01234567 89
`,
- `div :matchesOwn(^\d+$)`,
- []string{
- `
01234567 89
`,
- `
567 `,
- },
- },
- {
- `
`,
- `[href#=(fina)]:not([href#=(\/\/[^\/]+untrusted)])`,
- []string{
- `
`,
- `
`,
- },
- },
- {
- `
`,
- `[href#=(^https:\/\/[^\/]*\/?news)]`,
- []string{
- `
`,
- },
- },
- {
- `
`,
- `:input`,
- []string{
- `
`,
- `
`,
- `
- Canada
- United States
- `,
- `
`,
- `
Sign up `,
- },
- },
- {
- ``,
- ":root",
- []string{
- "",
- },
- },
- {
- ``,
- "*:root",
- []string{
- "",
- },
- },
- {
- ``,
- "*:root:first-child",
- []string{},
- },
- {
- ``,
- "*:root:nth-child(1)",
- []string{},
- },
- {
- `
`,
- "a:not(:root)",
- []string{
- `
`,
- },
- },
-}
-
-func TestSelectors(t *testing.T) {
- for _, test := range selectorTests {
- s, err := Compile(test.selector)
- if err != nil {
- t.Errorf("error compiling %q: %s", test.selector, err)
- continue
- }
-
- doc, err := html.Parse(strings.NewReader(test.HTML))
- if err != nil {
- t.Errorf("error parsing %q: %s", test.HTML, err)
- continue
- }
-
- matches := s.MatchAll(doc)
- if len(matches) != len(test.results) {
- t.Errorf("selector %s wanted %d elements, got %d instead", test.selector, len(test.results), len(matches))
- continue
- }
-
- for i, m := range matches {
- got := nodeString(m)
- if got != test.results[i] {
- t.Errorf("selector %s wanted %s, got %s instead", test.selector, test.results[i], got)
- }
- }
-
- firstMatch := s.MatchFirst(doc)
- if len(test.results) == 0 {
- if firstMatch != nil {
- t.Errorf("MatchFirst: selector %s want nil, got %s", test.selector, nodeString(firstMatch))
- }
- } else {
- got := nodeString(firstMatch)
- if got != test.results[0] {
- t.Errorf("MatchFirst: selector %s want %s, got %s", test.selector, test.results[0], got)
- }
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/.gitignore b/vendor/github.com/golang/protobuf/.gitignore
deleted file mode 100644
index c7dd4058..00000000
--- a/vendor/github.com/golang/protobuf/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-.DS_Store
-*.[568ao]
-*.ao
-*.so
-*.pyc
-._*
-.nfs.*
-[568a].out
-*~
-*.orig
-core
-_obj
-_test
-_testmain.go
-
-# Conformance test output and transient files.
-conformance/failing_tests.txt
diff --git a/vendor/github.com/golang/protobuf/.travis.yml b/vendor/github.com/golang/protobuf/.travis.yml
deleted file mode 100644
index 455fa660..00000000
--- a/vendor/github.com/golang/protobuf/.travis.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-sudo: false
-language: go
-go:
-- 1.6.x
-- 1.10.x
-- 1.x
-
-install:
- - go get -v -d -t github.com/golang/protobuf/...
- - curl -L https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip -o /tmp/protoc.zip
- - unzip /tmp/protoc.zip -d "$HOME"/protoc
- - mkdir -p "$HOME"/src && ln -s "$HOME"/protoc "$HOME"/src/protobuf
-
-env:
- - PATH=$HOME/protoc/bin:$PATH
-
-script:
- - make all
- - make regenerate
- # TODO(tamird): When https://github.com/travis-ci/gimme/pull/130 is
- # released, make this look for "1.x".
- - if [[ "$TRAVIS_GO_VERSION" == 1.10* ]]; then
- if [[ "$(git status --porcelain 2>&1)" != "" ]]; then
- git status >&2;
- git diff -a >&2;
- exit 1;
- fi;
- echo "git status is clean.";
- fi;
- - make test
diff --git a/vendor/github.com/golang/protobuf/Makefile b/vendor/github.com/golang/protobuf/Makefile
deleted file mode 100644
index 2bc2621a..00000000
--- a/vendor/github.com/golang/protobuf/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-# Go support for Protocol Buffers - Google's data interchange format
-#
-# Copyright 2010 The Go Authors. All rights reserved.
-# https://github.com/golang/protobuf
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-all: install
-
-install:
- go install ./proto ./jsonpb ./ptypes ./protoc-gen-go
-
-test:
- go test ./... ./protoc-gen-go/testdata
- make -C conformance test
-
-clean:
- go clean ./...
-
-nuke:
- go clean -i ./...
-
-regenerate:
- ./regenerate.sh
diff --git a/vendor/github.com/golang/protobuf/README.md b/vendor/github.com/golang/protobuf/README.md
deleted file mode 100644
index 01b29daf..00000000
--- a/vendor/github.com/golang/protobuf/README.md
+++ /dev/null
@@ -1,283 +0,0 @@
-# Go support for Protocol Buffers
-
-[![Build Status](https://travis-ci.org/golang/protobuf.svg?branch=master)](https://travis-ci.org/golang/protobuf)
-[![GoDoc](https://godoc.org/github.com/golang/protobuf?status.svg)](https://godoc.org/github.com/golang/protobuf)
-
-Google's data interchange format.
-Copyright 2010 The Go Authors.
-https://github.com/golang/protobuf
-
-This package and the code it generates requires at least Go 1.6.
-
-This software implements Go bindings for protocol buffers. For
-information about protocol buffers themselves, see
- https://developers.google.com/protocol-buffers/
-
-## Installation ##
-
-To use this software, you must:
-- Install the standard C++ implementation of protocol buffers from
- https://developers.google.com/protocol-buffers/
-- Of course, install the Go compiler and tools from
- https://golang.org/
- See
- https://golang.org/doc/install
- for details or, if you are using gccgo, follow the instructions at
- https://golang.org/doc/install/gccgo
-- Grab the code from the repository and install the proto package.
- The simplest way is to run `go get -u github.com/golang/protobuf/protoc-gen-go`.
- The compiler plugin, protoc-gen-go, will be installed in $GOBIN,
- defaulting to $GOPATH/bin. It must be in your $PATH for the protocol
- compiler, protoc, to find it.
-
-This software has two parts: a 'protocol compiler plugin' that
-generates Go source files that, once compiled, can access and manage
-protocol buffers; and a library that implements run-time support for
-encoding (marshaling), decoding (unmarshaling), and accessing protocol
-buffers.
-
-There is support for gRPC in Go using protocol buffers.
-See the note at the bottom of this file for details.
-
-There are no insertion points in the plugin.
-
-
-## Using protocol buffers with Go ##
-
-Once the software is installed, there are two steps to using it.
-First you must compile the protocol buffer definitions and then import
-them, with the support library, into your program.
-
-To compile the protocol buffer definition, run protoc with the --go_out
-parameter set to the directory you want to output the Go code to.
-
- protoc --go_out=. *.proto
-
-The generated files will be suffixed .pb.go. See the Test code below
-for an example using such a file.
-
-## Packages and input paths ##
-
-The protocol buffer language has a concept of "packages" which does not
-correspond well to the Go notion of packages. In generated Go code,
-each source `.proto` file is associated with a single Go package. The
-name and import path for this package is specified with the `go_package`
-proto option:
-
- option go_package = "github.com/golang/protobuf/ptypes/any";
-
-The protocol buffer compiler will attempt to derive a package name and
-import path if a `go_package` option is not present, but it is
-best to always specify one explicitly.
-
-There is a one-to-one relationship between source `.proto` files and
-generated `.pb.go` files, but any number of `.pb.go` files may be
-contained in the same Go package.
-
-The output name of a generated file is produced by replacing the
-`.proto` suffix with `.pb.go` (e.g., `foo.proto` produces `foo.pb.go`).
-However, the output directory is selected in one of two ways. Let
-us say we have `inputs/x.proto` with a `go_package` option of
-`github.com/golang/protobuf/p`. The corresponding output file may
-be:
-
-- Relative to the import path:
-
- protoc --go_out=. inputs/x.proto
- # writes ./github.com/golang/protobuf/p/x.pb.go
-
- (This can work well with `--go_out=$GOPATH`.)
-
-- Relative to the input file:
-
- protoc --go_out=paths=source_relative:. inputs/x.proto
- # generate ./inputs/x.pb.go
-
-## Generated code ##
-
-The package comment for the proto library contains text describing
-the interface provided in Go for protocol buffers. Here is an edited
-version.
-
-The proto package converts data structures to and from the
-wire format of protocol buffers. It works in concert with the
-Go source code generated for .proto files by the protocol compiler.
-
-A summary of the properties of the protocol buffer interface
-for a protocol buffer variable v:
-
- - Names are turned from camel_case to CamelCase for export.
- - There are no methods on v to set fields; just treat
- them as structure fields.
- - There are getters that return a field's value if set,
- and return the field's default value if unset.
- The getters work even if the receiver is a nil message.
- - The zero value for a struct is its correct initialization state.
- All desired fields must be set before marshaling.
- - A Reset() method will restore a protobuf struct to its zero state.
- - Non-repeated fields are pointers to the values; nil means unset.
- That is, optional or required field int32 f becomes F *int32.
- - Repeated fields are slices.
- - Helper functions are available to aid the setting of fields.
- Helpers for getting values are superseded by the
- GetFoo methods and their use is deprecated.
- msg.Foo = proto.String("hello") // set field
- - Constants are defined to hold the default values of all fields that
- have them. They have the form Default_StructName_FieldName.
- Because the getter methods handle defaulted values,
- direct use of these constants should be rare.
- - Enums are given type names and maps from names to values.
- Enum values are prefixed with the enum's type name. Enum types have
- a String method, and a Enum method to assist in message construction.
- - Nested groups and enums have type names prefixed with the name of
- the surrounding message type.
- - Extensions are given descriptor names that start with E_,
- followed by an underscore-delimited list of the nested messages
- 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.
-
-When the .proto file specifies `syntax="proto3"`, there are some differences:
-
- - Non-repeated fields of non-message type are values instead of pointers.
- - Enum types do not get an Enum method.
-
-Consider file test.proto, containing
-
-```proto
- syntax = "proto2";
- package example;
-
- enum FOO { X = 17; };
-
- message Test {
- required string label = 1;
- optional int32 type = 2 [default=77];
- repeated int64 reps = 3;
- optional group OptionalGroup = 4 {
- required string RequiredField = 5;
- }
- }
-```
-
-To create and play with a Test object from the example package,
-
-```go
- package main
-
- import (
- "log"
-
- "github.com/golang/protobuf/proto"
- "path/to/example"
- )
-
- func main() {
- test := &example.Test {
- Label: proto.String("hello"),
- Type: proto.Int32(17),
- Reps: []int64{1, 2, 3},
- Optionalgroup: &example.Test_OptionalGroup {
- RequiredField: proto.String("good bye"),
- },
- }
- data, err := proto.Marshal(test)
- if err != nil {
- log.Fatal("marshaling error: ", err)
- }
- newTest := &example.Test{}
- err = proto.Unmarshal(data, newTest)
- if err != nil {
- log.Fatal("unmarshaling error: ", err)
- }
- // Now test and newTest contain the same data.
- if test.GetLabel() != newTest.GetLabel() {
- log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel())
- }
- // etc.
- }
-```
-
-## Parameters ##
-
-To pass extra parameters to the plugin, use a comma-separated
-parameter list separated from the output directory by a colon:
-
- protoc --go_out=plugins=grpc,import_path=mypackage:. *.proto
-
-- `paths=(import | source_relative)` - specifies how the paths of
- generated files are structured. See the "Packages and imports paths"
- section above. The default is `import`.
-- `plugins=plugin1+plugin2` - specifies the list of sub-plugins to
- load. The only plugin in this repo is `grpc`.
-- `Mfoo/bar.proto=quux/shme` - declares that foo/bar.proto is
- associated with Go package quux/shme. This is subject to the
- import_prefix parameter.
-
-The following parameters are deprecated and should not be used:
-
-- `import_prefix=xxx` - a prefix that is added onto the beginning of
- all imports.
-- `import_path=foo/bar` - used as the package if no input files
- declare `go_package`. If it contains slashes, everything up to the
- rightmost slash is ignored.
-
-## gRPC Support ##
-
-If a proto file specifies RPC services, protoc-gen-go can be instructed to
-generate code compatible with gRPC (http://www.grpc.io/). To do this, pass
-the `plugins` parameter to protoc-gen-go; the usual way is to insert it into
-the --go_out argument to protoc:
-
- protoc --go_out=plugins=grpc:. *.proto
-
-## Compatibility ##
-
-The library and the generated code are expected to be stable over time.
-However, we reserve the right to make breaking changes without notice for the
-following reasons:
-
-- Security. A security issue in the specification or implementation may come to
- light whose resolution requires breaking compatibility. We reserve the right
- to address such security issues.
-- Unspecified behavior. There are some aspects of the Protocol Buffers
- specification that are undefined. Programs that depend on such unspecified
- behavior may break in future releases.
-- Specification errors or changes. If it becomes necessary to address an
- inconsistency, incompleteness, or change in the Protocol Buffers
- specification, resolving the issue could affect the meaning or legality of
- existing programs. We reserve the right to address such issues, including
- updating the implementations.
-- Bugs. If the library has a bug that violates the specification, a program
- that depends on the buggy behavior may break if the bug is fixed. We reserve
- the right to fix such bugs.
-- Adding methods or fields to generated structs. These may conflict with field
- names that already exist in a schema, causing applications to break. When the
- code generator encounters a field in the schema that would collide with a
- generated field or method name, the code generator will append an underscore
- to the generated field or method name.
-- Adding, removing, or changing methods or fields in generated structs that
- start with `XXX`. These parts of the generated code are exported out of
- necessity, but should not be considered part of the public API.
-- Adding, removing, or changing unexported symbols in generated code.
-
-Any breaking changes outside of these will be announced 6 months in advance to
-protobuf@googlegroups.com.
-
-You should, whenever possible, use generated code created by the `protoc-gen-go`
-tool built at the same commit as the `proto` package. The `proto` package
-declares package-level constants in the form `ProtoPackageIsVersionX`.
-Application code and generated code may depend on one of these constants to
-ensure that compilation will fail if the available version of the proto library
-is too old. Whenever we make a change to the generated code that requires newer
-library support, in the same commit we will increment the version number of the
-generated code and declare a new package-level constant whose name incorporates
-the latest version number. Removing a compatibility constant is considered a
-breaking change and would be subject to the announcement policy stated above.
-
-The `protoc-gen-go/generator` package exposes a plugin interface,
-which is used by the gRPC code generation. This interface is not
-supported and is subject to incompatible changes without notice.
diff --git a/vendor/github.com/golang/protobuf/conformance/Makefile b/vendor/github.com/golang/protobuf/conformance/Makefile
deleted file mode 100644
index b99e4ed6..00000000
--- a/vendor/github.com/golang/protobuf/conformance/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-# Go support for Protocol Buffers - Google's data interchange format
-#
-# Copyright 2016 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.
-
-PROTOBUF_ROOT=$(HOME)/src/protobuf
-
-all:
- @echo To run the tests in this directory, acquire the main protobuf
- @echo distribution from:
- @echo
- @echo ' https://github.com/google/protobuf'
- @echo
- @echo Build the test runner with:
- @echo
- @echo ' cd conformance && make conformance-test-runner'
- @echo
- @echo And run the tests in this directory with:
- @echo
- @echo ' make test PROTOBUF_ROOT=
'
-
-test:
- ./test.sh $(PROTOBUF_ROOT)
diff --git a/vendor/github.com/golang/protobuf/conformance/conformance.go b/vendor/github.com/golang/protobuf/conformance/conformance.go
deleted file mode 100644
index 3029312a..00000000
--- a/vendor/github.com/golang/protobuf/conformance/conformance.go
+++ /dev/null
@@ -1,154 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-// conformance implements the conformance test subprocess protocol as
-// documented in conformance.proto.
-package main
-
-import (
- "encoding/binary"
- "fmt"
- "io"
- "os"
-
- pb "github.com/golang/protobuf/conformance/internal/conformance_proto"
- "github.com/golang/protobuf/jsonpb"
- "github.com/golang/protobuf/proto"
-)
-
-func main() {
- var sizeBuf [4]byte
- inbuf := make([]byte, 0, 4096)
- outbuf := proto.NewBuffer(nil)
- for {
- if _, err := io.ReadFull(os.Stdin, sizeBuf[:]); err == io.EOF {
- break
- } else if err != nil {
- fmt.Fprintln(os.Stderr, "go conformance: read request:", err)
- os.Exit(1)
- }
- size := binary.LittleEndian.Uint32(sizeBuf[:])
- if int(size) > cap(inbuf) {
- inbuf = make([]byte, size)
- }
- inbuf = inbuf[:size]
- if _, err := io.ReadFull(os.Stdin, inbuf); err != nil {
- fmt.Fprintln(os.Stderr, "go conformance: read request:", err)
- os.Exit(1)
- }
-
- req := new(pb.ConformanceRequest)
- if err := proto.Unmarshal(inbuf, req); err != nil {
- fmt.Fprintln(os.Stderr, "go conformance: parse request:", err)
- os.Exit(1)
- }
- res := handle(req)
-
- if err := outbuf.Marshal(res); err != nil {
- fmt.Fprintln(os.Stderr, "go conformance: marshal response:", err)
- os.Exit(1)
- }
- binary.LittleEndian.PutUint32(sizeBuf[:], uint32(len(outbuf.Bytes())))
- if _, err := os.Stdout.Write(sizeBuf[:]); err != nil {
- fmt.Fprintln(os.Stderr, "go conformance: write response:", err)
- os.Exit(1)
- }
- if _, err := os.Stdout.Write(outbuf.Bytes()); err != nil {
- fmt.Fprintln(os.Stderr, "go conformance: write response:", err)
- os.Exit(1)
- }
- outbuf.Reset()
- }
-}
-
-var jsonMarshaler = jsonpb.Marshaler{
- OrigName: true,
-}
-
-func handle(req *pb.ConformanceRequest) *pb.ConformanceResponse {
- var err error
- var msg pb.TestAllTypes
- switch p := req.Payload.(type) {
- case *pb.ConformanceRequest_ProtobufPayload:
- err = proto.Unmarshal(p.ProtobufPayload, &msg)
- case *pb.ConformanceRequest_JsonPayload:
- err = jsonpb.UnmarshalString(p.JsonPayload, &msg)
- default:
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_RuntimeError{
- RuntimeError: "unknown request payload type",
- },
- }
- }
- if err != nil {
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_ParseError{
- ParseError: err.Error(),
- },
- }
- }
- switch req.RequestedOutputFormat {
- case pb.WireFormat_PROTOBUF:
- p, err := proto.Marshal(&msg)
- if err != nil {
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_SerializeError{
- SerializeError: err.Error(),
- },
- }
- }
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_ProtobufPayload{
- ProtobufPayload: p,
- },
- }
- case pb.WireFormat_JSON:
- p, err := jsonMarshaler.MarshalToString(&msg)
- if err != nil {
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_SerializeError{
- SerializeError: err.Error(),
- },
- }
- }
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_JsonPayload{
- JsonPayload: p,
- },
- }
- default:
- return &pb.ConformanceResponse{
- Result: &pb.ConformanceResponse_RuntimeError{
- RuntimeError: "unknown output format",
- },
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/conformance/conformance.sh b/vendor/github.com/golang/protobuf/conformance/conformance.sh
deleted file mode 100755
index 8532f571..00000000
--- a/vendor/github.com/golang/protobuf/conformance/conformance.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-cd $(dirname $0)
-exec go run conformance.go $*
diff --git a/vendor/github.com/golang/protobuf/conformance/failure_list_go.txt b/vendor/github.com/golang/protobuf/conformance/failure_list_go.txt
deleted file mode 100644
index d3728089..00000000
--- a/vendor/github.com/golang/protobuf/conformance/failure_list_go.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-# This is the list of conformance tests that are known ot fail right now.
-# TODO: These should be fixed.
-
-DurationProtoInputTooLarge.JsonOutput
-DurationProtoInputTooSmall.JsonOutput
-FieldMaskNumbersDontRoundTrip.JsonOutput
-FieldMaskPathsDontRoundTrip.JsonOutput
-FieldMaskTooManyUnderscore.JsonOutput
-JsonInput.AnyWithFieldMask.JsonOutput
-JsonInput.AnyWithFieldMask.ProtobufOutput
-JsonInput.DoubleFieldQuotedValue.JsonOutput
-JsonInput.DoubleFieldQuotedValue.ProtobufOutput
-JsonInput.DurationHas3FractionalDigits.Validator
-JsonInput.DurationHas6FractionalDigits.Validator
-JsonInput.DurationHas9FractionalDigits.Validator
-JsonInput.DurationHasZeroFractionalDigit.Validator
-JsonInput.DurationMaxValue.JsonOutput
-JsonInput.DurationMaxValue.ProtobufOutput
-JsonInput.DurationMinValue.JsonOutput
-JsonInput.DurationMinValue.ProtobufOutput
-JsonInput.EnumFieldUnknownValue.Validator
-JsonInput.FieldMask.JsonOutput
-JsonInput.FieldMask.ProtobufOutput
-JsonInput.FieldNameInLowerCamelCase.Validator
-JsonInput.FieldNameWithMixedCases.JsonOutput
-JsonInput.FieldNameWithMixedCases.ProtobufOutput
-JsonInput.FieldNameWithMixedCases.Validator
-JsonInput.FieldNameWithNumbers.Validator
-JsonInput.FloatFieldQuotedValue.JsonOutput
-JsonInput.FloatFieldQuotedValue.ProtobufOutput
-JsonInput.Int32FieldExponentialFormat.JsonOutput
-JsonInput.Int32FieldExponentialFormat.ProtobufOutput
-JsonInput.Int32FieldFloatTrailingZero.JsonOutput
-JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput
-JsonInput.Int32FieldMaxFloatValue.JsonOutput
-JsonInput.Int32FieldMaxFloatValue.ProtobufOutput
-JsonInput.Int32FieldMinFloatValue.JsonOutput
-JsonInput.Int32FieldMinFloatValue.ProtobufOutput
-JsonInput.Int32FieldStringValue.JsonOutput
-JsonInput.Int32FieldStringValue.ProtobufOutput
-JsonInput.Int32FieldStringValueEscaped.JsonOutput
-JsonInput.Int32FieldStringValueEscaped.ProtobufOutput
-JsonInput.Int64FieldBeString.Validator
-JsonInput.MapFieldValueIsNull
-JsonInput.OneofFieldDuplicate
-JsonInput.RepeatedFieldMessageElementIsNull
-JsonInput.RepeatedFieldPrimitiveElementIsNull
-JsonInput.StringFieldSurrogateInWrongOrder
-JsonInput.StringFieldUnpairedHighSurrogate
-JsonInput.StringFieldUnpairedLowSurrogate
-JsonInput.TimestampHas3FractionalDigits.Validator
-JsonInput.TimestampHas6FractionalDigits.Validator
-JsonInput.TimestampHas9FractionalDigits.Validator
-JsonInput.TimestampHasZeroFractionalDigit.Validator
-JsonInput.TimestampJsonInputTooSmall
-JsonInput.TimestampZeroNormalized.Validator
-JsonInput.Uint32FieldMaxFloatValue.JsonOutput
-JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput
-JsonInput.Uint64FieldBeString.Validator
-TimestampProtoInputTooLarge.JsonOutput
-TimestampProtoInputTooSmall.JsonOutput
diff --git a/vendor/github.com/golang/protobuf/conformance/internal/conformance_proto/conformance.pb.go b/vendor/github.com/golang/protobuf/conformance/internal/conformance_proto/conformance.pb.go
deleted file mode 100644
index 82d45412..00000000
--- a/vendor/github.com/golang/protobuf/conformance/internal/conformance_proto/conformance.pb.go
+++ /dev/null
@@ -1,1816 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: conformance.proto
-
-package conformance
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import any "github.com/golang/protobuf/ptypes/any"
-import duration "github.com/golang/protobuf/ptypes/duration"
-import _struct "github.com/golang/protobuf/ptypes/struct"
-import timestamp "github.com/golang/protobuf/ptypes/timestamp"
-import wrappers "github.com/golang/protobuf/ptypes/wrappers"
-import field_mask "google.golang.org/genproto/protobuf/field_mask"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type WireFormat int32
-
-const (
- WireFormat_UNSPECIFIED WireFormat = 0
- WireFormat_PROTOBUF WireFormat = 1
- WireFormat_JSON WireFormat = 2
-)
-
-var WireFormat_name = map[int32]string{
- 0: "UNSPECIFIED",
- 1: "PROTOBUF",
- 2: "JSON",
-}
-var WireFormat_value = map[string]int32{
- "UNSPECIFIED": 0,
- "PROTOBUF": 1,
- "JSON": 2,
-}
-
-func (x WireFormat) String() string {
- return proto.EnumName(WireFormat_name, int32(x))
-}
-func (WireFormat) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{0}
-}
-
-type ForeignEnum int32
-
-const (
- ForeignEnum_FOREIGN_FOO ForeignEnum = 0
- ForeignEnum_FOREIGN_BAR ForeignEnum = 1
- ForeignEnum_FOREIGN_BAZ ForeignEnum = 2
-)
-
-var ForeignEnum_name = map[int32]string{
- 0: "FOREIGN_FOO",
- 1: "FOREIGN_BAR",
- 2: "FOREIGN_BAZ",
-}
-var ForeignEnum_value = map[string]int32{
- "FOREIGN_FOO": 0,
- "FOREIGN_BAR": 1,
- "FOREIGN_BAZ": 2,
-}
-
-func (x ForeignEnum) String() string {
- return proto.EnumName(ForeignEnum_name, int32(x))
-}
-func (ForeignEnum) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{1}
-}
-
-type TestAllTypes_NestedEnum int32
-
-const (
- TestAllTypes_FOO TestAllTypes_NestedEnum = 0
- TestAllTypes_BAR TestAllTypes_NestedEnum = 1
- TestAllTypes_BAZ TestAllTypes_NestedEnum = 2
- TestAllTypes_NEG TestAllTypes_NestedEnum = -1
-)
-
-var TestAllTypes_NestedEnum_name = map[int32]string{
- 0: "FOO",
- 1: "BAR",
- 2: "BAZ",
- -1: "NEG",
-}
-var TestAllTypes_NestedEnum_value = map[string]int32{
- "FOO": 0,
- "BAR": 1,
- "BAZ": 2,
- "NEG": -1,
-}
-
-func (x TestAllTypes_NestedEnum) String() string {
- return proto.EnumName(TestAllTypes_NestedEnum_name, int32(x))
-}
-func (TestAllTypes_NestedEnum) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{2, 0}
-}
-
-// Represents a single test case's input. The testee should:
-//
-// 1. parse this proto (which should always succeed)
-// 2. parse the protobuf or JSON payload in "payload" (which may fail)
-// 3. if the parse succeeded, serialize the message in the requested format.
-type ConformanceRequest struct {
- // The payload (whether protobuf of JSON) is always for a TestAllTypes proto
- // (see below).
- //
- // Types that are valid to be assigned to Payload:
- // *ConformanceRequest_ProtobufPayload
- // *ConformanceRequest_JsonPayload
- Payload isConformanceRequest_Payload `protobuf_oneof:"payload"`
- // Which format should the testee serialize its message to?
- RequestedOutputFormat WireFormat `protobuf:"varint,3,opt,name=requested_output_format,json=requestedOutputFormat,enum=conformance.WireFormat" json:"requested_output_format,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ConformanceRequest) Reset() { *m = ConformanceRequest{} }
-func (m *ConformanceRequest) String() string { return proto.CompactTextString(m) }
-func (*ConformanceRequest) ProtoMessage() {}
-func (*ConformanceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{0}
-}
-func (m *ConformanceRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ConformanceRequest.Unmarshal(m, b)
-}
-func (m *ConformanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ConformanceRequest.Marshal(b, m, deterministic)
-}
-func (dst *ConformanceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConformanceRequest.Merge(dst, src)
-}
-func (m *ConformanceRequest) XXX_Size() int {
- return xxx_messageInfo_ConformanceRequest.Size(m)
-}
-func (m *ConformanceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ConformanceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConformanceRequest proto.InternalMessageInfo
-
-type isConformanceRequest_Payload interface {
- isConformanceRequest_Payload()
-}
-
-type ConformanceRequest_ProtobufPayload struct {
- ProtobufPayload []byte `protobuf:"bytes,1,opt,name=protobuf_payload,json=protobufPayload,proto3,oneof"`
-}
-type ConformanceRequest_JsonPayload struct {
- JsonPayload string `protobuf:"bytes,2,opt,name=json_payload,json=jsonPayload,oneof"`
-}
-
-func (*ConformanceRequest_ProtobufPayload) isConformanceRequest_Payload() {}
-func (*ConformanceRequest_JsonPayload) isConformanceRequest_Payload() {}
-
-func (m *ConformanceRequest) GetPayload() isConformanceRequest_Payload {
- if m != nil {
- return m.Payload
- }
- return nil
-}
-
-func (m *ConformanceRequest) GetProtobufPayload() []byte {
- if x, ok := m.GetPayload().(*ConformanceRequest_ProtobufPayload); ok {
- return x.ProtobufPayload
- }
- return nil
-}
-
-func (m *ConformanceRequest) GetJsonPayload() string {
- if x, ok := m.GetPayload().(*ConformanceRequest_JsonPayload); ok {
- return x.JsonPayload
- }
- return ""
-}
-
-func (m *ConformanceRequest) GetRequestedOutputFormat() WireFormat {
- if m != nil {
- return m.RequestedOutputFormat
- }
- return WireFormat_UNSPECIFIED
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*ConformanceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _ConformanceRequest_OneofMarshaler, _ConformanceRequest_OneofUnmarshaler, _ConformanceRequest_OneofSizer, []interface{}{
- (*ConformanceRequest_ProtobufPayload)(nil),
- (*ConformanceRequest_JsonPayload)(nil),
- }
-}
-
-func _ConformanceRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*ConformanceRequest)
- // payload
- switch x := m.Payload.(type) {
- case *ConformanceRequest_ProtobufPayload:
- b.EncodeVarint(1<<3 | proto.WireBytes)
- b.EncodeRawBytes(x.ProtobufPayload)
- case *ConformanceRequest_JsonPayload:
- b.EncodeVarint(2<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.JsonPayload)
- case nil:
- default:
- return fmt.Errorf("ConformanceRequest.Payload has unexpected type %T", x)
- }
- return nil
-}
-
-func _ConformanceRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*ConformanceRequest)
- switch tag {
- case 1: // payload.protobuf_payload
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeRawBytes(true)
- m.Payload = &ConformanceRequest_ProtobufPayload{x}
- return true, err
- case 2: // payload.json_payload
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Payload = &ConformanceRequest_JsonPayload{x}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _ConformanceRequest_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*ConformanceRequest)
- // payload
- switch x := m.Payload.(type) {
- case *ConformanceRequest_ProtobufPayload:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.ProtobufPayload)))
- n += len(x.ProtobufPayload)
- case *ConformanceRequest_JsonPayload:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.JsonPayload)))
- n += len(x.JsonPayload)
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-// Represents a single test case's output.
-type ConformanceResponse struct {
- // Types that are valid to be assigned to Result:
- // *ConformanceResponse_ParseError
- // *ConformanceResponse_SerializeError
- // *ConformanceResponse_RuntimeError
- // *ConformanceResponse_ProtobufPayload
- // *ConformanceResponse_JsonPayload
- // *ConformanceResponse_Skipped
- Result isConformanceResponse_Result `protobuf_oneof:"result"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ConformanceResponse) Reset() { *m = ConformanceResponse{} }
-func (m *ConformanceResponse) String() string { return proto.CompactTextString(m) }
-func (*ConformanceResponse) ProtoMessage() {}
-func (*ConformanceResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{1}
-}
-func (m *ConformanceResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ConformanceResponse.Unmarshal(m, b)
-}
-func (m *ConformanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ConformanceResponse.Marshal(b, m, deterministic)
-}
-func (dst *ConformanceResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConformanceResponse.Merge(dst, src)
-}
-func (m *ConformanceResponse) XXX_Size() int {
- return xxx_messageInfo_ConformanceResponse.Size(m)
-}
-func (m *ConformanceResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ConformanceResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConformanceResponse proto.InternalMessageInfo
-
-type isConformanceResponse_Result interface {
- isConformanceResponse_Result()
-}
-
-type ConformanceResponse_ParseError struct {
- ParseError string `protobuf:"bytes,1,opt,name=parse_error,json=parseError,oneof"`
-}
-type ConformanceResponse_SerializeError struct {
- SerializeError string `protobuf:"bytes,6,opt,name=serialize_error,json=serializeError,oneof"`
-}
-type ConformanceResponse_RuntimeError struct {
- RuntimeError string `protobuf:"bytes,2,opt,name=runtime_error,json=runtimeError,oneof"`
-}
-type ConformanceResponse_ProtobufPayload struct {
- ProtobufPayload []byte `protobuf:"bytes,3,opt,name=protobuf_payload,json=protobufPayload,proto3,oneof"`
-}
-type ConformanceResponse_JsonPayload struct {
- JsonPayload string `protobuf:"bytes,4,opt,name=json_payload,json=jsonPayload,oneof"`
-}
-type ConformanceResponse_Skipped struct {
- Skipped string `protobuf:"bytes,5,opt,name=skipped,oneof"`
-}
-
-func (*ConformanceResponse_ParseError) isConformanceResponse_Result() {}
-func (*ConformanceResponse_SerializeError) isConformanceResponse_Result() {}
-func (*ConformanceResponse_RuntimeError) isConformanceResponse_Result() {}
-func (*ConformanceResponse_ProtobufPayload) isConformanceResponse_Result() {}
-func (*ConformanceResponse_JsonPayload) isConformanceResponse_Result() {}
-func (*ConformanceResponse_Skipped) isConformanceResponse_Result() {}
-
-func (m *ConformanceResponse) GetResult() isConformanceResponse_Result {
- if m != nil {
- return m.Result
- }
- return nil
-}
-
-func (m *ConformanceResponse) GetParseError() string {
- if x, ok := m.GetResult().(*ConformanceResponse_ParseError); ok {
- return x.ParseError
- }
- return ""
-}
-
-func (m *ConformanceResponse) GetSerializeError() string {
- if x, ok := m.GetResult().(*ConformanceResponse_SerializeError); ok {
- return x.SerializeError
- }
- return ""
-}
-
-func (m *ConformanceResponse) GetRuntimeError() string {
- if x, ok := m.GetResult().(*ConformanceResponse_RuntimeError); ok {
- return x.RuntimeError
- }
- return ""
-}
-
-func (m *ConformanceResponse) GetProtobufPayload() []byte {
- if x, ok := m.GetResult().(*ConformanceResponse_ProtobufPayload); ok {
- return x.ProtobufPayload
- }
- return nil
-}
-
-func (m *ConformanceResponse) GetJsonPayload() string {
- if x, ok := m.GetResult().(*ConformanceResponse_JsonPayload); ok {
- return x.JsonPayload
- }
- return ""
-}
-
-func (m *ConformanceResponse) GetSkipped() string {
- if x, ok := m.GetResult().(*ConformanceResponse_Skipped); ok {
- return x.Skipped
- }
- return ""
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*ConformanceResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _ConformanceResponse_OneofMarshaler, _ConformanceResponse_OneofUnmarshaler, _ConformanceResponse_OneofSizer, []interface{}{
- (*ConformanceResponse_ParseError)(nil),
- (*ConformanceResponse_SerializeError)(nil),
- (*ConformanceResponse_RuntimeError)(nil),
- (*ConformanceResponse_ProtobufPayload)(nil),
- (*ConformanceResponse_JsonPayload)(nil),
- (*ConformanceResponse_Skipped)(nil),
- }
-}
-
-func _ConformanceResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*ConformanceResponse)
- // result
- switch x := m.Result.(type) {
- case *ConformanceResponse_ParseError:
- b.EncodeVarint(1<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.ParseError)
- case *ConformanceResponse_SerializeError:
- b.EncodeVarint(6<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.SerializeError)
- case *ConformanceResponse_RuntimeError:
- b.EncodeVarint(2<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.RuntimeError)
- case *ConformanceResponse_ProtobufPayload:
- b.EncodeVarint(3<<3 | proto.WireBytes)
- b.EncodeRawBytes(x.ProtobufPayload)
- case *ConformanceResponse_JsonPayload:
- b.EncodeVarint(4<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.JsonPayload)
- case *ConformanceResponse_Skipped:
- b.EncodeVarint(5<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.Skipped)
- case nil:
- default:
- return fmt.Errorf("ConformanceResponse.Result has unexpected type %T", x)
- }
- return nil
-}
-
-func _ConformanceResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*ConformanceResponse)
- switch tag {
- case 1: // result.parse_error
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Result = &ConformanceResponse_ParseError{x}
- return true, err
- case 6: // result.serialize_error
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Result = &ConformanceResponse_SerializeError{x}
- return true, err
- case 2: // result.runtime_error
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Result = &ConformanceResponse_RuntimeError{x}
- return true, err
- case 3: // result.protobuf_payload
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeRawBytes(true)
- m.Result = &ConformanceResponse_ProtobufPayload{x}
- return true, err
- case 4: // result.json_payload
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Result = &ConformanceResponse_JsonPayload{x}
- return true, err
- case 5: // result.skipped
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Result = &ConformanceResponse_Skipped{x}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _ConformanceResponse_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*ConformanceResponse)
- // result
- switch x := m.Result.(type) {
- case *ConformanceResponse_ParseError:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.ParseError)))
- n += len(x.ParseError)
- case *ConformanceResponse_SerializeError:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.SerializeError)))
- n += len(x.SerializeError)
- case *ConformanceResponse_RuntimeError:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.RuntimeError)))
- n += len(x.RuntimeError)
- case *ConformanceResponse_ProtobufPayload:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.ProtobufPayload)))
- n += len(x.ProtobufPayload)
- case *ConformanceResponse_JsonPayload:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.JsonPayload)))
- n += len(x.JsonPayload)
- case *ConformanceResponse_Skipped:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Skipped)))
- n += len(x.Skipped)
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-// This proto includes every type of field in both singular and repeated
-// forms.
-type TestAllTypes struct {
- // Singular
- OptionalInt32 int32 `protobuf:"varint,1,opt,name=optional_int32,json=optionalInt32" json:"optional_int32,omitempty"`
- OptionalInt64 int64 `protobuf:"varint,2,opt,name=optional_int64,json=optionalInt64" json:"optional_int64,omitempty"`
- OptionalUint32 uint32 `protobuf:"varint,3,opt,name=optional_uint32,json=optionalUint32" json:"optional_uint32,omitempty"`
- OptionalUint64 uint64 `protobuf:"varint,4,opt,name=optional_uint64,json=optionalUint64" json:"optional_uint64,omitempty"`
- OptionalSint32 int32 `protobuf:"zigzag32,5,opt,name=optional_sint32,json=optionalSint32" json:"optional_sint32,omitempty"`
- OptionalSint64 int64 `protobuf:"zigzag64,6,opt,name=optional_sint64,json=optionalSint64" json:"optional_sint64,omitempty"`
- OptionalFixed32 uint32 `protobuf:"fixed32,7,opt,name=optional_fixed32,json=optionalFixed32" json:"optional_fixed32,omitempty"`
- OptionalFixed64 uint64 `protobuf:"fixed64,8,opt,name=optional_fixed64,json=optionalFixed64" json:"optional_fixed64,omitempty"`
- OptionalSfixed32 int32 `protobuf:"fixed32,9,opt,name=optional_sfixed32,json=optionalSfixed32" json:"optional_sfixed32,omitempty"`
- OptionalSfixed64 int64 `protobuf:"fixed64,10,opt,name=optional_sfixed64,json=optionalSfixed64" json:"optional_sfixed64,omitempty"`
- OptionalFloat float32 `protobuf:"fixed32,11,opt,name=optional_float,json=optionalFloat" json:"optional_float,omitempty"`
- OptionalDouble float64 `protobuf:"fixed64,12,opt,name=optional_double,json=optionalDouble" json:"optional_double,omitempty"`
- OptionalBool bool `protobuf:"varint,13,opt,name=optional_bool,json=optionalBool" json:"optional_bool,omitempty"`
- OptionalString string `protobuf:"bytes,14,opt,name=optional_string,json=optionalString" json:"optional_string,omitempty"`
- OptionalBytes []byte `protobuf:"bytes,15,opt,name=optional_bytes,json=optionalBytes,proto3" json:"optional_bytes,omitempty"`
- OptionalNestedMessage *TestAllTypes_NestedMessage `protobuf:"bytes,18,opt,name=optional_nested_message,json=optionalNestedMessage" json:"optional_nested_message,omitempty"`
- OptionalForeignMessage *ForeignMessage `protobuf:"bytes,19,opt,name=optional_foreign_message,json=optionalForeignMessage" json:"optional_foreign_message,omitempty"`
- OptionalNestedEnum TestAllTypes_NestedEnum `protobuf:"varint,21,opt,name=optional_nested_enum,json=optionalNestedEnum,enum=conformance.TestAllTypes_NestedEnum" json:"optional_nested_enum,omitempty"`
- OptionalForeignEnum ForeignEnum `protobuf:"varint,22,opt,name=optional_foreign_enum,json=optionalForeignEnum,enum=conformance.ForeignEnum" json:"optional_foreign_enum,omitempty"`
- OptionalStringPiece string `protobuf:"bytes,24,opt,name=optional_string_piece,json=optionalStringPiece" json:"optional_string_piece,omitempty"`
- OptionalCord string `protobuf:"bytes,25,opt,name=optional_cord,json=optionalCord" json:"optional_cord,omitempty"`
- RecursiveMessage *TestAllTypes `protobuf:"bytes,27,opt,name=recursive_message,json=recursiveMessage" json:"recursive_message,omitempty"`
- // Repeated
- RepeatedInt32 []int32 `protobuf:"varint,31,rep,packed,name=repeated_int32,json=repeatedInt32" json:"repeated_int32,omitempty"`
- RepeatedInt64 []int64 `protobuf:"varint,32,rep,packed,name=repeated_int64,json=repeatedInt64" json:"repeated_int64,omitempty"`
- RepeatedUint32 []uint32 `protobuf:"varint,33,rep,packed,name=repeated_uint32,json=repeatedUint32" json:"repeated_uint32,omitempty"`
- RepeatedUint64 []uint64 `protobuf:"varint,34,rep,packed,name=repeated_uint64,json=repeatedUint64" json:"repeated_uint64,omitempty"`
- RepeatedSint32 []int32 `protobuf:"zigzag32,35,rep,packed,name=repeated_sint32,json=repeatedSint32" json:"repeated_sint32,omitempty"`
- RepeatedSint64 []int64 `protobuf:"zigzag64,36,rep,packed,name=repeated_sint64,json=repeatedSint64" json:"repeated_sint64,omitempty"`
- RepeatedFixed32 []uint32 `protobuf:"fixed32,37,rep,packed,name=repeated_fixed32,json=repeatedFixed32" json:"repeated_fixed32,omitempty"`
- RepeatedFixed64 []uint64 `protobuf:"fixed64,38,rep,packed,name=repeated_fixed64,json=repeatedFixed64" json:"repeated_fixed64,omitempty"`
- RepeatedSfixed32 []int32 `protobuf:"fixed32,39,rep,packed,name=repeated_sfixed32,json=repeatedSfixed32" json:"repeated_sfixed32,omitempty"`
- RepeatedSfixed64 []int64 `protobuf:"fixed64,40,rep,packed,name=repeated_sfixed64,json=repeatedSfixed64" json:"repeated_sfixed64,omitempty"`
- RepeatedFloat []float32 `protobuf:"fixed32,41,rep,packed,name=repeated_float,json=repeatedFloat" json:"repeated_float,omitempty"`
- RepeatedDouble []float64 `protobuf:"fixed64,42,rep,packed,name=repeated_double,json=repeatedDouble" json:"repeated_double,omitempty"`
- RepeatedBool []bool `protobuf:"varint,43,rep,packed,name=repeated_bool,json=repeatedBool" json:"repeated_bool,omitempty"`
- RepeatedString []string `protobuf:"bytes,44,rep,name=repeated_string,json=repeatedString" json:"repeated_string,omitempty"`
- RepeatedBytes [][]byte `protobuf:"bytes,45,rep,name=repeated_bytes,json=repeatedBytes,proto3" json:"repeated_bytes,omitempty"`
- RepeatedNestedMessage []*TestAllTypes_NestedMessage `protobuf:"bytes,48,rep,name=repeated_nested_message,json=repeatedNestedMessage" json:"repeated_nested_message,omitempty"`
- RepeatedForeignMessage []*ForeignMessage `protobuf:"bytes,49,rep,name=repeated_foreign_message,json=repeatedForeignMessage" json:"repeated_foreign_message,omitempty"`
- RepeatedNestedEnum []TestAllTypes_NestedEnum `protobuf:"varint,51,rep,packed,name=repeated_nested_enum,json=repeatedNestedEnum,enum=conformance.TestAllTypes_NestedEnum" json:"repeated_nested_enum,omitempty"`
- RepeatedForeignEnum []ForeignEnum `protobuf:"varint,52,rep,packed,name=repeated_foreign_enum,json=repeatedForeignEnum,enum=conformance.ForeignEnum" json:"repeated_foreign_enum,omitempty"`
- RepeatedStringPiece []string `protobuf:"bytes,54,rep,name=repeated_string_piece,json=repeatedStringPiece" json:"repeated_string_piece,omitempty"`
- RepeatedCord []string `protobuf:"bytes,55,rep,name=repeated_cord,json=repeatedCord" json:"repeated_cord,omitempty"`
- // Map
- MapInt32Int32 map[int32]int32 `protobuf:"bytes,56,rep,name=map_int32_int32,json=mapInt32Int32" json:"map_int32_int32,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- MapInt64Int64 map[int64]int64 `protobuf:"bytes,57,rep,name=map_int64_int64,json=mapInt64Int64" json:"map_int64_int64,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- MapUint32Uint32 map[uint32]uint32 `protobuf:"bytes,58,rep,name=map_uint32_uint32,json=mapUint32Uint32" json:"map_uint32_uint32,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- MapUint64Uint64 map[uint64]uint64 `protobuf:"bytes,59,rep,name=map_uint64_uint64,json=mapUint64Uint64" json:"map_uint64_uint64,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- MapSint32Sint32 map[int32]int32 `protobuf:"bytes,60,rep,name=map_sint32_sint32,json=mapSint32Sint32" json:"map_sint32_sint32,omitempty" protobuf_key:"zigzag32,1,opt,name=key" protobuf_val:"zigzag32,2,opt,name=value"`
- MapSint64Sint64 map[int64]int64 `protobuf:"bytes,61,rep,name=map_sint64_sint64,json=mapSint64Sint64" json:"map_sint64_sint64,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"zigzag64,2,opt,name=value"`
- MapFixed32Fixed32 map[uint32]uint32 `protobuf:"bytes,62,rep,name=map_fixed32_fixed32,json=mapFixed32Fixed32" json:"map_fixed32_fixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key" protobuf_val:"fixed32,2,opt,name=value"`
- MapFixed64Fixed64 map[uint64]uint64 `protobuf:"bytes,63,rep,name=map_fixed64_fixed64,json=mapFixed64Fixed64" json:"map_fixed64_fixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"`
- MapSfixed32Sfixed32 map[int32]int32 `protobuf:"bytes,64,rep,name=map_sfixed32_sfixed32,json=mapSfixed32Sfixed32" json:"map_sfixed32_sfixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key" protobuf_val:"fixed32,2,opt,name=value"`
- MapSfixed64Sfixed64 map[int64]int64 `protobuf:"bytes,65,rep,name=map_sfixed64_sfixed64,json=mapSfixed64Sfixed64" json:"map_sfixed64_sfixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"`
- MapInt32Float map[int32]float32 `protobuf:"bytes,66,rep,name=map_int32_float,json=mapInt32Float" json:"map_int32_float,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"fixed32,2,opt,name=value"`
- MapInt32Double map[int32]float64 `protobuf:"bytes,67,rep,name=map_int32_double,json=mapInt32Double" json:"map_int32_double,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"`
- MapBoolBool map[bool]bool `protobuf:"bytes,68,rep,name=map_bool_bool,json=mapBoolBool" json:"map_bool_bool,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- MapStringString map[string]string `protobuf:"bytes,69,rep,name=map_string_string,json=mapStringString" json:"map_string_string,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- MapStringBytes map[string][]byte `protobuf:"bytes,70,rep,name=map_string_bytes,json=mapStringBytes" json:"map_string_bytes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
- MapStringNestedMessage map[string]*TestAllTypes_NestedMessage `protobuf:"bytes,71,rep,name=map_string_nested_message,json=mapStringNestedMessage" json:"map_string_nested_message,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- MapStringForeignMessage map[string]*ForeignMessage `protobuf:"bytes,72,rep,name=map_string_foreign_message,json=mapStringForeignMessage" json:"map_string_foreign_message,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- MapStringNestedEnum map[string]TestAllTypes_NestedEnum `protobuf:"bytes,73,rep,name=map_string_nested_enum,json=mapStringNestedEnum" json:"map_string_nested_enum,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=conformance.TestAllTypes_NestedEnum"`
- MapStringForeignEnum map[string]ForeignEnum `protobuf:"bytes,74,rep,name=map_string_foreign_enum,json=mapStringForeignEnum" json:"map_string_foreign_enum,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=conformance.ForeignEnum"`
- // Types that are valid to be assigned to OneofField:
- // *TestAllTypes_OneofUint32
- // *TestAllTypes_OneofNestedMessage
- // *TestAllTypes_OneofString
- // *TestAllTypes_OneofBytes
- OneofField isTestAllTypes_OneofField `protobuf_oneof:"oneof_field"`
- // Well-known types
- OptionalBoolWrapper *wrappers.BoolValue `protobuf:"bytes,201,opt,name=optional_bool_wrapper,json=optionalBoolWrapper" json:"optional_bool_wrapper,omitempty"`
- OptionalInt32Wrapper *wrappers.Int32Value `protobuf:"bytes,202,opt,name=optional_int32_wrapper,json=optionalInt32Wrapper" json:"optional_int32_wrapper,omitempty"`
- OptionalInt64Wrapper *wrappers.Int64Value `protobuf:"bytes,203,opt,name=optional_int64_wrapper,json=optionalInt64Wrapper" json:"optional_int64_wrapper,omitempty"`
- OptionalUint32Wrapper *wrappers.UInt32Value `protobuf:"bytes,204,opt,name=optional_uint32_wrapper,json=optionalUint32Wrapper" json:"optional_uint32_wrapper,omitempty"`
- OptionalUint64Wrapper *wrappers.UInt64Value `protobuf:"bytes,205,opt,name=optional_uint64_wrapper,json=optionalUint64Wrapper" json:"optional_uint64_wrapper,omitempty"`
- OptionalFloatWrapper *wrappers.FloatValue `protobuf:"bytes,206,opt,name=optional_float_wrapper,json=optionalFloatWrapper" json:"optional_float_wrapper,omitempty"`
- OptionalDoubleWrapper *wrappers.DoubleValue `protobuf:"bytes,207,opt,name=optional_double_wrapper,json=optionalDoubleWrapper" json:"optional_double_wrapper,omitempty"`
- OptionalStringWrapper *wrappers.StringValue `protobuf:"bytes,208,opt,name=optional_string_wrapper,json=optionalStringWrapper" json:"optional_string_wrapper,omitempty"`
- OptionalBytesWrapper *wrappers.BytesValue `protobuf:"bytes,209,opt,name=optional_bytes_wrapper,json=optionalBytesWrapper" json:"optional_bytes_wrapper,omitempty"`
- RepeatedBoolWrapper []*wrappers.BoolValue `protobuf:"bytes,211,rep,name=repeated_bool_wrapper,json=repeatedBoolWrapper" json:"repeated_bool_wrapper,omitempty"`
- RepeatedInt32Wrapper []*wrappers.Int32Value `protobuf:"bytes,212,rep,name=repeated_int32_wrapper,json=repeatedInt32Wrapper" json:"repeated_int32_wrapper,omitempty"`
- RepeatedInt64Wrapper []*wrappers.Int64Value `protobuf:"bytes,213,rep,name=repeated_int64_wrapper,json=repeatedInt64Wrapper" json:"repeated_int64_wrapper,omitempty"`
- RepeatedUint32Wrapper []*wrappers.UInt32Value `protobuf:"bytes,214,rep,name=repeated_uint32_wrapper,json=repeatedUint32Wrapper" json:"repeated_uint32_wrapper,omitempty"`
- RepeatedUint64Wrapper []*wrappers.UInt64Value `protobuf:"bytes,215,rep,name=repeated_uint64_wrapper,json=repeatedUint64Wrapper" json:"repeated_uint64_wrapper,omitempty"`
- RepeatedFloatWrapper []*wrappers.FloatValue `protobuf:"bytes,216,rep,name=repeated_float_wrapper,json=repeatedFloatWrapper" json:"repeated_float_wrapper,omitempty"`
- RepeatedDoubleWrapper []*wrappers.DoubleValue `protobuf:"bytes,217,rep,name=repeated_double_wrapper,json=repeatedDoubleWrapper" json:"repeated_double_wrapper,omitempty"`
- RepeatedStringWrapper []*wrappers.StringValue `protobuf:"bytes,218,rep,name=repeated_string_wrapper,json=repeatedStringWrapper" json:"repeated_string_wrapper,omitempty"`
- RepeatedBytesWrapper []*wrappers.BytesValue `protobuf:"bytes,219,rep,name=repeated_bytes_wrapper,json=repeatedBytesWrapper" json:"repeated_bytes_wrapper,omitempty"`
- OptionalDuration *duration.Duration `protobuf:"bytes,301,opt,name=optional_duration,json=optionalDuration" json:"optional_duration,omitempty"`
- OptionalTimestamp *timestamp.Timestamp `protobuf:"bytes,302,opt,name=optional_timestamp,json=optionalTimestamp" json:"optional_timestamp,omitempty"`
- OptionalFieldMask *field_mask.FieldMask `protobuf:"bytes,303,opt,name=optional_field_mask,json=optionalFieldMask" json:"optional_field_mask,omitempty"`
- OptionalStruct *_struct.Struct `protobuf:"bytes,304,opt,name=optional_struct,json=optionalStruct" json:"optional_struct,omitempty"`
- OptionalAny *any.Any `protobuf:"bytes,305,opt,name=optional_any,json=optionalAny" json:"optional_any,omitempty"`
- OptionalValue *_struct.Value `protobuf:"bytes,306,opt,name=optional_value,json=optionalValue" json:"optional_value,omitempty"`
- RepeatedDuration []*duration.Duration `protobuf:"bytes,311,rep,name=repeated_duration,json=repeatedDuration" json:"repeated_duration,omitempty"`
- RepeatedTimestamp []*timestamp.Timestamp `protobuf:"bytes,312,rep,name=repeated_timestamp,json=repeatedTimestamp" json:"repeated_timestamp,omitempty"`
- RepeatedFieldmask []*field_mask.FieldMask `protobuf:"bytes,313,rep,name=repeated_fieldmask,json=repeatedFieldmask" json:"repeated_fieldmask,omitempty"`
- RepeatedStruct []*_struct.Struct `protobuf:"bytes,324,rep,name=repeated_struct,json=repeatedStruct" json:"repeated_struct,omitempty"`
- RepeatedAny []*any.Any `protobuf:"bytes,315,rep,name=repeated_any,json=repeatedAny" json:"repeated_any,omitempty"`
- RepeatedValue []*_struct.Value `protobuf:"bytes,316,rep,name=repeated_value,json=repeatedValue" json:"repeated_value,omitempty"`
- // Test field-name-to-JSON-name convention.
- Fieldname1 int32 `protobuf:"varint,401,opt,name=fieldname1" json:"fieldname1,omitempty"`
- FieldName2 int32 `protobuf:"varint,402,opt,name=field_name2,json=fieldName2" json:"field_name2,omitempty"`
- XFieldName3 int32 `protobuf:"varint,403,opt,name=_field_name3,json=FieldName3" json:"_field_name3,omitempty"`
- Field_Name4_ int32 `protobuf:"varint,404,opt,name=field__name4_,json=fieldName4" json:"field__name4_,omitempty"`
- Field0Name5 int32 `protobuf:"varint,405,opt,name=field0name5" json:"field0name5,omitempty"`
- Field_0Name6 int32 `protobuf:"varint,406,opt,name=field_0_name6,json=field0Name6" json:"field_0_name6,omitempty"`
- FieldName7 int32 `protobuf:"varint,407,opt,name=fieldName7" json:"fieldName7,omitempty"`
- FieldName8 int32 `protobuf:"varint,408,opt,name=FieldName8" json:"FieldName8,omitempty"`
- Field_Name9 int32 `protobuf:"varint,409,opt,name=field_Name9,json=fieldName9" json:"field_Name9,omitempty"`
- Field_Name10 int32 `protobuf:"varint,410,opt,name=Field_Name10,json=FieldName10" json:"Field_Name10,omitempty"`
- FIELD_NAME11 int32 `protobuf:"varint,411,opt,name=FIELD_NAME11,json=FIELDNAME11" json:"FIELD_NAME11,omitempty"`
- FIELDName12 int32 `protobuf:"varint,412,opt,name=FIELD_name12,json=FIELDName12" json:"FIELD_name12,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TestAllTypes) Reset() { *m = TestAllTypes{} }
-func (m *TestAllTypes) String() string { return proto.CompactTextString(m) }
-func (*TestAllTypes) ProtoMessage() {}
-func (*TestAllTypes) Descriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{2}
-}
-func (m *TestAllTypes) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllTypes.Unmarshal(m, b)
-}
-func (m *TestAllTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllTypes.Marshal(b, m, deterministic)
-}
-func (dst *TestAllTypes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllTypes.Merge(dst, src)
-}
-func (m *TestAllTypes) XXX_Size() int {
- return xxx_messageInfo_TestAllTypes.Size(m)
-}
-func (m *TestAllTypes) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllTypes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllTypes proto.InternalMessageInfo
-
-type isTestAllTypes_OneofField interface {
- isTestAllTypes_OneofField()
-}
-
-type TestAllTypes_OneofUint32 struct {
- OneofUint32 uint32 `protobuf:"varint,111,opt,name=oneof_uint32,json=oneofUint32,oneof"`
-}
-type TestAllTypes_OneofNestedMessage struct {
- OneofNestedMessage *TestAllTypes_NestedMessage `protobuf:"bytes,112,opt,name=oneof_nested_message,json=oneofNestedMessage,oneof"`
-}
-type TestAllTypes_OneofString struct {
- OneofString string `protobuf:"bytes,113,opt,name=oneof_string,json=oneofString,oneof"`
-}
-type TestAllTypes_OneofBytes struct {
- OneofBytes []byte `protobuf:"bytes,114,opt,name=oneof_bytes,json=oneofBytes,proto3,oneof"`
-}
-
-func (*TestAllTypes_OneofUint32) isTestAllTypes_OneofField() {}
-func (*TestAllTypes_OneofNestedMessage) isTestAllTypes_OneofField() {}
-func (*TestAllTypes_OneofString) isTestAllTypes_OneofField() {}
-func (*TestAllTypes_OneofBytes) isTestAllTypes_OneofField() {}
-
-func (m *TestAllTypes) GetOneofField() isTestAllTypes_OneofField {
- if m != nil {
- return m.OneofField
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalInt32() int32 {
- if m != nil {
- return m.OptionalInt32
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalInt64() int64 {
- if m != nil {
- return m.OptionalInt64
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalUint32() uint32 {
- if m != nil {
- return m.OptionalUint32
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalUint64() uint64 {
- if m != nil {
- return m.OptionalUint64
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalSint32() int32 {
- if m != nil {
- return m.OptionalSint32
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalSint64() int64 {
- if m != nil {
- return m.OptionalSint64
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalFixed32() uint32 {
- if m != nil {
- return m.OptionalFixed32
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalFixed64() uint64 {
- if m != nil {
- return m.OptionalFixed64
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalSfixed32() int32 {
- if m != nil {
- return m.OptionalSfixed32
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalSfixed64() int64 {
- if m != nil {
- return m.OptionalSfixed64
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalFloat() float32 {
- if m != nil {
- return m.OptionalFloat
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalDouble() float64 {
- if m != nil {
- return m.OptionalDouble
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOptionalBool() bool {
- if m != nil {
- return m.OptionalBool
- }
- return false
-}
-
-func (m *TestAllTypes) GetOptionalString() string {
- if m != nil {
- return m.OptionalString
- }
- return ""
-}
-
-func (m *TestAllTypes) GetOptionalBytes() []byte {
- if m != nil {
- return m.OptionalBytes
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalNestedMessage() *TestAllTypes_NestedMessage {
- if m != nil {
- return m.OptionalNestedMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalForeignMessage() *ForeignMessage {
- if m != nil {
- return m.OptionalForeignMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalNestedEnum() TestAllTypes_NestedEnum {
- if m != nil {
- return m.OptionalNestedEnum
- }
- return TestAllTypes_FOO
-}
-
-func (m *TestAllTypes) GetOptionalForeignEnum() ForeignEnum {
- if m != nil {
- return m.OptionalForeignEnum
- }
- return ForeignEnum_FOREIGN_FOO
-}
-
-func (m *TestAllTypes) GetOptionalStringPiece() string {
- if m != nil {
- return m.OptionalStringPiece
- }
- return ""
-}
-
-func (m *TestAllTypes) GetOptionalCord() string {
- if m != nil {
- return m.OptionalCord
- }
- return ""
-}
-
-func (m *TestAllTypes) GetRecursiveMessage() *TestAllTypes {
- if m != nil {
- return m.RecursiveMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedInt32() []int32 {
- if m != nil {
- return m.RepeatedInt32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedInt64() []int64 {
- if m != nil {
- return m.RepeatedInt64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedUint32() []uint32 {
- if m != nil {
- return m.RepeatedUint32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedUint64() []uint64 {
- if m != nil {
- return m.RepeatedUint64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedSint32() []int32 {
- if m != nil {
- return m.RepeatedSint32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedSint64() []int64 {
- if m != nil {
- return m.RepeatedSint64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedFixed32() []uint32 {
- if m != nil {
- return m.RepeatedFixed32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedFixed64() []uint64 {
- if m != nil {
- return m.RepeatedFixed64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedSfixed32() []int32 {
- if m != nil {
- return m.RepeatedSfixed32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedSfixed64() []int64 {
- if m != nil {
- return m.RepeatedSfixed64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedFloat() []float32 {
- if m != nil {
- return m.RepeatedFloat
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedDouble() []float64 {
- if m != nil {
- return m.RepeatedDouble
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedBool() []bool {
- if m != nil {
- return m.RepeatedBool
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedString() []string {
- if m != nil {
- return m.RepeatedString
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedBytes() [][]byte {
- if m != nil {
- return m.RepeatedBytes
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedNestedMessage() []*TestAllTypes_NestedMessage {
- if m != nil {
- return m.RepeatedNestedMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedForeignMessage() []*ForeignMessage {
- if m != nil {
- return m.RepeatedForeignMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedNestedEnum() []TestAllTypes_NestedEnum {
- if m != nil {
- return m.RepeatedNestedEnum
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedForeignEnum() []ForeignEnum {
- if m != nil {
- return m.RepeatedForeignEnum
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedStringPiece() []string {
- if m != nil {
- return m.RepeatedStringPiece
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedCord() []string {
- if m != nil {
- return m.RepeatedCord
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapInt32Int32() map[int32]int32 {
- if m != nil {
- return m.MapInt32Int32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapInt64Int64() map[int64]int64 {
- if m != nil {
- return m.MapInt64Int64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapUint32Uint32() map[uint32]uint32 {
- if m != nil {
- return m.MapUint32Uint32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapUint64Uint64() map[uint64]uint64 {
- if m != nil {
- return m.MapUint64Uint64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapSint32Sint32() map[int32]int32 {
- if m != nil {
- return m.MapSint32Sint32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapSint64Sint64() map[int64]int64 {
- if m != nil {
- return m.MapSint64Sint64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapFixed32Fixed32() map[uint32]uint32 {
- if m != nil {
- return m.MapFixed32Fixed32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapFixed64Fixed64() map[uint64]uint64 {
- if m != nil {
- return m.MapFixed64Fixed64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapSfixed32Sfixed32() map[int32]int32 {
- if m != nil {
- return m.MapSfixed32Sfixed32
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapSfixed64Sfixed64() map[int64]int64 {
- if m != nil {
- return m.MapSfixed64Sfixed64
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapInt32Float() map[int32]float32 {
- if m != nil {
- return m.MapInt32Float
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapInt32Double() map[int32]float64 {
- if m != nil {
- return m.MapInt32Double
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapBoolBool() map[bool]bool {
- if m != nil {
- return m.MapBoolBool
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapStringString() map[string]string {
- if m != nil {
- return m.MapStringString
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapStringBytes() map[string][]byte {
- if m != nil {
- return m.MapStringBytes
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapStringNestedMessage() map[string]*TestAllTypes_NestedMessage {
- if m != nil {
- return m.MapStringNestedMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapStringForeignMessage() map[string]*ForeignMessage {
- if m != nil {
- return m.MapStringForeignMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapStringNestedEnum() map[string]TestAllTypes_NestedEnum {
- if m != nil {
- return m.MapStringNestedEnum
- }
- return nil
-}
-
-func (m *TestAllTypes) GetMapStringForeignEnum() map[string]ForeignEnum {
- if m != nil {
- return m.MapStringForeignEnum
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOneofUint32() uint32 {
- if x, ok := m.GetOneofField().(*TestAllTypes_OneofUint32); ok {
- return x.OneofUint32
- }
- return 0
-}
-
-func (m *TestAllTypes) GetOneofNestedMessage() *TestAllTypes_NestedMessage {
- if x, ok := m.GetOneofField().(*TestAllTypes_OneofNestedMessage); ok {
- return x.OneofNestedMessage
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOneofString() string {
- if x, ok := m.GetOneofField().(*TestAllTypes_OneofString); ok {
- return x.OneofString
- }
- return ""
-}
-
-func (m *TestAllTypes) GetOneofBytes() []byte {
- if x, ok := m.GetOneofField().(*TestAllTypes_OneofBytes); ok {
- return x.OneofBytes
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalBoolWrapper() *wrappers.BoolValue {
- if m != nil {
- return m.OptionalBoolWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalInt32Wrapper() *wrappers.Int32Value {
- if m != nil {
- return m.OptionalInt32Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalInt64Wrapper() *wrappers.Int64Value {
- if m != nil {
- return m.OptionalInt64Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalUint32Wrapper() *wrappers.UInt32Value {
- if m != nil {
- return m.OptionalUint32Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalUint64Wrapper() *wrappers.UInt64Value {
- if m != nil {
- return m.OptionalUint64Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalFloatWrapper() *wrappers.FloatValue {
- if m != nil {
- return m.OptionalFloatWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalDoubleWrapper() *wrappers.DoubleValue {
- if m != nil {
- return m.OptionalDoubleWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalStringWrapper() *wrappers.StringValue {
- if m != nil {
- return m.OptionalStringWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalBytesWrapper() *wrappers.BytesValue {
- if m != nil {
- return m.OptionalBytesWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedBoolWrapper() []*wrappers.BoolValue {
- if m != nil {
- return m.RepeatedBoolWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedInt32Wrapper() []*wrappers.Int32Value {
- if m != nil {
- return m.RepeatedInt32Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedInt64Wrapper() []*wrappers.Int64Value {
- if m != nil {
- return m.RepeatedInt64Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedUint32Wrapper() []*wrappers.UInt32Value {
- if m != nil {
- return m.RepeatedUint32Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedUint64Wrapper() []*wrappers.UInt64Value {
- if m != nil {
- return m.RepeatedUint64Wrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedFloatWrapper() []*wrappers.FloatValue {
- if m != nil {
- return m.RepeatedFloatWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedDoubleWrapper() []*wrappers.DoubleValue {
- if m != nil {
- return m.RepeatedDoubleWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedStringWrapper() []*wrappers.StringValue {
- if m != nil {
- return m.RepeatedStringWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedBytesWrapper() []*wrappers.BytesValue {
- if m != nil {
- return m.RepeatedBytesWrapper
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalDuration() *duration.Duration {
- if m != nil {
- return m.OptionalDuration
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalTimestamp() *timestamp.Timestamp {
- if m != nil {
- return m.OptionalTimestamp
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalFieldMask() *field_mask.FieldMask {
- if m != nil {
- return m.OptionalFieldMask
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalStruct() *_struct.Struct {
- if m != nil {
- return m.OptionalStruct
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalAny() *any.Any {
- if m != nil {
- return m.OptionalAny
- }
- return nil
-}
-
-func (m *TestAllTypes) GetOptionalValue() *_struct.Value {
- if m != nil {
- return m.OptionalValue
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedDuration() []*duration.Duration {
- if m != nil {
- return m.RepeatedDuration
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedTimestamp() []*timestamp.Timestamp {
- if m != nil {
- return m.RepeatedTimestamp
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedFieldmask() []*field_mask.FieldMask {
- if m != nil {
- return m.RepeatedFieldmask
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedStruct() []*_struct.Struct {
- if m != nil {
- return m.RepeatedStruct
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedAny() []*any.Any {
- if m != nil {
- return m.RepeatedAny
- }
- return nil
-}
-
-func (m *TestAllTypes) GetRepeatedValue() []*_struct.Value {
- if m != nil {
- return m.RepeatedValue
- }
- return nil
-}
-
-func (m *TestAllTypes) GetFieldname1() int32 {
- if m != nil {
- return m.Fieldname1
- }
- return 0
-}
-
-func (m *TestAllTypes) GetFieldName2() int32 {
- if m != nil {
- return m.FieldName2
- }
- return 0
-}
-
-func (m *TestAllTypes) GetXFieldName3() int32 {
- if m != nil {
- return m.XFieldName3
- }
- return 0
-}
-
-func (m *TestAllTypes) GetField_Name4_() int32 {
- if m != nil {
- return m.Field_Name4_
- }
- return 0
-}
-
-func (m *TestAllTypes) GetField0Name5() int32 {
- if m != nil {
- return m.Field0Name5
- }
- return 0
-}
-
-func (m *TestAllTypes) GetField_0Name6() int32 {
- if m != nil {
- return m.Field_0Name6
- }
- return 0
-}
-
-func (m *TestAllTypes) GetFieldName7() int32 {
- if m != nil {
- return m.FieldName7
- }
- return 0
-}
-
-func (m *TestAllTypes) GetFieldName8() int32 {
- if m != nil {
- return m.FieldName8
- }
- return 0
-}
-
-func (m *TestAllTypes) GetField_Name9() int32 {
- if m != nil {
- return m.Field_Name9
- }
- return 0
-}
-
-func (m *TestAllTypes) GetField_Name10() int32 {
- if m != nil {
- return m.Field_Name10
- }
- return 0
-}
-
-func (m *TestAllTypes) GetFIELD_NAME11() int32 {
- if m != nil {
- return m.FIELD_NAME11
- }
- return 0
-}
-
-func (m *TestAllTypes) GetFIELDName12() int32 {
- if m != nil {
- return m.FIELDName12
- }
- return 0
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*TestAllTypes) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _TestAllTypes_OneofMarshaler, _TestAllTypes_OneofUnmarshaler, _TestAllTypes_OneofSizer, []interface{}{
- (*TestAllTypes_OneofUint32)(nil),
- (*TestAllTypes_OneofNestedMessage)(nil),
- (*TestAllTypes_OneofString)(nil),
- (*TestAllTypes_OneofBytes)(nil),
- }
-}
-
-func _TestAllTypes_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*TestAllTypes)
- // oneof_field
- switch x := m.OneofField.(type) {
- case *TestAllTypes_OneofUint32:
- b.EncodeVarint(111<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.OneofUint32))
- case *TestAllTypes_OneofNestedMessage:
- b.EncodeVarint(112<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.OneofNestedMessage); err != nil {
- return err
- }
- case *TestAllTypes_OneofString:
- b.EncodeVarint(113<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.OneofString)
- case *TestAllTypes_OneofBytes:
- b.EncodeVarint(114<<3 | proto.WireBytes)
- b.EncodeRawBytes(x.OneofBytes)
- case nil:
- default:
- return fmt.Errorf("TestAllTypes.OneofField has unexpected type %T", x)
- }
- return nil
-}
-
-func _TestAllTypes_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*TestAllTypes)
- switch tag {
- case 111: // oneof_field.oneof_uint32
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.OneofField = &TestAllTypes_OneofUint32{uint32(x)}
- return true, err
- case 112: // oneof_field.oneof_nested_message
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(TestAllTypes_NestedMessage)
- err := b.DecodeMessage(msg)
- m.OneofField = &TestAllTypes_OneofNestedMessage{msg}
- return true, err
- case 113: // oneof_field.oneof_string
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.OneofField = &TestAllTypes_OneofString{x}
- return true, err
- case 114: // oneof_field.oneof_bytes
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeRawBytes(true)
- m.OneofField = &TestAllTypes_OneofBytes{x}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _TestAllTypes_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*TestAllTypes)
- // oneof_field
- switch x := m.OneofField.(type) {
- case *TestAllTypes_OneofUint32:
- n += 2 // tag and wire
- n += proto.SizeVarint(uint64(x.OneofUint32))
- case *TestAllTypes_OneofNestedMessage:
- s := proto.Size(x.OneofNestedMessage)
- n += 2 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case *TestAllTypes_OneofString:
- n += 2 // tag and wire
- n += proto.SizeVarint(uint64(len(x.OneofString)))
- n += len(x.OneofString)
- case *TestAllTypes_OneofBytes:
- n += 2 // tag and wire
- n += proto.SizeVarint(uint64(len(x.OneofBytes)))
- n += len(x.OneofBytes)
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-type TestAllTypes_NestedMessage struct {
- A int32 `protobuf:"varint,1,opt,name=a" json:"a,omitempty"`
- Corecursive *TestAllTypes `protobuf:"bytes,2,opt,name=corecursive" json:"corecursive,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TestAllTypes_NestedMessage) Reset() { *m = TestAllTypes_NestedMessage{} }
-func (m *TestAllTypes_NestedMessage) String() string { return proto.CompactTextString(m) }
-func (*TestAllTypes_NestedMessage) ProtoMessage() {}
-func (*TestAllTypes_NestedMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{2, 0}
-}
-func (m *TestAllTypes_NestedMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllTypes_NestedMessage.Unmarshal(m, b)
-}
-func (m *TestAllTypes_NestedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllTypes_NestedMessage.Marshal(b, m, deterministic)
-}
-func (dst *TestAllTypes_NestedMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllTypes_NestedMessage.Merge(dst, src)
-}
-func (m *TestAllTypes_NestedMessage) XXX_Size() int {
- return xxx_messageInfo_TestAllTypes_NestedMessage.Size(m)
-}
-func (m *TestAllTypes_NestedMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllTypes_NestedMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllTypes_NestedMessage proto.InternalMessageInfo
-
-func (m *TestAllTypes_NestedMessage) GetA() int32 {
- if m != nil {
- return m.A
- }
- return 0
-}
-
-func (m *TestAllTypes_NestedMessage) GetCorecursive() *TestAllTypes {
- if m != nil {
- return m.Corecursive
- }
- return nil
-}
-
-type ForeignMessage struct {
- C int32 `protobuf:"varint,1,opt,name=c" json:"c,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ForeignMessage) Reset() { *m = ForeignMessage{} }
-func (m *ForeignMessage) String() string { return proto.CompactTextString(m) }
-func (*ForeignMessage) ProtoMessage() {}
-func (*ForeignMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_conformance_48ac832451f5d6c3, []int{3}
-}
-func (m *ForeignMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ForeignMessage.Unmarshal(m, b)
-}
-func (m *ForeignMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ForeignMessage.Marshal(b, m, deterministic)
-}
-func (dst *ForeignMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ForeignMessage.Merge(dst, src)
-}
-func (m *ForeignMessage) XXX_Size() int {
- return xxx_messageInfo_ForeignMessage.Size(m)
-}
-func (m *ForeignMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_ForeignMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ForeignMessage proto.InternalMessageInfo
-
-func (m *ForeignMessage) GetC() int32 {
- if m != nil {
- return m.C
- }
- return 0
-}
-
-func init() {
- proto.RegisterType((*ConformanceRequest)(nil), "conformance.ConformanceRequest")
- proto.RegisterType((*ConformanceResponse)(nil), "conformance.ConformanceResponse")
- proto.RegisterType((*TestAllTypes)(nil), "conformance.TestAllTypes")
- proto.RegisterMapType((map[bool]bool)(nil), "conformance.TestAllTypes.MapBoolBoolEntry")
- proto.RegisterMapType((map[uint32]uint32)(nil), "conformance.TestAllTypes.MapFixed32Fixed32Entry")
- proto.RegisterMapType((map[uint64]uint64)(nil), "conformance.TestAllTypes.MapFixed64Fixed64Entry")
- proto.RegisterMapType((map[int32]float64)(nil), "conformance.TestAllTypes.MapInt32DoubleEntry")
- proto.RegisterMapType((map[int32]float32)(nil), "conformance.TestAllTypes.MapInt32FloatEntry")
- proto.RegisterMapType((map[int32]int32)(nil), "conformance.TestAllTypes.MapInt32Int32Entry")
- proto.RegisterMapType((map[int64]int64)(nil), "conformance.TestAllTypes.MapInt64Int64Entry")
- proto.RegisterMapType((map[int32]int32)(nil), "conformance.TestAllTypes.MapSfixed32Sfixed32Entry")
- proto.RegisterMapType((map[int64]int64)(nil), "conformance.TestAllTypes.MapSfixed64Sfixed64Entry")
- proto.RegisterMapType((map[int32]int32)(nil), "conformance.TestAllTypes.MapSint32Sint32Entry")
- proto.RegisterMapType((map[int64]int64)(nil), "conformance.TestAllTypes.MapSint64Sint64Entry")
- proto.RegisterMapType((map[string][]byte)(nil), "conformance.TestAllTypes.MapStringBytesEntry")
- proto.RegisterMapType((map[string]ForeignEnum)(nil), "conformance.TestAllTypes.MapStringForeignEnumEntry")
- proto.RegisterMapType((map[string]*ForeignMessage)(nil), "conformance.TestAllTypes.MapStringForeignMessageEntry")
- proto.RegisterMapType((map[string]TestAllTypes_NestedEnum)(nil), "conformance.TestAllTypes.MapStringNestedEnumEntry")
- proto.RegisterMapType((map[string]*TestAllTypes_NestedMessage)(nil), "conformance.TestAllTypes.MapStringNestedMessageEntry")
- proto.RegisterMapType((map[string]string)(nil), "conformance.TestAllTypes.MapStringStringEntry")
- proto.RegisterMapType((map[uint32]uint32)(nil), "conformance.TestAllTypes.MapUint32Uint32Entry")
- proto.RegisterMapType((map[uint64]uint64)(nil), "conformance.TestAllTypes.MapUint64Uint64Entry")
- proto.RegisterType((*TestAllTypes_NestedMessage)(nil), "conformance.TestAllTypes.NestedMessage")
- proto.RegisterType((*ForeignMessage)(nil), "conformance.ForeignMessage")
- proto.RegisterEnum("conformance.WireFormat", WireFormat_name, WireFormat_value)
- proto.RegisterEnum("conformance.ForeignEnum", ForeignEnum_name, ForeignEnum_value)
- proto.RegisterEnum("conformance.TestAllTypes_NestedEnum", TestAllTypes_NestedEnum_name, TestAllTypes_NestedEnum_value)
-}
-
-func init() { proto.RegisterFile("conformance.proto", fileDescriptor_conformance_48ac832451f5d6c3) }
-
-var fileDescriptor_conformance_48ac832451f5d6c3 = []byte{
- // 2600 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x5a, 0x5b, 0x73, 0x13, 0xc9,
- 0x15, 0xf6, 0x68, 0xc0, 0x36, 0x2d, 0xd9, 0x96, 0xdb, 0xb7, 0xc6, 0x50, 0xcb, 0x60, 0x96, 0x20,
- 0x60, 0xd7, 0xeb, 0xcb, 0x30, 0x5c, 0x36, 0x4b, 0xb0, 0xc0, 0x02, 0x93, 0xc5, 0xa2, 0xc6, 0x78,
- 0xa9, 0x22, 0x0f, 0xca, 0x20, 0x8f, 0x5d, 0x5a, 0x24, 0x8d, 0x76, 0x66, 0xb4, 0x89, 0xf3, 0x98,
- 0x7f, 0x90, 0xfb, 0xf5, 0x2f, 0xe4, 0x5a, 0x95, 0x4a, 0x52, 0xc9, 0x53, 0x2a, 0x2f, 0xb9, 0x27,
- 0x95, 0x7b, 0xf2, 0x63, 0x92, 0xea, 0xeb, 0x74, 0xb7, 0x7a, 0x64, 0xb1, 0x55, 0x2b, 0x5b, 0xa7,
- 0xbf, 0xfe, 0xce, 0xe9, 0xd3, 0x67, 0xbe, 0x76, 0x9f, 0x01, 0xcc, 0x36, 0xa3, 0xee, 0x61, 0x14,
- 0x77, 0x82, 0x6e, 0x33, 0x5c, 0xed, 0xc5, 0x51, 0x1a, 0xc1, 0xa2, 0x64, 0x5a, 0x3e, 0x7b, 0x14,
- 0x45, 0x47, 0xed, 0xf0, 0x1d, 0x32, 0xf4, 0xb2, 0x7f, 0xf8, 0x4e, 0xd0, 0x3d, 0xa6, 0xb8, 0xe5,
- 0x37, 0xf4, 0xa1, 0x83, 0x7e, 0x1c, 0xa4, 0xad, 0xa8, 0xcb, 0xc6, 0x1d, 0x7d, 0xfc, 0xb0, 0x15,
- 0xb6, 0x0f, 0x1a, 0x9d, 0x20, 0x79, 0xc5, 0x10, 0xe7, 0x75, 0x44, 0x92, 0xc6, 0xfd, 0x66, 0xca,
- 0x46, 0x2f, 0xe8, 0xa3, 0x69, 0xab, 0x13, 0x26, 0x69, 0xd0, 0xe9, 0xe5, 0x05, 0xf0, 0xb9, 0x38,
- 0xe8, 0xf5, 0xc2, 0x38, 0xa1, 0xe3, 0x2b, 0xbf, 0xb2, 0x00, 0xbc, 0x9f, 0xad, 0xc5, 0x0f, 0x3f,
- 0xea, 0x87, 0x49, 0x0a, 0xaf, 0x83, 0x32, 0x9f, 0xd1, 0xe8, 0x05, 0xc7, 0xed, 0x28, 0x38, 0x40,
- 0x96, 0x63, 0x55, 0x4a, 0x8f, 0xc6, 0xfc, 0x19, 0x3e, 0xf2, 0x94, 0x0e, 0xc0, 0x4b, 0xa0, 0xf4,
- 0x61, 0x12, 0x75, 0x05, 0xb0, 0xe0, 0x58, 0x95, 0x33, 0x8f, 0xc6, 0xfc, 0x22, 0xb6, 0x72, 0x50,
- 0x1d, 0x2c, 0xc5, 0x94, 0x3c, 0x3c, 0x68, 0x44, 0xfd, 0xb4, 0xd7, 0x4f, 0x1b, 0xc4, 0x6b, 0x8a,
- 0x6c, 0xc7, 0xaa, 0x4c, 0x6f, 0x2c, 0xad, 0xca, 0x69, 0x7e, 0xde, 0x8a, 0xc3, 0x1a, 0x19, 0xf6,
- 0x17, 0xc4, 0xbc, 0x3a, 0x99, 0x46, 0xcd, 0xd5, 0x33, 0x60, 0x82, 0x39, 0x5c, 0xf9, 0x62, 0x01,
- 0xcc, 0x29, 0x8b, 0x48, 0x7a, 0x51, 0x37, 0x09, 0xe1, 0x45, 0x50, 0xec, 0x05, 0x71, 0x12, 0x36,
- 0xc2, 0x38, 0x8e, 0x62, 0xb2, 0x00, 0x1c, 0x17, 0x20, 0xc6, 0x6d, 0x6c, 0x83, 0x57, 0xc1, 0x4c,
- 0x12, 0xc6, 0xad, 0xa0, 0xdd, 0xfa, 0x02, 0x87, 0x8d, 0x33, 0xd8, 0xb4, 0x18, 0xa0, 0xd0, 0xcb,
- 0x60, 0x2a, 0xee, 0x77, 0x71, 0x82, 0x19, 0x90, 0xaf, 0xb3, 0xc4, 0xcc, 0x14, 0x66, 0x4a, 0x9d,
- 0x3d, 0x6a, 0xea, 0x4e, 0x99, 0x52, 0xb7, 0x0c, 0x26, 0x92, 0x57, 0xad, 0x5e, 0x2f, 0x3c, 0x40,
- 0xa7, 0xd9, 0x38, 0x37, 0x54, 0x27, 0xc1, 0x78, 0x1c, 0x26, 0xfd, 0x76, 0xba, 0xf2, 0x93, 0xfb,
- 0xa0, 0xf4, 0x2c, 0x4c, 0xd2, 0xad, 0x76, 0xfb, 0xd9, 0x71, 0x2f, 0x4c, 0xe0, 0x65, 0x30, 0x1d,
- 0xf5, 0x70, 0xad, 0x05, 0xed, 0x46, 0xab, 0x9b, 0x6e, 0x6e, 0x90, 0x04, 0x9c, 0xf6, 0xa7, 0xb8,
- 0x75, 0x07, 0x1b, 0x75, 0x98, 0xe7, 0x92, 0x75, 0xd9, 0x0a, 0xcc, 0x73, 0xe1, 0x15, 0x30, 0x23,
- 0x60, 0x7d, 0x4a, 0x87, 0x57, 0x35, 0xe5, 0x8b, 0xd9, 0xfb, 0xc4, 0x3a, 0x00, 0xf4, 0x5c, 0xb2,
- 0xaa, 0x53, 0x2a, 0x50, 0x63, 0x4c, 0x28, 0x23, 0x5e, 0xde, 0x6c, 0x06, 0xdc, 0x1b, 0x64, 0x4c,
- 0x28, 0x23, 0xde, 0x23, 0xa8, 0x02, 0x3d, 0x17, 0x5e, 0x05, 0x65, 0x01, 0x3c, 0x6c, 0x7d, 0x3e,
- 0x3c, 0xd8, 0xdc, 0x40, 0x13, 0x8e, 0x55, 0x99, 0xf0, 0x05, 0x41, 0x8d, 0x9a, 0x07, 0xa1, 0x9e,
- 0x8b, 0x26, 0x1d, 0xab, 0x32, 0xae, 0x41, 0x3d, 0x17, 0x5e, 0x07, 0xb3, 0x99, 0x7b, 0x4e, 0x7b,
- 0xc6, 0xb1, 0x2a, 0x33, 0xbe, 0xe0, 0xd8, 0x63, 0x76, 0x03, 0xd8, 0x73, 0x11, 0x70, 0xac, 0x4a,
- 0x59, 0x07, 0x7b, 0xae, 0x92, 0xfa, 0xc3, 0x76, 0x14, 0xa4, 0xa8, 0xe8, 0x58, 0x95, 0x42, 0x96,
- 0xfa, 0x1a, 0x36, 0x2a, 0xeb, 0x3f, 0x88, 0xfa, 0x2f, 0xdb, 0x21, 0x2a, 0x39, 0x56, 0xc5, 0xca,
- 0xd6, 0xff, 0x80, 0x58, 0xe1, 0x25, 0x20, 0x66, 0x36, 0x5e, 0x46, 0x51, 0x1b, 0x4d, 0x39, 0x56,
- 0x65, 0xd2, 0x2f, 0x71, 0x63, 0x35, 0x8a, 0xda, 0x6a, 0x36, 0xd3, 0xb8, 0xd5, 0x3d, 0x42, 0xd3,
- 0xb8, 0xaa, 0xa4, 0x6c, 0x12, 0xab, 0x12, 0xdd, 0xcb, 0xe3, 0x34, 0x4c, 0xd0, 0x0c, 0x2e, 0xe3,
- 0x2c, 0xba, 0x2a, 0x36, 0xc2, 0x06, 0x58, 0x12, 0xb0, 0x2e, 0x7d, 0xbc, 0x3b, 0x61, 0x92, 0x04,
- 0x47, 0x21, 0x82, 0x8e, 0x55, 0x29, 0x6e, 0x5c, 0x51, 0x1e, 0x6c, 0xb9, 0x44, 0x57, 0x77, 0x09,
- 0xfe, 0x09, 0x85, 0xfb, 0x0b, 0x9c, 0x47, 0x31, 0xc3, 0x7d, 0x80, 0xb2, 0x2c, 0x45, 0x71, 0xd8,
- 0x3a, 0xea, 0x0a, 0x0f, 0x73, 0xc4, 0xc3, 0x39, 0xc5, 0x43, 0x8d, 0x62, 0x38, 0xeb, 0xa2, 0x48,
- 0xa6, 0x62, 0x87, 0x1f, 0x80, 0x79, 0x3d, 0xee, 0xb0, 0xdb, 0xef, 0xa0, 0x05, 0xa2, 0x46, 0x6f,
- 0x9e, 0x14, 0xf4, 0x76, 0xb7, 0xdf, 0xf1, 0xa1, 0x1a, 0x31, 0xb6, 0xc1, 0xf7, 0xc1, 0xc2, 0x40,
- 0xb8, 0x84, 0x78, 0x91, 0x10, 0x23, 0x53, 0xac, 0x84, 0x6c, 0x4e, 0x0b, 0x94, 0xb0, 0x79, 0x12,
- 0x1b, 0xdd, 0xad, 0x46, 0xaf, 0x15, 0x36, 0x43, 0x84, 0xf0, 0x9e, 0x55, 0x0b, 0x93, 0x85, 0x6c,
- 0x1e, 0xdd, 0xb7, 0xa7, 0x78, 0x18, 0x5e, 0x91, 0x4a, 0xa1, 0x19, 0xc5, 0x07, 0xe8, 0x2c, 0xc3,
- 0x5b, 0x59, 0x39, 0xdc, 0x8f, 0xe2, 0x03, 0x58, 0x03, 0xb3, 0x71, 0xd8, 0xec, 0xc7, 0x49, 0xeb,
- 0xe3, 0x50, 0xa4, 0xf5, 0x1c, 0x49, 0xeb, 0xd9, 0xdc, 0x1c, 0xf8, 0x65, 0x31, 0x87, 0xa7, 0xf3,
- 0x32, 0x98, 0x8e, 0xc3, 0x5e, 0x18, 0xe0, 0x3c, 0xd2, 0x87, 0xf9, 0x82, 0x63, 0x63, 0xb5, 0xe1,
- 0x56, 0xa1, 0x36, 0x32, 0xcc, 0x73, 0x91, 0xe3, 0xd8, 0x58, 0x6d, 0x24, 0x18, 0xd5, 0x06, 0x01,
- 0x63, 0x6a, 0x73, 0xd1, 0xb1, 0xb1, 0xda, 0x70, 0x73, 0xa6, 0x36, 0x0a, 0xd0, 0x73, 0xd1, 0x8a,
- 0x63, 0x63, 0xb5, 0x91, 0x81, 0x1a, 0x23, 0x53, 0x9b, 0x4b, 0x8e, 0x8d, 0xd5, 0x86, 0x9b, 0xf7,
- 0x06, 0x19, 0x99, 0xda, 0xbc, 0xe9, 0xd8, 0x58, 0x6d, 0x64, 0x20, 0x55, 0x1b, 0x01, 0xe4, 0xb2,
- 0x70, 0xd9, 0xb1, 0xb1, 0xda, 0x70, 0xbb, 0xa4, 0x36, 0x2a, 0xd4, 0x73, 0xd1, 0x27, 0x1c, 0x1b,
- 0xab, 0x8d, 0x02, 0xa5, 0x6a, 0x93, 0xb9, 0xe7, 0xb4, 0x57, 0x1c, 0x1b, 0xab, 0x8d, 0x08, 0x40,
- 0x52, 0x1b, 0x0d, 0xec, 0xb9, 0xa8, 0xe2, 0xd8, 0x58, 0x6d, 0x54, 0x30, 0x55, 0x9b, 0x2c, 0x08,
- 0xa2, 0x36, 0x57, 0x1d, 0x1b, 0xab, 0x8d, 0x08, 0x81, 0xab, 0x8d, 0x80, 0x31, 0xb5, 0xb9, 0xe6,
- 0xd8, 0x58, 0x6d, 0xb8, 0x39, 0x53, 0x1b, 0x01, 0x24, 0x6a, 0x73, 0xdd, 0xb1, 0xb1, 0xda, 0x70,
- 0x23, 0x57, 0x9b, 0x2c, 0x42, 0xaa, 0x36, 0x6f, 0x39, 0x36, 0x56, 0x1b, 0x11, 0x9f, 0x50, 0x9b,
- 0x8c, 0x8d, 0xa8, 0xcd, 0xdb, 0x8e, 0x8d, 0xd5, 0x46, 0xd0, 0x71, 0xb5, 0x11, 0x30, 0x4d, 0x6d,
- 0xd6, 0x1c, 0xfb, 0xb5, 0xd4, 0x86, 0xf3, 0x0c, 0xa8, 0x4d, 0x96, 0x25, 0x4d, 0x6d, 0xd6, 0x89,
- 0x87, 0xe1, 0x6a, 0x23, 0x92, 0x39, 0xa0, 0x36, 0x7a, 0xdc, 0x44, 0x14, 0x36, 0x1d, 0x7b, 0x74,
- 0xb5, 0x51, 0x23, 0xe6, 0x6a, 0x33, 0x10, 0x2e, 0x21, 0x76, 0x09, 0xf1, 0x10, 0xb5, 0xd1, 0x02,
- 0xe5, 0x6a, 0xa3, 0xed, 0x16, 0x53, 0x1b, 0x0f, 0xef, 0x19, 0x55, 0x1b, 0x75, 0xdf, 0x84, 0xda,
- 0x88, 0x79, 0x44, 0x6d, 0x6e, 0x32, 0xbc, 0x95, 0x95, 0x03, 0x51, 0x9b, 0x67, 0x60, 0xa6, 0x13,
- 0xf4, 0xa8, 0x40, 0x30, 0x99, 0xb8, 0x45, 0x92, 0xfa, 0x56, 0x7e, 0x06, 0x9e, 0x04, 0x3d, 0xa2,
- 0x1d, 0xe4, 0x63, 0xbb, 0x9b, 0xc6, 0xc7, 0xfe, 0x54, 0x47, 0xb6, 0x49, 0xac, 0x9e, 0xcb, 0x54,
- 0xe5, 0xf6, 0x68, 0xac, 0x9e, 0x4b, 0x3e, 0x14, 0x56, 0x66, 0x83, 0x2f, 0xc0, 0x2c, 0x66, 0xa5,
- 0xf2, 0xc3, 0x55, 0xe8, 0x0e, 0xe1, 0x5d, 0x1d, 0xca, 0x4b, 0xa5, 0x89, 0x7e, 0x52, 0x66, 0x1c,
- 0x9e, 0x6c, 0x95, 0xb9, 0x3d, 0x97, 0x0b, 0xd7, 0xbb, 0x23, 0x72, 0x7b, 0x2e, 0xfd, 0x54, 0xb9,
- 0xb9, 0x95, 0x73, 0x53, 0x91, 0xe3, 0x5a, 0xf7, 0xc9, 0x11, 0xb8, 0xa9, 0x00, 0xee, 0x69, 0x71,
- 0xcb, 0x56, 0x99, 0xdb, 0x73, 0xb9, 0x3c, 0xbe, 0x37, 0x22, 0xb7, 0xe7, 0xee, 0x69, 0x71, 0xcb,
- 0x56, 0xf8, 0x59, 0x30, 0x87, 0xb9, 0x99, 0xb6, 0x09, 0x49, 0xbd, 0x4b, 0xd8, 0xd7, 0x86, 0xb2,
- 0x33, 0x9d, 0x65, 0x3f, 0x28, 0x3f, 0x0e, 0x54, 0xb5, 0x2b, 0x1e, 0x3c, 0x57, 0x28, 0xf1, 0xa7,
- 0x46, 0xf5, 0xe0, 0xb9, 0xec, 0x87, 0xe6, 0x41, 0xd8, 0xe1, 0x21, 0x58, 0x20, 0xf9, 0xe1, 0x8b,
- 0x10, 0x0a, 0x7e, 0x8f, 0xf8, 0xd8, 0x18, 0x9e, 0x23, 0x06, 0xe6, 0x3f, 0xa9, 0x17, 0x1c, 0xb2,
- 0x3e, 0xa2, 0xfa, 0xc1, 0x3b, 0xc1, 0xd7, 0xb2, 0x35, 0xb2, 0x1f, 0xcf, 0xe5, 0x3f, 0x75, 0x3f,
- 0xd9, 0x88, 0xfa, 0xbc, 0xd2, 0x43, 0xa3, 0x3a, 0xea, 0xf3, 0x4a, 0x8e, 0x13, 0xed, 0x79, 0xa5,
- 0x47, 0xcc, 0x73, 0x50, 0xce, 0x58, 0xd9, 0x19, 0x73, 0x9f, 0xd0, 0xbe, 0x7d, 0x32, 0x2d, 0x3d,
- 0x7d, 0x28, 0xef, 0x74, 0x47, 0x31, 0xc2, 0x5d, 0x80, 0x3d, 0x91, 0xd3, 0x88, 0x1e, 0x49, 0x0f,
- 0x08, 0xeb, 0xb5, 0xa1, 0xac, 0xf8, 0x9c, 0xc2, 0xff, 0x53, 0xca, 0x62, 0x27, 0xb3, 0x88, 0x72,
- 0xa7, 0x52, 0xc8, 0xce, 0xaf, 0xed, 0x51, 0xca, 0x9d, 0x40, 0xe9, 0xa7, 0x54, 0xee, 0x92, 0x95,
- 0x27, 0x81, 0x71, 0xd3, 0x23, 0xaf, 0x36, 0x42, 0x12, 0xe8, 0x74, 0x72, 0x1a, 0x66, 0x49, 0x90,
- 0x8c, 0xb0, 0x07, 0xce, 0x4a, 0xc4, 0xda, 0x21, 0xf9, 0x90, 0x78, 0xb8, 0x31, 0x82, 0x07, 0xe5,
- 0x58, 0xa4, 0x9e, 0x16, 0x3b, 0xc6, 0x41, 0x98, 0x80, 0x65, 0xc9, 0xa3, 0x7e, 0x6a, 0x3e, 0x22,
- 0x2e, 0xbd, 0x11, 0x5c, 0xaa, 0x67, 0x26, 0xf5, 0xb9, 0xd4, 0x31, 0x8f, 0xc2, 0x23, 0xb0, 0x38,
- 0xb8, 0x4c, 0x72, 0xf4, 0xed, 0x8c, 0xf2, 0x0c, 0x48, 0xcb, 0xc0, 0x47, 0x9f, 0xf4, 0x0c, 0x68,
- 0x23, 0xf0, 0x43, 0xb0, 0x64, 0x58, 0x1d, 0xf1, 0xf4, 0x98, 0x78, 0xda, 0x1c, 0x7d, 0x69, 0x99,
- 0xab, 0xf9, 0x8e, 0x61, 0x08, 0x5e, 0x02, 0xa5, 0xa8, 0x1b, 0x46, 0x87, 0xfc, 0xb8, 0x89, 0xf0,
- 0x15, 0xfb, 0xd1, 0x98, 0x5f, 0x24, 0x56, 0x76, 0x78, 0x7c, 0x06, 0xcc, 0x53, 0x90, 0xb6, 0xb7,
- 0xbd, 0xd7, 0xba, 0x6e, 0x3d, 0x1a, 0xf3, 0x21, 0xa1, 0x51, 0xf7, 0x52, 0x44, 0xc0, 0xaa, 0xfd,
- 0x23, 0xde, 0x91, 0x20, 0x56, 0x56, 0xbb, 0x17, 0x01, 0xfd, 0xca, 0xca, 0x36, 0x66, 0xed, 0x0d,
- 0x40, 0x8c, 0xb4, 0x0a, 0xeb, 0xd2, 0xc5, 0x85, 0x3c, 0x8f, 0xac, 0xf1, 0x84, 0x7e, 0x63, 0x91,
- 0x30, 0x97, 0x57, 0x69, 0x67, 0x6a, 0x95, 0xb7, 0x44, 0x56, 0xf1, 0x13, 0xf7, 0x41, 0xd0, 0xee,
- 0x87, 0xd9, 0x8d, 0x06, 0x9b, 0x9e, 0xd3, 0x79, 0xd0, 0x07, 0x8b, 0x6a, 0x3b, 0x43, 0x30, 0xfe,
- 0xd6, 0x62, 0xb7, 0x40, 0x9d, 0x91, 0x48, 0x03, 0xa5, 0x9c, 0x57, 0x9a, 0x1e, 0x39, 0x9c, 0x9e,
- 0x2b, 0x38, 0x7f, 0x37, 0x84, 0xd3, 0x73, 0x07, 0x39, 0x3d, 0x97, 0x73, 0xee, 0x4b, 0xf7, 0xe1,
- 0xbe, 0x1a, 0xe8, 0xef, 0x29, 0xe9, 0xf9, 0x01, 0xd2, 0x7d, 0x29, 0xd2, 0x05, 0xb5, 0x9f, 0x92,
- 0x47, 0x2b, 0xc5, 0xfa, 0x87, 0x61, 0xb4, 0x3c, 0xd8, 0x05, 0xb5, 0xfb, 0x62, 0xca, 0x00, 0xd1,
- 0x77, 0xc1, 0xfa, 0xc7, 0xbc, 0x0c, 0x10, 0x0d, 0xd7, 0x32, 0x40, 0x6c, 0xa6, 0x50, 0xa9, 0xba,
- 0x0b, 0xd2, 0x3f, 0xe5, 0x85, 0x4a, 0x05, 0x5c, 0x0b, 0x95, 0x1a, 0x4d, 0xb4, 0xec, 0x61, 0xe4,
- 0xb4, 0x7f, 0xce, 0xa3, 0xa5, 0xf5, 0xaa, 0xd1, 0x52, 0xa3, 0x29, 0x03, 0xa4, 0x9c, 0x05, 0xeb,
- 0x5f, 0xf2, 0x32, 0x40, 0x2a, 0x5c, 0xcb, 0x00, 0xb1, 0x71, 0xce, 0xba, 0xf4, 0x77, 0xb4, 0x52,
- 0xfc, 0x7f, 0xb5, 0x88, 0x62, 0x0c, 0x2d, 0x7e, 0xf9, 0xfe, 0x24, 0x05, 0xa9, 0xde, 0xae, 0x05,
- 0xe3, 0xdf, 0x2c, 0x76, 0x29, 0x19, 0x56, 0xfc, 0xca, 0x1d, 0x3c, 0x87, 0x53, 0x2a, 0xa8, 0xbf,
- 0x0f, 0xe1, 0x14, 0xc5, 0xaf, 0x5c, 0xd8, 0xa5, 0x3d, 0xd2, 0xee, 0xed, 0x82, 0xf4, 0x1f, 0x94,
- 0xf4, 0x84, 0xe2, 0x57, 0xaf, 0xf7, 0x79, 0xb4, 0x52, 0xac, 0xff, 0x1c, 0x46, 0x2b, 0x8a, 0x5f,
- 0x6d, 0x06, 0x98, 0x32, 0xa0, 0x16, 0xff, 0xbf, 0xf2, 0x32, 0x20, 0x17, 0xbf, 0x72, 0x6f, 0x36,
- 0x85, 0xaa, 0x15, 0xff, 0xbf, 0xf3, 0x42, 0x55, 0x8a, 0x5f, 0xbd, 0x65, 0x9b, 0x68, 0xb5, 0xe2,
- 0xff, 0x4f, 0x1e, 0xad, 0x52, 0xfc, 0xea, 0xb5, 0xcd, 0x94, 0x01, 0xb5, 0xf8, 0xff, 0x9b, 0x97,
- 0x01, 0xb9, 0xf8, 0x95, 0xbb, 0x39, 0xe7, 0x7c, 0x28, 0xb5, 0x40, 0xf9, 0xeb, 0x0e, 0xf4, 0xbd,
- 0x02, 0x6b, 0x29, 0x0d, 0xac, 0x9d, 0x21, 0xb2, 0xf6, 0x28, 0xb7, 0xc0, 0xc7, 0x40, 0xf4, 0xd7,
- 0x1a, 0xe2, 0xbd, 0x06, 0xfa, 0x7e, 0x21, 0xe7, 0xfc, 0x78, 0xc6, 0x21, 0xbe, 0xf0, 0x2f, 0x4c,
- 0xf0, 0xd3, 0x60, 0x4e, 0xea, 0xf7, 0xf2, 0x77, 0x2c, 0xe8, 0x07, 0x79, 0x64, 0x35, 0x8c, 0x79,
- 0x12, 0x24, 0xaf, 0x32, 0x32, 0x61, 0x82, 0x5b, 0x6a, 0x0b, 0xb5, 0xdf, 0x4c, 0xd1, 0x0f, 0x29,
- 0xd1, 0x92, 0x69, 0x13, 0xfa, 0xcd, 0x54, 0x69, 0xae, 0xf6, 0x9b, 0x29, 0xbc, 0x05, 0x44, 0x1b,
- 0xae, 0x11, 0x74, 0x8f, 0xd1, 0x8f, 0xe8, 0xfc, 0xf9, 0x81, 0xf9, 0x5b, 0xdd, 0x63, 0xbf, 0xc8,
- 0xa1, 0x5b, 0xdd, 0x63, 0x78, 0x57, 0x6a, 0xcb, 0x7e, 0x8c, 0xb7, 0x01, 0xfd, 0x98, 0xce, 0x5d,
- 0x1c, 0x98, 0x4b, 0x77, 0x49, 0x34, 0x02, 0xc9, 0x57, 0xbc, 0x3d, 0x59, 0x81, 0xf2, 0xed, 0xf9,
- 0x69, 0x81, 0xec, 0xf6, 0xb0, 0xed, 0x11, 0x75, 0x29, 0x6d, 0x8f, 0x20, 0xca, 0xb6, 0xe7, 0x67,
- 0x85, 0x1c, 0x85, 0x93, 0xb6, 0x87, 0x4f, 0xcb, 0xb6, 0x47, 0xe6, 0x22, 0xdb, 0x43, 0x76, 0xe7,
- 0xe7, 0x79, 0x5c, 0xd2, 0xee, 0x64, 0xfd, 0x33, 0x36, 0x0b, 0xef, 0x8e, 0xfc, 0xa8, 0xe0, 0xdd,
- 0xf9, 0x35, 0x25, 0xca, 0xdf, 0x1d, 0xe9, 0xe9, 0x60, 0xbb, 0x23, 0x28, 0xf0, 0xee, 0xfc, 0x82,
- 0xce, 0xcf, 0xd9, 0x1d, 0x0e, 0x65, 0xbb, 0x23, 0x66, 0xd2, 0xdd, 0xf9, 0x25, 0x9d, 0x9b, 0xbb,
- 0x3b, 0x1c, 0x4e, 0x77, 0xe7, 0x02, 0x00, 0x64, 0xfd, 0xdd, 0xa0, 0x13, 0xae, 0xa3, 0x2f, 0xd9,
- 0xe4, 0x8d, 0x8d, 0x64, 0x82, 0x0e, 0x28, 0xd2, 0xfa, 0xc5, 0x5f, 0x37, 0xd0, 0x97, 0x65, 0xc4,
- 0x2e, 0x36, 0xc1, 0x8b, 0xa0, 0xd4, 0xc8, 0x20, 0x9b, 0xe8, 0x2b, 0x0c, 0x52, 0xe3, 0x90, 0x4d,
- 0xb8, 0x02, 0xa6, 0x28, 0x82, 0x40, 0xdc, 0x06, 0xfa, 0xaa, 0x4e, 0xe3, 0xe2, 0xbf, 0xf1, 0xc8,
- 0xb7, 0x35, 0x0c, 0xb9, 0x81, 0xbe, 0x46, 0x11, 0xb2, 0x0d, 0x5e, 0xe2, 0x34, 0x6b, 0x84, 0xc7,
- 0x43, 0x5f, 0x57, 0x40, 0x98, 0xc7, 0x13, 0x2b, 0xc2, 0xdf, 0x6e, 0xa2, 0x6f, 0xe8, 0x8e, 0x6e,
- 0x62, 0x80, 0x08, 0xed, 0x16, 0xfa, 0xa6, 0x1e, 0xed, 0xad, 0x6c, 0xc9, 0xf8, 0xeb, 0x6d, 0xf4,
- 0x2d, 0x9d, 0xe2, 0x36, 0x5c, 0x01, 0xa5, 0x9a, 0x40, 0xac, 0xaf, 0xa1, 0x6f, 0xb3, 0x38, 0x04,
- 0xc9, 0xfa, 0x1a, 0xc1, 0xec, 0x6c, 0xbf, 0xff, 0xa0, 0xb1, 0xbb, 0xf5, 0x64, 0x7b, 0x7d, 0x1d,
- 0x7d, 0x87, 0x63, 0xb0, 0x91, 0xda, 0x32, 0x0c, 0xc9, 0xf5, 0x06, 0xfa, 0xae, 0x82, 0x21, 0xb6,
- 0xe5, 0x17, 0x60, 0x4a, 0xfd, 0x8b, 0xb9, 0x04, 0xac, 0x80, 0xbd, 0x5a, 0xb3, 0x02, 0xf8, 0x2e,
- 0x28, 0x36, 0x23, 0xd1, 0x1d, 0x47, 0x85, 0x93, 0x3a, 0xe9, 0x32, 0x7a, 0xf9, 0x1e, 0x80, 0x83,
- 0xdd, 0x2e, 0x58, 0x06, 0xf6, 0xab, 0xf0, 0x98, 0xb9, 0xc0, 0xbf, 0xc2, 0x79, 0x70, 0x9a, 0x16,
- 0x57, 0x81, 0xd8, 0xe8, 0x97, 0x3b, 0x85, 0x5b, 0x56, 0xc6, 0x20, 0x77, 0xb6, 0x64, 0x06, 0xdb,
- 0xc0, 0x60, 0xcb, 0x0c, 0x55, 0x30, 0x6f, 0xea, 0x61, 0xc9, 0x1c, 0x53, 0x06, 0x8e, 0x29, 0x33,
- 0x87, 0xd2, 0xab, 0x92, 0x39, 0x4e, 0x19, 0x38, 0x4e, 0x0d, 0x72, 0x0c, 0xf4, 0xa4, 0x64, 0x8e,
- 0x59, 0x03, 0xc7, 0xac, 0x99, 0x43, 0xe9, 0x3d, 0xc9, 0x1c, 0xd0, 0xc0, 0x01, 0x65, 0x8e, 0x07,
- 0x60, 0xd1, 0xdc, 0x61, 0x92, 0x59, 0x26, 0x0c, 0x2c, 0x13, 0x39, 0x2c, 0x6a, 0x17, 0x49, 0x66,
- 0x19, 0x37, 0xb0, 0x8c, 0xcb, 0x2c, 0x35, 0x80, 0xf2, 0xfa, 0x44, 0x32, 0xcf, 0x8c, 0x81, 0x67,
- 0x26, 0x8f, 0x47, 0xeb, 0x03, 0xc9, 0x3c, 0x65, 0x03, 0x4f, 0xd9, 0x58, 0x6d, 0x72, 0xb7, 0xe7,
- 0xa4, 0x7a, 0x2d, 0xc8, 0x0c, 0x5b, 0x60, 0xce, 0xd0, 0xd8, 0x39, 0x89, 0xc2, 0x92, 0x29, 0xee,
- 0x82, 0xb2, 0xde, 0xc5, 0x91, 0xe7, 0x4f, 0x1a, 0xe6, 0x4f, 0x1a, 0x8a, 0x44, 0xef, 0xd8, 0xc8,
- 0x1c, 0x67, 0x0c, 0x1c, 0x67, 0x06, 0x97, 0xa1, 0xb7, 0x66, 0x4e, 0xa2, 0x28, 0xc9, 0x14, 0x31,
- 0x38, 0x37, 0xa4, 0xf7, 0x62, 0xa0, 0x7a, 0x4f, 0xa6, 0x7a, 0x8d, 0x17, 0x1f, 0x92, 0xcf, 0x23,
- 0x70, 0x7e, 0x58, 0xf3, 0xc5, 0xe0, 0x74, 0x5d, 0x75, 0x3a, 0xf4, 0x5d, 0x88, 0xe4, 0xa8, 0x4d,
- 0x0b, 0xce, 0xd4, 0x74, 0x31, 0x38, 0xb9, 0x23, 0x3b, 0x19, 0xf5, 0xed, 0x88, 0xe4, 0x2d, 0x00,
- 0x67, 0x73, 0x1b, 0x2f, 0x06, 0x77, 0xab, 0xaa, 0xbb, 0xfc, 0x77, 0x26, 0x99, 0x8b, 0x95, 0xdb,
- 0x00, 0x48, 0x2d, 0xa2, 0x09, 0x60, 0xd7, 0xea, 0xf5, 0xf2, 0x18, 0xfe, 0xa5, 0xba, 0xe5, 0x97,
- 0x2d, 0xfa, 0xcb, 0x8b, 0x72, 0x01, 0xbb, 0xdb, 0xdd, 0x7e, 0x58, 0xfe, 0x1f, 0xff, 0xcf, 0xaa,
- 0x4e, 0xf1, 0xe6, 0x09, 0x39, 0xc0, 0x56, 0xde, 0x00, 0xd3, 0x5a, 0x67, 0xab, 0x04, 0xac, 0x26,
- 0x3f, 0x50, 0x9a, 0xd7, 0x6e, 0x00, 0x90, 0xfd, 0x63, 0x18, 0x38, 0x03, 0x8a, 0xfb, 0xbb, 0x7b,
- 0x4f, 0xb7, 0xef, 0xef, 0xd4, 0x76, 0xb6, 0x1f, 0x94, 0xc7, 0x60, 0x09, 0x4c, 0x3e, 0xf5, 0xeb,
- 0xcf, 0xea, 0xd5, 0xfd, 0x5a, 0xd9, 0x82, 0x93, 0xe0, 0xd4, 0xe3, 0xbd, 0xfa, 0x6e, 0xb9, 0x70,
- 0xed, 0x1e, 0x28, 0xca, 0x8d, 0xa5, 0x19, 0x50, 0xac, 0xd5, 0xfd, 0xed, 0x9d, 0x87, 0xbb, 0x0d,
- 0x1a, 0xa9, 0x64, 0xa0, 0x11, 0x2b, 0x86, 0x17, 0xe5, 0x42, 0xf5, 0x22, 0xb8, 0xd0, 0x8c, 0x3a,
- 0x03, 0x7f, 0xb6, 0x48, 0xc9, 0x79, 0x39, 0x4e, 0xac, 0x9b, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff,
- 0x29, 0x30, 0x51, 0x54, 0x22, 0x25, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/conformance/internal/conformance_proto/conformance.proto b/vendor/github.com/golang/protobuf/conformance/internal/conformance_proto/conformance.proto
deleted file mode 100644
index fc96074a..00000000
--- a/vendor/github.com/golang/protobuf/conformance/internal/conformance_proto/conformance.proto
+++ /dev/null
@@ -1,273 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package conformance;
-option java_package = "com.google.protobuf.conformance";
-
-import "google/protobuf/any.proto";
-import "google/protobuf/duration.proto";
-import "google/protobuf/field_mask.proto";
-import "google/protobuf/struct.proto";
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/wrappers.proto";
-
-// This defines the conformance testing protocol. This protocol exists between
-// the conformance test suite itself and the code being tested. For each test,
-// the suite will send a ConformanceRequest message and expect a
-// ConformanceResponse message.
-//
-// You can either run the tests in two different ways:
-//
-// 1. in-process (using the interface in conformance_test.h).
-//
-// 2. as a sub-process communicating over a pipe. Information about how to
-// do this is in conformance_test_runner.cc.
-//
-// Pros/cons of the two approaches:
-//
-// - running as a sub-process is much simpler for languages other than C/C++.
-//
-// - running as a sub-process may be more tricky in unusual environments like
-// iOS apps, where fork/stdin/stdout are not available.
-
-enum WireFormat {
- UNSPECIFIED = 0;
- PROTOBUF = 1;
- JSON = 2;
-}
-
-// Represents a single test case's input. The testee should:
-//
-// 1. parse this proto (which should always succeed)
-// 2. parse the protobuf or JSON payload in "payload" (which may fail)
-// 3. if the parse succeeded, serialize the message in the requested format.
-message ConformanceRequest {
- // The payload (whether protobuf of JSON) is always for a TestAllTypes proto
- // (see below).
- oneof payload {
- bytes protobuf_payload = 1;
- string json_payload = 2;
- }
-
- // Which format should the testee serialize its message to?
- WireFormat requested_output_format = 3;
-}
-
-// Represents a single test case's output.
-message ConformanceResponse {
- oneof result {
- // This string should be set to indicate parsing failed. The string can
- // provide more information about the parse error if it is available.
- //
- // Setting this string does not necessarily mean the testee failed the
- // test. Some of the test cases are intentionally invalid input.
- string parse_error = 1;
-
- // If the input was successfully parsed but errors occurred when
- // serializing it to the requested output format, set the error message in
- // this field.
- string serialize_error = 6;
-
- // This should be set if some other error occurred. This will always
- // indicate that the test failed. The string can provide more information
- // about the failure.
- string runtime_error = 2;
-
- // If the input was successfully parsed and the requested output was
- // protobuf, serialize it to protobuf and set it in this field.
- bytes protobuf_payload = 3;
-
- // If the input was successfully parsed and the requested output was JSON,
- // serialize to JSON and set it in this field.
- string json_payload = 4;
-
- // For when the testee skipped the test, likely because a certain feature
- // wasn't supported, like JSON input/output.
- string skipped = 5;
- }
-}
-
-// This proto includes every type of field in both singular and repeated
-// forms.
-message TestAllTypes {
- message NestedMessage {
- int32 a = 1;
- TestAllTypes corecursive = 2;
- }
-
- enum NestedEnum {
- FOO = 0;
- BAR = 1;
- BAZ = 2;
- NEG = -1; // Intentionally negative.
- }
-
- // Singular
- int32 optional_int32 = 1;
- int64 optional_int64 = 2;
- uint32 optional_uint32 = 3;
- uint64 optional_uint64 = 4;
- sint32 optional_sint32 = 5;
- sint64 optional_sint64 = 6;
- fixed32 optional_fixed32 = 7;
- fixed64 optional_fixed64 = 8;
- sfixed32 optional_sfixed32 = 9;
- sfixed64 optional_sfixed64 = 10;
- float optional_float = 11;
- double optional_double = 12;
- bool optional_bool = 13;
- string optional_string = 14;
- bytes optional_bytes = 15;
-
- NestedMessage optional_nested_message = 18;
- ForeignMessage optional_foreign_message = 19;
-
- NestedEnum optional_nested_enum = 21;
- ForeignEnum optional_foreign_enum = 22;
-
- string optional_string_piece = 24 [ctype=STRING_PIECE];
- string optional_cord = 25 [ctype=CORD];
-
- TestAllTypes recursive_message = 27;
-
- // Repeated
- repeated int32 repeated_int32 = 31;
- repeated int64 repeated_int64 = 32;
- repeated uint32 repeated_uint32 = 33;
- repeated uint64 repeated_uint64 = 34;
- repeated sint32 repeated_sint32 = 35;
- repeated sint64 repeated_sint64 = 36;
- repeated fixed32 repeated_fixed32 = 37;
- repeated fixed64 repeated_fixed64 = 38;
- repeated sfixed32 repeated_sfixed32 = 39;
- repeated sfixed64 repeated_sfixed64 = 40;
- repeated float repeated_float = 41;
- repeated double repeated_double = 42;
- repeated bool repeated_bool = 43;
- repeated string repeated_string = 44;
- repeated bytes repeated_bytes = 45;
-
- repeated NestedMessage repeated_nested_message = 48;
- repeated ForeignMessage repeated_foreign_message = 49;
-
- repeated NestedEnum repeated_nested_enum = 51;
- repeated ForeignEnum repeated_foreign_enum = 52;
-
- repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
- repeated string repeated_cord = 55 [ctype=CORD];
-
- // Map
- map < int32, int32> map_int32_int32 = 56;
- map < int64, int64> map_int64_int64 = 57;
- map < uint32, uint32> map_uint32_uint32 = 58;
- map < uint64, uint64> map_uint64_uint64 = 59;
- map < sint32, sint32> map_sint32_sint32 = 60;
- map < sint64, sint64> map_sint64_sint64 = 61;
- map < fixed32, fixed32> map_fixed32_fixed32 = 62;
- map < fixed64, fixed64> map_fixed64_fixed64 = 63;
- map map_sfixed32_sfixed32 = 64;
- map map_sfixed64_sfixed64 = 65;
- map < int32, float> map_int32_float = 66;
- map < int32, double> map_int32_double = 67;
- map < bool, bool> map_bool_bool = 68;
- map < string, string> map_string_string = 69;
- map < string, bytes> map_string_bytes = 70;
- map < string, NestedMessage> map_string_nested_message = 71;
- map < string, ForeignMessage> map_string_foreign_message = 72;
- map < string, NestedEnum> map_string_nested_enum = 73;
- map < string, ForeignEnum> map_string_foreign_enum = 74;
-
- oneof oneof_field {
- uint32 oneof_uint32 = 111;
- NestedMessage oneof_nested_message = 112;
- string oneof_string = 113;
- bytes oneof_bytes = 114;
- }
-
- // Well-known types
- google.protobuf.BoolValue optional_bool_wrapper = 201;
- google.protobuf.Int32Value optional_int32_wrapper = 202;
- google.protobuf.Int64Value optional_int64_wrapper = 203;
- google.protobuf.UInt32Value optional_uint32_wrapper = 204;
- google.protobuf.UInt64Value optional_uint64_wrapper = 205;
- google.protobuf.FloatValue optional_float_wrapper = 206;
- google.protobuf.DoubleValue optional_double_wrapper = 207;
- google.protobuf.StringValue optional_string_wrapper = 208;
- google.protobuf.BytesValue optional_bytes_wrapper = 209;
-
- repeated google.protobuf.BoolValue repeated_bool_wrapper = 211;
- repeated google.protobuf.Int32Value repeated_int32_wrapper = 212;
- repeated google.protobuf.Int64Value repeated_int64_wrapper = 213;
- repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214;
- repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215;
- repeated google.protobuf.FloatValue repeated_float_wrapper = 216;
- repeated google.protobuf.DoubleValue repeated_double_wrapper = 217;
- repeated google.protobuf.StringValue repeated_string_wrapper = 218;
- repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219;
-
- google.protobuf.Duration optional_duration = 301;
- google.protobuf.Timestamp optional_timestamp = 302;
- google.protobuf.FieldMask optional_field_mask = 303;
- google.protobuf.Struct optional_struct = 304;
- google.protobuf.Any optional_any = 305;
- google.protobuf.Value optional_value = 306;
-
- repeated google.protobuf.Duration repeated_duration = 311;
- repeated google.protobuf.Timestamp repeated_timestamp = 312;
- repeated google.protobuf.FieldMask repeated_fieldmask = 313;
- repeated google.protobuf.Struct repeated_struct = 324;
- repeated google.protobuf.Any repeated_any = 315;
- repeated google.protobuf.Value repeated_value = 316;
-
- // Test field-name-to-JSON-name convention.
- int32 fieldname1 = 401;
- int32 field_name2 = 402;
- int32 _field_name3 = 403;
- int32 field__name4_ = 404;
- int32 field0name5 = 405;
- int32 field_0_name6 = 406;
- int32 fieldName7 = 407;
- int32 FieldName8 = 408;
- int32 field_Name9 = 409;
- int32 Field_Name10 = 410;
- int32 FIELD_NAME11 = 411;
- int32 FIELD_name12 = 412;
-}
-
-message ForeignMessage {
- int32 c = 1;
-}
-
-enum ForeignEnum {
- FOREIGN_FOO = 0;
- FOREIGN_BAR = 1;
- FOREIGN_BAZ = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/conformance/test.sh b/vendor/github.com/golang/protobuf/conformance/test.sh
deleted file mode 100755
index e6de29b9..00000000
--- a/vendor/github.com/golang/protobuf/conformance/test.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-PROTOBUF_ROOT=$1
-CONFORMANCE_ROOT=$1/conformance
-CONFORMANCE_TEST_RUNNER=$CONFORMANCE_ROOT/conformance-test-runner
-
-cd $(dirname $0)
-
-if [[ $PROTOBUF_ROOT == "" ]]; then
- echo "usage: test.sh " >/dev/stderr
- exit 1
-fi
-
-if [[ ! -x $CONFORMANCE_TEST_RUNNER ]]; then
- echo "SKIP: conformance test runner not installed" >/dev/stderr
- exit 0
-fi
-
-a=$CONFORMANCE_ROOT/conformance.proto
-b=internal/conformance_proto/conformance.proto
-if [[ $(diff $a $b) != "" ]]; then
- cp $a $b
- echo "WARNING: conformance.proto is out of date" >/dev/stderr
-fi
-
-$CONFORMANCE_TEST_RUNNER --failure_list failure_list_go.txt ./conformance.sh
diff --git a/vendor/github.com/golang/protobuf/descriptor/descriptor.go b/vendor/github.com/golang/protobuf/descriptor/descriptor.go
deleted file mode 100644
index ac7e51bf..00000000
--- a/vendor/github.com/golang/protobuf/descriptor/descriptor.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-// Package descriptor provides functions for obtaining protocol buffer
-// descriptors for generated Go types.
-//
-// These functions cannot go in package proto because they depend on the
-// generated protobuf descriptor messages, which themselves depend on proto.
-package descriptor
-
-import (
- "bytes"
- "compress/gzip"
- "fmt"
- "io/ioutil"
-
- "github.com/golang/protobuf/proto"
- protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
-)
-
-// extractFile extracts a FileDescriptorProto from a gzip'd buffer.
-func extractFile(gz []byte) (*protobuf.FileDescriptorProto, error) {
- r, err := gzip.NewReader(bytes.NewReader(gz))
- if err != nil {
- return nil, fmt.Errorf("failed to open gzip reader: %v", err)
- }
- defer r.Close()
-
- b, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, fmt.Errorf("failed to uncompress descriptor: %v", err)
- }
-
- fd := new(protobuf.FileDescriptorProto)
- if err := proto.Unmarshal(b, fd); err != nil {
- return nil, fmt.Errorf("malformed FileDescriptorProto: %v", err)
- }
-
- return fd, nil
-}
-
-// Message is a proto.Message with a method to return its descriptor.
-//
-// Message types generated by the protocol compiler always satisfy
-// the Message interface.
-type Message interface {
- proto.Message
- Descriptor() ([]byte, []int)
-}
-
-// ForMessage returns a FileDescriptorProto and a DescriptorProto from within it
-// describing the given message.
-func ForMessage(msg Message) (fd *protobuf.FileDescriptorProto, md *protobuf.DescriptorProto) {
- gz, path := msg.Descriptor()
- fd, err := extractFile(gz)
- if err != nil {
- panic(fmt.Sprintf("invalid FileDescriptorProto for %T: %v", msg, err))
- }
-
- md = fd.MessageType[path[0]]
- for _, i := range path[1:] {
- md = md.NestedType[i]
- }
- return fd, md
-}
diff --git a/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go b/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go
deleted file mode 100644
index bf5174d3..00000000
--- a/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package descriptor_test
-
-import (
- "fmt"
- "testing"
-
- "github.com/golang/protobuf/descriptor"
- tpb "github.com/golang/protobuf/proto/test_proto"
- protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
-)
-
-func TestMessage(t *testing.T) {
- var msg *protobuf.DescriptorProto
- fd, md := descriptor.ForMessage(msg)
- if pkg, want := fd.GetPackage(), "google.protobuf"; pkg != want {
- t.Errorf("descriptor.ForMessage(%T).GetPackage() = %q; want %q", msg, pkg, want)
- }
- if name, want := md.GetName(), "DescriptorProto"; name != want {
- t.Fatalf("descriptor.ForMessage(%T).GetName() = %q; want %q", msg, name, want)
- }
-}
-
-func Example_options() {
- var msg *tpb.MyMessageSet
- _, md := descriptor.ForMessage(msg)
- if md.GetOptions().GetMessageSetWireFormat() {
- fmt.Printf("%v uses option message_set_wire_format.\n", md.GetName())
- }
-
- // Output:
- // MyMessageSet uses option message_set_wire_format.
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
deleted file mode 100644
index ff368f33..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
+++ /dev/null
@@ -1,1241 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 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.
-
-/*
-Package jsonpb provides marshaling and unmarshaling between protocol buffers and JSON.
-It follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json.
-
-This package produces a different output than the standard "encoding/json" package,
-which does not operate correctly on protocol buffers.
-*/
-package jsonpb
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "math"
- "reflect"
- "sort"
- "strconv"
- "strings"
- "time"
-
- "github.com/golang/protobuf/proto"
-
- stpb "github.com/golang/protobuf/ptypes/struct"
-)
-
-const secondInNanos = int64(time.Second / time.Nanosecond)
-
-// Marshaler is a configurable object for converting between
-// protocol buffer objects and a JSON representation for them.
-type Marshaler struct {
- // Whether to render enum values as integers, as opposed to string values.
- EnumsAsInts bool
-
- // Whether to render fields with zero values.
- EmitDefaults bool
-
- // A string to indent each level by. The presence of this field will
- // also cause a space to appear between the field separator and
- // value, and for newlines to be appear between fields and array
- // elements.
- Indent string
-
- // Whether to use the original (.proto) name for fields.
- OrigName bool
-
- // A custom URL resolver to use when marshaling Any messages to JSON.
- // If unset, the default resolution strategy is to extract the
- // fully-qualified type name from the type URL and pass that to
- // proto.MessageType(string).
- AnyResolver AnyResolver
-}
-
-// AnyResolver takes a type URL, present in an Any message, and resolves it into
-// an instance of the associated message.
-type AnyResolver interface {
- Resolve(typeUrl string) (proto.Message, error)
-}
-
-func defaultResolveAny(typeUrl string) (proto.Message, error) {
- // Only the part of typeUrl after the last slash is relevant.
- mname := typeUrl
- if slash := strings.LastIndex(mname, "/"); slash >= 0 {
- mname = mname[slash+1:]
- }
- mt := proto.MessageType(mname)
- if mt == nil {
- return nil, fmt.Errorf("unknown message type %q", mname)
- }
- return reflect.New(mt.Elem()).Interface().(proto.Message), nil
-}
-
-// JSONPBMarshaler is implemented by protobuf messages that customize the
-// way they are marshaled to JSON. Messages that implement this should
-// also implement JSONPBUnmarshaler so that the custom format can be
-// parsed.
-type JSONPBMarshaler interface {
- MarshalJSONPB(*Marshaler) ([]byte, error)
-}
-
-// JSONPBUnmarshaler is implemented by protobuf messages that customize
-// the way they are unmarshaled from JSON. Messages that implement this
-// should also implement JSONPBMarshaler so that the custom format can be
-// produced.
-type JSONPBUnmarshaler interface {
- UnmarshalJSONPB(*Unmarshaler, []byte) error
-}
-
-// Marshal marshals a protocol buffer into JSON.
-func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error {
- v := reflect.ValueOf(pb)
- if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) {
- return errors.New("Marshal called with nil")
- }
- // Check for unset required fields first.
- if err := checkRequiredFields(pb); err != nil {
- return err
- }
- writer := &errWriter{writer: out}
- return m.marshalObject(writer, pb, "", "")
-}
-
-// MarshalToString converts a protocol buffer object to JSON string.
-func (m *Marshaler) MarshalToString(pb proto.Message) (string, error) {
- var buf bytes.Buffer
- if err := m.Marshal(&buf, pb); err != nil {
- return "", err
- }
- return buf.String(), nil
-}
-
-type int32Slice []int32
-
-var nonFinite = map[string]float64{
- `"NaN"`: math.NaN(),
- `"Infinity"`: math.Inf(1),
- `"-Infinity"`: math.Inf(-1),
-}
-
-// For sorting extensions ids to ensure stable output.
-func (s int32Slice) Len() int { return len(s) }
-func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }
-func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-
-type wkt interface {
- XXX_WellKnownType() string
-}
-
-// marshalObject writes a struct to the Writer.
-func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeURL string) error {
- if jsm, ok := v.(JSONPBMarshaler); ok {
- b, err := jsm.MarshalJSONPB(m)
- if err != nil {
- return err
- }
- if typeURL != "" {
- // we are marshaling this object to an Any type
- var js map[string]*json.RawMessage
- if err = json.Unmarshal(b, &js); err != nil {
- return fmt.Errorf("type %T produced invalid JSON: %v", v, err)
- }
- turl, err := json.Marshal(typeURL)
- if err != nil {
- return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err)
- }
- js["@type"] = (*json.RawMessage)(&turl)
- if b, err = json.Marshal(js); err != nil {
- return err
- }
- }
-
- out.write(string(b))
- return out.err
- }
-
- s := reflect.ValueOf(v).Elem()
-
- // Handle well-known types.
- if wkt, ok := v.(wkt); ok {
- switch wkt.XXX_WellKnownType() {
- case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value",
- "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue":
- // "Wrappers use the same representation in JSON
- // as the wrapped primitive type, ..."
- sprop := proto.GetProperties(s.Type())
- return m.marshalValue(out, sprop.Prop[0], s.Field(0), indent)
- case "Any":
- // Any is a bit more involved.
- return m.marshalAny(out, v, indent)
- case "Duration":
- // "Generated output always contains 0, 3, 6, or 9 fractional digits,
- // depending on required precision."
- s, ns := s.Field(0).Int(), s.Field(1).Int()
- if ns <= -secondInNanos || ns >= secondInNanos {
- return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos)
- }
- if (s > 0 && ns < 0) || (s < 0 && ns > 0) {
- return errors.New("signs of seconds and nanos do not match")
- }
- if s < 0 {
- ns = -ns
- }
- x := fmt.Sprintf("%d.%09d", s, ns)
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, ".000")
- out.write(`"`)
- out.write(x)
- out.write(`s"`)
- return out.err
- case "Struct", "ListValue":
- // Let marshalValue handle the `Struct.fields` map or the `ListValue.values` slice.
- // TODO: pass the correct Properties if needed.
- return m.marshalValue(out, &proto.Properties{}, s.Field(0), indent)
- case "Timestamp":
- // "RFC 3339, where generated output will always be Z-normalized
- // and uses 0, 3, 6 or 9 fractional digits."
- s, ns := s.Field(0).Int(), s.Field(1).Int()
- if ns < 0 || ns >= secondInNanos {
- return fmt.Errorf("ns out of range [0, %v)", secondInNanos)
- }
- t := time.Unix(s, ns).UTC()
- // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits).
- x := t.Format("2006-01-02T15:04:05.000000000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, ".000")
- out.write(`"`)
- out.write(x)
- out.write(`Z"`)
- return out.err
- case "Value":
- // Value has a single oneof.
- kind := s.Field(0)
- if kind.IsNil() {
- // "absence of any variant indicates an error"
- return errors.New("nil Value")
- }
- // oneof -> *T -> T -> T.F
- x := kind.Elem().Elem().Field(0)
- // TODO: pass the correct Properties if needed.
- return m.marshalValue(out, &proto.Properties{}, x, indent)
- }
- }
-
- out.write("{")
- if m.Indent != "" {
- out.write("\n")
- }
-
- firstField := true
-
- if typeURL != "" {
- if err := m.marshalTypeURL(out, indent, typeURL); err != nil {
- return err
- }
- firstField = false
- }
-
- for i := 0; i < s.NumField(); i++ {
- value := s.Field(i)
- valueField := s.Type().Field(i)
- if strings.HasPrefix(valueField.Name, "XXX_") {
- continue
- }
-
- // IsNil will panic on most value kinds.
- switch value.Kind() {
- case reflect.Chan, reflect.Func, reflect.Interface:
- if value.IsNil() {
- continue
- }
- }
-
- if !m.EmitDefaults {
- switch value.Kind() {
- case reflect.Bool:
- if !value.Bool() {
- continue
- }
- case reflect.Int32, reflect.Int64:
- if value.Int() == 0 {
- continue
- }
- case reflect.Uint32, reflect.Uint64:
- if value.Uint() == 0 {
- continue
- }
- case reflect.Float32, reflect.Float64:
- if value.Float() == 0 {
- continue
- }
- case reflect.String:
- if value.Len() == 0 {
- continue
- }
- case reflect.Map, reflect.Ptr, reflect.Slice:
- if value.IsNil() {
- continue
- }
- }
- }
-
- // Oneof fields need special handling.
- if valueField.Tag.Get("protobuf_oneof") != "" {
- // value is an interface containing &T{real_value}.
- sv := value.Elem().Elem() // interface -> *T -> T
- value = sv.Field(0)
- valueField = sv.Type().Field(0)
- }
- prop := jsonProperties(valueField, m.OrigName)
- if !firstField {
- m.writeSep(out)
- }
- if err := m.marshalField(out, prop, value, indent); err != nil {
- return err
- }
- firstField = false
- }
-
- // Handle proto2 extensions.
- if ep, ok := v.(proto.Message); ok {
- extensions := proto.RegisteredExtensions(v)
- // Sort extensions for stable output.
- ids := make([]int32, 0, len(extensions))
- for id, desc := range extensions {
- if !proto.HasExtension(ep, desc) {
- continue
- }
- ids = append(ids, id)
- }
- sort.Sort(int32Slice(ids))
- for _, id := range ids {
- desc := extensions[id]
- if desc == nil {
- // unknown extension
- continue
- }
- ext, extErr := proto.GetExtension(ep, desc)
- if extErr != nil {
- return extErr
- }
- value := reflect.ValueOf(ext)
- var prop proto.Properties
- prop.Parse(desc.Tag)
- prop.JSONName = fmt.Sprintf("[%s]", desc.Name)
- if !firstField {
- m.writeSep(out)
- }
- if err := m.marshalField(out, &prop, value, indent); err != nil {
- return err
- }
- firstField = false
- }
-
- }
-
- if m.Indent != "" {
- out.write("\n")
- out.write(indent)
- }
- out.write("}")
- return out.err
-}
-
-func (m *Marshaler) writeSep(out *errWriter) {
- if m.Indent != "" {
- out.write(",\n")
- } else {
- out.write(",")
- }
-}
-
-func (m *Marshaler) marshalAny(out *errWriter, any proto.Message, indent string) error {
- // "If the Any contains a value that has a special JSON mapping,
- // it will be converted as follows: {"@type": xxx, "value": yyy}.
- // Otherwise, the value will be converted into a JSON object,
- // and the "@type" field will be inserted to indicate the actual data type."
- v := reflect.ValueOf(any).Elem()
- turl := v.Field(0).String()
- val := v.Field(1).Bytes()
-
- var msg proto.Message
- var err error
- if m.AnyResolver != nil {
- msg, err = m.AnyResolver.Resolve(turl)
- } else {
- msg, err = defaultResolveAny(turl)
- }
- if err != nil {
- return err
- }
-
- if err := proto.Unmarshal(val, msg); err != nil {
- return err
- }
-
- if _, ok := msg.(wkt); ok {
- out.write("{")
- if m.Indent != "" {
- out.write("\n")
- }
- if err := m.marshalTypeURL(out, indent, turl); err != nil {
- return err
- }
- m.writeSep(out)
- if m.Indent != "" {
- out.write(indent)
- out.write(m.Indent)
- out.write(`"value": `)
- } else {
- out.write(`"value":`)
- }
- if err := m.marshalObject(out, msg, indent+m.Indent, ""); err != nil {
- return err
- }
- if m.Indent != "" {
- out.write("\n")
- out.write(indent)
- }
- out.write("}")
- return out.err
- }
-
- return m.marshalObject(out, msg, indent, turl)
-}
-
-func (m *Marshaler) marshalTypeURL(out *errWriter, indent, typeURL string) error {
- if m.Indent != "" {
- out.write(indent)
- out.write(m.Indent)
- }
- out.write(`"@type":`)
- if m.Indent != "" {
- out.write(" ")
- }
- b, err := json.Marshal(typeURL)
- if err != nil {
- return err
- }
- out.write(string(b))
- return out.err
-}
-
-// marshalField writes field description and value to the Writer.
-func (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error {
- if m.Indent != "" {
- out.write(indent)
- out.write(m.Indent)
- }
- out.write(`"`)
- out.write(prop.JSONName)
- out.write(`":`)
- if m.Indent != "" {
- out.write(" ")
- }
- if err := m.marshalValue(out, prop, v, indent); err != nil {
- return err
- }
- return nil
-}
-
-// marshalValue writes the value to the Writer.
-func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error {
- var err error
- v = reflect.Indirect(v)
-
- // Handle nil pointer
- if v.Kind() == reflect.Invalid {
- out.write("null")
- return out.err
- }
-
- // Handle repeated elements.
- if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 {
- out.write("[")
- comma := ""
- for i := 0; i < v.Len(); i++ {
- sliceVal := v.Index(i)
- out.write(comma)
- if m.Indent != "" {
- out.write("\n")
- out.write(indent)
- out.write(m.Indent)
- out.write(m.Indent)
- }
- if err := m.marshalValue(out, prop, sliceVal, indent+m.Indent); err != nil {
- return err
- }
- comma = ","
- }
- if m.Indent != "" {
- out.write("\n")
- out.write(indent)
- out.write(m.Indent)
- }
- out.write("]")
- return out.err
- }
-
- // Handle well-known types.
- // Most are handled up in marshalObject (because 99% are messages).
- if wkt, ok := v.Interface().(wkt); ok {
- switch wkt.XXX_WellKnownType() {
- case "NullValue":
- out.write("null")
- return out.err
- }
- }
-
- // Handle enumerations.
- if !m.EnumsAsInts && prop.Enum != "" {
- // Unknown enum values will are stringified by the proto library as their
- // value. Such values should _not_ be quoted or they will be interpreted
- // as an enum string instead of their value.
- enumStr := v.Interface().(fmt.Stringer).String()
- var valStr string
- if v.Kind() == reflect.Ptr {
- valStr = strconv.Itoa(int(v.Elem().Int()))
- } else {
- valStr = strconv.Itoa(int(v.Int()))
- }
- isKnownEnum := enumStr != valStr
- if isKnownEnum {
- out.write(`"`)
- }
- out.write(enumStr)
- if isKnownEnum {
- out.write(`"`)
- }
- return out.err
- }
-
- // Handle nested messages.
- if v.Kind() == reflect.Struct {
- return m.marshalObject(out, v.Addr().Interface().(proto.Message), indent+m.Indent, "")
- }
-
- // Handle maps.
- // Since Go randomizes map iteration, we sort keys for stable output.
- if v.Kind() == reflect.Map {
- out.write(`{`)
- keys := v.MapKeys()
- sort.Sort(mapKeys(keys))
- for i, k := range keys {
- if i > 0 {
- out.write(`,`)
- }
- if m.Indent != "" {
- out.write("\n")
- out.write(indent)
- out.write(m.Indent)
- out.write(m.Indent)
- }
-
- b, err := json.Marshal(k.Interface())
- if err != nil {
- return err
- }
- s := string(b)
-
- // If the JSON is not a string value, encode it again to make it one.
- if !strings.HasPrefix(s, `"`) {
- b, err := json.Marshal(s)
- if err != nil {
- return err
- }
- s = string(b)
- }
-
- out.write(s)
- out.write(`:`)
- if m.Indent != "" {
- out.write(` `)
- }
-
- if err := m.marshalValue(out, prop, v.MapIndex(k), indent+m.Indent); err != nil {
- return err
- }
- }
- if m.Indent != "" {
- out.write("\n")
- out.write(indent)
- out.write(m.Indent)
- }
- out.write(`}`)
- return out.err
- }
-
- // Handle non-finite floats, e.g. NaN, Infinity and -Infinity.
- if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 {
- f := v.Float()
- var sval string
- switch {
- case math.IsInf(f, 1):
- sval = `"Infinity"`
- case math.IsInf(f, -1):
- sval = `"-Infinity"`
- case math.IsNaN(f):
- sval = `"NaN"`
- }
- if sval != "" {
- out.write(sval)
- return out.err
- }
- }
-
- // Default handling defers to the encoding/json library.
- b, err := json.Marshal(v.Interface())
- if err != nil {
- return err
- }
- needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64)
- if needToQuote {
- out.write(`"`)
- }
- out.write(string(b))
- if needToQuote {
- out.write(`"`)
- }
- return out.err
-}
-
-// Unmarshaler is a configurable object for converting from a JSON
-// representation to a protocol buffer object.
-type Unmarshaler struct {
- // Whether to allow messages to contain unknown fields, as opposed to
- // failing to unmarshal.
- AllowUnknownFields bool
-
- // A custom URL resolver to use when unmarshaling Any messages from JSON.
- // If unset, the default resolution strategy is to extract the
- // fully-qualified type name from the type URL and pass that to
- // proto.MessageType(string).
- AnyResolver AnyResolver
-}
-
-// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream.
-// This function is lenient and will decode any options permutations of the
-// related Marshaler.
-func (u *Unmarshaler) UnmarshalNext(dec *json.Decoder, pb proto.Message) error {
- inputValue := json.RawMessage{}
- if err := dec.Decode(&inputValue); err != nil {
- return err
- }
- if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil {
- return err
- }
- return checkRequiredFields(pb)
-}
-
-// Unmarshal unmarshals a JSON object stream into a protocol
-// buffer. This function is lenient and will decode any options
-// permutations of the related Marshaler.
-func (u *Unmarshaler) Unmarshal(r io.Reader, pb proto.Message) error {
- dec := json.NewDecoder(r)
- return u.UnmarshalNext(dec, pb)
-}
-
-// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream.
-// This function is lenient and will decode any options permutations of the
-// related Marshaler.
-func UnmarshalNext(dec *json.Decoder, pb proto.Message) error {
- return new(Unmarshaler).UnmarshalNext(dec, pb)
-}
-
-// Unmarshal unmarshals a JSON object stream into a protocol
-// buffer. This function is lenient and will decode any options
-// permutations of the related Marshaler.
-func Unmarshal(r io.Reader, pb proto.Message) error {
- return new(Unmarshaler).Unmarshal(r, pb)
-}
-
-// UnmarshalString will populate the fields of a protocol buffer based
-// on a JSON string. This function is lenient and will decode any options
-// permutations of the related Marshaler.
-func UnmarshalString(str string, pb proto.Message) error {
- return new(Unmarshaler).Unmarshal(strings.NewReader(str), pb)
-}
-
-// unmarshalValue converts/copies a value into the target.
-// prop may be nil.
-func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMessage, prop *proto.Properties) error {
- targetType := target.Type()
-
- // Allocate memory for pointer fields.
- if targetType.Kind() == reflect.Ptr {
- // If input value is "null" and target is a pointer type, then the field should be treated as not set
- // UNLESS the target is structpb.Value, in which case it should be set to structpb.NullValue.
- _, isJSONPBUnmarshaler := target.Interface().(JSONPBUnmarshaler)
- if string(inputValue) == "null" && targetType != reflect.TypeOf(&stpb.Value{}) && !isJSONPBUnmarshaler {
- return nil
- }
- target.Set(reflect.New(targetType.Elem()))
-
- return u.unmarshalValue(target.Elem(), inputValue, prop)
- }
-
- if jsu, ok := target.Addr().Interface().(JSONPBUnmarshaler); ok {
- return jsu.UnmarshalJSONPB(u, []byte(inputValue))
- }
-
- // Handle well-known types that are not pointers.
- if w, ok := target.Addr().Interface().(wkt); ok {
- switch w.XXX_WellKnownType() {
- case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value",
- "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue":
- return u.unmarshalValue(target.Field(0), inputValue, prop)
- case "Any":
- // Use json.RawMessage pointer type instead of value to support pre-1.8 version.
- // 1.8 changed RawMessage.MarshalJSON from pointer type to value type, see
- // https://github.com/golang/go/issues/14493
- var jsonFields map[string]*json.RawMessage
- if err := json.Unmarshal(inputValue, &jsonFields); err != nil {
- return err
- }
-
- val, ok := jsonFields["@type"]
- if !ok || val == nil {
- return errors.New("Any JSON doesn't have '@type'")
- }
-
- var turl string
- if err := json.Unmarshal([]byte(*val), &turl); err != nil {
- return fmt.Errorf("can't unmarshal Any's '@type': %q", *val)
- }
- target.Field(0).SetString(turl)
-
- var m proto.Message
- var err error
- if u.AnyResolver != nil {
- m, err = u.AnyResolver.Resolve(turl)
- } else {
- m, err = defaultResolveAny(turl)
- }
- if err != nil {
- return err
- }
-
- if _, ok := m.(wkt); ok {
- val, ok := jsonFields["value"]
- if !ok {
- return errors.New("Any JSON doesn't have 'value'")
- }
-
- if err := u.unmarshalValue(reflect.ValueOf(m).Elem(), *val, nil); err != nil {
- return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err)
- }
- } else {
- delete(jsonFields, "@type")
- nestedProto, err := json.Marshal(jsonFields)
- if err != nil {
- return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err)
- }
-
- if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), nestedProto, nil); err != nil {
- return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err)
- }
- }
-
- b, err := proto.Marshal(m)
- if err != nil {
- return fmt.Errorf("can't marshal proto %T into Any.Value: %v", m, err)
- }
- target.Field(1).SetBytes(b)
-
- return nil
- case "Duration":
- unq, err := strconv.Unquote(string(inputValue))
- if err != nil {
- return err
- }
-
- d, err := time.ParseDuration(unq)
- if err != nil {
- return fmt.Errorf("bad Duration: %v", err)
- }
-
- ns := d.Nanoseconds()
- s := ns / 1e9
- ns %= 1e9
- target.Field(0).SetInt(s)
- target.Field(1).SetInt(ns)
- return nil
- case "Timestamp":
- unq, err := strconv.Unquote(string(inputValue))
- if err != nil {
- return err
- }
-
- t, err := time.Parse(time.RFC3339Nano, unq)
- if err != nil {
- return fmt.Errorf("bad Timestamp: %v", err)
- }
-
- target.Field(0).SetInt(t.Unix())
- target.Field(1).SetInt(int64(t.Nanosecond()))
- return nil
- case "Struct":
- var m map[string]json.RawMessage
- if err := json.Unmarshal(inputValue, &m); err != nil {
- return fmt.Errorf("bad StructValue: %v", err)
- }
-
- target.Field(0).Set(reflect.ValueOf(map[string]*stpb.Value{}))
- for k, jv := range m {
- pv := &stpb.Value{}
- if err := u.unmarshalValue(reflect.ValueOf(pv).Elem(), jv, prop); err != nil {
- return fmt.Errorf("bad value in StructValue for key %q: %v", k, err)
- }
- target.Field(0).SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(pv))
- }
- return nil
- case "ListValue":
- var s []json.RawMessage
- if err := json.Unmarshal(inputValue, &s); err != nil {
- return fmt.Errorf("bad ListValue: %v", err)
- }
-
- target.Field(0).Set(reflect.ValueOf(make([]*stpb.Value, len(s))))
- for i, sv := range s {
- if err := u.unmarshalValue(target.Field(0).Index(i), sv, prop); err != nil {
- return err
- }
- }
- return nil
- case "Value":
- ivStr := string(inputValue)
- if ivStr == "null" {
- target.Field(0).Set(reflect.ValueOf(&stpb.Value_NullValue{}))
- } else if v, err := strconv.ParseFloat(ivStr, 0); err == nil {
- target.Field(0).Set(reflect.ValueOf(&stpb.Value_NumberValue{v}))
- } else if v, err := strconv.Unquote(ivStr); err == nil {
- target.Field(0).Set(reflect.ValueOf(&stpb.Value_StringValue{v}))
- } else if v, err := strconv.ParseBool(ivStr); err == nil {
- target.Field(0).Set(reflect.ValueOf(&stpb.Value_BoolValue{v}))
- } else if err := json.Unmarshal(inputValue, &[]json.RawMessage{}); err == nil {
- lv := &stpb.ListValue{}
- target.Field(0).Set(reflect.ValueOf(&stpb.Value_ListValue{lv}))
- return u.unmarshalValue(reflect.ValueOf(lv).Elem(), inputValue, prop)
- } else if err := json.Unmarshal(inputValue, &map[string]json.RawMessage{}); err == nil {
- sv := &stpb.Struct{}
- target.Field(0).Set(reflect.ValueOf(&stpb.Value_StructValue{sv}))
- return u.unmarshalValue(reflect.ValueOf(sv).Elem(), inputValue, prop)
- } else {
- return fmt.Errorf("unrecognized type for Value %q", ivStr)
- }
- return nil
- }
- }
-
- // Handle enums, which have an underlying type of int32,
- // and may appear as strings.
- // The case of an enum appearing as a number is handled
- // at the bottom of this function.
- if inputValue[0] == '"' && prop != nil && prop.Enum != "" {
- vmap := proto.EnumValueMap(prop.Enum)
- // Don't need to do unquoting; valid enum names
- // are from a limited character set.
- s := inputValue[1 : len(inputValue)-1]
- n, ok := vmap[string(s)]
- if !ok {
- return fmt.Errorf("unknown value %q for enum %s", s, prop.Enum)
- }
- if target.Kind() == reflect.Ptr { // proto2
- target.Set(reflect.New(targetType.Elem()))
- target = target.Elem()
- }
- target.SetInt(int64(n))
- return nil
- }
-
- // Handle nested messages.
- if targetType.Kind() == reflect.Struct {
- var jsonFields map[string]json.RawMessage
- if err := json.Unmarshal(inputValue, &jsonFields); err != nil {
- return err
- }
-
- consumeField := func(prop *proto.Properties) (json.RawMessage, bool) {
- // Be liberal in what names we accept; both orig_name and camelName are okay.
- fieldNames := acceptedJSONFieldNames(prop)
-
- vOrig, okOrig := jsonFields[fieldNames.orig]
- vCamel, okCamel := jsonFields[fieldNames.camel]
- if !okOrig && !okCamel {
- return nil, false
- }
- // If, for some reason, both are present in the data, favour the camelName.
- var raw json.RawMessage
- if okOrig {
- raw = vOrig
- delete(jsonFields, fieldNames.orig)
- }
- if okCamel {
- raw = vCamel
- delete(jsonFields, fieldNames.camel)
- }
- return raw, true
- }
-
- sprops := proto.GetProperties(targetType)
- for i := 0; i < target.NumField(); i++ {
- ft := target.Type().Field(i)
- if strings.HasPrefix(ft.Name, "XXX_") {
- continue
- }
-
- valueForField, ok := consumeField(sprops.Prop[i])
- if !ok {
- continue
- }
-
- if err := u.unmarshalValue(target.Field(i), valueForField, sprops.Prop[i]); err != nil {
- return err
- }
- }
- // Check for any oneof fields.
- if len(jsonFields) > 0 {
- for _, oop := range sprops.OneofTypes {
- raw, ok := consumeField(oop.Prop)
- if !ok {
- continue
- }
- nv := reflect.New(oop.Type.Elem())
- target.Field(oop.Field).Set(nv)
- if err := u.unmarshalValue(nv.Elem().Field(0), raw, oop.Prop); err != nil {
- return err
- }
- }
- }
- // Handle proto2 extensions.
- if len(jsonFields) > 0 {
- if ep, ok := target.Addr().Interface().(proto.Message); ok {
- for _, ext := range proto.RegisteredExtensions(ep) {
- name := fmt.Sprintf("[%s]", ext.Name)
- raw, ok := jsonFields[name]
- if !ok {
- continue
- }
- delete(jsonFields, name)
- nv := reflect.New(reflect.TypeOf(ext.ExtensionType).Elem())
- if err := u.unmarshalValue(nv.Elem(), raw, nil); err != nil {
- return err
- }
- if err := proto.SetExtension(ep, ext, nv.Interface()); err != nil {
- return err
- }
- }
- }
- }
- if !u.AllowUnknownFields && len(jsonFields) > 0 {
- // Pick any field to be the scapegoat.
- var f string
- for fname := range jsonFields {
- f = fname
- break
- }
- return fmt.Errorf("unknown field %q in %v", f, targetType)
- }
- return nil
- }
-
- // Handle arrays (which aren't encoded bytes)
- if targetType.Kind() == reflect.Slice && targetType.Elem().Kind() != reflect.Uint8 {
- var slc []json.RawMessage
- if err := json.Unmarshal(inputValue, &slc); err != nil {
- return err
- }
- if slc != nil {
- l := len(slc)
- target.Set(reflect.MakeSlice(targetType, l, l))
- for i := 0; i < l; i++ {
- if err := u.unmarshalValue(target.Index(i), slc[i], prop); err != nil {
- return err
- }
- }
- }
- return nil
- }
-
- // Handle maps (whose keys are always strings)
- if targetType.Kind() == reflect.Map {
- var mp map[string]json.RawMessage
- if err := json.Unmarshal(inputValue, &mp); err != nil {
- return err
- }
- if mp != nil {
- target.Set(reflect.MakeMap(targetType))
- for ks, raw := range mp {
- // Unmarshal map key. The core json library already decoded the key into a
- // string, so we handle that specially. Other types were quoted post-serialization.
- var k reflect.Value
- if targetType.Key().Kind() == reflect.String {
- k = reflect.ValueOf(ks)
- } else {
- k = reflect.New(targetType.Key()).Elem()
- // TODO: pass the correct Properties if needed.
- if err := u.unmarshalValue(k, json.RawMessage(ks), nil); err != nil {
- return err
- }
- }
-
- // Unmarshal map value.
- v := reflect.New(targetType.Elem()).Elem()
- // TODO: pass the correct Properties if needed.
- if err := u.unmarshalValue(v, raw, nil); err != nil {
- return err
- }
- target.SetMapIndex(k, v)
- }
- }
- return nil
- }
-
- // 64-bit integers can be encoded as strings. In this case we drop
- // the quotes and proceed as normal.
- isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64
- if isNum && strings.HasPrefix(string(inputValue), `"`) {
- inputValue = inputValue[1 : len(inputValue)-1]
- }
-
- // Non-finite numbers can be encoded as strings.
- isFloat := targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64
- if isFloat {
- if num, ok := nonFinite[string(inputValue)]; ok {
- target.SetFloat(num)
- return nil
- }
- }
-
- // Use the encoding/json for parsing other value types.
- return json.Unmarshal(inputValue, target.Addr().Interface())
-}
-
-// jsonProperties returns parsed proto.Properties for the field and corrects JSONName attribute.
-func jsonProperties(f reflect.StructField, origName bool) *proto.Properties {
- var prop proto.Properties
- prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f)
- if origName || prop.JSONName == "" {
- prop.JSONName = prop.OrigName
- }
- return &prop
-}
-
-type fieldNames struct {
- orig, camel string
-}
-
-func acceptedJSONFieldNames(prop *proto.Properties) fieldNames {
- opts := fieldNames{orig: prop.OrigName, camel: prop.OrigName}
- if prop.JSONName != "" {
- opts.camel = prop.JSONName
- }
- return opts
-}
-
-// Writer wrapper inspired by https://blog.golang.org/errors-are-values
-type errWriter struct {
- writer io.Writer
- err error
-}
-
-func (w *errWriter) write(str string) {
- if w.err != nil {
- return
- }
- _, w.err = w.writer.Write([]byte(str))
-}
-
-// Map fields may have key types of non-float scalars, strings and enums.
-// The easiest way to sort them in some deterministic order is to use fmt.
-// If this turns out to be inefficient we can always consider other options,
-// such as doing a Schwartzian transform.
-//
-// Numeric keys are sorted in numeric order per
-// https://developers.google.com/protocol-buffers/docs/proto#maps.
-type mapKeys []reflect.Value
-
-func (s mapKeys) Len() int { return len(s) }
-func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s mapKeys) Less(i, j int) bool {
- if k := s[i].Kind(); k == s[j].Kind() {
- switch k {
- case reflect.Int32, reflect.Int64:
- return s[i].Int() < s[j].Int()
- case reflect.Uint32, reflect.Uint64:
- return s[i].Uint() < s[j].Uint()
- }
- }
- return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface())
-}
-
-// checkRequiredFields returns an error if any required field in the given proto message is not set.
-// This function is used by both Marshal and Unmarshal. While required fields only exist in a
-// proto2 message, a proto3 message can contain proto2 message(s).
-func checkRequiredFields(pb proto.Message) error {
- // Most well-known type messages do not contain required fields. The "Any" type may contain
- // a message that has required fields.
- //
- // When an Any message is being marshaled, the code will invoked proto.Unmarshal on Any.Value
- // field in order to transform that into JSON, and that should have returned an error if a
- // required field is not set in the embedded message.
- //
- // When an Any message is being unmarshaled, the code will have invoked proto.Marshal on the
- // embedded message to store the serialized message in Any.Value field, and that should have
- // returned an error if a required field is not set.
- if _, ok := pb.(wkt); ok {
- return nil
- }
-
- v := reflect.ValueOf(pb)
- // Skip message if it is not a struct pointer.
- if v.Kind() != reflect.Ptr {
- return nil
- }
- v = v.Elem()
- if v.Kind() != reflect.Struct {
- return nil
- }
-
- for i := 0; i < v.NumField(); i++ {
- field := v.Field(i)
- sfield := v.Type().Field(i)
-
- if sfield.PkgPath != "" {
- // blank PkgPath means the field is exported; skip if not exported
- continue
- }
-
- if strings.HasPrefix(sfield.Name, "XXX_") {
- continue
- }
-
- // Oneof field is an interface implemented by wrapper structs containing the actual oneof
- // field, i.e. an interface containing &T{real_value}.
- if sfield.Tag.Get("protobuf_oneof") != "" {
- if field.Kind() != reflect.Interface {
- continue
- }
- v := field.Elem()
- if v.Kind() != reflect.Ptr || v.IsNil() {
- continue
- }
- v = v.Elem()
- if v.Kind() != reflect.Struct || v.NumField() < 1 {
- continue
- }
- field = v.Field(0)
- sfield = v.Type().Field(0)
- }
-
- protoTag := sfield.Tag.Get("protobuf")
- if protoTag == "" {
- continue
- }
- var prop proto.Properties
- prop.Init(sfield.Type, sfield.Name, protoTag, &sfield)
-
- switch field.Kind() {
- case reflect.Map:
- if field.IsNil() {
- continue
- }
- // Check each map value.
- keys := field.MapKeys()
- for _, k := range keys {
- v := field.MapIndex(k)
- if err := checkRequiredFieldsInValue(v); err != nil {
- return err
- }
- }
- case reflect.Slice:
- // Handle non-repeated type, e.g. bytes.
- if !prop.Repeated {
- if prop.Required && field.IsNil() {
- return fmt.Errorf("required field %q is not set", prop.Name)
- }
- continue
- }
-
- // Handle repeated type.
- if field.IsNil() {
- continue
- }
- // Check each slice item.
- for i := 0; i < field.Len(); i++ {
- v := field.Index(i)
- if err := checkRequiredFieldsInValue(v); err != nil {
- return err
- }
- }
- case reflect.Ptr:
- if field.IsNil() {
- if prop.Required {
- return fmt.Errorf("required field %q is not set", prop.Name)
- }
- continue
- }
- if err := checkRequiredFieldsInValue(field); err != nil {
- return err
- }
- }
- }
-
- // Handle proto2 extensions.
- for _, ext := range proto.RegisteredExtensions(pb) {
- if !proto.HasExtension(pb, ext) {
- continue
- }
- ep, err := proto.GetExtension(pb, ext)
- if err != nil {
- return err
- }
- err = checkRequiredFieldsInValue(reflect.ValueOf(ep))
- if err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func checkRequiredFieldsInValue(v reflect.Value) error {
- if pm, ok := v.Interface().(proto.Message); ok {
- return checkRequiredFields(pm)
- }
- return nil
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go
deleted file mode 100644
index c9934d97..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go
+++ /dev/null
@@ -1,1150 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 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.
-
-package jsonpb
-
-import (
- "bytes"
- "encoding/json"
- "io"
- "math"
- "reflect"
- "strings"
- "testing"
-
- "github.com/golang/protobuf/proto"
-
- pb "github.com/golang/protobuf/jsonpb/jsonpb_test_proto"
- proto3pb "github.com/golang/protobuf/proto/proto3_proto"
- "github.com/golang/protobuf/ptypes"
- anypb "github.com/golang/protobuf/ptypes/any"
- durpb "github.com/golang/protobuf/ptypes/duration"
- stpb "github.com/golang/protobuf/ptypes/struct"
- tspb "github.com/golang/protobuf/ptypes/timestamp"
- wpb "github.com/golang/protobuf/ptypes/wrappers"
-)
-
-var (
- marshaler = Marshaler{}
-
- marshalerAllOptions = Marshaler{
- Indent: " ",
- }
-
- simpleObject = &pb.Simple{
- OInt32: proto.Int32(-32),
- OInt64: proto.Int64(-6400000000),
- OUint32: proto.Uint32(32),
- OUint64: proto.Uint64(6400000000),
- OSint32: proto.Int32(-13),
- OSint64: proto.Int64(-2600000000),
- OFloat: proto.Float32(3.14),
- ODouble: proto.Float64(6.02214179e23),
- OBool: proto.Bool(true),
- OString: proto.String("hello \"there\""),
- OBytes: []byte("beep boop"),
- }
-
- simpleObjectJSON = `{` +
- `"oBool":true,` +
- `"oInt32":-32,` +
- `"oInt64":"-6400000000",` +
- `"oUint32":32,` +
- `"oUint64":"6400000000",` +
- `"oSint32":-13,` +
- `"oSint64":"-2600000000",` +
- `"oFloat":3.14,` +
- `"oDouble":6.02214179e+23,` +
- `"oString":"hello \"there\"",` +
- `"oBytes":"YmVlcCBib29w"` +
- `}`
-
- simpleObjectPrettyJSON = `{
- "oBool": true,
- "oInt32": -32,
- "oInt64": "-6400000000",
- "oUint32": 32,
- "oUint64": "6400000000",
- "oSint32": -13,
- "oSint64": "-2600000000",
- "oFloat": 3.14,
- "oDouble": 6.02214179e+23,
- "oString": "hello \"there\"",
- "oBytes": "YmVlcCBib29w"
-}`
-
- repeatsObject = &pb.Repeats{
- RBool: []bool{true, false, true},
- RInt32: []int32{-3, -4, -5},
- RInt64: []int64{-123456789, -987654321},
- RUint32: []uint32{1, 2, 3},
- RUint64: []uint64{6789012345, 3456789012},
- RSint32: []int32{-1, -2, -3},
- RSint64: []int64{-6789012345, -3456789012},
- RFloat: []float32{3.14, 6.28},
- RDouble: []float64{299792458 * 1e20, 6.62606957e-34},
- RString: []string{"happy", "days"},
- RBytes: [][]byte{[]byte("skittles"), []byte("m&m's")},
- }
-
- repeatsObjectJSON = `{` +
- `"rBool":[true,false,true],` +
- `"rInt32":[-3,-4,-5],` +
- `"rInt64":["-123456789","-987654321"],` +
- `"rUint32":[1,2,3],` +
- `"rUint64":["6789012345","3456789012"],` +
- `"rSint32":[-1,-2,-3],` +
- `"rSint64":["-6789012345","-3456789012"],` +
- `"rFloat":[3.14,6.28],` +
- `"rDouble":[2.99792458e+28,6.62606957e-34],` +
- `"rString":["happy","days"],` +
- `"rBytes":["c2tpdHRsZXM=","bSZtJ3M="]` +
- `}`
-
- repeatsObjectPrettyJSON = `{
- "rBool": [
- true,
- false,
- true
- ],
- "rInt32": [
- -3,
- -4,
- -5
- ],
- "rInt64": [
- "-123456789",
- "-987654321"
- ],
- "rUint32": [
- 1,
- 2,
- 3
- ],
- "rUint64": [
- "6789012345",
- "3456789012"
- ],
- "rSint32": [
- -1,
- -2,
- -3
- ],
- "rSint64": [
- "-6789012345",
- "-3456789012"
- ],
- "rFloat": [
- 3.14,
- 6.28
- ],
- "rDouble": [
- 2.99792458e+28,
- 6.62606957e-34
- ],
- "rString": [
- "happy",
- "days"
- ],
- "rBytes": [
- "c2tpdHRsZXM=",
- "bSZtJ3M="
- ]
-}`
-
- innerSimple = &pb.Simple{OInt32: proto.Int32(-32)}
- innerSimple2 = &pb.Simple{OInt64: proto.Int64(25)}
- innerRepeats = &pb.Repeats{RString: []string{"roses", "red"}}
- innerRepeats2 = &pb.Repeats{RString: []string{"violets", "blue"}}
- complexObject = &pb.Widget{
- Color: pb.Widget_GREEN.Enum(),
- RColor: []pb.Widget_Color{pb.Widget_RED, pb.Widget_GREEN, pb.Widget_BLUE},
- Simple: innerSimple,
- RSimple: []*pb.Simple{innerSimple, innerSimple2},
- Repeats: innerRepeats,
- RRepeats: []*pb.Repeats{innerRepeats, innerRepeats2},
- }
-
- complexObjectJSON = `{"color":"GREEN",` +
- `"rColor":["RED","GREEN","BLUE"],` +
- `"simple":{"oInt32":-32},` +
- `"rSimple":[{"oInt32":-32},{"oInt64":"25"}],` +
- `"repeats":{"rString":["roses","red"]},` +
- `"rRepeats":[{"rString":["roses","red"]},{"rString":["violets","blue"]}]` +
- `}`
-
- complexObjectPrettyJSON = `{
- "color": "GREEN",
- "rColor": [
- "RED",
- "GREEN",
- "BLUE"
- ],
- "simple": {
- "oInt32": -32
- },
- "rSimple": [
- {
- "oInt32": -32
- },
- {
- "oInt64": "25"
- }
- ],
- "repeats": {
- "rString": [
- "roses",
- "red"
- ]
- },
- "rRepeats": [
- {
- "rString": [
- "roses",
- "red"
- ]
- },
- {
- "rString": [
- "violets",
- "blue"
- ]
- }
- ]
-}`
-
- colorPrettyJSON = `{
- "color": 2
-}`
-
- colorListPrettyJSON = `{
- "color": 1000,
- "rColor": [
- "RED"
- ]
-}`
-
- nummyPrettyJSON = `{
- "nummy": {
- "1": 2,
- "3": 4
- }
-}`
-
- objjyPrettyJSON = `{
- "objjy": {
- "1": {
- "dub": 1
- }
- }
-}`
- realNumber = &pb.Real{Value: proto.Float64(3.14159265359)}
- realNumberName = "Pi"
- complexNumber = &pb.Complex{Imaginary: proto.Float64(0.5772156649)}
- realNumberJSON = `{` +
- `"value":3.14159265359,` +
- `"[jsonpb.Complex.real_extension]":{"imaginary":0.5772156649},` +
- `"[jsonpb.name]":"Pi"` +
- `}`
-
- anySimple = &pb.KnownTypes{
- An: &anypb.Any{
- TypeUrl: "something.example.com/jsonpb.Simple",
- Value: []byte{
- // &pb.Simple{OBool:true}
- 1 << 3, 1,
- },
- },
- }
- anySimpleJSON = `{"an":{"@type":"something.example.com/jsonpb.Simple","oBool":true}}`
- anySimplePrettyJSON = `{
- "an": {
- "@type": "something.example.com/jsonpb.Simple",
- "oBool": true
- }
-}`
-
- anyWellKnown = &pb.KnownTypes{
- An: &anypb.Any{
- TypeUrl: "type.googleapis.com/google.protobuf.Duration",
- Value: []byte{
- // &durpb.Duration{Seconds: 1, Nanos: 212000000 }
- 1 << 3, 1, // seconds
- 2 << 3, 0x80, 0xba, 0x8b, 0x65, // nanos
- },
- },
- }
- anyWellKnownJSON = `{"an":{"@type":"type.googleapis.com/google.protobuf.Duration","value":"1.212s"}}`
- anyWellKnownPrettyJSON = `{
- "an": {
- "@type": "type.googleapis.com/google.protobuf.Duration",
- "value": "1.212s"
- }
-}`
-
- nonFinites = &pb.NonFinites{
- FNan: proto.Float32(float32(math.NaN())),
- FPinf: proto.Float32(float32(math.Inf(1))),
- FNinf: proto.Float32(float32(math.Inf(-1))),
- DNan: proto.Float64(float64(math.NaN())),
- DPinf: proto.Float64(float64(math.Inf(1))),
- DNinf: proto.Float64(float64(math.Inf(-1))),
- }
- nonFinitesJSON = `{` +
- `"fNan":"NaN",` +
- `"fPinf":"Infinity",` +
- `"fNinf":"-Infinity",` +
- `"dNan":"NaN",` +
- `"dPinf":"Infinity",` +
- `"dNinf":"-Infinity"` +
- `}`
-)
-
-func init() {
- if err := proto.SetExtension(realNumber, pb.E_Name, &realNumberName); err != nil {
- panic(err)
- }
- if err := proto.SetExtension(realNumber, pb.E_Complex_RealExtension, complexNumber); err != nil {
- panic(err)
- }
-}
-
-var marshalingTests = []struct {
- desc string
- marshaler Marshaler
- pb proto.Message
- json string
-}{
- {"simple flat object", marshaler, simpleObject, simpleObjectJSON},
- {"simple pretty object", marshalerAllOptions, simpleObject, simpleObjectPrettyJSON},
- {"non-finite floats fields object", marshaler, nonFinites, nonFinitesJSON},
- {"repeated fields flat object", marshaler, repeatsObject, repeatsObjectJSON},
- {"repeated fields pretty object", marshalerAllOptions, repeatsObject, repeatsObjectPrettyJSON},
- {"nested message/enum flat object", marshaler, complexObject, complexObjectJSON},
- {"nested message/enum pretty object", marshalerAllOptions, complexObject, complexObjectPrettyJSON},
- {"enum-string flat object", Marshaler{},
- &pb.Widget{Color: pb.Widget_BLUE.Enum()}, `{"color":"BLUE"}`},
- {"enum-value pretty object", Marshaler{EnumsAsInts: true, Indent: " "},
- &pb.Widget{Color: pb.Widget_BLUE.Enum()}, colorPrettyJSON},
- {"unknown enum value object", marshalerAllOptions,
- &pb.Widget{Color: pb.Widget_Color(1000).Enum(), RColor: []pb.Widget_Color{pb.Widget_RED}}, colorListPrettyJSON},
- {"repeated proto3 enum", Marshaler{},
- &proto3pb.Message{RFunny: []proto3pb.Message_Humour{
- proto3pb.Message_PUNS,
- proto3pb.Message_SLAPSTICK,
- }},
- `{"rFunny":["PUNS","SLAPSTICK"]}`},
- {"repeated proto3 enum as int", Marshaler{EnumsAsInts: true},
- &proto3pb.Message{RFunny: []proto3pb.Message_Humour{
- proto3pb.Message_PUNS,
- proto3pb.Message_SLAPSTICK,
- }},
- `{"rFunny":[1,2]}`},
- {"empty value", marshaler, &pb.Simple3{}, `{}`},
- {"empty value emitted", Marshaler{EmitDefaults: true}, &pb.Simple3{}, `{"dub":0}`},
- {"empty repeated emitted", Marshaler{EmitDefaults: true}, &pb.SimpleSlice3{}, `{"slices":[]}`},
- {"empty map emitted", Marshaler{EmitDefaults: true}, &pb.SimpleMap3{}, `{"stringy":{}}`},
- {"nested struct null", Marshaler{EmitDefaults: true}, &pb.SimpleNull3{}, `{"simple":null}`},
- {"map", marshaler, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, `{"nummy":{"1":2,"3":4}}`},
- {"map", marshalerAllOptions, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, nummyPrettyJSON},
- {"map", marshaler,
- &pb.Mappy{Strry: map[string]string{`"one"`: "two", "three": "four"}},
- `{"strry":{"\"one\"":"two","three":"four"}}`},
- {"map", marshaler,
- &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: {Dub: 1}}}, `{"objjy":{"1":{"dub":1}}}`},
- {"map", marshalerAllOptions,
- &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: {Dub: 1}}}, objjyPrettyJSON},
- {"map", marshaler, &pb.Mappy{Buggy: map[int64]string{1234: "yup"}},
- `{"buggy":{"1234":"yup"}}`},
- {"map", marshaler, &pb.Mappy{Booly: map[bool]bool{false: true}}, `{"booly":{"false":true}}`},
- // TODO: This is broken.
- //{"map", marshaler, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}, `{"enumy":{"XIV":"ROMAN"}`},
- {"map", Marshaler{EnumsAsInts: true}, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}, `{"enumy":{"XIV":2}}`},
- {"map", marshaler, &pb.Mappy{S32Booly: map[int32]bool{1: true, 3: false, 10: true, 12: false}}, `{"s32booly":{"1":true,"3":false,"10":true,"12":false}}`},
- {"map", marshaler, &pb.Mappy{S64Booly: map[int64]bool{1: true, 3: false, 10: true, 12: false}}, `{"s64booly":{"1":true,"3":false,"10":true,"12":false}}`},
- {"map", marshaler, &pb.Mappy{U32Booly: map[uint32]bool{1: true, 3: false, 10: true, 12: false}}, `{"u32booly":{"1":true,"3":false,"10":true,"12":false}}`},
- {"map", marshaler, &pb.Mappy{U64Booly: map[uint64]bool{1: true, 3: false, 10: true, 12: false}}, `{"u64booly":{"1":true,"3":false,"10":true,"12":false}}`},
- {"proto2 map", marshaler, &pb.Maps{MInt64Str: map[int64]string{213: "cat"}},
- `{"mInt64Str":{"213":"cat"}}`},
- {"proto2 map", marshaler,
- &pb.Maps{MBoolSimple: map[bool]*pb.Simple{true: {OInt32: proto.Int32(1)}}},
- `{"mBoolSimple":{"true":{"oInt32":1}}}`},
- {"oneof, not set", marshaler, &pb.MsgWithOneof{}, `{}`},
- {"oneof, set", marshaler, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Title{"Grand Poobah"}}, `{"title":"Grand Poobah"}`},
- {"force orig_name", Marshaler{OrigName: true}, &pb.Simple{OInt32: proto.Int32(4)},
- `{"o_int32":4}`},
- {"proto2 extension", marshaler, realNumber, realNumberJSON},
- {"Any with message", marshaler, anySimple, anySimpleJSON},
- {"Any with message and indent", marshalerAllOptions, anySimple, anySimplePrettyJSON},
- {"Any with WKT", marshaler, anyWellKnown, anyWellKnownJSON},
- {"Any with WKT and indent", marshalerAllOptions, anyWellKnown, anyWellKnownPrettyJSON},
- {"Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 3}}, `{"dur":"3s"}`},
- {"Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 3, Nanos: 1e6}}, `{"dur":"3.001s"}`},
- {"Duration beyond float64 precision", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 100000000, Nanos: 1}}, `{"dur":"100000000.000000001s"}`},
- {"negative Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: -123, Nanos: -456}}, `{"dur":"-123.000000456s"}`},
- {"Struct", marshaler, &pb.KnownTypes{St: &stpb.Struct{
- Fields: map[string]*stpb.Value{
- "one": {Kind: &stpb.Value_StringValue{"loneliest number"}},
- "two": {Kind: &stpb.Value_NullValue{stpb.NullValue_NULL_VALUE}},
- },
- }}, `{"st":{"one":"loneliest number","two":null}}`},
- {"empty ListValue", marshaler, &pb.KnownTypes{Lv: &stpb.ListValue{}}, `{"lv":[]}`},
- {"basic ListValue", marshaler, &pb.KnownTypes{Lv: &stpb.ListValue{Values: []*stpb.Value{
- {Kind: &stpb.Value_StringValue{"x"}},
- {Kind: &stpb.Value_NullValue{}},
- {Kind: &stpb.Value_NumberValue{3}},
- {Kind: &stpb.Value_BoolValue{true}},
- }}}, `{"lv":["x",null,3,true]}`},
- {"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 21e6}}, `{"ts":"2014-05-13T16:53:20.021Z"}`},
- {"Timestamp", marshaler, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 0}}, `{"ts":"2014-05-13T16:53:20Z"}`},
- {"number Value", marshaler, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_NumberValue{1}}}, `{"val":1}`},
- {"null Value", marshaler, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_NullValue{stpb.NullValue_NULL_VALUE}}}, `{"val":null}`},
- {"string number value", marshaler, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_StringValue{"9223372036854775807"}}}, `{"val":"9223372036854775807"}`},
- {"list of lists Value", marshaler, &pb.KnownTypes{Val: &stpb.Value{
- Kind: &stpb.Value_ListValue{&stpb.ListValue{
- Values: []*stpb.Value{
- {Kind: &stpb.Value_StringValue{"x"}},
- {Kind: &stpb.Value_ListValue{&stpb.ListValue{
- Values: []*stpb.Value{
- {Kind: &stpb.Value_ListValue{&stpb.ListValue{
- Values: []*stpb.Value{{Kind: &stpb.Value_StringValue{"y"}}},
- }}},
- {Kind: &stpb.Value_StringValue{"z"}},
- },
- }}},
- },
- }},
- }}, `{"val":["x",[["y"],"z"]]}`},
-
- {"DoubleValue", marshaler, &pb.KnownTypes{Dbl: &wpb.DoubleValue{Value: 1.2}}, `{"dbl":1.2}`},
- {"FloatValue", marshaler, &pb.KnownTypes{Flt: &wpb.FloatValue{Value: 1.2}}, `{"flt":1.2}`},
- {"Int64Value", marshaler, &pb.KnownTypes{I64: &wpb.Int64Value{Value: -3}}, `{"i64":"-3"}`},
- {"UInt64Value", marshaler, &pb.KnownTypes{U64: &wpb.UInt64Value{Value: 3}}, `{"u64":"3"}`},
- {"Int32Value", marshaler, &pb.KnownTypes{I32: &wpb.Int32Value{Value: -4}}, `{"i32":-4}`},
- {"UInt32Value", marshaler, &pb.KnownTypes{U32: &wpb.UInt32Value{Value: 4}}, `{"u32":4}`},
- {"BoolValue", marshaler, &pb.KnownTypes{Bool: &wpb.BoolValue{Value: true}}, `{"bool":true}`},
- {"StringValue", marshaler, &pb.KnownTypes{Str: &wpb.StringValue{Value: "plush"}}, `{"str":"plush"}`},
- {"BytesValue", marshaler, &pb.KnownTypes{Bytes: &wpb.BytesValue{Value: []byte("wow")}}, `{"bytes":"d293"}`},
-
- {"required", marshaler, &pb.MsgWithRequired{Str: proto.String("hello")}, `{"str":"hello"}`},
- {"required bytes", marshaler, &pb.MsgWithRequiredBytes{Byts: []byte{}}, `{"byts":""}`},
-}
-
-func TestMarshaling(t *testing.T) {
- for _, tt := range marshalingTests {
- json, err := tt.marshaler.MarshalToString(tt.pb)
- if err != nil {
- t.Errorf("%s: marshaling error: %v", tt.desc, err)
- } else if tt.json != json {
- t.Errorf("%s: got [%v] want [%v]", tt.desc, json, tt.json)
- }
- }
-}
-
-func TestMarshalingNil(t *testing.T) {
- var msg *pb.Simple
- m := &Marshaler{}
- if _, err := m.MarshalToString(msg); err == nil {
- t.Errorf("mashaling nil returned no error")
- }
-}
-
-func TestMarshalIllegalTime(t *testing.T) {
- tests := []struct {
- pb proto.Message
- fail bool
- }{
- {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: 1, Nanos: 0}}, false},
- {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: -1, Nanos: 0}}, false},
- {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: 1, Nanos: -1}}, true},
- {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: -1, Nanos: 1}}, true},
- {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: 1, Nanos: 1000000000}}, true},
- {&pb.KnownTypes{Dur: &durpb.Duration{Seconds: -1, Nanos: -1000000000}}, true},
- {&pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 1, Nanos: 1}}, false},
- {&pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 1, Nanos: -1}}, true},
- {&pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 1, Nanos: 1000000000}}, true},
- }
- for _, tt := range tests {
- _, err := marshaler.MarshalToString(tt.pb)
- if err == nil && tt.fail {
- t.Errorf("marshaler.MarshalToString(%v) = _, ; want _, ", tt.pb)
- }
- if err != nil && !tt.fail {
- t.Errorf("marshaler.MarshalToString(%v) = _, %v; want _, ", tt.pb, err)
- }
- }
-}
-
-func TestMarshalJSONPBMarshaler(t *testing.T) {
- rawJson := `{ "foo": "bar", "baz": [0, 1, 2, 3] }`
- msg := dynamicMessage{rawJson: rawJson}
- str, err := new(Marshaler).MarshalToString(&msg)
- if err != nil {
- t.Errorf("an unexpected error occurred when marshalling JSONPBMarshaler: %v", err)
- }
- if str != rawJson {
- t.Errorf("marshalling JSON produced incorrect output: got %s, wanted %s", str, rawJson)
- }
-}
-
-func TestMarshalAnyJSONPBMarshaler(t *testing.T) {
- msg := dynamicMessage{rawJson: `{ "foo": "bar", "baz": [0, 1, 2, 3] }`}
- a, err := ptypes.MarshalAny(&msg)
- if err != nil {
- t.Errorf("an unexpected error occurred when marshalling to Any: %v", err)
- }
- str, err := new(Marshaler).MarshalToString(a)
- if err != nil {
- t.Errorf("an unexpected error occurred when marshalling Any to JSON: %v", err)
- }
- // after custom marshaling, it's round-tripped through JSON decoding/encoding already,
- // so the keys are sorted, whitespace is compacted, and "@type" key has been added
- expected := `{"@type":"type.googleapis.com/` + dynamicMessageName + `","baz":[0,1,2,3],"foo":"bar"}`
- if str != expected {
- t.Errorf("marshalling JSON produced incorrect output: got %s, wanted %s", str, expected)
- }
-}
-
-func TestMarshalWithCustomValidation(t *testing.T) {
- msg := dynamicMessage{rawJson: `{ "foo": "bar", "baz": [0, 1, 2, 3] }`, dummy: &dynamicMessage{}}
-
- js, err := new(Marshaler).MarshalToString(&msg)
- if err != nil {
- t.Errorf("an unexpected error occurred when marshalling to json: %v", err)
- }
- err = Unmarshal(strings.NewReader(js), &msg)
- if err != nil {
- t.Errorf("an unexpected error occurred when unmarshalling from json: %v", err)
- }
-}
-
-// Test marshaling message containing unset required fields should produce error.
-func TestMarshalUnsetRequiredFields(t *testing.T) {
- msgExt := &pb.Real{}
- proto.SetExtension(msgExt, pb.E_Extm, &pb.MsgWithRequired{})
-
- tests := []struct {
- desc string
- marshaler *Marshaler
- pb proto.Message
- }{
- {
- desc: "direct required field",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithRequired{},
- },
- {
- desc: "direct required field + emit defaults",
- marshaler: &Marshaler{EmitDefaults: true},
- pb: &pb.MsgWithRequired{},
- },
- {
- desc: "indirect required field",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithIndirectRequired{Subm: &pb.MsgWithRequired{}},
- },
- {
- desc: "indirect required field + emit defaults",
- marshaler: &Marshaler{EmitDefaults: true},
- pb: &pb.MsgWithIndirectRequired{Subm: &pb.MsgWithRequired{}},
- },
- {
- desc: "direct required wkt field",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithRequiredWKT{},
- },
- {
- desc: "direct required wkt field + emit defaults",
- marshaler: &Marshaler{EmitDefaults: true},
- pb: &pb.MsgWithRequiredWKT{},
- },
- {
- desc: "direct required bytes field",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithRequiredBytes{},
- },
- {
- desc: "required in map value",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithIndirectRequired{
- MapField: map[string]*pb.MsgWithRequired{
- "key": {},
- },
- },
- },
- {
- desc: "required in repeated item",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithIndirectRequired{
- SliceField: []*pb.MsgWithRequired{
- {Str: proto.String("hello")},
- {},
- },
- },
- },
- {
- desc: "required inside oneof",
- marshaler: &Marshaler{},
- pb: &pb.MsgWithOneof{
- Union: &pb.MsgWithOneof_MsgWithRequired{&pb.MsgWithRequired{}},
- },
- },
- {
- desc: "required inside extension",
- marshaler: &Marshaler{},
- pb: msgExt,
- },
- }
-
- for _, tc := range tests {
- if _, err := tc.marshaler.MarshalToString(tc.pb); err == nil {
- t.Errorf("%s: expecting error in marshaling with unset required fields %+v", tc.desc, tc.pb)
- }
- }
-}
-
-var unmarshalingTests = []struct {
- desc string
- unmarshaler Unmarshaler
- json string
- pb proto.Message
-}{
- {"simple flat object", Unmarshaler{}, simpleObjectJSON, simpleObject},
- {"simple pretty object", Unmarshaler{}, simpleObjectPrettyJSON, simpleObject},
- {"repeated fields flat object", Unmarshaler{}, repeatsObjectJSON, repeatsObject},
- {"repeated fields pretty object", Unmarshaler{}, repeatsObjectPrettyJSON, repeatsObject},
- {"nested message/enum flat object", Unmarshaler{}, complexObjectJSON, complexObject},
- {"nested message/enum pretty object", Unmarshaler{}, complexObjectPrettyJSON, complexObject},
- {"enum-string object", Unmarshaler{}, `{"color":"BLUE"}`, &pb.Widget{Color: pb.Widget_BLUE.Enum()}},
- {"enum-value object", Unmarshaler{}, "{\n \"color\": 2\n}", &pb.Widget{Color: pb.Widget_BLUE.Enum()}},
- {"unknown field with allowed option", Unmarshaler{AllowUnknownFields: true}, `{"unknown": "foo"}`, new(pb.Simple)},
- {"proto3 enum string", Unmarshaler{}, `{"hilarity":"PUNS"}`, &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}},
- {"proto3 enum value", Unmarshaler{}, `{"hilarity":1}`, &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}},
- {"unknown enum value object",
- Unmarshaler{},
- "{\n \"color\": 1000,\n \"r_color\": [\n \"RED\"\n ]\n}",
- &pb.Widget{Color: pb.Widget_Color(1000).Enum(), RColor: []pb.Widget_Color{pb.Widget_RED}}},
- {"repeated proto3 enum", Unmarshaler{}, `{"rFunny":["PUNS","SLAPSTICK"]}`,
- &proto3pb.Message{RFunny: []proto3pb.Message_Humour{
- proto3pb.Message_PUNS,
- proto3pb.Message_SLAPSTICK,
- }}},
- {"repeated proto3 enum as int", Unmarshaler{}, `{"rFunny":[1,2]}`,
- &proto3pb.Message{RFunny: []proto3pb.Message_Humour{
- proto3pb.Message_PUNS,
- proto3pb.Message_SLAPSTICK,
- }}},
- {"repeated proto3 enum as mix of strings and ints", Unmarshaler{}, `{"rFunny":["PUNS",2]}`,
- &proto3pb.Message{RFunny: []proto3pb.Message_Humour{
- proto3pb.Message_PUNS,
- proto3pb.Message_SLAPSTICK,
- }}},
- {"unquoted int64 object", Unmarshaler{}, `{"oInt64":-314}`, &pb.Simple{OInt64: proto.Int64(-314)}},
- {"unquoted uint64 object", Unmarshaler{}, `{"oUint64":123}`, &pb.Simple{OUint64: proto.Uint64(123)}},
- {"NaN", Unmarshaler{}, `{"oDouble":"NaN"}`, &pb.Simple{ODouble: proto.Float64(math.NaN())}},
- {"Inf", Unmarshaler{}, `{"oFloat":"Infinity"}`, &pb.Simple{OFloat: proto.Float32(float32(math.Inf(1)))}},
- {"-Inf", Unmarshaler{}, `{"oDouble":"-Infinity"}`, &pb.Simple{ODouble: proto.Float64(math.Inf(-1))}},
- {"map", Unmarshaler{}, `{"nummy":{"1":2,"3":4}}`, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}},
- {"map", Unmarshaler{}, `{"strry":{"\"one\"":"two","three":"four"}}`, &pb.Mappy{Strry: map[string]string{`"one"`: "two", "three": "four"}}},
- {"map", Unmarshaler{}, `{"objjy":{"1":{"dub":1}}}`, &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: {Dub: 1}}}},
- {"proto2 extension", Unmarshaler{}, realNumberJSON, realNumber},
- {"Any with message", Unmarshaler{}, anySimpleJSON, anySimple},
- {"Any with message and indent", Unmarshaler{}, anySimplePrettyJSON, anySimple},
- {"Any with WKT", Unmarshaler{}, anyWellKnownJSON, anyWellKnown},
- {"Any with WKT and indent", Unmarshaler{}, anyWellKnownPrettyJSON, anyWellKnown},
- // TODO: This is broken.
- //{"map", Unmarshaler{}, `{"enumy":{"XIV":"ROMAN"}`, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}},
- {"map", Unmarshaler{}, `{"enumy":{"XIV":2}}`, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}},
- {"oneof", Unmarshaler{}, `{"salary":31000}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Salary{31000}}},
- {"oneof spec name", Unmarshaler{}, `{"Country":"Australia"}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Country{"Australia"}}},
- {"oneof orig_name", Unmarshaler{}, `{"Country":"Australia"}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Country{"Australia"}}},
- {"oneof spec name2", Unmarshaler{}, `{"homeAddress":"Australia"}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_HomeAddress{"Australia"}}},
- {"oneof orig_name2", Unmarshaler{}, `{"home_address":"Australia"}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_HomeAddress{"Australia"}}},
- {"orig_name input", Unmarshaler{}, `{"o_bool":true}`, &pb.Simple{OBool: proto.Bool(true)}},
- {"camelName input", Unmarshaler{}, `{"oBool":true}`, &pb.Simple{OBool: proto.Bool(true)}},
-
- {"Duration", Unmarshaler{}, `{"dur":"3.000s"}`, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 3}}},
- {"Duration", Unmarshaler{}, `{"dur":"4s"}`, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 4}}},
- {"null Duration", Unmarshaler{}, `{"dur":null}`, &pb.KnownTypes{Dur: nil}},
- {"Timestamp", Unmarshaler{}, `{"ts":"2014-05-13T16:53:20.021Z"}`, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 21e6}}},
- {"Timestamp", Unmarshaler{}, `{"ts":"2014-05-13T16:53:20Z"}`, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: 14e8, Nanos: 0}}},
- {"PreEpochTimestamp", Unmarshaler{}, `{"ts":"1969-12-31T23:59:58.999999995Z"}`, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: -2, Nanos: 999999995}}},
- {"ZeroTimeTimestamp", Unmarshaler{}, `{"ts":"0001-01-01T00:00:00Z"}`, &pb.KnownTypes{Ts: &tspb.Timestamp{Seconds: -62135596800, Nanos: 0}}},
- {"null Timestamp", Unmarshaler{}, `{"ts":null}`, &pb.KnownTypes{Ts: nil}},
- {"null Struct", Unmarshaler{}, `{"st": null}`, &pb.KnownTypes{St: nil}},
- {"empty Struct", Unmarshaler{}, `{"st": {}}`, &pb.KnownTypes{St: &stpb.Struct{}}},
- {"basic Struct", Unmarshaler{}, `{"st": {"a": "x", "b": null, "c": 3, "d": true}}`, &pb.KnownTypes{St: &stpb.Struct{Fields: map[string]*stpb.Value{
- "a": {Kind: &stpb.Value_StringValue{"x"}},
- "b": {Kind: &stpb.Value_NullValue{}},
- "c": {Kind: &stpb.Value_NumberValue{3}},
- "d": {Kind: &stpb.Value_BoolValue{true}},
- }}}},
- {"nested Struct", Unmarshaler{}, `{"st": {"a": {"b": 1, "c": [{"d": true}, "f"]}}}`, &pb.KnownTypes{St: &stpb.Struct{Fields: map[string]*stpb.Value{
- "a": {Kind: &stpb.Value_StructValue{&stpb.Struct{Fields: map[string]*stpb.Value{
- "b": {Kind: &stpb.Value_NumberValue{1}},
- "c": {Kind: &stpb.Value_ListValue{&stpb.ListValue{Values: []*stpb.Value{
- {Kind: &stpb.Value_StructValue{&stpb.Struct{Fields: map[string]*stpb.Value{"d": {Kind: &stpb.Value_BoolValue{true}}}}}},
- {Kind: &stpb.Value_StringValue{"f"}},
- }}}},
- }}}},
- }}}},
- {"null ListValue", Unmarshaler{}, `{"lv": null}`, &pb.KnownTypes{Lv: nil}},
- {"empty ListValue", Unmarshaler{}, `{"lv": []}`, &pb.KnownTypes{Lv: &stpb.ListValue{}}},
- {"basic ListValue", Unmarshaler{}, `{"lv": ["x", null, 3, true]}`, &pb.KnownTypes{Lv: &stpb.ListValue{Values: []*stpb.Value{
- {Kind: &stpb.Value_StringValue{"x"}},
- {Kind: &stpb.Value_NullValue{}},
- {Kind: &stpb.Value_NumberValue{3}},
- {Kind: &stpb.Value_BoolValue{true}},
- }}}},
- {"number Value", Unmarshaler{}, `{"val":1}`, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_NumberValue{1}}}},
- {"null Value", Unmarshaler{}, `{"val":null}`, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_NullValue{stpb.NullValue_NULL_VALUE}}}},
- {"bool Value", Unmarshaler{}, `{"val":true}`, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_BoolValue{true}}}},
- {"string Value", Unmarshaler{}, `{"val":"x"}`, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_StringValue{"x"}}}},
- {"string number value", Unmarshaler{}, `{"val":"9223372036854775807"}`, &pb.KnownTypes{Val: &stpb.Value{Kind: &stpb.Value_StringValue{"9223372036854775807"}}}},
- {"list of lists Value", Unmarshaler{}, `{"val":["x", [["y"], "z"]]}`, &pb.KnownTypes{Val: &stpb.Value{
- Kind: &stpb.Value_ListValue{&stpb.ListValue{
- Values: []*stpb.Value{
- {Kind: &stpb.Value_StringValue{"x"}},
- {Kind: &stpb.Value_ListValue{&stpb.ListValue{
- Values: []*stpb.Value{
- {Kind: &stpb.Value_ListValue{&stpb.ListValue{
- Values: []*stpb.Value{{Kind: &stpb.Value_StringValue{"y"}}},
- }}},
- {Kind: &stpb.Value_StringValue{"z"}},
- },
- }}},
- },
- }}}}},
-
- {"DoubleValue", Unmarshaler{}, `{"dbl":1.2}`, &pb.KnownTypes{Dbl: &wpb.DoubleValue{Value: 1.2}}},
- {"FloatValue", Unmarshaler{}, `{"flt":1.2}`, &pb.KnownTypes{Flt: &wpb.FloatValue{Value: 1.2}}},
- {"Int64Value", Unmarshaler{}, `{"i64":"-3"}`, &pb.KnownTypes{I64: &wpb.Int64Value{Value: -3}}},
- {"UInt64Value", Unmarshaler{}, `{"u64":"3"}`, &pb.KnownTypes{U64: &wpb.UInt64Value{Value: 3}}},
- {"Int32Value", Unmarshaler{}, `{"i32":-4}`, &pb.KnownTypes{I32: &wpb.Int32Value{Value: -4}}},
- {"UInt32Value", Unmarshaler{}, `{"u32":4}`, &pb.KnownTypes{U32: &wpb.UInt32Value{Value: 4}}},
- {"BoolValue", Unmarshaler{}, `{"bool":true}`, &pb.KnownTypes{Bool: &wpb.BoolValue{Value: true}}},
- {"StringValue", Unmarshaler{}, `{"str":"plush"}`, &pb.KnownTypes{Str: &wpb.StringValue{Value: "plush"}}},
- {"BytesValue", Unmarshaler{}, `{"bytes":"d293"}`, &pb.KnownTypes{Bytes: &wpb.BytesValue{Value: []byte("wow")}}},
-
- // Ensure that `null` as a value ends up with a nil pointer instead of a [type]Value struct.
- {"null DoubleValue", Unmarshaler{}, `{"dbl":null}`, &pb.KnownTypes{Dbl: nil}},
- {"null FloatValue", Unmarshaler{}, `{"flt":null}`, &pb.KnownTypes{Flt: nil}},
- {"null Int64Value", Unmarshaler{}, `{"i64":null}`, &pb.KnownTypes{I64: nil}},
- {"null UInt64Value", Unmarshaler{}, `{"u64":null}`, &pb.KnownTypes{U64: nil}},
- {"null Int32Value", Unmarshaler{}, `{"i32":null}`, &pb.KnownTypes{I32: nil}},
- {"null UInt32Value", Unmarshaler{}, `{"u32":null}`, &pb.KnownTypes{U32: nil}},
- {"null BoolValue", Unmarshaler{}, `{"bool":null}`, &pb.KnownTypes{Bool: nil}},
- {"null StringValue", Unmarshaler{}, `{"str":null}`, &pb.KnownTypes{Str: nil}},
- {"null BytesValue", Unmarshaler{}, `{"bytes":null}`, &pb.KnownTypes{Bytes: nil}},
-
- {"required", Unmarshaler{}, `{"str":"hello"}`, &pb.MsgWithRequired{Str: proto.String("hello")}},
- {"required bytes", Unmarshaler{}, `{"byts": []}`, &pb.MsgWithRequiredBytes{Byts: []byte{}}},
-}
-
-func TestUnmarshaling(t *testing.T) {
- for _, tt := range unmarshalingTests {
- // Make a new instance of the type of our expected object.
- p := reflect.New(reflect.TypeOf(tt.pb).Elem()).Interface().(proto.Message)
-
- err := tt.unmarshaler.Unmarshal(strings.NewReader(tt.json), p)
- if err != nil {
- t.Errorf("%s: %v", tt.desc, err)
- continue
- }
-
- // For easier diffs, compare text strings of the protos.
- exp := proto.MarshalTextString(tt.pb)
- act := proto.MarshalTextString(p)
- if string(exp) != string(act) {
- t.Errorf("%s: got [%s] want [%s]", tt.desc, act, exp)
- }
- }
-}
-
-func TestUnmarshalNullArray(t *testing.T) {
- var repeats pb.Repeats
- if err := UnmarshalString(`{"rBool":null}`, &repeats); err != nil {
- t.Fatal(err)
- }
- if !reflect.DeepEqual(repeats, pb.Repeats{}) {
- t.Errorf("got non-nil fields in [%#v]", repeats)
- }
-}
-
-func TestUnmarshalNullObject(t *testing.T) {
- var maps pb.Maps
- if err := UnmarshalString(`{"mInt64Str":null}`, &maps); err != nil {
- t.Fatal(err)
- }
- if !reflect.DeepEqual(maps, pb.Maps{}) {
- t.Errorf("got non-nil fields in [%#v]", maps)
- }
-}
-
-func TestUnmarshalNext(t *testing.T) {
- // We only need to check against a few, not all of them.
- tests := unmarshalingTests[:5]
-
- // Create a buffer with many concatenated JSON objects.
- var b bytes.Buffer
- for _, tt := range tests {
- b.WriteString(tt.json)
- }
-
- dec := json.NewDecoder(&b)
- for _, tt := range tests {
- // Make a new instance of the type of our expected object.
- p := reflect.New(reflect.TypeOf(tt.pb).Elem()).Interface().(proto.Message)
-
- err := tt.unmarshaler.UnmarshalNext(dec, p)
- if err != nil {
- t.Errorf("%s: %v", tt.desc, err)
- continue
- }
-
- // For easier diffs, compare text strings of the protos.
- exp := proto.MarshalTextString(tt.pb)
- act := proto.MarshalTextString(p)
- if string(exp) != string(act) {
- t.Errorf("%s: got [%s] want [%s]", tt.desc, act, exp)
- }
- }
-
- p := &pb.Simple{}
- err := new(Unmarshaler).UnmarshalNext(dec, p)
- if err != io.EOF {
- t.Errorf("eof: got %v, expected io.EOF", err)
- }
-}
-
-var unmarshalingShouldError = []struct {
- desc string
- in string
- pb proto.Message
-}{
- {"a value", "666", new(pb.Simple)},
- {"gibberish", "{adskja123;l23=-=", new(pb.Simple)},
- {"unknown field", `{"unknown": "foo"}`, new(pb.Simple)},
- {"unknown enum name", `{"hilarity":"DAVE"}`, new(proto3pb.Message)},
-}
-
-func TestUnmarshalingBadInput(t *testing.T) {
- for _, tt := range unmarshalingShouldError {
- err := UnmarshalString(tt.in, tt.pb)
- if err == nil {
- t.Errorf("an error was expected when parsing %q instead of an object", tt.desc)
- }
- }
-}
-
-type funcResolver func(turl string) (proto.Message, error)
-
-func (fn funcResolver) Resolve(turl string) (proto.Message, error) {
- return fn(turl)
-}
-
-func TestAnyWithCustomResolver(t *testing.T) {
- var resolvedTypeUrls []string
- resolver := funcResolver(func(turl string) (proto.Message, error) {
- resolvedTypeUrls = append(resolvedTypeUrls, turl)
- return new(pb.Simple), nil
- })
- msg := &pb.Simple{
- OBytes: []byte{1, 2, 3, 4},
- OBool: proto.Bool(true),
- OString: proto.String("foobar"),
- OInt64: proto.Int64(1020304),
- }
- msgBytes, err := proto.Marshal(msg)
- if err != nil {
- t.Errorf("an unexpected error occurred when marshaling message: %v", err)
- }
- // make an Any with a type URL that won't resolve w/out custom resolver
- any := &anypb.Any{
- TypeUrl: "https://foobar.com/some.random.MessageKind",
- Value: msgBytes,
- }
-
- m := Marshaler{AnyResolver: resolver}
- js, err := m.MarshalToString(any)
- if err != nil {
- t.Errorf("an unexpected error occurred when marshaling any to JSON: %v", err)
- }
- if len(resolvedTypeUrls) != 1 {
- t.Errorf("custom resolver was not invoked during marshaling")
- } else if resolvedTypeUrls[0] != "https://foobar.com/some.random.MessageKind" {
- t.Errorf("custom resolver was invoked with wrong URL: got %q, wanted %q", resolvedTypeUrls[0], "https://foobar.com/some.random.MessageKind")
- }
- wanted := `{"@type":"https://foobar.com/some.random.MessageKind","oBool":true,"oInt64":"1020304","oString":"foobar","oBytes":"AQIDBA=="}`
- if js != wanted {
- t.Errorf("marshalling JSON produced incorrect output: got %s, wanted %s", js, wanted)
- }
-
- u := Unmarshaler{AnyResolver: resolver}
- roundTrip := &anypb.Any{}
- err = u.Unmarshal(bytes.NewReader([]byte(js)), roundTrip)
- if err != nil {
- t.Errorf("an unexpected error occurred when unmarshaling any from JSON: %v", err)
- }
- if len(resolvedTypeUrls) != 2 {
- t.Errorf("custom resolver was not invoked during marshaling")
- } else if resolvedTypeUrls[1] != "https://foobar.com/some.random.MessageKind" {
- t.Errorf("custom resolver was invoked with wrong URL: got %q, wanted %q", resolvedTypeUrls[1], "https://foobar.com/some.random.MessageKind")
- }
- if !proto.Equal(any, roundTrip) {
- t.Errorf("message contents not set correctly after unmarshalling JSON: got %s, wanted %s", roundTrip, any)
- }
-}
-
-func TestUnmarshalJSONPBUnmarshaler(t *testing.T) {
- rawJson := `{ "foo": "bar", "baz": [0, 1, 2, 3] }`
- var msg dynamicMessage
- if err := Unmarshal(strings.NewReader(rawJson), &msg); err != nil {
- t.Errorf("an unexpected error occurred when parsing into JSONPBUnmarshaler: %v", err)
- }
- if msg.rawJson != rawJson {
- t.Errorf("message contents not set correctly after unmarshalling JSON: got %s, wanted %s", msg.rawJson, rawJson)
- }
-}
-
-func TestUnmarshalNullWithJSONPBUnmarshaler(t *testing.T) {
- rawJson := `{"stringField":null}`
- var ptrFieldMsg ptrFieldMessage
- if err := Unmarshal(strings.NewReader(rawJson), &ptrFieldMsg); err != nil {
- t.Errorf("unmarshal error: %v", err)
- }
-
- want := ptrFieldMessage{StringField: &stringField{IsSet: true, StringValue: "null"}}
- if !proto.Equal(&ptrFieldMsg, &want) {
- t.Errorf("unmarshal result StringField: got %v, want %v", ptrFieldMsg, want)
- }
-}
-
-func TestUnmarshalAnyJSONPBUnmarshaler(t *testing.T) {
- rawJson := `{ "@type": "blah.com/` + dynamicMessageName + `", "foo": "bar", "baz": [0, 1, 2, 3] }`
- var got anypb.Any
- if err := Unmarshal(strings.NewReader(rawJson), &got); err != nil {
- t.Errorf("an unexpected error occurred when parsing into JSONPBUnmarshaler: %v", err)
- }
-
- dm := &dynamicMessage{rawJson: `{"baz":[0,1,2,3],"foo":"bar"}`}
- var want anypb.Any
- if b, err := proto.Marshal(dm); err != nil {
- t.Errorf("an unexpected error occurred when marshaling message: %v", err)
- } else {
- want.TypeUrl = "blah.com/" + dynamicMessageName
- want.Value = b
- }
-
- if !proto.Equal(&got, &want) {
- t.Errorf("message contents not set correctly after unmarshalling JSON: got %v, wanted %v", got, want)
- }
-}
-
-const (
- dynamicMessageName = "google.protobuf.jsonpb.testing.dynamicMessage"
-)
-
-func init() {
- // we register the custom type below so that we can use it in Any types
- proto.RegisterType((*dynamicMessage)(nil), dynamicMessageName)
-}
-
-type ptrFieldMessage struct {
- StringField *stringField `protobuf:"bytes,1,opt,name=stringField"`
-}
-
-func (m *ptrFieldMessage) Reset() {
-}
-
-func (m *ptrFieldMessage) String() string {
- return m.StringField.StringValue
-}
-
-func (m *ptrFieldMessage) ProtoMessage() {
-}
-
-type stringField struct {
- IsSet bool `protobuf:"varint,1,opt,name=isSet"`
- StringValue string `protobuf:"bytes,2,opt,name=stringValue"`
-}
-
-func (s *stringField) Reset() {
-}
-
-func (s *stringField) String() string {
- return s.StringValue
-}
-
-func (s *stringField) ProtoMessage() {
-}
-
-func (s *stringField) UnmarshalJSONPB(jum *Unmarshaler, js []byte) error {
- s.IsSet = true
- s.StringValue = string(js)
- return nil
-}
-
-// dynamicMessage implements protobuf.Message but is not a normal generated message type.
-// It provides implementations of JSONPBMarshaler and JSONPBUnmarshaler for JSON support.
-type dynamicMessage struct {
- rawJson string `protobuf:"bytes,1,opt,name=rawJson"`
-
- // an unexported nested message is present just to ensure that it
- // won't result in a panic (see issue #509)
- dummy *dynamicMessage `protobuf:"bytes,2,opt,name=dummy"`
-}
-
-func (m *dynamicMessage) Reset() {
- m.rawJson = "{}"
-}
-
-func (m *dynamicMessage) String() string {
- return m.rawJson
-}
-
-func (m *dynamicMessage) ProtoMessage() {
-}
-
-func (m *dynamicMessage) MarshalJSONPB(jm *Marshaler) ([]byte, error) {
- return []byte(m.rawJson), nil
-}
-
-func (m *dynamicMessage) UnmarshalJSONPB(jum *Unmarshaler, js []byte) error {
- m.rawJson = string(js)
- return nil
-}
-
-// Test unmarshaling message containing unset required fields should produce error.
-func TestUnmarshalUnsetRequiredFields(t *testing.T) {
- tests := []struct {
- desc string
- pb proto.Message
- json string
- }{
- {
- desc: "direct required field missing",
- pb: &pb.MsgWithRequired{},
- json: `{}`,
- },
- {
- desc: "direct required field set to null",
- pb: &pb.MsgWithRequired{},
- json: `{"str": null}`,
- },
- {
- desc: "indirect required field missing",
- pb: &pb.MsgWithIndirectRequired{},
- json: `{"subm": {}}`,
- },
- {
- desc: "indirect required field set to null",
- pb: &pb.MsgWithIndirectRequired{},
- json: `{"subm": {"str": null}}`,
- },
- {
- desc: "direct required bytes field missing",
- pb: &pb.MsgWithRequiredBytes{},
- json: `{}`,
- },
- {
- desc: "direct required bytes field set to null",
- pb: &pb.MsgWithRequiredBytes{},
- json: `{"byts": null}`,
- },
- {
- desc: "direct required wkt field missing",
- pb: &pb.MsgWithRequiredWKT{},
- json: `{}`,
- },
- {
- desc: "direct required wkt field set to null",
- pb: &pb.MsgWithRequiredWKT{},
- json: `{"str": null}`,
- },
- {
- desc: "any containing message with required field set to null",
- pb: &pb.KnownTypes{},
- json: `{"an": {"@type": "example.com/jsonpb.MsgWithRequired", "str": null}}`,
- },
- {
- desc: "any containing message with missing required field",
- pb: &pb.KnownTypes{},
- json: `{"an": {"@type": "example.com/jsonpb.MsgWithRequired"}}`,
- },
- {
- desc: "missing required in map value",
- pb: &pb.MsgWithIndirectRequired{},
- json: `{"map_field": {"a": {}, "b": {"str": "hi"}}}`,
- },
- {
- desc: "required in map value set to null",
- pb: &pb.MsgWithIndirectRequired{},
- json: `{"map_field": {"a": {"str": "hello"}, "b": {"str": null}}}`,
- },
- {
- desc: "missing required in slice item",
- pb: &pb.MsgWithIndirectRequired{},
- json: `{"slice_field": [{}, {"str": "hi"}]}`,
- },
- {
- desc: "required in slice item set to null",
- pb: &pb.MsgWithIndirectRequired{},
- json: `{"slice_field": [{"str": "hello"}, {"str": null}]}`,
- },
- {
- desc: "required inside oneof missing",
- pb: &pb.MsgWithOneof{},
- json: `{"msgWithRequired": {}}`,
- },
- {
- desc: "required inside oneof set to null",
- pb: &pb.MsgWithOneof{},
- json: `{"msgWithRequired": {"str": null}}`,
- },
- {
- desc: "required field in extension missing",
- pb: &pb.Real{},
- json: `{"[jsonpb.extm]":{}}`,
- },
- {
- desc: "required field in extension set to null",
- pb: &pb.Real{},
- json: `{"[jsonpb.extm]":{"str": null}}`,
- },
- }
-
- for _, tc := range tests {
- if err := UnmarshalString(tc.json, tc.pb); err == nil {
- t.Errorf("%s: expecting error in unmarshaling with unset required fields %s", tc.desc, tc.json)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.pb.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.pb.go
deleted file mode 100644
index 1bcce029..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.pb.go
+++ /dev/null
@@ -1,368 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: more_test_objects.proto
-
-package jsonpb
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Numeral int32
-
-const (
- Numeral_UNKNOWN Numeral = 0
- Numeral_ARABIC Numeral = 1
- Numeral_ROMAN Numeral = 2
-)
-
-var Numeral_name = map[int32]string{
- 0: "UNKNOWN",
- 1: "ARABIC",
- 2: "ROMAN",
-}
-var Numeral_value = map[string]int32{
- "UNKNOWN": 0,
- "ARABIC": 1,
- "ROMAN": 2,
-}
-
-func (x Numeral) String() string {
- return proto.EnumName(Numeral_name, int32(x))
-}
-func (Numeral) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_more_test_objects_bef0d79b901f4c4a, []int{0}
-}
-
-type Simple3 struct {
- Dub float64 `protobuf:"fixed64,1,opt,name=dub" json:"dub,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Simple3) Reset() { *m = Simple3{} }
-func (m *Simple3) String() string { return proto.CompactTextString(m) }
-func (*Simple3) ProtoMessage() {}
-func (*Simple3) Descriptor() ([]byte, []int) {
- return fileDescriptor_more_test_objects_bef0d79b901f4c4a, []int{0}
-}
-func (m *Simple3) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Simple3.Unmarshal(m, b)
-}
-func (m *Simple3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Simple3.Marshal(b, m, deterministic)
-}
-func (dst *Simple3) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Simple3.Merge(dst, src)
-}
-func (m *Simple3) XXX_Size() int {
- return xxx_messageInfo_Simple3.Size(m)
-}
-func (m *Simple3) XXX_DiscardUnknown() {
- xxx_messageInfo_Simple3.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Simple3 proto.InternalMessageInfo
-
-func (m *Simple3) GetDub() float64 {
- if m != nil {
- return m.Dub
- }
- return 0
-}
-
-type SimpleSlice3 struct {
- Slices []string `protobuf:"bytes,1,rep,name=slices" json:"slices,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SimpleSlice3) Reset() { *m = SimpleSlice3{} }
-func (m *SimpleSlice3) String() string { return proto.CompactTextString(m) }
-func (*SimpleSlice3) ProtoMessage() {}
-func (*SimpleSlice3) Descriptor() ([]byte, []int) {
- return fileDescriptor_more_test_objects_bef0d79b901f4c4a, []int{1}
-}
-func (m *SimpleSlice3) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SimpleSlice3.Unmarshal(m, b)
-}
-func (m *SimpleSlice3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SimpleSlice3.Marshal(b, m, deterministic)
-}
-func (dst *SimpleSlice3) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SimpleSlice3.Merge(dst, src)
-}
-func (m *SimpleSlice3) XXX_Size() int {
- return xxx_messageInfo_SimpleSlice3.Size(m)
-}
-func (m *SimpleSlice3) XXX_DiscardUnknown() {
- xxx_messageInfo_SimpleSlice3.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SimpleSlice3 proto.InternalMessageInfo
-
-func (m *SimpleSlice3) GetSlices() []string {
- if m != nil {
- return m.Slices
- }
- return nil
-}
-
-type SimpleMap3 struct {
- Stringy map[string]string `protobuf:"bytes,1,rep,name=stringy" json:"stringy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SimpleMap3) Reset() { *m = SimpleMap3{} }
-func (m *SimpleMap3) String() string { return proto.CompactTextString(m) }
-func (*SimpleMap3) ProtoMessage() {}
-func (*SimpleMap3) Descriptor() ([]byte, []int) {
- return fileDescriptor_more_test_objects_bef0d79b901f4c4a, []int{2}
-}
-func (m *SimpleMap3) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SimpleMap3.Unmarshal(m, b)
-}
-func (m *SimpleMap3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SimpleMap3.Marshal(b, m, deterministic)
-}
-func (dst *SimpleMap3) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SimpleMap3.Merge(dst, src)
-}
-func (m *SimpleMap3) XXX_Size() int {
- return xxx_messageInfo_SimpleMap3.Size(m)
-}
-func (m *SimpleMap3) XXX_DiscardUnknown() {
- xxx_messageInfo_SimpleMap3.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SimpleMap3 proto.InternalMessageInfo
-
-func (m *SimpleMap3) GetStringy() map[string]string {
- if m != nil {
- return m.Stringy
- }
- return nil
-}
-
-type SimpleNull3 struct {
- Simple *Simple3 `protobuf:"bytes,1,opt,name=simple" json:"simple,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SimpleNull3) Reset() { *m = SimpleNull3{} }
-func (m *SimpleNull3) String() string { return proto.CompactTextString(m) }
-func (*SimpleNull3) ProtoMessage() {}
-func (*SimpleNull3) Descriptor() ([]byte, []int) {
- return fileDescriptor_more_test_objects_bef0d79b901f4c4a, []int{3}
-}
-func (m *SimpleNull3) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SimpleNull3.Unmarshal(m, b)
-}
-func (m *SimpleNull3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SimpleNull3.Marshal(b, m, deterministic)
-}
-func (dst *SimpleNull3) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SimpleNull3.Merge(dst, src)
-}
-func (m *SimpleNull3) XXX_Size() int {
- return xxx_messageInfo_SimpleNull3.Size(m)
-}
-func (m *SimpleNull3) XXX_DiscardUnknown() {
- xxx_messageInfo_SimpleNull3.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SimpleNull3 proto.InternalMessageInfo
-
-func (m *SimpleNull3) GetSimple() *Simple3 {
- if m != nil {
- return m.Simple
- }
- return nil
-}
-
-type Mappy struct {
- Nummy map[int64]int32 `protobuf:"bytes,1,rep,name=nummy" json:"nummy,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- Strry map[string]string `protobuf:"bytes,2,rep,name=strry" json:"strry,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Objjy map[int32]*Simple3 `protobuf:"bytes,3,rep,name=objjy" json:"objjy,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Buggy map[int64]string `protobuf:"bytes,4,rep,name=buggy" json:"buggy,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Booly map[bool]bool `protobuf:"bytes,5,rep,name=booly" json:"booly,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- Enumy map[string]Numeral `protobuf:"bytes,6,rep,name=enumy" json:"enumy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=jsonpb.Numeral"`
- S32Booly map[int32]bool `protobuf:"bytes,7,rep,name=s32booly" json:"s32booly,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- S64Booly map[int64]bool `protobuf:"bytes,8,rep,name=s64booly" json:"s64booly,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- U32Booly map[uint32]bool `protobuf:"bytes,9,rep,name=u32booly" json:"u32booly,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- U64Booly map[uint64]bool `protobuf:"bytes,10,rep,name=u64booly" json:"u64booly,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Mappy) Reset() { *m = Mappy{} }
-func (m *Mappy) String() string { return proto.CompactTextString(m) }
-func (*Mappy) ProtoMessage() {}
-func (*Mappy) Descriptor() ([]byte, []int) {
- return fileDescriptor_more_test_objects_bef0d79b901f4c4a, []int{4}
-}
-func (m *Mappy) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Mappy.Unmarshal(m, b)
-}
-func (m *Mappy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Mappy.Marshal(b, m, deterministic)
-}
-func (dst *Mappy) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Mappy.Merge(dst, src)
-}
-func (m *Mappy) XXX_Size() int {
- return xxx_messageInfo_Mappy.Size(m)
-}
-func (m *Mappy) XXX_DiscardUnknown() {
- xxx_messageInfo_Mappy.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Mappy proto.InternalMessageInfo
-
-func (m *Mappy) GetNummy() map[int64]int32 {
- if m != nil {
- return m.Nummy
- }
- return nil
-}
-
-func (m *Mappy) GetStrry() map[string]string {
- if m != nil {
- return m.Strry
- }
- return nil
-}
-
-func (m *Mappy) GetObjjy() map[int32]*Simple3 {
- if m != nil {
- return m.Objjy
- }
- return nil
-}
-
-func (m *Mappy) GetBuggy() map[int64]string {
- if m != nil {
- return m.Buggy
- }
- return nil
-}
-
-func (m *Mappy) GetBooly() map[bool]bool {
- if m != nil {
- return m.Booly
- }
- return nil
-}
-
-func (m *Mappy) GetEnumy() map[string]Numeral {
- if m != nil {
- return m.Enumy
- }
- return nil
-}
-
-func (m *Mappy) GetS32Booly() map[int32]bool {
- if m != nil {
- return m.S32Booly
- }
- return nil
-}
-
-func (m *Mappy) GetS64Booly() map[int64]bool {
- if m != nil {
- return m.S64Booly
- }
- return nil
-}
-
-func (m *Mappy) GetU32Booly() map[uint32]bool {
- if m != nil {
- return m.U32Booly
- }
- return nil
-}
-
-func (m *Mappy) GetU64Booly() map[uint64]bool {
- if m != nil {
- return m.U64Booly
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Simple3)(nil), "jsonpb.Simple3")
- proto.RegisterType((*SimpleSlice3)(nil), "jsonpb.SimpleSlice3")
- proto.RegisterType((*SimpleMap3)(nil), "jsonpb.SimpleMap3")
- proto.RegisterMapType((map[string]string)(nil), "jsonpb.SimpleMap3.StringyEntry")
- proto.RegisterType((*SimpleNull3)(nil), "jsonpb.SimpleNull3")
- proto.RegisterType((*Mappy)(nil), "jsonpb.Mappy")
- proto.RegisterMapType((map[bool]bool)(nil), "jsonpb.Mappy.BoolyEntry")
- proto.RegisterMapType((map[int64]string)(nil), "jsonpb.Mappy.BuggyEntry")
- proto.RegisterMapType((map[string]Numeral)(nil), "jsonpb.Mappy.EnumyEntry")
- proto.RegisterMapType((map[int64]int32)(nil), "jsonpb.Mappy.NummyEntry")
- proto.RegisterMapType((map[int32]*Simple3)(nil), "jsonpb.Mappy.ObjjyEntry")
- proto.RegisterMapType((map[int32]bool)(nil), "jsonpb.Mappy.S32boolyEntry")
- proto.RegisterMapType((map[int64]bool)(nil), "jsonpb.Mappy.S64boolyEntry")
- proto.RegisterMapType((map[string]string)(nil), "jsonpb.Mappy.StrryEntry")
- proto.RegisterMapType((map[uint32]bool)(nil), "jsonpb.Mappy.U32boolyEntry")
- proto.RegisterMapType((map[uint64]bool)(nil), "jsonpb.Mappy.U64boolyEntry")
- proto.RegisterEnum("jsonpb.Numeral", Numeral_name, Numeral_value)
-}
-
-func init() {
- proto.RegisterFile("more_test_objects.proto", fileDescriptor_more_test_objects_bef0d79b901f4c4a)
-}
-
-var fileDescriptor_more_test_objects_bef0d79b901f4c4a = []byte{
- // 526 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xdd, 0x6b, 0xdb, 0x3c,
- 0x14, 0x87, 0x5f, 0x27, 0xf5, 0xd7, 0x49, 0xfb, 0x2e, 0x88, 0xb1, 0x99, 0xf4, 0x62, 0xc5, 0xb0,
- 0xad, 0x0c, 0xe6, 0x8b, 0x78, 0x74, 0x5d, 0x77, 0x95, 0x8e, 0x5e, 0x94, 0x11, 0x07, 0x1c, 0xc2,
- 0x2e, 0x4b, 0xdc, 0x99, 0x90, 0xcc, 0x5f, 0xd8, 0xd6, 0xc0, 0xd7, 0xfb, 0xbb, 0x07, 0xe3, 0x48,
- 0x72, 0x2d, 0x07, 0x85, 0x6c, 0x77, 0x52, 0x7e, 0xcf, 0xe3, 0x73, 0x24, 0x1d, 0x02, 0x2f, 0xd3,
- 0xbc, 0x8c, 0x1f, 0xea, 0xb8, 0xaa, 0x1f, 0xf2, 0x68, 0x17, 0x3f, 0xd6, 0x95, 0x57, 0x94, 0x79,
- 0x9d, 0x13, 0x63, 0x57, 0xe5, 0x59, 0x11, 0xb9, 0xe7, 0x60, 0x2e, 0xb7, 0x69, 0x91, 0xc4, 0x3e,
- 0x19, 0xc3, 0xf0, 0x3b, 0x8d, 0x1c, 0xed, 0x42, 0xbb, 0xd4, 0x42, 0x5c, 0xba, 0x6f, 0xe0, 0x94,
- 0x87, 0xcb, 0x64, 0xfb, 0x18, 0xfb, 0xe4, 0x05, 0x18, 0x15, 0xae, 0x2a, 0x47, 0xbb, 0x18, 0x5e,
- 0xda, 0xa1, 0xd8, 0xb9, 0xbf, 0x34, 0x00, 0x0e, 0xce, 0xd7, 0x85, 0x4f, 0x3e, 0x81, 0x59, 0xd5,
- 0xe5, 0x36, 0xdb, 0x34, 0x8c, 0x1b, 0x4d, 0x5f, 0x79, 0xbc, 0x9a, 0xd7, 0x41, 0xde, 0x92, 0x13,
- 0x77, 0x59, 0x5d, 0x36, 0x61, 0xcb, 0x4f, 0x6e, 0xe0, 0x54, 0x0e, 0xb0, 0xa7, 0x1f, 0x71, 0xc3,
- 0x7a, 0xb2, 0x43, 0x5c, 0x92, 0xe7, 0xa0, 0xff, 0x5c, 0x27, 0x34, 0x76, 0x06, 0xec, 0x37, 0xbe,
- 0xb9, 0x19, 0x5c, 0x6b, 0xee, 0x15, 0x8c, 0xf8, 0xf7, 0x03, 0x9a, 0x24, 0x3e, 0x79, 0x0b, 0x46,
- 0xc5, 0xb6, 0xcc, 0x1e, 0x4d, 0x9f, 0xf5, 0x9b, 0xf0, 0x43, 0x11, 0xbb, 0xbf, 0x2d, 0xd0, 0xe7,
- 0xeb, 0xa2, 0x68, 0x88, 0x07, 0x7a, 0x46, 0xd3, 0xb4, 0x6d, 0xdb, 0x69, 0x0d, 0x96, 0x7a, 0x01,
- 0x46, 0xbc, 0x5f, 0x8e, 0x21, 0x5f, 0xd5, 0x65, 0xd9, 0x38, 0x03, 0x15, 0xbf, 0xc4, 0x48, 0xf0,
- 0x0c, 0x43, 0x3e, 0x8f, 0x76, 0xbb, 0xc6, 0x19, 0xaa, 0xf8, 0x05, 0x46, 0x82, 0x67, 0x18, 0xf2,
- 0x11, 0xdd, 0x6c, 0x1a, 0xe7, 0x44, 0xc5, 0xdf, 0x62, 0x24, 0x78, 0x86, 0x31, 0x3e, 0xcf, 0x93,
- 0xc6, 0xd1, 0x95, 0x3c, 0x46, 0x2d, 0x8f, 0x6b, 0xe4, 0xe3, 0x8c, 0xa6, 0x8d, 0x63, 0xa8, 0xf8,
- 0x3b, 0x8c, 0x04, 0xcf, 0x30, 0xf2, 0x11, 0xac, 0xca, 0x9f, 0xf2, 0x12, 0x26, 0x53, 0xce, 0xf7,
- 0x8e, 0x2c, 0x52, 0x6e, 0x3d, 0xc1, 0x4c, 0xbc, 0xfa, 0xc0, 0x45, 0x4b, 0x29, 0x8a, 0xb4, 0x15,
- 0xc5, 0x16, 0x45, 0xda, 0x56, 0xb4, 0x55, 0xe2, 0xaa, 0x5f, 0x91, 0x4a, 0x15, 0x69, 0x5b, 0x11,
- 0x94, 0x62, 0xbf, 0x62, 0x0b, 0x4f, 0xae, 0x01, 0xba, 0x87, 0x96, 0xe7, 0x6f, 0xa8, 0x98, 0x3f,
- 0x5d, 0x9a, 0x3f, 0x34, 0xbb, 0x27, 0xff, 0x97, 0xc9, 0x9d, 0xdc, 0x03, 0x74, 0x8f, 0x2f, 0x9b,
- 0x3a, 0x37, 0x5f, 0xcb, 0xa6, 0x62, 0x92, 0xfb, 0x4d, 0x74, 0x73, 0x71, 0xac, 0x7d, 0x7b, 0xdf,
- 0x7c, 0xba, 0x10, 0xd9, 0xb4, 0x14, 0xa6, 0xb5, 0xd7, 0x7e, 0x37, 0x2b, 0x8a, 0x83, 0xf7, 0xda,
- 0xff, 0xbf, 0x6b, 0x3f, 0xa0, 0x69, 0x5c, 0xae, 0x13, 0xf9, 0x53, 0x9f, 0xe1, 0xac, 0x37, 0x43,
- 0x8a, 0xcb, 0x38, 0xdc, 0x07, 0xca, 0xf2, 0xab, 0x1e, 0x3b, 0xfe, 0xbe, 0xbc, 0x3a, 0x54, 0xf9,
- 0xec, 0x6f, 0xe4, 0x43, 0x95, 0x4f, 0x8e, 0xc8, 0xef, 0xde, 0x83, 0x29, 0x6e, 0x82, 0x8c, 0xc0,
- 0x5c, 0x05, 0x5f, 0x83, 0xc5, 0xb7, 0x60, 0xfc, 0x1f, 0x01, 0x30, 0x66, 0xe1, 0xec, 0xf6, 0xfe,
- 0xcb, 0x58, 0x23, 0x36, 0xe8, 0xe1, 0x62, 0x3e, 0x0b, 0xc6, 0x83, 0xc8, 0x60, 0x7f, 0xe0, 0xfe,
- 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x84, 0x34, 0xaf, 0xdb, 0x05, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto
deleted file mode 100644
index d254fa5f..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto
+++ /dev/null
@@ -1,69 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package jsonpb;
-
-message Simple3 {
- double dub = 1;
-}
-
-message SimpleSlice3 {
- repeated string slices = 1;
-}
-
-message SimpleMap3 {
- map stringy = 1;
-}
-
-message SimpleNull3 {
- Simple3 simple = 1;
-}
-
-enum Numeral {
- UNKNOWN = 0;
- ARABIC = 1;
- ROMAN = 2;
-}
-
-message Mappy {
- map nummy = 1;
- map strry = 2;
- map objjy = 3;
- map buggy = 4;
- map booly = 5;
- map enumy = 6;
- map s32booly = 7;
- map s64booly = 8;
- map u32booly = 9;
- map u64booly = 10;
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.pb.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.pb.go
deleted file mode 100644
index d9e24db2..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.pb.go
+++ /dev/null
@@ -1,1278 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: test_objects.proto
-
-package jsonpb
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import any "github.com/golang/protobuf/ptypes/any"
-import duration "github.com/golang/protobuf/ptypes/duration"
-import _struct "github.com/golang/protobuf/ptypes/struct"
-import timestamp "github.com/golang/protobuf/ptypes/timestamp"
-import wrappers "github.com/golang/protobuf/ptypes/wrappers"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Widget_Color int32
-
-const (
- Widget_RED Widget_Color = 0
- Widget_GREEN Widget_Color = 1
- Widget_BLUE Widget_Color = 2
-)
-
-var Widget_Color_name = map[int32]string{
- 0: "RED",
- 1: "GREEN",
- 2: "BLUE",
-}
-var Widget_Color_value = map[string]int32{
- "RED": 0,
- "GREEN": 1,
- "BLUE": 2,
-}
-
-func (x Widget_Color) Enum() *Widget_Color {
- p := new(Widget_Color)
- *p = x
- return p
-}
-func (x Widget_Color) String() string {
- return proto.EnumName(Widget_Color_name, int32(x))
-}
-func (x *Widget_Color) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(Widget_Color_value, data, "Widget_Color")
- if err != nil {
- return err
- }
- *x = Widget_Color(value)
- return nil
-}
-func (Widget_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{3, 0}
-}
-
-// Test message for holding primitive types.
-type Simple struct {
- OBool *bool `protobuf:"varint,1,opt,name=o_bool,json=oBool" json:"o_bool,omitempty"`
- OInt32 *int32 `protobuf:"varint,2,opt,name=o_int32,json=oInt32" json:"o_int32,omitempty"`
- OInt64 *int64 `protobuf:"varint,3,opt,name=o_int64,json=oInt64" json:"o_int64,omitempty"`
- OUint32 *uint32 `protobuf:"varint,4,opt,name=o_uint32,json=oUint32" json:"o_uint32,omitempty"`
- OUint64 *uint64 `protobuf:"varint,5,opt,name=o_uint64,json=oUint64" json:"o_uint64,omitempty"`
- OSint32 *int32 `protobuf:"zigzag32,6,opt,name=o_sint32,json=oSint32" json:"o_sint32,omitempty"`
- OSint64 *int64 `protobuf:"zigzag64,7,opt,name=o_sint64,json=oSint64" json:"o_sint64,omitempty"`
- OFloat *float32 `protobuf:"fixed32,8,opt,name=o_float,json=oFloat" json:"o_float,omitempty"`
- ODouble *float64 `protobuf:"fixed64,9,opt,name=o_double,json=oDouble" json:"o_double,omitempty"`
- OString *string `protobuf:"bytes,10,opt,name=o_string,json=oString" json:"o_string,omitempty"`
- OBytes []byte `protobuf:"bytes,11,opt,name=o_bytes,json=oBytes" json:"o_bytes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Simple) Reset() { *m = Simple{} }
-func (m *Simple) String() string { return proto.CompactTextString(m) }
-func (*Simple) ProtoMessage() {}
-func (*Simple) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{0}
-}
-func (m *Simple) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Simple.Unmarshal(m, b)
-}
-func (m *Simple) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Simple.Marshal(b, m, deterministic)
-}
-func (dst *Simple) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Simple.Merge(dst, src)
-}
-func (m *Simple) XXX_Size() int {
- return xxx_messageInfo_Simple.Size(m)
-}
-func (m *Simple) XXX_DiscardUnknown() {
- xxx_messageInfo_Simple.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Simple proto.InternalMessageInfo
-
-func (m *Simple) GetOBool() bool {
- if m != nil && m.OBool != nil {
- return *m.OBool
- }
- return false
-}
-
-func (m *Simple) GetOInt32() int32 {
- if m != nil && m.OInt32 != nil {
- return *m.OInt32
- }
- return 0
-}
-
-func (m *Simple) GetOInt64() int64 {
- if m != nil && m.OInt64 != nil {
- return *m.OInt64
- }
- return 0
-}
-
-func (m *Simple) GetOUint32() uint32 {
- if m != nil && m.OUint32 != nil {
- return *m.OUint32
- }
- return 0
-}
-
-func (m *Simple) GetOUint64() uint64 {
- if m != nil && m.OUint64 != nil {
- return *m.OUint64
- }
- return 0
-}
-
-func (m *Simple) GetOSint32() int32 {
- if m != nil && m.OSint32 != nil {
- return *m.OSint32
- }
- return 0
-}
-
-func (m *Simple) GetOSint64() int64 {
- if m != nil && m.OSint64 != nil {
- return *m.OSint64
- }
- return 0
-}
-
-func (m *Simple) GetOFloat() float32 {
- if m != nil && m.OFloat != nil {
- return *m.OFloat
- }
- return 0
-}
-
-func (m *Simple) GetODouble() float64 {
- if m != nil && m.ODouble != nil {
- return *m.ODouble
- }
- return 0
-}
-
-func (m *Simple) GetOString() string {
- if m != nil && m.OString != nil {
- return *m.OString
- }
- return ""
-}
-
-func (m *Simple) GetOBytes() []byte {
- if m != nil {
- return m.OBytes
- }
- return nil
-}
-
-// Test message for holding special non-finites primitives.
-type NonFinites struct {
- FNan *float32 `protobuf:"fixed32,1,opt,name=f_nan,json=fNan" json:"f_nan,omitempty"`
- FPinf *float32 `protobuf:"fixed32,2,opt,name=f_pinf,json=fPinf" json:"f_pinf,omitempty"`
- FNinf *float32 `protobuf:"fixed32,3,opt,name=f_ninf,json=fNinf" json:"f_ninf,omitempty"`
- DNan *float64 `protobuf:"fixed64,4,opt,name=d_nan,json=dNan" json:"d_nan,omitempty"`
- DPinf *float64 `protobuf:"fixed64,5,opt,name=d_pinf,json=dPinf" json:"d_pinf,omitempty"`
- DNinf *float64 `protobuf:"fixed64,6,opt,name=d_ninf,json=dNinf" json:"d_ninf,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NonFinites) Reset() { *m = NonFinites{} }
-func (m *NonFinites) String() string { return proto.CompactTextString(m) }
-func (*NonFinites) ProtoMessage() {}
-func (*NonFinites) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{1}
-}
-func (m *NonFinites) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NonFinites.Unmarshal(m, b)
-}
-func (m *NonFinites) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NonFinites.Marshal(b, m, deterministic)
-}
-func (dst *NonFinites) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NonFinites.Merge(dst, src)
-}
-func (m *NonFinites) XXX_Size() int {
- return xxx_messageInfo_NonFinites.Size(m)
-}
-func (m *NonFinites) XXX_DiscardUnknown() {
- xxx_messageInfo_NonFinites.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NonFinites proto.InternalMessageInfo
-
-func (m *NonFinites) GetFNan() float32 {
- if m != nil && m.FNan != nil {
- return *m.FNan
- }
- return 0
-}
-
-func (m *NonFinites) GetFPinf() float32 {
- if m != nil && m.FPinf != nil {
- return *m.FPinf
- }
- return 0
-}
-
-func (m *NonFinites) GetFNinf() float32 {
- if m != nil && m.FNinf != nil {
- return *m.FNinf
- }
- return 0
-}
-
-func (m *NonFinites) GetDNan() float64 {
- if m != nil && m.DNan != nil {
- return *m.DNan
- }
- return 0
-}
-
-func (m *NonFinites) GetDPinf() float64 {
- if m != nil && m.DPinf != nil {
- return *m.DPinf
- }
- return 0
-}
-
-func (m *NonFinites) GetDNinf() float64 {
- if m != nil && m.DNinf != nil {
- return *m.DNinf
- }
- return 0
-}
-
-// Test message for holding repeated primitives.
-type Repeats struct {
- RBool []bool `protobuf:"varint,1,rep,name=r_bool,json=rBool" json:"r_bool,omitempty"`
- RInt32 []int32 `protobuf:"varint,2,rep,name=r_int32,json=rInt32" json:"r_int32,omitempty"`
- RInt64 []int64 `protobuf:"varint,3,rep,name=r_int64,json=rInt64" json:"r_int64,omitempty"`
- RUint32 []uint32 `protobuf:"varint,4,rep,name=r_uint32,json=rUint32" json:"r_uint32,omitempty"`
- RUint64 []uint64 `protobuf:"varint,5,rep,name=r_uint64,json=rUint64" json:"r_uint64,omitempty"`
- RSint32 []int32 `protobuf:"zigzag32,6,rep,name=r_sint32,json=rSint32" json:"r_sint32,omitempty"`
- RSint64 []int64 `protobuf:"zigzag64,7,rep,name=r_sint64,json=rSint64" json:"r_sint64,omitempty"`
- RFloat []float32 `protobuf:"fixed32,8,rep,name=r_float,json=rFloat" json:"r_float,omitempty"`
- RDouble []float64 `protobuf:"fixed64,9,rep,name=r_double,json=rDouble" json:"r_double,omitempty"`
- RString []string `protobuf:"bytes,10,rep,name=r_string,json=rString" json:"r_string,omitempty"`
- RBytes [][]byte `protobuf:"bytes,11,rep,name=r_bytes,json=rBytes" json:"r_bytes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Repeats) Reset() { *m = Repeats{} }
-func (m *Repeats) String() string { return proto.CompactTextString(m) }
-func (*Repeats) ProtoMessage() {}
-func (*Repeats) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{2}
-}
-func (m *Repeats) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Repeats.Unmarshal(m, b)
-}
-func (m *Repeats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Repeats.Marshal(b, m, deterministic)
-}
-func (dst *Repeats) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Repeats.Merge(dst, src)
-}
-func (m *Repeats) XXX_Size() int {
- return xxx_messageInfo_Repeats.Size(m)
-}
-func (m *Repeats) XXX_DiscardUnknown() {
- xxx_messageInfo_Repeats.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Repeats proto.InternalMessageInfo
-
-func (m *Repeats) GetRBool() []bool {
- if m != nil {
- return m.RBool
- }
- return nil
-}
-
-func (m *Repeats) GetRInt32() []int32 {
- if m != nil {
- return m.RInt32
- }
- return nil
-}
-
-func (m *Repeats) GetRInt64() []int64 {
- if m != nil {
- return m.RInt64
- }
- return nil
-}
-
-func (m *Repeats) GetRUint32() []uint32 {
- if m != nil {
- return m.RUint32
- }
- return nil
-}
-
-func (m *Repeats) GetRUint64() []uint64 {
- if m != nil {
- return m.RUint64
- }
- return nil
-}
-
-func (m *Repeats) GetRSint32() []int32 {
- if m != nil {
- return m.RSint32
- }
- return nil
-}
-
-func (m *Repeats) GetRSint64() []int64 {
- if m != nil {
- return m.RSint64
- }
- return nil
-}
-
-func (m *Repeats) GetRFloat() []float32 {
- if m != nil {
- return m.RFloat
- }
- return nil
-}
-
-func (m *Repeats) GetRDouble() []float64 {
- if m != nil {
- return m.RDouble
- }
- return nil
-}
-
-func (m *Repeats) GetRString() []string {
- if m != nil {
- return m.RString
- }
- return nil
-}
-
-func (m *Repeats) GetRBytes() [][]byte {
- if m != nil {
- return m.RBytes
- }
- return nil
-}
-
-// Test message for holding enums and nested messages.
-type Widget struct {
- Color *Widget_Color `protobuf:"varint,1,opt,name=color,enum=jsonpb.Widget_Color" json:"color,omitempty"`
- RColor []Widget_Color `protobuf:"varint,2,rep,name=r_color,json=rColor,enum=jsonpb.Widget_Color" json:"r_color,omitempty"`
- Simple *Simple `protobuf:"bytes,10,opt,name=simple" json:"simple,omitempty"`
- RSimple []*Simple `protobuf:"bytes,11,rep,name=r_simple,json=rSimple" json:"r_simple,omitempty"`
- Repeats *Repeats `protobuf:"bytes,20,opt,name=repeats" json:"repeats,omitempty"`
- RRepeats []*Repeats `protobuf:"bytes,21,rep,name=r_repeats,json=rRepeats" json:"r_repeats,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Widget) Reset() { *m = Widget{} }
-func (m *Widget) String() string { return proto.CompactTextString(m) }
-func (*Widget) ProtoMessage() {}
-func (*Widget) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{3}
-}
-func (m *Widget) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Widget.Unmarshal(m, b)
-}
-func (m *Widget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Widget.Marshal(b, m, deterministic)
-}
-func (dst *Widget) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Widget.Merge(dst, src)
-}
-func (m *Widget) XXX_Size() int {
- return xxx_messageInfo_Widget.Size(m)
-}
-func (m *Widget) XXX_DiscardUnknown() {
- xxx_messageInfo_Widget.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Widget proto.InternalMessageInfo
-
-func (m *Widget) GetColor() Widget_Color {
- if m != nil && m.Color != nil {
- return *m.Color
- }
- return Widget_RED
-}
-
-func (m *Widget) GetRColor() []Widget_Color {
- if m != nil {
- return m.RColor
- }
- return nil
-}
-
-func (m *Widget) GetSimple() *Simple {
- if m != nil {
- return m.Simple
- }
- return nil
-}
-
-func (m *Widget) GetRSimple() []*Simple {
- if m != nil {
- return m.RSimple
- }
- return nil
-}
-
-func (m *Widget) GetRepeats() *Repeats {
- if m != nil {
- return m.Repeats
- }
- return nil
-}
-
-func (m *Widget) GetRRepeats() []*Repeats {
- if m != nil {
- return m.RRepeats
- }
- return nil
-}
-
-type Maps struct {
- MInt64Str map[int64]string `protobuf:"bytes,1,rep,name=m_int64_str,json=mInt64Str" json:"m_int64_str,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- MBoolSimple map[bool]*Simple `protobuf:"bytes,2,rep,name=m_bool_simple,json=mBoolSimple" json:"m_bool_simple,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Maps) Reset() { *m = Maps{} }
-func (m *Maps) String() string { return proto.CompactTextString(m) }
-func (*Maps) ProtoMessage() {}
-func (*Maps) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{4}
-}
-func (m *Maps) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Maps.Unmarshal(m, b)
-}
-func (m *Maps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Maps.Marshal(b, m, deterministic)
-}
-func (dst *Maps) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Maps.Merge(dst, src)
-}
-func (m *Maps) XXX_Size() int {
- return xxx_messageInfo_Maps.Size(m)
-}
-func (m *Maps) XXX_DiscardUnknown() {
- xxx_messageInfo_Maps.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Maps proto.InternalMessageInfo
-
-func (m *Maps) GetMInt64Str() map[int64]string {
- if m != nil {
- return m.MInt64Str
- }
- return nil
-}
-
-func (m *Maps) GetMBoolSimple() map[bool]*Simple {
- if m != nil {
- return m.MBoolSimple
- }
- return nil
-}
-
-type MsgWithOneof struct {
- // Types that are valid to be assigned to Union:
- // *MsgWithOneof_Title
- // *MsgWithOneof_Salary
- // *MsgWithOneof_Country
- // *MsgWithOneof_HomeAddress
- // *MsgWithOneof_MsgWithRequired
- Union isMsgWithOneof_Union `protobuf_oneof:"union"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MsgWithOneof) Reset() { *m = MsgWithOneof{} }
-func (m *MsgWithOneof) String() string { return proto.CompactTextString(m) }
-func (*MsgWithOneof) ProtoMessage() {}
-func (*MsgWithOneof) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{5}
-}
-func (m *MsgWithOneof) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MsgWithOneof.Unmarshal(m, b)
-}
-func (m *MsgWithOneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MsgWithOneof.Marshal(b, m, deterministic)
-}
-func (dst *MsgWithOneof) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgWithOneof.Merge(dst, src)
-}
-func (m *MsgWithOneof) XXX_Size() int {
- return xxx_messageInfo_MsgWithOneof.Size(m)
-}
-func (m *MsgWithOneof) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgWithOneof.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgWithOneof proto.InternalMessageInfo
-
-type isMsgWithOneof_Union interface {
- isMsgWithOneof_Union()
-}
-
-type MsgWithOneof_Title struct {
- Title string `protobuf:"bytes,1,opt,name=title,oneof"`
-}
-type MsgWithOneof_Salary struct {
- Salary int64 `protobuf:"varint,2,opt,name=salary,oneof"`
-}
-type MsgWithOneof_Country struct {
- Country string `protobuf:"bytes,3,opt,name=Country,oneof"`
-}
-type MsgWithOneof_HomeAddress struct {
- HomeAddress string `protobuf:"bytes,4,opt,name=home_address,json=homeAddress,oneof"`
-}
-type MsgWithOneof_MsgWithRequired struct {
- MsgWithRequired *MsgWithRequired `protobuf:"bytes,5,opt,name=msg_with_required,json=msgWithRequired,oneof"`
-}
-
-func (*MsgWithOneof_Title) isMsgWithOneof_Union() {}
-func (*MsgWithOneof_Salary) isMsgWithOneof_Union() {}
-func (*MsgWithOneof_Country) isMsgWithOneof_Union() {}
-func (*MsgWithOneof_HomeAddress) isMsgWithOneof_Union() {}
-func (*MsgWithOneof_MsgWithRequired) isMsgWithOneof_Union() {}
-
-func (m *MsgWithOneof) GetUnion() isMsgWithOneof_Union {
- if m != nil {
- return m.Union
- }
- return nil
-}
-
-func (m *MsgWithOneof) GetTitle() string {
- if x, ok := m.GetUnion().(*MsgWithOneof_Title); ok {
- return x.Title
- }
- return ""
-}
-
-func (m *MsgWithOneof) GetSalary() int64 {
- if x, ok := m.GetUnion().(*MsgWithOneof_Salary); ok {
- return x.Salary
- }
- return 0
-}
-
-func (m *MsgWithOneof) GetCountry() string {
- if x, ok := m.GetUnion().(*MsgWithOneof_Country); ok {
- return x.Country
- }
- return ""
-}
-
-func (m *MsgWithOneof) GetHomeAddress() string {
- if x, ok := m.GetUnion().(*MsgWithOneof_HomeAddress); ok {
- return x.HomeAddress
- }
- return ""
-}
-
-func (m *MsgWithOneof) GetMsgWithRequired() *MsgWithRequired {
- if x, ok := m.GetUnion().(*MsgWithOneof_MsgWithRequired); ok {
- return x.MsgWithRequired
- }
- return nil
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*MsgWithOneof) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _MsgWithOneof_OneofMarshaler, _MsgWithOneof_OneofUnmarshaler, _MsgWithOneof_OneofSizer, []interface{}{
- (*MsgWithOneof_Title)(nil),
- (*MsgWithOneof_Salary)(nil),
- (*MsgWithOneof_Country)(nil),
- (*MsgWithOneof_HomeAddress)(nil),
- (*MsgWithOneof_MsgWithRequired)(nil),
- }
-}
-
-func _MsgWithOneof_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*MsgWithOneof)
- // union
- switch x := m.Union.(type) {
- case *MsgWithOneof_Title:
- b.EncodeVarint(1<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.Title)
- case *MsgWithOneof_Salary:
- b.EncodeVarint(2<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.Salary))
- case *MsgWithOneof_Country:
- b.EncodeVarint(3<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.Country)
- case *MsgWithOneof_HomeAddress:
- b.EncodeVarint(4<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.HomeAddress)
- case *MsgWithOneof_MsgWithRequired:
- b.EncodeVarint(5<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.MsgWithRequired); err != nil {
- return err
- }
- case nil:
- default:
- return fmt.Errorf("MsgWithOneof.Union has unexpected type %T", x)
- }
- return nil
-}
-
-func _MsgWithOneof_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*MsgWithOneof)
- switch tag {
- case 1: // union.title
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Union = &MsgWithOneof_Title{x}
- return true, err
- case 2: // union.salary
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &MsgWithOneof_Salary{int64(x)}
- return true, err
- case 3: // union.Country
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Union = &MsgWithOneof_Country{x}
- return true, err
- case 4: // union.home_address
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Union = &MsgWithOneof_HomeAddress{x}
- return true, err
- case 5: // union.msg_with_required
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(MsgWithRequired)
- err := b.DecodeMessage(msg)
- m.Union = &MsgWithOneof_MsgWithRequired{msg}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _MsgWithOneof_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*MsgWithOneof)
- // union
- switch x := m.Union.(type) {
- case *MsgWithOneof_Title:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Title)))
- n += len(x.Title)
- case *MsgWithOneof_Salary:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.Salary))
- case *MsgWithOneof_Country:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Country)))
- n += len(x.Country)
- case *MsgWithOneof_HomeAddress:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.HomeAddress)))
- n += len(x.HomeAddress)
- case *MsgWithOneof_MsgWithRequired:
- s := proto.Size(x.MsgWithRequired)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-type Real struct {
- Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Real) Reset() { *m = Real{} }
-func (m *Real) String() string { return proto.CompactTextString(m) }
-func (*Real) ProtoMessage() {}
-func (*Real) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{6}
-}
-
-var extRange_Real = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*Real) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_Real
-}
-func (m *Real) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Real.Unmarshal(m, b)
-}
-func (m *Real) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Real.Marshal(b, m, deterministic)
-}
-func (dst *Real) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Real.Merge(dst, src)
-}
-func (m *Real) XXX_Size() int {
- return xxx_messageInfo_Real.Size(m)
-}
-func (m *Real) XXX_DiscardUnknown() {
- xxx_messageInfo_Real.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Real proto.InternalMessageInfo
-
-func (m *Real) GetValue() float64 {
- if m != nil && m.Value != nil {
- return *m.Value
- }
- return 0
-}
-
-type Complex struct {
- Imaginary *float64 `protobuf:"fixed64,1,opt,name=imaginary" json:"imaginary,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Complex) Reset() { *m = Complex{} }
-func (m *Complex) String() string { return proto.CompactTextString(m) }
-func (*Complex) ProtoMessage() {}
-func (*Complex) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{7}
-}
-
-var extRange_Complex = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*Complex) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_Complex
-}
-func (m *Complex) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Complex.Unmarshal(m, b)
-}
-func (m *Complex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Complex.Marshal(b, m, deterministic)
-}
-func (dst *Complex) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Complex.Merge(dst, src)
-}
-func (m *Complex) XXX_Size() int {
- return xxx_messageInfo_Complex.Size(m)
-}
-func (m *Complex) XXX_DiscardUnknown() {
- xxx_messageInfo_Complex.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Complex proto.InternalMessageInfo
-
-func (m *Complex) GetImaginary() float64 {
- if m != nil && m.Imaginary != nil {
- return *m.Imaginary
- }
- return 0
-}
-
-var E_Complex_RealExtension = &proto.ExtensionDesc{
- ExtendedType: (*Real)(nil),
- ExtensionType: (*Complex)(nil),
- Field: 123,
- Name: "jsonpb.Complex.real_extension",
- Tag: "bytes,123,opt,name=real_extension,json=realExtension",
- Filename: "test_objects.proto",
-}
-
-type KnownTypes struct {
- An *any.Any `protobuf:"bytes,14,opt,name=an" json:"an,omitempty"`
- Dur *duration.Duration `protobuf:"bytes,1,opt,name=dur" json:"dur,omitempty"`
- St *_struct.Struct `protobuf:"bytes,12,opt,name=st" json:"st,omitempty"`
- Ts *timestamp.Timestamp `protobuf:"bytes,2,opt,name=ts" json:"ts,omitempty"`
- Lv *_struct.ListValue `protobuf:"bytes,15,opt,name=lv" json:"lv,omitempty"`
- Val *_struct.Value `protobuf:"bytes,16,opt,name=val" json:"val,omitempty"`
- Dbl *wrappers.DoubleValue `protobuf:"bytes,3,opt,name=dbl" json:"dbl,omitempty"`
- Flt *wrappers.FloatValue `protobuf:"bytes,4,opt,name=flt" json:"flt,omitempty"`
- I64 *wrappers.Int64Value `protobuf:"bytes,5,opt,name=i64" json:"i64,omitempty"`
- U64 *wrappers.UInt64Value `protobuf:"bytes,6,opt,name=u64" json:"u64,omitempty"`
- I32 *wrappers.Int32Value `protobuf:"bytes,7,opt,name=i32" json:"i32,omitempty"`
- U32 *wrappers.UInt32Value `protobuf:"bytes,8,opt,name=u32" json:"u32,omitempty"`
- Bool *wrappers.BoolValue `protobuf:"bytes,9,opt,name=bool" json:"bool,omitempty"`
- Str *wrappers.StringValue `protobuf:"bytes,10,opt,name=str" json:"str,omitempty"`
- Bytes *wrappers.BytesValue `protobuf:"bytes,11,opt,name=bytes" json:"bytes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *KnownTypes) Reset() { *m = KnownTypes{} }
-func (m *KnownTypes) String() string { return proto.CompactTextString(m) }
-func (*KnownTypes) ProtoMessage() {}
-func (*KnownTypes) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{8}
-}
-func (m *KnownTypes) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_KnownTypes.Unmarshal(m, b)
-}
-func (m *KnownTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_KnownTypes.Marshal(b, m, deterministic)
-}
-func (dst *KnownTypes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_KnownTypes.Merge(dst, src)
-}
-func (m *KnownTypes) XXX_Size() int {
- return xxx_messageInfo_KnownTypes.Size(m)
-}
-func (m *KnownTypes) XXX_DiscardUnknown() {
- xxx_messageInfo_KnownTypes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_KnownTypes proto.InternalMessageInfo
-
-func (m *KnownTypes) GetAn() *any.Any {
- if m != nil {
- return m.An
- }
- return nil
-}
-
-func (m *KnownTypes) GetDur() *duration.Duration {
- if m != nil {
- return m.Dur
- }
- return nil
-}
-
-func (m *KnownTypes) GetSt() *_struct.Struct {
- if m != nil {
- return m.St
- }
- return nil
-}
-
-func (m *KnownTypes) GetTs() *timestamp.Timestamp {
- if m != nil {
- return m.Ts
- }
- return nil
-}
-
-func (m *KnownTypes) GetLv() *_struct.ListValue {
- if m != nil {
- return m.Lv
- }
- return nil
-}
-
-func (m *KnownTypes) GetVal() *_struct.Value {
- if m != nil {
- return m.Val
- }
- return nil
-}
-
-func (m *KnownTypes) GetDbl() *wrappers.DoubleValue {
- if m != nil {
- return m.Dbl
- }
- return nil
-}
-
-func (m *KnownTypes) GetFlt() *wrappers.FloatValue {
- if m != nil {
- return m.Flt
- }
- return nil
-}
-
-func (m *KnownTypes) GetI64() *wrappers.Int64Value {
- if m != nil {
- return m.I64
- }
- return nil
-}
-
-func (m *KnownTypes) GetU64() *wrappers.UInt64Value {
- if m != nil {
- return m.U64
- }
- return nil
-}
-
-func (m *KnownTypes) GetI32() *wrappers.Int32Value {
- if m != nil {
- return m.I32
- }
- return nil
-}
-
-func (m *KnownTypes) GetU32() *wrappers.UInt32Value {
- if m != nil {
- return m.U32
- }
- return nil
-}
-
-func (m *KnownTypes) GetBool() *wrappers.BoolValue {
- if m != nil {
- return m.Bool
- }
- return nil
-}
-
-func (m *KnownTypes) GetStr() *wrappers.StringValue {
- if m != nil {
- return m.Str
- }
- return nil
-}
-
-func (m *KnownTypes) GetBytes() *wrappers.BytesValue {
- if m != nil {
- return m.Bytes
- }
- return nil
-}
-
-// Test messages for marshaling/unmarshaling required fields.
-type MsgWithRequired struct {
- Str *string `protobuf:"bytes,1,req,name=str" json:"str,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MsgWithRequired) Reset() { *m = MsgWithRequired{} }
-func (m *MsgWithRequired) String() string { return proto.CompactTextString(m) }
-func (*MsgWithRequired) ProtoMessage() {}
-func (*MsgWithRequired) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{9}
-}
-func (m *MsgWithRequired) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MsgWithRequired.Unmarshal(m, b)
-}
-func (m *MsgWithRequired) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MsgWithRequired.Marshal(b, m, deterministic)
-}
-func (dst *MsgWithRequired) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgWithRequired.Merge(dst, src)
-}
-func (m *MsgWithRequired) XXX_Size() int {
- return xxx_messageInfo_MsgWithRequired.Size(m)
-}
-func (m *MsgWithRequired) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgWithRequired.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgWithRequired proto.InternalMessageInfo
-
-func (m *MsgWithRequired) GetStr() string {
- if m != nil && m.Str != nil {
- return *m.Str
- }
- return ""
-}
-
-type MsgWithIndirectRequired struct {
- Subm *MsgWithRequired `protobuf:"bytes,1,opt,name=subm" json:"subm,omitempty"`
- MapField map[string]*MsgWithRequired `protobuf:"bytes,2,rep,name=map_field,json=mapField" json:"map_field,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- SliceField []*MsgWithRequired `protobuf:"bytes,3,rep,name=slice_field,json=sliceField" json:"slice_field,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MsgWithIndirectRequired) Reset() { *m = MsgWithIndirectRequired{} }
-func (m *MsgWithIndirectRequired) String() string { return proto.CompactTextString(m) }
-func (*MsgWithIndirectRequired) ProtoMessage() {}
-func (*MsgWithIndirectRequired) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{10}
-}
-func (m *MsgWithIndirectRequired) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MsgWithIndirectRequired.Unmarshal(m, b)
-}
-func (m *MsgWithIndirectRequired) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MsgWithIndirectRequired.Marshal(b, m, deterministic)
-}
-func (dst *MsgWithIndirectRequired) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgWithIndirectRequired.Merge(dst, src)
-}
-func (m *MsgWithIndirectRequired) XXX_Size() int {
- return xxx_messageInfo_MsgWithIndirectRequired.Size(m)
-}
-func (m *MsgWithIndirectRequired) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgWithIndirectRequired.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgWithIndirectRequired proto.InternalMessageInfo
-
-func (m *MsgWithIndirectRequired) GetSubm() *MsgWithRequired {
- if m != nil {
- return m.Subm
- }
- return nil
-}
-
-func (m *MsgWithIndirectRequired) GetMapField() map[string]*MsgWithRequired {
- if m != nil {
- return m.MapField
- }
- return nil
-}
-
-func (m *MsgWithIndirectRequired) GetSliceField() []*MsgWithRequired {
- if m != nil {
- return m.SliceField
- }
- return nil
-}
-
-type MsgWithRequiredBytes struct {
- Byts []byte `protobuf:"bytes,1,req,name=byts" json:"byts,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MsgWithRequiredBytes) Reset() { *m = MsgWithRequiredBytes{} }
-func (m *MsgWithRequiredBytes) String() string { return proto.CompactTextString(m) }
-func (*MsgWithRequiredBytes) ProtoMessage() {}
-func (*MsgWithRequiredBytes) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{11}
-}
-func (m *MsgWithRequiredBytes) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MsgWithRequiredBytes.Unmarshal(m, b)
-}
-func (m *MsgWithRequiredBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MsgWithRequiredBytes.Marshal(b, m, deterministic)
-}
-func (dst *MsgWithRequiredBytes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgWithRequiredBytes.Merge(dst, src)
-}
-func (m *MsgWithRequiredBytes) XXX_Size() int {
- return xxx_messageInfo_MsgWithRequiredBytes.Size(m)
-}
-func (m *MsgWithRequiredBytes) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgWithRequiredBytes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgWithRequiredBytes proto.InternalMessageInfo
-
-func (m *MsgWithRequiredBytes) GetByts() []byte {
- if m != nil {
- return m.Byts
- }
- return nil
-}
-
-type MsgWithRequiredWKT struct {
- Str *wrappers.StringValue `protobuf:"bytes,1,req,name=str" json:"str,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MsgWithRequiredWKT) Reset() { *m = MsgWithRequiredWKT{} }
-func (m *MsgWithRequiredWKT) String() string { return proto.CompactTextString(m) }
-func (*MsgWithRequiredWKT) ProtoMessage() {}
-func (*MsgWithRequiredWKT) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_objects_c6f6c615ab823e65, []int{12}
-}
-func (m *MsgWithRequiredWKT) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MsgWithRequiredWKT.Unmarshal(m, b)
-}
-func (m *MsgWithRequiredWKT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MsgWithRequiredWKT.Marshal(b, m, deterministic)
-}
-func (dst *MsgWithRequiredWKT) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MsgWithRequiredWKT.Merge(dst, src)
-}
-func (m *MsgWithRequiredWKT) XXX_Size() int {
- return xxx_messageInfo_MsgWithRequiredWKT.Size(m)
-}
-func (m *MsgWithRequiredWKT) XXX_DiscardUnknown() {
- xxx_messageInfo_MsgWithRequiredWKT.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MsgWithRequiredWKT proto.InternalMessageInfo
-
-func (m *MsgWithRequiredWKT) GetStr() *wrappers.StringValue {
- if m != nil {
- return m.Str
- }
- return nil
-}
-
-var E_Name = &proto.ExtensionDesc{
- ExtendedType: (*Real)(nil),
- ExtensionType: (*string)(nil),
- Field: 124,
- Name: "jsonpb.name",
- Tag: "bytes,124,opt,name=name",
- Filename: "test_objects.proto",
-}
-
-var E_Extm = &proto.ExtensionDesc{
- ExtendedType: (*Real)(nil),
- ExtensionType: (*MsgWithRequired)(nil),
- Field: 125,
- Name: "jsonpb.extm",
- Tag: "bytes,125,opt,name=extm",
- Filename: "test_objects.proto",
-}
-
-func init() {
- proto.RegisterType((*Simple)(nil), "jsonpb.Simple")
- proto.RegisterType((*NonFinites)(nil), "jsonpb.NonFinites")
- proto.RegisterType((*Repeats)(nil), "jsonpb.Repeats")
- proto.RegisterType((*Widget)(nil), "jsonpb.Widget")
- proto.RegisterType((*Maps)(nil), "jsonpb.Maps")
- proto.RegisterMapType((map[bool]*Simple)(nil), "jsonpb.Maps.MBoolSimpleEntry")
- proto.RegisterMapType((map[int64]string)(nil), "jsonpb.Maps.MInt64StrEntry")
- proto.RegisterType((*MsgWithOneof)(nil), "jsonpb.MsgWithOneof")
- proto.RegisterType((*Real)(nil), "jsonpb.Real")
- proto.RegisterType((*Complex)(nil), "jsonpb.Complex")
- proto.RegisterType((*KnownTypes)(nil), "jsonpb.KnownTypes")
- proto.RegisterType((*MsgWithRequired)(nil), "jsonpb.MsgWithRequired")
- proto.RegisterType((*MsgWithIndirectRequired)(nil), "jsonpb.MsgWithIndirectRequired")
- proto.RegisterMapType((map[string]*MsgWithRequired)(nil), "jsonpb.MsgWithIndirectRequired.MapFieldEntry")
- proto.RegisterType((*MsgWithRequiredBytes)(nil), "jsonpb.MsgWithRequiredBytes")
- proto.RegisterType((*MsgWithRequiredWKT)(nil), "jsonpb.MsgWithRequiredWKT")
- proto.RegisterEnum("jsonpb.Widget_Color", Widget_Color_name, Widget_Color_value)
- proto.RegisterExtension(E_Complex_RealExtension)
- proto.RegisterExtension(E_Name)
- proto.RegisterExtension(E_Extm)
-}
-
-func init() { proto.RegisterFile("test_objects.proto", fileDescriptor_test_objects_c6f6c615ab823e65) }
-
-var fileDescriptor_test_objects_c6f6c615ab823e65 = []byte{
- // 1357 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xdd, 0x72, 0x13, 0xc7,
- 0x12, 0xf6, 0xee, 0x6a, 0xf5, 0xd3, 0xf2, 0x1f, 0x83, 0x81, 0xc5, 0x87, 0x73, 0x8e, 0x4a, 0x70,
- 0x38, 0x0a, 0xc4, 0xa2, 0x22, 0xbb, 0x5c, 0x84, 0xe4, 0x06, 0x63, 0x13, 0x08, 0xe0, 0xa4, 0xc6,
- 0x26, 0x5c, 0xaa, 0x56, 0xde, 0x91, 0x59, 0xb2, 0xbb, 0xa3, 0xcc, 0xcc, 0xda, 0xa8, 0x92, 0x54,
- 0xf9, 0x19, 0x52, 0x79, 0x82, 0x54, 0x25, 0x8f, 0x90, 0x8b, 0xbc, 0x45, 0xde, 0x28, 0x35, 0x3d,
- 0xb3, 0x5a, 0x59, 0x42, 0x95, 0x5c, 0x79, 0xbb, 0xfb, 0xeb, 0x4f, 0x33, 0xfd, 0xf5, 0x74, 0x1b,
- 0x88, 0x62, 0x52, 0xf5, 0xf9, 0xe0, 0x1d, 0x3b, 0x51, 0xb2, 0x3b, 0x12, 0x5c, 0x71, 0x52, 0x7d,
- 0x27, 0x79, 0x36, 0x1a, 0x6c, 0xde, 0x3c, 0xe5, 0xfc, 0x34, 0x61, 0x0f, 0xd0, 0x3b, 0xc8, 0x87,
- 0x0f, 0xc2, 0x6c, 0x6c, 0x20, 0x9b, 0xff, 0x99, 0x0d, 0x45, 0xb9, 0x08, 0x55, 0xcc, 0x33, 0x1b,
- 0xbf, 0x35, 0x1b, 0x97, 0x4a, 0xe4, 0x27, 0xca, 0x46, 0xff, 0x3b, 0x1b, 0x55, 0x71, 0xca, 0xa4,
- 0x0a, 0xd3, 0xd1, 0x22, 0xfa, 0x73, 0x11, 0x8e, 0x46, 0x4c, 0xd8, 0x13, 0xb6, 0x7f, 0x75, 0xa1,
- 0x7a, 0x14, 0xa7, 0xa3, 0x84, 0x91, 0x6b, 0x50, 0xe5, 0xfd, 0x01, 0xe7, 0x49, 0xe0, 0xb4, 0x9c,
- 0x4e, 0x9d, 0xfa, 0x7c, 0x8f, 0xf3, 0x84, 0xdc, 0x80, 0x1a, 0xef, 0xc7, 0x99, 0xda, 0xee, 0x05,
- 0x6e, 0xcb, 0xe9, 0xf8, 0xb4, 0xca, 0x9f, 0x6b, 0x6b, 0x12, 0xd8, 0xdd, 0x09, 0xbc, 0x96, 0xd3,
- 0xf1, 0x4c, 0x60, 0x77, 0x87, 0xdc, 0x84, 0x3a, 0xef, 0xe7, 0x26, 0xa5, 0xd2, 0x72, 0x3a, 0x2b,
- 0xb4, 0xc6, 0x5f, 0xa3, 0x59, 0x86, 0x76, 0x77, 0x02, 0xbf, 0xe5, 0x74, 0x2a, 0x36, 0x54, 0x64,
- 0x49, 0x93, 0x55, 0x6d, 0x39, 0x9d, 0x2b, 0xb4, 0xc6, 0x8f, 0xa6, 0xb2, 0xa4, 0xc9, 0xaa, 0xb5,
- 0x9c, 0x0e, 0xb1, 0xa1, 0xdd, 0x1d, 0x73, 0x88, 0x61, 0xc2, 0x43, 0x15, 0xd4, 0x5b, 0x4e, 0xc7,
- 0xa5, 0x55, 0xfe, 0x54, 0x5b, 0x26, 0x27, 0xe2, 0xf9, 0x20, 0x61, 0x41, 0xa3, 0xe5, 0x74, 0x1c,
- 0x5a, 0xe3, 0xfb, 0x68, 0x5a, 0x3a, 0x25, 0xe2, 0xec, 0x34, 0x80, 0x96, 0xd3, 0x69, 0x68, 0x3a,
- 0x34, 0x0d, 0xdd, 0x60, 0xac, 0x98, 0x0c, 0x9a, 0x2d, 0xa7, 0xb3, 0x4c, 0xab, 0x7c, 0x4f, 0x5b,
- 0xed, 0x9f, 0x1c, 0x80, 0x43, 0x9e, 0x3d, 0x8d, 0xb3, 0x58, 0x31, 0x49, 0xae, 0x82, 0x3f, 0xec,
- 0x67, 0x61, 0x86, 0xa5, 0x72, 0x69, 0x65, 0x78, 0x18, 0x66, 0xba, 0x80, 0xc3, 0xfe, 0x28, 0xce,
- 0x86, 0x58, 0x28, 0x97, 0xfa, 0xc3, 0xaf, 0xe3, 0x6c, 0x68, 0xdc, 0x99, 0x76, 0x7b, 0xd6, 0x7d,
- 0xa8, 0xdd, 0x57, 0xc1, 0x8f, 0x90, 0xa2, 0x82, 0xa7, 0xab, 0x44, 0x96, 0x22, 0x32, 0x14, 0x3e,
- 0x7a, 0xfd, 0xa8, 0xa0, 0x88, 0x0c, 0x45, 0xd5, 0xba, 0x35, 0x45, 0xfb, 0x37, 0x17, 0x6a, 0x94,
- 0x8d, 0x58, 0xa8, 0xa4, 0x86, 0x88, 0x42, 0x3d, 0x4f, 0xab, 0x27, 0x0a, 0xf5, 0xc4, 0x44, 0x3d,
- 0x4f, 0xab, 0x27, 0x26, 0xea, 0x89, 0x89, 0x7a, 0x9e, 0x56, 0x4f, 0x4c, 0xd4, 0x13, 0xa5, 0x7a,
- 0x9e, 0x56, 0x4f, 0x94, 0xea, 0x89, 0x52, 0x3d, 0x4f, 0xab, 0x27, 0x4a, 0xf5, 0x44, 0xa9, 0x9e,
- 0xa7, 0xd5, 0x13, 0x47, 0x53, 0x59, 0x13, 0xf5, 0x3c, 0xad, 0x9e, 0x28, 0xd5, 0x13, 0x13, 0xf5,
- 0x3c, 0xad, 0x9e, 0x98, 0xa8, 0x27, 0x4a, 0xf5, 0x3c, 0xad, 0x9e, 0x28, 0xd5, 0x13, 0xa5, 0x7a,
- 0x9e, 0x56, 0x4f, 0x94, 0xea, 0x89, 0x89, 0x7a, 0x9e, 0x56, 0x4f, 0x18, 0xf5, 0x7e, 0x77, 0xa1,
- 0xfa, 0x26, 0x8e, 0x4e, 0x99, 0x22, 0xf7, 0xc0, 0x3f, 0xe1, 0x09, 0x17, 0xa8, 0xdc, 0x6a, 0x6f,
- 0xa3, 0x6b, 0x9e, 0x68, 0xd7, 0x84, 0xbb, 0x4f, 0x74, 0x8c, 0x1a, 0x08, 0xd9, 0xd2, 0x7c, 0x06,
- 0xad, 0x8b, 0xb7, 0x08, 0x5d, 0x15, 0xf8, 0x97, 0xdc, 0x85, 0xaa, 0xc4, 0xa7, 0x84, 0x5d, 0xd5,
- 0xec, 0xad, 0x16, 0x68, 0xf3, 0xc0, 0xa8, 0x8d, 0x92, 0x8f, 0x4c, 0x41, 0x10, 0xa9, 0xcf, 0x39,
- 0x8f, 0xd4, 0x05, 0xb2, 0xd0, 0x9a, 0x30, 0x02, 0x07, 0x1b, 0xc8, 0xb9, 0x56, 0x20, 0xad, 0xee,
- 0xb4, 0x88, 0x93, 0x8f, 0xa1, 0x21, 0xfa, 0x05, 0xf8, 0x1a, 0xd2, 0xce, 0x81, 0xeb, 0xc2, 0x7e,
- 0xb5, 0xff, 0x07, 0xbe, 0x39, 0x74, 0x0d, 0x3c, 0x7a, 0xb0, 0xbf, 0xbe, 0x44, 0x1a, 0xe0, 0x7f,
- 0x41, 0x0f, 0x0e, 0x0e, 0xd7, 0x1d, 0x52, 0x87, 0xca, 0xde, 0xcb, 0xd7, 0x07, 0xeb, 0x6e, 0xfb,
- 0x67, 0x17, 0x2a, 0xaf, 0xc2, 0x91, 0x24, 0x9f, 0x41, 0x33, 0x35, 0xed, 0xa2, 0x6b, 0x8f, 0x3d,
- 0xd6, 0xec, 0xfd, 0xab, 0xe0, 0xd7, 0x90, 0xee, 0x2b, 0xec, 0x9f, 0x23, 0x25, 0x0e, 0x32, 0x25,
- 0xc6, 0xb4, 0x91, 0x16, 0x36, 0x79, 0x0c, 0x2b, 0x29, 0xf6, 0x66, 0x71, 0x6b, 0x17, 0xd3, 0xff,
- 0x7d, 0x39, 0x5d, 0xf7, 0xab, 0xb9, 0xb6, 0x21, 0x68, 0xa6, 0xa5, 0x67, 0xf3, 0x73, 0x58, 0xbd,
- 0xcc, 0x4f, 0xd6, 0xc1, 0xfb, 0x96, 0x8d, 0x51, 0x46, 0x8f, 0xea, 0x4f, 0xb2, 0x01, 0xfe, 0x59,
- 0x98, 0xe4, 0x0c, 0x9f, 0x5f, 0x83, 0x1a, 0xe3, 0x91, 0xfb, 0xd0, 0xd9, 0x3c, 0x84, 0xf5, 0x59,
- 0xfa, 0xe9, 0xfc, 0xba, 0xc9, 0xbf, 0x33, 0x9d, 0x3f, 0x2f, 0x4a, 0xc9, 0xd7, 0xfe, 0xd3, 0x81,
- 0xe5, 0x57, 0xf2, 0xf4, 0x4d, 0xac, 0xde, 0x7e, 0x95, 0x31, 0x3e, 0x24, 0xd7, 0xc1, 0x57, 0xb1,
- 0x4a, 0x18, 0xd2, 0x35, 0x9e, 0x2d, 0x51, 0x63, 0x92, 0x00, 0xaa, 0x32, 0x4c, 0x42, 0x31, 0x46,
- 0x4e, 0xef, 0xd9, 0x12, 0xb5, 0x36, 0xd9, 0x84, 0xda, 0x13, 0x9e, 0xeb, 0x93, 0xe0, 0x58, 0xd0,
- 0x39, 0x85, 0x83, 0xdc, 0x86, 0xe5, 0xb7, 0x3c, 0x65, 0xfd, 0x30, 0x8a, 0x04, 0x93, 0x12, 0x27,
- 0x84, 0x06, 0x34, 0xb5, 0xf7, 0xb1, 0x71, 0x92, 0x03, 0xb8, 0x92, 0xca, 0xd3, 0xfe, 0x79, 0xac,
- 0xde, 0xf6, 0x05, 0xfb, 0x2e, 0x8f, 0x05, 0x8b, 0x70, 0x6a, 0x34, 0x7b, 0x37, 0x26, 0x85, 0x35,
- 0x67, 0xa4, 0x36, 0xfc, 0x6c, 0x89, 0xae, 0xa5, 0x97, 0x5d, 0x7b, 0x35, 0xf0, 0xf3, 0x2c, 0xe6,
- 0x59, 0xfb, 0x2e, 0x54, 0x28, 0x0b, 0x93, 0xb2, 0x8a, 0x8e, 0x19, 0x35, 0x68, 0xdc, 0xab, 0xd7,
- 0xa3, 0xf5, 0x8b, 0x8b, 0x8b, 0x0b, 0xb7, 0x7d, 0xae, 0x0f, 0xae, 0x0b, 0xf2, 0x9e, 0xdc, 0x82,
- 0x46, 0x9c, 0x86, 0xa7, 0x71, 0xa6, 0x2f, 0x68, 0xe0, 0xa5, 0xa3, 0x4c, 0xe9, 0xed, 0xc3, 0xaa,
- 0x60, 0x61, 0xd2, 0x67, 0xef, 0x15, 0xcb, 0x64, 0xcc, 0x33, 0xb2, 0x5c, 0x76, 0x66, 0x98, 0x04,
- 0xdf, 0x5f, 0x6e, 0x6d, 0x4b, 0x4f, 0x57, 0x74, 0xd2, 0x41, 0x91, 0xd3, 0xfe, 0xc3, 0x07, 0x78,
- 0x91, 0xf1, 0xf3, 0xec, 0x78, 0x3c, 0x62, 0x92, 0xdc, 0x01, 0x37, 0xcc, 0x82, 0x55, 0x4c, 0xdd,
- 0xe8, 0x9a, 0x35, 0xd7, 0x2d, 0xd6, 0x5c, 0xf7, 0x71, 0x36, 0xa6, 0x6e, 0x98, 0x91, 0xfb, 0xe0,
- 0x45, 0xb9, 0x79, 0xec, 0xcd, 0xde, 0xcd, 0x39, 0xd8, 0xbe, 0x5d, 0xb6, 0x54, 0xa3, 0xc8, 0xff,
- 0xc1, 0x95, 0x2a, 0x58, 0xb6, 0x35, 0x9c, 0xc5, 0x1e, 0xe1, 0xe2, 0xa5, 0xae, 0xd4, 0x43, 0xc4,
- 0x55, 0xd2, 0xb6, 0xc9, 0xe6, 0x1c, 0xf0, 0xb8, 0xd8, 0xc1, 0xd4, 0x55, 0x52, 0x63, 0x93, 0xb3,
- 0x60, 0x6d, 0x01, 0xf6, 0x65, 0x2c, 0xd5, 0x37, 0xba, 0xc2, 0xd4, 0x4d, 0xce, 0x48, 0x07, 0xbc,
- 0xb3, 0x30, 0x09, 0xd6, 0x11, 0x7c, 0x7d, 0x0e, 0x6c, 0x80, 0x1a, 0x42, 0xba, 0xe0, 0x45, 0x83,
- 0x04, 0x5b, 0xa7, 0xd9, 0xbb, 0x35, 0x7f, 0x2f, 0x9c, 0x95, 0x16, 0x1f, 0x0d, 0x12, 0xb2, 0x05,
- 0xde, 0x30, 0x51, 0xd8, 0x49, 0xfa, 0xdd, 0xce, 0xe2, 0x71, 0xea, 0x5a, 0xf8, 0x30, 0x51, 0x1a,
- 0x1e, 0xdb, 0x15, 0xfd, 0x21, 0x38, 0xbe, 0x44, 0x0b, 0x8f, 0x77, 0x77, 0xf4, 0x69, 0xf2, 0xdd,
- 0x1d, 0x5c, 0x4e, 0x1f, 0x3a, 0xcd, 0xeb, 0x69, 0x7c, 0xbe, 0xbb, 0x83, 0xf4, 0xdb, 0x3d, 0xdc,
- 0xe5, 0x0b, 0xe8, 0xb7, 0x7b, 0x05, 0xfd, 0x76, 0x0f, 0xe9, 0xb7, 0x7b, 0xb8, 0xe0, 0x17, 0xd1,
- 0x4f, 0xf0, 0x39, 0xe2, 0x2b, 0xb8, 0x09, 0x1b, 0x0b, 0x8a, 0xae, 0x47, 0x81, 0x81, 0x23, 0x4e,
- 0xf3, 0xeb, 0xa1, 0x06, 0x0b, 0xf8, 0xcd, 0x76, 0xb1, 0xfc, 0x52, 0x09, 0xf2, 0x09, 0xf8, 0xe5,
- 0xff, 0x08, 0x1f, 0xba, 0x00, 0x6e, 0x1d, 0x93, 0x60, 0x90, 0xed, 0xdb, 0xb0, 0x36, 0xf3, 0x18,
- 0xf5, 0x00, 0x32, 0xa3, 0xd4, 0xed, 0x34, 0x90, 0xb7, 0xfd, 0x8b, 0x0b, 0x37, 0x2c, 0xea, 0x79,
- 0x16, 0xc5, 0x82, 0x9d, 0xa8, 0x09, 0xfa, 0x3e, 0x54, 0x64, 0x3e, 0x48, 0x6d, 0x27, 0x2f, 0x7a,
- 0xe1, 0x14, 0x41, 0xe4, 0x4b, 0x68, 0xa4, 0xe1, 0xa8, 0x3f, 0x8c, 0x59, 0x12, 0xd9, 0x61, 0xbb,
- 0x35, 0x93, 0x31, 0xfb, 0x03, 0x7a, 0x08, 0x3f, 0xd5, 0x78, 0x33, 0x7c, 0xeb, 0xa9, 0x35, 0xc9,
- 0x43, 0x68, 0xca, 0x24, 0x3e, 0x61, 0x96, 0xcd, 0x43, 0xb6, 0x85, 0xbf, 0x0f, 0x88, 0xc5, 0xcc,
- 0xcd, 0x63, 0x58, 0xb9, 0x44, 0x3a, 0x3d, 0x72, 0x1b, 0x66, 0xe4, 0x6e, 0x5d, 0x1e, 0xb9, 0x0b,
- 0x69, 0xa7, 0x66, 0xef, 0x3d, 0xd8, 0x98, 0x89, 0x62, 0xb5, 0x09, 0x81, 0xca, 0x60, 0xac, 0x24,
- 0xd6, 0x73, 0x99, 0xe2, 0x77, 0x7b, 0x1f, 0xc8, 0x0c, 0xf6, 0xcd, 0x8b, 0xe3, 0x42, 0x6e, 0x0d,
- 0xfc, 0x27, 0x72, 0x3f, 0x6a, 0x41, 0x25, 0x0b, 0x53, 0x36, 0x33, 0xb4, 0x7e, 0xc0, 0x5b, 0x60,
- 0xe4, 0xd1, 0xa7, 0x50, 0x61, 0xef, 0x55, 0x3a, 0x83, 0xf8, 0xf1, 0x6f, 0xa4, 0xd2, 0x29, 0x7f,
- 0x05, 0x00, 0x00, 0xff, 0xff, 0xea, 0x06, 0x1a, 0xa9, 0x37, 0x0c, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto
deleted file mode 100644
index 36eb6e8c..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto
+++ /dev/null
@@ -1,171 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-import "google/protobuf/any.proto";
-import "google/protobuf/duration.proto";
-import "google/protobuf/struct.proto";
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/wrappers.proto";
-
-package jsonpb;
-
-// Test message for holding primitive types.
-message Simple {
- optional bool o_bool = 1;
- optional int32 o_int32 = 2;
- optional int64 o_int64 = 3;
- optional uint32 o_uint32 = 4;
- optional uint64 o_uint64 = 5;
- optional sint32 o_sint32 = 6;
- optional sint64 o_sint64 = 7;
- optional float o_float = 8;
- optional double o_double = 9;
- optional string o_string = 10;
- optional bytes o_bytes = 11;
-}
-
-// Test message for holding special non-finites primitives.
-message NonFinites {
- optional float f_nan = 1;
- optional float f_pinf = 2;
- optional float f_ninf = 3;
- optional double d_nan = 4;
- optional double d_pinf = 5;
- optional double d_ninf = 6;
-}
-
-// Test message for holding repeated primitives.
-message Repeats {
- repeated bool r_bool = 1;
- repeated int32 r_int32 = 2;
- repeated int64 r_int64 = 3;
- repeated uint32 r_uint32 = 4;
- repeated uint64 r_uint64 = 5;
- repeated sint32 r_sint32 = 6;
- repeated sint64 r_sint64 = 7;
- repeated float r_float = 8;
- repeated double r_double = 9;
- repeated string r_string = 10;
- repeated bytes r_bytes = 11;
-}
-
-// Test message for holding enums and nested messages.
-message Widget {
- enum Color {
- RED = 0;
- GREEN = 1;
- BLUE = 2;
- };
- optional Color color = 1;
- repeated Color r_color = 2;
-
- optional Simple simple = 10;
- repeated Simple r_simple = 11;
-
- optional Repeats repeats = 20;
- repeated Repeats r_repeats = 21;
-}
-
-message Maps {
- map m_int64_str = 1;
- map m_bool_simple = 2;
-}
-
-message MsgWithOneof {
- oneof union {
- string title = 1;
- int64 salary = 2;
- string Country = 3;
- string home_address = 4;
- MsgWithRequired msg_with_required = 5;
- }
-}
-
-message Real {
- optional double value = 1;
- extensions 100 to max;
-}
-
-extend Real {
- optional string name = 124;
-}
-
-message Complex {
- extend Real {
- optional Complex real_extension = 123;
- }
- optional double imaginary = 1;
- extensions 100 to max;
-}
-
-message KnownTypes {
- optional google.protobuf.Any an = 14;
- optional google.protobuf.Duration dur = 1;
- optional google.protobuf.Struct st = 12;
- optional google.protobuf.Timestamp ts = 2;
- optional google.protobuf.ListValue lv = 15;
- optional google.protobuf.Value val = 16;
-
- optional google.protobuf.DoubleValue dbl = 3;
- optional google.protobuf.FloatValue flt = 4;
- optional google.protobuf.Int64Value i64 = 5;
- optional google.protobuf.UInt64Value u64 = 6;
- optional google.protobuf.Int32Value i32 = 7;
- optional google.protobuf.UInt32Value u32 = 8;
- optional google.protobuf.BoolValue bool = 9;
- optional google.protobuf.StringValue str = 10;
- optional google.protobuf.BytesValue bytes = 11;
-}
-
-// Test messages for marshaling/unmarshaling required fields.
-message MsgWithRequired {
- required string str = 1;
-}
-
-message MsgWithIndirectRequired {
- optional MsgWithRequired subm = 1;
- map map_field = 2;
- repeated MsgWithRequired slice_field = 3;
-}
-
-message MsgWithRequiredBytes {
- required bytes byts = 1;
-}
-
-message MsgWithRequiredWKT {
- required google.protobuf.StringValue str = 1;
-}
-
-extend Real {
- optional MsgWithRequired extm = 125;
-}
diff --git a/vendor/github.com/golang/protobuf/proto/all_test.go b/vendor/github.com/golang/protobuf/proto/all_test.go
deleted file mode 100644
index 361f72fb..00000000
--- a/vendor/github.com/golang/protobuf/proto/all_test.go
+++ /dev/null
@@ -1,2410 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package proto_test
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- "math"
- "math/rand"
- "reflect"
- "runtime/debug"
- "strings"
- "sync"
- "testing"
- "time"
-
- . "github.com/golang/protobuf/proto"
- . "github.com/golang/protobuf/proto/test_proto"
-)
-
-var globalO *Buffer
-
-func old() *Buffer {
- if globalO == nil {
- globalO = NewBuffer(nil)
- }
- globalO.Reset()
- return globalO
-}
-
-func equalbytes(b1, b2 []byte, t *testing.T) {
- if len(b1) != len(b2) {
- t.Errorf("wrong lengths: 2*%d != %d", len(b1), len(b2))
- return
- }
- for i := 0; i < len(b1); i++ {
- if b1[i] != b2[i] {
- t.Errorf("bad byte[%d]:%x %x: %s %s", i, b1[i], b2[i], b1, b2)
- }
- }
-}
-
-func initGoTestField() *GoTestField {
- f := new(GoTestField)
- f.Label = String("label")
- f.Type = String("type")
- return f
-}
-
-// These are all structurally equivalent but the tag numbers differ.
-// (It's remarkable that required, optional, and repeated all have
-// 8 letters.)
-func initGoTest_RequiredGroup() *GoTest_RequiredGroup {
- return &GoTest_RequiredGroup{
- RequiredField: String("required"),
- }
-}
-
-func initGoTest_OptionalGroup() *GoTest_OptionalGroup {
- return &GoTest_OptionalGroup{
- RequiredField: String("optional"),
- }
-}
-
-func initGoTest_RepeatedGroup() *GoTest_RepeatedGroup {
- return &GoTest_RepeatedGroup{
- RequiredField: String("repeated"),
- }
-}
-
-func initGoTest(setdefaults bool) *GoTest {
- pb := new(GoTest)
- if setdefaults {
- pb.F_BoolDefaulted = Bool(Default_GoTest_F_BoolDefaulted)
- pb.F_Int32Defaulted = Int32(Default_GoTest_F_Int32Defaulted)
- pb.F_Int64Defaulted = Int64(Default_GoTest_F_Int64Defaulted)
- pb.F_Fixed32Defaulted = Uint32(Default_GoTest_F_Fixed32Defaulted)
- pb.F_Fixed64Defaulted = Uint64(Default_GoTest_F_Fixed64Defaulted)
- pb.F_Uint32Defaulted = Uint32(Default_GoTest_F_Uint32Defaulted)
- pb.F_Uint64Defaulted = Uint64(Default_GoTest_F_Uint64Defaulted)
- pb.F_FloatDefaulted = Float32(Default_GoTest_F_FloatDefaulted)
- pb.F_DoubleDefaulted = Float64(Default_GoTest_F_DoubleDefaulted)
- pb.F_StringDefaulted = String(Default_GoTest_F_StringDefaulted)
- pb.F_BytesDefaulted = Default_GoTest_F_BytesDefaulted
- pb.F_Sint32Defaulted = Int32(Default_GoTest_F_Sint32Defaulted)
- pb.F_Sint64Defaulted = Int64(Default_GoTest_F_Sint64Defaulted)
- pb.F_Sfixed32Defaulted = Int32(Default_GoTest_F_Sfixed32Defaulted)
- pb.F_Sfixed64Defaulted = Int64(Default_GoTest_F_Sfixed64Defaulted)
- }
-
- pb.Kind = GoTest_TIME.Enum()
- pb.RequiredField = initGoTestField()
- pb.F_BoolRequired = Bool(true)
- pb.F_Int32Required = Int32(3)
- pb.F_Int64Required = Int64(6)
- pb.F_Fixed32Required = Uint32(32)
- pb.F_Fixed64Required = Uint64(64)
- pb.F_Uint32Required = Uint32(3232)
- pb.F_Uint64Required = Uint64(6464)
- pb.F_FloatRequired = Float32(3232)
- pb.F_DoubleRequired = Float64(6464)
- pb.F_StringRequired = String("string")
- pb.F_BytesRequired = []byte("bytes")
- pb.F_Sint32Required = Int32(-32)
- pb.F_Sint64Required = Int64(-64)
- pb.F_Sfixed32Required = Int32(-32)
- pb.F_Sfixed64Required = Int64(-64)
- pb.Requiredgroup = initGoTest_RequiredGroup()
-
- return pb
-}
-
-func hex(c uint8) uint8 {
- if '0' <= c && c <= '9' {
- return c - '0'
- }
- if 'a' <= c && c <= 'f' {
- return 10 + c - 'a'
- }
- if 'A' <= c && c <= 'F' {
- return 10 + c - 'A'
- }
- return 0
-}
-
-func equal(b []byte, s string, t *testing.T) bool {
- if 2*len(b) != len(s) {
- // fail(fmt.Sprintf("wrong lengths: 2*%d != %d", len(b), len(s)), b, s, t)
- fmt.Printf("wrong lengths: 2*%d != %d\n", len(b), len(s))
- return false
- }
- for i, j := 0, 0; i < len(b); i, j = i+1, j+2 {
- x := hex(s[j])*16 + hex(s[j+1])
- if b[i] != x {
- // fail(fmt.Sprintf("bad byte[%d]:%x %x", i, b[i], x), b, s, t)
- fmt.Printf("bad byte[%d]:%x %x", i, b[i], x)
- return false
- }
- }
- return true
-}
-
-func overify(t *testing.T, pb *GoTest, expected string) {
- o := old()
- err := o.Marshal(pb)
- if err != nil {
- fmt.Printf("overify marshal-1 err = %v", err)
- o.DebugPrint("", o.Bytes())
- t.Fatalf("expected = %s", expected)
- }
- if !equal(o.Bytes(), expected, t) {
- o.DebugPrint("overify neq 1", o.Bytes())
- t.Fatalf("expected = %s", expected)
- }
-
- // Now test Unmarshal by recreating the original buffer.
- pbd := new(GoTest)
- err = o.Unmarshal(pbd)
- if err != nil {
- t.Fatalf("overify unmarshal err = %v", err)
- o.DebugPrint("", o.Bytes())
- t.Fatalf("string = %s", expected)
- }
- o.Reset()
- err = o.Marshal(pbd)
- if err != nil {
- t.Errorf("overify marshal-2 err = %v", err)
- o.DebugPrint("", o.Bytes())
- t.Fatalf("string = %s", expected)
- }
- if !equal(o.Bytes(), expected, t) {
- o.DebugPrint("overify neq 2", o.Bytes())
- t.Fatalf("string = %s", expected)
- }
-}
-
-// Simple tests for numeric encode/decode primitives (varint, etc.)
-func TestNumericPrimitives(t *testing.T) {
- for i := uint64(0); i < 1e6; i += 111 {
- o := old()
- if o.EncodeVarint(i) != nil {
- t.Error("EncodeVarint")
- break
- }
- x, e := o.DecodeVarint()
- if e != nil {
- t.Fatal("DecodeVarint")
- }
- if x != i {
- t.Fatal("varint decode fail:", i, x)
- }
-
- o = old()
- if o.EncodeFixed32(i) != nil {
- t.Fatal("encFixed32")
- }
- x, e = o.DecodeFixed32()
- if e != nil {
- t.Fatal("decFixed32")
- }
- if x != i {
- t.Fatal("fixed32 decode fail:", i, x)
- }
-
- o = old()
- if o.EncodeFixed64(i*1234567) != nil {
- t.Error("encFixed64")
- break
- }
- x, e = o.DecodeFixed64()
- if e != nil {
- t.Error("decFixed64")
- break
- }
- if x != i*1234567 {
- t.Error("fixed64 decode fail:", i*1234567, x)
- break
- }
-
- o = old()
- i32 := int32(i - 12345)
- if o.EncodeZigzag32(uint64(i32)) != nil {
- t.Fatal("EncodeZigzag32")
- }
- x, e = o.DecodeZigzag32()
- if e != nil {
- t.Fatal("DecodeZigzag32")
- }
- if x != uint64(uint32(i32)) {
- t.Fatal("zigzag32 decode fail:", i32, x)
- }
-
- o = old()
- i64 := int64(i - 12345)
- if o.EncodeZigzag64(uint64(i64)) != nil {
- t.Fatal("EncodeZigzag64")
- }
- x, e = o.DecodeZigzag64()
- if e != nil {
- t.Fatal("DecodeZigzag64")
- }
- if x != uint64(i64) {
- t.Fatal("zigzag64 decode fail:", i64, x)
- }
- }
-}
-
-// fakeMarshaler is a simple struct implementing Marshaler and Message interfaces.
-type fakeMarshaler struct {
- b []byte
- err error
-}
-
-func (f *fakeMarshaler) Marshal() ([]byte, error) { return f.b, f.err }
-func (f *fakeMarshaler) String() string { return fmt.Sprintf("Bytes: %v Error: %v", f.b, f.err) }
-func (f *fakeMarshaler) ProtoMessage() {}
-func (f *fakeMarshaler) Reset() {}
-
-type msgWithFakeMarshaler struct {
- M *fakeMarshaler `protobuf:"bytes,1,opt,name=fake"`
-}
-
-func (m *msgWithFakeMarshaler) String() string { return CompactTextString(m) }
-func (m *msgWithFakeMarshaler) ProtoMessage() {}
-func (m *msgWithFakeMarshaler) Reset() {}
-
-// Simple tests for proto messages that implement the Marshaler interface.
-func TestMarshalerEncoding(t *testing.T) {
- tests := []struct {
- name string
- m Message
- want []byte
- errType reflect.Type
- }{
- {
- name: "Marshaler that fails",
- m: &fakeMarshaler{
- err: errors.New("some marshal err"),
- b: []byte{5, 6, 7},
- },
- // Since the Marshal method returned bytes, they should be written to the
- // buffer. (For efficiency, we assume that Marshal implementations are
- // always correct w.r.t. RequiredNotSetError and output.)
- want: []byte{5, 6, 7},
- errType: reflect.TypeOf(errors.New("some marshal err")),
- },
- {
- name: "Marshaler that fails with RequiredNotSetError",
- m: &msgWithFakeMarshaler{
- M: &fakeMarshaler{
- err: &RequiredNotSetError{},
- b: []byte{5, 6, 7},
- },
- },
- // Since there's an error that can be continued after,
- // the buffer should be written.
- want: []byte{
- 10, 3, // for &msgWithFakeMarshaler
- 5, 6, 7, // for &fakeMarshaler
- },
- errType: reflect.TypeOf(&RequiredNotSetError{}),
- },
- {
- name: "Marshaler that succeeds",
- m: &fakeMarshaler{
- b: []byte{0, 1, 2, 3, 4, 127, 255},
- },
- want: []byte{0, 1, 2, 3, 4, 127, 255},
- },
- }
- for _, test := range tests {
- b := NewBuffer(nil)
- err := b.Marshal(test.m)
- if reflect.TypeOf(err) != test.errType {
- t.Errorf("%s: got err %T(%v) wanted %T", test.name, err, err, test.errType)
- }
- if !reflect.DeepEqual(test.want, b.Bytes()) {
- t.Errorf("%s: got bytes %v wanted %v", test.name, b.Bytes(), test.want)
- }
- if size := Size(test.m); size != len(b.Bytes()) {
- t.Errorf("%s: Size(_) = %v, but marshaled to %v bytes", test.name, size, len(b.Bytes()))
- }
-
- m, mErr := Marshal(test.m)
- if !bytes.Equal(b.Bytes(), m) {
- t.Errorf("%s: Marshal returned %v, but (*Buffer).Marshal wrote %v", test.name, m, b.Bytes())
- }
- if !reflect.DeepEqual(err, mErr) {
- t.Errorf("%s: Marshal err = %q, but (*Buffer).Marshal returned %q",
- test.name, fmt.Sprint(mErr), fmt.Sprint(err))
- }
- }
-}
-
-// Ensure that Buffer.Marshal uses O(N) memory for N messages
-func TestBufferMarshalAllocs(t *testing.T) {
- value := &OtherMessage{Key: Int64(1)}
- msg := &MyMessage{Count: Int32(1), Others: []*OtherMessage{value}}
-
- reallocSize := func(t *testing.T, items int, prealloc int) (int64, int64) {
- var b Buffer
- b.SetBuf(make([]byte, 0, prealloc))
-
- var allocSpace int64
- prevCap := cap(b.Bytes())
- for i := 0; i < items; i++ {
- err := b.Marshal(msg)
- if err != nil {
- t.Errorf("Marshal err = %q", err)
- break
- }
- if c := cap(b.Bytes()); prevCap != c {
- allocSpace += int64(c)
- prevCap = c
- }
- }
- needSpace := int64(len(b.Bytes()))
- return allocSpace, needSpace
- }
-
- for _, prealloc := range []int{0, 100, 10000} {
- for _, items := range []int{1, 2, 5, 10, 20, 50, 100, 200, 500, 1000} {
- runtimeSpace, need := reallocSize(t, items, prealloc)
- totalSpace := int64(prealloc) + runtimeSpace
-
- runtimeRatio := float64(runtimeSpace) / float64(need)
- totalRatio := float64(totalSpace) / float64(need)
-
- if totalRatio < 1 || runtimeRatio > 4 {
- t.Errorf("needed %dB, allocated %dB total (ratio %.1f), allocated %dB at runtime (ratio %.1f)",
- need, totalSpace, totalRatio, runtimeSpace, runtimeRatio)
- }
- }
- }
-}
-
-// Simple tests for bytes
-func TestBytesPrimitives(t *testing.T) {
- o := old()
- bytes := []byte{'n', 'o', 'w', ' ', 'i', 's', ' ', 't', 'h', 'e', ' ', 't', 'i', 'm', 'e'}
- if o.EncodeRawBytes(bytes) != nil {
- t.Error("EncodeRawBytes")
- }
- decb, e := o.DecodeRawBytes(false)
- if e != nil {
- t.Error("DecodeRawBytes")
- }
- equalbytes(bytes, decb, t)
-}
-
-// Simple tests for strings
-func TestStringPrimitives(t *testing.T) {
- o := old()
- s := "now is the time"
- if o.EncodeStringBytes(s) != nil {
- t.Error("enc_string")
- }
- decs, e := o.DecodeStringBytes()
- if e != nil {
- t.Error("dec_string")
- }
- if s != decs {
- t.Error("string encode/decode fail:", s, decs)
- }
-}
-
-// Do we catch the "required bit not set" case?
-func TestRequiredBit(t *testing.T) {
- o := old()
- pb := new(GoTest)
- err := o.Marshal(pb)
- if err == nil {
- t.Error("did not catch missing required fields")
- } else if !strings.Contains(err.Error(), "Kind") {
- t.Error("wrong error type:", err)
- }
-}
-
-// Check that all fields are nil.
-// Clearly silly, and a residue from a more interesting test with an earlier,
-// different initialization property, but it once caught a compiler bug so
-// it lives.
-func checkInitialized(pb *GoTest, t *testing.T) {
- if pb.F_BoolDefaulted != nil {
- t.Error("New or Reset did not set boolean:", *pb.F_BoolDefaulted)
- }
- if pb.F_Int32Defaulted != nil {
- t.Error("New or Reset did not set int32:", *pb.F_Int32Defaulted)
- }
- if pb.F_Int64Defaulted != nil {
- t.Error("New or Reset did not set int64:", *pb.F_Int64Defaulted)
- }
- if pb.F_Fixed32Defaulted != nil {
- t.Error("New or Reset did not set fixed32:", *pb.F_Fixed32Defaulted)
- }
- if pb.F_Fixed64Defaulted != nil {
- t.Error("New or Reset did not set fixed64:", *pb.F_Fixed64Defaulted)
- }
- if pb.F_Uint32Defaulted != nil {
- t.Error("New or Reset did not set uint32:", *pb.F_Uint32Defaulted)
- }
- if pb.F_Uint64Defaulted != nil {
- t.Error("New or Reset did not set uint64:", *pb.F_Uint64Defaulted)
- }
- if pb.F_FloatDefaulted != nil {
- t.Error("New or Reset did not set float:", *pb.F_FloatDefaulted)
- }
- if pb.F_DoubleDefaulted != nil {
- t.Error("New or Reset did not set double:", *pb.F_DoubleDefaulted)
- }
- if pb.F_StringDefaulted != nil {
- t.Error("New or Reset did not set string:", *pb.F_StringDefaulted)
- }
- if pb.F_BytesDefaulted != nil {
- t.Error("New or Reset did not set bytes:", string(pb.F_BytesDefaulted))
- }
- if pb.F_Sint32Defaulted != nil {
- t.Error("New or Reset did not set int32:", *pb.F_Sint32Defaulted)
- }
- if pb.F_Sint64Defaulted != nil {
- t.Error("New or Reset did not set int64:", *pb.F_Sint64Defaulted)
- }
-}
-
-// Does Reset() reset?
-func TestReset(t *testing.T) {
- pb := initGoTest(true)
- // muck with some values
- pb.F_BoolDefaulted = Bool(false)
- pb.F_Int32Defaulted = Int32(237)
- pb.F_Int64Defaulted = Int64(12346)
- pb.F_Fixed32Defaulted = Uint32(32000)
- pb.F_Fixed64Defaulted = Uint64(666)
- pb.F_Uint32Defaulted = Uint32(323232)
- pb.F_Uint64Defaulted = nil
- pb.F_FloatDefaulted = nil
- pb.F_DoubleDefaulted = Float64(0)
- pb.F_StringDefaulted = String("gotcha")
- pb.F_BytesDefaulted = []byte("asdfasdf")
- pb.F_Sint32Defaulted = Int32(123)
- pb.F_Sint64Defaulted = Int64(789)
- pb.Reset()
- checkInitialized(pb, t)
-}
-
-// All required fields set, no defaults provided.
-func TestEncodeDecode1(t *testing.T) {
- pb := initGoTest(false)
- overify(t, pb,
- "0807"+ // field 1, encoding 0, value 7
- "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
- "5001"+ // field 10, encoding 0, value 1
- "5803"+ // field 11, encoding 0, value 3
- "6006"+ // field 12, encoding 0, value 6
- "6d20000000"+ // field 13, encoding 5, value 0x20
- "714000000000000000"+ // field 14, encoding 1, value 0x40
- "78a019"+ // field 15, encoding 0, value 0xca0 = 3232
- "8001c032"+ // field 16, encoding 0, value 0x1940 = 6464
- "8d0100004a45"+ // field 17, encoding 5, value 3232.0
- "9101000000000040b940"+ // field 18, encoding 1, value 6464.0
- "9a0106"+"737472696e67"+ // field 19, encoding 2, string "string"
- "b304"+ // field 70, encoding 3, start group
- "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
- "b404"+ // field 70, encoding 4, end group
- "aa0605"+"6279746573"+ // field 101, encoding 2, string "bytes"
- "b0063f"+ // field 102, encoding 0, 0x3f zigzag32
- "b8067f"+ // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff") // field 105, encoding 1, -64 fixed64
-}
-
-// All required fields set, defaults provided.
-func TestEncodeDecode2(t *testing.T) {
- pb := initGoTest(true)
- overify(t, pb,
- "0807"+ // field 1, encoding 0, value 7
- "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
- "5001"+ // field 10, encoding 0, value 1
- "5803"+ // field 11, encoding 0, value 3
- "6006"+ // field 12, encoding 0, value 6
- "6d20000000"+ // field 13, encoding 5, value 32
- "714000000000000000"+ // field 14, encoding 1, value 64
- "78a019"+ // field 15, encoding 0, value 3232
- "8001c032"+ // field 16, encoding 0, value 6464
- "8d0100004a45"+ // field 17, encoding 5, value 3232.0
- "9101000000000040b940"+ // field 18, encoding 1, value 6464.0
- "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
- "c00201"+ // field 40, encoding 0, value 1
- "c80220"+ // field 41, encoding 0, value 32
- "d00240"+ // field 42, encoding 0, value 64
- "dd0240010000"+ // field 43, encoding 5, value 320
- "e1028002000000000000"+ // field 44, encoding 1, value 640
- "e8028019"+ // field 45, encoding 0, value 3200
- "f0028032"+ // field 46, encoding 0, value 6400
- "fd02e0659948"+ // field 47, encoding 5, value 314159.0
- "81030000000050971041"+ // field 48, encoding 1, value 271828.0
- "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
- "b304"+ // start group field 70 level 1
- "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
- "b404"+ // end group field 70 level 1
- "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
- "b0063f"+ // field 102, encoding 0, 0x3f zigzag32
- "b8067f"+ // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64
- "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
- "90193f"+ // field 402, encoding 0, value 63
- "98197f"+ // field 403, encoding 0, value 127
- "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32
- "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64
-
-}
-
-// All default fields set to their default value by hand
-func TestEncodeDecode3(t *testing.T) {
- pb := initGoTest(false)
- pb.F_BoolDefaulted = Bool(true)
- pb.F_Int32Defaulted = Int32(32)
- pb.F_Int64Defaulted = Int64(64)
- pb.F_Fixed32Defaulted = Uint32(320)
- pb.F_Fixed64Defaulted = Uint64(640)
- pb.F_Uint32Defaulted = Uint32(3200)
- pb.F_Uint64Defaulted = Uint64(6400)
- pb.F_FloatDefaulted = Float32(314159)
- pb.F_DoubleDefaulted = Float64(271828)
- pb.F_StringDefaulted = String("hello, \"world!\"\n")
- pb.F_BytesDefaulted = []byte("Bignose")
- pb.F_Sint32Defaulted = Int32(-32)
- pb.F_Sint64Defaulted = Int64(-64)
- pb.F_Sfixed32Defaulted = Int32(-32)
- pb.F_Sfixed64Defaulted = Int64(-64)
-
- overify(t, pb,
- "0807"+ // field 1, encoding 0, value 7
- "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
- "5001"+ // field 10, encoding 0, value 1
- "5803"+ // field 11, encoding 0, value 3
- "6006"+ // field 12, encoding 0, value 6
- "6d20000000"+ // field 13, encoding 5, value 32
- "714000000000000000"+ // field 14, encoding 1, value 64
- "78a019"+ // field 15, encoding 0, value 3232
- "8001c032"+ // field 16, encoding 0, value 6464
- "8d0100004a45"+ // field 17, encoding 5, value 3232.0
- "9101000000000040b940"+ // field 18, encoding 1, value 6464.0
- "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
- "c00201"+ // field 40, encoding 0, value 1
- "c80220"+ // field 41, encoding 0, value 32
- "d00240"+ // field 42, encoding 0, value 64
- "dd0240010000"+ // field 43, encoding 5, value 320
- "e1028002000000000000"+ // field 44, encoding 1, value 640
- "e8028019"+ // field 45, encoding 0, value 3200
- "f0028032"+ // field 46, encoding 0, value 6400
- "fd02e0659948"+ // field 47, encoding 5, value 314159.0
- "81030000000050971041"+ // field 48, encoding 1, value 271828.0
- "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
- "b304"+ // start group field 70 level 1
- "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
- "b404"+ // end group field 70 level 1
- "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
- "b0063f"+ // field 102, encoding 0, 0x3f zigzag32
- "b8067f"+ // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64
- "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
- "90193f"+ // field 402, encoding 0, value 63
- "98197f"+ // field 403, encoding 0, value 127
- "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32
- "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64
-
-}
-
-// All required fields set, defaults provided, all non-defaulted optional fields have values.
-func TestEncodeDecode4(t *testing.T) {
- pb := initGoTest(true)
- pb.Table = String("hello")
- pb.Param = Int32(7)
- pb.OptionalField = initGoTestField()
- pb.F_BoolOptional = Bool(true)
- pb.F_Int32Optional = Int32(32)
- pb.F_Int64Optional = Int64(64)
- pb.F_Fixed32Optional = Uint32(3232)
- pb.F_Fixed64Optional = Uint64(6464)
- pb.F_Uint32Optional = Uint32(323232)
- pb.F_Uint64Optional = Uint64(646464)
- pb.F_FloatOptional = Float32(32.)
- pb.F_DoubleOptional = Float64(64.)
- pb.F_StringOptional = String("hello")
- pb.F_BytesOptional = []byte("Bignose")
- pb.F_Sint32Optional = Int32(-32)
- pb.F_Sint64Optional = Int64(-64)
- pb.F_Sfixed32Optional = Int32(-32)
- pb.F_Sfixed64Optional = Int64(-64)
- pb.Optionalgroup = initGoTest_OptionalGroup()
-
- overify(t, pb,
- "0807"+ // field 1, encoding 0, value 7
- "1205"+"68656c6c6f"+ // field 2, encoding 2, string "hello"
- "1807"+ // field 3, encoding 0, value 7
- "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
- "320d"+"0a056c6162656c120474797065"+ // field 6, encoding 2 (GoTestField)
- "5001"+ // field 10, encoding 0, value 1
- "5803"+ // field 11, encoding 0, value 3
- "6006"+ // field 12, encoding 0, value 6
- "6d20000000"+ // field 13, encoding 5, value 32
- "714000000000000000"+ // field 14, encoding 1, value 64
- "78a019"+ // field 15, encoding 0, value 3232
- "8001c032"+ // field 16, encoding 0, value 6464
- "8d0100004a45"+ // field 17, encoding 5, value 3232.0
- "9101000000000040b940"+ // field 18, encoding 1, value 6464.0
- "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
- "f00101"+ // field 30, encoding 0, value 1
- "f80120"+ // field 31, encoding 0, value 32
- "800240"+ // field 32, encoding 0, value 64
- "8d02a00c0000"+ // field 33, encoding 5, value 3232
- "91024019000000000000"+ // field 34, encoding 1, value 6464
- "9802a0dd13"+ // field 35, encoding 0, value 323232
- "a002c0ba27"+ // field 36, encoding 0, value 646464
- "ad0200000042"+ // field 37, encoding 5, value 32.0
- "b1020000000000005040"+ // field 38, encoding 1, value 64.0
- "ba0205"+"68656c6c6f"+ // field 39, encoding 2, string "hello"
- "c00201"+ // field 40, encoding 0, value 1
- "c80220"+ // field 41, encoding 0, value 32
- "d00240"+ // field 42, encoding 0, value 64
- "dd0240010000"+ // field 43, encoding 5, value 320
- "e1028002000000000000"+ // field 44, encoding 1, value 640
- "e8028019"+ // field 45, encoding 0, value 3200
- "f0028032"+ // field 46, encoding 0, value 6400
- "fd02e0659948"+ // field 47, encoding 5, value 314159.0
- "81030000000050971041"+ // field 48, encoding 1, value 271828.0
- "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
- "b304"+ // start group field 70 level 1
- "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
- "b404"+ // end group field 70 level 1
- "d305"+ // start group field 90 level 1
- "da0508"+"6f7074696f6e616c"+ // field 91, encoding 2, string "optional"
- "d405"+ // end group field 90 level 1
- "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
- "b0063f"+ // field 102, encoding 0, 0x3f zigzag32
- "b8067f"+ // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64
- "ea1207"+"4269676e6f7365"+ // field 301, encoding 2, string "Bignose"
- "f0123f"+ // field 302, encoding 0, value 63
- "f8127f"+ // field 303, encoding 0, value 127
- "8513e0ffffff"+ // field 304, encoding 5, -32 fixed32
- "8913c0ffffffffffffff"+ // field 305, encoding 1, -64 fixed64
- "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
- "90193f"+ // field 402, encoding 0, value 63
- "98197f"+ // field 403, encoding 0, value 127
- "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32
- "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64
-
-}
-
-// All required fields set, defaults provided, all repeated fields given two values.
-func TestEncodeDecode5(t *testing.T) {
- pb := initGoTest(true)
- pb.RepeatedField = []*GoTestField{initGoTestField(), initGoTestField()}
- pb.F_BoolRepeated = []bool{false, true}
- pb.F_Int32Repeated = []int32{32, 33}
- pb.F_Int64Repeated = []int64{64, 65}
- pb.F_Fixed32Repeated = []uint32{3232, 3333}
- pb.F_Fixed64Repeated = []uint64{6464, 6565}
- pb.F_Uint32Repeated = []uint32{323232, 333333}
- pb.F_Uint64Repeated = []uint64{646464, 656565}
- pb.F_FloatRepeated = []float32{32., 33.}
- pb.F_DoubleRepeated = []float64{64., 65.}
- pb.F_StringRepeated = []string{"hello", "sailor"}
- pb.F_BytesRepeated = [][]byte{[]byte("big"), []byte("nose")}
- pb.F_Sint32Repeated = []int32{32, -32}
- pb.F_Sint64Repeated = []int64{64, -64}
- pb.F_Sfixed32Repeated = []int32{32, -32}
- pb.F_Sfixed64Repeated = []int64{64, -64}
- pb.Repeatedgroup = []*GoTest_RepeatedGroup{initGoTest_RepeatedGroup(), initGoTest_RepeatedGroup()}
-
- overify(t, pb,
- "0807"+ // field 1, encoding 0, value 7
- "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
- "2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField)
- "2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField)
- "5001"+ // field 10, encoding 0, value 1
- "5803"+ // field 11, encoding 0, value 3
- "6006"+ // field 12, encoding 0, value 6
- "6d20000000"+ // field 13, encoding 5, value 32
- "714000000000000000"+ // field 14, encoding 1, value 64
- "78a019"+ // field 15, encoding 0, value 3232
- "8001c032"+ // field 16, encoding 0, value 6464
- "8d0100004a45"+ // field 17, encoding 5, value 3232.0
- "9101000000000040b940"+ // field 18, encoding 1, value 6464.0
- "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
- "a00100"+ // field 20, encoding 0, value 0
- "a00101"+ // field 20, encoding 0, value 1
- "a80120"+ // field 21, encoding 0, value 32
- "a80121"+ // field 21, encoding 0, value 33
- "b00140"+ // field 22, encoding 0, value 64
- "b00141"+ // field 22, encoding 0, value 65
- "bd01a00c0000"+ // field 23, encoding 5, value 3232
- "bd01050d0000"+ // field 23, encoding 5, value 3333
- "c1014019000000000000"+ // field 24, encoding 1, value 6464
- "c101a519000000000000"+ // field 24, encoding 1, value 6565
- "c801a0dd13"+ // field 25, encoding 0, value 323232
- "c80195ac14"+ // field 25, encoding 0, value 333333
- "d001c0ba27"+ // field 26, encoding 0, value 646464
- "d001b58928"+ // field 26, encoding 0, value 656565
- "dd0100000042"+ // field 27, encoding 5, value 32.0
- "dd0100000442"+ // field 27, encoding 5, value 33.0
- "e1010000000000005040"+ // field 28, encoding 1, value 64.0
- "e1010000000000405040"+ // field 28, encoding 1, value 65.0
- "ea0105"+"68656c6c6f"+ // field 29, encoding 2, string "hello"
- "ea0106"+"7361696c6f72"+ // field 29, encoding 2, string "sailor"
- "c00201"+ // field 40, encoding 0, value 1
- "c80220"+ // field 41, encoding 0, value 32
- "d00240"+ // field 42, encoding 0, value 64
- "dd0240010000"+ // field 43, encoding 5, value 320
- "e1028002000000000000"+ // field 44, encoding 1, value 640
- "e8028019"+ // field 45, encoding 0, value 3200
- "f0028032"+ // field 46, encoding 0, value 6400
- "fd02e0659948"+ // field 47, encoding 5, value 314159.0
- "81030000000050971041"+ // field 48, encoding 1, value 271828.0
- "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
- "b304"+ // start group field 70 level 1
- "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
- "b404"+ // end group field 70 level 1
- "8305"+ // start group field 80 level 1
- "8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated"
- "8405"+ // end group field 80 level 1
- "8305"+ // start group field 80 level 1
- "8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated"
- "8405"+ // end group field 80 level 1
- "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
- "b0063f"+ // field 102, encoding 0, 0x3f zigzag32
- "b8067f"+ // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64
- "ca0c03"+"626967"+ // field 201, encoding 2, string "big"
- "ca0c04"+"6e6f7365"+ // field 201, encoding 2, string "nose"
- "d00c40"+ // field 202, encoding 0, value 32
- "d00c3f"+ // field 202, encoding 0, value -32
- "d80c8001"+ // field 203, encoding 0, value 64
- "d80c7f"+ // field 203, encoding 0, value -64
- "e50c20000000"+ // field 204, encoding 5, 32 fixed32
- "e50ce0ffffff"+ // field 204, encoding 5, -32 fixed32
- "e90c4000000000000000"+ // field 205, encoding 1, 64 fixed64
- "e90cc0ffffffffffffff"+ // field 205, encoding 1, -64 fixed64
- "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
- "90193f"+ // field 402, encoding 0, value 63
- "98197f"+ // field 403, encoding 0, value 127
- "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32
- "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64
-
-}
-
-// All required fields set, all packed repeated fields given two values.
-func TestEncodeDecode6(t *testing.T) {
- pb := initGoTest(false)
- pb.F_BoolRepeatedPacked = []bool{false, true}
- pb.F_Int32RepeatedPacked = []int32{32, 33}
- pb.F_Int64RepeatedPacked = []int64{64, 65}
- pb.F_Fixed32RepeatedPacked = []uint32{3232, 3333}
- pb.F_Fixed64RepeatedPacked = []uint64{6464, 6565}
- pb.F_Uint32RepeatedPacked = []uint32{323232, 333333}
- pb.F_Uint64RepeatedPacked = []uint64{646464, 656565}
- pb.F_FloatRepeatedPacked = []float32{32., 33.}
- pb.F_DoubleRepeatedPacked = []float64{64., 65.}
- pb.F_Sint32RepeatedPacked = []int32{32, -32}
- pb.F_Sint64RepeatedPacked = []int64{64, -64}
- pb.F_Sfixed32RepeatedPacked = []int32{32, -32}
- pb.F_Sfixed64RepeatedPacked = []int64{64, -64}
-
- overify(t, pb,
- "0807"+ // field 1, encoding 0, value 7
- "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
- "5001"+ // field 10, encoding 0, value 1
- "5803"+ // field 11, encoding 0, value 3
- "6006"+ // field 12, encoding 0, value 6
- "6d20000000"+ // field 13, encoding 5, value 32
- "714000000000000000"+ // field 14, encoding 1, value 64
- "78a019"+ // field 15, encoding 0, value 3232
- "8001c032"+ // field 16, encoding 0, value 6464
- "8d0100004a45"+ // field 17, encoding 5, value 3232.0
- "9101000000000040b940"+ // field 18, encoding 1, value 6464.0
- "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
- "9203020001"+ // field 50, encoding 2, 2 bytes, value 0, value 1
- "9a03022021"+ // field 51, encoding 2, 2 bytes, value 32, value 33
- "a203024041"+ // field 52, encoding 2, 2 bytes, value 64, value 65
- "aa0308"+ // field 53, encoding 2, 8 bytes
- "a00c0000050d0000"+ // value 3232, value 3333
- "b20310"+ // field 54, encoding 2, 16 bytes
- "4019000000000000a519000000000000"+ // value 6464, value 6565
- "ba0306"+ // field 55, encoding 2, 6 bytes
- "a0dd1395ac14"+ // value 323232, value 333333
- "c20306"+ // field 56, encoding 2, 6 bytes
- "c0ba27b58928"+ // value 646464, value 656565
- "ca0308"+ // field 57, encoding 2, 8 bytes
- "0000004200000442"+ // value 32.0, value 33.0
- "d20310"+ // field 58, encoding 2, 16 bytes
- "00000000000050400000000000405040"+ // value 64.0, value 65.0
- "b304"+ // start group field 70 level 1
- "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
- "b404"+ // end group field 70 level 1
- "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
- "b0063f"+ // field 102, encoding 0, 0x3f zigzag32
- "b8067f"+ // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64
- "b21f02"+ // field 502, encoding 2, 2 bytes
- "403f"+ // value 32, value -32
- "ba1f03"+ // field 503, encoding 2, 3 bytes
- "80017f"+ // value 64, value -64
- "c21f08"+ // field 504, encoding 2, 8 bytes
- "20000000e0ffffff"+ // value 32, value -32
- "ca1f10"+ // field 505, encoding 2, 16 bytes
- "4000000000000000c0ffffffffffffff") // value 64, value -64
-
-}
-
-// Test that we can encode empty bytes fields.
-func TestEncodeDecodeBytes1(t *testing.T) {
- pb := initGoTest(false)
-
- // Create our bytes
- pb.F_BytesRequired = []byte{}
- pb.F_BytesRepeated = [][]byte{{}}
- pb.F_BytesOptional = []byte{}
-
- d, err := Marshal(pb)
- if err != nil {
- t.Error(err)
- }
-
- pbd := new(GoTest)
- if err := Unmarshal(d, pbd); err != nil {
- t.Error(err)
- }
-
- if pbd.F_BytesRequired == nil || len(pbd.F_BytesRequired) != 0 {
- t.Error("required empty bytes field is incorrect")
- }
- if pbd.F_BytesRepeated == nil || len(pbd.F_BytesRepeated) == 1 && pbd.F_BytesRepeated[0] == nil {
- t.Error("repeated empty bytes field is incorrect")
- }
- if pbd.F_BytesOptional == nil || len(pbd.F_BytesOptional) != 0 {
- t.Error("optional empty bytes field is incorrect")
- }
-}
-
-// Test that we encode nil-valued fields of a repeated bytes field correctly.
-// Since entries in a repeated field cannot be nil, nil must mean empty value.
-func TestEncodeDecodeBytes2(t *testing.T) {
- pb := initGoTest(false)
-
- // Create our bytes
- pb.F_BytesRepeated = [][]byte{nil}
-
- d, err := Marshal(pb)
- if err != nil {
- t.Error(err)
- }
-
- pbd := new(GoTest)
- if err := Unmarshal(d, pbd); err != nil {
- t.Error(err)
- }
-
- if len(pbd.F_BytesRepeated) != 1 || pbd.F_BytesRepeated[0] == nil {
- t.Error("Unexpected value for repeated bytes field")
- }
-}
-
-// All required fields set, defaults provided, all repeated fields given two values.
-func TestSkippingUnrecognizedFields(t *testing.T) {
- o := old()
- pb := initGoTestField()
-
- // Marshal it normally.
- o.Marshal(pb)
-
- // Now new a GoSkipTest record.
- skip := &GoSkipTest{
- SkipInt32: Int32(32),
- SkipFixed32: Uint32(3232),
- SkipFixed64: Uint64(6464),
- SkipString: String("skipper"),
- Skipgroup: &GoSkipTest_SkipGroup{
- GroupInt32: Int32(75),
- GroupString: String("wxyz"),
- },
- }
-
- // Marshal it into same buffer.
- o.Marshal(skip)
-
- pbd := new(GoTestField)
- o.Unmarshal(pbd)
-
- // The __unrecognized field should be a marshaling of GoSkipTest
- skipd := new(GoSkipTest)
-
- o.SetBuf(pbd.XXX_unrecognized)
- o.Unmarshal(skipd)
-
- if *skipd.SkipInt32 != *skip.SkipInt32 {
- t.Error("skip int32", skipd.SkipInt32)
- }
- if *skipd.SkipFixed32 != *skip.SkipFixed32 {
- t.Error("skip fixed32", skipd.SkipFixed32)
- }
- if *skipd.SkipFixed64 != *skip.SkipFixed64 {
- t.Error("skip fixed64", skipd.SkipFixed64)
- }
- if *skipd.SkipString != *skip.SkipString {
- t.Error("skip string", *skipd.SkipString)
- }
- if *skipd.Skipgroup.GroupInt32 != *skip.Skipgroup.GroupInt32 {
- t.Error("skip group int32", skipd.Skipgroup.GroupInt32)
- }
- if *skipd.Skipgroup.GroupString != *skip.Skipgroup.GroupString {
- t.Error("skip group string", *skipd.Skipgroup.GroupString)
- }
-}
-
-// Check that unrecognized fields of a submessage are preserved.
-func TestSubmessageUnrecognizedFields(t *testing.T) {
- nm := &NewMessage{
- Nested: &NewMessage_Nested{
- Name: String("Nigel"),
- FoodGroup: String("carbs"),
- },
- }
- b, err := Marshal(nm)
- if err != nil {
- t.Fatalf("Marshal of NewMessage: %v", err)
- }
-
- // Unmarshal into an OldMessage.
- om := new(OldMessage)
- if err := Unmarshal(b, om); err != nil {
- t.Fatalf("Unmarshal to OldMessage: %v", err)
- }
- exp := &OldMessage{
- Nested: &OldMessage_Nested{
- Name: String("Nigel"),
- // normal protocol buffer users should not do this
- XXX_unrecognized: []byte("\x12\x05carbs"),
- },
- }
- if !Equal(om, exp) {
- t.Errorf("om = %v, want %v", om, exp)
- }
-
- // Clone the OldMessage.
- om = Clone(om).(*OldMessage)
- if !Equal(om, exp) {
- t.Errorf("Clone(om) = %v, want %v", om, exp)
- }
-
- // Marshal the OldMessage, then unmarshal it into an empty NewMessage.
- if b, err = Marshal(om); err != nil {
- t.Fatalf("Marshal of OldMessage: %v", err)
- }
- t.Logf("Marshal(%v) -> %q", om, b)
- nm2 := new(NewMessage)
- if err := Unmarshal(b, nm2); err != nil {
- t.Fatalf("Unmarshal to NewMessage: %v", err)
- }
- if !Equal(nm, nm2) {
- t.Errorf("NewMessage round-trip: %v => %v", nm, nm2)
- }
-}
-
-// Check that an int32 field can be upgraded to an int64 field.
-func TestNegativeInt32(t *testing.T) {
- om := &OldMessage{
- Num: Int32(-1),
- }
- b, err := Marshal(om)
- if err != nil {
- t.Fatalf("Marshal of OldMessage: %v", err)
- }
-
- // Check the size. It should be 11 bytes;
- // 1 for the field/wire type, and 10 for the negative number.
- if len(b) != 11 {
- t.Errorf("%v marshaled as %q, wanted 11 bytes", om, b)
- }
-
- // Unmarshal into a NewMessage.
- nm := new(NewMessage)
- if err := Unmarshal(b, nm); err != nil {
- t.Fatalf("Unmarshal to NewMessage: %v", err)
- }
- want := &NewMessage{
- Num: Int64(-1),
- }
- if !Equal(nm, want) {
- t.Errorf("nm = %v, want %v", nm, want)
- }
-}
-
-// Check that we can grow an array (repeated field) to have many elements.
-// This test doesn't depend only on our encoding; for variety, it makes sure
-// we create, encode, and decode the correct contents explicitly. It's therefore
-// a bit messier.
-// This test also uses (and hence tests) the Marshal/Unmarshal functions
-// instead of the methods.
-func TestBigRepeated(t *testing.T) {
- pb := initGoTest(true)
-
- // Create the arrays
- const N = 50 // Internally the library starts much smaller.
- pb.Repeatedgroup = make([]*GoTest_RepeatedGroup, N)
- pb.F_Sint64Repeated = make([]int64, N)
- pb.F_Sint32Repeated = make([]int32, N)
- pb.F_BytesRepeated = make([][]byte, N)
- pb.F_StringRepeated = make([]string, N)
- pb.F_DoubleRepeated = make([]float64, N)
- pb.F_FloatRepeated = make([]float32, N)
- pb.F_Uint64Repeated = make([]uint64, N)
- pb.F_Uint32Repeated = make([]uint32, N)
- pb.F_Fixed64Repeated = make([]uint64, N)
- pb.F_Fixed32Repeated = make([]uint32, N)
- pb.F_Int64Repeated = make([]int64, N)
- pb.F_Int32Repeated = make([]int32, N)
- pb.F_BoolRepeated = make([]bool, N)
- pb.RepeatedField = make([]*GoTestField, N)
-
- // Fill in the arrays with checkable values.
- igtf := initGoTestField()
- igtrg := initGoTest_RepeatedGroup()
- for i := 0; i < N; i++ {
- pb.Repeatedgroup[i] = igtrg
- pb.F_Sint64Repeated[i] = int64(i)
- pb.F_Sint32Repeated[i] = int32(i)
- s := fmt.Sprint(i)
- pb.F_BytesRepeated[i] = []byte(s)
- pb.F_StringRepeated[i] = s
- pb.F_DoubleRepeated[i] = float64(i)
- pb.F_FloatRepeated[i] = float32(i)
- pb.F_Uint64Repeated[i] = uint64(i)
- pb.F_Uint32Repeated[i] = uint32(i)
- pb.F_Fixed64Repeated[i] = uint64(i)
- pb.F_Fixed32Repeated[i] = uint32(i)
- pb.F_Int64Repeated[i] = int64(i)
- pb.F_Int32Repeated[i] = int32(i)
- pb.F_BoolRepeated[i] = i%2 == 0
- pb.RepeatedField[i] = igtf
- }
-
- // Marshal.
- buf, _ := Marshal(pb)
-
- // Now test Unmarshal by recreating the original buffer.
- pbd := new(GoTest)
- Unmarshal(buf, pbd)
-
- // Check the checkable values
- for i := uint64(0); i < N; i++ {
- if pbd.Repeatedgroup[i] == nil { // TODO: more checking?
- t.Error("pbd.Repeatedgroup bad")
- }
- if x := uint64(pbd.F_Sint64Repeated[i]); x != i {
- t.Error("pbd.F_Sint64Repeated bad", x, i)
- }
- if x := uint64(pbd.F_Sint32Repeated[i]); x != i {
- t.Error("pbd.F_Sint32Repeated bad", x, i)
- }
- s := fmt.Sprint(i)
- equalbytes(pbd.F_BytesRepeated[i], []byte(s), t)
- if pbd.F_StringRepeated[i] != s {
- t.Error("pbd.F_Sint32Repeated bad", pbd.F_StringRepeated[i], i)
- }
- if x := uint64(pbd.F_DoubleRepeated[i]); x != i {
- t.Error("pbd.F_DoubleRepeated bad", x, i)
- }
- if x := uint64(pbd.F_FloatRepeated[i]); x != i {
- t.Error("pbd.F_FloatRepeated bad", x, i)
- }
- if x := pbd.F_Uint64Repeated[i]; x != i {
- t.Error("pbd.F_Uint64Repeated bad", x, i)
- }
- if x := uint64(pbd.F_Uint32Repeated[i]); x != i {
- t.Error("pbd.F_Uint32Repeated bad", x, i)
- }
- if x := pbd.F_Fixed64Repeated[i]; x != i {
- t.Error("pbd.F_Fixed64Repeated bad", x, i)
- }
- if x := uint64(pbd.F_Fixed32Repeated[i]); x != i {
- t.Error("pbd.F_Fixed32Repeated bad", x, i)
- }
- if x := uint64(pbd.F_Int64Repeated[i]); x != i {
- t.Error("pbd.F_Int64Repeated bad", x, i)
- }
- if x := uint64(pbd.F_Int32Repeated[i]); x != i {
- t.Error("pbd.F_Int32Repeated bad", x, i)
- }
- if x := pbd.F_BoolRepeated[i]; x != (i%2 == 0) {
- t.Error("pbd.F_BoolRepeated bad", x, i)
- }
- if pbd.RepeatedField[i] == nil { // TODO: more checking?
- t.Error("pbd.RepeatedField bad")
- }
- }
-}
-
-func TestBadWireTypeUnknown(t *testing.T) {
- var b []byte
- fmt.Sscanf("0a01780d00000000080b101612036161611521000000202c220362626225370000002203636363214200000000000000584d5a036464645900000000000056405d63000000", "%x", &b)
-
- m := new(MyMessage)
- if err := Unmarshal(b, m); err != nil {
- t.Errorf("unexpected Unmarshal error: %v", err)
- }
-
- var unknown []byte
- fmt.Sscanf("0a01780d0000000010161521000000202c2537000000214200000000000000584d5a036464645d63000000", "%x", &unknown)
- if !bytes.Equal(m.XXX_unrecognized, unknown) {
- t.Errorf("unknown bytes mismatch:\ngot %x\nwant %x", m.XXX_unrecognized, unknown)
- }
- DiscardUnknown(m)
-
- want := &MyMessage{Count: Int32(11), Name: String("aaa"), Pet: []string{"bbb", "ccc"}, Bigfloat: Float64(88)}
- if !Equal(m, want) {
- t.Errorf("message mismatch:\ngot %v\nwant %v", m, want)
- }
-}
-
-func encodeDecode(t *testing.T, in, out Message, msg string) {
- buf, err := Marshal(in)
- if err != nil {
- t.Fatalf("failed marshaling %v: %v", msg, err)
- }
- if err := Unmarshal(buf, out); err != nil {
- t.Fatalf("failed unmarshaling %v: %v", msg, err)
- }
-}
-
-func TestPackedNonPackedDecoderSwitching(t *testing.T) {
- np, p := new(NonPackedTest), new(PackedTest)
-
- // non-packed -> packed
- np.A = []int32{0, 1, 1, 2, 3, 5}
- encodeDecode(t, np, p, "non-packed -> packed")
- if !reflect.DeepEqual(np.A, p.B) {
- t.Errorf("failed non-packed -> packed; np.A=%+v, p.B=%+v", np.A, p.B)
- }
-
- // packed -> non-packed
- np.Reset()
- p.B = []int32{3, 1, 4, 1, 5, 9}
- encodeDecode(t, p, np, "packed -> non-packed")
- if !reflect.DeepEqual(p.B, np.A) {
- t.Errorf("failed packed -> non-packed; p.B=%+v, np.A=%+v", p.B, np.A)
- }
-}
-
-func TestProto1RepeatedGroup(t *testing.T) {
- pb := &MessageList{
- Message: []*MessageList_Message{
- {
- Name: String("blah"),
- Count: Int32(7),
- },
- // NOTE: pb.Message[1] is a nil
- nil,
- },
- }
-
- o := old()
- err := o.Marshal(pb)
- if err == nil || !strings.Contains(err.Error(), "repeated field Message has nil") {
- t.Fatalf("unexpected or no error when marshaling: %v", err)
- }
-}
-
-// Test that enums work. Checks for a bug introduced by making enums
-// named types instead of int32: newInt32FromUint64 would crash with
-// a type mismatch in reflect.PointTo.
-func TestEnum(t *testing.T) {
- pb := new(GoEnum)
- pb.Foo = FOO_FOO1.Enum()
- o := old()
- if err := o.Marshal(pb); err != nil {
- t.Fatal("error encoding enum:", err)
- }
- pb1 := new(GoEnum)
- if err := o.Unmarshal(pb1); err != nil {
- t.Fatal("error decoding enum:", err)
- }
- if *pb1.Foo != FOO_FOO1 {
- t.Error("expected 7 but got ", *pb1.Foo)
- }
-}
-
-// Enum types have String methods. Check that enum fields can be printed.
-// We don't care what the value actually is, just as long as it doesn't crash.
-func TestPrintingNilEnumFields(t *testing.T) {
- pb := new(GoEnum)
- _ = fmt.Sprintf("%+v", pb)
-}
-
-// Verify that absent required fields cause Marshal/Unmarshal to return errors.
-func TestRequiredFieldEnforcement(t *testing.T) {
- pb := new(GoTestField)
- _, err := Marshal(pb)
- if err == nil {
- t.Error("marshal: expected error, got nil")
- } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Label") {
- t.Errorf("marshal: bad error type: %v", err)
- }
-
- // A slightly sneaky, yet valid, proto. It encodes the same required field twice,
- // so simply counting the required fields is insufficient.
- // field 1, encoding 2, value "hi"
- buf := []byte("\x0A\x02hi\x0A\x02hi")
- err = Unmarshal(buf, pb)
- if err == nil {
- t.Error("unmarshal: expected error, got nil")
- } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Type") && !strings.Contains(err.Error(), "{Unknown}") {
- // TODO: remove unknown cases once we commit to the new unmarshaler.
- t.Errorf("unmarshal: bad error type: %v", err)
- }
-}
-
-// Verify that absent required fields in groups cause Marshal/Unmarshal to return errors.
-func TestRequiredFieldEnforcementGroups(t *testing.T) {
- pb := &GoTestRequiredGroupField{Group: &GoTestRequiredGroupField_Group{}}
- if _, err := Marshal(pb); err == nil {
- t.Error("marshal: expected error, got nil")
- } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Group.Field") {
- t.Errorf("marshal: bad error type: %v", err)
- }
-
- buf := []byte{11, 12}
- if err := Unmarshal(buf, pb); err == nil {
- t.Error("unmarshal: expected error, got nil")
- } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Group.Field") && !strings.Contains(err.Error(), "Group.{Unknown}") {
- t.Errorf("unmarshal: bad error type: %v", err)
- }
-}
-
-func TestTypedNilMarshal(t *testing.T) {
- // A typed nil should return ErrNil and not crash.
- {
- var m *GoEnum
- if _, err := Marshal(m); err != ErrNil {
- t.Errorf("Marshal(%#v): got %v, want ErrNil", m, err)
- }
- }
-
- {
- m := &Communique{Union: &Communique_Msg{nil}}
- if _, err := Marshal(m); err == nil || err == ErrNil {
- t.Errorf("Marshal(%#v): got %v, want errOneofHasNil", m, err)
- }
- }
-}
-
-// A type that implements the Marshaler interface, but is not nillable.
-type nonNillableInt uint64
-
-func (nni nonNillableInt) Marshal() ([]byte, error) {
- return EncodeVarint(uint64(nni)), nil
-}
-
-type NNIMessage struct {
- nni nonNillableInt
-}
-
-func (*NNIMessage) Reset() {}
-func (*NNIMessage) String() string { return "" }
-func (*NNIMessage) ProtoMessage() {}
-
-type NMMessage struct{}
-
-func (*NMMessage) Reset() {}
-func (*NMMessage) String() string { return "" }
-func (*NMMessage) ProtoMessage() {}
-
-// Verify a type that uses the Marshaler interface, but has a nil pointer.
-func TestNilMarshaler(t *testing.T) {
- // Try a struct with a Marshaler field that is nil.
- // It should be directly marshable.
- nmm := new(NMMessage)
- if _, err := Marshal(nmm); err != nil {
- t.Error("unexpected error marshaling nmm: ", err)
- }
-
- // Try a struct with a Marshaler field that is not nillable.
- nnim := new(NNIMessage)
- nnim.nni = 7
- var _ Marshaler = nnim.nni // verify it is truly a Marshaler
- if _, err := Marshal(nnim); err != nil {
- t.Error("unexpected error marshaling nnim: ", err)
- }
-}
-
-func TestAllSetDefaults(t *testing.T) {
- // Exercise SetDefaults with all scalar field types.
- m := &Defaults{
- // NaN != NaN, so override that here.
- F_Nan: Float32(1.7),
- }
- expected := &Defaults{
- F_Bool: Bool(true),
- F_Int32: Int32(32),
- F_Int64: Int64(64),
- F_Fixed32: Uint32(320),
- F_Fixed64: Uint64(640),
- F_Uint32: Uint32(3200),
- F_Uint64: Uint64(6400),
- F_Float: Float32(314159),
- F_Double: Float64(271828),
- F_String: String(`hello, "world!"` + "\n"),
- F_Bytes: []byte("Bignose"),
- F_Sint32: Int32(-32),
- F_Sint64: Int64(-64),
- F_Enum: Defaults_GREEN.Enum(),
- F_Pinf: Float32(float32(math.Inf(1))),
- F_Ninf: Float32(float32(math.Inf(-1))),
- F_Nan: Float32(1.7),
- StrZero: String(""),
- }
- SetDefaults(m)
- if !Equal(m, expected) {
- t.Errorf("SetDefaults failed\n got %v\nwant %v", m, expected)
- }
-}
-
-func TestSetDefaultsWithSetField(t *testing.T) {
- // Check that a set value is not overridden.
- m := &Defaults{
- F_Int32: Int32(12),
- }
- SetDefaults(m)
- if v := m.GetF_Int32(); v != 12 {
- t.Errorf("m.FInt32 = %v, want 12", v)
- }
-}
-
-func TestSetDefaultsWithSubMessage(t *testing.T) {
- m := &OtherMessage{
- Key: Int64(123),
- Inner: &InnerMessage{
- Host: String("gopher"),
- },
- }
- expected := &OtherMessage{
- Key: Int64(123),
- Inner: &InnerMessage{
- Host: String("gopher"),
- Port: Int32(4000),
- },
- }
- SetDefaults(m)
- if !Equal(m, expected) {
- t.Errorf("\n got %v\nwant %v", m, expected)
- }
-}
-
-func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) {
- m := &MyMessage{
- RepInner: []*InnerMessage{{}},
- }
- expected := &MyMessage{
- RepInner: []*InnerMessage{{
- Port: Int32(4000),
- }},
- }
- SetDefaults(m)
- if !Equal(m, expected) {
- t.Errorf("\n got %v\nwant %v", m, expected)
- }
-}
-
-func TestSetDefaultWithRepeatedNonMessage(t *testing.T) {
- m := &MyMessage{
- Pet: []string{"turtle", "wombat"},
- }
- expected := Clone(m)
- SetDefaults(m)
- if !Equal(m, expected) {
- t.Errorf("\n got %v\nwant %v", m, expected)
- }
-}
-
-func TestMaximumTagNumber(t *testing.T) {
- m := &MaxTag{
- LastField: String("natural goat essence"),
- }
- buf, err := Marshal(m)
- if err != nil {
- t.Fatalf("proto.Marshal failed: %v", err)
- }
- m2 := new(MaxTag)
- if err := Unmarshal(buf, m2); err != nil {
- t.Fatalf("proto.Unmarshal failed: %v", err)
- }
- if got, want := m2.GetLastField(), *m.LastField; got != want {
- t.Errorf("got %q, want %q", got, want)
- }
-}
-
-func TestJSON(t *testing.T) {
- m := &MyMessage{
- Count: Int32(4),
- Pet: []string{"bunny", "kitty"},
- Inner: &InnerMessage{
- Host: String("cauchy"),
- },
- Bikeshed: MyMessage_GREEN.Enum(),
- }
- const expected = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":1}`
-
- b, err := json.Marshal(m)
- if err != nil {
- t.Fatalf("json.Marshal failed: %v", err)
- }
- s := string(b)
- if s != expected {
- t.Errorf("got %s\nwant %s", s, expected)
- }
-
- received := new(MyMessage)
- if err := json.Unmarshal(b, received); err != nil {
- t.Fatalf("json.Unmarshal failed: %v", err)
- }
- if !Equal(received, m) {
- t.Fatalf("got %s, want %s", received, m)
- }
-
- // Test unmarshalling of JSON with symbolic enum name.
- const old = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":"GREEN"}`
- received.Reset()
- if err := json.Unmarshal([]byte(old), received); err != nil {
- t.Fatalf("json.Unmarshal failed: %v", err)
- }
- if !Equal(received, m) {
- t.Fatalf("got %s, want %s", received, m)
- }
-}
-
-func TestBadWireType(t *testing.T) {
- b := []byte{7<<3 | 6} // field 7, wire type 6
- pb := new(OtherMessage)
- if err := Unmarshal(b, pb); err == nil {
- t.Errorf("Unmarshal did not fail")
- } else if !strings.Contains(err.Error(), "unknown wire type") {
- t.Errorf("wrong error: %v", err)
- }
-}
-
-func TestBytesWithInvalidLength(t *testing.T) {
- // If a byte sequence has an invalid (negative) length, Unmarshal should not panic.
- b := []byte{2<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0}
- Unmarshal(b, new(MyMessage))
-}
-
-func TestLengthOverflow(t *testing.T) {
- // Overflowing a length should not panic.
- b := []byte{2<<3 | WireBytes, 1, 1, 3<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01}
- Unmarshal(b, new(MyMessage))
-}
-
-func TestVarintOverflow(t *testing.T) {
- // Overflowing a 64-bit length should not be allowed.
- b := []byte{1<<3 | WireVarint, 0x01, 3<<3 | WireBytes, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01}
- if err := Unmarshal(b, new(MyMessage)); err == nil {
- t.Fatalf("Overflowed uint64 length without error")
- }
-}
-
-func TestBytesWithInvalidLengthInGroup(t *testing.T) {
- // Overflowing a 64-bit length should not be allowed.
- b := []byte{0xbb, 0x30, 0xb2, 0x30, 0xb0, 0xb2, 0x83, 0xf1, 0xb0, 0xb2, 0xef, 0xbf, 0xbd, 0x01}
- if err := Unmarshal(b, new(MyMessage)); err == nil {
- t.Fatalf("Overflowed uint64 length without error")
- }
-}
-
-func TestUnmarshalFuzz(t *testing.T) {
- const N = 1000
- seed := time.Now().UnixNano()
- t.Logf("RNG seed is %d", seed)
- rng := rand.New(rand.NewSource(seed))
- buf := make([]byte, 20)
- for i := 0; i < N; i++ {
- for j := range buf {
- buf[j] = byte(rng.Intn(256))
- }
- fuzzUnmarshal(t, buf)
- }
-}
-
-func TestMergeMessages(t *testing.T) {
- pb := &MessageList{Message: []*MessageList_Message{{Name: String("x"), Count: Int32(1)}}}
- data, err := Marshal(pb)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
-
- pb1 := new(MessageList)
- if err := Unmarshal(data, pb1); err != nil {
- t.Fatalf("first Unmarshal: %v", err)
- }
- if err := Unmarshal(data, pb1); err != nil {
- t.Fatalf("second Unmarshal: %v", err)
- }
- if len(pb1.Message) != 1 {
- t.Errorf("two Unmarshals produced %d Messages, want 1", len(pb1.Message))
- }
-
- pb2 := new(MessageList)
- if err := UnmarshalMerge(data, pb2); err != nil {
- t.Fatalf("first UnmarshalMerge: %v", err)
- }
- if err := UnmarshalMerge(data, pb2); err != nil {
- t.Fatalf("second UnmarshalMerge: %v", err)
- }
- if len(pb2.Message) != 2 {
- t.Errorf("two UnmarshalMerges produced %d Messages, want 2", len(pb2.Message))
- }
-}
-
-func TestExtensionMarshalOrder(t *testing.T) {
- m := &MyMessage{Count: Int(123)}
- if err := SetExtension(m, E_Ext_More, &Ext{Data: String("alpha")}); err != nil {
- t.Fatalf("SetExtension: %v", err)
- }
- if err := SetExtension(m, E_Ext_Text, String("aleph")); err != nil {
- t.Fatalf("SetExtension: %v", err)
- }
- if err := SetExtension(m, E_Ext_Number, Int32(1)); err != nil {
- t.Fatalf("SetExtension: %v", err)
- }
-
- // Serialize m several times, and check we get the same bytes each time.
- var orig []byte
- for i := 0; i < 100; i++ {
- b, err := Marshal(m)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
- if i == 0 {
- orig = b
- continue
- }
- if !bytes.Equal(b, orig) {
- t.Errorf("Bytes differ on attempt #%d", i)
- }
- }
-}
-
-func TestExtensionMapFieldMarshalDeterministic(t *testing.T) {
- m := &MyMessage{Count: Int(123)}
- if err := SetExtension(m, E_Ext_More, &Ext{MapField: map[int32]int32{1: 1, 2: 2, 3: 3, 4: 4}}); err != nil {
- t.Fatalf("SetExtension: %v", err)
- }
- marshal := func(m Message) []byte {
- var b Buffer
- b.SetDeterministic(true)
- if err := b.Marshal(m); err != nil {
- t.Fatalf("Marshal failed: %v", err)
- }
- return b.Bytes()
- }
-
- want := marshal(m)
- for i := 0; i < 100; i++ {
- if got := marshal(m); !bytes.Equal(got, want) {
- t.Errorf("Marshal produced inconsistent output with determinism enabled (pass %d).\n got %v\nwant %v", i, got, want)
- }
- }
-}
-
-// Many extensions, because small maps might not iterate differently on each iteration.
-var exts = []*ExtensionDesc{
- E_X201,
- E_X202,
- E_X203,
- E_X204,
- E_X205,
- E_X206,
- E_X207,
- E_X208,
- E_X209,
- E_X210,
- E_X211,
- E_X212,
- E_X213,
- E_X214,
- E_X215,
- E_X216,
- E_X217,
- E_X218,
- E_X219,
- E_X220,
- E_X221,
- E_X222,
- E_X223,
- E_X224,
- E_X225,
- E_X226,
- E_X227,
- E_X228,
- E_X229,
- E_X230,
- E_X231,
- E_X232,
- E_X233,
- E_X234,
- E_X235,
- E_X236,
- E_X237,
- E_X238,
- E_X239,
- E_X240,
- E_X241,
- E_X242,
- E_X243,
- E_X244,
- E_X245,
- E_X246,
- E_X247,
- E_X248,
- E_X249,
- E_X250,
-}
-
-func TestMessageSetMarshalOrder(t *testing.T) {
- m := &MyMessageSet{}
- for _, x := range exts {
- if err := SetExtension(m, x, &Empty{}); err != nil {
- t.Fatalf("SetExtension: %v", err)
- }
- }
-
- buf, err := Marshal(m)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
-
- // Serialize m several times, and check we get the same bytes each time.
- for i := 0; i < 10; i++ {
- b1, err := Marshal(m)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
- if !bytes.Equal(b1, buf) {
- t.Errorf("Bytes differ on re-Marshal #%d", i)
- }
-
- m2 := &MyMessageSet{}
- if err := Unmarshal(buf, m2); err != nil {
- t.Errorf("Unmarshal: %v", err)
- }
- b2, err := Marshal(m2)
- if err != nil {
- t.Errorf("re-Marshal: %v", err)
- }
- if !bytes.Equal(b2, buf) {
- t.Errorf("Bytes differ on round-trip #%d", i)
- }
- }
-}
-
-func TestUnmarshalMergesMessages(t *testing.T) {
- // If a nested message occurs twice in the input,
- // the fields should be merged when decoding.
- a := &OtherMessage{
- Key: Int64(123),
- Inner: &InnerMessage{
- Host: String("polhode"),
- Port: Int32(1234),
- },
- }
- aData, err := Marshal(a)
- if err != nil {
- t.Fatalf("Marshal(a): %v", err)
- }
- b := &OtherMessage{
- Weight: Float32(1.2),
- Inner: &InnerMessage{
- Host: String("herpolhode"),
- Connected: Bool(true),
- },
- }
- bData, err := Marshal(b)
- if err != nil {
- t.Fatalf("Marshal(b): %v", err)
- }
- want := &OtherMessage{
- Key: Int64(123),
- Weight: Float32(1.2),
- Inner: &InnerMessage{
- Host: String("herpolhode"),
- Port: Int32(1234),
- Connected: Bool(true),
- },
- }
- got := new(OtherMessage)
- if err := Unmarshal(append(aData, bData...), got); err != nil {
- t.Fatalf("Unmarshal: %v", err)
- }
- if !Equal(got, want) {
- t.Errorf("\n got %v\nwant %v", got, want)
- }
-}
-
-func TestUnmarshalMergesGroups(t *testing.T) {
- // If a nested group occurs twice in the input,
- // the fields should be merged when decoding.
- a := &GroupNew{
- G: &GroupNew_G{
- X: Int32(7),
- Y: Int32(8),
- },
- }
- aData, err := Marshal(a)
- if err != nil {
- t.Fatalf("Marshal(a): %v", err)
- }
- b := &GroupNew{
- G: &GroupNew_G{
- X: Int32(9),
- },
- }
- bData, err := Marshal(b)
- if err != nil {
- t.Fatalf("Marshal(b): %v", err)
- }
- want := &GroupNew{
- G: &GroupNew_G{
- X: Int32(9),
- Y: Int32(8),
- },
- }
- got := new(GroupNew)
- if err := Unmarshal(append(aData, bData...), got); err != nil {
- t.Fatalf("Unmarshal: %v", err)
- }
- if !Equal(got, want) {
- t.Errorf("\n got %v\nwant %v", got, want)
- }
-}
-
-func TestEncodingSizes(t *testing.T) {
- tests := []struct {
- m Message
- n int
- }{
- {&Defaults{F_Int32: Int32(math.MaxInt32)}, 6},
- {&Defaults{F_Int32: Int32(math.MinInt32)}, 11},
- {&Defaults{F_Uint32: Uint32(uint32(math.MaxInt32) + 1)}, 6},
- {&Defaults{F_Uint32: Uint32(math.MaxUint32)}, 6},
- }
- for _, test := range tests {
- b, err := Marshal(test.m)
- if err != nil {
- t.Errorf("Marshal(%v): %v", test.m, err)
- continue
- }
- if len(b) != test.n {
- t.Errorf("Marshal(%v) yielded %d bytes, want %d bytes", test.m, len(b), test.n)
- }
- }
-}
-
-func TestRequiredNotSetError(t *testing.T) {
- pb := initGoTest(false)
- pb.RequiredField.Label = nil
- pb.F_Int32Required = nil
- pb.F_Int64Required = nil
-
- expected := "0807" + // field 1, encoding 0, value 7
- "2206" + "120474797065" + // field 4, encoding 2 (GoTestField)
- "5001" + // field 10, encoding 0, value 1
- "6d20000000" + // field 13, encoding 5, value 0x20
- "714000000000000000" + // field 14, encoding 1, value 0x40
- "78a019" + // field 15, encoding 0, value 0xca0 = 3232
- "8001c032" + // field 16, encoding 0, value 0x1940 = 6464
- "8d0100004a45" + // field 17, encoding 5, value 3232.0
- "9101000000000040b940" + // field 18, encoding 1, value 6464.0
- "9a0106" + "737472696e67" + // field 19, encoding 2, string "string"
- "b304" + // field 70, encoding 3, start group
- "ba0408" + "7265717569726564" + // field 71, encoding 2, string "required"
- "b404" + // field 70, encoding 4, end group
- "aa0605" + "6279746573" + // field 101, encoding 2, string "bytes"
- "b0063f" + // field 102, encoding 0, 0x3f zigzag32
- "b8067f" + // field 103, encoding 0, 0x7f zigzag64
- "c506e0ffffff" + // field 104, encoding 5, -32 fixed32
- "c906c0ffffffffffffff" // field 105, encoding 1, -64 fixed64
-
- o := old()
- bytes, err := Marshal(pb)
- if _, ok := err.(*RequiredNotSetError); !ok {
- fmt.Printf("marshal-1 err = %v, want *RequiredNotSetError", err)
- o.DebugPrint("", bytes)
- t.Fatalf("expected = %s", expected)
- }
- if !strings.Contains(err.Error(), "RequiredField.Label") {
- t.Errorf("marshal-1 wrong err msg: %v", err)
- }
- if !equal(bytes, expected, t) {
- o.DebugPrint("neq 1", bytes)
- t.Fatalf("expected = %s", expected)
- }
-
- // Now test Unmarshal by recreating the original buffer.
- pbd := new(GoTest)
- err = Unmarshal(bytes, pbd)
- if _, ok := err.(*RequiredNotSetError); !ok {
- t.Fatalf("unmarshal err = %v, want *RequiredNotSetError", err)
- o.DebugPrint("", bytes)
- t.Fatalf("string = %s", expected)
- }
- if !strings.Contains(err.Error(), "RequiredField.Label") && !strings.Contains(err.Error(), "RequiredField.{Unknown}") {
- t.Errorf("unmarshal wrong err msg: %v", err)
- }
- bytes, err = Marshal(pbd)
- if _, ok := err.(*RequiredNotSetError); !ok {
- t.Errorf("marshal-2 err = %v, want *RequiredNotSetError", err)
- o.DebugPrint("", bytes)
- t.Fatalf("string = %s", expected)
- }
- if !strings.Contains(err.Error(), "RequiredField.Label") {
- t.Errorf("marshal-2 wrong err msg: %v", err)
- }
- if !equal(bytes, expected, t) {
- o.DebugPrint("neq 2", bytes)
- t.Fatalf("string = %s", expected)
- }
-}
-
-func TestRequiredNotSetErrorWithBadWireTypes(t *testing.T) {
- // Required field expects a varint, and properly found a varint.
- if err := Unmarshal([]byte{0x08, 0x00}, new(GoEnum)); err != nil {
- t.Errorf("Unmarshal = %v, want nil", err)
- }
- // Required field expects a varint, but found a fixed32 instead.
- if err := Unmarshal([]byte{0x0d, 0x00, 0x00, 0x00, 0x00}, new(GoEnum)); err == nil {
- t.Errorf("Unmarshal = nil, want RequiredNotSetError")
- }
- // Required field expects a varint, and found both a varint and fixed32 (ignored).
- m := new(GoEnum)
- if err := Unmarshal([]byte{0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00}, m); err != nil {
- t.Errorf("Unmarshal = %v, want nil", err)
- }
- if !bytes.Equal(m.XXX_unrecognized, []byte{0x0d, 0x00, 0x00, 0x00, 0x00}) {
- t.Errorf("expected fixed32 to appear as unknown bytes: %x", m.XXX_unrecognized)
- }
-}
-
-func fuzzUnmarshal(t *testing.T, data []byte) {
- defer func() {
- if e := recover(); e != nil {
- t.Errorf("These bytes caused a panic: %+v", data)
- t.Logf("Stack:\n%s", debug.Stack())
- t.FailNow()
- }
- }()
-
- pb := new(MyMessage)
- Unmarshal(data, pb)
-}
-
-func TestMapFieldMarshal(t *testing.T) {
- m := &MessageWithMap{
- NameMapping: map[int32]string{
- 1: "Rob",
- 4: "Ian",
- 8: "Dave",
- },
- }
- b, err := Marshal(m)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
-
- // b should be the concatenation of these three byte sequences in some order.
- parts := []string{
- "\n\a\b\x01\x12\x03Rob",
- "\n\a\b\x04\x12\x03Ian",
- "\n\b\b\x08\x12\x04Dave",
- }
- ok := false
- for i := range parts {
- for j := range parts {
- if j == i {
- continue
- }
- for k := range parts {
- if k == i || k == j {
- continue
- }
- try := parts[i] + parts[j] + parts[k]
- if bytes.Equal(b, []byte(try)) {
- ok = true
- break
- }
- }
- }
- }
- if !ok {
- t.Fatalf("Incorrect Marshal output.\n got %q\nwant %q (or a permutation of that)", b, parts[0]+parts[1]+parts[2])
- }
- t.Logf("FYI b: %q", b)
-
- (new(Buffer)).DebugPrint("Dump of b", b)
-}
-
-func TestMapFieldDeterministicMarshal(t *testing.T) {
- m := &MessageWithMap{
- NameMapping: map[int32]string{
- 1: "Rob",
- 4: "Ian",
- 8: "Dave",
- },
- }
-
- marshal := func(m Message) []byte {
- var b Buffer
- b.SetDeterministic(true)
- if err := b.Marshal(m); err != nil {
- t.Fatalf("Marshal failed: %v", err)
- }
- return b.Bytes()
- }
-
- want := marshal(m)
- for i := 0; i < 10; i++ {
- if got := marshal(m); !bytes.Equal(got, want) {
- t.Errorf("Marshal produced inconsistent output with determinism enabled (pass %d).\n got %v\nwant %v", i, got, want)
- }
- }
-}
-
-func TestMapFieldRoundTrips(t *testing.T) {
- m := &MessageWithMap{
- NameMapping: map[int32]string{
- 1: "Rob",
- 4: "Ian",
- 8: "Dave",
- },
- MsgMapping: map[int64]*FloatingPoint{
- 0x7001: {F: Float64(2.0)},
- },
- ByteMapping: map[bool][]byte{
- false: []byte("that's not right!"),
- true: []byte("aye, 'tis true!"),
- },
- }
- b, err := Marshal(m)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
- t.Logf("FYI b: %q", b)
- m2 := new(MessageWithMap)
- if err := Unmarshal(b, m2); err != nil {
- t.Fatalf("Unmarshal: %v", err)
- }
- if !Equal(m, m2) {
- t.Errorf("Map did not survive a round trip.\ninitial: %v\n final: %v", m, m2)
- }
-}
-
-func TestMapFieldWithNil(t *testing.T) {
- m1 := &MessageWithMap{
- MsgMapping: map[int64]*FloatingPoint{
- 1: nil,
- },
- }
- b, err := Marshal(m1)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
- m2 := new(MessageWithMap)
- if err := Unmarshal(b, m2); err != nil {
- t.Fatalf("Unmarshal: %v, got these bytes: %v", err, b)
- }
- if v, ok := m2.MsgMapping[1]; !ok {
- t.Error("msg_mapping[1] not present")
- } else if v != nil {
- t.Errorf("msg_mapping[1] not nil: %v", v)
- }
-}
-
-func TestMapFieldWithNilBytes(t *testing.T) {
- m1 := &MessageWithMap{
- ByteMapping: map[bool][]byte{
- false: {},
- true: nil,
- },
- }
- n := Size(m1)
- b, err := Marshal(m1)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
- if n != len(b) {
- t.Errorf("Size(m1) = %d; want len(Marshal(m1)) = %d", n, len(b))
- }
- m2 := new(MessageWithMap)
- if err := Unmarshal(b, m2); err != nil {
- t.Fatalf("Unmarshal: %v, got these bytes: %v", err, b)
- }
- if v, ok := m2.ByteMapping[false]; !ok {
- t.Error("byte_mapping[false] not present")
- } else if len(v) != 0 {
- t.Errorf("byte_mapping[false] not empty: %#v", v)
- }
- if v, ok := m2.ByteMapping[true]; !ok {
- t.Error("byte_mapping[true] not present")
- } else if len(v) != 0 {
- t.Errorf("byte_mapping[true] not empty: %#v", v)
- }
-}
-
-func TestDecodeMapFieldMissingKey(t *testing.T) {
- b := []byte{
- 0x0A, 0x03, // message, tag 1 (name_mapping), of length 3 bytes
- // no key
- 0x12, 0x01, 0x6D, // string value of length 1 byte, value "m"
- }
- got := &MessageWithMap{}
- err := Unmarshal(b, got)
- if err != nil {
- t.Fatalf("failed to marshal map with missing key: %v", err)
- }
- want := &MessageWithMap{NameMapping: map[int32]string{0: "m"}}
- if !Equal(got, want) {
- t.Errorf("Unmarshaled map with no key was not as expected. got: %v, want %v", got, want)
- }
-}
-
-func TestDecodeMapFieldMissingValue(t *testing.T) {
- b := []byte{
- 0x0A, 0x02, // message, tag 1 (name_mapping), of length 2 bytes
- 0x08, 0x01, // varint key, value 1
- // no value
- }
- got := &MessageWithMap{}
- err := Unmarshal(b, got)
- if err != nil {
- t.Fatalf("failed to marshal map with missing value: %v", err)
- }
- want := &MessageWithMap{NameMapping: map[int32]string{1: ""}}
- if !Equal(got, want) {
- t.Errorf("Unmarshaled map with no value was not as expected. got: %v, want %v", got, want)
- }
-}
-
-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)
- }
-}
-
-func TestOneofNilBytes(t *testing.T) {
- // A oneof with nil byte slice should marshal to tag + 0 (size), with no error.
- m := &Communique{Union: &Communique_Data{Data: nil}}
- b, err := Marshal(m)
- if err != nil {
- t.Fatalf("Marshal failed: %v", err)
- }
- want := []byte{
- 7<<3 | 2, // tag 7, wire type 2
- 0, // size
- }
- if !bytes.Equal(b, want) {
- t.Errorf("Wrong result of Marshal: got %x, want %x", b, want)
- }
-}
-
-func TestInefficientPackedBool(t *testing.T) {
- // https://github.com/golang/protobuf/issues/76
- inp := []byte{
- 0x12, 0x02, // 0x12 = 2<<3|2; 2 bytes
- // Usually a bool should take a single byte,
- // but it is permitted to be any varint.
- 0xb9, 0x30,
- }
- if err := Unmarshal(inp, new(MoreRepeated)); err != nil {
- t.Error(err)
- }
-}
-
-// Make sure pure-reflect-based implementation handles
-// []int32-[]enum conversion correctly.
-func TestRepeatedEnum2(t *testing.T) {
- pb := &RepeatedEnum{
- Color: []RepeatedEnum_Color{RepeatedEnum_RED},
- }
- b, err := Marshal(pb)
- if err != nil {
- t.Fatalf("Marshal failed: %v", err)
- }
- x := new(RepeatedEnum)
- err = Unmarshal(b, x)
- if err != nil {
- t.Fatalf("Unmarshal failed: %v", err)
- }
- if !Equal(pb, x) {
- t.Errorf("Incorrect result: want: %v got: %v", pb, x)
- }
-}
-
-// TestConcurrentMarshal makes sure that it is safe to marshal
-// same message in multiple goroutines concurrently.
-func TestConcurrentMarshal(t *testing.T) {
- pb := initGoTest(true)
- const N = 100
- b := make([][]byte, N)
-
- var wg sync.WaitGroup
- for i := 0; i < N; i++ {
- wg.Add(1)
- go func(i int) {
- defer wg.Done()
- var err error
- b[i], err = Marshal(pb)
- if err != nil {
- t.Errorf("marshal error: %v", err)
- }
- }(i)
- }
-
- wg.Wait()
- for i := 1; i < N; i++ {
- if !bytes.Equal(b[0], b[i]) {
- t.Errorf("concurrent marshal result not same: b[0] = %v, b[%d] = %v", b[0], i, b[i])
- }
- }
-}
-
-func TestInvalidUTF8(t *testing.T) {
- const wire = "\x12\x04\xde\xea\xca\xfe"
-
- var m GoTest
- if err := Unmarshal([]byte(wire), &m); err == nil {
- t.Errorf("Unmarshal error: got nil, want non-nil")
- }
-
- m.Reset()
- m.Table = String(wire[2:])
- if _, err := Marshal(&m); err == nil {
- t.Errorf("Marshal error: got nil, want non-nil")
- }
-}
-
-// Benchmarks
-
-func testMsg() *GoTest {
- pb := initGoTest(true)
- const N = 1000 // Internally the library starts much smaller.
- pb.F_Int32Repeated = make([]int32, N)
- pb.F_DoubleRepeated = make([]float64, N)
- for i := 0; i < N; i++ {
- pb.F_Int32Repeated[i] = int32(i)
- pb.F_DoubleRepeated[i] = float64(i)
- }
- return pb
-}
-
-func bytesMsg() *GoTest {
- pb := initGoTest(true)
- buf := make([]byte, 4000)
- for i := range buf {
- buf[i] = byte(i)
- }
- pb.F_BytesDefaulted = buf
- return pb
-}
-
-func benchmarkMarshal(b *testing.B, pb Message, marshal func(Message) ([]byte, error)) {
- d, _ := marshal(pb)
- b.SetBytes(int64(len(d)))
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- marshal(pb)
- }
-}
-
-func benchmarkBufferMarshal(b *testing.B, pb Message) {
- p := NewBuffer(nil)
- benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) {
- p.Reset()
- err := p.Marshal(pb0)
- return p.Bytes(), err
- })
-}
-
-func benchmarkSize(b *testing.B, pb Message) {
- benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) {
- Size(pb)
- return nil, nil
- })
-}
-
-func newOf(pb Message) Message {
- in := reflect.ValueOf(pb)
- if in.IsNil() {
- return pb
- }
- return reflect.New(in.Type().Elem()).Interface().(Message)
-}
-
-func benchmarkUnmarshal(b *testing.B, pb Message, unmarshal func([]byte, Message) error) {
- d, _ := Marshal(pb)
- b.SetBytes(int64(len(d)))
- pbd := newOf(pb)
-
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- unmarshal(d, pbd)
- }
-}
-
-func benchmarkBufferUnmarshal(b *testing.B, pb Message) {
- p := NewBuffer(nil)
- benchmarkUnmarshal(b, pb, func(d []byte, pb0 Message) error {
- p.SetBuf(d)
- return p.Unmarshal(pb0)
- })
-}
-
-// Benchmark{Marshal,BufferMarshal,Size,Unmarshal,BufferUnmarshal}{,Bytes}
-
-func BenchmarkMarshal(b *testing.B) {
- benchmarkMarshal(b, testMsg(), Marshal)
-}
-
-func BenchmarkBufferMarshal(b *testing.B) {
- benchmarkBufferMarshal(b, testMsg())
-}
-
-func BenchmarkSize(b *testing.B) {
- benchmarkSize(b, testMsg())
-}
-
-func BenchmarkUnmarshal(b *testing.B) {
- benchmarkUnmarshal(b, testMsg(), Unmarshal)
-}
-
-func BenchmarkBufferUnmarshal(b *testing.B) {
- benchmarkBufferUnmarshal(b, testMsg())
-}
-
-func BenchmarkMarshalBytes(b *testing.B) {
- benchmarkMarshal(b, bytesMsg(), Marshal)
-}
-
-func BenchmarkBufferMarshalBytes(b *testing.B) {
- benchmarkBufferMarshal(b, bytesMsg())
-}
-
-func BenchmarkSizeBytes(b *testing.B) {
- benchmarkSize(b, bytesMsg())
-}
-
-func BenchmarkUnmarshalBytes(b *testing.B) {
- benchmarkUnmarshal(b, bytesMsg(), Unmarshal)
-}
-
-func BenchmarkBufferUnmarshalBytes(b *testing.B) {
- benchmarkBufferUnmarshal(b, bytesMsg())
-}
-
-func BenchmarkUnmarshalUnrecognizedFields(b *testing.B) {
- b.StopTimer()
- pb := initGoTestField()
- skip := &GoSkipTest{
- SkipInt32: Int32(32),
- SkipFixed32: Uint32(3232),
- SkipFixed64: Uint64(6464),
- SkipString: String("skipper"),
- Skipgroup: &GoSkipTest_SkipGroup{
- GroupInt32: Int32(75),
- GroupString: String("wxyz"),
- },
- }
-
- pbd := new(GoTestField)
- p := NewBuffer(nil)
- p.Marshal(pb)
- p.Marshal(skip)
- p2 := NewBuffer(nil)
-
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- p2.SetBuf(p.Bytes())
- p2.Unmarshal(pbd)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/any_test.go b/vendor/github.com/golang/protobuf/proto/any_test.go
deleted file mode 100644
index 56fc97c1..00000000
--- a/vendor/github.com/golang/protobuf/proto/any_test.go
+++ /dev/null
@@ -1,300 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package proto_test
-
-import (
- "strings"
- "testing"
-
- "github.com/golang/protobuf/proto"
-
- pb "github.com/golang/protobuf/proto/proto3_proto"
- testpb "github.com/golang/protobuf/proto/test_proto"
- anypb "github.com/golang/protobuf/ptypes/any"
-)
-
-var (
- expandedMarshaler = proto.TextMarshaler{ExpandAny: true}
- expandedCompactMarshaler = proto.TextMarshaler{Compact: true, ExpandAny: true}
-)
-
-// anyEqual reports whether two messages which may be google.protobuf.Any or may
-// contain google.protobuf.Any fields are equal. We can't use proto.Equal for
-// comparison, because semantically equivalent messages may be marshaled to
-// binary in different tag order. Instead, trust that TextMarshaler with
-// ExpandAny option works and compare the text marshaling results.
-func anyEqual(got, want proto.Message) bool {
- // if messages are proto.Equal, no need to marshal.
- if proto.Equal(got, want) {
- return true
- }
- g := expandedMarshaler.Text(got)
- w := expandedMarshaler.Text(want)
- return g == w
-}
-
-type golden struct {
- m proto.Message
- t, c string
-}
-
-var goldenMessages = makeGolden()
-
-func makeGolden() []golden {
- nested := &pb.Nested{Bunny: "Monty"}
- nb, err := proto.Marshal(nested)
- if err != nil {
- panic(err)
- }
- m1 := &pb.Message{
- Name: "David",
- ResultCount: 47,
- Anything: &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(nested), Value: nb},
- }
- m2 := &pb.Message{
- Name: "David",
- ResultCount: 47,
- Anything: &anypb.Any{TypeUrl: "http://[::1]/type.googleapis.com/" + proto.MessageName(nested), Value: nb},
- }
- m3 := &pb.Message{
- Name: "David",
- ResultCount: 47,
- Anything: &anypb.Any{TypeUrl: `type.googleapis.com/"/` + proto.MessageName(nested), Value: nb},
- }
- m4 := &pb.Message{
- Name: "David",
- ResultCount: 47,
- Anything: &anypb.Any{TypeUrl: "type.googleapis.com/a/path/" + proto.MessageName(nested), Value: nb},
- }
- m5 := &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(nested), Value: nb}
-
- any1 := &testpb.MyMessage{Count: proto.Int32(47), Name: proto.String("David")}
- proto.SetExtension(any1, testpb.E_Ext_More, &testpb.Ext{Data: proto.String("foo")})
- proto.SetExtension(any1, testpb.E_Ext_Text, proto.String("bar"))
- any1b, err := proto.Marshal(any1)
- if err != nil {
- panic(err)
- }
- any2 := &testpb.MyMessage{Count: proto.Int32(42), Bikeshed: testpb.MyMessage_GREEN.Enum(), RepBytes: [][]byte{[]byte("roboto")}}
- proto.SetExtension(any2, testpb.E_Ext_More, &testpb.Ext{Data: proto.String("baz")})
- any2b, err := proto.Marshal(any2)
- if err != nil {
- panic(err)
- }
- m6 := &pb.Message{
- Name: "David",
- ResultCount: 47,
- Anything: &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any1), Value: any1b},
- ManyThings: []*anypb.Any{
- &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any2), Value: any2b},
- &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any1), Value: any1b},
- },
- }
-
- const (
- m1Golden = `
-name: "David"
-result_count: 47
-anything: <
- [type.googleapis.com/proto3_proto.Nested]: <
- bunny: "Monty"
- >
->
-`
- m2Golden = `
-name: "David"
-result_count: 47
-anything: <
- ["http://[::1]/type.googleapis.com/proto3_proto.Nested"]: <
- bunny: "Monty"
- >
->
-`
- m3Golden = `
-name: "David"
-result_count: 47
-anything: <
- ["type.googleapis.com/\"/proto3_proto.Nested"]: <
- bunny: "Monty"
- >
->
-`
- m4Golden = `
-name: "David"
-result_count: 47
-anything: <
- [type.googleapis.com/a/path/proto3_proto.Nested]: <
- bunny: "Monty"
- >
->
-`
- m5Golden = `
-[type.googleapis.com/proto3_proto.Nested]: <
- bunny: "Monty"
->
-`
- m6Golden = `
-name: "David"
-result_count: 47
-anything: <
- [type.googleapis.com/test_proto.MyMessage]: <
- count: 47
- name: "David"
- [test_proto.Ext.more]: <
- data: "foo"
- >
- [test_proto.Ext.text]: "bar"
- >
->
-many_things: <
- [type.googleapis.com/test_proto.MyMessage]: <
- count: 42
- bikeshed: GREEN
- rep_bytes: "roboto"
- [test_proto.Ext.more]: <
- data: "baz"
- >
- >
->
-many_things: <
- [type.googleapis.com/test_proto.MyMessage]: <
- count: 47
- name: "David"
- [test_proto.Ext.more]: <
- data: "foo"
- >
- [test_proto.Ext.text]: "bar"
- >
->
-`
- )
- return []golden{
- {m1, strings.TrimSpace(m1Golden) + "\n", strings.TrimSpace(compact(m1Golden)) + " "},
- {m2, strings.TrimSpace(m2Golden) + "\n", strings.TrimSpace(compact(m2Golden)) + " "},
- {m3, strings.TrimSpace(m3Golden) + "\n", strings.TrimSpace(compact(m3Golden)) + " "},
- {m4, strings.TrimSpace(m4Golden) + "\n", strings.TrimSpace(compact(m4Golden)) + " "},
- {m5, strings.TrimSpace(m5Golden) + "\n", strings.TrimSpace(compact(m5Golden)) + " "},
- {m6, strings.TrimSpace(m6Golden) + "\n", strings.TrimSpace(compact(m6Golden)) + " "},
- }
-}
-
-func TestMarshalGolden(t *testing.T) {
- for _, tt := range goldenMessages {
- if got, want := expandedMarshaler.Text(tt.m), tt.t; got != want {
- t.Errorf("message %v: got:\n%s\nwant:\n%s", tt.m, got, want)
- }
- if got, want := expandedCompactMarshaler.Text(tt.m), tt.c; got != want {
- t.Errorf("message %v: got:\n`%s`\nwant:\n`%s`", tt.m, got, want)
- }
- }
-}
-
-func TestUnmarshalGolden(t *testing.T) {
- for _, tt := range goldenMessages {
- want := tt.m
- got := proto.Clone(tt.m)
- got.Reset()
- if err := proto.UnmarshalText(tt.t, got); err != nil {
- t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.t, err)
- }
- if !anyEqual(got, want) {
- t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.t, got, want)
- }
- got.Reset()
- if err := proto.UnmarshalText(tt.c, got); err != nil {
- t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.c, err)
- }
- if !anyEqual(got, want) {
- t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.c, got, want)
- }
- }
-}
-
-func TestMarshalUnknownAny(t *testing.T) {
- m := &pb.Message{
- Anything: &anypb.Any{
- TypeUrl: "foo",
- Value: []byte("bar"),
- },
- }
- want := `anything: <
- type_url: "foo"
- value: "bar"
->
-`
- got := expandedMarshaler.Text(m)
- if got != want {
- t.Errorf("got\n`%s`\nwant\n`%s`", got, want)
- }
-}
-
-func TestAmbiguousAny(t *testing.T) {
- pb := &anypb.Any{}
- err := proto.UnmarshalText(`
- type_url: "ttt/proto3_proto.Nested"
- value: "\n\x05Monty"
- `, pb)
- t.Logf("result: %v (error: %v)", expandedMarshaler.Text(pb), err)
- if err != nil {
- t.Errorf("failed to parse ambiguous Any message: %v", err)
- }
-}
-
-func TestUnmarshalOverwriteAny(t *testing.T) {
- pb := &anypb.Any{}
- err := proto.UnmarshalText(`
- [type.googleapis.com/a/path/proto3_proto.Nested]: <
- bunny: "Monty"
- >
- [type.googleapis.com/a/path/proto3_proto.Nested]: <
- bunny: "Rabbit of Caerbannog"
- >
- `, pb)
- want := `line 7: Any message unpacked multiple times, or "type_url" already set`
- if err.Error() != want {
- t.Errorf("incorrect error.\nHave: %v\nWant: %v", err.Error(), want)
- }
-}
-
-func TestUnmarshalAnyMixAndMatch(t *testing.T) {
- pb := &anypb.Any{}
- err := proto.UnmarshalText(`
- value: "\n\x05Monty"
- [type.googleapis.com/a/path/proto3_proto.Nested]: <
- bunny: "Rabbit of Caerbannog"
- >
- `, pb)
- want := `line 5: Any message unpacked multiple times, or "value" already set`
- if err.Error() != want {
- t.Errorf("incorrect error.\nHave: %v\nWant: %v", err.Error(), want)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/clone_test.go b/vendor/github.com/golang/protobuf/proto/clone_test.go
deleted file mode 100644
index 0d3b1273..00000000
--- a/vendor/github.com/golang/protobuf/proto/clone_test.go
+++ /dev/null
@@ -1,390 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2011 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.
-
-package proto_test
-
-import (
- "testing"
-
- "github.com/golang/protobuf/proto"
-
- proto3pb "github.com/golang/protobuf/proto/proto3_proto"
- pb "github.com/golang/protobuf/proto/test_proto"
-)
-
-var cloneTestMessage = &pb.MyMessage{
- Count: proto.Int32(42),
- Name: proto.String("Dave"),
- Pet: []string{"bunny", "kitty", "horsey"},
- Inner: &pb.InnerMessage{
- Host: proto.String("niles"),
- Port: proto.Int32(9099),
- Connected: proto.Bool(true),
- },
- Others: []*pb.OtherMessage{
- {
- Value: []byte("some bytes"),
- },
- },
- Somegroup: &pb.MyMessage_SomeGroup{
- GroupField: proto.Int32(6),
- },
- RepBytes: [][]byte{[]byte("sham"), []byte("wow")},
-}
-
-func init() {
- ext := &pb.Ext{
- Data: proto.String("extension"),
- }
- if err := proto.SetExtension(cloneTestMessage, pb.E_Ext_More, ext); err != nil {
- panic("SetExtension: " + err.Error())
- }
-}
-
-func TestClone(t *testing.T) {
- m := proto.Clone(cloneTestMessage).(*pb.MyMessage)
- if !proto.Equal(m, cloneTestMessage) {
- t.Fatalf("Clone(%v) = %v", cloneTestMessage, m)
- }
-
- // Verify it was a deep copy.
- *m.Inner.Port++
- if proto.Equal(m, cloneTestMessage) {
- t.Error("Mutating clone changed the original")
- }
- // Byte fields and repeated fields should be copied.
- if &m.Pet[0] == &cloneTestMessage.Pet[0] {
- t.Error("Pet: repeated field not copied")
- }
- if &m.Others[0] == &cloneTestMessage.Others[0] {
- t.Error("Others: repeated field not copied")
- }
- if &m.Others[0].Value[0] == &cloneTestMessage.Others[0].Value[0] {
- t.Error("Others[0].Value: bytes field not copied")
- }
- if &m.RepBytes[0] == &cloneTestMessage.RepBytes[0] {
- t.Error("RepBytes: repeated field not copied")
- }
- if &m.RepBytes[0][0] == &cloneTestMessage.RepBytes[0][0] {
- t.Error("RepBytes[0]: bytes field not copied")
- }
-}
-
-func TestCloneNil(t *testing.T) {
- var m *pb.MyMessage
- if c := proto.Clone(m); !proto.Equal(m, c) {
- t.Errorf("Clone(%v) = %v", m, c)
- }
-}
-
-var mergeTests = []struct {
- src, dst, want proto.Message
-}{
- {
- src: &pb.MyMessage{
- Count: proto.Int32(42),
- },
- dst: &pb.MyMessage{
- Name: proto.String("Dave"),
- },
- want: &pb.MyMessage{
- Count: proto.Int32(42),
- Name: proto.String("Dave"),
- },
- },
- {
- src: &pb.MyMessage{
- Inner: &pb.InnerMessage{
- Host: proto.String("hey"),
- Connected: proto.Bool(true),
- },
- Pet: []string{"horsey"},
- Others: []*pb.OtherMessage{
- {
- Value: []byte("some bytes"),
- },
- },
- },
- dst: &pb.MyMessage{
- Inner: &pb.InnerMessage{
- Host: proto.String("niles"),
- Port: proto.Int32(9099),
- },
- Pet: []string{"bunny", "kitty"},
- Others: []*pb.OtherMessage{
- {
- Key: proto.Int64(31415926535),
- },
- {
- // Explicitly test a src=nil field
- Inner: nil,
- },
- },
- },
- want: &pb.MyMessage{
- Inner: &pb.InnerMessage{
- Host: proto.String("hey"),
- Connected: proto.Bool(true),
- Port: proto.Int32(9099),
- },
- Pet: []string{"bunny", "kitty", "horsey"},
- Others: []*pb.OtherMessage{
- {
- Key: proto.Int64(31415926535),
- },
- {},
- {
- Value: []byte("some bytes"),
- },
- },
- },
- },
- {
- src: &pb.MyMessage{
- RepBytes: [][]byte{[]byte("wow")},
- },
- dst: &pb.MyMessage{
- Somegroup: &pb.MyMessage_SomeGroup{
- GroupField: proto.Int32(6),
- },
- RepBytes: [][]byte{[]byte("sham")},
- },
- want: &pb.MyMessage{
- Somegroup: &pb.MyMessage_SomeGroup{
- GroupField: proto.Int32(6),
- },
- RepBytes: [][]byte{[]byte("sham"), []byte("wow")},
- },
- },
- // Check that a scalar bytes field replaces rather than appends.
- {
- src: &pb.OtherMessage{Value: []byte("foo")},
- dst: &pb.OtherMessage{Value: []byte("bar")},
- want: &pb.OtherMessage{Value: []byte("foo")},
- },
- {
- src: &pb.MessageWithMap{
- NameMapping: map[int32]string{6: "Nigel"},
- MsgMapping: map[int64]*pb.FloatingPoint{
- 0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)},
- 0x4002: &pb.FloatingPoint{
- F: proto.Float64(2.0),
- },
- },
- ByteMapping: map[bool][]byte{true: []byte("wowsa")},
- },
- dst: &pb.MessageWithMap{
- NameMapping: map[int32]string{
- 6: "Bruce", // should be overwritten
- 7: "Andrew",
- },
- MsgMapping: map[int64]*pb.FloatingPoint{
- 0x4002: &pb.FloatingPoint{
- F: proto.Float64(3.0),
- Exact: proto.Bool(true),
- }, // the entire message should be overwritten
- },
- },
- want: &pb.MessageWithMap{
- NameMapping: map[int32]string{
- 6: "Nigel",
- 7: "Andrew",
- },
- MsgMapping: map[int64]*pb.FloatingPoint{
- 0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)},
- 0x4002: &pb.FloatingPoint{
- F: proto.Float64(2.0),
- },
- },
- ByteMapping: map[bool][]byte{true: []byte("wowsa")},
- },
- },
- // proto3 shouldn't merge zero values,
- // in the same way that proto2 shouldn't merge nils.
- {
- src: &proto3pb.Message{
- Name: "Aaron",
- Data: []byte(""), // zero value, but not nil
- },
- dst: &proto3pb.Message{
- HeightInCm: 176,
- Data: []byte("texas!"),
- },
- want: &proto3pb.Message{
- Name: "Aaron",
- HeightInCm: 176,
- Data: []byte("texas!"),
- },
- },
- { // Oneof fields should merge by assignment.
- src: &pb.Communique{Union: &pb.Communique_Number{41}},
- dst: &pb.Communique{Union: &pb.Communique_Name{"Bobby Tables"}},
- want: &pb.Communique{Union: &pb.Communique_Number{41}},
- },
- { // Oneof nil is the same as not set.
- src: &pb.Communique{},
- dst: &pb.Communique{Union: &pb.Communique_Name{"Bobby Tables"}},
- want: &pb.Communique{Union: &pb.Communique_Name{"Bobby Tables"}},
- },
- {
- src: &pb.Communique{Union: &pb.Communique_Number{1337}},
- dst: &pb.Communique{},
- want: &pb.Communique{Union: &pb.Communique_Number{1337}},
- },
- {
- src: &pb.Communique{Union: &pb.Communique_Col{pb.MyMessage_RED}},
- dst: &pb.Communique{},
- want: &pb.Communique{Union: &pb.Communique_Col{pb.MyMessage_RED}},
- },
- {
- src: &pb.Communique{Union: &pb.Communique_Data{[]byte("hello")}},
- dst: &pb.Communique{},
- want: &pb.Communique{Union: &pb.Communique_Data{[]byte("hello")}},
- },
- {
- src: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{BytesField: []byte{1, 2, 3}}}},
- dst: &pb.Communique{},
- want: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{BytesField: []byte{1, 2, 3}}}},
- },
- {
- src: &pb.Communique{Union: &pb.Communique_Msg{}},
- dst: &pb.Communique{},
- want: &pb.Communique{Union: &pb.Communique_Msg{}},
- },
- {
- src: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{StringField: proto.String("123")}}},
- dst: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{BytesField: []byte{1, 2, 3}}}},
- want: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{StringField: proto.String("123"), BytesField: []byte{1, 2, 3}}}},
- },
- {
- src: &proto3pb.Message{
- Terrain: map[string]*proto3pb.Nested{
- "kay_a": &proto3pb.Nested{Cute: true}, // replace
- "kay_b": &proto3pb.Nested{Bunny: "rabbit"}, // insert
- },
- },
- dst: &proto3pb.Message{
- Terrain: map[string]*proto3pb.Nested{
- "kay_a": &proto3pb.Nested{Bunny: "lost"}, // replaced
- "kay_c": &proto3pb.Nested{Bunny: "bunny"}, // keep
- },
- },
- want: &proto3pb.Message{
- Terrain: map[string]*proto3pb.Nested{
- "kay_a": &proto3pb.Nested{Cute: true},
- "kay_b": &proto3pb.Nested{Bunny: "rabbit"},
- "kay_c": &proto3pb.Nested{Bunny: "bunny"},
- },
- },
- },
- {
- src: &pb.GoTest{
- F_BoolRepeated: []bool{},
- F_Int32Repeated: []int32{},
- F_Int64Repeated: []int64{},
- F_Uint32Repeated: []uint32{},
- F_Uint64Repeated: []uint64{},
- F_FloatRepeated: []float32{},
- F_DoubleRepeated: []float64{},
- F_StringRepeated: []string{},
- F_BytesRepeated: [][]byte{},
- },
- dst: &pb.GoTest{},
- want: &pb.GoTest{
- F_BoolRepeated: []bool{},
- F_Int32Repeated: []int32{},
- F_Int64Repeated: []int64{},
- F_Uint32Repeated: []uint32{},
- F_Uint64Repeated: []uint64{},
- F_FloatRepeated: []float32{},
- F_DoubleRepeated: []float64{},
- F_StringRepeated: []string{},
- F_BytesRepeated: [][]byte{},
- },
- },
- {
- src: &pb.GoTest{},
- dst: &pb.GoTest{
- F_BoolRepeated: []bool{},
- F_Int32Repeated: []int32{},
- F_Int64Repeated: []int64{},
- F_Uint32Repeated: []uint32{},
- F_Uint64Repeated: []uint64{},
- F_FloatRepeated: []float32{},
- F_DoubleRepeated: []float64{},
- F_StringRepeated: []string{},
- F_BytesRepeated: [][]byte{},
- },
- want: &pb.GoTest{
- F_BoolRepeated: []bool{},
- F_Int32Repeated: []int32{},
- F_Int64Repeated: []int64{},
- F_Uint32Repeated: []uint32{},
- F_Uint64Repeated: []uint64{},
- F_FloatRepeated: []float32{},
- F_DoubleRepeated: []float64{},
- F_StringRepeated: []string{},
- F_BytesRepeated: [][]byte{},
- },
- },
- {
- src: &pb.GoTest{
- F_BytesRepeated: [][]byte{nil, []byte{}, []byte{0}},
- },
- dst: &pb.GoTest{},
- want: &pb.GoTest{
- F_BytesRepeated: [][]byte{nil, []byte{}, []byte{0}},
- },
- },
- {
- src: &pb.MyMessage{
- Others: []*pb.OtherMessage{},
- },
- dst: &pb.MyMessage{},
- want: &pb.MyMessage{
- Others: []*pb.OtherMessage{},
- },
- },
-}
-
-func TestMerge(t *testing.T) {
- for _, m := range mergeTests {
- got := proto.Clone(m.dst)
- if !proto.Equal(got, m.dst) {
- t.Errorf("Clone()\ngot %v\nwant %v", got, m.dst)
- continue
- }
- proto.Merge(got, m.src)
- if !proto.Equal(got, m.want) {
- t.Errorf("Merge(%v, %v)\ngot %v\nwant %v", m.dst, m.src, got, m.want)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/decode_test.go b/vendor/github.com/golang/protobuf/proto/decode_test.go
deleted file mode 100644
index 949be3ab..00000000
--- a/vendor/github.com/golang/protobuf/proto/decode_test.go
+++ /dev/null
@@ -1,255 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// +build go1.7
-
-package proto_test
-
-import (
- "fmt"
- "testing"
-
- "github.com/golang/protobuf/proto"
- tpb "github.com/golang/protobuf/proto/proto3_proto"
-)
-
-var msgBlackhole = new(tpb.Message)
-
-// BenchmarkVarint32ArraySmall shows the performance on an array of small int32 fields (1 and
-// 2 bytes long).
-func BenchmarkVarint32ArraySmall(b *testing.B) {
- for i := uint(1); i <= 10; i++ {
- dist := genInt32Dist([7]int{0, 3, 1}, 1<unmarshal.
-}
-
-func TestMarshalUnmarshalRepeatedExtension(t *testing.T) {
- // Add a repeated extension to the result.
- tests := []struct {
- name string
- ext []*pb.ComplexExtension
- }{
- {
- "two fields",
- []*pb.ComplexExtension{
- {First: proto.Int32(7)},
- {Second: proto.Int32(11)},
- },
- },
- {
- "repeated field",
- []*pb.ComplexExtension{
- {Third: []int32{1000}},
- {Third: []int32{2000}},
- },
- },
- {
- "two fields and repeated field",
- []*pb.ComplexExtension{
- {Third: []int32{1000}},
- {First: proto.Int32(9)},
- {Second: proto.Int32(21)},
- {Third: []int32{2000}},
- },
- },
- }
- for _, test := range tests {
- // Marshal message with a repeated extension.
- msg1 := new(pb.OtherMessage)
- err := proto.SetExtension(msg1, pb.E_RComplex, test.ext)
- if err != nil {
- t.Fatalf("[%s] Error setting extension: %v", test.name, err)
- }
- b, err := proto.Marshal(msg1)
- if err != nil {
- t.Fatalf("[%s] Error marshaling message: %v", test.name, err)
- }
-
- // Unmarshal and read the merged proto.
- msg2 := new(pb.OtherMessage)
- err = proto.Unmarshal(b, msg2)
- if err != nil {
- t.Fatalf("[%s] Error unmarshaling message: %v", test.name, err)
- }
- e, err := proto.GetExtension(msg2, pb.E_RComplex)
- if err != nil {
- t.Fatalf("[%s] Error getting extension: %v", test.name, err)
- }
- ext := e.([]*pb.ComplexExtension)
- if ext == nil {
- t.Fatalf("[%s] Invalid extension", test.name)
- }
- if len(ext) != len(test.ext) {
- t.Errorf("[%s] Wrong length of ComplexExtension: got: %v want: %v\n", test.name, len(ext), len(test.ext))
- }
- for i := range test.ext {
- if !proto.Equal(ext[i], test.ext[i]) {
- t.Errorf("[%s] Wrong value for ComplexExtension[%d]: got: %v want: %v\n", test.name, i, ext[i], test.ext[i])
- }
- }
- }
-}
-
-func TestUnmarshalRepeatingNonRepeatedExtension(t *testing.T) {
- // We may see multiple instances of the same extension in the wire
- // format. For example, the proto compiler may encode custom options in
- // this way. Here, we verify that we merge the extensions together.
- tests := []struct {
- name string
- ext []*pb.ComplexExtension
- }{
- {
- "two fields",
- []*pb.ComplexExtension{
- {First: proto.Int32(7)},
- {Second: proto.Int32(11)},
- },
- },
- {
- "repeated field",
- []*pb.ComplexExtension{
- {Third: []int32{1000}},
- {Third: []int32{2000}},
- },
- },
- {
- "two fields and repeated field",
- []*pb.ComplexExtension{
- {Third: []int32{1000}},
- {First: proto.Int32(9)},
- {Second: proto.Int32(21)},
- {Third: []int32{2000}},
- },
- },
- }
- for _, test := range tests {
- var buf bytes.Buffer
- var want pb.ComplexExtension
-
- // Generate a serialized representation of a repeated extension
- // by catenating bytes together.
- for i, e := range test.ext {
- // Merge to create the wanted proto.
- proto.Merge(&want, e)
-
- // serialize the message
- msg := new(pb.OtherMessage)
- err := proto.SetExtension(msg, pb.E_Complex, e)
- if err != nil {
- t.Fatalf("[%s] Error setting extension %d: %v", test.name, i, err)
- }
- b, err := proto.Marshal(msg)
- if err != nil {
- t.Fatalf("[%s] Error marshaling message %d: %v", test.name, i, err)
- }
- buf.Write(b)
- }
-
- // Unmarshal and read the merged proto.
- msg2 := new(pb.OtherMessage)
- err := proto.Unmarshal(buf.Bytes(), msg2)
- if err != nil {
- t.Fatalf("[%s] Error unmarshaling message: %v", test.name, err)
- }
- e, err := proto.GetExtension(msg2, pb.E_Complex)
- if err != nil {
- t.Fatalf("[%s] Error getting extension: %v", test.name, err)
- }
- ext := e.(*pb.ComplexExtension)
- if ext == nil {
- t.Fatalf("[%s] Invalid extension", test.name)
- }
- if !proto.Equal(ext, &want) {
- t.Errorf("[%s] Wrong value for ComplexExtension: got: %s want: %s\n", test.name, ext, &want)
- }
- }
-}
-
-func TestClearAllExtensions(t *testing.T) {
- // unregistered extension
- desc := &proto.ExtensionDesc{
- ExtendedType: (*pb.MyMessage)(nil),
- ExtensionType: (*bool)(nil),
- Field: 101010100,
- Name: "emptyextension",
- Tag: "varint,0,opt",
- }
- m := &pb.MyMessage{}
- if proto.HasExtension(m, desc) {
- t.Errorf("proto.HasExtension(%s): got true, want false", proto.MarshalTextString(m))
- }
- if err := proto.SetExtension(m, desc, proto.Bool(true)); err != nil {
- t.Errorf("proto.SetExtension(m, desc, true): got error %q, want nil", err)
- }
- if !proto.HasExtension(m, desc) {
- t.Errorf("proto.HasExtension(%s): got false, want true", proto.MarshalTextString(m))
- }
- proto.ClearAllExtensions(m)
- if proto.HasExtension(m, desc) {
- t.Errorf("proto.HasExtension(%s): got true, want false", proto.MarshalTextString(m))
- }
-}
-
-func TestMarshalRace(t *testing.T) {
- ext := &pb.Ext{}
- m := &pb.MyMessage{Count: proto.Int32(4)}
- if err := proto.SetExtension(m, pb.E_Ext_More, ext); err != nil {
- t.Fatalf("proto.SetExtension(m, desc, true): got error %q, want nil", err)
- }
-
- b, err := proto.Marshal(m)
- if err != nil {
- t.Fatalf("Could not marshal message: %v", err)
- }
- if err := proto.Unmarshal(b, m); err != nil {
- t.Fatalf("Could not unmarshal message: %v", err)
- }
- // after Unmarshal, the extension is in undecoded form.
- // GetExtension will decode it lazily. Make sure this does
- // not race against Marshal.
-
- var g errgroup.Group
- for n := 3; n > 0; n-- {
- g.Go(func() error {
- _, err := proto.Marshal(m)
- return err
- })
- g.Go(func() error {
- _, err := proto.GetExtension(m, pb.E_Ext_More)
- return err
- })
- }
- if err := g.Wait(); err != nil {
- t.Fatal(err)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/map_test.go b/vendor/github.com/golang/protobuf/proto/map_test.go
deleted file mode 100644
index b1e1529e..00000000
--- a/vendor/github.com/golang/protobuf/proto/map_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package proto_test
-
-import (
- "fmt"
- "reflect"
- "testing"
-
- "github.com/golang/protobuf/proto"
- ppb "github.com/golang/protobuf/proto/proto3_proto"
-)
-
-func TestMap(t *testing.T) {
- var b []byte
- fmt.Sscanf("a2010c0a044b657931120456616c31a201130a044b657932120556616c3261120456616c32a201240a044b6579330d05000000120556616c33621a0556616c3361120456616c331505000000a20100a201260a044b657934130a07536f6d6555524c1209536f6d655469746c651a08536e69707065743114", "%x", &b)
-
- var m ppb.Message
- if err := proto.Unmarshal(b, &m); err != nil {
- t.Fatalf("proto.Unmarshal error: %v", err)
- }
-
- got := m.StringMap
- want := map[string]string{
- "": "",
- "Key1": "Val1",
- "Key2": "Val2",
- "Key3": "Val3",
- "Key4": "",
- }
-
- if !reflect.DeepEqual(got, want) {
- t.Errorf("maps differ:\ngot %#v\nwant %#v", got, want)
- }
-}
-
-func marshalled() []byte {
- m := &ppb.IntMaps{}
- for i := 0; i < 1000; i++ {
- m.Maps = append(m.Maps, &ppb.IntMap{
- Rtt: map[int32]int32{1: 2},
- })
- }
- b, err := proto.Marshal(m)
- if err != nil {
- panic(fmt.Sprintf("Can't marshal %+v: %v", m, err))
- }
- return b
-}
-
-func BenchmarkConcurrentMapUnmarshal(b *testing.B) {
- in := marshalled()
- b.RunParallel(func(pb *testing.PB) {
- for pb.Next() {
- var out ppb.IntMaps
- if err := proto.Unmarshal(in, &out); err != nil {
- b.Errorf("Can't unmarshal ppb.IntMaps: %v", err)
- }
- }
- })
-}
-
-func BenchmarkSequentialMapUnmarshal(b *testing.B) {
- in := marshalled()
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- var out ppb.IntMaps
- if err := proto.Unmarshal(in, &out); err != nil {
- b.Errorf("Can't unmarshal ppb.IntMaps: %v", err)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/message_set_test.go b/vendor/github.com/golang/protobuf/proto/message_set_test.go
deleted file mode 100644
index 2c170c5f..00000000
--- a/vendor/github.com/golang/protobuf/proto/message_set_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2014 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package proto
-
-import (
- "bytes"
- "testing"
-)
-
-func TestUnmarshalMessageSetWithDuplicate(t *testing.T) {
- // Check that a repeated message set entry will be concatenated.
- in := &messageSet{
- Item: []*_MessageSet_Item{
- {TypeId: Int32(12345), Message: []byte("hoo")},
- {TypeId: Int32(12345), Message: []byte("hah")},
- },
- }
- b, err := Marshal(in)
- if err != nil {
- t.Fatalf("Marshal: %v", err)
- }
- t.Logf("Marshaled bytes: %q", b)
-
- var extensions XXX_InternalExtensions
- if err := UnmarshalMessageSet(b, &extensions); err != nil {
- t.Fatalf("UnmarshalMessageSet: %v", err)
- }
- ext, ok := extensions.p.extensionMap[12345]
- if !ok {
- t.Fatalf("Didn't retrieve extension 12345; map is %v", extensions.p.extensionMap)
- }
- // Skip wire type/field number and length varints.
- got := skipVarint(skipVarint(ext.enc))
- if want := []byte("hoohah"); !bytes.Equal(got, want) {
- t.Errorf("Combined extension is %q, want %q", got, want)
- }
-}
-
-func TestMarshalMessageSetJSON_UnknownType(t *testing.T) {
- extMap := map[int32]Extension{12345: Extension{}}
- got, err := MarshalMessageSetJSON(extMap)
- if err != nil {
- t.Fatalf("MarshalMessageSetJSON: %v", err)
- }
- if want := []byte("{}"); !bytes.Equal(got, want) {
- t.Errorf("MarshalMessageSetJSON(%v) = %q, want %q", extMap, got, want)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go
deleted file mode 100644
index a80f0893..00000000
--- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go
+++ /dev/null
@@ -1,461 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: proto3_proto/proto3.proto
-
-package proto3_proto
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import test_proto "github.com/golang/protobuf/proto/test_proto"
-import any "github.com/golang/protobuf/ptypes/any"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Message_Humour int32
-
-const (
- Message_UNKNOWN Message_Humour = 0
- Message_PUNS Message_Humour = 1
- Message_SLAPSTICK Message_Humour = 2
- Message_BILL_BAILEY Message_Humour = 3
-)
-
-var Message_Humour_name = map[int32]string{
- 0: "UNKNOWN",
- 1: "PUNS",
- 2: "SLAPSTICK",
- 3: "BILL_BAILEY",
-}
-var Message_Humour_value = map[string]int32{
- "UNKNOWN": 0,
- "PUNS": 1,
- "SLAPSTICK": 2,
- "BILL_BAILEY": 3,
-}
-
-func (x Message_Humour) String() string {
- return proto.EnumName(Message_Humour_name, int32(x))
-}
-func (Message_Humour) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_proto3_e706e4ff19a5dbea, []int{0, 0}
-}
-
-type Message struct {
- Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"`
- HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm,json=heightInCm" json:"height_in_cm,omitempty"`
- Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
- ResultCount int64 `protobuf:"varint,7,opt,name=result_count,json=resultCount" json:"result_count,omitempty"`
- TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman,json=trueScotsman" json:"true_scotsman,omitempty"`
- Score float32 `protobuf:"fixed32,9,opt,name=score" json:"score,omitempty"`
- Key []uint64 `protobuf:"varint,5,rep,packed,name=key" json:"key,omitempty"`
- ShortKey []int32 `protobuf:"varint,19,rep,packed,name=short_key,json=shortKey" json:"short_key,omitempty"`
- Nested *Nested `protobuf:"bytes,6,opt,name=nested" json:"nested,omitempty"`
- RFunny []Message_Humour `protobuf:"varint,16,rep,packed,name=r_funny,json=rFunny,enum=proto3_proto.Message_Humour" json:"r_funny,omitempty"`
- Terrain map[string]*Nested `protobuf:"bytes,10,rep,name=terrain" json:"terrain,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Proto2Field *test_proto.SubDefaults `protobuf:"bytes,11,opt,name=proto2_field,json=proto2Field" json:"proto2_field,omitempty"`
- Proto2Value map[string]*test_proto.SubDefaults `protobuf:"bytes,13,rep,name=proto2_value,json=proto2Value" json:"proto2_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Anything *any.Any `protobuf:"bytes,14,opt,name=anything" json:"anything,omitempty"`
- ManyThings []*any.Any `protobuf:"bytes,15,rep,name=many_things,json=manyThings" json:"many_things,omitempty"`
- Submessage *Message `protobuf:"bytes,17,opt,name=submessage" json:"submessage,omitempty"`
- Children []*Message `protobuf:"bytes,18,rep,name=children" json:"children,omitempty"`
- StringMap map[string]string `protobuf:"bytes,20,rep,name=string_map,json=stringMap" json:"string_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Message) Reset() { *m = Message{} }
-func (m *Message) String() string { return proto.CompactTextString(m) }
-func (*Message) ProtoMessage() {}
-func (*Message) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_e706e4ff19a5dbea, []int{0}
-}
-func (m *Message) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Message.Unmarshal(m, b)
-}
-func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Message.Marshal(b, m, deterministic)
-}
-func (dst *Message) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Message.Merge(dst, src)
-}
-func (m *Message) XXX_Size() int {
- return xxx_messageInfo_Message.Size(m)
-}
-func (m *Message) XXX_DiscardUnknown() {
- xxx_messageInfo_Message.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Message proto.InternalMessageInfo
-
-func (m *Message) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *Message) GetHilarity() Message_Humour {
- if m != nil {
- return m.Hilarity
- }
- return Message_UNKNOWN
-}
-
-func (m *Message) GetHeightInCm() uint32 {
- if m != nil {
- return m.HeightInCm
- }
- return 0
-}
-
-func (m *Message) GetData() []byte {
- if m != nil {
- return m.Data
- }
- return nil
-}
-
-func (m *Message) GetResultCount() int64 {
- if m != nil {
- return m.ResultCount
- }
- return 0
-}
-
-func (m *Message) GetTrueScotsman() bool {
- if m != nil {
- return m.TrueScotsman
- }
- return false
-}
-
-func (m *Message) GetScore() float32 {
- if m != nil {
- return m.Score
- }
- return 0
-}
-
-func (m *Message) GetKey() []uint64 {
- if m != nil {
- return m.Key
- }
- return nil
-}
-
-func (m *Message) GetShortKey() []int32 {
- if m != nil {
- return m.ShortKey
- }
- return nil
-}
-
-func (m *Message) GetNested() *Nested {
- if m != nil {
- return m.Nested
- }
- return nil
-}
-
-func (m *Message) GetRFunny() []Message_Humour {
- if m != nil {
- return m.RFunny
- }
- return nil
-}
-
-func (m *Message) GetTerrain() map[string]*Nested {
- if m != nil {
- return m.Terrain
- }
- return nil
-}
-
-func (m *Message) GetProto2Field() *test_proto.SubDefaults {
- if m != nil {
- return m.Proto2Field
- }
- return nil
-}
-
-func (m *Message) GetProto2Value() map[string]*test_proto.SubDefaults {
- if m != nil {
- return m.Proto2Value
- }
- return nil
-}
-
-func (m *Message) GetAnything() *any.Any {
- if m != nil {
- return m.Anything
- }
- return nil
-}
-
-func (m *Message) GetManyThings() []*any.Any {
- if m != nil {
- return m.ManyThings
- }
- return nil
-}
-
-func (m *Message) GetSubmessage() *Message {
- if m != nil {
- return m.Submessage
- }
- return nil
-}
-
-func (m *Message) GetChildren() []*Message {
- if m != nil {
- return m.Children
- }
- return nil
-}
-
-func (m *Message) GetStringMap() map[string]string {
- if m != nil {
- return m.StringMap
- }
- return nil
-}
-
-type Nested struct {
- Bunny string `protobuf:"bytes,1,opt,name=bunny" json:"bunny,omitempty"`
- Cute bool `protobuf:"varint,2,opt,name=cute" json:"cute,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Nested) Reset() { *m = Nested{} }
-func (m *Nested) String() string { return proto.CompactTextString(m) }
-func (*Nested) ProtoMessage() {}
-func (*Nested) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_e706e4ff19a5dbea, []int{1}
-}
-func (m *Nested) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Nested.Unmarshal(m, b)
-}
-func (m *Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Nested.Marshal(b, m, deterministic)
-}
-func (dst *Nested) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Nested.Merge(dst, src)
-}
-func (m *Nested) XXX_Size() int {
- return xxx_messageInfo_Nested.Size(m)
-}
-func (m *Nested) XXX_DiscardUnknown() {
- xxx_messageInfo_Nested.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Nested proto.InternalMessageInfo
-
-func (m *Nested) GetBunny() string {
- if m != nil {
- return m.Bunny
- }
- return ""
-}
-
-func (m *Nested) GetCute() bool {
- if m != nil {
- return m.Cute
- }
- return false
-}
-
-type MessageWithMap struct {
- ByteMapping map[bool][]byte `protobuf:"bytes,1,rep,name=byte_mapping,json=byteMapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MessageWithMap) Reset() { *m = MessageWithMap{} }
-func (m *MessageWithMap) String() string { return proto.CompactTextString(m) }
-func (*MessageWithMap) ProtoMessage() {}
-func (*MessageWithMap) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_e706e4ff19a5dbea, []int{2}
-}
-func (m *MessageWithMap) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MessageWithMap.Unmarshal(m, b)
-}
-func (m *MessageWithMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MessageWithMap.Marshal(b, m, deterministic)
-}
-func (dst *MessageWithMap) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MessageWithMap.Merge(dst, src)
-}
-func (m *MessageWithMap) XXX_Size() int {
- return xxx_messageInfo_MessageWithMap.Size(m)
-}
-func (m *MessageWithMap) XXX_DiscardUnknown() {
- xxx_messageInfo_MessageWithMap.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MessageWithMap proto.InternalMessageInfo
-
-func (m *MessageWithMap) GetByteMapping() map[bool][]byte {
- if m != nil {
- return m.ByteMapping
- }
- return nil
-}
-
-type IntMap struct {
- Rtt map[int32]int32 `protobuf:"bytes,1,rep,name=rtt" json:"rtt,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *IntMap) Reset() { *m = IntMap{} }
-func (m *IntMap) String() string { return proto.CompactTextString(m) }
-func (*IntMap) ProtoMessage() {}
-func (*IntMap) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_e706e4ff19a5dbea, []int{3}
-}
-func (m *IntMap) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_IntMap.Unmarshal(m, b)
-}
-func (m *IntMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_IntMap.Marshal(b, m, deterministic)
-}
-func (dst *IntMap) XXX_Merge(src proto.Message) {
- xxx_messageInfo_IntMap.Merge(dst, src)
-}
-func (m *IntMap) XXX_Size() int {
- return xxx_messageInfo_IntMap.Size(m)
-}
-func (m *IntMap) XXX_DiscardUnknown() {
- xxx_messageInfo_IntMap.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_IntMap proto.InternalMessageInfo
-
-func (m *IntMap) GetRtt() map[int32]int32 {
- if m != nil {
- return m.Rtt
- }
- return nil
-}
-
-type IntMaps struct {
- Maps []*IntMap `protobuf:"bytes,1,rep,name=maps" json:"maps,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *IntMaps) Reset() { *m = IntMaps{} }
-func (m *IntMaps) String() string { return proto.CompactTextString(m) }
-func (*IntMaps) ProtoMessage() {}
-func (*IntMaps) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_e706e4ff19a5dbea, []int{4}
-}
-func (m *IntMaps) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_IntMaps.Unmarshal(m, b)
-}
-func (m *IntMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_IntMaps.Marshal(b, m, deterministic)
-}
-func (dst *IntMaps) XXX_Merge(src proto.Message) {
- xxx_messageInfo_IntMaps.Merge(dst, src)
-}
-func (m *IntMaps) XXX_Size() int {
- return xxx_messageInfo_IntMaps.Size(m)
-}
-func (m *IntMaps) XXX_DiscardUnknown() {
- xxx_messageInfo_IntMaps.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_IntMaps proto.InternalMessageInfo
-
-func (m *IntMaps) GetMaps() []*IntMap {
- if m != nil {
- return m.Maps
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Message)(nil), "proto3_proto.Message")
- proto.RegisterMapType((map[string]*test_proto.SubDefaults)(nil), "proto3_proto.Message.Proto2ValueEntry")
- proto.RegisterMapType((map[string]string)(nil), "proto3_proto.Message.StringMapEntry")
- proto.RegisterMapType((map[string]*Nested)(nil), "proto3_proto.Message.TerrainEntry")
- proto.RegisterType((*Nested)(nil), "proto3_proto.Nested")
- proto.RegisterType((*MessageWithMap)(nil), "proto3_proto.MessageWithMap")
- proto.RegisterMapType((map[bool][]byte)(nil), "proto3_proto.MessageWithMap.ByteMappingEntry")
- proto.RegisterType((*IntMap)(nil), "proto3_proto.IntMap")
- proto.RegisterMapType((map[int32]int32)(nil), "proto3_proto.IntMap.RttEntry")
- proto.RegisterType((*IntMaps)(nil), "proto3_proto.IntMaps")
- proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value)
-}
-
-func init() { proto.RegisterFile("proto3_proto/proto3.proto", fileDescriptor_proto3_e706e4ff19a5dbea) }
-
-var fileDescriptor_proto3_e706e4ff19a5dbea = []byte{
- // 774 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x6f, 0x8f, 0xdb, 0x44,
- 0x10, 0xc6, 0x71, 0x9c, 0x3f, 0xce, 0xd8, 0x77, 0x35, 0x4b, 0x2a, 0xb6, 0x01, 0x24, 0x13, 0x10,
- 0xb2, 0x10, 0xf5, 0x41, 0xaa, 0x43, 0x55, 0x55, 0x81, 0xee, 0x8e, 0x56, 0x44, 0x77, 0x17, 0xa2,
- 0xcd, 0x95, 0x13, 0xaf, 0xac, 0x4d, 0x6e, 0x93, 0x58, 0xc4, 0xeb, 0xe0, 0x5d, 0x23, 0xf9, 0x0b,
- 0xf0, 0x41, 0xf8, 0xa4, 0x68, 0x77, 0x9d, 0xd4, 0xa9, 0x5c, 0xfa, 0x2a, 0xbb, 0x8f, 0x7f, 0x33,
- 0xcf, 0x78, 0x66, 0x1c, 0x78, 0xb2, 0xcb, 0x33, 0x99, 0x3d, 0x8b, 0xf5, 0xcf, 0x99, 0xb9, 0x44,
- 0xfa, 0x07, 0x79, 0xf5, 0x47, 0xc3, 0x27, 0xeb, 0x2c, 0x5b, 0x6f, 0x99, 0x41, 0x16, 0xc5, 0xea,
- 0x8c, 0xf2, 0xd2, 0x80, 0xc3, 0xc7, 0x92, 0x09, 0x59, 0x65, 0x50, 0x47, 0x23, 0x8f, 0xfe, 0xe9,
- 0x43, 0xef, 0x96, 0x09, 0x41, 0xd7, 0x0c, 0x21, 0x68, 0x73, 0x9a, 0x32, 0x6c, 0x05, 0x56, 0xd8,
- 0x27, 0xfa, 0x8c, 0x9e, 0x83, 0xb3, 0x49, 0xb6, 0x34, 0x4f, 0x64, 0x89, 0x5b, 0x81, 0x15, 0x9e,
- 0x8e, 0x3f, 0x8f, 0xea, 0x96, 0x51, 0x15, 0x1c, 0xfd, 0x5a, 0xa4, 0x59, 0x91, 0x93, 0x03, 0x8d,
- 0x02, 0xf0, 0x36, 0x2c, 0x59, 0x6f, 0x64, 0x9c, 0xf0, 0x78, 0x99, 0x62, 0x3b, 0xb0, 0xc2, 0x13,
- 0x02, 0x46, 0x9b, 0xf0, 0xab, 0x54, 0xf9, 0x3d, 0x50, 0x49, 0x71, 0x3b, 0xb0, 0x42, 0x8f, 0xe8,
- 0x33, 0xfa, 0x12, 0xbc, 0x9c, 0x89, 0x62, 0x2b, 0xe3, 0x65, 0x56, 0x70, 0x89, 0x7b, 0x81, 0x15,
- 0xda, 0xc4, 0x35, 0xda, 0x95, 0x92, 0xd0, 0x57, 0x70, 0x22, 0xf3, 0x82, 0xc5, 0x62, 0x99, 0x49,
- 0x91, 0x52, 0x8e, 0x9d, 0xc0, 0x0a, 0x1d, 0xe2, 0x29, 0x71, 0x5e, 0x69, 0x68, 0x00, 0x1d, 0xb1,
- 0xcc, 0x72, 0x86, 0xfb, 0x81, 0x15, 0xb6, 0x88, 0xb9, 0x20, 0x1f, 0xec, 0x3f, 0x59, 0x89, 0x3b,
- 0x81, 0x1d, 0xb6, 0x89, 0x3a, 0xa2, 0xcf, 0xa0, 0x2f, 0x36, 0x59, 0x2e, 0x63, 0xa5, 0x7f, 0x12,
- 0xd8, 0x61, 0x87, 0x38, 0x5a, 0xb8, 0x66, 0x25, 0xfa, 0x0e, 0xba, 0x9c, 0x09, 0xc9, 0x1e, 0x70,
- 0x37, 0xb0, 0x42, 0x77, 0x3c, 0x38, 0x7e, 0xf5, 0xa9, 0x7e, 0x46, 0x2a, 0x06, 0x9d, 0x43, 0x2f,
- 0x8f, 0x57, 0x05, 0xe7, 0x25, 0xf6, 0x03, 0xfb, 0x83, 0x9d, 0xea, 0xe6, 0xaf, 0x15, 0x8b, 0x5e,
- 0x42, 0x4f, 0xb2, 0x3c, 0xa7, 0x09, 0xc7, 0x10, 0xd8, 0xa1, 0x3b, 0x1e, 0x35, 0x87, 0xdd, 0x19,
- 0xe8, 0x15, 0x97, 0x79, 0x49, 0xf6, 0x21, 0xe8, 0x05, 0x98, 0x0d, 0x18, 0xc7, 0xab, 0x84, 0x6d,
- 0x1f, 0xb0, 0xab, 0x0b, 0xfd, 0x34, 0x7a, 0x3b, 0xed, 0x68, 0x5e, 0x2c, 0x7e, 0x61, 0x2b, 0x5a,
- 0x6c, 0xa5, 0x20, 0xae, 0x81, 0x5f, 0x2b, 0x16, 0x4d, 0x0e, 0xb1, 0x7f, 0xd3, 0x6d, 0xc1, 0xf0,
- 0x89, 0xb6, 0xff, 0xa6, 0xd9, 0x7e, 0xa6, 0xc9, 0xdf, 0x15, 0x68, 0x4a, 0xa8, 0x52, 0x69, 0x05,
- 0x7d, 0x0f, 0x0e, 0xe5, 0xa5, 0xdc, 0x24, 0x7c, 0x8d, 0x4f, 0xab, 0x5e, 0x99, 0x5d, 0x8c, 0xf6,
- 0xbb, 0x18, 0x5d, 0xf0, 0x92, 0x1c, 0x28, 0x74, 0x0e, 0x6e, 0x4a, 0x79, 0x19, 0xeb, 0x9b, 0xc0,
- 0x8f, 0xb4, 0x77, 0x73, 0x10, 0x28, 0xf0, 0x4e, 0x73, 0xe8, 0x1c, 0x40, 0x14, 0x8b, 0xd4, 0x14,
- 0x85, 0x3f, 0xd6, 0x56, 0x8f, 0x1b, 0x2b, 0x26, 0x35, 0x10, 0xfd, 0x00, 0xce, 0x72, 0x93, 0x6c,
- 0x1f, 0x72, 0xc6, 0x31, 0xd2, 0x56, 0xef, 0x09, 0x3a, 0x60, 0xe8, 0x0a, 0x40, 0xc8, 0x3c, 0xe1,
- 0xeb, 0x38, 0xa5, 0x3b, 0x3c, 0xd0, 0x41, 0x5f, 0x37, 0xf7, 0x66, 0xae, 0xb9, 0x5b, 0xba, 0x33,
- 0x9d, 0xe9, 0x8b, 0xfd, 0x7d, 0x38, 0x03, 0xaf, 0x3e, 0xb7, 0xfd, 0x02, 0x9a, 0x2f, 0x4c, 0x2f,
- 0xe0, 0xb7, 0xd0, 0x31, 0xdd, 0x6f, 0xfd, 0xcf, 0x8a, 0x19, 0xe4, 0x45, 0xeb, 0xb9, 0x35, 0xbc,
- 0x07, 0xff, 0xdd, 0x51, 0x34, 0x64, 0x7d, 0x7a, 0x9c, 0xf5, 0xbd, 0xfb, 0x50, 0x4b, 0xfc, 0x12,
- 0x4e, 0x8f, 0xdf, 0xa3, 0x21, 0xed, 0xa0, 0x9e, 0xb6, 0x5f, 0x8b, 0x1e, 0xfd, 0x0c, 0x5d, 0xb3,
- 0xd7, 0xc8, 0x85, 0xde, 0x9b, 0xe9, 0xf5, 0xf4, 0xb7, 0xfb, 0xa9, 0xff, 0x11, 0x72, 0xa0, 0x3d,
- 0x7b, 0x33, 0x9d, 0xfb, 0x16, 0x3a, 0x81, 0xfe, 0xfc, 0xe6, 0x62, 0x36, 0xbf, 0x9b, 0x5c, 0x5d,
- 0xfb, 0x2d, 0xf4, 0x08, 0xdc, 0xcb, 0xc9, 0xcd, 0x4d, 0x7c, 0x79, 0x31, 0xb9, 0x79, 0xf5, 0x87,
- 0x6f, 0x8f, 0xc6, 0xd0, 0x35, 0x2f, 0xab, 0x4c, 0x16, 0xfa, 0x2b, 0x32, 0xc6, 0xe6, 0xa2, 0xfe,
- 0x2c, 0x96, 0x85, 0x34, 0xce, 0x0e, 0xd1, 0xe7, 0xd1, 0xbf, 0x16, 0x9c, 0x56, 0x33, 0xb8, 0x4f,
- 0xe4, 0xe6, 0x96, 0xee, 0xd0, 0x0c, 0xbc, 0x45, 0x29, 0x99, 0x9a, 0xd9, 0x4e, 0x2d, 0xa3, 0xa5,
- 0xe7, 0xf6, 0xb4, 0x71, 0x6e, 0x55, 0x4c, 0x74, 0x59, 0x4a, 0x76, 0x6b, 0xf8, 0x6a, 0xb5, 0x17,
- 0x6f, 0x95, 0xe1, 0x4f, 0xe0, 0xbf, 0x0b, 0xd4, 0x3b, 0xe3, 0x34, 0x74, 0xc6, 0xab, 0x77, 0xe6,
- 0x2f, 0xe8, 0x4e, 0xb8, 0x54, 0xb5, 0x9d, 0x81, 0x9d, 0x4b, 0x59, 0x95, 0xf4, 0xc5, 0x71, 0x49,
- 0x06, 0x89, 0x88, 0x94, 0xa6, 0x04, 0x45, 0x0e, 0x7f, 0x04, 0x67, 0x2f, 0xd4, 0x2d, 0x3b, 0x0d,
- 0x96, 0x9d, 0xba, 0xe5, 0x33, 0xe8, 0x99, 0x7c, 0x02, 0x85, 0xd0, 0x4e, 0xe9, 0x4e, 0x54, 0xa6,
- 0x83, 0x26, 0x53, 0xa2, 0x89, 0x45, 0xd7, 0x3c, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x99, 0x24,
- 0x6b, 0x12, 0x6d, 0x06, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto
deleted file mode 100644
index c81fe1e5..00000000
--- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto
+++ /dev/null
@@ -1,89 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2014 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-import "google/protobuf/any.proto";
-import "test_proto/test.proto";
-
-package proto3_proto;
-
-message Message {
- enum Humour {
- UNKNOWN = 0;
- PUNS = 1;
- SLAPSTICK = 2;
- BILL_BAILEY = 3;
- }
-
- string name = 1;
- Humour hilarity = 2;
- uint32 height_in_cm = 3;
- bytes data = 4;
- int64 result_count = 7;
- bool true_scotsman = 8;
- float score = 9;
-
- repeated uint64 key = 5;
- repeated int32 short_key = 19;
- Nested nested = 6;
- repeated Humour r_funny = 16;
-
- map terrain = 10;
- test_proto.SubDefaults proto2_field = 11;
- map proto2_value = 13;
-
- google.protobuf.Any anything = 14;
- repeated google.protobuf.Any many_things = 15;
-
- Message submessage = 17;
- repeated Message children = 18;
-
- map string_map = 20;
-}
-
-message Nested {
- string bunny = 1;
- bool cute = 2;
-}
-
-message MessageWithMap {
- map byte_mapping = 1;
-}
-
-
-message IntMap {
- map rtt = 1;
-}
-
-message IntMaps {
- repeated IntMap maps = 1;
-}
diff --git a/vendor/github.com/golang/protobuf/proto/proto3_test.go b/vendor/github.com/golang/protobuf/proto/proto3_test.go
deleted file mode 100644
index 73eed6c0..00000000
--- a/vendor/github.com/golang/protobuf/proto/proto3_test.go
+++ /dev/null
@@ -1,151 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2014 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package proto_test
-
-import (
- "bytes"
- "testing"
-
- "github.com/golang/protobuf/proto"
- pb "github.com/golang/protobuf/proto/proto3_proto"
- tpb "github.com/golang/protobuf/proto/test_proto"
-)
-
-func TestProto3ZeroValues(t *testing.T) {
- tests := []struct {
- desc string
- m proto.Message
- }{
- {"zero message", &pb.Message{}},
- {"empty bytes field", &pb.Message{Data: []byte{}}},
- }
- for _, test := range tests {
- b, err := proto.Marshal(test.m)
- if err != nil {
- t.Errorf("%s: proto.Marshal: %v", test.desc, err)
- continue
- }
- if len(b) > 0 {
- t.Errorf("%s: Encoding is non-empty: %q", test.desc, b)
- }
- }
-}
-
-func TestRoundTripProto3(t *testing.T) {
- m := &pb.Message{
- Name: "David", // (2 | 1<<3): 0x0a 0x05 "David"
- Hilarity: pb.Message_PUNS, // (0 | 2<<3): 0x10 0x01
- HeightInCm: 178, // (0 | 3<<3): 0x18 0xb2 0x01
- Data: []byte("roboto"), // (2 | 4<<3): 0x20 0x06 "roboto"
- ResultCount: 47, // (0 | 7<<3): 0x38 0x2f
- TrueScotsman: true, // (0 | 8<<3): 0x40 0x01
- Score: 8.1, // (5 | 9<<3): 0x4d <8.1>
-
- Key: []uint64{1, 0xdeadbeef},
- Nested: &pb.Nested{
- Bunny: "Monty",
- },
- }
- t.Logf(" m: %v", m)
-
- b, err := proto.Marshal(m)
- if err != nil {
- t.Fatalf("proto.Marshal: %v", err)
- }
- t.Logf(" b: %q", b)
-
- m2 := new(pb.Message)
- if err := proto.Unmarshal(b, m2); err != nil {
- t.Fatalf("proto.Unmarshal: %v", err)
- }
- t.Logf("m2: %v", m2)
-
- if !proto.Equal(m, m2) {
- t.Errorf("proto.Equal returned false:\n m: %v\nm2: %v", m, m2)
- }
-}
-
-func TestGettersForBasicTypesExist(t *testing.T) {
- var m pb.Message
- if got := m.GetNested().GetBunny(); got != "" {
- t.Errorf("m.GetNested().GetBunny() = %q, want empty string", got)
- }
- if got := m.GetNested().GetCute(); got {
- t.Errorf("m.GetNested().GetCute() = %t, want false", got)
- }
-}
-
-func TestProto3SetDefaults(t *testing.T) {
- in := &pb.Message{
- Terrain: map[string]*pb.Nested{
- "meadow": new(pb.Nested),
- },
- Proto2Field: new(tpb.SubDefaults),
- Proto2Value: map[string]*tpb.SubDefaults{
- "badlands": new(tpb.SubDefaults),
- },
- }
-
- got := proto.Clone(in).(*pb.Message)
- proto.SetDefaults(got)
-
- // There are no defaults in proto3. Everything should be the zero value, but
- // we need to remember to set defaults for nested proto2 messages.
- want := &pb.Message{
- Terrain: map[string]*pb.Nested{
- "meadow": new(pb.Nested),
- },
- Proto2Field: &tpb.SubDefaults{N: proto.Int64(7)},
- Proto2Value: map[string]*tpb.SubDefaults{
- "badlands": &tpb.SubDefaults{N: proto.Int64(7)},
- },
- }
-
- if !proto.Equal(got, want) {
- t.Errorf("with in = %v\nproto.SetDefaults(in) =>\ngot %v\nwant %v", in, got, want)
- }
-}
-
-func TestUnknownFieldPreservation(t *testing.T) {
- b1 := "\x0a\x05David" // Known tag 1
- b2 := "\xc2\x0c\x06Google" // Unknown tag 200
- b := []byte(b1 + b2)
-
- m := new(pb.Message)
- if err := proto.Unmarshal(b, m); err != nil {
- t.Fatalf("proto.Unmarshal: %v", err)
- }
-
- if !bytes.Equal(m.XXX_unrecognized, []byte(b2)) {
- t.Fatalf("mismatching unknown fields:\ngot %q\nwant %q", m.XXX_unrecognized, b2)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/size2_test.go b/vendor/github.com/golang/protobuf/proto/size2_test.go
deleted file mode 100644
index 7846b061..00000000
--- a/vendor/github.com/golang/protobuf/proto/size2_test.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// 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.
-
-package proto
-
-import (
- "testing"
-)
-
-// This is a separate file and package from size_test.go because that one uses
-// generated messages and thus may not be in package proto without having a circular
-// dependency, whereas this file tests unexported details of size.go.
-
-func TestVarintSize(t *testing.T) {
- // Check the edge cases carefully.
- testCases := []struct {
- n uint64
- size int
- }{
- {0, 1},
- {1, 1},
- {127, 1},
- {128, 2},
- {16383, 2},
- {16384, 3},
- {1<<63 - 1, 9},
- {1 << 63, 10},
- }
- for _, tc := range testCases {
- size := SizeVarint(tc.n)
- if size != tc.size {
- t.Errorf("sizeVarint(%d) = %d, want %d", tc.n, size, tc.size)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/size_test.go b/vendor/github.com/golang/protobuf/proto/size_test.go
deleted file mode 100644
index 3abac418..00000000
--- a/vendor/github.com/golang/protobuf/proto/size_test.go
+++ /dev/null
@@ -1,191 +0,0 @@
-// 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.
-
-package proto_test
-
-import (
- "log"
- "strings"
- "testing"
-
- . "github.com/golang/protobuf/proto"
- proto3pb "github.com/golang/protobuf/proto/proto3_proto"
- pb "github.com/golang/protobuf/proto/test_proto"
-)
-
-var messageWithExtension1 = &pb.MyMessage{Count: Int32(7)}
-
-// messageWithExtension2 is in equal_test.go.
-var messageWithExtension3 = &pb.MyMessage{Count: Int32(8)}
-
-func init() {
- if err := SetExtension(messageWithExtension1, pb.E_Ext_More, &pb.Ext{Data: String("Abbott")}); err != nil {
- log.Panicf("SetExtension: %v", err)
- }
- if err := SetExtension(messageWithExtension3, pb.E_Ext_More, &pb.Ext{Data: String("Costello")}); err != nil {
- log.Panicf("SetExtension: %v", err)
- }
-
- // Force messageWithExtension3 to have the extension encoded.
- Marshal(messageWithExtension3)
-
-}
-
-// non-pointer custom message
-type nonptrMessage struct{}
-
-func (m nonptrMessage) ProtoMessage() {}
-func (m nonptrMessage) Reset() {}
-func (m nonptrMessage) String() string { return "" }
-
-func (m nonptrMessage) Marshal() ([]byte, error) {
- return []byte{42}, nil
-}
-
-// custom message embedding a proto.Message
-type messageWithEmbedding struct {
- *pb.OtherMessage
-}
-
-func (m *messageWithEmbedding) ProtoMessage() {}
-func (m *messageWithEmbedding) Reset() {}
-func (m *messageWithEmbedding) String() string { return "" }
-
-func (m *messageWithEmbedding) Marshal() ([]byte, error) {
- return []byte{42}, nil
-}
-
-var SizeTests = []struct {
- desc string
- pb Message
-}{
- {"empty", &pb.OtherMessage{}},
- // Basic types.
- {"bool", &pb.Defaults{F_Bool: Bool(true)}},
- {"int32", &pb.Defaults{F_Int32: Int32(12)}},
- {"negative int32", &pb.Defaults{F_Int32: Int32(-1)}},
- {"small int64", &pb.Defaults{F_Int64: Int64(1)}},
- {"big int64", &pb.Defaults{F_Int64: Int64(1 << 20)}},
- {"negative int64", &pb.Defaults{F_Int64: Int64(-1)}},
- {"fixed32", &pb.Defaults{F_Fixed32: Uint32(71)}},
- {"fixed64", &pb.Defaults{F_Fixed64: Uint64(72)}},
- {"uint32", &pb.Defaults{F_Uint32: Uint32(123)}},
- {"uint64", &pb.Defaults{F_Uint64: Uint64(124)}},
- {"float", &pb.Defaults{F_Float: Float32(12.6)}},
- {"double", &pb.Defaults{F_Double: Float64(13.9)}},
- {"string", &pb.Defaults{F_String: String("niles")}},
- {"bytes", &pb.Defaults{F_Bytes: []byte("wowsa")}},
- {"bytes, empty", &pb.Defaults{F_Bytes: []byte{}}},
- {"sint32", &pb.Defaults{F_Sint32: Int32(65)}},
- {"sint64", &pb.Defaults{F_Sint64: Int64(67)}},
- {"enum", &pb.Defaults{F_Enum: pb.Defaults_BLUE.Enum()}},
- // Repeated.
- {"empty repeated bool", &pb.MoreRepeated{Bools: []bool{}}},
- {"repeated bool", &pb.MoreRepeated{Bools: []bool{false, true, true, false}}},
- {"packed repeated bool", &pb.MoreRepeated{BoolsPacked: []bool{false, true, true, false, true, true, true}}},
- {"repeated int32", &pb.MoreRepeated{Ints: []int32{1, 12203, 1729, -1}}},
- {"repeated int32 packed", &pb.MoreRepeated{IntsPacked: []int32{1, 12203, 1729}}},
- {"repeated int64 packed", &pb.MoreRepeated{Int64SPacked: []int64{
- // Need enough large numbers to verify that the header is counting the number of bytes
- // for the field, not the number of elements.
- 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62,
- 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62,
- }}},
- {"repeated string", &pb.MoreRepeated{Strings: []string{"r", "ken", "gri"}}},
- {"repeated fixed", &pb.MoreRepeated{Fixeds: []uint32{1, 2, 3, 4}}},
- // Nested.
- {"nested", &pb.OldMessage{Nested: &pb.OldMessage_Nested{Name: String("whatever")}}},
- {"group", &pb.GroupOld{G: &pb.GroupOld_G{X: Int32(12345)}}},
- // Other things.
- {"unrecognized", &pb.MoreRepeated{XXX_unrecognized: []byte{13<<3 | 0, 4}}},
- {"extension (unencoded)", messageWithExtension1},
- {"extension (encoded)", messageWithExtension3},
- // proto3 message
- {"proto3 empty", &proto3pb.Message{}},
- {"proto3 bool", &proto3pb.Message{TrueScotsman: true}},
- {"proto3 int64", &proto3pb.Message{ResultCount: 1}},
- {"proto3 uint32", &proto3pb.Message{HeightInCm: 123}},
- {"proto3 float", &proto3pb.Message{Score: 12.6}},
- {"proto3 string", &proto3pb.Message{Name: "Snezana"}},
- {"proto3 bytes", &proto3pb.Message{Data: []byte("wowsa")}},
- {"proto3 bytes, empty", &proto3pb.Message{Data: []byte{}}},
- {"proto3 enum", &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}},
- {"proto3 map field with empty bytes", &proto3pb.MessageWithMap{ByteMapping: map[bool][]byte{false: []byte{}}}},
-
- {"map field", &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob", 7: "Andrew"}}},
- {"map field with message", &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{0x7001: &pb.FloatingPoint{F: Float64(2.0)}}}},
- {"map field with bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte("this time for sure")}}},
- {"map field with empty bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte{}}}},
-
- {"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.Oneof{}},
- {"oneof bool", &pb.Oneof{Union: &pb.Oneof_F_Bool{true}}},
- {"oneof zero int32", &pb.Oneof{Union: &pb.Oneof_F_Int32{0}}},
- {"oneof big int32", &pb.Oneof{Union: &pb.Oneof_F_Int32{1 << 20}}},
- {"oneof int64", &pb.Oneof{Union: &pb.Oneof_F_Int64{42}}},
- {"oneof fixed32", &pb.Oneof{Union: &pb.Oneof_F_Fixed32{43}}},
- {"oneof fixed64", &pb.Oneof{Union: &pb.Oneof_F_Fixed64{44}}},
- {"oneof uint32", &pb.Oneof{Union: &pb.Oneof_F_Uint32{45}}},
- {"oneof uint64", &pb.Oneof{Union: &pb.Oneof_F_Uint64{46}}},
- {"oneof float", &pb.Oneof{Union: &pb.Oneof_F_Float{47.1}}},
- {"oneof double", &pb.Oneof{Union: &pb.Oneof_F_Double{48.9}}},
- {"oneof string", &pb.Oneof{Union: &pb.Oneof_F_String{"Rhythmic Fman"}}},
- {"oneof bytes", &pb.Oneof{Union: &pb.Oneof_F_Bytes{[]byte("let go")}}},
- {"oneof sint32", &pb.Oneof{Union: &pb.Oneof_F_Sint32{50}}},
- {"oneof sint64", &pb.Oneof{Union: &pb.Oneof_F_Sint64{51}}},
- {"oneof enum", &pb.Oneof{Union: &pb.Oneof_F_Enum{pb.MyMessage_BLUE}}},
- {"message for oneof", &pb.GoTestField{Label: String("k"), Type: String("v")}},
- {"oneof message", &pb.Oneof{Union: &pb.Oneof_F_Message{&pb.GoTestField{Label: String("k"), Type: String("v")}}}},
- {"oneof group", &pb.Oneof{Union: &pb.Oneof_FGroup{&pb.Oneof_F_Group{X: Int32(52)}}}},
- {"oneof largest tag", &pb.Oneof{Union: &pb.Oneof_F_Largest_Tag{1}}},
- {"multiple oneofs", &pb.Oneof{Union: &pb.Oneof_F_Int32{1}, Tormato: &pb.Oneof_Value{2}}},
-
- {"non-pointer message", nonptrMessage{}},
- {"custom message with embedding", &messageWithEmbedding{&pb.OtherMessage{}}},
-}
-
-func TestSize(t *testing.T) {
- for _, tc := range SizeTests {
- size := Size(tc.pb)
- b, err := Marshal(tc.pb)
- if err != nil {
- t.Errorf("%v: Marshal failed: %v", tc.desc, err)
- continue
- }
- if size != len(b) {
- t.Errorf("%v: Size(%v) = %d, want %d", tc.desc, tc.pb, size, len(b))
- t.Logf("%v: bytes: %#v", tc.desc, b)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go b/vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go
deleted file mode 100644
index 049b5dd2..00000000
--- a/vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go
+++ /dev/null
@@ -1,5118 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: test_proto/test.proto
-
-package test_proto // import "github.com/golang/protobuf/proto/test_proto"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-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
-}
-func (FOO) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{0}
-}
-
-// 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
-}
-func (GoTest_KIND) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{2, 0}
-}
-
-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
-}
-func (MyMessage_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{13, 0}
-}
-
-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
-}
-func (DefaultsMessage_DefaultsEnum) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{16, 0}
-}
-
-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
-}
-func (Defaults_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{21, 0}
-}
-
-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
-}
-func (RepeatedEnum_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{23, 0}
-}
-
-type GoEnum struct {
- Foo *FOO `protobuf:"varint,1,req,name=foo,enum=test_proto.FOO" json:"foo,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoEnum) Reset() { *m = GoEnum{} }
-func (m *GoEnum) String() string { return proto.CompactTextString(m) }
-func (*GoEnum) ProtoMessage() {}
-func (*GoEnum) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{0}
-}
-func (m *GoEnum) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoEnum.Unmarshal(m, b)
-}
-func (m *GoEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoEnum.Marshal(b, m, deterministic)
-}
-func (dst *GoEnum) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoEnum.Merge(dst, src)
-}
-func (m *GoEnum) XXX_Size() int {
- return xxx_messageInfo_GoEnum.Size(m)
-}
-func (m *GoEnum) XXX_DiscardUnknown() {
- xxx_messageInfo_GoEnum.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoEnum proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTestField) Reset() { *m = GoTestField{} }
-func (m *GoTestField) String() string { return proto.CompactTextString(m) }
-func (*GoTestField) ProtoMessage() {}
-func (*GoTestField) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{1}
-}
-func (m *GoTestField) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTestField.Unmarshal(m, b)
-}
-func (m *GoTestField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTestField.Marshal(b, m, deterministic)
-}
-func (dst *GoTestField) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTestField.Merge(dst, src)
-}
-func (m *GoTestField) XXX_Size() int {
- return xxx_messageInfo_GoTestField.Size(m)
-}
-func (m *GoTestField) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTestField.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTestField proto.InternalMessageInfo
-
-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=test_proto.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=FBoolRequired" json:"F_Bool_required,omitempty"`
- F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required,json=FInt32Required" json:"F_Int32_required,omitempty"`
- F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required,json=FInt64Required" json:"F_Int64_required,omitempty"`
- F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required,json=FFixed32Required" json:"F_Fixed32_required,omitempty"`
- F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required,json=FFixed64Required" json:"F_Fixed64_required,omitempty"`
- F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required,json=FUint32Required" json:"F_Uint32_required,omitempty"`
- F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required,json=FUint64Required" json:"F_Uint64_required,omitempty"`
- F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required,json=FFloatRequired" json:"F_Float_required,omitempty"`
- F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required,json=FDoubleRequired" json:"F_Double_required,omitempty"`
- F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required,json=FStringRequired" json:"F_String_required,omitempty"`
- F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required,json=FBytesRequired" json:"F_Bytes_required,omitempty"`
- F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required,json=FSint32Required" json:"F_Sint32_required,omitempty"`
- F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required,json=FSint64Required" json:"F_Sint64_required,omitempty"`
- F_Sfixed32Required *int32 `protobuf:"fixed32,104,req,name=F_Sfixed32_required,json=FSfixed32Required" json:"F_Sfixed32_required,omitempty"`
- F_Sfixed64Required *int64 `protobuf:"fixed64,105,req,name=F_Sfixed64_required,json=FSfixed64Required" json:"F_Sfixed64_required,omitempty"`
- // Repeated fields of all basic types
- F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated,json=FBoolRepeated" json:"F_Bool_repeated,omitempty"`
- F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated,json=FInt32Repeated" json:"F_Int32_repeated,omitempty"`
- F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated,json=FInt64Repeated" json:"F_Int64_repeated,omitempty"`
- F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated,json=FFixed32Repeated" json:"F_Fixed32_repeated,omitempty"`
- F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated,json=FFixed64Repeated" json:"F_Fixed64_repeated,omitempty"`
- F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated,json=FUint32Repeated" json:"F_Uint32_repeated,omitempty"`
- F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated,json=FUint64Repeated" json:"F_Uint64_repeated,omitempty"`
- F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated,json=FFloatRepeated" json:"F_Float_repeated,omitempty"`
- F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated,json=FDoubleRepeated" json:"F_Double_repeated,omitempty"`
- F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated,json=FStringRepeated" json:"F_String_repeated,omitempty"`
- F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated,json=FBytesRepeated" json:"F_Bytes_repeated,omitempty"`
- F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated,json=FSint32Repeated" json:"F_Sint32_repeated,omitempty"`
- F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated,json=FSint64Repeated" json:"F_Sint64_repeated,omitempty"`
- F_Sfixed32Repeated []int32 `protobuf:"fixed32,204,rep,name=F_Sfixed32_repeated,json=FSfixed32Repeated" json:"F_Sfixed32_repeated,omitempty"`
- F_Sfixed64Repeated []int64 `protobuf:"fixed64,205,rep,name=F_Sfixed64_repeated,json=FSfixed64Repeated" json:"F_Sfixed64_repeated,omitempty"`
- // Optional fields of all basic types
- F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional,json=FBoolOptional" json:"F_Bool_optional,omitempty"`
- F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional,json=FInt32Optional" json:"F_Int32_optional,omitempty"`
- F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional,json=FInt64Optional" json:"F_Int64_optional,omitempty"`
- F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional,json=FFixed32Optional" json:"F_Fixed32_optional,omitempty"`
- F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional,json=FFixed64Optional" json:"F_Fixed64_optional,omitempty"`
- F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional,json=FUint32Optional" json:"F_Uint32_optional,omitempty"`
- F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional,json=FUint64Optional" json:"F_Uint64_optional,omitempty"`
- F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional,json=FFloatOptional" json:"F_Float_optional,omitempty"`
- F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional,json=FDoubleOptional" json:"F_Double_optional,omitempty"`
- F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional,json=FStringOptional" json:"F_String_optional,omitempty"`
- F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional,json=FBytesOptional" json:"F_Bytes_optional,omitempty"`
- F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional,json=FSint32Optional" json:"F_Sint32_optional,omitempty"`
- F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional,json=FSint64Optional" json:"F_Sint64_optional,omitempty"`
- F_Sfixed32Optional *int32 `protobuf:"fixed32,304,opt,name=F_Sfixed32_optional,json=FSfixed32Optional" json:"F_Sfixed32_optional,omitempty"`
- F_Sfixed64Optional *int64 `protobuf:"fixed64,305,opt,name=F_Sfixed64_optional,json=FSfixed64Optional" json:"F_Sfixed64_optional,omitempty"`
- // Default-valued fields of all basic types
- F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,json=FBoolDefaulted,def=1" json:"F_Bool_defaulted,omitempty"`
- F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,json=FInt32Defaulted,def=32" json:"F_Int32_defaulted,omitempty"`
- F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,json=FInt64Defaulted,def=64" json:"F_Int64_defaulted,omitempty"`
- F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,json=FFixed32Defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"`
- F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,json=FFixed64Defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"`
- F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,json=FUint32Defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"`
- F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,json=FUint64Defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"`
- F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,json=FFloatDefaulted,def=314159" json:"F_Float_defaulted,omitempty"`
- F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,json=FDoubleDefaulted,def=271828" json:"F_Double_defaulted,omitempty"`
- F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,json=FStringDefaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"`
- F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,json=FBytesDefaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"`
- F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,json=FSint32Defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"`
- F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,json=FSint64Defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"`
- F_Sfixed32Defaulted *int32 `protobuf:"fixed32,404,opt,name=F_Sfixed32_defaulted,json=FSfixed32Defaulted,def=-32" json:"F_Sfixed32_defaulted,omitempty"`
- F_Sfixed64Defaulted *int64 `protobuf:"fixed64,405,opt,name=F_Sfixed64_defaulted,json=FSfixed64Defaulted,def=-64" json:"F_Sfixed64_defaulted,omitempty"`
- // Packed repeated fields (no string or bytes).
- F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed,json=FBoolRepeatedPacked" json:"F_Bool_repeated_packed,omitempty"`
- F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed,json=FInt32RepeatedPacked" json:"F_Int32_repeated_packed,omitempty"`
- F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed,json=FInt64RepeatedPacked" json:"F_Int64_repeated_packed,omitempty"`
- F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed,json=FFixed32RepeatedPacked" json:"F_Fixed32_repeated_packed,omitempty"`
- F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed,json=FFixed64RepeatedPacked" json:"F_Fixed64_repeated_packed,omitempty"`
- F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed,json=FUint32RepeatedPacked" json:"F_Uint32_repeated_packed,omitempty"`
- F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed,json=FUint64RepeatedPacked" json:"F_Uint64_repeated_packed,omitempty"`
- F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed,json=FFloatRepeatedPacked" json:"F_Float_repeated_packed,omitempty"`
- F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed,json=FDoubleRepeatedPacked" json:"F_Double_repeated_packed,omitempty"`
- F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed,json=FSint32RepeatedPacked" json:"F_Sint32_repeated_packed,omitempty"`
- F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed,json=FSint64RepeatedPacked" json:"F_Sint64_repeated_packed,omitempty"`
- F_Sfixed32RepeatedPacked []int32 `protobuf:"fixed32,504,rep,packed,name=F_Sfixed32_repeated_packed,json=FSfixed32RepeatedPacked" json:"F_Sfixed32_repeated_packed,omitempty"`
- F_Sfixed64RepeatedPacked []int64 `protobuf:"fixed64,505,rep,packed,name=F_Sfixed64_repeated_packed,json=FSfixed64RepeatedPacked" json:"F_Sfixed64_repeated_packed,omitempty"`
- Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup,json=requiredgroup" json:"requiredgroup,omitempty"`
- Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup,json=repeatedgroup" json:"repeatedgroup,omitempty"`
- Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup,json=optionalgroup" json:"optionalgroup,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTest) Reset() { *m = GoTest{} }
-func (m *GoTest) String() string { return proto.CompactTextString(m) }
-func (*GoTest) ProtoMessage() {}
-func (*GoTest) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{2}
-}
-func (m *GoTest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTest.Unmarshal(m, b)
-}
-func (m *GoTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTest.Marshal(b, m, deterministic)
-}
-func (dst *GoTest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTest.Merge(dst, src)
-}
-func (m *GoTest) XXX_Size() int {
- return xxx_messageInfo_GoTest.Size(m)
-}
-func (m *GoTest) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTest proto.InternalMessageInfo
-
-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
-const Default_GoTest_F_Sfixed32Defaulted int32 = -32
-const Default_GoTest_F_Sfixed64Defaulted 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_Sfixed32Required() int32 {
- if m != nil && m.F_Sfixed32Required != nil {
- return *m.F_Sfixed32Required
- }
- return 0
-}
-
-func (m *GoTest) GetF_Sfixed64Required() int64 {
- if m != nil && m.F_Sfixed64Required != nil {
- return *m.F_Sfixed64Required
- }
- 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_Sfixed32Repeated() []int32 {
- if m != nil {
- return m.F_Sfixed32Repeated
- }
- return nil
-}
-
-func (m *GoTest) GetF_Sfixed64Repeated() []int64 {
- if m != nil {
- return m.F_Sfixed64Repeated
- }
- 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_Sfixed32Optional() int32 {
- if m != nil && m.F_Sfixed32Optional != nil {
- return *m.F_Sfixed32Optional
- }
- return 0
-}
-
-func (m *GoTest) GetF_Sfixed64Optional() int64 {
- if m != nil && m.F_Sfixed64Optional != nil {
- return *m.F_Sfixed64Optional
- }
- 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_Sfixed32Defaulted() int32 {
- if m != nil && m.F_Sfixed32Defaulted != nil {
- return *m.F_Sfixed32Defaulted
- }
- return Default_GoTest_F_Sfixed32Defaulted
-}
-
-func (m *GoTest) GetF_Sfixed64Defaulted() int64 {
- if m != nil && m.F_Sfixed64Defaulted != nil {
- return *m.F_Sfixed64Defaulted
- }
- return Default_GoTest_F_Sfixed64Defaulted
-}
-
-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) GetF_Sfixed32RepeatedPacked() []int32 {
- if m != nil {
- return m.F_Sfixed32RepeatedPacked
- }
- return nil
-}
-
-func (m *GoTest) GetF_Sfixed64RepeatedPacked() []int64 {
- if m != nil {
- return m.F_Sfixed64RepeatedPacked
- }
- 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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTest_RequiredGroup) Reset() { *m = GoTest_RequiredGroup{} }
-func (m *GoTest_RequiredGroup) String() string { return proto.CompactTextString(m) }
-func (*GoTest_RequiredGroup) ProtoMessage() {}
-func (*GoTest_RequiredGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{2, 0}
-}
-func (m *GoTest_RequiredGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTest_RequiredGroup.Unmarshal(m, b)
-}
-func (m *GoTest_RequiredGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTest_RequiredGroup.Marshal(b, m, deterministic)
-}
-func (dst *GoTest_RequiredGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTest_RequiredGroup.Merge(dst, src)
-}
-func (m *GoTest_RequiredGroup) XXX_Size() int {
- return xxx_messageInfo_GoTest_RequiredGroup.Size(m)
-}
-func (m *GoTest_RequiredGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTest_RequiredGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTest_RequiredGroup proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTest_RepeatedGroup) Reset() { *m = GoTest_RepeatedGroup{} }
-func (m *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(m) }
-func (*GoTest_RepeatedGroup) ProtoMessage() {}
-func (*GoTest_RepeatedGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{2, 1}
-}
-func (m *GoTest_RepeatedGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTest_RepeatedGroup.Unmarshal(m, b)
-}
-func (m *GoTest_RepeatedGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTest_RepeatedGroup.Marshal(b, m, deterministic)
-}
-func (dst *GoTest_RepeatedGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTest_RepeatedGroup.Merge(dst, src)
-}
-func (m *GoTest_RepeatedGroup) XXX_Size() int {
- return xxx_messageInfo_GoTest_RepeatedGroup.Size(m)
-}
-func (m *GoTest_RepeatedGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTest_RepeatedGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTest_RepeatedGroup proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTest_OptionalGroup) Reset() { *m = GoTest_OptionalGroup{} }
-func (m *GoTest_OptionalGroup) String() string { return proto.CompactTextString(m) }
-func (*GoTest_OptionalGroup) ProtoMessage() {}
-func (*GoTest_OptionalGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{2, 2}
-}
-func (m *GoTest_OptionalGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTest_OptionalGroup.Unmarshal(m, b)
-}
-func (m *GoTest_OptionalGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTest_OptionalGroup.Marshal(b, m, deterministic)
-}
-func (dst *GoTest_OptionalGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTest_OptionalGroup.Merge(dst, src)
-}
-func (m *GoTest_OptionalGroup) XXX_Size() int {
- return xxx_messageInfo_GoTest_OptionalGroup.Size(m)
-}
-func (m *GoTest_OptionalGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTest_OptionalGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTest_OptionalGroup proto.InternalMessageInfo
-
-func (m *GoTest_OptionalGroup) GetRequiredField() string {
- if m != nil && m.RequiredField != nil {
- return *m.RequiredField
- }
- return ""
-}
-
-// For testing a group containing a required field.
-type GoTestRequiredGroupField struct {
- Group *GoTestRequiredGroupField_Group `protobuf:"group,1,req,name=Group,json=group" json:"group,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTestRequiredGroupField) Reset() { *m = GoTestRequiredGroupField{} }
-func (m *GoTestRequiredGroupField) String() string { return proto.CompactTextString(m) }
-func (*GoTestRequiredGroupField) ProtoMessage() {}
-func (*GoTestRequiredGroupField) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{3}
-}
-func (m *GoTestRequiredGroupField) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTestRequiredGroupField.Unmarshal(m, b)
-}
-func (m *GoTestRequiredGroupField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTestRequiredGroupField.Marshal(b, m, deterministic)
-}
-func (dst *GoTestRequiredGroupField) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTestRequiredGroupField.Merge(dst, src)
-}
-func (m *GoTestRequiredGroupField) XXX_Size() int {
- return xxx_messageInfo_GoTestRequiredGroupField.Size(m)
-}
-func (m *GoTestRequiredGroupField) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTestRequiredGroupField.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTestRequiredGroupField proto.InternalMessageInfo
-
-func (m *GoTestRequiredGroupField) GetGroup() *GoTestRequiredGroupField_Group {
- if m != nil {
- return m.Group
- }
- return nil
-}
-
-type GoTestRequiredGroupField_Group struct {
- Field *int32 `protobuf:"varint,2,req,name=Field" json:"Field,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoTestRequiredGroupField_Group) Reset() { *m = GoTestRequiredGroupField_Group{} }
-func (m *GoTestRequiredGroupField_Group) String() string { return proto.CompactTextString(m) }
-func (*GoTestRequiredGroupField_Group) ProtoMessage() {}
-func (*GoTestRequiredGroupField_Group) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{3, 0}
-}
-func (m *GoTestRequiredGroupField_Group) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoTestRequiredGroupField_Group.Unmarshal(m, b)
-}
-func (m *GoTestRequiredGroupField_Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoTestRequiredGroupField_Group.Marshal(b, m, deterministic)
-}
-func (dst *GoTestRequiredGroupField_Group) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoTestRequiredGroupField_Group.Merge(dst, src)
-}
-func (m *GoTestRequiredGroupField_Group) XXX_Size() int {
- return xxx_messageInfo_GoTestRequiredGroupField_Group.Size(m)
-}
-func (m *GoTestRequiredGroupField_Group) XXX_DiscardUnknown() {
- xxx_messageInfo_GoTestRequiredGroupField_Group.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoTestRequiredGroupField_Group proto.InternalMessageInfo
-
-func (m *GoTestRequiredGroupField_Group) GetField() int32 {
- if m != nil && m.Field != nil {
- return *m.Field
- }
- return 0
-}
-
-// 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=skipInt32" json:"skip_int32,omitempty"`
- SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32,json=skipFixed32" json:"skip_fixed32,omitempty"`
- SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64,json=skipFixed64" json:"skip_fixed64,omitempty"`
- SkipString *string `protobuf:"bytes,14,req,name=skip_string,json=skipString" json:"skip_string,omitempty"`
- Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup,json=skipgroup" json:"skipgroup,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoSkipTest) Reset() { *m = GoSkipTest{} }
-func (m *GoSkipTest) String() string { return proto.CompactTextString(m) }
-func (*GoSkipTest) ProtoMessage() {}
-func (*GoSkipTest) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{4}
-}
-func (m *GoSkipTest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoSkipTest.Unmarshal(m, b)
-}
-func (m *GoSkipTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoSkipTest.Marshal(b, m, deterministic)
-}
-func (dst *GoSkipTest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoSkipTest.Merge(dst, src)
-}
-func (m *GoSkipTest) XXX_Size() int {
- return xxx_messageInfo_GoSkipTest.Size(m)
-}
-func (m *GoSkipTest) XXX_DiscardUnknown() {
- xxx_messageInfo_GoSkipTest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoSkipTest proto.InternalMessageInfo
-
-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=groupInt32" json:"group_int32,omitempty"`
- GroupString *string `protobuf:"bytes,17,req,name=group_string,json=groupString" json:"group_string,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GoSkipTest_SkipGroup) Reset() { *m = GoSkipTest_SkipGroup{} }
-func (m *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(m) }
-func (*GoSkipTest_SkipGroup) ProtoMessage() {}
-func (*GoSkipTest_SkipGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{4, 0}
-}
-func (m *GoSkipTest_SkipGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GoSkipTest_SkipGroup.Unmarshal(m, b)
-}
-func (m *GoSkipTest_SkipGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GoSkipTest_SkipGroup.Marshal(b, m, deterministic)
-}
-func (dst *GoSkipTest_SkipGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GoSkipTest_SkipGroup.Merge(dst, src)
-}
-func (m *GoSkipTest_SkipGroup) XXX_Size() int {
- return xxx_messageInfo_GoSkipTest_SkipGroup.Size(m)
-}
-func (m *GoSkipTest_SkipGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_GoSkipTest_SkipGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GoSkipTest_SkipGroup proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NonPackedTest) Reset() { *m = NonPackedTest{} }
-func (m *NonPackedTest) String() string { return proto.CompactTextString(m) }
-func (*NonPackedTest) ProtoMessage() {}
-func (*NonPackedTest) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{5}
-}
-func (m *NonPackedTest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NonPackedTest.Unmarshal(m, b)
-}
-func (m *NonPackedTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NonPackedTest.Marshal(b, m, deterministic)
-}
-func (dst *NonPackedTest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NonPackedTest.Merge(dst, src)
-}
-func (m *NonPackedTest) XXX_Size() int {
- return xxx_messageInfo_NonPackedTest.Size(m)
-}
-func (m *NonPackedTest) XXX_DiscardUnknown() {
- xxx_messageInfo_NonPackedTest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NonPackedTest proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PackedTest) Reset() { *m = PackedTest{} }
-func (m *PackedTest) String() string { return proto.CompactTextString(m) }
-func (*PackedTest) ProtoMessage() {}
-func (*PackedTest) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{6}
-}
-func (m *PackedTest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_PackedTest.Unmarshal(m, b)
-}
-func (m *PackedTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_PackedTest.Marshal(b, m, deterministic)
-}
-func (dst *PackedTest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PackedTest.Merge(dst, src)
-}
-func (m *PackedTest) XXX_Size() int {
- return xxx_messageInfo_PackedTest.Size(m)
-}
-func (m *PackedTest) XXX_DiscardUnknown() {
- xxx_messageInfo_PackedTest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PackedTest proto.InternalMessageInfo
-
-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=lastField" json:"last_field,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MaxTag) Reset() { *m = MaxTag{} }
-func (m *MaxTag) String() string { return proto.CompactTextString(m) }
-func (*MaxTag) ProtoMessage() {}
-func (*MaxTag) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{7}
-}
-func (m *MaxTag) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MaxTag.Unmarshal(m, b)
-}
-func (m *MaxTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MaxTag.Marshal(b, m, deterministic)
-}
-func (dst *MaxTag) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MaxTag.Merge(dst, src)
-}
-func (m *MaxTag) XXX_Size() int {
- return xxx_messageInfo_MaxTag.Size(m)
-}
-func (m *MaxTag) XXX_DiscardUnknown() {
- xxx_messageInfo_MaxTag.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MaxTag proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OldMessage) Reset() { *m = OldMessage{} }
-func (m *OldMessage) String() string { return proto.CompactTextString(m) }
-func (*OldMessage) ProtoMessage() {}
-func (*OldMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{8}
-}
-func (m *OldMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OldMessage.Unmarshal(m, b)
-}
-func (m *OldMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OldMessage.Marshal(b, m, deterministic)
-}
-func (dst *OldMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OldMessage.Merge(dst, src)
-}
-func (m *OldMessage) XXX_Size() int {
- return xxx_messageInfo_OldMessage.Size(m)
-}
-func (m *OldMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_OldMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OldMessage proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OldMessage_Nested) Reset() { *m = OldMessage_Nested{} }
-func (m *OldMessage_Nested) String() string { return proto.CompactTextString(m) }
-func (*OldMessage_Nested) ProtoMessage() {}
-func (*OldMessage_Nested) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{8, 0}
-}
-func (m *OldMessage_Nested) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OldMessage_Nested.Unmarshal(m, b)
-}
-func (m *OldMessage_Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OldMessage_Nested.Marshal(b, m, deterministic)
-}
-func (dst *OldMessage_Nested) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OldMessage_Nested.Merge(dst, src)
-}
-func (m *OldMessage_Nested) XXX_Size() int {
- return xxx_messageInfo_OldMessage_Nested.Size(m)
-}
-func (m *OldMessage_Nested) XXX_DiscardUnknown() {
- xxx_messageInfo_OldMessage_Nested.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OldMessage_Nested proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NewMessage) Reset() { *m = NewMessage{} }
-func (m *NewMessage) String() string { return proto.CompactTextString(m) }
-func (*NewMessage) ProtoMessage() {}
-func (*NewMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{9}
-}
-func (m *NewMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NewMessage.Unmarshal(m, b)
-}
-func (m *NewMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NewMessage.Marshal(b, m, deterministic)
-}
-func (dst *NewMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NewMessage.Merge(dst, src)
-}
-func (m *NewMessage) XXX_Size() int {
- return xxx_messageInfo_NewMessage.Size(m)
-}
-func (m *NewMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_NewMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NewMessage proto.InternalMessageInfo
-
-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=foodGroup" json:"food_group,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NewMessage_Nested) Reset() { *m = NewMessage_Nested{} }
-func (m *NewMessage_Nested) String() string { return proto.CompactTextString(m) }
-func (*NewMessage_Nested) ProtoMessage() {}
-func (*NewMessage_Nested) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{9, 0}
-}
-func (m *NewMessage_Nested) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NewMessage_Nested.Unmarshal(m, b)
-}
-func (m *NewMessage_Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NewMessage_Nested.Marshal(b, m, deterministic)
-}
-func (dst *NewMessage_Nested) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NewMessage_Nested.Merge(dst, src)
-}
-func (m *NewMessage_Nested) XXX_Size() int {
- return xxx_messageInfo_NewMessage_Nested.Size(m)
-}
-func (m *NewMessage_Nested) XXX_DiscardUnknown() {
- xxx_messageInfo_NewMessage_Nested.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NewMessage_Nested proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *InnerMessage) Reset() { *m = InnerMessage{} }
-func (m *InnerMessage) String() string { return proto.CompactTextString(m) }
-func (*InnerMessage) ProtoMessage() {}
-func (*InnerMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{10}
-}
-func (m *InnerMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_InnerMessage.Unmarshal(m, b)
-}
-func (m *InnerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_InnerMessage.Marshal(b, m, deterministic)
-}
-func (dst *InnerMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_InnerMessage.Merge(dst, src)
-}
-func (m *InnerMessage) XXX_Size() int {
- return xxx_messageInfo_InnerMessage.Size(m)
-}
-func (m *InnerMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_InnerMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_InnerMessage proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OtherMessage) Reset() { *m = OtherMessage{} }
-func (m *OtherMessage) String() string { return proto.CompactTextString(m) }
-func (*OtherMessage) ProtoMessage() {}
-func (*OtherMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{11}
-}
-
-var extRange_OtherMessage = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*OtherMessage) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_OtherMessage
-}
-func (m *OtherMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OtherMessage.Unmarshal(m, b)
-}
-func (m *OtherMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OtherMessage.Marshal(b, m, deterministic)
-}
-func (dst *OtherMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OtherMessage.Merge(dst, src)
-}
-func (m *OtherMessage) XXX_Size() int {
- return xxx_messageInfo_OtherMessage.Size(m)
-}
-func (m *OtherMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_OtherMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OtherMessage proto.InternalMessageInfo
-
-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 RequiredInnerMessage struct {
- LeoFinallyWonAnOscar *InnerMessage `protobuf:"bytes,1,req,name=leo_finally_won_an_oscar,json=leoFinallyWonAnOscar" json:"leo_finally_won_an_oscar,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RequiredInnerMessage) Reset() { *m = RequiredInnerMessage{} }
-func (m *RequiredInnerMessage) String() string { return proto.CompactTextString(m) }
-func (*RequiredInnerMessage) ProtoMessage() {}
-func (*RequiredInnerMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{12}
-}
-func (m *RequiredInnerMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RequiredInnerMessage.Unmarshal(m, b)
-}
-func (m *RequiredInnerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RequiredInnerMessage.Marshal(b, m, deterministic)
-}
-func (dst *RequiredInnerMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RequiredInnerMessage.Merge(dst, src)
-}
-func (m *RequiredInnerMessage) XXX_Size() int {
- return xxx_messageInfo_RequiredInnerMessage.Size(m)
-}
-func (m *RequiredInnerMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_RequiredInnerMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RequiredInnerMessage proto.InternalMessageInfo
-
-func (m *RequiredInnerMessage) GetLeoFinallyWonAnOscar() *InnerMessage {
- if m != nil {
- return m.LeoFinallyWonAnOscar
- }
- 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"`
- WeMustGoDeeper *RequiredInnerMessage `protobuf:"bytes,13,opt,name=we_must_go_deeper,json=weMustGoDeeper" json:"we_must_go_deeper,omitempty"`
- RepInner []*InnerMessage `protobuf:"bytes,12,rep,name=rep_inner,json=repInner" json:"rep_inner,omitempty"`
- Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=test_proto.MyMessage_Color" json:"bikeshed,omitempty"`
- Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup,json=somegroup" json:"somegroup,omitempty"`
- // This field becomes [][]byte in the generated code.
- RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes,json=repBytes" json:"rep_bytes,omitempty"`
- Bigfloat *float64 `protobuf:"fixed64,11,opt,name=bigfloat" json:"bigfloat,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MyMessage) Reset() { *m = MyMessage{} }
-func (m *MyMessage) String() string { return proto.CompactTextString(m) }
-func (*MyMessage) ProtoMessage() {}
-func (*MyMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{13}
-}
-
-var extRange_MyMessage = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_MyMessage
-}
-func (m *MyMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MyMessage.Unmarshal(m, b)
-}
-func (m *MyMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MyMessage.Marshal(b, m, deterministic)
-}
-func (dst *MyMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MyMessage.Merge(dst, src)
-}
-func (m *MyMessage) XXX_Size() int {
- return xxx_messageInfo_MyMessage.Size(m)
-}
-func (m *MyMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_MyMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MyMessage proto.InternalMessageInfo
-
-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) GetWeMustGoDeeper() *RequiredInnerMessage {
- if m != nil {
- return m.WeMustGoDeeper
- }
- 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=groupField" json:"group_field,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MyMessage_SomeGroup) Reset() { *m = MyMessage_SomeGroup{} }
-func (m *MyMessage_SomeGroup) String() string { return proto.CompactTextString(m) }
-func (*MyMessage_SomeGroup) ProtoMessage() {}
-func (*MyMessage_SomeGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{13, 0}
-}
-func (m *MyMessage_SomeGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MyMessage_SomeGroup.Unmarshal(m, b)
-}
-func (m *MyMessage_SomeGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MyMessage_SomeGroup.Marshal(b, m, deterministic)
-}
-func (dst *MyMessage_SomeGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MyMessage_SomeGroup.Merge(dst, src)
-}
-func (m *MyMessage_SomeGroup) XXX_Size() int {
- return xxx_messageInfo_MyMessage_SomeGroup.Size(m)
-}
-func (m *MyMessage_SomeGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_MyMessage_SomeGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MyMessage_SomeGroup proto.InternalMessageInfo
-
-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"`
- MapField map[int32]int32 `protobuf:"bytes,2,rep,name=map_field,json=mapField" json:"map_field,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Ext) Reset() { *m = Ext{} }
-func (m *Ext) String() string { return proto.CompactTextString(m) }
-func (*Ext) ProtoMessage() {}
-func (*Ext) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{14}
-}
-func (m *Ext) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Ext.Unmarshal(m, b)
-}
-func (m *Ext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Ext.Marshal(b, m, deterministic)
-}
-func (dst *Ext) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Ext.Merge(dst, src)
-}
-func (m *Ext) XXX_Size() int {
- return xxx_messageInfo_Ext.Size(m)
-}
-func (m *Ext) XXX_DiscardUnknown() {
- xxx_messageInfo_Ext.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Ext proto.InternalMessageInfo
-
-func (m *Ext) GetData() string {
- if m != nil && m.Data != nil {
- return *m.Data
- }
- return ""
-}
-
-func (m *Ext) GetMapField() map[int32]int32 {
- if m != nil {
- return m.MapField
- }
- return nil
-}
-
-var E_Ext_More = &proto.ExtensionDesc{
- ExtendedType: (*MyMessage)(nil),
- ExtensionType: (*Ext)(nil),
- Field: 103,
- Name: "test_proto.Ext.more",
- Tag: "bytes,103,opt,name=more",
- Filename: "test_proto/test.proto",
-}
-
-var E_Ext_Text = &proto.ExtensionDesc{
- ExtendedType: (*MyMessage)(nil),
- ExtensionType: (*string)(nil),
- Field: 104,
- Name: "test_proto.Ext.text",
- Tag: "bytes,104,opt,name=text",
- Filename: "test_proto/test.proto",
-}
-
-var E_Ext_Number = &proto.ExtensionDesc{
- ExtendedType: (*MyMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 105,
- Name: "test_proto.Ext.number",
- Tag: "varint,105,opt,name=number",
- Filename: "test_proto/test.proto",
-}
-
-type ComplexExtension struct {
- First *int32 `protobuf:"varint,1,opt,name=first" json:"first,omitempty"`
- Second *int32 `protobuf:"varint,2,opt,name=second" json:"second,omitempty"`
- Third []int32 `protobuf:"varint,3,rep,name=third" json:"third,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ComplexExtension) Reset() { *m = ComplexExtension{} }
-func (m *ComplexExtension) String() string { return proto.CompactTextString(m) }
-func (*ComplexExtension) ProtoMessage() {}
-func (*ComplexExtension) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{15}
-}
-func (m *ComplexExtension) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ComplexExtension.Unmarshal(m, b)
-}
-func (m *ComplexExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ComplexExtension.Marshal(b, m, deterministic)
-}
-func (dst *ComplexExtension) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ComplexExtension.Merge(dst, src)
-}
-func (m *ComplexExtension) XXX_Size() int {
- return xxx_messageInfo_ComplexExtension.Size(m)
-}
-func (m *ComplexExtension) XXX_DiscardUnknown() {
- xxx_messageInfo_ComplexExtension.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ComplexExtension proto.InternalMessageInfo
-
-func (m *ComplexExtension) GetFirst() int32 {
- if m != nil && m.First != nil {
- return *m.First
- }
- return 0
-}
-
-func (m *ComplexExtension) GetSecond() int32 {
- if m != nil && m.Second != nil {
- return *m.Second
- }
- return 0
-}
-
-func (m *ComplexExtension) GetThird() []int32 {
- if m != nil {
- return m.Third
- }
- return nil
-}
-
-type DefaultsMessage struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DefaultsMessage) Reset() { *m = DefaultsMessage{} }
-func (m *DefaultsMessage) String() string { return proto.CompactTextString(m) }
-func (*DefaultsMessage) ProtoMessage() {}
-func (*DefaultsMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{16}
-}
-
-var extRange_DefaultsMessage = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*DefaultsMessage) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_DefaultsMessage
-}
-func (m *DefaultsMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DefaultsMessage.Unmarshal(m, b)
-}
-func (m *DefaultsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DefaultsMessage.Marshal(b, m, deterministic)
-}
-func (dst *DefaultsMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DefaultsMessage.Merge(dst, src)
-}
-func (m *DefaultsMessage) XXX_Size() int {
- return xxx_messageInfo_DefaultsMessage.Size(m)
-}
-func (m *DefaultsMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_DefaultsMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DefaultsMessage proto.InternalMessageInfo
-
-type MyMessageSet struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `protobuf_messageset:"1" json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MyMessageSet) Reset() { *m = MyMessageSet{} }
-func (m *MyMessageSet) String() string { return proto.CompactTextString(m) }
-func (*MyMessageSet) ProtoMessage() {}
-func (*MyMessageSet) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{17}
-}
-
-func (m *MyMessageSet) MarshalJSON() ([]byte, error) {
- return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions)
-}
-func (m *MyMessageSet) UnmarshalJSON(buf []byte) error {
- return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions)
-}
-
-var extRange_MyMessageSet = []proto.ExtensionRange{
- {Start: 100, End: 2147483646},
-}
-
-func (*MyMessageSet) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_MyMessageSet
-}
-func (m *MyMessageSet) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MyMessageSet.Unmarshal(m, b)
-}
-func (m *MyMessageSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MyMessageSet.Marshal(b, m, deterministic)
-}
-func (dst *MyMessageSet) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MyMessageSet.Merge(dst, src)
-}
-func (m *MyMessageSet) XXX_Size() int {
- return xxx_messageInfo_MyMessageSet.Size(m)
-}
-func (m *MyMessageSet) XXX_DiscardUnknown() {
- xxx_messageInfo_MyMessageSet.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MyMessageSet proto.InternalMessageInfo
-
-type Empty struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Empty) Reset() { *m = Empty{} }
-func (m *Empty) String() string { return proto.CompactTextString(m) }
-func (*Empty) ProtoMessage() {}
-func (*Empty) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{18}
-}
-func (m *Empty) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Empty.Unmarshal(m, b)
-}
-func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
-}
-func (dst *Empty) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Empty.Merge(dst, src)
-}
-func (m *Empty) XXX_Size() int {
- return xxx_messageInfo_Empty.Size(m)
-}
-func (m *Empty) XXX_DiscardUnknown() {
- xxx_messageInfo_Empty.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Empty proto.InternalMessageInfo
-
-type MessageList struct {
- Message []*MessageList_Message `protobuf:"group,1,rep,name=Message,json=message" json:"message,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MessageList) Reset() { *m = MessageList{} }
-func (m *MessageList) String() string { return proto.CompactTextString(m) }
-func (*MessageList) ProtoMessage() {}
-func (*MessageList) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{19}
-}
-func (m *MessageList) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MessageList.Unmarshal(m, b)
-}
-func (m *MessageList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MessageList.Marshal(b, m, deterministic)
-}
-func (dst *MessageList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MessageList.Merge(dst, src)
-}
-func (m *MessageList) XXX_Size() int {
- return xxx_messageInfo_MessageList.Size(m)
-}
-func (m *MessageList) XXX_DiscardUnknown() {
- xxx_messageInfo_MessageList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MessageList proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MessageList_Message) Reset() { *m = MessageList_Message{} }
-func (m *MessageList_Message) String() string { return proto.CompactTextString(m) }
-func (*MessageList_Message) ProtoMessage() {}
-func (*MessageList_Message) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{19, 0}
-}
-func (m *MessageList_Message) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MessageList_Message.Unmarshal(m, b)
-}
-func (m *MessageList_Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MessageList_Message.Marshal(b, m, deterministic)
-}
-func (dst *MessageList_Message) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MessageList_Message.Merge(dst, src)
-}
-func (m *MessageList_Message) XXX_Size() int {
- return xxx_messageInfo_MessageList_Message.Size(m)
-}
-func (m *MessageList_Message) XXX_DiscardUnknown() {
- xxx_messageInfo_MessageList_Message.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MessageList_Message proto.InternalMessageInfo
-
-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=stringField" json:"string_field,omitempty"`
- BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field,json=bytesField" json:"bytes_field,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Strings) Reset() { *m = Strings{} }
-func (m *Strings) String() string { return proto.CompactTextString(m) }
-func (*Strings) ProtoMessage() {}
-func (*Strings) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{20}
-}
-func (m *Strings) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Strings.Unmarshal(m, b)
-}
-func (m *Strings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Strings.Marshal(b, m, deterministic)
-}
-func (dst *Strings) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Strings.Merge(dst, src)
-}
-func (m *Strings) XXX_Size() int {
- return xxx_messageInfo_Strings.Size(m)
-}
-func (m *Strings) XXX_DiscardUnknown() {
- xxx_messageInfo_Strings.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Strings proto.InternalMessageInfo
-
-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,json=FBool,def=1" json:"F_Bool,omitempty"`
- F_Int32 *int32 `protobuf:"varint,2,opt,name=F_Int32,json=FInt32,def=32" json:"F_Int32,omitempty"`
- F_Int64 *int64 `protobuf:"varint,3,opt,name=F_Int64,json=FInt64,def=64" json:"F_Int64,omitempty"`
- F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,name=F_Fixed32,json=FFixed32,def=320" json:"F_Fixed32,omitempty"`
- F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,name=F_Fixed64,json=FFixed64,def=640" json:"F_Fixed64,omitempty"`
- F_Uint32 *uint32 `protobuf:"varint,6,opt,name=F_Uint32,json=FUint32,def=3200" json:"F_Uint32,omitempty"`
- F_Uint64 *uint64 `protobuf:"varint,7,opt,name=F_Uint64,json=FUint64,def=6400" json:"F_Uint64,omitempty"`
- F_Float *float32 `protobuf:"fixed32,8,opt,name=F_Float,json=FFloat,def=314159" json:"F_Float,omitempty"`
- F_Double *float64 `protobuf:"fixed64,9,opt,name=F_Double,json=FDouble,def=271828" json:"F_Double,omitempty"`
- F_String *string `protobuf:"bytes,10,opt,name=F_String,json=FString,def=hello, \"world!\"\n" json:"F_String,omitempty"`
- F_Bytes []byte `protobuf:"bytes,11,opt,name=F_Bytes,json=FBytes,def=Bignose" json:"F_Bytes,omitempty"`
- F_Sint32 *int32 `protobuf:"zigzag32,12,opt,name=F_Sint32,json=FSint32,def=-32" json:"F_Sint32,omitempty"`
- F_Sint64 *int64 `protobuf:"zigzag64,13,opt,name=F_Sint64,json=FSint64,def=-64" json:"F_Sint64,omitempty"`
- F_Enum *Defaults_Color `protobuf:"varint,14,opt,name=F_Enum,json=FEnum,enum=test_proto.Defaults_Color,def=1" json:"F_Enum,omitempty"`
- // More fields with crazy defaults.
- F_Pinf *float32 `protobuf:"fixed32,15,opt,name=F_Pinf,json=FPinf,def=inf" json:"F_Pinf,omitempty"`
- F_Ninf *float32 `protobuf:"fixed32,16,opt,name=F_Ninf,json=FNinf,def=-inf" json:"F_Ninf,omitempty"`
- F_Nan *float32 `protobuf:"fixed32,17,opt,name=F_Nan,json=FNan,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,json=strZero,def=" json:"str_zero,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Defaults) Reset() { *m = Defaults{} }
-func (m *Defaults) String() string { return proto.CompactTextString(m) }
-func (*Defaults) ProtoMessage() {}
-func (*Defaults) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{21}
-}
-func (m *Defaults) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Defaults.Unmarshal(m, b)
-}
-func (m *Defaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Defaults.Marshal(b, m, deterministic)
-}
-func (dst *Defaults) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Defaults.Merge(dst, src)
-}
-func (m *Defaults) XXX_Size() int {
- return xxx_messageInfo_Defaults.Size(m)
-}
-func (m *Defaults) XXX_DiscardUnknown() {
- xxx_messageInfo_Defaults.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Defaults proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SubDefaults) Reset() { *m = SubDefaults{} }
-func (m *SubDefaults) String() string { return proto.CompactTextString(m) }
-func (*SubDefaults) ProtoMessage() {}
-func (*SubDefaults) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{22}
-}
-func (m *SubDefaults) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SubDefaults.Unmarshal(m, b)
-}
-func (m *SubDefaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SubDefaults.Marshal(b, m, deterministic)
-}
-func (dst *SubDefaults) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SubDefaults.Merge(dst, src)
-}
-func (m *SubDefaults) XXX_Size() int {
- return xxx_messageInfo_SubDefaults.Size(m)
-}
-func (m *SubDefaults) XXX_DiscardUnknown() {
- xxx_messageInfo_SubDefaults.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SubDefaults proto.InternalMessageInfo
-
-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=test_proto.RepeatedEnum_Color" json:"color,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RepeatedEnum) Reset() { *m = RepeatedEnum{} }
-func (m *RepeatedEnum) String() string { return proto.CompactTextString(m) }
-func (*RepeatedEnum) ProtoMessage() {}
-func (*RepeatedEnum) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{23}
-}
-func (m *RepeatedEnum) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RepeatedEnum.Unmarshal(m, b)
-}
-func (m *RepeatedEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RepeatedEnum.Marshal(b, m, deterministic)
-}
-func (dst *RepeatedEnum) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RepeatedEnum.Merge(dst, src)
-}
-func (m *RepeatedEnum) XXX_Size() int {
- return xxx_messageInfo_RepeatedEnum.Size(m)
-}
-func (m *RepeatedEnum) XXX_DiscardUnknown() {
- xxx_messageInfo_RepeatedEnum.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RepeatedEnum proto.InternalMessageInfo
-
-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=boolsPacked" 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=intsPacked" json:"ints_packed,omitempty"`
- Int64SPacked []int64 `protobuf:"varint,7,rep,packed,name=int64s_packed,json=int64sPacked" 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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MoreRepeated) Reset() { *m = MoreRepeated{} }
-func (m *MoreRepeated) String() string { return proto.CompactTextString(m) }
-func (*MoreRepeated) ProtoMessage() {}
-func (*MoreRepeated) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{24}
-}
-func (m *MoreRepeated) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MoreRepeated.Unmarshal(m, b)
-}
-func (m *MoreRepeated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MoreRepeated.Marshal(b, m, deterministic)
-}
-func (dst *MoreRepeated) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MoreRepeated.Merge(dst, src)
-}
-func (m *MoreRepeated) XXX_Size() int {
- return xxx_messageInfo_MoreRepeated.Size(m)
-}
-func (m *MoreRepeated) XXX_DiscardUnknown() {
- xxx_messageInfo_MoreRepeated.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MoreRepeated proto.InternalMessageInfo
-
-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" json:"g,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GroupOld) Reset() { *m = GroupOld{} }
-func (m *GroupOld) String() string { return proto.CompactTextString(m) }
-func (*GroupOld) ProtoMessage() {}
-func (*GroupOld) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{25}
-}
-func (m *GroupOld) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GroupOld.Unmarshal(m, b)
-}
-func (m *GroupOld) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GroupOld.Marshal(b, m, deterministic)
-}
-func (dst *GroupOld) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupOld.Merge(dst, src)
-}
-func (m *GroupOld) XXX_Size() int {
- return xxx_messageInfo_GroupOld.Size(m)
-}
-func (m *GroupOld) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupOld.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupOld proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GroupOld_G) Reset() { *m = GroupOld_G{} }
-func (m *GroupOld_G) String() string { return proto.CompactTextString(m) }
-func (*GroupOld_G) ProtoMessage() {}
-func (*GroupOld_G) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{25, 0}
-}
-func (m *GroupOld_G) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GroupOld_G.Unmarshal(m, b)
-}
-func (m *GroupOld_G) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GroupOld_G.Marshal(b, m, deterministic)
-}
-func (dst *GroupOld_G) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupOld_G.Merge(dst, src)
-}
-func (m *GroupOld_G) XXX_Size() int {
- return xxx_messageInfo_GroupOld_G.Size(m)
-}
-func (m *GroupOld_G) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupOld_G.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupOld_G proto.InternalMessageInfo
-
-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" json:"g,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GroupNew) Reset() { *m = GroupNew{} }
-func (m *GroupNew) String() string { return proto.CompactTextString(m) }
-func (*GroupNew) ProtoMessage() {}
-func (*GroupNew) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{26}
-}
-func (m *GroupNew) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GroupNew.Unmarshal(m, b)
-}
-func (m *GroupNew) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GroupNew.Marshal(b, m, deterministic)
-}
-func (dst *GroupNew) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupNew.Merge(dst, src)
-}
-func (m *GroupNew) XXX_Size() int {
- return xxx_messageInfo_GroupNew.Size(m)
-}
-func (m *GroupNew) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupNew.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupNew proto.InternalMessageInfo
-
-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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GroupNew_G) Reset() { *m = GroupNew_G{} }
-func (m *GroupNew_G) String() string { return proto.CompactTextString(m) }
-func (*GroupNew_G) ProtoMessage() {}
-func (*GroupNew_G) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{26, 0}
-}
-func (m *GroupNew_G) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GroupNew_G.Unmarshal(m, b)
-}
-func (m *GroupNew_G) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GroupNew_G.Marshal(b, m, deterministic)
-}
-func (dst *GroupNew_G) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupNew_G.Merge(dst, src)
-}
-func (m *GroupNew_G) XXX_Size() int {
- return xxx_messageInfo_GroupNew_G.Size(m)
-}
-func (m *GroupNew_G) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupNew_G.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupNew_G proto.InternalMessageInfo
-
-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"`
- Exact *bool `protobuf:"varint,2,opt,name=exact" json:"exact,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FloatingPoint) Reset() { *m = FloatingPoint{} }
-func (m *FloatingPoint) String() string { return proto.CompactTextString(m) }
-func (*FloatingPoint) ProtoMessage() {}
-func (*FloatingPoint) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{27}
-}
-func (m *FloatingPoint) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FloatingPoint.Unmarshal(m, b)
-}
-func (m *FloatingPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FloatingPoint.Marshal(b, m, deterministic)
-}
-func (dst *FloatingPoint) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FloatingPoint.Merge(dst, src)
-}
-func (m *FloatingPoint) XXX_Size() int {
- return xxx_messageInfo_FloatingPoint.Size(m)
-}
-func (m *FloatingPoint) XXX_DiscardUnknown() {
- xxx_messageInfo_FloatingPoint.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FloatingPoint proto.InternalMessageInfo
-
-func (m *FloatingPoint) GetF() float64 {
- if m != nil && m.F != nil {
- return *m.F
- }
- return 0
-}
-
-func (m *FloatingPoint) GetExact() bool {
- if m != nil && m.Exact != nil {
- return *m.Exact
- }
- return false
-}
-
-type MessageWithMap struct {
- NameMapping map[int32]string `protobuf:"bytes,1,rep,name=name_mapping,json=nameMapping" 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=msgMapping" 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=byteMapping" 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=strToStr" json:"str_to_str,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MessageWithMap) Reset() { *m = MessageWithMap{} }
-func (m *MessageWithMap) String() string { return proto.CompactTextString(m) }
-func (*MessageWithMap) ProtoMessage() {}
-func (*MessageWithMap) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{28}
-}
-func (m *MessageWithMap) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MessageWithMap.Unmarshal(m, b)
-}
-func (m *MessageWithMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MessageWithMap.Marshal(b, m, deterministic)
-}
-func (dst *MessageWithMap) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MessageWithMap.Merge(dst, src)
-}
-func (m *MessageWithMap) XXX_Size() int {
- return xxx_messageInfo_MessageWithMap.Size(m)
-}
-func (m *MessageWithMap) XXX_DiscardUnknown() {
- xxx_messageInfo_MessageWithMap.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MessageWithMap proto.InternalMessageInfo
-
-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 Oneof struct {
- // Types that are valid to be assigned to Union:
- // *Oneof_F_Bool
- // *Oneof_F_Int32
- // *Oneof_F_Int64
- // *Oneof_F_Fixed32
- // *Oneof_F_Fixed64
- // *Oneof_F_Uint32
- // *Oneof_F_Uint64
- // *Oneof_F_Float
- // *Oneof_F_Double
- // *Oneof_F_String
- // *Oneof_F_Bytes
- // *Oneof_F_Sint32
- // *Oneof_F_Sint64
- // *Oneof_F_Enum
- // *Oneof_F_Message
- // *Oneof_FGroup
- // *Oneof_F_Largest_Tag
- Union isOneof_Union `protobuf_oneof:"union"`
- // Types that are valid to be assigned to Tormato:
- // *Oneof_Value
- Tormato isOneof_Tormato `protobuf_oneof:"tormato"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oneof) Reset() { *m = Oneof{} }
-func (m *Oneof) String() string { return proto.CompactTextString(m) }
-func (*Oneof) ProtoMessage() {}
-func (*Oneof) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{29}
-}
-func (m *Oneof) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oneof.Unmarshal(m, b)
-}
-func (m *Oneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oneof.Marshal(b, m, deterministic)
-}
-func (dst *Oneof) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oneof.Merge(dst, src)
-}
-func (m *Oneof) XXX_Size() int {
- return xxx_messageInfo_Oneof.Size(m)
-}
-func (m *Oneof) XXX_DiscardUnknown() {
- xxx_messageInfo_Oneof.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oneof proto.InternalMessageInfo
-
-type isOneof_Union interface {
- isOneof_Union()
-}
-type isOneof_Tormato interface {
- isOneof_Tormato()
-}
-
-type Oneof_F_Bool struct {
- F_Bool bool `protobuf:"varint,1,opt,name=F_Bool,json=FBool,oneof"`
-}
-type Oneof_F_Int32 struct {
- F_Int32 int32 `protobuf:"varint,2,opt,name=F_Int32,json=FInt32,oneof"`
-}
-type Oneof_F_Int64 struct {
- F_Int64 int64 `protobuf:"varint,3,opt,name=F_Int64,json=FInt64,oneof"`
-}
-type Oneof_F_Fixed32 struct {
- F_Fixed32 uint32 `protobuf:"fixed32,4,opt,name=F_Fixed32,json=FFixed32,oneof"`
-}
-type Oneof_F_Fixed64 struct {
- F_Fixed64 uint64 `protobuf:"fixed64,5,opt,name=F_Fixed64,json=FFixed64,oneof"`
-}
-type Oneof_F_Uint32 struct {
- F_Uint32 uint32 `protobuf:"varint,6,opt,name=F_Uint32,json=FUint32,oneof"`
-}
-type Oneof_F_Uint64 struct {
- F_Uint64 uint64 `protobuf:"varint,7,opt,name=F_Uint64,json=FUint64,oneof"`
-}
-type Oneof_F_Float struct {
- F_Float float32 `protobuf:"fixed32,8,opt,name=F_Float,json=FFloat,oneof"`
-}
-type Oneof_F_Double struct {
- F_Double float64 `protobuf:"fixed64,9,opt,name=F_Double,json=FDouble,oneof"`
-}
-type Oneof_F_String struct {
- F_String string `protobuf:"bytes,10,opt,name=F_String,json=FString,oneof"`
-}
-type Oneof_F_Bytes struct {
- F_Bytes []byte `protobuf:"bytes,11,opt,name=F_Bytes,json=FBytes,oneof"`
-}
-type Oneof_F_Sint32 struct {
- F_Sint32 int32 `protobuf:"zigzag32,12,opt,name=F_Sint32,json=FSint32,oneof"`
-}
-type Oneof_F_Sint64 struct {
- F_Sint64 int64 `protobuf:"zigzag64,13,opt,name=F_Sint64,json=FSint64,oneof"`
-}
-type Oneof_F_Enum struct {
- F_Enum MyMessage_Color `protobuf:"varint,14,opt,name=F_Enum,json=FEnum,enum=test_proto.MyMessage_Color,oneof"`
-}
-type Oneof_F_Message struct {
- F_Message *GoTestField `protobuf:"bytes,15,opt,name=F_Message,json=FMessage,oneof"`
-}
-type Oneof_FGroup struct {
- FGroup *Oneof_F_Group `protobuf:"group,16,opt,name=F_Group,json=fGroup,oneof"`
-}
-type Oneof_F_Largest_Tag struct {
- F_Largest_Tag int32 `protobuf:"varint,536870911,opt,name=F_Largest_Tag,json=FLargestTag,oneof"`
-}
-type Oneof_Value struct {
- Value int32 `protobuf:"varint,100,opt,name=value,oneof"`
-}
-
-func (*Oneof_F_Bool) isOneof_Union() {}
-func (*Oneof_F_Int32) isOneof_Union() {}
-func (*Oneof_F_Int64) isOneof_Union() {}
-func (*Oneof_F_Fixed32) isOneof_Union() {}
-func (*Oneof_F_Fixed64) isOneof_Union() {}
-func (*Oneof_F_Uint32) isOneof_Union() {}
-func (*Oneof_F_Uint64) isOneof_Union() {}
-func (*Oneof_F_Float) isOneof_Union() {}
-func (*Oneof_F_Double) isOneof_Union() {}
-func (*Oneof_F_String) isOneof_Union() {}
-func (*Oneof_F_Bytes) isOneof_Union() {}
-func (*Oneof_F_Sint32) isOneof_Union() {}
-func (*Oneof_F_Sint64) isOneof_Union() {}
-func (*Oneof_F_Enum) isOneof_Union() {}
-func (*Oneof_F_Message) isOneof_Union() {}
-func (*Oneof_FGroup) isOneof_Union() {}
-func (*Oneof_F_Largest_Tag) isOneof_Union() {}
-func (*Oneof_Value) isOneof_Tormato() {}
-
-func (m *Oneof) GetUnion() isOneof_Union {
- if m != nil {
- return m.Union
- }
- return nil
-}
-func (m *Oneof) GetTormato() isOneof_Tormato {
- if m != nil {
- return m.Tormato
- }
- return nil
-}
-
-func (m *Oneof) GetF_Bool() bool {
- if x, ok := m.GetUnion().(*Oneof_F_Bool); ok {
- return x.F_Bool
- }
- return false
-}
-
-func (m *Oneof) GetF_Int32() int32 {
- if x, ok := m.GetUnion().(*Oneof_F_Int32); ok {
- return x.F_Int32
- }
- return 0
-}
-
-func (m *Oneof) GetF_Int64() int64 {
- if x, ok := m.GetUnion().(*Oneof_F_Int64); ok {
- return x.F_Int64
- }
- return 0
-}
-
-func (m *Oneof) GetF_Fixed32() uint32 {
- if x, ok := m.GetUnion().(*Oneof_F_Fixed32); ok {
- return x.F_Fixed32
- }
- return 0
-}
-
-func (m *Oneof) GetF_Fixed64() uint64 {
- if x, ok := m.GetUnion().(*Oneof_F_Fixed64); ok {
- return x.F_Fixed64
- }
- return 0
-}
-
-func (m *Oneof) GetF_Uint32() uint32 {
- if x, ok := m.GetUnion().(*Oneof_F_Uint32); ok {
- return x.F_Uint32
- }
- return 0
-}
-
-func (m *Oneof) GetF_Uint64() uint64 {
- if x, ok := m.GetUnion().(*Oneof_F_Uint64); ok {
- return x.F_Uint64
- }
- return 0
-}
-
-func (m *Oneof) GetF_Float() float32 {
- if x, ok := m.GetUnion().(*Oneof_F_Float); ok {
- return x.F_Float
- }
- return 0
-}
-
-func (m *Oneof) GetF_Double() float64 {
- if x, ok := m.GetUnion().(*Oneof_F_Double); ok {
- return x.F_Double
- }
- return 0
-}
-
-func (m *Oneof) GetF_String() string {
- if x, ok := m.GetUnion().(*Oneof_F_String); ok {
- return x.F_String
- }
- return ""
-}
-
-func (m *Oneof) GetF_Bytes() []byte {
- if x, ok := m.GetUnion().(*Oneof_F_Bytes); ok {
- return x.F_Bytes
- }
- return nil
-}
-
-func (m *Oneof) GetF_Sint32() int32 {
- if x, ok := m.GetUnion().(*Oneof_F_Sint32); ok {
- return x.F_Sint32
- }
- return 0
-}
-
-func (m *Oneof) GetF_Sint64() int64 {
- if x, ok := m.GetUnion().(*Oneof_F_Sint64); ok {
- return x.F_Sint64
- }
- return 0
-}
-
-func (m *Oneof) GetF_Enum() MyMessage_Color {
- if x, ok := m.GetUnion().(*Oneof_F_Enum); ok {
- return x.F_Enum
- }
- return MyMessage_RED
-}
-
-func (m *Oneof) GetF_Message() *GoTestField {
- if x, ok := m.GetUnion().(*Oneof_F_Message); ok {
- return x.F_Message
- }
- return nil
-}
-
-func (m *Oneof) GetFGroup() *Oneof_F_Group {
- if x, ok := m.GetUnion().(*Oneof_FGroup); ok {
- return x.FGroup
- }
- return nil
-}
-
-func (m *Oneof) GetF_Largest_Tag() int32 {
- if x, ok := m.GetUnion().(*Oneof_F_Largest_Tag); ok {
- return x.F_Largest_Tag
- }
- return 0
-}
-
-func (m *Oneof) GetValue() int32 {
- if x, ok := m.GetTormato().(*Oneof_Value); ok {
- return x.Value
- }
- return 0
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*Oneof) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _Oneof_OneofMarshaler, _Oneof_OneofUnmarshaler, _Oneof_OneofSizer, []interface{}{
- (*Oneof_F_Bool)(nil),
- (*Oneof_F_Int32)(nil),
- (*Oneof_F_Int64)(nil),
- (*Oneof_F_Fixed32)(nil),
- (*Oneof_F_Fixed64)(nil),
- (*Oneof_F_Uint32)(nil),
- (*Oneof_F_Uint64)(nil),
- (*Oneof_F_Float)(nil),
- (*Oneof_F_Double)(nil),
- (*Oneof_F_String)(nil),
- (*Oneof_F_Bytes)(nil),
- (*Oneof_F_Sint32)(nil),
- (*Oneof_F_Sint64)(nil),
- (*Oneof_F_Enum)(nil),
- (*Oneof_F_Message)(nil),
- (*Oneof_FGroup)(nil),
- (*Oneof_F_Largest_Tag)(nil),
- (*Oneof_Value)(nil),
- }
-}
-
-func _Oneof_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*Oneof)
- // union
- switch x := m.Union.(type) {
- case *Oneof_F_Bool:
- t := uint64(0)
- if x.F_Bool {
- t = 1
- }
- b.EncodeVarint(1<<3 | proto.WireVarint)
- b.EncodeVarint(t)
- case *Oneof_F_Int32:
- b.EncodeVarint(2<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.F_Int32))
- case *Oneof_F_Int64:
- b.EncodeVarint(3<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.F_Int64))
- case *Oneof_F_Fixed32:
- b.EncodeVarint(4<<3 | proto.WireFixed32)
- b.EncodeFixed32(uint64(x.F_Fixed32))
- case *Oneof_F_Fixed64:
- b.EncodeVarint(5<<3 | proto.WireFixed64)
- b.EncodeFixed64(uint64(x.F_Fixed64))
- case *Oneof_F_Uint32:
- b.EncodeVarint(6<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.F_Uint32))
- case *Oneof_F_Uint64:
- b.EncodeVarint(7<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.F_Uint64))
- case *Oneof_F_Float:
- b.EncodeVarint(8<<3 | proto.WireFixed32)
- b.EncodeFixed32(uint64(math.Float32bits(x.F_Float)))
- case *Oneof_F_Double:
- b.EncodeVarint(9<<3 | proto.WireFixed64)
- b.EncodeFixed64(math.Float64bits(x.F_Double))
- case *Oneof_F_String:
- b.EncodeVarint(10<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.F_String)
- case *Oneof_F_Bytes:
- b.EncodeVarint(11<<3 | proto.WireBytes)
- b.EncodeRawBytes(x.F_Bytes)
- case *Oneof_F_Sint32:
- b.EncodeVarint(12<<3 | proto.WireVarint)
- b.EncodeZigzag32(uint64(x.F_Sint32))
- case *Oneof_F_Sint64:
- b.EncodeVarint(13<<3 | proto.WireVarint)
- b.EncodeZigzag64(uint64(x.F_Sint64))
- case *Oneof_F_Enum:
- b.EncodeVarint(14<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.F_Enum))
- case *Oneof_F_Message:
- b.EncodeVarint(15<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.F_Message); err != nil {
- return err
- }
- case *Oneof_FGroup:
- b.EncodeVarint(16<<3 | proto.WireStartGroup)
- if err := b.Marshal(x.FGroup); err != nil {
- return err
- }
- b.EncodeVarint(16<<3 | proto.WireEndGroup)
- case *Oneof_F_Largest_Tag:
- b.EncodeVarint(536870911<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.F_Largest_Tag))
- case nil:
- default:
- return fmt.Errorf("Oneof.Union has unexpected type %T", x)
- }
- // tormato
- switch x := m.Tormato.(type) {
- case *Oneof_Value:
- b.EncodeVarint(100<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.Value))
- case nil:
- default:
- return fmt.Errorf("Oneof.Tormato has unexpected type %T", x)
- }
- return nil
-}
-
-func _Oneof_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*Oneof)
- switch tag {
- case 1: // union.F_Bool
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Bool{x != 0}
- return true, err
- case 2: // union.F_Int32
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Int32{int32(x)}
- return true, err
- case 3: // union.F_Int64
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Int64{int64(x)}
- return true, err
- case 4: // union.F_Fixed32
- if wire != proto.WireFixed32 {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeFixed32()
- m.Union = &Oneof_F_Fixed32{uint32(x)}
- return true, err
- case 5: // union.F_Fixed64
- if wire != proto.WireFixed64 {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeFixed64()
- m.Union = &Oneof_F_Fixed64{x}
- return true, err
- case 6: // union.F_Uint32
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Uint32{uint32(x)}
- return true, err
- case 7: // union.F_Uint64
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Uint64{x}
- return true, err
- case 8: // union.F_Float
- if wire != proto.WireFixed32 {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeFixed32()
- m.Union = &Oneof_F_Float{math.Float32frombits(uint32(x))}
- return true, err
- case 9: // union.F_Double
- if wire != proto.WireFixed64 {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeFixed64()
- m.Union = &Oneof_F_Double{math.Float64frombits(x)}
- return true, err
- case 10: // union.F_String
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Union = &Oneof_F_String{x}
- return true, err
- case 11: // union.F_Bytes
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeRawBytes(true)
- m.Union = &Oneof_F_Bytes{x}
- return true, err
- case 12: // union.F_Sint32
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeZigzag32()
- m.Union = &Oneof_F_Sint32{int32(x)}
- return true, err
- case 13: // union.F_Sint64
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeZigzag64()
- m.Union = &Oneof_F_Sint64{int64(x)}
- return true, err
- case 14: // union.F_Enum
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Enum{MyMessage_Color(x)}
- return true, err
- case 15: // union.F_Message
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(GoTestField)
- err := b.DecodeMessage(msg)
- m.Union = &Oneof_F_Message{msg}
- return true, err
- case 16: // union.f_group
- if wire != proto.WireStartGroup {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Oneof_F_Group)
- err := b.DecodeGroup(msg)
- m.Union = &Oneof_FGroup{msg}
- return true, err
- case 536870911: // union.F_Largest_Tag
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Oneof_F_Largest_Tag{int32(x)}
- return true, err
- case 100: // tormato.value
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Tormato = &Oneof_Value{int32(x)}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _Oneof_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*Oneof)
- // union
- switch x := m.Union.(type) {
- case *Oneof_F_Bool:
- n += 1 // tag and wire
- n += 1
- case *Oneof_F_Int32:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.F_Int32))
- case *Oneof_F_Int64:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.F_Int64))
- case *Oneof_F_Fixed32:
- n += 1 // tag and wire
- n += 4
- case *Oneof_F_Fixed64:
- n += 1 // tag and wire
- n += 8
- case *Oneof_F_Uint32:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.F_Uint32))
- case *Oneof_F_Uint64:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.F_Uint64))
- case *Oneof_F_Float:
- n += 1 // tag and wire
- n += 4
- case *Oneof_F_Double:
- n += 1 // tag and wire
- n += 8
- case *Oneof_F_String:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.F_String)))
- n += len(x.F_String)
- case *Oneof_F_Bytes:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.F_Bytes)))
- n += len(x.F_Bytes)
- case *Oneof_F_Sint32:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64((uint32(x.F_Sint32) << 1) ^ uint32((int32(x.F_Sint32) >> 31))))
- case *Oneof_F_Sint64:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(uint64(x.F_Sint64<<1) ^ uint64((int64(x.F_Sint64) >> 63))))
- case *Oneof_F_Enum:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.F_Enum))
- case *Oneof_F_Message:
- s := proto.Size(x.F_Message)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Oneof_FGroup:
- n += 2 // tag and wire
- n += proto.Size(x.FGroup)
- n += 2 // tag and wire
- case *Oneof_F_Largest_Tag:
- n += 10 // tag and wire
- n += proto.SizeVarint(uint64(x.F_Largest_Tag))
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- // tormato
- switch x := m.Tormato.(type) {
- case *Oneof_Value:
- n += 2 // tag and wire
- n += proto.SizeVarint(uint64(x.Value))
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-type Oneof_F_Group struct {
- X *int32 `protobuf:"varint,17,opt,name=x" json:"x,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oneof_F_Group) Reset() { *m = Oneof_F_Group{} }
-func (m *Oneof_F_Group) String() string { return proto.CompactTextString(m) }
-func (*Oneof_F_Group) ProtoMessage() {}
-func (*Oneof_F_Group) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{29, 0}
-}
-func (m *Oneof_F_Group) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oneof_F_Group.Unmarshal(m, b)
-}
-func (m *Oneof_F_Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oneof_F_Group.Marshal(b, m, deterministic)
-}
-func (dst *Oneof_F_Group) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oneof_F_Group.Merge(dst, src)
-}
-func (m *Oneof_F_Group) XXX_Size() int {
- return xxx_messageInfo_Oneof_F_Group.Size(m)
-}
-func (m *Oneof_F_Group) XXX_DiscardUnknown() {
- xxx_messageInfo_Oneof_F_Group.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oneof_F_Group proto.InternalMessageInfo
-
-func (m *Oneof_F_Group) GetX() int32 {
- if m != nil && m.X != nil {
- return *m.X
- }
- return 0
-}
-
-type Communique struct {
- MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry,json=makeMeCry" 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_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Communique) Reset() { *m = Communique{} }
-func (m *Communique) String() string { return proto.CompactTextString(m) }
-func (*Communique) ProtoMessage() {}
-func (*Communique) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_74787bfc6550f8a7, []int{30}
-}
-func (m *Communique) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Communique.Unmarshal(m, b)
-}
-func (m *Communique) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Communique.Marshal(b, m, deterministic)
-}
-func (dst *Communique) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Communique.Merge(dst, src)
-}
-func (m *Communique) XXX_Size() int {
- return xxx_messageInfo_Communique.Size(m)
-}
-func (m *Communique) XXX_DiscardUnknown() {
- xxx_messageInfo_Communique.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Communique proto.InternalMessageInfo
-
-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,json=tempC,oneof"`
-}
-type Communique_Col struct {
- Col MyMessage_Color `protobuf:"varint,9,opt,name=col,enum=test_proto.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), func(msg proto.Message) (n int), []interface{}) {
- return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, _Communique_OneofSizer, []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
- }
-}
-
-func _Communique_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*Communique)
- // union
- switch x := m.Union.(type) {
- case *Communique_Number:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.Number))
- case *Communique_Name:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Name)))
- n += len(x.Name)
- case *Communique_Data:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Data)))
- n += len(x.Data)
- case *Communique_TempC:
- n += 1 // tag and wire
- n += 8
- case *Communique_Col:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.Col))
- case *Communique_Msg:
- s := proto.Size(x.Msg)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-var E_Greeting = &proto.ExtensionDesc{
- ExtendedType: (*MyMessage)(nil),
- ExtensionType: ([]string)(nil),
- Field: 106,
- Name: "test_proto.greeting",
- Tag: "bytes,106,rep,name=greeting",
- Filename: "test_proto/test.proto",
-}
-
-var E_Complex = &proto.ExtensionDesc{
- ExtendedType: (*OtherMessage)(nil),
- ExtensionType: (*ComplexExtension)(nil),
- Field: 200,
- Name: "test_proto.complex",
- Tag: "bytes,200,opt,name=complex",
- Filename: "test_proto/test.proto",
-}
-
-var E_RComplex = &proto.ExtensionDesc{
- ExtendedType: (*OtherMessage)(nil),
- ExtensionType: ([]*ComplexExtension)(nil),
- Field: 201,
- Name: "test_proto.r_complex",
- Tag: "bytes,201,rep,name=r_complex,json=rComplex",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultDouble = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*float64)(nil),
- Field: 101,
- Name: "test_proto.no_default_double",
- Tag: "fixed64,101,opt,name=no_default_double,json=noDefaultDouble",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultFloat = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*float32)(nil),
- Field: 102,
- Name: "test_proto.no_default_float",
- Tag: "fixed32,102,opt,name=no_default_float,json=noDefaultFloat",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultInt32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 103,
- Name: "test_proto.no_default_int32",
- Tag: "varint,103,opt,name=no_default_int32,json=noDefaultInt32",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultInt64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 104,
- Name: "test_proto.no_default_int64",
- Tag: "varint,104,opt,name=no_default_int64,json=noDefaultInt64",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultUint32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint32)(nil),
- Field: 105,
- Name: "test_proto.no_default_uint32",
- Tag: "varint,105,opt,name=no_default_uint32,json=noDefaultUint32",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultUint64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint64)(nil),
- Field: 106,
- Name: "test_proto.no_default_uint64",
- Tag: "varint,106,opt,name=no_default_uint64,json=noDefaultUint64",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultSint32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 107,
- Name: "test_proto.no_default_sint32",
- Tag: "zigzag32,107,opt,name=no_default_sint32,json=noDefaultSint32",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultSint64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 108,
- Name: "test_proto.no_default_sint64",
- Tag: "zigzag64,108,opt,name=no_default_sint64,json=noDefaultSint64",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultFixed32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint32)(nil),
- Field: 109,
- Name: "test_proto.no_default_fixed32",
- Tag: "fixed32,109,opt,name=no_default_fixed32,json=noDefaultFixed32",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultFixed64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint64)(nil),
- Field: 110,
- Name: "test_proto.no_default_fixed64",
- Tag: "fixed64,110,opt,name=no_default_fixed64,json=noDefaultFixed64",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultSfixed32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 111,
- Name: "test_proto.no_default_sfixed32",
- Tag: "fixed32,111,opt,name=no_default_sfixed32,json=noDefaultSfixed32",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultSfixed64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 112,
- Name: "test_proto.no_default_sfixed64",
- Tag: "fixed64,112,opt,name=no_default_sfixed64,json=noDefaultSfixed64",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultBool = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*bool)(nil),
- Field: 113,
- Name: "test_proto.no_default_bool",
- Tag: "varint,113,opt,name=no_default_bool,json=noDefaultBool",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultString = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*string)(nil),
- Field: 114,
- Name: "test_proto.no_default_string",
- Tag: "bytes,114,opt,name=no_default_string,json=noDefaultString",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultBytes = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: ([]byte)(nil),
- Field: 115,
- Name: "test_proto.no_default_bytes",
- Tag: "bytes,115,opt,name=no_default_bytes,json=noDefaultBytes",
- Filename: "test_proto/test.proto",
-}
-
-var E_NoDefaultEnum = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil),
- Field: 116,
- Name: "test_proto.no_default_enum",
- Tag: "varint,116,opt,name=no_default_enum,json=noDefaultEnum,enum=test_proto.DefaultsMessage_DefaultsEnum",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultDouble = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*float64)(nil),
- Field: 201,
- Name: "test_proto.default_double",
- Tag: "fixed64,201,opt,name=default_double,json=defaultDouble,def=3.1415",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultFloat = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*float32)(nil),
- Field: 202,
- Name: "test_proto.default_float",
- Tag: "fixed32,202,opt,name=default_float,json=defaultFloat,def=3.14",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultInt32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 203,
- Name: "test_proto.default_int32",
- Tag: "varint,203,opt,name=default_int32,json=defaultInt32,def=42",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultInt64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 204,
- Name: "test_proto.default_int64",
- Tag: "varint,204,opt,name=default_int64,json=defaultInt64,def=43",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultUint32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint32)(nil),
- Field: 205,
- Name: "test_proto.default_uint32",
- Tag: "varint,205,opt,name=default_uint32,json=defaultUint32,def=44",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultUint64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint64)(nil),
- Field: 206,
- Name: "test_proto.default_uint64",
- Tag: "varint,206,opt,name=default_uint64,json=defaultUint64,def=45",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultSint32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 207,
- Name: "test_proto.default_sint32",
- Tag: "zigzag32,207,opt,name=default_sint32,json=defaultSint32,def=46",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultSint64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 208,
- Name: "test_proto.default_sint64",
- Tag: "zigzag64,208,opt,name=default_sint64,json=defaultSint64,def=47",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultFixed32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint32)(nil),
- Field: 209,
- Name: "test_proto.default_fixed32",
- Tag: "fixed32,209,opt,name=default_fixed32,json=defaultFixed32,def=48",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultFixed64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*uint64)(nil),
- Field: 210,
- Name: "test_proto.default_fixed64",
- Tag: "fixed64,210,opt,name=default_fixed64,json=defaultFixed64,def=49",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultSfixed32 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 211,
- Name: "test_proto.default_sfixed32",
- Tag: "fixed32,211,opt,name=default_sfixed32,json=defaultSfixed32,def=50",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultSfixed64 = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 212,
- Name: "test_proto.default_sfixed64",
- Tag: "fixed64,212,opt,name=default_sfixed64,json=defaultSfixed64,def=51",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultBool = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*bool)(nil),
- Field: 213,
- Name: "test_proto.default_bool",
- Tag: "varint,213,opt,name=default_bool,json=defaultBool,def=1",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultString = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*string)(nil),
- Field: 214,
- Name: "test_proto.default_string",
- Tag: "bytes,214,opt,name=default_string,json=defaultString,def=Hello, string,def=foo",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultBytes = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: ([]byte)(nil),
- Field: 215,
- Name: "test_proto.default_bytes",
- Tag: "bytes,215,opt,name=default_bytes,json=defaultBytes,def=Hello, bytes",
- Filename: "test_proto/test.proto",
-}
-
-var E_DefaultEnum = &proto.ExtensionDesc{
- ExtendedType: (*DefaultsMessage)(nil),
- ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil),
- Field: 216,
- Name: "test_proto.default_enum",
- Tag: "varint,216,opt,name=default_enum,json=defaultEnum,enum=test_proto.DefaultsMessage_DefaultsEnum,def=1",
- Filename: "test_proto/test.proto",
-}
-
-var E_X201 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 201,
- Name: "test_proto.x201",
- Tag: "bytes,201,opt,name=x201",
- Filename: "test_proto/test.proto",
-}
-
-var E_X202 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 202,
- Name: "test_proto.x202",
- Tag: "bytes,202,opt,name=x202",
- Filename: "test_proto/test.proto",
-}
-
-var E_X203 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 203,
- Name: "test_proto.x203",
- Tag: "bytes,203,opt,name=x203",
- Filename: "test_proto/test.proto",
-}
-
-var E_X204 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 204,
- Name: "test_proto.x204",
- Tag: "bytes,204,opt,name=x204",
- Filename: "test_proto/test.proto",
-}
-
-var E_X205 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 205,
- Name: "test_proto.x205",
- Tag: "bytes,205,opt,name=x205",
- Filename: "test_proto/test.proto",
-}
-
-var E_X206 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 206,
- Name: "test_proto.x206",
- Tag: "bytes,206,opt,name=x206",
- Filename: "test_proto/test.proto",
-}
-
-var E_X207 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 207,
- Name: "test_proto.x207",
- Tag: "bytes,207,opt,name=x207",
- Filename: "test_proto/test.proto",
-}
-
-var E_X208 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 208,
- Name: "test_proto.x208",
- Tag: "bytes,208,opt,name=x208",
- Filename: "test_proto/test.proto",
-}
-
-var E_X209 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 209,
- Name: "test_proto.x209",
- Tag: "bytes,209,opt,name=x209",
- Filename: "test_proto/test.proto",
-}
-
-var E_X210 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 210,
- Name: "test_proto.x210",
- Tag: "bytes,210,opt,name=x210",
- Filename: "test_proto/test.proto",
-}
-
-var E_X211 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 211,
- Name: "test_proto.x211",
- Tag: "bytes,211,opt,name=x211",
- Filename: "test_proto/test.proto",
-}
-
-var E_X212 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 212,
- Name: "test_proto.x212",
- Tag: "bytes,212,opt,name=x212",
- Filename: "test_proto/test.proto",
-}
-
-var E_X213 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 213,
- Name: "test_proto.x213",
- Tag: "bytes,213,opt,name=x213",
- Filename: "test_proto/test.proto",
-}
-
-var E_X214 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 214,
- Name: "test_proto.x214",
- Tag: "bytes,214,opt,name=x214",
- Filename: "test_proto/test.proto",
-}
-
-var E_X215 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 215,
- Name: "test_proto.x215",
- Tag: "bytes,215,opt,name=x215",
- Filename: "test_proto/test.proto",
-}
-
-var E_X216 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 216,
- Name: "test_proto.x216",
- Tag: "bytes,216,opt,name=x216",
- Filename: "test_proto/test.proto",
-}
-
-var E_X217 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 217,
- Name: "test_proto.x217",
- Tag: "bytes,217,opt,name=x217",
- Filename: "test_proto/test.proto",
-}
-
-var E_X218 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 218,
- Name: "test_proto.x218",
- Tag: "bytes,218,opt,name=x218",
- Filename: "test_proto/test.proto",
-}
-
-var E_X219 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 219,
- Name: "test_proto.x219",
- Tag: "bytes,219,opt,name=x219",
- Filename: "test_proto/test.proto",
-}
-
-var E_X220 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 220,
- Name: "test_proto.x220",
- Tag: "bytes,220,opt,name=x220",
- Filename: "test_proto/test.proto",
-}
-
-var E_X221 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 221,
- Name: "test_proto.x221",
- Tag: "bytes,221,opt,name=x221",
- Filename: "test_proto/test.proto",
-}
-
-var E_X222 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 222,
- Name: "test_proto.x222",
- Tag: "bytes,222,opt,name=x222",
- Filename: "test_proto/test.proto",
-}
-
-var E_X223 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 223,
- Name: "test_proto.x223",
- Tag: "bytes,223,opt,name=x223",
- Filename: "test_proto/test.proto",
-}
-
-var E_X224 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 224,
- Name: "test_proto.x224",
- Tag: "bytes,224,opt,name=x224",
- Filename: "test_proto/test.proto",
-}
-
-var E_X225 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 225,
- Name: "test_proto.x225",
- Tag: "bytes,225,opt,name=x225",
- Filename: "test_proto/test.proto",
-}
-
-var E_X226 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 226,
- Name: "test_proto.x226",
- Tag: "bytes,226,opt,name=x226",
- Filename: "test_proto/test.proto",
-}
-
-var E_X227 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 227,
- Name: "test_proto.x227",
- Tag: "bytes,227,opt,name=x227",
- Filename: "test_proto/test.proto",
-}
-
-var E_X228 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 228,
- Name: "test_proto.x228",
- Tag: "bytes,228,opt,name=x228",
- Filename: "test_proto/test.proto",
-}
-
-var E_X229 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 229,
- Name: "test_proto.x229",
- Tag: "bytes,229,opt,name=x229",
- Filename: "test_proto/test.proto",
-}
-
-var E_X230 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 230,
- Name: "test_proto.x230",
- Tag: "bytes,230,opt,name=x230",
- Filename: "test_proto/test.proto",
-}
-
-var E_X231 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 231,
- Name: "test_proto.x231",
- Tag: "bytes,231,opt,name=x231",
- Filename: "test_proto/test.proto",
-}
-
-var E_X232 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 232,
- Name: "test_proto.x232",
- Tag: "bytes,232,opt,name=x232",
- Filename: "test_proto/test.proto",
-}
-
-var E_X233 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 233,
- Name: "test_proto.x233",
- Tag: "bytes,233,opt,name=x233",
- Filename: "test_proto/test.proto",
-}
-
-var E_X234 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 234,
- Name: "test_proto.x234",
- Tag: "bytes,234,opt,name=x234",
- Filename: "test_proto/test.proto",
-}
-
-var E_X235 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 235,
- Name: "test_proto.x235",
- Tag: "bytes,235,opt,name=x235",
- Filename: "test_proto/test.proto",
-}
-
-var E_X236 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 236,
- Name: "test_proto.x236",
- Tag: "bytes,236,opt,name=x236",
- Filename: "test_proto/test.proto",
-}
-
-var E_X237 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 237,
- Name: "test_proto.x237",
- Tag: "bytes,237,opt,name=x237",
- Filename: "test_proto/test.proto",
-}
-
-var E_X238 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 238,
- Name: "test_proto.x238",
- Tag: "bytes,238,opt,name=x238",
- Filename: "test_proto/test.proto",
-}
-
-var E_X239 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 239,
- Name: "test_proto.x239",
- Tag: "bytes,239,opt,name=x239",
- Filename: "test_proto/test.proto",
-}
-
-var E_X240 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 240,
- Name: "test_proto.x240",
- Tag: "bytes,240,opt,name=x240",
- Filename: "test_proto/test.proto",
-}
-
-var E_X241 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 241,
- Name: "test_proto.x241",
- Tag: "bytes,241,opt,name=x241",
- Filename: "test_proto/test.proto",
-}
-
-var E_X242 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 242,
- Name: "test_proto.x242",
- Tag: "bytes,242,opt,name=x242",
- Filename: "test_proto/test.proto",
-}
-
-var E_X243 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 243,
- Name: "test_proto.x243",
- Tag: "bytes,243,opt,name=x243",
- Filename: "test_proto/test.proto",
-}
-
-var E_X244 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 244,
- Name: "test_proto.x244",
- Tag: "bytes,244,opt,name=x244",
- Filename: "test_proto/test.proto",
-}
-
-var E_X245 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 245,
- Name: "test_proto.x245",
- Tag: "bytes,245,opt,name=x245",
- Filename: "test_proto/test.proto",
-}
-
-var E_X246 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 246,
- Name: "test_proto.x246",
- Tag: "bytes,246,opt,name=x246",
- Filename: "test_proto/test.proto",
-}
-
-var E_X247 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 247,
- Name: "test_proto.x247",
- Tag: "bytes,247,opt,name=x247",
- Filename: "test_proto/test.proto",
-}
-
-var E_X248 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 248,
- Name: "test_proto.x248",
- Tag: "bytes,248,opt,name=x248",
- Filename: "test_proto/test.proto",
-}
-
-var E_X249 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 249,
- Name: "test_proto.x249",
- Tag: "bytes,249,opt,name=x249",
- Filename: "test_proto/test.proto",
-}
-
-var E_X250 = &proto.ExtensionDesc{
- ExtendedType: (*MyMessageSet)(nil),
- ExtensionType: (*Empty)(nil),
- Field: 250,
- Name: "test_proto.x250",
- Tag: "bytes,250,opt,name=x250",
- Filename: "test_proto/test.proto",
-}
-
-func init() {
- proto.RegisterType((*GoEnum)(nil), "test_proto.GoEnum")
- proto.RegisterType((*GoTestField)(nil), "test_proto.GoTestField")
- proto.RegisterType((*GoTest)(nil), "test_proto.GoTest")
- proto.RegisterType((*GoTest_RequiredGroup)(nil), "test_proto.GoTest.RequiredGroup")
- proto.RegisterType((*GoTest_RepeatedGroup)(nil), "test_proto.GoTest.RepeatedGroup")
- proto.RegisterType((*GoTest_OptionalGroup)(nil), "test_proto.GoTest.OptionalGroup")
- proto.RegisterType((*GoTestRequiredGroupField)(nil), "test_proto.GoTestRequiredGroupField")
- proto.RegisterType((*GoTestRequiredGroupField_Group)(nil), "test_proto.GoTestRequiredGroupField.Group")
- proto.RegisterType((*GoSkipTest)(nil), "test_proto.GoSkipTest")
- proto.RegisterType((*GoSkipTest_SkipGroup)(nil), "test_proto.GoSkipTest.SkipGroup")
- proto.RegisterType((*NonPackedTest)(nil), "test_proto.NonPackedTest")
- proto.RegisterType((*PackedTest)(nil), "test_proto.PackedTest")
- proto.RegisterType((*MaxTag)(nil), "test_proto.MaxTag")
- proto.RegisterType((*OldMessage)(nil), "test_proto.OldMessage")
- proto.RegisterType((*OldMessage_Nested)(nil), "test_proto.OldMessage.Nested")
- proto.RegisterType((*NewMessage)(nil), "test_proto.NewMessage")
- proto.RegisterType((*NewMessage_Nested)(nil), "test_proto.NewMessage.Nested")
- proto.RegisterType((*InnerMessage)(nil), "test_proto.InnerMessage")
- proto.RegisterType((*OtherMessage)(nil), "test_proto.OtherMessage")
- proto.RegisterType((*RequiredInnerMessage)(nil), "test_proto.RequiredInnerMessage")
- proto.RegisterType((*MyMessage)(nil), "test_proto.MyMessage")
- proto.RegisterType((*MyMessage_SomeGroup)(nil), "test_proto.MyMessage.SomeGroup")
- proto.RegisterType((*Ext)(nil), "test_proto.Ext")
- proto.RegisterMapType((map[int32]int32)(nil), "test_proto.Ext.MapFieldEntry")
- proto.RegisterType((*ComplexExtension)(nil), "test_proto.ComplexExtension")
- proto.RegisterType((*DefaultsMessage)(nil), "test_proto.DefaultsMessage")
- proto.RegisterType((*MyMessageSet)(nil), "test_proto.MyMessageSet")
- proto.RegisterType((*Empty)(nil), "test_proto.Empty")
- proto.RegisterType((*MessageList)(nil), "test_proto.MessageList")
- proto.RegisterType((*MessageList_Message)(nil), "test_proto.MessageList.Message")
- proto.RegisterType((*Strings)(nil), "test_proto.Strings")
- proto.RegisterType((*Defaults)(nil), "test_proto.Defaults")
- proto.RegisterType((*SubDefaults)(nil), "test_proto.SubDefaults")
- proto.RegisterType((*RepeatedEnum)(nil), "test_proto.RepeatedEnum")
- proto.RegisterType((*MoreRepeated)(nil), "test_proto.MoreRepeated")
- proto.RegisterType((*GroupOld)(nil), "test_proto.GroupOld")
- proto.RegisterType((*GroupOld_G)(nil), "test_proto.GroupOld.G")
- proto.RegisterType((*GroupNew)(nil), "test_proto.GroupNew")
- proto.RegisterType((*GroupNew_G)(nil), "test_proto.GroupNew.G")
- proto.RegisterType((*FloatingPoint)(nil), "test_proto.FloatingPoint")
- proto.RegisterType((*MessageWithMap)(nil), "test_proto.MessageWithMap")
- proto.RegisterMapType((map[bool][]byte)(nil), "test_proto.MessageWithMap.ByteMappingEntry")
- proto.RegisterMapType((map[int64]*FloatingPoint)(nil), "test_proto.MessageWithMap.MsgMappingEntry")
- proto.RegisterMapType((map[int32]string)(nil), "test_proto.MessageWithMap.NameMappingEntry")
- proto.RegisterMapType((map[string]string)(nil), "test_proto.MessageWithMap.StrToStrEntry")
- proto.RegisterType((*Oneof)(nil), "test_proto.Oneof")
- proto.RegisterType((*Oneof_F_Group)(nil), "test_proto.Oneof.F_Group")
- proto.RegisterType((*Communique)(nil), "test_proto.Communique")
- proto.RegisterEnum("test_proto.FOO", FOO_name, FOO_value)
- proto.RegisterEnum("test_proto.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value)
- proto.RegisterEnum("test_proto.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value)
- proto.RegisterEnum("test_proto.DefaultsMessage_DefaultsEnum", DefaultsMessage_DefaultsEnum_name, DefaultsMessage_DefaultsEnum_value)
- proto.RegisterEnum("test_proto.Defaults_Color", Defaults_Color_name, Defaults_Color_value)
- proto.RegisterEnum("test_proto.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_Complex)
- proto.RegisterExtension(E_RComplex)
- 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)
-}
-
-func init() { proto.RegisterFile("test_proto/test.proto", fileDescriptor_test_74787bfc6550f8a7) }
-
-var fileDescriptor_test_74787bfc6550f8a7 = []byte{
- // 4680 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x5b, 0xd9, 0x73, 0x1b, 0x47,
- 0x7a, 0xd7, 0x0c, 0xee, 0x0f, 0x20, 0x31, 0x6c, 0xd1, 0x12, 0x44, 0x59, 0xd2, 0x08, 0x6b, 0xaf,
- 0x61, 0xc9, 0xa2, 0x48, 0x60, 0x08, 0x49, 0x70, 0xec, 0xb2, 0x0e, 0x82, 0x62, 0x49, 0x24, 0xe4,
- 0x21, 0x6d, 0x67, 0x95, 0x07, 0x14, 0x48, 0x0c, 0x40, 0xac, 0x80, 0x19, 0x18, 0x18, 0x44, 0x64,
- 0x52, 0xa9, 0xf2, 0x63, 0xaa, 0xf2, 0x94, 0x4d, 0x52, 0x95, 0xf7, 0xbc, 0xe4, 0x25, 0xd7, 0x43,
- 0xf2, 0x37, 0xc4, 0xd7, 0x5e, 0xde, 0x2b, 0xc9, 0x26, 0x9b, 0xfb, 0xce, 0xe6, 0xde, 0x23, 0x2f,
- 0x4e, 0xf5, 0xd7, 0x3d, 0x33, 0x3d, 0x03, 0xa8, 0x45, 0x3e, 0x71, 0xa6, 0xfb, 0xf7, 0xfd, 0xfa,
- 0xfa, 0xf5, 0xf7, 0xf5, 0xd7, 0x18, 0xc2, 0x0b, 0xae, 0x35, 0x76, 0x9b, 0xc3, 0x91, 0xe3, 0x3a,
- 0xd7, 0xe9, 0xe3, 0x32, 0x3e, 0x12, 0x08, 0x8a, 0x8b, 0x57, 0x21, 0xb9, 0xe1, 0xac, 0xdb, 0x93,
- 0x01, 0xb9, 0x0c, 0xb1, 0x8e, 0xe3, 0x14, 0x14, 0x5d, 0x2d, 0xcd, 0x97, 0xf3, 0xcb, 0x01, 0x66,
- 0xb9, 0xde, 0x68, 0x98, 0xb4, 0xae, 0x78, 0x03, 0xb2, 0x1b, 0xce, 0xae, 0x35, 0x76, 0xeb, 0x3d,
- 0xab, 0xdf, 0x26, 0x8b, 0x90, 0x78, 0xd8, 0xda, 0xb3, 0xfa, 0x68, 0x93, 0x31, 0xd9, 0x0b, 0x21,
- 0x10, 0xdf, 0x3d, 0x1a, 0x5a, 0x05, 0x15, 0x0b, 0xf1, 0xb9, 0xf8, 0x87, 0x45, 0xda, 0x0c, 0xb5,
- 0x24, 0x57, 0x21, 0xfe, 0xa0, 0x67, 0xb7, 0x79, 0x3b, 0x67, 0xc5, 0x76, 0x18, 0x62, 0xf9, 0xc1,
- 0xe6, 0xf6, 0x3d, 0x13, 0x41, 0xb4, 0x85, 0xdd, 0xd6, 0x5e, 0x9f, 0x92, 0x29, 0xb4, 0x05, 0x7c,
- 0xa1, 0xa5, 0x8f, 0x5a, 0xa3, 0xd6, 0xa0, 0x10, 0xd3, 0x95, 0x52, 0xc2, 0x64, 0x2f, 0xe4, 0x0d,
- 0x98, 0x33, 0xad, 0xf7, 0x27, 0xbd, 0x91, 0xd5, 0xc6, 0xee, 0x15, 0xe2, 0xba, 0x5a, 0xca, 0xce,
- 0x6a, 0x01, 0xab, 0xcd, 0x30, 0x9a, 0x99, 0x0f, 0xad, 0x96, 0xeb, 0x99, 0x27, 0xf4, 0xd8, 0x73,
- 0xcc, 0x05, 0x34, 0x35, 0x6f, 0x0c, 0xdd, 0x9e, 0x63, 0xb7, 0xfa, 0xcc, 0x3c, 0xa9, 0x2b, 0x52,
- 0xf3, 0x10, 0x9a, 0x7c, 0x11, 0xf2, 0xf5, 0xe6, 0x1d, 0xc7, 0xe9, 0x37, 0x47, 0xbc, 0x57, 0x05,
- 0xd0, 0xd5, 0x52, 0xda, 0x9c, 0xab, 0xd3, 0x52, 0xaf, 0xab, 0xa4, 0x04, 0x5a, 0xbd, 0xb9, 0x69,
- 0xbb, 0x95, 0x72, 0x00, 0xcc, 0xea, 0x6a, 0x29, 0x61, 0xce, 0xd7, 0xb1, 0x78, 0x0a, 0x59, 0x35,
- 0x02, 0x64, 0x4e, 0x57, 0x4b, 0x31, 0x86, 0xac, 0x1a, 0x3e, 0xf2, 0x35, 0x20, 0xf5, 0x66, 0xbd,
- 0x77, 0x68, 0xb5, 0x45, 0xd6, 0x39, 0x5d, 0x2d, 0xa5, 0x4c, 0xad, 0xce, 0x2b, 0x66, 0xa0, 0x45,
- 0xe6, 0x79, 0x5d, 0x2d, 0x25, 0x3d, 0xb4, 0xc0, 0x7d, 0x05, 0x16, 0xea, 0xcd, 0x77, 0x7a, 0xe1,
- 0x0e, 0xe7, 0x75, 0xb5, 0x34, 0x67, 0xe6, 0xeb, 0xac, 0x7c, 0x1a, 0x2b, 0x12, 0x6b, 0xba, 0x5a,
- 0x8a, 0x73, 0xac, 0xc0, 0x8b, 0xa3, 0xab, 0xf7, 0x9d, 0x96, 0x1b, 0x40, 0x17, 0x74, 0xb5, 0xa4,
- 0x9a, 0xf3, 0x75, 0x2c, 0x0e, 0xb3, 0xde, 0x73, 0x26, 0x7b, 0x7d, 0x2b, 0x80, 0x12, 0x5d, 0x2d,
- 0x29, 0x66, 0xbe, 0xce, 0xca, 0xc3, 0xd8, 0x1d, 0x77, 0xd4, 0xb3, 0xbb, 0x01, 0xf6, 0x34, 0xea,
- 0x38, 0x5f, 0x67, 0xe5, 0xe1, 0x1e, 0xdc, 0x39, 0x72, 0xad, 0x71, 0x00, 0xb5, 0x74, 0xb5, 0x94,
- 0x33, 0xe7, 0xeb, 0x58, 0x1c, 0x61, 0x8d, 0xcc, 0x41, 0x47, 0x57, 0x4b, 0x0b, 0x94, 0x75, 0xc6,
- 0x1c, 0xec, 0x44, 0xe6, 0xa0, 0xab, 0xab, 0x25, 0xc2, 0xb1, 0xc2, 0x1c, 0x2c, 0xc3, 0xe9, 0x7a,
- 0x73, 0xa7, 0x13, 0x5d, 0xb8, 0x03, 0x5d, 0x2d, 0xe5, 0xcd, 0x85, 0xba, 0x57, 0x33, 0x0b, 0x2f,
- 0xb2, 0xf7, 0x74, 0xb5, 0xa4, 0xf9, 0x78, 0x81, 0x5f, 0xd4, 0x24, 0x93, 0x7a, 0x61, 0x51, 0x8f,
- 0x09, 0x9a, 0x64, 0x85, 0x61, 0x4d, 0x72, 0xe0, 0x0b, 0x7a, 0x4c, 0xd4, 0x64, 0x04, 0x89, 0xcd,
- 0x73, 0xe4, 0x19, 0x3d, 0x26, 0x6a, 0x92, 0x23, 0x23, 0x9a, 0xe4, 0xd8, 0xb3, 0x7a, 0x2c, 0xac,
- 0xc9, 0x29, 0xb4, 0xc8, 0x5c, 0xd0, 0x63, 0x61, 0x4d, 0x72, 0x74, 0x58, 0x93, 0x1c, 0x7c, 0x4e,
- 0x8f, 0x85, 0x34, 0x19, 0xc5, 0x8a, 0xc4, 0x4b, 0x7a, 0x2c, 0xa4, 0x49, 0x71, 0x74, 0x9e, 0x26,
- 0x39, 0xf4, 0xbc, 0x1e, 0x13, 0x35, 0x29, 0xb2, 0xfa, 0x9a, 0xe4, 0xd0, 0x17, 0xf5, 0x58, 0x48,
- 0x93, 0x22, 0xd6, 0xd7, 0x24, 0xc7, 0x5e, 0xd0, 0x63, 0x21, 0x4d, 0x72, 0xec, 0xab, 0xa2, 0x26,
- 0x39, 0xf4, 0x43, 0x45, 0x8f, 0x89, 0xa2, 0xe4, 0xd0, 0xab, 0x21, 0x51, 0x72, 0xec, 0x47, 0x14,
- 0x2b, 0xaa, 0x32, 0x0a, 0x16, 0x67, 0xe1, 0x63, 0x0a, 0x16, 0x65, 0xc9, 0xc1, 0xd7, 0x23, 0xb2,
- 0xe4, 0xf0, 0x4f, 0x28, 0x3c, 0xac, 0xcb, 0x69, 0x03, 0x91, 0xff, 0x53, 0x6a, 0x10, 0x16, 0x26,
- 0x37, 0x08, 0x84, 0xe9, 0x70, 0x27, 0x5a, 0xb8, 0xa8, 0x2b, 0xbe, 0x30, 0x3d, 0xcf, 0x2a, 0x0a,
- 0xd3, 0x07, 0x5e, 0xc2, 0x90, 0xc1, 0x85, 0x39, 0x85, 0xac, 0x1a, 0x01, 0x52, 0xd7, 0x95, 0x40,
- 0x98, 0x3e, 0x32, 0x24, 0x4c, 0x1f, 0x7b, 0x59, 0x57, 0x44, 0x61, 0xce, 0x40, 0x8b, 0xcc, 0x45,
- 0x5d, 0x11, 0x85, 0xe9, 0xa3, 0x45, 0x61, 0xfa, 0xe0, 0x2f, 0xe8, 0x8a, 0x20, 0xcc, 0x69, 0xac,
- 0x48, 0xfc, 0x92, 0xae, 0x08, 0xc2, 0x0c, 0x8f, 0x8e, 0x09, 0xd3, 0x87, 0xbe, 0xac, 0x2b, 0x81,
- 0x30, 0xc3, 0xac, 0x5c, 0x98, 0x3e, 0xf4, 0x8b, 0xba, 0x22, 0x08, 0x33, 0x8c, 0xe5, 0xc2, 0xf4,
- 0xb1, 0xaf, 0x60, 0x9c, 0xf6, 0x84, 0xe9, 0x63, 0x05, 0x61, 0xfa, 0xd0, 0xdf, 0xa1, 0x31, 0xdd,
- 0x17, 0xa6, 0x0f, 0x15, 0x85, 0xe9, 0x63, 0x7f, 0x97, 0x62, 0x03, 0x61, 0x4e, 0x83, 0xc5, 0x59,
- 0xf8, 0x3d, 0x0a, 0x0e, 0x84, 0xe9, 0x83, 0xc3, 0xc2, 0xf4, 0xe1, 0xbf, 0x4f, 0xe1, 0xa2, 0x30,
- 0x67, 0x19, 0x88, 0xfc, 0x7f, 0x40, 0x0d, 0x44, 0x61, 0xfa, 0x06, 0xcb, 0x38, 0x4c, 0x2a, 0xcc,
- 0xb6, 0xd5, 0x69, 0x4d, 0xfa, 0x54, 0xc6, 0x25, 0xaa, 0xcc, 0x5a, 0xdc, 0x1d, 0x4d, 0x2c, 0x3a,
- 0x56, 0xc7, 0xe9, 0xdf, 0xf3, 0xea, 0xc8, 0x32, 0xed, 0x3e, 0x13, 0x68, 0x60, 0xf0, 0x2a, 0x55,
- 0x68, 0x4d, 0xad, 0x94, 0xcd, 0x3c, 0x53, 0xe9, 0x34, 0xbe, 0x6a, 0x08, 0xf8, 0x2b, 0x54, 0xa7,
- 0x35, 0xb5, 0x6a, 0x30, 0x7c, 0xd5, 0x08, 0xf0, 0x15, 0x3a, 0x00, 0x4f, 0xac, 0x81, 0xc5, 0x55,
- 0xaa, 0xd6, 0x5a, 0xac, 0x52, 0x5e, 0x31, 0x17, 0x3c, 0xc9, 0xce, 0x32, 0x0a, 0x35, 0xf3, 0x1a,
- 0x15, 0x6d, 0x2d, 0x56, 0x35, 0x7c, 0x23, 0xb1, 0xa5, 0x32, 0x15, 0x3a, 0x97, 0x6e, 0x60, 0x73,
- 0x8d, 0x6a, 0xb7, 0x16, 0xaf, 0x94, 0x57, 0x56, 0x4c, 0x8d, 0x2b, 0x78, 0x86, 0x4d, 0xa8, 0x9d,
- 0x65, 0xaa, 0xe1, 0x5a, 0xbc, 0x6a, 0xf8, 0x36, 0xe1, 0x76, 0x16, 0x3c, 0x29, 0x07, 0x26, 0xd7,
- 0xa9, 0x96, 0x6b, 0xc9, 0xca, 0xaa, 0xb1, 0xba, 0x76, 0xcb, 0xcc, 0x33, 0x4d, 0x07, 0x36, 0x06,
- 0x6d, 0x87, 0x8b, 0x3a, 0x30, 0x5a, 0xa1, 0xaa, 0xae, 0x25, 0xcb, 0x37, 0x56, 0x6f, 0x96, 0x6f,
- 0x9a, 0x1a, 0x57, 0x77, 0x60, 0xf5, 0x26, 0xb5, 0xe2, 0xf2, 0x0e, 0xac, 0x56, 0xa9, 0xbe, 0x6b,
- 0xda, 0x81, 0xd5, 0xef, 0x3b, 0xaf, 0xe9, 0xc5, 0xa7, 0xce, 0xa8, 0xdf, 0xbe, 0x5c, 0x04, 0x53,
- 0xe3, 0x8a, 0x17, 0x5b, 0x5d, 0xf0, 0x24, 0x1f, 0x98, 0xff, 0x2a, 0x3d, 0xb1, 0xe6, 0x6a, 0xa9,
- 0x3b, 0xbd, 0xae, 0xed, 0x8c, 0x2d, 0x33, 0xcf, 0xc4, 0x1f, 0x99, 0x93, 0x9d, 0xe8, 0x3c, 0x7e,
- 0x85, 0x9a, 0x2d, 0xd4, 0x62, 0xd7, 0x2a, 0x65, 0xda, 0xd2, 0xac, 0x79, 0xdc, 0x89, 0xce, 0xe3,
- 0xaf, 0x51, 0x1b, 0x52, 0x8b, 0x5d, 0xab, 0x1a, 0xdc, 0x46, 0x9c, 0xc7, 0x2a, 0x2c, 0x0a, 0x7b,
- 0x21, 0xb0, 0xfa, 0x75, 0x6a, 0x95, 0x67, 0x2d, 0x11, 0x7f, 0x47, 0xcc, 0xb4, 0x0b, 0xb5, 0xf6,
- 0x1b, 0xd4, 0x4e, 0x63, 0xad, 0x11, 0x7f, 0x63, 0x04, 0x76, 0x37, 0xe0, 0x4c, 0xe4, 0x2c, 0xd1,
- 0x1c, 0xb6, 0xf6, 0x9f, 0x58, 0xed, 0x42, 0x99, 0x1e, 0x29, 0xee, 0xa8, 0x9a, 0x62, 0x9e, 0x0e,
- 0x1d, 0x2b, 0x1e, 0x61, 0x35, 0xb9, 0x05, 0x67, 0xa3, 0x87, 0x0b, 0xcf, 0xb2, 0x42, 0xcf, 0x18,
- 0x68, 0xb9, 0x18, 0x3e, 0x67, 0x44, 0x4c, 0x85, 0xa0, 0xe2, 0x99, 0x1a, 0xf4, 0xd0, 0x11, 0x98,
- 0x06, 0xb1, 0x85, 0x9b, 0xbe, 0x01, 0xe7, 0xa6, 0x8f, 0x1f, 0x9e, 0xf1, 0x1a, 0x3d, 0x85, 0xa0,
- 0xf1, 0x99, 0xe8, 0x49, 0x64, 0xca, 0x7c, 0x46, 0xdb, 0x55, 0x7a, 0x2c, 0x11, 0xcd, 0xa7, 0x5a,
- 0x7f, 0x1d, 0x0a, 0x53, 0x07, 0x14, 0xcf, 0xfa, 0x06, 0x3d, 0xa7, 0xa0, 0xf5, 0x0b, 0x91, 0xb3,
- 0x4a, 0xd4, 0x78, 0x46, 0xd3, 0x37, 0xe9, 0xc1, 0x45, 0x30, 0x9e, 0x6a, 0x19, 0xa7, 0x2c, 0x7c,
- 0x84, 0xf1, 0x6c, 0x6f, 0xd1, 0x93, 0x0c, 0x9f, 0xb2, 0xd0, 0x69, 0x46, 0x6c, 0x37, 0x72, 0xa6,
- 0xf1, 0x6c, 0x6b, 0xf4, 0x68, 0xc3, 0xdb, 0x0d, 0x1f, 0x6f, 0xb8, 0xf1, 0xcf, 0x50, 0xe3, 0x9d,
- 0xd9, 0x23, 0xfe, 0x51, 0x8c, 0x1e, 0x4a, 0xb8, 0xf5, 0xce, 0xac, 0x21, 0xfb, 0xd6, 0x33, 0x86,
- 0xfc, 0x63, 0x6a, 0x4d, 0x04, 0xeb, 0xa9, 0x31, 0xbf, 0x05, 0x4b, 0x33, 0xce, 0x2b, 0x9e, 0xfd,
- 0x4f, 0xa8, 0x7d, 0x1e, 0xed, 0xcf, 0x4e, 0x1d, 0x5d, 0xa6, 0x19, 0x66, 0xf4, 0xe0, 0xa7, 0x94,
- 0x41, 0x0b, 0x31, 0x4c, 0xf5, 0xa1, 0x0e, 0x73, 0xde, 0x79, 0xbc, 0x3b, 0x72, 0x26, 0xc3, 0x42,
- 0x5d, 0x57, 0x4b, 0x50, 0xd6, 0x67, 0x64, 0xc7, 0xde, 0xf1, 0x7c, 0x83, 0xe2, 0xcc, 0xb0, 0x19,
- 0xe3, 0x61, 0xcc, 0x8c, 0xe7, 0x91, 0x1e, 0x7b, 0x26, 0x0f, 0xc3, 0xf9, 0x3c, 0x82, 0x19, 0xe5,
- 0xf1, 0xc2, 0x1d, 0xe3, 0x79, 0xac, 0x2b, 0xcf, 0xe0, 0xf1, 0x82, 0x1f, 0xe7, 0x09, 0x99, 0x2d,
- 0xad, 0x05, 0x39, 0x39, 0xd6, 0x93, 0x97, 0xa2, 0x49, 0xfa, 0x06, 0x66, 0x57, 0xe1, 0x42, 0x66,
- 0x26, 0x74, 0x6f, 0xda, 0xec, 0xed, 0x67, 0x98, 0x85, 0x7a, 0x33, 0x6d, 0xf6, 0x73, 0x33, 0xcc,
- 0x8a, 0xbf, 0xa9, 0x40, 0xfc, 0xc1, 0xe6, 0xf6, 0x3d, 0x92, 0x86, 0xf8, 0xbb, 0x8d, 0xcd, 0x7b,
- 0xda, 0x29, 0xfa, 0x74, 0xa7, 0xd1, 0x78, 0xa8, 0x29, 0x24, 0x03, 0x89, 0x3b, 0x5f, 0xda, 0x5d,
- 0xdf, 0xd1, 0x54, 0x92, 0x87, 0x6c, 0x7d, 0x73, 0x7b, 0x63, 0xdd, 0x7c, 0x64, 0x6e, 0x6e, 0xef,
- 0x6a, 0x31, 0x5a, 0x57, 0x7f, 0xd8, 0xb8, 0xbd, 0xab, 0xc5, 0x49, 0x0a, 0x62, 0xb4, 0x2c, 0x41,
- 0x00, 0x92, 0x3b, 0xbb, 0xe6, 0xe6, 0xf6, 0x86, 0x96, 0xa4, 0x2c, 0xbb, 0x9b, 0x5b, 0xeb, 0x5a,
- 0x8a, 0x22, 0x77, 0xdf, 0x79, 0xf4, 0x70, 0x5d, 0x4b, 0xd3, 0xc7, 0xdb, 0xa6, 0x79, 0xfb, 0x4b,
- 0x5a, 0x86, 0x1a, 0x6d, 0xdd, 0x7e, 0xa4, 0x01, 0x56, 0xdf, 0xbe, 0xf3, 0x70, 0x5d, 0xcb, 0x92,
- 0x1c, 0xa4, 0xeb, 0xef, 0x6c, 0xdf, 0xdd, 0xdd, 0x6c, 0x6c, 0x6b, 0xb9, 0xe2, 0x2f, 0x42, 0x81,
- 0x4d, 0x73, 0x68, 0x16, 0xd9, 0x95, 0xc1, 0x5b, 0x90, 0x60, 0x6b, 0xa3, 0xa0, 0x56, 0xae, 0x4c,
- 0xaf, 0xcd, 0xb4, 0xd1, 0x32, 0x5b, 0x25, 0x66, 0xb8, 0x74, 0x01, 0x12, 0x6c, 0x9e, 0x16, 0x21,
- 0xc1, 0xe6, 0x47, 0xc5, 0xab, 0x04, 0xf6, 0x52, 0xfc, 0x2d, 0x15, 0x60, 0xc3, 0xd9, 0x79, 0xd2,
- 0x1b, 0xe2, 0xc5, 0xcd, 0x05, 0x80, 0xf1, 0x93, 0xde, 0xb0, 0x89, 0x3b, 0x90, 0x5f, 0x3a, 0x64,
- 0x68, 0x09, 0xfa, 0x5e, 0x72, 0x19, 0x72, 0x58, 0xcd, 0xb7, 0x08, 0xde, 0x35, 0xa4, 0xcc, 0x2c,
- 0x2d, 0xe3, 0x4e, 0x32, 0x0c, 0xa9, 0x1a, 0x78, 0xc5, 0x90, 0x14, 0x20, 0x55, 0x83, 0x5c, 0x02,
- 0x7c, 0x6d, 0x8e, 0x31, 0x9a, 0xe2, 0xb5, 0x42, 0xc6, 0xc4, 0x76, 0x59, 0x7c, 0x25, 0x6f, 0x02,
- 0xb6, 0xc9, 0x46, 0x9e, 0x9f, 0xb5, 0x4b, 0xbc, 0x0e, 0x2f, 0xd3, 0x07, 0x36, 0xde, 0xc0, 0x64,
- 0xa9, 0x01, 0x19, 0xbf, 0x9c, 0xb6, 0x86, 0xa5, 0x7c, 0x4c, 0x1a, 0x8e, 0x09, 0xb0, 0xc8, 0x1f,
- 0x14, 0x03, 0xf0, 0xfe, 0x2c, 0x60, 0x7f, 0x98, 0x11, 0xeb, 0x50, 0xf1, 0x02, 0xcc, 0x6d, 0x3b,
- 0x36, 0xdb, 0xc7, 0x38, 0x4f, 0x39, 0x50, 0x5a, 0x05, 0x05, 0xf3, 0x5f, 0xa5, 0x55, 0xbc, 0x08,
- 0x20, 0xd4, 0x69, 0xa0, 0xec, 0xb1, 0x3a, 0xf4, 0x07, 0xca, 0x5e, 0xf1, 0x2a, 0x24, 0xb7, 0x5a,
- 0x87, 0xbb, 0xad, 0x2e, 0xb9, 0x0c, 0xd0, 0x6f, 0x8d, 0xdd, 0x66, 0x07, 0x57, 0xe2, 0xf3, 0xcf,
- 0x3f, 0xff, 0x5c, 0xc1, 0xc3, 0x74, 0x86, 0x96, 0xb2, 0x15, 0x19, 0x03, 0x34, 0xfa, 0xed, 0x2d,
- 0x6b, 0x3c, 0x6e, 0x75, 0x2d, 0xb2, 0x06, 0x49, 0xdb, 0x1a, 0xd3, 0xe8, 0xab, 0xe0, 0x5d, 0xd3,
- 0x05, 0x71, 0x1e, 0x02, 0xdc, 0xf2, 0x36, 0x82, 0x4c, 0x0e, 0x26, 0x1a, 0xc4, 0xec, 0xc9, 0x00,
- 0x6f, 0xd4, 0x12, 0x26, 0x7d, 0x5c, 0x7a, 0x11, 0x92, 0x0c, 0x43, 0x08, 0xc4, 0xed, 0xd6, 0xc0,
- 0x2a, 0xb0, 0x96, 0xf1, 0xb9, 0xf8, 0x15, 0x05, 0x60, 0xdb, 0x7a, 0x7a, 0xac, 0x56, 0x03, 0x9c,
- 0xa4, 0xd5, 0x18, 0x6b, 0xf5, 0x75, 0x59, 0xab, 0x54, 0x6d, 0x1d, 0xc7, 0x69, 0x37, 0xd9, 0x42,
- 0xb3, 0xeb, 0xbf, 0x0c, 0x2d, 0xc1, 0x95, 0x2b, 0x3e, 0x86, 0xdc, 0xa6, 0x6d, 0x5b, 0x23, 0xaf,
- 0x57, 0x04, 0xe2, 0x07, 0xce, 0xd8, 0xe5, 0x37, 0x91, 0xf8, 0x4c, 0x0a, 0x10, 0x1f, 0x3a, 0x23,
- 0x97, 0x8d, 0xb4, 0x16, 0x37, 0x56, 0x56, 0x56, 0x4c, 0x2c, 0x21, 0x2f, 0x42, 0x66, 0xdf, 0xb1,
- 0x6d, 0x6b, 0x9f, 0x0e, 0x23, 0x86, 0xa9, 0x63, 0x50, 0x50, 0xfc, 0x65, 0x05, 0x72, 0x0d, 0xf7,
- 0x20, 0x20, 0xd7, 0x20, 0xf6, 0xc4, 0x3a, 0xc2, 0xee, 0xc5, 0x4c, 0xfa, 0x48, 0x37, 0xcc, 0xcf,
- 0xb7, 0xfa, 0x13, 0x76, 0x2f, 0x99, 0x33, 0xd9, 0x0b, 0x39, 0x03, 0xc9, 0xa7, 0x56, 0xaf, 0x7b,
- 0xe0, 0x22, 0xa7, 0x6a, 0xf2, 0x37, 0xb2, 0x0c, 0x89, 0x1e, 0xed, 0x6c, 0x21, 0x8e, 0x33, 0x56,
- 0x10, 0x67, 0x4c, 0x1c, 0x85, 0xc9, 0x60, 0x57, 0xd2, 0xe9, 0xb6, 0xf6, 0xc1, 0x07, 0x1f, 0x7c,
- 0xa0, 0x16, 0x0f, 0x60, 0xd1, 0xdb, 0xc4, 0xa1, 0xe1, 0x3e, 0x82, 0x42, 0xdf, 0x72, 0x9a, 0x9d,
- 0x9e, 0xdd, 0xea, 0xf7, 0x8f, 0x9a, 0x4f, 0x1d, 0xbb, 0xd9, 0xb2, 0x9b, 0xce, 0x78, 0xbf, 0x35,
- 0xc2, 0x29, 0x90, 0x35, 0xb2, 0xd8, 0xb7, 0x9c, 0x3a, 0x33, 0x7c, 0xcf, 0xb1, 0x6f, 0xdb, 0x0d,
- 0x6a, 0x55, 0xfc, 0x2c, 0x0e, 0x99, 0xad, 0x23, 0x8f, 0x7f, 0x11, 0x12, 0xfb, 0xce, 0xc4, 0x66,
- 0xf3, 0x99, 0x30, 0xd9, 0x8b, 0xbf, 0x4e, 0xaa, 0xb0, 0x4e, 0x8b, 0x90, 0x78, 0x7f, 0xe2, 0xb8,
- 0x16, 0x0e, 0x39, 0x63, 0xb2, 0x17, 0x3a, 0x63, 0x43, 0xcb, 0x2d, 0xc4, 0xf1, 0x9a, 0x82, 0x3e,
- 0x06, 0x73, 0x90, 0x38, 0xd6, 0x1c, 0x90, 0x15, 0x48, 0x3a, 0x74, 0x0d, 0xc6, 0x85, 0x24, 0xde,
- 0xc3, 0x86, 0x0c, 0xc4, 0xd5, 0x31, 0x39, 0x8e, 0x3c, 0x80, 0x85, 0xa7, 0x56, 0x73, 0x30, 0x19,
- 0xbb, 0xcd, 0xae, 0xd3, 0x6c, 0x5b, 0xd6, 0xd0, 0x1a, 0x15, 0xe6, 0xb0, 0xb5, 0x90, 0x87, 0x98,
- 0x35, 0xa1, 0xe6, 0xfc, 0x53, 0x6b, 0x6b, 0x32, 0x76, 0x37, 0x9c, 0x7b, 0x68, 0x47, 0xd6, 0x20,
- 0x33, 0xb2, 0xa8, 0x5f, 0xa0, 0x5d, 0xce, 0x4d, 0xf7, 0x20, 0x64, 0x9c, 0x1e, 0x59, 0x43, 0x2c,
- 0x20, 0x37, 0x20, 0xbd, 0xd7, 0x7b, 0x62, 0x8d, 0x0f, 0xac, 0x76, 0x21, 0xa5, 0x2b, 0xa5, 0xf9,
- 0xf2, 0x79, 0xd1, 0xca, 0x9f, 0xe0, 0xe5, 0xbb, 0x4e, 0xdf, 0x19, 0x99, 0x3e, 0x98, 0xbc, 0x01,
- 0x99, 0xb1, 0x33, 0xb0, 0x98, 0xda, 0xd3, 0x18, 0x6c, 0x2f, 0xcd, 0xb6, 0xdc, 0x71, 0x06, 0x96,
- 0xe7, 0xd5, 0x3c, 0x0b, 0x72, 0x9e, 0x75, 0x77, 0x8f, 0x26, 0x13, 0x05, 0xc0, 0x0b, 0x1f, 0xda,
- 0x29, 0x4c, 0x2e, 0xc8, 0x12, 0xed, 0x54, 0xb7, 0x43, 0xcf, 0x6c, 0x85, 0x2c, 0xe6, 0xf2, 0xfe,
- 0xfb, 0xd2, 0x6b, 0x90, 0xf1, 0x09, 0x03, 0x77, 0xc8, 0x5c, 0x50, 0x06, 0x3d, 0x04, 0x73, 0x87,
- 0xcc, 0xff, 0xbc, 0x0c, 0x09, 0xec, 0x38, 0x8d, 0x5c, 0xe6, 0x3a, 0x0d, 0x94, 0x19, 0x48, 0x6c,
- 0x98, 0xeb, 0xeb, 0xdb, 0x9a, 0x82, 0x31, 0xf3, 0xe1, 0x3b, 0xeb, 0x9a, 0x2a, 0xe8, 0xf7, 0xb7,
- 0x55, 0x88, 0xad, 0x1f, 0xa2, 0x72, 0xda, 0x2d, 0xb7, 0xe5, 0xed, 0x70, 0xfa, 0x4c, 0x6a, 0x90,
- 0x19, 0xb4, 0xbc, 0xb6, 0x54, 0x9c, 0xe2, 0x90, 0x2f, 0x59, 0x3f, 0x74, 0x97, 0xb7, 0x5a, 0xac,
- 0xe5, 0x75, 0xdb, 0x1d, 0x1d, 0x99, 0xe9, 0x01, 0x7f, 0x5d, 0x7a, 0x1d, 0xe6, 0x42, 0x55, 0xe2,
- 0x16, 0x4d, 0xcc, 0xd8, 0xa2, 0x09, 0xbe, 0x45, 0x6b, 0xea, 0x4d, 0xa5, 0x5c, 0x83, 0xf8, 0xc0,
- 0x19, 0x59, 0xe4, 0x85, 0x99, 0x13, 0x5c, 0xe8, 0xa2, 0x64, 0xf2, 0x91, 0xae, 0x98, 0x68, 0x53,
- 0x7e, 0x15, 0xe2, 0xae, 0x75, 0xe8, 0x3e, 0xcb, 0xf6, 0x80, 0x8d, 0x8f, 0x42, 0xca, 0xd7, 0x20,
- 0x69, 0x4f, 0x06, 0x7b, 0xd6, 0xe8, 0x59, 0xe0, 0x1e, 0x76, 0x8c, 0x83, 0x8a, 0xef, 0x82, 0x76,
- 0xd7, 0x19, 0x0c, 0xfb, 0xd6, 0xe1, 0xfa, 0xa1, 0x6b, 0xd9, 0xe3, 0x9e, 0x63, 0xd3, 0x31, 0x74,
- 0x7a, 0x23, 0x74, 0x6b, 0x38, 0x06, 0x7c, 0xa1, 0x6e, 0x66, 0x6c, 0xed, 0x3b, 0x76, 0x9b, 0x0f,
- 0x8d, 0xbf, 0x51, 0xb4, 0x7b, 0xd0, 0x1b, 0x51, 0x8f, 0x46, 0x83, 0x0f, 0x7b, 0x29, 0x6e, 0x40,
- 0x9e, 0xa7, 0x61, 0x63, 0xde, 0x70, 0xf1, 0x0a, 0xe4, 0xbc, 0x22, 0xfc, 0xe5, 0x27, 0x0d, 0xf1,
- 0xc7, 0xeb, 0x66, 0x43, 0x3b, 0x45, 0xd7, 0xb5, 0xb1, 0xbd, 0xae, 0x29, 0xf4, 0x61, 0xf7, 0xbd,
- 0x46, 0x68, 0x2d, 0x5f, 0x84, 0x9c, 0xdf, 0xf7, 0x1d, 0xcb, 0xc5, 0x1a, 0x1a, 0xa5, 0x52, 0x35,
- 0x35, 0xad, 0x14, 0x53, 0x90, 0x58, 0x1f, 0x0c, 0xdd, 0xa3, 0xe2, 0x2f, 0x41, 0x96, 0x83, 0x1e,
- 0xf6, 0xc6, 0x2e, 0xb9, 0x05, 0xa9, 0x01, 0x1f, 0xaf, 0x82, 0x67, 0xd1, 0xb0, 0xac, 0x03, 0xa4,
- 0xf7, 0x6c, 0x7a, 0xf8, 0xa5, 0x0a, 0xa4, 0x04, 0xf7, 0xce, 0x3d, 0x8f, 0x2a, 0x7a, 0x1e, 0xe6,
- 0xa3, 0x62, 0x82, 0x8f, 0x2a, 0x6e, 0x41, 0x8a, 0x05, 0xe6, 0x31, 0x1e, 0x37, 0x58, 0xfe, 0xce,
- 0x34, 0xc6, 0xc4, 0x97, 0x65, 0x65, 0xec, 0x0c, 0x75, 0x09, 0xb2, 0xb8, 0x67, 0x7c, 0x15, 0x52,
- 0x6f, 0x0e, 0x58, 0xc4, 0x14, 0xff, 0x47, 0x09, 0x48, 0x7b, 0x73, 0x45, 0xce, 0x43, 0x92, 0x25,
- 0xb1, 0x48, 0xe5, 0x5d, 0xea, 0x24, 0x30, 0x6d, 0x25, 0xe7, 0x21, 0xc5, 0x13, 0x55, 0x1e, 0x70,
- 0xd4, 0x4a, 0xd9, 0x4c, 0xb2, 0xc4, 0xd4, 0xaf, 0xac, 0x1a, 0xe8, 0x27, 0xd9, 0x75, 0x4d, 0x92,
- 0xa5, 0x9e, 0x44, 0x87, 0x8c, 0x9f, 0x6c, 0x62, 0x88, 0xe0, 0x77, 0x33, 0x69, 0x2f, 0xbb, 0x14,
- 0x10, 0x55, 0x03, 0x1d, 0x28, 0xbf, 0x88, 0x49, 0xd7, 0x83, 0x73, 0x53, 0xda, 0x4b, 0x19, 0xf1,
- 0x97, 0x27, 0xef, 0xd6, 0x25, 0xc5, 0x93, 0xc4, 0x00, 0x50, 0x35, 0xd0, 0x33, 0x79, 0x57, 0x2c,
- 0x29, 0x9e, 0x08, 0x92, 0x4b, 0xb4, 0x8b, 0x98, 0xd8, 0xa1, 0xff, 0x09, 0xee, 0x53, 0x92, 0x2c,
- 0xdd, 0x23, 0x97, 0x29, 0x03, 0xcb, 0xde, 0xd0, 0x35, 0x04, 0x97, 0x27, 0x29, 0x9e, 0xd4, 0x91,
- 0xab, 0x14, 0xc2, 0xa6, 0xbf, 0x00, 0xcf, 0xb8, 0x29, 0x49, 0xf1, 0x9b, 0x12, 0xa2, 0xd3, 0x06,
- 0xd1, 0x43, 0xa1, 0x57, 0x12, 0x6e, 0x45, 0x92, 0xec, 0x56, 0x84, 0x5c, 0x44, 0x3a, 0x36, 0xa8,
- 0x5c, 0x70, 0x03, 0x92, 0xe2, 0x59, 0x60, 0x50, 0x8f, 0x67, 0x49, 0xff, 0xb6, 0x23, 0xc5, 0xf3,
- 0x3c, 0x72, 0x93, 0xae, 0x17, 0x55, 0x78, 0x61, 0x1e, 0x7d, 0xf1, 0x92, 0x28, 0x3d, 0x6f, 0x55,
- 0x99, 0x2b, 0xae, 0x31, 0x37, 0x66, 0x26, 0xea, 0xb8, 0x23, 0x96, 0xa8, 0xe5, 0xa3, 0x9e, 0xdd,
- 0x29, 0xe4, 0x71, 0x2e, 0x62, 0x3d, 0xbb, 0x63, 0x26, 0xea, 0xb4, 0x84, 0xa9, 0x60, 0x9b, 0xd6,
- 0x69, 0x58, 0x17, 0xbf, 0xc6, 0x2a, 0x69, 0x11, 0x29, 0x40, 0xa2, 0xde, 0xdc, 0x6e, 0xd9, 0x85,
- 0x05, 0x66, 0x67, 0xb7, 0x6c, 0x33, 0x5e, 0xdf, 0x6e, 0xd9, 0xe4, 0x55, 0x88, 0x8d, 0x27, 0x7b,
- 0x05, 0x32, 0xfd, 0xb3, 0xe0, 0xce, 0x64, 0xcf, 0xeb, 0x8c, 0x49, 0x31, 0xe4, 0x3c, 0xa4, 0xc7,
- 0xee, 0xa8, 0xf9, 0x0b, 0xd6, 0xc8, 0x29, 0x9c, 0xc6, 0x69, 0x3c, 0x65, 0xa6, 0xc6, 0xee, 0xe8,
- 0xb1, 0x35, 0x72, 0x8e, 0xe9, 0x83, 0x8b, 0x17, 0x21, 0x2b, 0xf0, 0x92, 0x3c, 0x28, 0x36, 0x3b,
- 0xc0, 0xd4, 0x94, 0x1b, 0xa6, 0x62, 0x17, 0xdf, 0x85, 0x9c, 0x97, 0x62, 0xe1, 0x88, 0x0d, 0xba,
- 0x9b, 0xfa, 0xce, 0x08, 0x77, 0xe9, 0x7c, 0xf9, 0x62, 0x38, 0x62, 0x06, 0x40, 0x1e, 0xb9, 0x18,
- 0xb8, 0xa8, 0x45, 0x3a, 0xa3, 0x14, 0x7f, 0xa0, 0x40, 0x6e, 0xcb, 0x19, 0x05, 0xbf, 0x5f, 0x2c,
- 0x42, 0x62, 0xcf, 0x71, 0xfa, 0x63, 0x24, 0x4e, 0x9b, 0xec, 0x85, 0xbc, 0x0c, 0x39, 0x7c, 0xf0,
- 0x92, 0x64, 0xd5, 0xbf, 0x05, 0xca, 0x62, 0x39, 0xcf, 0x8b, 0x09, 0xc4, 0x7b, 0xb6, 0x3b, 0xe6,
- 0x1e, 0x0d, 0x9f, 0xc9, 0x17, 0x20, 0x4b, 0xff, 0x7a, 0x96, 0x71, 0xff, 0x34, 0x0d, 0xb4, 0x98,
- 0x1b, 0xbe, 0x02, 0x73, 0xa8, 0x01, 0x1f, 0x96, 0xf2, 0x6f, 0x7c, 0x72, 0xac, 0x82, 0x03, 0x0b,
- 0x90, 0x62, 0x0e, 0x61, 0x8c, 0x3f, 0xf8, 0x66, 0x4c, 0xef, 0x95, 0xba, 0x59, 0x4c, 0x54, 0xd8,
- 0x09, 0x24, 0x65, 0xf2, 0xb7, 0xe2, 0x5d, 0x48, 0x63, 0xb8, 0x6c, 0xf4, 0xdb, 0xe4, 0x25, 0x50,
- 0xba, 0x05, 0x0b, 0xc3, 0xf5, 0x99, 0x50, 0x16, 0xc2, 0x01, 0xcb, 0x1b, 0xa6, 0xd2, 0x5d, 0x5a,
- 0x00, 0x65, 0x83, 0xa6, 0x05, 0x87, 0xdc, 0x61, 0x2b, 0x87, 0xc5, 0xb7, 0x39, 0xc9, 0xb6, 0xf5,
- 0x54, 0x4e, 0xb2, 0x6d, 0x3d, 0x65, 0x24, 0x97, 0xa6, 0x48, 0xe8, 0xdb, 0x11, 0xff, 0x0d, 0x5c,
- 0x39, 0x2a, 0x56, 0x60, 0x0e, 0x37, 0x6a, 0xcf, 0xee, 0x3e, 0x72, 0x7a, 0x36, 0x26, 0x22, 0x1d,
- 0x3c, 0xc0, 0x29, 0xa6, 0xd2, 0xa1, 0xeb, 0x60, 0x1d, 0xb6, 0xf6, 0xd9, 0x71, 0x38, 0x6d, 0xb2,
- 0x97, 0xe2, 0xf7, 0xe3, 0x30, 0xcf, 0x9d, 0xec, 0x7b, 0x3d, 0xf7, 0x60, 0xab, 0x35, 0x24, 0xdb,
- 0x90, 0xa3, 0xfe, 0xb5, 0x39, 0x68, 0x0d, 0x87, 0x74, 0x23, 0x2b, 0x18, 0x9a, 0xaf, 0xce, 0x70,
- 0xdb, 0xdc, 0x62, 0x79, 0xbb, 0x35, 0xb0, 0xb6, 0x18, 0x9a, 0x05, 0xea, 0xac, 0x1d, 0x94, 0x90,
- 0x07, 0x90, 0x1d, 0x8c, 0xbb, 0x3e, 0x1d, 0x8b, 0xf4, 0x57, 0x24, 0x74, 0x5b, 0xe3, 0x6e, 0x88,
- 0x0d, 0x06, 0x7e, 0x01, 0xed, 0x1c, 0xf5, 0xce, 0x3e, 0x5b, 0xec, 0xb9, 0x9d, 0xa3, 0xae, 0x24,
- 0xdc, 0xb9, 0xbd, 0xa0, 0x84, 0xd4, 0x01, 0xe8, 0x56, 0x73, 0x1d, 0x9a, 0xe1, 0xa1, 0x96, 0xb2,
- 0xe5, 0x92, 0x84, 0x6d, 0xc7, 0x1d, 0xed, 0x3a, 0x3b, 0xee, 0x88, 0x1f, 0x48, 0xc6, 0xfc, 0x75,
- 0xe9, 0x4d, 0xd0, 0xa2, 0xb3, 0xf0, 0xbc, 0x33, 0x49, 0x46, 0x38, 0x93, 0x2c, 0xfd, 0x2c, 0xe4,
- 0x23, 0xc3, 0x16, 0xcd, 0x09, 0x33, 0xbf, 0x2e, 0x9a, 0x67, 0xcb, 0xe7, 0x42, 0xdf, 0x68, 0x88,
- 0x4b, 0x2f, 0x32, 0xbf, 0x09, 0x5a, 0x74, 0x0a, 0x44, 0xea, 0xb4, 0x24, 0xa1, 0x41, 0xfb, 0xd7,
- 0x61, 0x2e, 0x34, 0x68, 0xd1, 0x38, 0xf3, 0x9c, 0x61, 0x15, 0x7f, 0x25, 0x01, 0x89, 0x86, 0x6d,
- 0x39, 0x1d, 0x72, 0x36, 0x1c, 0x3b, 0xef, 0x9f, 0xf2, 0xe2, 0xe6, 0xb9, 0x48, 0xdc, 0xbc, 0x7f,
- 0xca, 0x8f, 0x9a, 0xe7, 0x22, 0x51, 0xd3, 0xab, 0xaa, 0x1a, 0xe4, 0xc2, 0x54, 0xcc, 0xbc, 0x7f,
- 0x4a, 0x08, 0x98, 0x17, 0xa6, 0x02, 0x66, 0x50, 0x5d, 0x35, 0xa8, 0x83, 0x0d, 0x47, 0xcb, 0xfb,
- 0xa7, 0x82, 0x48, 0x79, 0x3e, 0x1a, 0x29, 0xfd, 0xca, 0xaa, 0xc1, 0xba, 0x24, 0x44, 0x49, 0xec,
- 0x12, 0x8b, 0x8f, 0xe7, 0xa3, 0xf1, 0x11, 0xed, 0x78, 0x64, 0x3c, 0x1f, 0x8d, 0x8c, 0x58, 0xc9,
- 0x23, 0xe1, 0xb9, 0x48, 0x24, 0x44, 0x52, 0x16, 0x02, 0xcf, 0x47, 0x43, 0x20, 0xb3, 0x13, 0x7a,
- 0x2a, 0xc6, 0x3f, 0xbf, 0xb2, 0x6a, 0x10, 0x23, 0x12, 0xfc, 0x64, 0x89, 0x08, 0xae, 0x06, 0x86,
- 0x81, 0x2a, 0x9d, 0x38, 0xef, 0x80, 0x9a, 0x97, 0x7e, 0xc2, 0x82, 0x33, 0xea, 0x1d, 0xd0, 0x0c,
- 0x48, 0x75, 0x78, 0xae, 0xae, 0xa1, 0x27, 0x0b, 0x89, 0x13, 0x25, 0xb0, 0x5c, 0x6f, 0xa2, 0x47,
- 0xa3, 0xa3, 0xeb, 0xb0, 0x84, 0xa3, 0x04, 0x73, 0xf5, 0xe6, 0xc3, 0xd6, 0xa8, 0x4b, 0xa1, 0xbb,
- 0xad, 0xae, 0x7f, 0xeb, 0x41, 0x55, 0x90, 0xad, 0xf3, 0x9a, 0xdd, 0x56, 0x97, 0x9c, 0xf1, 0x24,
- 0xd6, 0xc6, 0x5a, 0x85, 0x8b, 0x6c, 0xe9, 0x2c, 0x9d, 0x3a, 0x46, 0x86, 0xbe, 0x71, 0x81, 0xfb,
- 0xc6, 0x3b, 0x29, 0x48, 0x4c, 0xec, 0x9e, 0x63, 0xdf, 0xc9, 0x40, 0xca, 0x75, 0x46, 0x83, 0x96,
- 0xeb, 0x14, 0x7f, 0xa8, 0x00, 0xdc, 0x75, 0x06, 0x83, 0x89, 0xdd, 0x7b, 0x7f, 0x62, 0x91, 0x8b,
- 0x90, 0x1d, 0xb4, 0x9e, 0x58, 0xcd, 0x81, 0xd5, 0xdc, 0x1f, 0x79, 0xbb, 0x21, 0x43, 0x8b, 0xb6,
- 0xac, 0xbb, 0xa3, 0x23, 0x52, 0xf0, 0x0e, 0xf0, 0xa8, 0x20, 0x14, 0x26, 0x3f, 0xd0, 0x2f, 0xf2,
- 0xe3, 0x68, 0x92, 0xaf, 0xa4, 0x77, 0x20, 0x65, 0x49, 0x4e, 0x8a, 0xaf, 0x21, 0x4b, 0x73, 0xce,
- 0x42, 0xd2, 0xb5, 0x06, 0xc3, 0xe6, 0x3e, 0x0a, 0x86, 0x8a, 0x22, 0x41, 0xdf, 0xef, 0x92, 0xeb,
- 0x10, 0xdb, 0x77, 0xfa, 0x28, 0x95, 0xe7, 0xae, 0x0e, 0x45, 0x92, 0x57, 0x20, 0x36, 0x18, 0x33,
- 0xf9, 0x64, 0xcb, 0xa7, 0x43, 0x27, 0x08, 0x16, 0xb2, 0x28, 0x70, 0x30, 0xee, 0xfa, 0x63, 0xbf,
- 0x92, 0x87, 0x58, 0xbd, 0xd1, 0xa0, 0xa7, 0x82, 0x7a, 0xa3, 0xb1, 0xaa, 0x29, 0xb5, 0x55, 0x48,
- 0x77, 0x47, 0x96, 0x45, 0x1d, 0xc5, 0xb3, 0xb2, 0x92, 0x2f, 0x63, 0x14, 0xf4, 0x61, 0xb5, 0xb7,
- 0x21, 0xb5, 0xcf, 0xf2, 0x12, 0xf2, 0xcc, 0x1c, 0xbc, 0xf0, 0xc7, 0xec, 0x2e, 0xe8, 0x45, 0x11,
- 0x10, 0xcd, 0x66, 0x4c, 0x8f, 0xa7, 0xb6, 0x0b, 0x99, 0x51, 0xf3, 0xf9, 0xa4, 0x1f, 0xb2, 0xc8,
- 0x23, 0x27, 0x4d, 0x8f, 0x78, 0x51, 0x6d, 0x03, 0x16, 0x6c, 0xc7, 0xfb, 0x49, 0xaa, 0xd9, 0xe6,
- 0xfb, 0x6e, 0xd6, 0x91, 0xcf, 0x6b, 0xc0, 0x62, 0x3f, 0x6c, 0xdb, 0x0e, 0xaf, 0x60, 0x7b, 0xb5,
- 0xb6, 0x0e, 0x9a, 0x40, 0xd4, 0x61, 0x9b, 0x5b, 0xc6, 0xd3, 0x61, 0xbf, 0xa5, 0xfb, 0x3c, 0xe8,
- 0x0f, 0x22, 0x34, 0x7c, 0xc7, 0xca, 0x68, 0xba, 0xec, 0xd3, 0x04, 0x9f, 0x06, 0x9d, 0xe0, 0x34,
- 0x0d, 0xf5, 0x5f, 0x32, 0x9a, 0x03, 0xf6, 0xdd, 0x82, 0x48, 0x53, 0x35, 0x22, 0xb3, 0x33, 0x39,
- 0x46, 0x77, 0x7a, 0xec, 0xc3, 0x03, 0x9f, 0x87, 0xb9, 0xc7, 0x19, 0x44, 0xcf, 0xeb, 0xd0, 0x97,
- 0xd9, 0x57, 0x09, 0x21, 0xa2, 0xa9, 0x1e, 0x8d, 0x8f, 0xd1, 0xa3, 0x27, 0xec, 0x23, 0x00, 0x9f,
- 0x68, 0x67, 0x56, 0x8f, 0xc6, 0xc7, 0xe8, 0x51, 0x9f, 0x7d, 0x20, 0x10, 0x22, 0xaa, 0x1a, 0xb5,
- 0x4d, 0x20, 0xe2, 0xc2, 0xf3, 0x58, 0x22, 0x65, 0x1a, 0xb0, 0x0f, 0x3f, 0x82, 0xa5, 0x67, 0x46,
- 0xb3, 0xa8, 0x9e, 0xd7, 0x29, 0x9b, 0x7d, 0x15, 0x12, 0xa6, 0xaa, 0x1a, 0xb5, 0x07, 0x70, 0x5a,
- 0x1c, 0xde, 0xb1, 0xba, 0xe5, 0xb0, 0x4f, 0x1a, 0x82, 0x01, 0x72, 0xab, 0x99, 0x64, 0xcf, 0xeb,
- 0xd8, 0x90, 0x7d, 0xee, 0x10, 0x21, 0xab, 0x1a, 0xb5, 0xbb, 0x90, 0x17, 0xc8, 0xf6, 0x30, 0x0b,
- 0x96, 0x11, 0xbd, 0xcf, 0x3e, 0xd2, 0xf1, 0x89, 0x68, 0xfc, 0x8f, 0xae, 0x1e, 0x8b, 0x88, 0x52,
- 0x9a, 0x11, 0xfb, 0xc6, 0x24, 0xe8, 0x0f, 0xda, 0x44, 0x36, 0xca, 0x1e, 0x0b, 0x9f, 0x32, 0x9e,
- 0x31, 0xfb, 0xfe, 0x24, 0xe8, 0x0e, 0x35, 0xa9, 0x0d, 0x42, 0x83, 0xb2, 0x68, 0x50, 0x94, 0xb2,
- 0xb8, 0xe8, 0xbf, 0x4b, 0x12, 0xc8, 0xb2, 0x78, 0xd9, 0x22, 0x0c, 0x9f, 0xbe, 0xd6, 0x1e, 0xc0,
- 0xfc, 0x49, 0x5c, 0xd6, 0x87, 0x0a, 0xcb, 0xbc, 0x2b, 0xcb, 0x34, 0x39, 0x37, 0xe7, 0xda, 0x21,
- 0xcf, 0xb5, 0x01, 0x73, 0x27, 0x70, 0x5b, 0x1f, 0x29, 0x2c, 0x7f, 0xa5, 0x5c, 0x66, 0xae, 0x1d,
- 0xf6, 0x5d, 0x73, 0x27, 0x70, 0x5c, 0x1f, 0x2b, 0xec, 0xc2, 0xc3, 0x28, 0xfb, 0x34, 0x9e, 0xef,
- 0x9a, 0x3b, 0x81, 0xe3, 0xfa, 0x84, 0xe5, 0xa7, 0xaa, 0x51, 0x11, 0x69, 0xd0, 0x53, 0xcc, 0x9f,
- 0xc4, 0x71, 0x7d, 0xaa, 0xe0, 0x05, 0x88, 0x6a, 0x18, 0xfe, 0xfc, 0xf8, 0xbe, 0x6b, 0xfe, 0x24,
- 0x8e, 0xeb, 0xab, 0x0a, 0x5e, 0x94, 0xa8, 0xc6, 0x5a, 0x88, 0x28, 0xdc, 0xa3, 0xe3, 0x38, 0xae,
- 0xaf, 0x29, 0x78, 0x7b, 0xa1, 0x1a, 0x55, 0x9f, 0x68, 0x67, 0xaa, 0x47, 0xc7, 0x71, 0x5c, 0x5f,
- 0xc7, 0x6c, 0xa0, 0xa6, 0x1a, 0x37, 0x42, 0x44, 0xe8, 0xbb, 0xf2, 0x27, 0x72, 0x5c, 0xdf, 0x50,
- 0xf0, 0xa2, 0x49, 0x35, 0x6e, 0x9a, 0x5e, 0x0f, 0x02, 0xdf, 0x95, 0x3f, 0x91, 0xe3, 0xfa, 0xa6,
- 0x82, 0x37, 0x52, 0xaa, 0x71, 0x2b, 0x4c, 0x85, 0xbe, 0x4b, 0x3b, 0x99, 0xe3, 0xfa, 0x4c, 0xc1,
- 0xef, 0x4f, 0xd4, 0xb5, 0x15, 0xd3, 0xeb, 0x84, 0xe0, 0xbb, 0xb4, 0x93, 0x39, 0xae, 0x6f, 0x29,
- 0xf8, 0x51, 0x8a, 0xba, 0xb6, 0x1a, 0x21, 0xab, 0x1a, 0xb5, 0x75, 0xc8, 0x1d, 0xdf, 0x71, 0x7d,
- 0x5b, 0xbc, 0xef, 0xcb, 0xb6, 0x05, 0xef, 0xf5, 0x58, 0x58, 0xbf, 0x63, 0xb8, 0xae, 0xef, 0x60,
- 0xd6, 0x54, 0x7b, 0xe1, 0x3e, 0xbb, 0x15, 0x63, 0x26, 0xaf, 0xb5, 0xad, 0xce, 0x1b, 0x1d, 0xc7,
- 0x09, 0x96, 0x94, 0x39, 0xb4, 0x46, 0xb0, 0x7b, 0x8e, 0xe1, 0xcd, 0xbe, 0xab, 0xe0, 0x25, 0x5a,
- 0x8e, 0x53, 0xa3, 0x85, 0xbf, 0x8f, 0x98, 0x6b, 0xb3, 0x83, 0x31, 0x3f, 0xdf, 0xaf, 0x7d, 0x4f,
- 0x39, 0x99, 0x63, 0xab, 0xc5, 0x1a, 0xdb, 0xeb, 0xfe, 0xe4, 0x60, 0xc9, 0x5b, 0x10, 0x3f, 0x2c,
- 0xaf, 0xac, 0x86, 0x8f, 0x78, 0xe2, 0x1d, 0x32, 0x73, 0x67, 0xd9, 0xf2, 0x42, 0xe8, 0xb2, 0x7d,
- 0x30, 0x74, 0x8f, 0x4c, 0xb4, 0xe4, 0x0c, 0x65, 0x09, 0xc3, 0x47, 0x52, 0x86, 0x32, 0x67, 0xa8,
- 0x48, 0x18, 0x3e, 0x96, 0x32, 0x54, 0x38, 0x83, 0x21, 0x61, 0xf8, 0x44, 0xca, 0x60, 0x70, 0x86,
- 0x35, 0x09, 0xc3, 0xa7, 0x52, 0x86, 0x35, 0xce, 0x50, 0x95, 0x30, 0x7c, 0x55, 0xca, 0x50, 0xe5,
- 0x0c, 0x37, 0x24, 0x0c, 0x5f, 0x93, 0x32, 0xdc, 0xe0, 0x0c, 0x37, 0x25, 0x0c, 0x5f, 0x97, 0x32,
- 0xdc, 0xe4, 0x0c, 0xb7, 0x24, 0x0c, 0xdf, 0x90, 0x32, 0xdc, 0x62, 0x0c, 0xab, 0x2b, 0x12, 0x86,
- 0x6f, 0xca, 0x18, 0x56, 0x57, 0x38, 0x83, 0x4c, 0x93, 0x9f, 0x49, 0x19, 0xb8, 0x26, 0x57, 0x65,
- 0x9a, 0xfc, 0x96, 0x94, 0x81, 0x6b, 0x72, 0x55, 0xa6, 0xc9, 0x6f, 0x4b, 0x19, 0xb8, 0x26, 0x57,
- 0x65, 0x9a, 0xfc, 0x8e, 0x94, 0x81, 0x6b, 0x72, 0x55, 0xa6, 0xc9, 0xef, 0x4a, 0x19, 0xb8, 0x26,
- 0x57, 0x65, 0x9a, 0xfc, 0x9e, 0x94, 0x81, 0x6b, 0x72, 0x55, 0xa6, 0xc9, 0x3f, 0x91, 0x32, 0x70,
- 0x4d, 0xae, 0xca, 0x34, 0xf9, 0xa7, 0x52, 0x06, 0xae, 0xc9, 0x55, 0x99, 0x26, 0xff, 0x4c, 0xca,
- 0xc0, 0x35, 0x59, 0x96, 0x69, 0xf2, 0xfb, 0x32, 0x86, 0x32, 0xd7, 0x64, 0x59, 0xa6, 0xc9, 0x3f,
- 0x97, 0x32, 0x70, 0x4d, 0x96, 0x65, 0x9a, 0xfc, 0x0b, 0x29, 0x03, 0xd7, 0x64, 0x59, 0xa6, 0xc9,
- 0x1f, 0x48, 0x19, 0xb8, 0x26, 0xcb, 0x32, 0x4d, 0xfe, 0xa5, 0x94, 0x81, 0x6b, 0xb2, 0x2c, 0xd3,
- 0xe4, 0x5f, 0x49, 0x19, 0xb8, 0x26, 0xcb, 0x32, 0x4d, 0xfe, 0xb5, 0x94, 0x81, 0x6b, 0xb2, 0x2c,
- 0xd3, 0xe4, 0xdf, 0x48, 0x19, 0xb8, 0x26, 0xcb, 0x32, 0x4d, 0xfe, 0xad, 0x94, 0x81, 0x6b, 0xb2,
- 0x2c, 0xd3, 0xe4, 0xdf, 0x49, 0x19, 0xb8, 0x26, 0x2b, 0x32, 0x4d, 0xfe, 0xbd, 0x8c, 0xa1, 0xc2,
- 0x35, 0x59, 0x91, 0x69, 0xf2, 0x1f, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, 0xff, 0x51, 0xca,
- 0xc0, 0x35, 0x59, 0x91, 0x69, 0xf2, 0x9f, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, 0xff, 0x59,
- 0xca, 0xc0, 0x35, 0x59, 0x91, 0x69, 0xf2, 0x5f, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, 0xff,
- 0x55, 0xca, 0xc0, 0x35, 0x59, 0x91, 0x69, 0xf2, 0xdf, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26,
- 0x7f, 0x28, 0x65, 0xe0, 0x9a, 0xac, 0xc8, 0x34, 0xf9, 0xef, 0x52, 0x06, 0xae, 0x49, 0x43, 0xa6,
- 0xc9, 0xff, 0x90, 0x31, 0x18, 0x5c, 0x93, 0x86, 0x4c, 0x93, 0xff, 0x29, 0x65, 0xe0, 0x9a, 0x34,
- 0x64, 0x9a, 0xfc, 0x2f, 0x29, 0x03, 0xd7, 0xa4, 0x21, 0xd3, 0xe4, 0x7f, 0x4b, 0x19, 0xb8, 0x26,
- 0x0d, 0x99, 0x26, 0xff, 0x47, 0xca, 0xc0, 0x35, 0x69, 0xc8, 0x34, 0xf9, 0xbf, 0x52, 0x06, 0xae,
- 0x49, 0x43, 0xa6, 0xc9, 0x1f, 0x49, 0x19, 0xb8, 0x26, 0x0d, 0x99, 0x26, 0x7f, 0x2c, 0x65, 0xe0,
- 0x9a, 0x34, 0x64, 0x9a, 0xfc, 0x89, 0x94, 0x81, 0x6b, 0xd2, 0x90, 0x69, 0xf2, 0xa7, 0x52, 0x06,
- 0xae, 0xc9, 0x35, 0x99, 0x26, 0xff, 0x4f, 0xc6, 0xb0, 0xb6, 0x72, 0xe7, 0xda, 0xe3, 0xab, 0xdd,
- 0x9e, 0x7b, 0x30, 0xd9, 0x5b, 0xde, 0x77, 0x06, 0xd7, 0xbb, 0x4e, 0xbf, 0x65, 0x77, 0xaf, 0x23,
- 0x6c, 0x6f, 0xd2, 0xb9, 0x1e, 0xfc, 0xeb, 0x35, 0x33, 0xfd, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
- 0x46, 0xc7, 0xb3, 0x38, 0x92, 0x3d, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/proto/test_proto/test.proto b/vendor/github.com/golang/protobuf/proto/test_proto/test.proto
deleted file mode 100644
index 22068a95..00000000
--- a/vendor/github.com/golang/protobuf/proto/test_proto/test.proto
+++ /dev/null
@@ -1,562 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A feature-rich test file for the protocol compiler and libraries.
-
-syntax = "proto2";
-
-option go_package = "github.com/golang/protobuf/proto/test_proto";
-
-package test_proto;
-
-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;
- required sfixed32 F_Sfixed32_required = 104;
- required sfixed64 F_Sfixed64_required = 105;
-
- // 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;
- repeated sfixed32 F_Sfixed32_repeated = 204;
- repeated sfixed64 F_Sfixed64_repeated = 205;
-
- // 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;
- optional sfixed32 F_Sfixed32_optional = 304;
- optional sfixed64 F_Sfixed64_optional = 305;
-
- // 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];
- optional sfixed32 F_Sfixed32_defaulted = 404 [default = -32];
- optional sfixed64 F_Sfixed64_defaulted = 405 [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];
- repeated sfixed32 F_Sfixed32_repeated_packed = 504 [packed=true];
- repeated sfixed64 F_Sfixed64_repeated_packed = 505 [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 a group containing a required field.
-message GoTestRequiredGroupField {
- required group Group = 1 {
- required int32 Field = 2;
- };
-}
-
-// 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;
-
- extensions 100 to max;
-}
-
-message RequiredInnerMessage {
- required InnerMessage leo_finally_won_an_oscar = 1;
-}
-
-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;
- optional RequiredInnerMessage we_must_go_deeper = 13;
- 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;
- map map_field = 2;
-}
-
-extend MyMessage {
- repeated string greeting = 106;
- // leave field 200 unregistered for testing
-}
-
-message ComplexExtension {
- optional int32 first = 1;
- optional int32 second = 2;
- repeated int32 third = 3;
-}
-
-extend OtherMessage {
- optional ComplexExtension complex = 200;
- repeated ComplexExtension r_complex = 201;
-}
-
-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,def=foo"];
- 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;
- optional bool exact = 2;
-}
-
-message MessageWithMap {
- map name_mapping = 1;
- map msg_mapping = 2;
- map byte_mapping = 3;
- map str_to_str = 4;
-}
-
-message Oneof {
- oneof union {
- bool F_Bool = 1;
- int32 F_Int32 = 2;
- int64 F_Int64 = 3;
- fixed32 F_Fixed32 = 4;
- fixed64 F_Fixed64 = 5;
- uint32 F_Uint32 = 6;
- uint64 F_Uint64 = 7;
- float F_Float = 8;
- double F_Double = 9;
- string F_String = 10;
- bytes F_Bytes = 11;
- sint32 F_Sint32 = 12;
- sint64 F_Sint64 = 13;
- MyMessage.Color F_Enum = 14;
- GoTestField F_Message = 15;
- group F_Group = 16 {
- optional int32 x = 17;
- }
- int32 F_Largest_Tag = 536870911;
- }
-
- oneof tormato {
- int32 value = 100;
- }
-}
-
-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/vendor/github.com/golang/protobuf/proto/text_parser_test.go b/vendor/github.com/golang/protobuf/proto/text_parser_test.go
deleted file mode 100644
index a8198087..00000000
--- a/vendor/github.com/golang/protobuf/proto/text_parser_test.go
+++ /dev/null
@@ -1,706 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package proto_test
-
-import (
- "fmt"
- "math"
- "testing"
-
- . "github.com/golang/protobuf/proto"
- proto3pb "github.com/golang/protobuf/proto/proto3_proto"
- . "github.com/golang/protobuf/proto/test_proto"
-)
-
-type UnmarshalTextTest struct {
- in string
- err string // if "", no error expected
- out *MyMessage
-}
-
-func buildExtStructTest(text string) UnmarshalTextTest {
- msg := &MyMessage{
- Count: Int32(42),
- }
- SetExtension(msg, E_Ext_More, &Ext{
- Data: String("Hello, world!"),
- })
- return UnmarshalTextTest{in: text, out: msg}
-}
-
-func buildExtDataTest(text string) UnmarshalTextTest {
- msg := &MyMessage{
- Count: Int32(42),
- }
- SetExtension(msg, E_Ext_Text, String("Hello, world!"))
- SetExtension(msg, E_Ext_Number, Int32(1729))
- return UnmarshalTextTest{in: text, out: msg}
-}
-
-func buildExtRepStringTest(text string) UnmarshalTextTest {
- msg := &MyMessage{
- Count: Int32(42),
- }
- if err := SetExtension(msg, E_Greeting, []string{"bula", "hola"}); err != nil {
- panic(err)
- }
- return UnmarshalTextTest{in: text, out: msg}
-}
-
-var unMarshalTextTests = []UnmarshalTextTest{
- // Basic
- {
- in: " count:42\n name:\"Dave\" ",
- out: &MyMessage{
- Count: Int32(42),
- Name: String("Dave"),
- },
- },
-
- // Empty quoted string
- {
- in: `count:42 name:""`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String(""),
- },
- },
-
- // Quoted string concatenation with double quotes
- {
- in: `count:42 name: "My name is "` + "\n" + `"elsewhere"`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String("My name is elsewhere"),
- },
- },
-
- // Quoted string concatenation with single quotes
- {
- in: "count:42 name: 'My name is '\n'elsewhere'",
- out: &MyMessage{
- Count: Int32(42),
- Name: String("My name is elsewhere"),
- },
- },
-
- // Quoted string concatenations with mixed quotes
- {
- in: "count:42 name: 'My name is '\n\"elsewhere\"",
- out: &MyMessage{
- Count: Int32(42),
- Name: String("My name is elsewhere"),
- },
- },
- {
- in: "count:42 name: \"My name is \"\n'elsewhere'",
- out: &MyMessage{
- Count: Int32(42),
- Name: String("My name is elsewhere"),
- },
- },
-
- // Quoted string with escaped apostrophe
- {
- in: `count:42 name: "HOLIDAY - New Year\'s Day"`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String("HOLIDAY - New Year's Day"),
- },
- },
-
- // Quoted string with single quote
- {
- in: `count:42 name: 'Roger "The Ramster" Ramjet'`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String(`Roger "The Ramster" Ramjet`),
- },
- },
-
- // Quoted string with all the accepted special characters from the C++ test
- {
- in: `count:42 name: ` + "\"\\\"A string with \\' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and multiple spaces\"",
- out: &MyMessage{
- Count: Int32(42),
- Name: String("\"A string with ' characters \n and \r newlines and \t tabs and \001 slashes \\ and multiple spaces"),
- },
- },
-
- // Quoted string with quoted backslash
- {
- in: `count:42 name: "\\'xyz"`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String(`\'xyz`),
- },
- },
-
- // Quoted string with UTF-8 bytes.
- {
- in: "count:42 name: '\303\277\302\201\x00\xAB\xCD\xEF'",
- out: &MyMessage{
- Count: Int32(42),
- Name: String("\303\277\302\201\x00\xAB\xCD\xEF"),
- },
- },
-
- // Quoted string with unicode escapes.
- {
- in: `count: 42 name: "\u0047\U00000047\uffff\U0010ffff"`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String("GG\uffff\U0010ffff"),
- },
- },
-
- // Bad quoted string
- {
- in: `inner: < host: "\0" >` + "\n",
- err: `line 1.15: invalid quoted string "\0": \0 requires 2 following digits`,
- },
-
- // Bad \u escape
- {
- in: `count: 42 name: "\u000"`,
- err: `line 1.16: invalid quoted string "\u000": \u requires 4 following digits`,
- },
-
- // Bad \U escape
- {
- in: `count: 42 name: "\U0000000"`,
- err: `line 1.16: invalid quoted string "\U0000000": \U requires 8 following digits`,
- },
-
- // Bad \U escape
- {
- in: `count: 42 name: "\xxx"`,
- err: `line 1.16: invalid quoted string "\xxx": \xxx contains non-hexadecimal digits`,
- },
-
- // Number too large for int64
- {
- in: "count: 1 others { key: 123456789012345678901 }",
- err: "line 1.23: invalid int64: 123456789012345678901",
- },
-
- // Number too large for int32
- {
- in: "count: 1234567890123",
- err: "line 1.7: invalid int32: 1234567890123",
- },
-
- // Number in hexadecimal
- {
- in: "count: 0x2beef",
- out: &MyMessage{
- Count: Int32(0x2beef),
- },
- },
-
- // Number in octal
- {
- in: "count: 024601",
- out: &MyMessage{
- Count: Int32(024601),
- },
- },
-
- // Floating point number with "f" suffix
- {
- in: "count: 4 others:< weight: 17.0f >",
- out: &MyMessage{
- Count: Int32(4),
- Others: []*OtherMessage{
- {
- Weight: Float32(17),
- },
- },
- },
- },
-
- // Floating point positive infinity
- {
- in: "count: 4 bigfloat: inf",
- out: &MyMessage{
- Count: Int32(4),
- Bigfloat: Float64(math.Inf(1)),
- },
- },
-
- // Floating point negative infinity
- {
- in: "count: 4 bigfloat: -inf",
- out: &MyMessage{
- Count: Int32(4),
- Bigfloat: Float64(math.Inf(-1)),
- },
- },
-
- // Number too large for float32
- {
- in: "others:< weight: 12345678901234567890123456789012345678901234567890 >",
- err: "line 1.17: invalid float32: 12345678901234567890123456789012345678901234567890",
- },
-
- // Number posing as a quoted string
- {
- in: `inner: < host: 12 >` + "\n",
- err: `line 1.15: invalid string: 12`,
- },
-
- // Quoted string posing as int32
- {
- in: `count: "12"`,
- err: `line 1.7: invalid int32: "12"`,
- },
-
- // Quoted string posing a float32
- {
- in: `others:< weight: "17.4" >`,
- err: `line 1.17: invalid float32: "17.4"`,
- },
-
- // unclosed bracket doesn't cause infinite loop
- {
- in: `[`,
- err: `line 1.0: unclosed type_url or extension name`,
- },
-
- // Enum
- {
- in: `count:42 bikeshed: BLUE`,
- out: &MyMessage{
- Count: Int32(42),
- Bikeshed: MyMessage_BLUE.Enum(),
- },
- },
-
- // Repeated field
- {
- in: `count:42 pet: "horsey" pet:"bunny"`,
- out: &MyMessage{
- Count: Int32(42),
- Pet: []string{"horsey", "bunny"},
- },
- },
-
- // Repeated field with list notation
- {
- in: `count:42 pet: ["horsey", "bunny"]`,
- out: &MyMessage{
- Count: Int32(42),
- Pet: []string{"horsey", "bunny"},
- },
- },
-
- // Repeated message with/without colon and <>/{}
- {
- in: `count:42 others:{} others{} others:<> others:{}`,
- out: &MyMessage{
- Count: Int32(42),
- Others: []*OtherMessage{
- {},
- {},
- {},
- {},
- },
- },
- },
-
- // Missing colon for inner message
- {
- in: `count:42 inner < host: "cauchy.syd" >`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("cauchy.syd"),
- },
- },
- },
-
- // Missing colon for string field
- {
- in: `name "Dave"`,
- err: `line 1.5: expected ':', found "\"Dave\""`,
- },
-
- // Missing colon for int32 field
- {
- in: `count 42`,
- err: `line 1.6: expected ':', found "42"`,
- },
-
- // Missing required field
- {
- in: `name: "Pawel"`,
- err: fmt.Sprintf(`proto: required field "%T.count" not set`, MyMessage{}),
- out: &MyMessage{
- Name: String("Pawel"),
- },
- },
-
- // Missing required field in a required submessage
- {
- in: `count: 42 we_must_go_deeper < leo_finally_won_an_oscar <> >`,
- err: fmt.Sprintf(`proto: required field "%T.host" not set`, InnerMessage{}),
- out: &MyMessage{
- Count: Int32(42),
- WeMustGoDeeper: &RequiredInnerMessage{LeoFinallyWonAnOscar: &InnerMessage{}},
- },
- },
-
- // Repeated non-repeated field
- {
- in: `name: "Rob" name: "Russ"`,
- err: `line 1.12: non-repeated field "name" was repeated`,
- },
-
- // Group
- {
- in: `count: 17 SomeGroup { group_field: 12 }`,
- out: &MyMessage{
- Count: Int32(17),
- Somegroup: &MyMessage_SomeGroup{
- GroupField: Int32(12),
- },
- },
- },
-
- // Semicolon between fields
- {
- in: `count:3;name:"Calvin"`,
- out: &MyMessage{
- Count: Int32(3),
- Name: String("Calvin"),
- },
- },
- // Comma between fields
- {
- in: `count:4,name:"Ezekiel"`,
- out: &MyMessage{
- Count: Int32(4),
- Name: String("Ezekiel"),
- },
- },
-
- // Boolean false
- {
- in: `count:42 inner { host: "example.com" connected: false }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(false),
- },
- },
- },
- // Boolean true
- {
- in: `count:42 inner { host: "example.com" connected: true }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(true),
- },
- },
- },
- // Boolean 0
- {
- in: `count:42 inner { host: "example.com" connected: 0 }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(false),
- },
- },
- },
- // Boolean 1
- {
- in: `count:42 inner { host: "example.com" connected: 1 }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(true),
- },
- },
- },
- // Boolean f
- {
- in: `count:42 inner { host: "example.com" connected: f }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(false),
- },
- },
- },
- // Boolean t
- {
- in: `count:42 inner { host: "example.com" connected: t }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(true),
- },
- },
- },
- // Boolean False
- {
- in: `count:42 inner { host: "example.com" connected: False }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(false),
- },
- },
- },
- // Boolean True
- {
- in: `count:42 inner { host: "example.com" connected: True }`,
- out: &MyMessage{
- Count: Int32(42),
- Inner: &InnerMessage{
- Host: String("example.com"),
- Connected: Bool(true),
- },
- },
- },
-
- // Extension
- buildExtStructTest(`count: 42 [test_proto.Ext.more]:`),
- buildExtStructTest(`count: 42 [test_proto.Ext.more] {data:"Hello, world!"}`),
- buildExtDataTest(`count: 42 [test_proto.Ext.text]:"Hello, world!" [test_proto.Ext.number]:1729`),
- buildExtRepStringTest(`count: 42 [test_proto.greeting]:"bula" [test_proto.greeting]:"hola"`),
-
- // Big all-in-one
- {
- in: "count:42 # Meaning\n" +
- `name:"Dave" ` +
- `quote:"\"I didn't want to go.\"" ` +
- `pet:"bunny" ` +
- `pet:"kitty" ` +
- `pet:"horsey" ` +
- `inner:<` +
- ` host:"footrest.syd" ` +
- ` port:7001 ` +
- ` connected:true ` +
- `> ` +
- `others:<` +
- ` key:3735928559 ` +
- ` value:"\x01A\a\f" ` +
- `> ` +
- `others:<` +
- " weight:58.9 # Atomic weight of Co\n" +
- ` inner:<` +
- ` host:"lesha.mtv" ` +
- ` port:8002 ` +
- ` >` +
- `>`,
- out: &MyMessage{
- Count: Int32(42),
- Name: String("Dave"),
- Quote: String(`"I didn't want to go."`),
- Pet: []string{"bunny", "kitty", "horsey"},
- Inner: &InnerMessage{
- Host: String("footrest.syd"),
- Port: Int32(7001),
- Connected: Bool(true),
- },
- Others: []*OtherMessage{
- {
- Key: Int64(3735928559),
- Value: []byte{0x1, 'A', '\a', '\f'},
- },
- {
- Weight: Float32(58.9),
- Inner: &InnerMessage{
- Host: String("lesha.mtv"),
- Port: Int32(8002),
- },
- },
- },
- },
- },
-}
-
-func TestUnmarshalText(t *testing.T) {
- for i, test := range unMarshalTextTests {
- pb := new(MyMessage)
- err := UnmarshalText(test.in, pb)
- if test.err == "" {
- // We don't expect failure.
- if err != nil {
- t.Errorf("Test %d: Unexpected error: %v", i, err)
- } else if !Equal(pb, test.out) {
- t.Errorf("Test %d: Incorrect populated \nHave: %v\nWant: %v",
- i, pb, test.out)
- }
- } else {
- // We do expect failure.
- if err == nil {
- t.Errorf("Test %d: Didn't get expected error: %v", i, test.err)
- } else if err.Error() != test.err {
- t.Errorf("Test %d: Incorrect error.\nHave: %v\nWant: %v",
- i, err.Error(), test.err)
- } else if _, ok := err.(*RequiredNotSetError); ok && test.out != nil && !Equal(pb, test.out) {
- t.Errorf("Test %d: Incorrect populated \nHave: %v\nWant: %v",
- i, pb, test.out)
- }
- }
- }
-}
-
-func TestUnmarshalTextCustomMessage(t *testing.T) {
- msg := &textMessage{}
- if err := UnmarshalText("custom", msg); err != nil {
- t.Errorf("Unexpected error from custom unmarshal: %v", err)
- }
- if UnmarshalText("not custom", msg) == nil {
- t.Errorf("Didn't get expected error from custom unmarshal")
- }
-}
-
-// Regression test; this caused a panic.
-func TestRepeatedEnum(t *testing.T) {
- pb := new(RepeatedEnum)
- if err := UnmarshalText("color: RED", pb); err != nil {
- t.Fatal(err)
- }
- exp := &RepeatedEnum{
- Color: []RepeatedEnum_Color{RepeatedEnum_RED},
- }
- if !Equal(pb, exp) {
- t.Errorf("Incorrect populated \nHave: %v\nWant: %v", pb, exp)
- }
-}
-
-func TestProto3TextParsing(t *testing.T) {
- m := new(proto3pb.Message)
- const in = `name: "Wallace" true_scotsman: true`
- want := &proto3pb.Message{
- Name: "Wallace",
- TrueScotsman: true,
- }
- if err := UnmarshalText(in, m); err != nil {
- t.Fatal(err)
- }
- if !Equal(m, want) {
- t.Errorf("\n got %v\nwant %v", m, want)
- }
-}
-
-func TestMapParsing(t *testing.T) {
- m := new(MessageWithMap)
- const in = `name_mapping: name_mapping:` +
- `msg_mapping:,>` + // separating commas are okay
- `msg_mapping>` + // no colon after "value"
- `msg_mapping:>` + // omitted key
- `msg_mapping:` + // omitted value
- `byte_mapping:` +
- `byte_mapping:<>` // omitted key and value
- want := &MessageWithMap{
- NameMapping: map[int32]string{
- 1: "Beatles",
- 1234: "Feist",
- },
- MsgMapping: map[int64]*FloatingPoint{
- -4: {F: Float64(2.0)},
- -2: {F: Float64(4.0)},
- 0: {F: Float64(5.0)},
- 1: nil,
- },
- ByteMapping: map[bool][]byte{
- false: nil,
- true: []byte("so be it"),
- },
- }
- if err := UnmarshalText(in, m); err != nil {
- t.Fatal(err)
- }
- if !Equal(m, want) {
- t.Errorf("\n got %v\nwant %v", m, want)
- }
-}
-
-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)
- }
-
- const inOverwrite = `name:"Shrek" number:42`
- m = new(Communique)
- testErr := "line 1.13: field 'number' would overwrite already parsed oneof 'Union'"
- if err := UnmarshalText(inOverwrite, m); err == nil {
- t.Errorf("TestOneofParsing: Didn't get expected error: %v", testErr)
- } else if err.Error() != testErr {
- t.Errorf("TestOneofParsing: Incorrect error.\nHave: %v\nWant: %v",
- err.Error(), testErr)
- }
-
-}
-
-var benchInput string
-
-func init() {
- benchInput = "count: 4\n"
- for i := 0; i < 1000; i++ {
- benchInput += "pet: \"fido\"\n"
- }
-
- // Check it is valid input.
- pb := new(MyMessage)
- err := UnmarshalText(benchInput, pb)
- if err != nil {
- panic("Bad benchmark input: " + err.Error())
- }
-}
-
-func BenchmarkUnmarshalText(b *testing.B) {
- pb := new(MyMessage)
- for i := 0; i < b.N; i++ {
- UnmarshalText(benchInput, pb)
- }
- b.SetBytes(int64(len(benchInput)))
-}
diff --git a/vendor/github.com/golang/protobuf/proto/text_test.go b/vendor/github.com/golang/protobuf/proto/text_test.go
deleted file mode 100644
index 3c8b033c..00000000
--- a/vendor/github.com/golang/protobuf/proto/text_test.go
+++ /dev/null
@@ -1,518 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package proto_test
-
-import (
- "bytes"
- "errors"
- "io/ioutil"
- "math"
- "strings"
- "sync"
- "testing"
-
- "github.com/golang/protobuf/proto"
-
- proto3pb "github.com/golang/protobuf/proto/proto3_proto"
- pb "github.com/golang/protobuf/proto/test_proto"
- anypb "github.com/golang/protobuf/ptypes/any"
-)
-
-// textMessage implements the methods that allow it to marshal and unmarshal
-// itself as text.
-type textMessage struct {
-}
-
-func (*textMessage) MarshalText() ([]byte, error) {
- return []byte("custom"), nil
-}
-
-func (*textMessage) UnmarshalText(bytes []byte) error {
- if string(bytes) != "custom" {
- return errors.New("expected 'custom'")
- }
- return nil
-}
-
-func (*textMessage) Reset() {}
-func (*textMessage) String() string { return "" }
-func (*textMessage) ProtoMessage() {}
-
-func newTestMessage() *pb.MyMessage {
- msg := &pb.MyMessage{
- Count: proto.Int32(42),
- Name: proto.String("Dave"),
- Quote: proto.String(`"I didn't want to go."`),
- Pet: []string{"bunny", "kitty", "horsey"},
- Inner: &pb.InnerMessage{
- Host: proto.String("footrest.syd"),
- Port: proto.Int32(7001),
- Connected: proto.Bool(true),
- },
- Others: []*pb.OtherMessage{
- {
- Key: proto.Int64(0xdeadbeef),
- Value: []byte{1, 65, 7, 12},
- },
- {
- Weight: proto.Float32(6.022),
- Inner: &pb.InnerMessage{
- Host: proto.String("lesha.mtv"),
- Port: proto.Int32(8002),
- },
- },
- },
- Bikeshed: pb.MyMessage_BLUE.Enum(),
- Somegroup: &pb.MyMessage_SomeGroup{
- GroupField: proto.Int32(8),
- },
- // One normally wouldn't do this.
- // This is an undeclared tag 13, as a varint (wire type 0) with value 4.
- XXX_unrecognized: []byte{13<<3 | 0, 4},
- }
- ext := &pb.Ext{
- Data: proto.String("Big gobs for big rats"),
- }
- if err := proto.SetExtension(msg, pb.E_Ext_More, ext); err != nil {
- panic(err)
- }
- greetings := []string{"adg", "easy", "cow"}
- if err := proto.SetExtension(msg, pb.E_Greeting, greetings); err != nil {
- panic(err)
- }
-
- // Add an unknown extension. We marshal a pb.Ext, and fake the ID.
- b, err := proto.Marshal(&pb.Ext{Data: proto.String("3G skiing")})
- if err != nil {
- panic(err)
- }
- b = append(proto.EncodeVarint(201<<3|proto.WireBytes), b...)
- proto.SetRawExtension(msg, 201, b)
-
- // Extensions can be plain fields, too, so let's test that.
- b = append(proto.EncodeVarint(202<<3|proto.WireVarint), 19)
- proto.SetRawExtension(msg, 202, b)
-
- return msg
-}
-
-const text = `count: 42
-name: "Dave"
-quote: "\"I didn't want to go.\""
-pet: "bunny"
-pet: "kitty"
-pet: "horsey"
-inner: <
- host: "footrest.syd"
- port: 7001
- connected: true
->
-others: <
- key: 3735928559
- value: "\001A\007\014"
->
-others: <
- weight: 6.022
- inner: <
- host: "lesha.mtv"
- port: 8002
- >
->
-bikeshed: BLUE
-SomeGroup {
- group_field: 8
-}
-/* 2 unknown bytes */
-13: 4
-[test_proto.Ext.more]: <
- data: "Big gobs for big rats"
->
-[test_proto.greeting]: "adg"
-[test_proto.greeting]: "easy"
-[test_proto.greeting]: "cow"
-/* 13 unknown bytes */
-201: "\t3G skiing"
-/* 3 unknown bytes */
-202: 19
-`
-
-func TestMarshalText(t *testing.T) {
- buf := new(bytes.Buffer)
- if err := proto.MarshalText(buf, newTestMessage()); err != nil {
- t.Fatalf("proto.MarshalText: %v", err)
- }
- s := buf.String()
- if s != text {
- t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", s, text)
- }
-}
-
-func TestMarshalTextCustomMessage(t *testing.T) {
- buf := new(bytes.Buffer)
- if err := proto.MarshalText(buf, &textMessage{}); err != nil {
- t.Fatalf("proto.MarshalText: %v", err)
- }
- s := buf.String()
- if s != "custom" {
- t.Errorf("Got %q, expected %q", s, "custom")
- }
-}
-func TestMarshalTextNil(t *testing.T) {
- want := ""
- tests := []proto.Message{nil, (*pb.MyMessage)(nil)}
- for i, test := range tests {
- buf := new(bytes.Buffer)
- if err := proto.MarshalText(buf, test); err != nil {
- t.Fatal(err)
- }
- if got := buf.String(); got != want {
- t.Errorf("%d: got %q want %q", i, got, want)
- }
- }
-}
-
-func TestMarshalTextUnknownEnum(t *testing.T) {
- // The Color enum only specifies values 0-2.
- m := &pb.MyMessage{Bikeshed: pb.MyMessage_Color(3).Enum()}
- got := m.String()
- const want = `bikeshed:3 `
- if got != want {
- t.Errorf("\n got %q\nwant %q", got, want)
- }
-}
-
-func TestTextOneof(t *testing.T) {
- tests := []struct {
- m proto.Message
- want string
- }{
- // zero message
- {&pb.Communique{}, ``},
- // scalar field
- {&pb.Communique{Union: &pb.Communique_Number{4}}, `number:4`},
- // message field
- {&pb.Communique{Union: &pb.Communique_Msg{
- &pb.Strings{StringField: proto.String("why hello!")},
- }}, `msg:`},
- // bad oneof (should not panic)
- {&pb.Communique{Union: &pb.Communique_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()
- for i := 0; i < b.N; i++ {
- buf.Reset()
- proto.MarshalText(buf, m)
- }
-}
-
-func BenchmarkMarshalTextUnbuffered(b *testing.B) {
- w := ioutil.Discard
- m := newTestMessage()
- for i := 0; i < b.N; i++ {
- proto.MarshalText(w, m)
- }
-}
-
-func compact(src string) string {
- // s/[ \n]+/ /g; s/ $//;
- dst := make([]byte, len(src))
- space, comment := false, false
- j := 0
- for i := 0; i < len(src); i++ {
- if strings.HasPrefix(src[i:], "/*") {
- comment = true
- i++
- continue
- }
- if comment && strings.HasPrefix(src[i:], "*/") {
- comment = false
- i++
- continue
- }
- if comment {
- continue
- }
- c := src[i]
- if c == ' ' || c == '\n' {
- space = true
- continue
- }
- if j > 0 && (dst[j-1] == ':' || dst[j-1] == '<' || dst[j-1] == '{') {
- space = false
- }
- if c == '{' {
- space = false
- }
- if space {
- dst[j] = ' '
- j++
- space = false
- }
- dst[j] = c
- j++
- }
- if space {
- dst[j] = ' '
- j++
- }
- return string(dst[0:j])
-}
-
-var compactText = compact(text)
-
-func TestCompactText(t *testing.T) {
- s := proto.CompactTextString(newTestMessage())
- if s != compactText {
- t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v\n===\n", s, compactText)
- }
-}
-
-func TestStringEscaping(t *testing.T) {
- testCases := []struct {
- in *pb.Strings
- out string
- }{
- {
- // Test data from C++ test (TextFormatTest.StringEscape).
- // Single divergence: we don't escape apostrophes.
- &pb.Strings{StringField: proto.String("\"A string with ' characters \n and \r newlines and \t tabs and \001 slashes \\ and multiple spaces")},
- "string_field: \"\\\"A string with ' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and multiple spaces\"\n",
- },
- {
- // Test data from the same C++ test.
- &pb.Strings{StringField: proto.String("\350\260\267\346\255\214")},
- "string_field: \"\\350\\260\\267\\346\\255\\214\"\n",
- },
- {
- // Some UTF-8.
- &pb.Strings{StringField: proto.String("\x00\x01\xff\x81")},
- `string_field: "\000\001\377\201"` + "\n",
- },
- }
-
- for i, tc := range testCases {
- var buf bytes.Buffer
- if err := proto.MarshalText(&buf, tc.in); err != nil {
- t.Errorf("proto.MarsalText: %v", err)
- continue
- }
- s := buf.String()
- if s != tc.out {
- t.Errorf("#%d: Got:\n%s\nExpected:\n%s\n", i, s, tc.out)
- continue
- }
-
- // Check round-trip.
- pb := new(pb.Strings)
- if err := proto.UnmarshalText(s, pb); err != nil {
- t.Errorf("#%d: UnmarshalText: %v", i, err)
- continue
- }
- if !proto.Equal(pb, tc.in) {
- t.Errorf("#%d: Round-trip failed:\nstart: %v\n end: %v", i, tc.in, pb)
- }
- }
-}
-
-// A limitedWriter accepts some output before it fails.
-// This is a proxy for something like a nearly-full or imminently-failing disk,
-// or a network connection that is about to die.
-type limitedWriter struct {
- b bytes.Buffer
- limit int
-}
-
-var outOfSpace = errors.New("proto: insufficient space")
-
-func (w *limitedWriter) Write(p []byte) (n int, err error) {
- var avail = w.limit - w.b.Len()
- if avail <= 0 {
- return 0, outOfSpace
- }
- if len(p) <= avail {
- return w.b.Write(p)
- }
- n, _ = w.b.Write(p[:avail])
- return n, outOfSpace
-}
-
-func TestMarshalTextFailing(t *testing.T) {
- // Try lots of different sizes to exercise more error code-paths.
- for lim := 0; lim < len(text); lim++ {
- buf := new(limitedWriter)
- buf.limit = lim
- err := proto.MarshalText(buf, newTestMessage())
- // We expect a certain error, but also some partial results in the buffer.
- if err != outOfSpace {
- t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", err, outOfSpace)
- }
- s := buf.b.String()
- x := text[:buf.limit]
- if s != x {
- t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", s, x)
- }
- }
-}
-
-func TestFloats(t *testing.T) {
- tests := []struct {
- f float64
- want string
- }{
- {0, "0"},
- {4.7, "4.7"},
- {math.Inf(1), "inf"},
- {math.Inf(-1), "-inf"},
- {math.NaN(), "nan"},
- }
- for _, test := range tests {
- msg := &pb.FloatingPoint{F: &test.f}
- got := strings.TrimSpace(msg.String())
- want := `f:` + test.want
- if got != want {
- t.Errorf("f=%f: got %q, want %q", test.f, got, want)
- }
- }
-}
-
-func TestRepeatedNilText(t *testing.T) {
- m := &pb.MessageList{
- Message: []*pb.MessageList_Message{
- nil,
- &pb.MessageList_Message{
- Name: proto.String("Horse"),
- },
- nil,
- },
- }
- want := `Message
-Message {
- name: "Horse"
-}
-Message
-`
- if s := proto.MarshalTextString(m); s != want {
- t.Errorf(" got: %s\nwant: %s", s, want)
- }
-}
-
-func TestProto3Text(t *testing.T) {
- tests := []struct {
- m proto.Message
- want string
- }{
- // zero message
- {&proto3pb.Message{}, ``},
- // zero message except for an empty byte slice
- {&proto3pb.Message{Data: []byte{}}, ``},
- // trivial case
- {&proto3pb.Message{Name: "Rob", HeightInCm: 175}, `name:"Rob" height_in_cm:175`},
- // empty map
- {&pb.MessageWithMap{}, ``},
- // non-empty map; map format is the same as a repeated struct,
- // and they are sorted by key (numerically for numeric keys).
- {
- &pb.MessageWithMap{NameMapping: map[int32]string{
- -1: "Negatory",
- 7: "Lucky",
- 1234: "Feist",
- 6345789: "Otis",
- }},
- `name_mapping: ` +
- `name_mapping: ` +
- `name_mapping: ` +
- `name_mapping:`,
- },
- // map with nil value; not well-defined, but we shouldn't crash
- {
- &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{7: nil}},
- `msg_mapping:`,
- },
- }
- 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 TestRacyMarshal(t *testing.T) {
- // This test should be run with the race detector.
-
- any := &pb.MyMessage{Count: proto.Int32(47), Name: proto.String("David")}
- proto.SetExtension(any, pb.E_Ext_Text, proto.String("bar"))
- b, err := proto.Marshal(any)
- if err != nil {
- panic(err)
- }
- m := &proto3pb.Message{
- Name: "David",
- ResultCount: 47,
- Anything: &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any), Value: b},
- }
-
- wantText := proto.MarshalTextString(m)
- wantBytes, err := proto.Marshal(m)
- if err != nil {
- t.Fatalf("proto.Marshal error: %v", err)
- }
-
- var wg sync.WaitGroup
- defer wg.Wait()
- wg.Add(20)
- for i := 0; i < 10; i++ {
- go func() {
- defer wg.Done()
- got := proto.MarshalTextString(m)
- if got != wantText {
- t.Errorf("proto.MarshalTextString = %q, want %q", got, wantText)
- }
- }()
- go func() {
- defer wg.Done()
- got, err := proto.Marshal(m)
- if !bytes.Equal(got, wantBytes) || err != nil {
- t.Errorf("proto.Marshal = (%x, %v), want (%x, nil)", got, err, wantBytes)
- }
- }()
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
deleted file mode 100644
index e855b1f5..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
+++ /dev/null
@@ -1,2812 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/descriptor.proto
-
-package descriptor // import "github.com/golang/protobuf/protoc-gen-go/descriptor"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type FieldDescriptorProto_Type int32
-
-const (
- // 0 is reserved for errors.
- // Order is weird for historical reasons.
- FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1
- FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
- // negative values are likely.
- FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3
- FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
- // negative values are likely.
- FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5
- FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6
- FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7
- FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8
- FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9
- // Tag-delimited aggregate.
- // Group type is deprecated and not supported in proto3. However, Proto3
- // implementations should still be able to parse the group wire format and
- // treat group fields as unknown fields.
- FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10
- FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11
- // New in version 2.
- FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12
- FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13
- FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14
- FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15
- FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16
- FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17
- FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18
-)
-
-var FieldDescriptorProto_Type_name = map[int32]string{
- 1: "TYPE_DOUBLE",
- 2: "TYPE_FLOAT",
- 3: "TYPE_INT64",
- 4: "TYPE_UINT64",
- 5: "TYPE_INT32",
- 6: "TYPE_FIXED64",
- 7: "TYPE_FIXED32",
- 8: "TYPE_BOOL",
- 9: "TYPE_STRING",
- 10: "TYPE_GROUP",
- 11: "TYPE_MESSAGE",
- 12: "TYPE_BYTES",
- 13: "TYPE_UINT32",
- 14: "TYPE_ENUM",
- 15: "TYPE_SFIXED32",
- 16: "TYPE_SFIXED64",
- 17: "TYPE_SINT32",
- 18: "TYPE_SINT64",
-}
-var FieldDescriptorProto_Type_value = map[string]int32{
- "TYPE_DOUBLE": 1,
- "TYPE_FLOAT": 2,
- "TYPE_INT64": 3,
- "TYPE_UINT64": 4,
- "TYPE_INT32": 5,
- "TYPE_FIXED64": 6,
- "TYPE_FIXED32": 7,
- "TYPE_BOOL": 8,
- "TYPE_STRING": 9,
- "TYPE_GROUP": 10,
- "TYPE_MESSAGE": 11,
- "TYPE_BYTES": 12,
- "TYPE_UINT32": 13,
- "TYPE_ENUM": 14,
- "TYPE_SFIXED32": 15,
- "TYPE_SFIXED64": 16,
- "TYPE_SINT32": 17,
- "TYPE_SINT64": 18,
-}
-
-func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type {
- p := new(FieldDescriptorProto_Type)
- *p = x
- return p
-}
-func (x FieldDescriptorProto_Type) String() string {
- return proto.EnumName(FieldDescriptorProto_Type_name, int32(x))
-}
-func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type")
- if err != nil {
- return err
- }
- *x = FieldDescriptorProto_Type(value)
- return nil
-}
-func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4, 0}
-}
-
-type FieldDescriptorProto_Label int32
-
-const (
- // 0 is reserved for errors
- FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1
- FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2
- FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3
-)
-
-var FieldDescriptorProto_Label_name = map[int32]string{
- 1: "LABEL_OPTIONAL",
- 2: "LABEL_REQUIRED",
- 3: "LABEL_REPEATED",
-}
-var FieldDescriptorProto_Label_value = map[string]int32{
- "LABEL_OPTIONAL": 1,
- "LABEL_REQUIRED": 2,
- "LABEL_REPEATED": 3,
-}
-
-func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label {
- p := new(FieldDescriptorProto_Label)
- *p = x
- return p
-}
-func (x FieldDescriptorProto_Label) String() string {
- return proto.EnumName(FieldDescriptorProto_Label_name, int32(x))
-}
-func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label")
- if err != nil {
- return err
- }
- *x = FieldDescriptorProto_Label(value)
- return nil
-}
-func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4, 1}
-}
-
-// Generated classes can be optimized for speed or code size.
-type FileOptions_OptimizeMode int32
-
-const (
- FileOptions_SPEED FileOptions_OptimizeMode = 1
- // etc.
- FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2
- FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3
-)
-
-var FileOptions_OptimizeMode_name = map[int32]string{
- 1: "SPEED",
- 2: "CODE_SIZE",
- 3: "LITE_RUNTIME",
-}
-var FileOptions_OptimizeMode_value = map[string]int32{
- "SPEED": 1,
- "CODE_SIZE": 2,
- "LITE_RUNTIME": 3,
-}
-
-func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode {
- p := new(FileOptions_OptimizeMode)
- *p = x
- return p
-}
-func (x FileOptions_OptimizeMode) String() string {
- return proto.EnumName(FileOptions_OptimizeMode_name, int32(x))
-}
-func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode")
- if err != nil {
- return err
- }
- *x = FileOptions_OptimizeMode(value)
- return nil
-}
-func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{10, 0}
-}
-
-type FieldOptions_CType int32
-
-const (
- // Default mode.
- FieldOptions_STRING FieldOptions_CType = 0
- FieldOptions_CORD FieldOptions_CType = 1
- FieldOptions_STRING_PIECE FieldOptions_CType = 2
-)
-
-var FieldOptions_CType_name = map[int32]string{
- 0: "STRING",
- 1: "CORD",
- 2: "STRING_PIECE",
-}
-var FieldOptions_CType_value = map[string]int32{
- "STRING": 0,
- "CORD": 1,
- "STRING_PIECE": 2,
-}
-
-func (x FieldOptions_CType) Enum() *FieldOptions_CType {
- p := new(FieldOptions_CType)
- *p = x
- return p
-}
-func (x FieldOptions_CType) String() string {
- return proto.EnumName(FieldOptions_CType_name, int32(x))
-}
-func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType")
- if err != nil {
- return err
- }
- *x = FieldOptions_CType(value)
- return nil
-}
-func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12, 0}
-}
-
-type FieldOptions_JSType int32
-
-const (
- // Use the default type.
- FieldOptions_JS_NORMAL FieldOptions_JSType = 0
- // Use JavaScript strings.
- FieldOptions_JS_STRING FieldOptions_JSType = 1
- // Use JavaScript numbers.
- FieldOptions_JS_NUMBER FieldOptions_JSType = 2
-)
-
-var FieldOptions_JSType_name = map[int32]string{
- 0: "JS_NORMAL",
- 1: "JS_STRING",
- 2: "JS_NUMBER",
-}
-var FieldOptions_JSType_value = map[string]int32{
- "JS_NORMAL": 0,
- "JS_STRING": 1,
- "JS_NUMBER": 2,
-}
-
-func (x FieldOptions_JSType) Enum() *FieldOptions_JSType {
- p := new(FieldOptions_JSType)
- *p = x
- return p
-}
-func (x FieldOptions_JSType) String() string {
- return proto.EnumName(FieldOptions_JSType_name, int32(x))
-}
-func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType")
- if err != nil {
- return err
- }
- *x = FieldOptions_JSType(value)
- return nil
-}
-func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12, 1}
-}
-
-// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
-// or neither? HTTP based RPC implementation may choose GET verb for safe
-// methods, and PUT verb for idempotent methods instead of the default POST.
-type MethodOptions_IdempotencyLevel int32
-
-const (
- MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0
- MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1
- MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2
-)
-
-var MethodOptions_IdempotencyLevel_name = map[int32]string{
- 0: "IDEMPOTENCY_UNKNOWN",
- 1: "NO_SIDE_EFFECTS",
- 2: "IDEMPOTENT",
-}
-var MethodOptions_IdempotencyLevel_value = map[string]int32{
- "IDEMPOTENCY_UNKNOWN": 0,
- "NO_SIDE_EFFECTS": 1,
- "IDEMPOTENT": 2,
-}
-
-func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel {
- p := new(MethodOptions_IdempotencyLevel)
- *p = x
- return p
-}
-func (x MethodOptions_IdempotencyLevel) String() string {
- return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x))
-}
-func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel")
- if err != nil {
- return err
- }
- *x = MethodOptions_IdempotencyLevel(value)
- return nil
-}
-func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{17, 0}
-}
-
-// The protocol compiler can output a FileDescriptorSet containing the .proto
-// files it parses.
-type FileDescriptorSet struct {
- File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} }
-func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) }
-func (*FileDescriptorSet) ProtoMessage() {}
-func (*FileDescriptorSet) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{0}
-}
-func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b)
-}
-func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic)
-}
-func (dst *FileDescriptorSet) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileDescriptorSet.Merge(dst, src)
-}
-func (m *FileDescriptorSet) XXX_Size() int {
- return xxx_messageInfo_FileDescriptorSet.Size(m)
-}
-func (m *FileDescriptorSet) XXX_DiscardUnknown() {
- xxx_messageInfo_FileDescriptorSet.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileDescriptorSet proto.InternalMessageInfo
-
-func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto {
- if m != nil {
- return m.File
- }
- return nil
-}
-
-// Describes a complete .proto file.
-type FileDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"`
- // Names of files imported by this file.
- Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"`
- // Indexes of the public imported files in the dependency list above.
- PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"`
- // Indexes of the weak imported files in the dependency list.
- // For Google-internal migration only. Do not use.
- WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"`
- // All top-level definitions in this file.
- MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"`
- EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
- Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"`
- Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"`
- Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
- // This field contains optional information about the original source code.
- // You may safely remove this entire field without harming runtime
- // functionality of the descriptors -- the information is needed only by
- // development tools.
- SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"`
- // The syntax of the proto file.
- // The supported values are "proto2" and "proto3".
- Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} }
-func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*FileDescriptorProto) ProtoMessage() {}
-func (*FileDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{1}
-}
-func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b)
-}
-func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *FileDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileDescriptorProto.Merge(dst, src)
-}
-func (m *FileDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_FileDescriptorProto.Size(m)
-}
-func (m *FileDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_FileDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileDescriptorProto proto.InternalMessageInfo
-
-func (m *FileDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *FileDescriptorProto) GetPackage() string {
- if m != nil && m.Package != nil {
- return *m.Package
- }
- return ""
-}
-
-func (m *FileDescriptorProto) GetDependency() []string {
- if m != nil {
- return m.Dependency
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetPublicDependency() []int32 {
- if m != nil {
- return m.PublicDependency
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetWeakDependency() []int32 {
- if m != nil {
- return m.WeakDependency
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto {
- if m != nil {
- return m.MessageType
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto {
- if m != nil {
- return m.EnumType
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto {
- if m != nil {
- return m.Service
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto {
- if m != nil {
- return m.Extension
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetOptions() *FileOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo {
- if m != nil {
- return m.SourceCodeInfo
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetSyntax() string {
- if m != nil && m.Syntax != nil {
- return *m.Syntax
- }
- return ""
-}
-
-// Describes a message type.
-type DescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"`
- Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"`
- NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"`
- EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
- ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"`
- OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"`
- Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"`
- ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
- // Reserved field names, which may not be used by fields in the same message.
- // A given name may only be reserved once.
- ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DescriptorProto) Reset() { *m = DescriptorProto{} }
-func (m *DescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*DescriptorProto) ProtoMessage() {}
-func (*DescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2}
-}
-func (m *DescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DescriptorProto.Unmarshal(m, b)
-}
-func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *DescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DescriptorProto.Merge(dst, src)
-}
-func (m *DescriptorProto) XXX_Size() int {
- return xxx_messageInfo_DescriptorProto.Size(m)
-}
-func (m *DescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_DescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DescriptorProto proto.InternalMessageInfo
-
-func (m *DescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *DescriptorProto) GetField() []*FieldDescriptorProto {
- if m != nil {
- return m.Field
- }
- return nil
-}
-
-func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto {
- if m != nil {
- return m.Extension
- }
- return nil
-}
-
-func (m *DescriptorProto) GetNestedType() []*DescriptorProto {
- if m != nil {
- return m.NestedType
- }
- return nil
-}
-
-func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto {
- if m != nil {
- return m.EnumType
- }
- return nil
-}
-
-func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange {
- if m != nil {
- return m.ExtensionRange
- }
- return nil
-}
-
-func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto {
- if m != nil {
- return m.OneofDecl
- }
- return nil
-}
-
-func (m *DescriptorProto) GetOptions() *MessageOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange {
- if m != nil {
- return m.ReservedRange
- }
- return nil
-}
-
-func (m *DescriptorProto) GetReservedName() []string {
- if m != nil {
- return m.ReservedName
- }
- return nil
-}
-
-type DescriptorProto_ExtensionRange struct {
- Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
- End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
- Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} }
-func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) }
-func (*DescriptorProto_ExtensionRange) ProtoMessage() {}
-func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2, 0}
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic)
-}
-func (dst *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(dst, src)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Size() int {
- return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_DiscardUnknown() {
- xxx_messageInfo_DescriptorProto_ExtensionRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DescriptorProto_ExtensionRange proto.InternalMessageInfo
-
-func (m *DescriptorProto_ExtensionRange) GetStart() int32 {
- if m != nil && m.Start != nil {
- return *m.Start
- }
- return 0
-}
-
-func (m *DescriptorProto_ExtensionRange) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-func (m *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Range of reserved tag numbers. Reserved tag numbers may not be used by
-// fields or extension ranges in the same message. Reserved ranges may
-// not overlap.
-type DescriptorProto_ReservedRange struct {
- Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
- End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} }
-func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) }
-func (*DescriptorProto_ReservedRange) ProtoMessage() {}
-func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2, 1}
-}
-func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b)
-}
-func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic)
-}
-func (dst *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DescriptorProto_ReservedRange.Merge(dst, src)
-}
-func (m *DescriptorProto_ReservedRange) XXX_Size() int {
- return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m)
-}
-func (m *DescriptorProto_ReservedRange) XXX_DiscardUnknown() {
- xxx_messageInfo_DescriptorProto_ReservedRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DescriptorProto_ReservedRange proto.InternalMessageInfo
-
-func (m *DescriptorProto_ReservedRange) GetStart() int32 {
- if m != nil && m.Start != nil {
- return *m.Start
- }
- return 0
-}
-
-func (m *DescriptorProto_ReservedRange) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-type ExtensionRangeOptions struct {
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} }
-func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) }
-func (*ExtensionRangeOptions) ProtoMessage() {}
-func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{3}
-}
-
-var extRange_ExtensionRangeOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_ExtensionRangeOptions
-}
-func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b)
-}
-func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic)
-}
-func (dst *ExtensionRangeOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExtensionRangeOptions.Merge(dst, src)
-}
-func (m *ExtensionRangeOptions) XXX_Size() int {
- return xxx_messageInfo_ExtensionRangeOptions.Size(m)
-}
-func (m *ExtensionRangeOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ExtensionRangeOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExtensionRangeOptions proto.InternalMessageInfo
-
-func (m *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-// Describes a field within a message.
-type FieldDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
- Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"`
- // If type_name is set, this need not be set. If both this and type_name
- // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
- Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"`
- // For message and enum types, this is the name of the type. If the name
- // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
- // rules are used to find the type (i.e. first the nested types within this
- // message are searched, then within the parent, on up to the root
- // namespace).
- TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"`
- // For extensions, this is the name of the type being extended. It is
- // resolved in the same manner as type_name.
- Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"`
- // For numeric types, contains the original text representation of the value.
- // For booleans, "true" or "false".
- // For strings, contains the default text contents (not escaped in any way).
- // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
- // TODO(kenton): Base-64 encode?
- DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"`
- // If set, gives the index of a oneof in the containing type's oneof_decl
- // list. This field is a member of that oneof.
- OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"`
- // JSON name of this field. The value is set by protocol compiler. If the
- // user has set a "json_name" option on this field, that option's value
- // will be used. Otherwise, it's deduced from the field's name by converting
- // it to camelCase.
- JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"`
- Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} }
-func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*FieldDescriptorProto) ProtoMessage() {}
-func (*FieldDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4}
-}
-func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b)
-}
-func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *FieldDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FieldDescriptorProto.Merge(dst, src)
-}
-func (m *FieldDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_FieldDescriptorProto.Size(m)
-}
-func (m *FieldDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_FieldDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FieldDescriptorProto proto.InternalMessageInfo
-
-func (m *FieldDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetNumber() int32 {
- if m != nil && m.Number != nil {
- return *m.Number
- }
- return 0
-}
-
-func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label {
- if m != nil && m.Label != nil {
- return *m.Label
- }
- return FieldDescriptorProto_LABEL_OPTIONAL
-}
-
-func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type {
- if m != nil && m.Type != nil {
- return *m.Type
- }
- return FieldDescriptorProto_TYPE_DOUBLE
-}
-
-func (m *FieldDescriptorProto) GetTypeName() string {
- if m != nil && m.TypeName != nil {
- return *m.TypeName
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetExtendee() string {
- if m != nil && m.Extendee != nil {
- return *m.Extendee
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetDefaultValue() string {
- if m != nil && m.DefaultValue != nil {
- return *m.DefaultValue
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetOneofIndex() int32 {
- if m != nil && m.OneofIndex != nil {
- return *m.OneofIndex
- }
- return 0
-}
-
-func (m *FieldDescriptorProto) GetJsonName() string {
- if m != nil && m.JsonName != nil {
- return *m.JsonName
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetOptions() *FieldOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes a oneof.
-type OneofDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} }
-func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*OneofDescriptorProto) ProtoMessage() {}
-func (*OneofDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{5}
-}
-func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b)
-}
-func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *OneofDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OneofDescriptorProto.Merge(dst, src)
-}
-func (m *OneofDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_OneofDescriptorProto.Size(m)
-}
-func (m *OneofDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_OneofDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OneofDescriptorProto proto.InternalMessageInfo
-
-func (m *OneofDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *OneofDescriptorProto) GetOptions() *OneofOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes an enum type.
-type EnumDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"`
- Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- // Range of reserved numeric values. Reserved numeric values may not be used
- // by enum values in the same enum declaration. Reserved ranges may not
- // overlap.
- ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
- // Reserved enum value names, which may not be reused. A given name may only
- // be reserved once.
- ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} }
-func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*EnumDescriptorProto) ProtoMessage() {}
-func (*EnumDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{6}
-}
-func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b)
-}
-func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *EnumDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumDescriptorProto.Merge(dst, src)
-}
-func (m *EnumDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_EnumDescriptorProto.Size(m)
-}
-func (m *EnumDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumDescriptorProto proto.InternalMessageInfo
-
-func (m *EnumDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-func (m *EnumDescriptorProto) GetOptions() *EnumOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange {
- if m != nil {
- return m.ReservedRange
- }
- return nil
-}
-
-func (m *EnumDescriptorProto) GetReservedName() []string {
- if m != nil {
- return m.ReservedName
- }
- return nil
-}
-
-// Range of reserved numeric values. Reserved values may not be used by
-// entries in the same enum. Reserved ranges may not overlap.
-//
-// Note that this is distinct from DescriptorProto.ReservedRange in that it
-// is inclusive such that it can appropriately represent the entire int32
-// domain.
-type EnumDescriptorProto_EnumReservedRange struct {
- Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
- End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescriptorProto_EnumReservedRange{} }
-func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) }
-func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {}
-func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{6, 0}
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic)
-}
-func (dst *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(dst, src)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int {
- return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumDescriptorProto_EnumReservedRange proto.InternalMessageInfo
-
-func (m *EnumDescriptorProto_EnumReservedRange) GetStart() int32 {
- if m != nil && m.Start != nil {
- return *m.Start
- }
- return 0
-}
-
-func (m *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-// Describes a value within an enum.
-type EnumValueDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"`
- Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} }
-func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*EnumValueDescriptorProto) ProtoMessage() {}
-func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{7}
-}
-func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b)
-}
-func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *EnumValueDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumValueDescriptorProto.Merge(dst, src)
-}
-func (m *EnumValueDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_EnumValueDescriptorProto.Size(m)
-}
-func (m *EnumValueDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumValueDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumValueDescriptorProto proto.InternalMessageInfo
-
-func (m *EnumValueDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *EnumValueDescriptorProto) GetNumber() int32 {
- if m != nil && m.Number != nil {
- return *m.Number
- }
- return 0
-}
-
-func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes a service.
-type ServiceDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"`
- Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} }
-func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*ServiceDescriptorProto) ProtoMessage() {}
-func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{8}
-}
-func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b)
-}
-func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *ServiceDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceDescriptorProto.Merge(dst, src)
-}
-func (m *ServiceDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_ServiceDescriptorProto.Size(m)
-}
-func (m *ServiceDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ServiceDescriptorProto proto.InternalMessageInfo
-
-func (m *ServiceDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto {
- if m != nil {
- return m.Method
- }
- return nil
-}
-
-func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes a method of a service.
-type MethodDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- // Input and output type names. These are resolved in the same way as
- // FieldDescriptorProto.type_name, but must refer to a message type.
- InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"`
- OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"`
- Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"`
- // Identifies if client streams multiple client messages
- ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"`
- // Identifies if server streams multiple server messages
- ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} }
-func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*MethodDescriptorProto) ProtoMessage() {}
-func (*MethodDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{9}
-}
-func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b)
-}
-func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic)
-}
-func (dst *MethodDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MethodDescriptorProto.Merge(dst, src)
-}
-func (m *MethodDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_MethodDescriptorProto.Size(m)
-}
-func (m *MethodDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_MethodDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MethodDescriptorProto proto.InternalMessageInfo
-
-const Default_MethodDescriptorProto_ClientStreaming bool = false
-const Default_MethodDescriptorProto_ServerStreaming bool = false
-
-func (m *MethodDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *MethodDescriptorProto) GetInputType() string {
- if m != nil && m.InputType != nil {
- return *m.InputType
- }
- return ""
-}
-
-func (m *MethodDescriptorProto) GetOutputType() string {
- if m != nil && m.OutputType != nil {
- return *m.OutputType
- }
- return ""
-}
-
-func (m *MethodDescriptorProto) GetOptions() *MethodOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *MethodDescriptorProto) GetClientStreaming() bool {
- if m != nil && m.ClientStreaming != nil {
- return *m.ClientStreaming
- }
- return Default_MethodDescriptorProto_ClientStreaming
-}
-
-func (m *MethodDescriptorProto) GetServerStreaming() bool {
- if m != nil && m.ServerStreaming != nil {
- return *m.ServerStreaming
- }
- return Default_MethodDescriptorProto_ServerStreaming
-}
-
-type FileOptions struct {
- // Sets the Java package where classes generated from this .proto will be
- // placed. By default, the proto package is used, but this is often
- // inappropriate because proto packages do not normally start with backwards
- // domain names.
- JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"`
- // If set, all the classes from the .proto file are wrapped in a single
- // outer class with the given name. This applies to both Proto1
- // (equivalent to the old "--one_java_file" option) and Proto2 (where
- // a .proto always translates to a single class, but you may want to
- // explicitly choose the class name).
- JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"`
- // If set true, then the Java code generator will generate a separate .java
- // file for each top-level message, enum, and service defined in the .proto
- // file. Thus, these types will *not* be nested inside the outer class
- // named by java_outer_classname. However, the outer class will still be
- // generated to contain the file's getDescriptor() method as well as any
- // top-level extensions defined in the file.
- JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"`
- // This option does nothing.
- JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated: Do not use.
- // If set true, then the Java2 code generator will generate code that
- // throws an exception whenever an attempt is made to assign a non-UTF-8
- // byte sequence to a string field.
- // Message reflection will do the same.
- // However, an extension field still accepts non-UTF-8 byte sequences.
- // This option has no effect on when used with the lite runtime.
- JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"`
- OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"`
- // Sets the Go package where structs generated from this .proto will be
- // placed. If omitted, the Go package will be derived from the following:
- // - The basename of the package import path, if provided.
- // - Otherwise, the package statement in the .proto file, if present.
- // - Otherwise, the basename of the .proto file, without extension.
- GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"`
- // Should generic services be generated in each language? "Generic" services
- // are not specific to any particular RPC system. They are generated by the
- // main code generators in each language (without additional plugins).
- // Generic services were the only kind of service generation supported by
- // early versions of google.protobuf.
- //
- // Generic services are now considered deprecated in favor of using plugins
- // that generate code specific to your particular RPC system. Therefore,
- // these default to false. Old code which depends on generic services should
- // explicitly set them to true.
- CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"`
- JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"`
- PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"`
- PhpGenericServices *bool `protobuf:"varint,42,opt,name=php_generic_services,json=phpGenericServices,def=0" json:"php_generic_services,omitempty"`
- // Is this file deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for everything in the file, or it will be completely ignored; in the very
- // least, this is a formalization for deprecating files.
- Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // Enables the use of arenas for the proto messages in this file. This applies
- // only to generated classes for C++.
- CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"`
- // Sets the objective c class prefix which is prepended to all objective c
- // generated classes from this .proto. There is no default.
- ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"`
- // Namespace for generated classes; defaults to the package.
- CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"`
- // By default Swift generators will take the proto package and CamelCase it
- // replacing '.' with underscore and use that to prefix the types/symbols
- // defined. When this options is provided, they will use this value instead
- // to prefix the types/symbols defined.
- SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"`
- // Sets the php class prefix which is prepended to all php generated classes
- // from this .proto. Default is empty.
- PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"`
- // Use this option to change the namespace of php generated classes. Default
- // is empty. When this option is empty, the package name will be used for
- // determining the namespace.
- PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"`
- // The parser stores options it doesn't recognize here.
- // See the documentation for the "Options" section above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileOptions) Reset() { *m = FileOptions{} }
-func (m *FileOptions) String() string { return proto.CompactTextString(m) }
-func (*FileOptions) ProtoMessage() {}
-func (*FileOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{10}
-}
-
-var extRange_FileOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_FileOptions
-}
-func (m *FileOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileOptions.Unmarshal(m, b)
-}
-func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic)
-}
-func (dst *FileOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileOptions.Merge(dst, src)
-}
-func (m *FileOptions) XXX_Size() int {
- return xxx_messageInfo_FileOptions.Size(m)
-}
-func (m *FileOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_FileOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileOptions proto.InternalMessageInfo
-
-const Default_FileOptions_JavaMultipleFiles bool = false
-const Default_FileOptions_JavaStringCheckUtf8 bool = false
-const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED
-const Default_FileOptions_CcGenericServices bool = false
-const Default_FileOptions_JavaGenericServices bool = false
-const Default_FileOptions_PyGenericServices bool = false
-const Default_FileOptions_PhpGenericServices bool = false
-const Default_FileOptions_Deprecated bool = false
-const Default_FileOptions_CcEnableArenas bool = false
-
-func (m *FileOptions) GetJavaPackage() string {
- if m != nil && m.JavaPackage != nil {
- return *m.JavaPackage
- }
- return ""
-}
-
-func (m *FileOptions) GetJavaOuterClassname() string {
- if m != nil && m.JavaOuterClassname != nil {
- return *m.JavaOuterClassname
- }
- return ""
-}
-
-func (m *FileOptions) GetJavaMultipleFiles() bool {
- if m != nil && m.JavaMultipleFiles != nil {
- return *m.JavaMultipleFiles
- }
- return Default_FileOptions_JavaMultipleFiles
-}
-
-// Deprecated: Do not use.
-func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool {
- if m != nil && m.JavaGenerateEqualsAndHash != nil {
- return *m.JavaGenerateEqualsAndHash
- }
- return false
-}
-
-func (m *FileOptions) GetJavaStringCheckUtf8() bool {
- if m != nil && m.JavaStringCheckUtf8 != nil {
- return *m.JavaStringCheckUtf8
- }
- return Default_FileOptions_JavaStringCheckUtf8
-}
-
-func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode {
- if m != nil && m.OptimizeFor != nil {
- return *m.OptimizeFor
- }
- return Default_FileOptions_OptimizeFor
-}
-
-func (m *FileOptions) GetGoPackage() string {
- if m != nil && m.GoPackage != nil {
- return *m.GoPackage
- }
- return ""
-}
-
-func (m *FileOptions) GetCcGenericServices() bool {
- if m != nil && m.CcGenericServices != nil {
- return *m.CcGenericServices
- }
- return Default_FileOptions_CcGenericServices
-}
-
-func (m *FileOptions) GetJavaGenericServices() bool {
- if m != nil && m.JavaGenericServices != nil {
- return *m.JavaGenericServices
- }
- return Default_FileOptions_JavaGenericServices
-}
-
-func (m *FileOptions) GetPyGenericServices() bool {
- if m != nil && m.PyGenericServices != nil {
- return *m.PyGenericServices
- }
- return Default_FileOptions_PyGenericServices
-}
-
-func (m *FileOptions) GetPhpGenericServices() bool {
- if m != nil && m.PhpGenericServices != nil {
- return *m.PhpGenericServices
- }
- return Default_FileOptions_PhpGenericServices
-}
-
-func (m *FileOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_FileOptions_Deprecated
-}
-
-func (m *FileOptions) GetCcEnableArenas() bool {
- if m != nil && m.CcEnableArenas != nil {
- return *m.CcEnableArenas
- }
- return Default_FileOptions_CcEnableArenas
-}
-
-func (m *FileOptions) GetObjcClassPrefix() string {
- if m != nil && m.ObjcClassPrefix != nil {
- return *m.ObjcClassPrefix
- }
- return ""
-}
-
-func (m *FileOptions) GetCsharpNamespace() string {
- if m != nil && m.CsharpNamespace != nil {
- return *m.CsharpNamespace
- }
- return ""
-}
-
-func (m *FileOptions) GetSwiftPrefix() string {
- if m != nil && m.SwiftPrefix != nil {
- return *m.SwiftPrefix
- }
- return ""
-}
-
-func (m *FileOptions) GetPhpClassPrefix() string {
- if m != nil && m.PhpClassPrefix != nil {
- return *m.PhpClassPrefix
- }
- return ""
-}
-
-func (m *FileOptions) GetPhpNamespace() string {
- if m != nil && m.PhpNamespace != nil {
- return *m.PhpNamespace
- }
- return ""
-}
-
-func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type MessageOptions struct {
- // Set true to use the old proto1 MessageSet wire format for extensions.
- // This is provided for backwards-compatibility with the MessageSet wire
- // format. You should not use this for any other reason: It's less
- // efficient, has fewer features, and is more complicated.
- //
- // The message must be defined exactly as follows:
- // message Foo {
- // option message_set_wire_format = true;
- // extensions 4 to max;
- // }
- // Note that the message cannot have any defined fields; MessageSets only
- // have extensions.
- //
- // All extensions of your type must be singular messages; e.g. they cannot
- // be int32s, enums, or repeated messages.
- //
- // Because this is an option, the above two restrictions are not enforced by
- // the protocol compiler.
- MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"`
- // Disables the generation of the standard "descriptor()" accessor, which can
- // conflict with a field of the same name. This is meant to make migration
- // from proto1 easier; new code should avoid fields named "descriptor".
- NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"`
- // Is this message deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the message, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating messages.
- Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // Whether the message is an automatically generated map entry type for the
- // maps field.
- //
- // For maps fields:
- // map map_field = 1;
- // The parsed descriptor looks like:
- // message MapFieldEntry {
- // option map_entry = true;
- // optional KeyType key = 1;
- // optional ValueType value = 2;
- // }
- // repeated MapFieldEntry map_field = 1;
- //
- // Implementations may choose not to generate the map_entry=true message, but
- // use a native map in the target language to hold the keys and values.
- // The reflection APIs in such implementions still need to work as
- // if the field is a repeated message field.
- //
- // NOTE: Do not set the option in .proto files. Always use the maps syntax
- // instead. The option should only be implicitly set by the proto compiler
- // parser.
- MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MessageOptions) Reset() { *m = MessageOptions{} }
-func (m *MessageOptions) String() string { return proto.CompactTextString(m) }
-func (*MessageOptions) ProtoMessage() {}
-func (*MessageOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{11}
-}
-
-var extRange_MessageOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_MessageOptions
-}
-func (m *MessageOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MessageOptions.Unmarshal(m, b)
-}
-func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic)
-}
-func (dst *MessageOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MessageOptions.Merge(dst, src)
-}
-func (m *MessageOptions) XXX_Size() int {
- return xxx_messageInfo_MessageOptions.Size(m)
-}
-func (m *MessageOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_MessageOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MessageOptions proto.InternalMessageInfo
-
-const Default_MessageOptions_MessageSetWireFormat bool = false
-const Default_MessageOptions_NoStandardDescriptorAccessor bool = false
-const Default_MessageOptions_Deprecated bool = false
-
-func (m *MessageOptions) GetMessageSetWireFormat() bool {
- if m != nil && m.MessageSetWireFormat != nil {
- return *m.MessageSetWireFormat
- }
- return Default_MessageOptions_MessageSetWireFormat
-}
-
-func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool {
- if m != nil && m.NoStandardDescriptorAccessor != nil {
- return *m.NoStandardDescriptorAccessor
- }
- return Default_MessageOptions_NoStandardDescriptorAccessor
-}
-
-func (m *MessageOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_MessageOptions_Deprecated
-}
-
-func (m *MessageOptions) GetMapEntry() bool {
- if m != nil && m.MapEntry != nil {
- return *m.MapEntry
- }
- return false
-}
-
-func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type FieldOptions struct {
- // The ctype option instructs the C++ code generator to use a different
- // representation of the field than it normally would. See the specific
- // options below. This option is not yet implemented in the open source
- // release -- sorry, we'll try to include it in a future version!
- Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"`
- // The packed option can be enabled for repeated primitive fields to enable
- // a more efficient representation on the wire. Rather than repeatedly
- // writing the tag and type for each element, the entire array is encoded as
- // a single length-delimited blob. In proto3, only explicit setting it to
- // false will avoid using packed encoding.
- Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"`
- // The jstype option determines the JavaScript type used for values of the
- // field. The option is permitted only for 64 bit integral and fixed types
- // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
- // is represented as JavaScript string, which avoids loss of precision that
- // can happen when a large value is converted to a floating point JavaScript.
- // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
- // use the JavaScript "number" type. The behavior of the default option
- // JS_NORMAL is implementation dependent.
- //
- // This option is an enum to permit additional types to be added, e.g.
- // goog.math.Integer.
- Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"`
- // Should this field be parsed lazily? Lazy applies only to message-type
- // fields. It means that when the outer message is initially parsed, the
- // inner message's contents will not be parsed but instead stored in encoded
- // form. The inner message will actually be parsed when it is first accessed.
- //
- // This is only a hint. Implementations are free to choose whether to use
- // eager or lazy parsing regardless of the value of this option. However,
- // setting this option true suggests that the protocol author believes that
- // using lazy parsing on this field is worth the additional bookkeeping
- // overhead typically needed to implement it.
- //
- // This option does not affect the public interface of any generated code;
- // all method signatures remain the same. Furthermore, thread-safety of the
- // interface is not affected by this option; const methods remain safe to
- // call from multiple threads concurrently, while non-const methods continue
- // to require exclusive access.
- //
- //
- // Note that implementations may choose not to check required fields within
- // a lazy sub-message. That is, calling IsInitialized() on the outer message
- // may return true even if the inner message has missing required fields.
- // This is necessary because otherwise the inner message would have to be
- // parsed in order to perform the check, defeating the purpose of lazy
- // parsing. An implementation which chooses not to check required fields
- // must be consistent about it. That is, for any particular sub-message, the
- // implementation must either *always* check its required fields, or *never*
- // check its required fields, regardless of whether or not the message has
- // been parsed.
- Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"`
- // Is this field deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for accessors, or it will be completely ignored; in the very least, this
- // is a formalization for deprecating fields.
- Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // For Google-internal migration only. Do not use.
- Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FieldOptions) Reset() { *m = FieldOptions{} }
-func (m *FieldOptions) String() string { return proto.CompactTextString(m) }
-func (*FieldOptions) ProtoMessage() {}
-func (*FieldOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12}
-}
-
-var extRange_FieldOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_FieldOptions
-}
-func (m *FieldOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FieldOptions.Unmarshal(m, b)
-}
-func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic)
-}
-func (dst *FieldOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FieldOptions.Merge(dst, src)
-}
-func (m *FieldOptions) XXX_Size() int {
- return xxx_messageInfo_FieldOptions.Size(m)
-}
-func (m *FieldOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_FieldOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FieldOptions proto.InternalMessageInfo
-
-const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING
-const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL
-const Default_FieldOptions_Lazy bool = false
-const Default_FieldOptions_Deprecated bool = false
-const Default_FieldOptions_Weak bool = false
-
-func (m *FieldOptions) GetCtype() FieldOptions_CType {
- if m != nil && m.Ctype != nil {
- return *m.Ctype
- }
- return Default_FieldOptions_Ctype
-}
-
-func (m *FieldOptions) GetPacked() bool {
- if m != nil && m.Packed != nil {
- return *m.Packed
- }
- return false
-}
-
-func (m *FieldOptions) GetJstype() FieldOptions_JSType {
- if m != nil && m.Jstype != nil {
- return *m.Jstype
- }
- return Default_FieldOptions_Jstype
-}
-
-func (m *FieldOptions) GetLazy() bool {
- if m != nil && m.Lazy != nil {
- return *m.Lazy
- }
- return Default_FieldOptions_Lazy
-}
-
-func (m *FieldOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_FieldOptions_Deprecated
-}
-
-func (m *FieldOptions) GetWeak() bool {
- if m != nil && m.Weak != nil {
- return *m.Weak
- }
- return Default_FieldOptions_Weak
-}
-
-func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type OneofOptions struct {
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OneofOptions) Reset() { *m = OneofOptions{} }
-func (m *OneofOptions) String() string { return proto.CompactTextString(m) }
-func (*OneofOptions) ProtoMessage() {}
-func (*OneofOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{13}
-}
-
-var extRange_OneofOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_OneofOptions
-}
-func (m *OneofOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OneofOptions.Unmarshal(m, b)
-}
-func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic)
-}
-func (dst *OneofOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OneofOptions.Merge(dst, src)
-}
-func (m *OneofOptions) XXX_Size() int {
- return xxx_messageInfo_OneofOptions.Size(m)
-}
-func (m *OneofOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_OneofOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OneofOptions proto.InternalMessageInfo
-
-func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type EnumOptions struct {
- // Set this option to true to allow mapping different tag names to the same
- // value.
- AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"`
- // Is this enum deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the enum, or it will be completely ignored; in the very least, this
- // is a formalization for deprecating enums.
- Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumOptions) Reset() { *m = EnumOptions{} }
-func (m *EnumOptions) String() string { return proto.CompactTextString(m) }
-func (*EnumOptions) ProtoMessage() {}
-func (*EnumOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{14}
-}
-
-var extRange_EnumOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_EnumOptions
-}
-func (m *EnumOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumOptions.Unmarshal(m, b)
-}
-func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic)
-}
-func (dst *EnumOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumOptions.Merge(dst, src)
-}
-func (m *EnumOptions) XXX_Size() int {
- return xxx_messageInfo_EnumOptions.Size(m)
-}
-func (m *EnumOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumOptions proto.InternalMessageInfo
-
-const Default_EnumOptions_Deprecated bool = false
-
-func (m *EnumOptions) GetAllowAlias() bool {
- if m != nil && m.AllowAlias != nil {
- return *m.AllowAlias
- }
- return false
-}
-
-func (m *EnumOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_EnumOptions_Deprecated
-}
-
-func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type EnumValueOptions struct {
- // Is this enum value deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the enum value, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating enum values.
- Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} }
-func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) }
-func (*EnumValueOptions) ProtoMessage() {}
-func (*EnumValueOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{15}
-}
-
-var extRange_EnumValueOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_EnumValueOptions
-}
-func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b)
-}
-func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic)
-}
-func (dst *EnumValueOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumValueOptions.Merge(dst, src)
-}
-func (m *EnumValueOptions) XXX_Size() int {
- return xxx_messageInfo_EnumValueOptions.Size(m)
-}
-func (m *EnumValueOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumValueOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumValueOptions proto.InternalMessageInfo
-
-const Default_EnumValueOptions_Deprecated bool = false
-
-func (m *EnumValueOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_EnumValueOptions_Deprecated
-}
-
-func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type ServiceOptions struct {
- // Is this service deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the service, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating services.
- Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ServiceOptions) Reset() { *m = ServiceOptions{} }
-func (m *ServiceOptions) String() string { return proto.CompactTextString(m) }
-func (*ServiceOptions) ProtoMessage() {}
-func (*ServiceOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{16}
-}
-
-var extRange_ServiceOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_ServiceOptions
-}
-func (m *ServiceOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ServiceOptions.Unmarshal(m, b)
-}
-func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic)
-}
-func (dst *ServiceOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceOptions.Merge(dst, src)
-}
-func (m *ServiceOptions) XXX_Size() int {
- return xxx_messageInfo_ServiceOptions.Size(m)
-}
-func (m *ServiceOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ServiceOptions proto.InternalMessageInfo
-
-const Default_ServiceOptions_Deprecated bool = false
-
-func (m *ServiceOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_ServiceOptions_Deprecated
-}
-
-func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type MethodOptions struct {
- // Is this method deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the method, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating methods.
- Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MethodOptions) Reset() { *m = MethodOptions{} }
-func (m *MethodOptions) String() string { return proto.CompactTextString(m) }
-func (*MethodOptions) ProtoMessage() {}
-func (*MethodOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{17}
-}
-
-var extRange_MethodOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_MethodOptions
-}
-func (m *MethodOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MethodOptions.Unmarshal(m, b)
-}
-func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic)
-}
-func (dst *MethodOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MethodOptions.Merge(dst, src)
-}
-func (m *MethodOptions) XXX_Size() int {
- return xxx_messageInfo_MethodOptions.Size(m)
-}
-func (m *MethodOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_MethodOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MethodOptions proto.InternalMessageInfo
-
-const Default_MethodOptions_Deprecated bool = false
-const Default_MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN
-
-func (m *MethodOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_MethodOptions_Deprecated
-}
-
-func (m *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel {
- if m != nil && m.IdempotencyLevel != nil {
- return *m.IdempotencyLevel
- }
- return Default_MethodOptions_IdempotencyLevel
-}
-
-func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-// A message representing a option the parser does not recognize. This only
-// appears in options protos created by the compiler::Parser class.
-// DescriptorPool resolves these when building Descriptor objects. Therefore,
-// options protos in descriptor objects (e.g. returned by Descriptor::options(),
-// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
-// in them.
-type UninterpretedOption struct {
- Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"`
- // The value of the uninterpreted option, in whatever type the tokenizer
- // identified it as during parsing. Exactly one of these should be set.
- IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"`
- PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"`
- NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"`
- DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"`
- StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"`
- AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} }
-func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) }
-func (*UninterpretedOption) ProtoMessage() {}
-func (*UninterpretedOption) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{18}
-}
-func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b)
-}
-func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic)
-}
-func (dst *UninterpretedOption) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UninterpretedOption.Merge(dst, src)
-}
-func (m *UninterpretedOption) XXX_Size() int {
- return xxx_messageInfo_UninterpretedOption.Size(m)
-}
-func (m *UninterpretedOption) XXX_DiscardUnknown() {
- xxx_messageInfo_UninterpretedOption.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UninterpretedOption proto.InternalMessageInfo
-
-func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart {
- if m != nil {
- return m.Name
- }
- return nil
-}
-
-func (m *UninterpretedOption) GetIdentifierValue() string {
- if m != nil && m.IdentifierValue != nil {
- return *m.IdentifierValue
- }
- return ""
-}
-
-func (m *UninterpretedOption) GetPositiveIntValue() uint64 {
- if m != nil && m.PositiveIntValue != nil {
- return *m.PositiveIntValue
- }
- return 0
-}
-
-func (m *UninterpretedOption) GetNegativeIntValue() int64 {
- if m != nil && m.NegativeIntValue != nil {
- return *m.NegativeIntValue
- }
- return 0
-}
-
-func (m *UninterpretedOption) GetDoubleValue() float64 {
- if m != nil && m.DoubleValue != nil {
- return *m.DoubleValue
- }
- return 0
-}
-
-func (m *UninterpretedOption) GetStringValue() []byte {
- if m != nil {
- return m.StringValue
- }
- return nil
-}
-
-func (m *UninterpretedOption) GetAggregateValue() string {
- if m != nil && m.AggregateValue != nil {
- return *m.AggregateValue
- }
- return ""
-}
-
-// The name of the uninterpreted option. Each string represents a segment in
-// a dot-separated name. is_extension is true iff a segment represents an
-// extension (denoted with parentheses in options specs in .proto files).
-// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
-// "foo.(bar.baz).qux".
-type UninterpretedOption_NamePart struct {
- NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"`
- IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} }
-func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) }
-func (*UninterpretedOption_NamePart) ProtoMessage() {}
-func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{18, 0}
-}
-func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b)
-}
-func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic)
-}
-func (dst *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UninterpretedOption_NamePart.Merge(dst, src)
-}
-func (m *UninterpretedOption_NamePart) XXX_Size() int {
- return xxx_messageInfo_UninterpretedOption_NamePart.Size(m)
-}
-func (m *UninterpretedOption_NamePart) XXX_DiscardUnknown() {
- xxx_messageInfo_UninterpretedOption_NamePart.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UninterpretedOption_NamePart proto.InternalMessageInfo
-
-func (m *UninterpretedOption_NamePart) GetNamePart() string {
- if m != nil && m.NamePart != nil {
- return *m.NamePart
- }
- return ""
-}
-
-func (m *UninterpretedOption_NamePart) GetIsExtension() bool {
- if m != nil && m.IsExtension != nil {
- return *m.IsExtension
- }
- return false
-}
-
-// Encapsulates information about the original source file from which a
-// FileDescriptorProto was generated.
-type SourceCodeInfo struct {
- // A Location identifies a piece of source code in a .proto file which
- // corresponds to a particular definition. This information is intended
- // to be useful to IDEs, code indexers, documentation generators, and similar
- // tools.
- //
- // For example, say we have a file like:
- // message Foo {
- // optional string foo = 1;
- // }
- // Let's look at just the field definition:
- // optional string foo = 1;
- // ^ ^^ ^^ ^ ^^^
- // a bc de f ghi
- // We have the following locations:
- // span path represents
- // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
- // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
- // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
- // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
- // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
- //
- // Notes:
- // - A location may refer to a repeated field itself (i.e. not to any
- // particular index within it). This is used whenever a set of elements are
- // logically enclosed in a single code segment. For example, an entire
- // extend block (possibly containing multiple extension definitions) will
- // have an outer location whose path refers to the "extensions" repeated
- // field without an index.
- // - Multiple locations may have the same path. This happens when a single
- // logical declaration is spread out across multiple places. The most
- // obvious example is the "extend" block again -- there may be multiple
- // extend blocks in the same scope, each of which will have the same path.
- // - A location's span is not always a subset of its parent's span. For
- // example, the "extendee" of an extension declaration appears at the
- // beginning of the "extend" block and is shared by all extensions within
- // the block.
- // - Just because a location's span is a subset of some other location's span
- // does not mean that it is a descendent. For example, a "group" defines
- // both a type and a field in a single declaration. Thus, the locations
- // corresponding to the type and field and their components will overlap.
- // - Code which tries to interpret locations should probably be designed to
- // ignore those that it doesn't understand, as more types of locations could
- // be recorded in the future.
- Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} }
-func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) }
-func (*SourceCodeInfo) ProtoMessage() {}
-func (*SourceCodeInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{19}
-}
-func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b)
-}
-func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic)
-}
-func (dst *SourceCodeInfo) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SourceCodeInfo.Merge(dst, src)
-}
-func (m *SourceCodeInfo) XXX_Size() int {
- return xxx_messageInfo_SourceCodeInfo.Size(m)
-}
-func (m *SourceCodeInfo) XXX_DiscardUnknown() {
- xxx_messageInfo_SourceCodeInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SourceCodeInfo proto.InternalMessageInfo
-
-func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location {
- if m != nil {
- return m.Location
- }
- return nil
-}
-
-type SourceCodeInfo_Location struct {
- // Identifies which part of the FileDescriptorProto was defined at this
- // location.
- //
- // Each element is a field number or an index. They form a path from
- // the root FileDescriptorProto to the place where the definition. For
- // example, this path:
- // [ 4, 3, 2, 7, 1 ]
- // refers to:
- // file.message_type(3) // 4, 3
- // .field(7) // 2, 7
- // .name() // 1
- // This is because FileDescriptorProto.message_type has field number 4:
- // repeated DescriptorProto message_type = 4;
- // and DescriptorProto.field has field number 2:
- // repeated FieldDescriptorProto field = 2;
- // and FieldDescriptorProto.name has field number 1:
- // optional string name = 1;
- //
- // Thus, the above path gives the location of a field name. If we removed
- // the last element:
- // [ 4, 3, 2, 7 ]
- // this path refers to the whole field declaration (from the beginning
- // of the label to the terminating semicolon).
- Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
- // Always has exactly three or four elements: start line, start column,
- // end line (optional, otherwise assumed same as start line), end column.
- // These are packed into a single field for efficiency. Note that line
- // and column numbers are zero-based -- typically you will want to add
- // 1 to each before displaying to a user.
- Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"`
- // If this SourceCodeInfo represents a complete declaration, these are any
- // comments appearing before and after the declaration which appear to be
- // attached to the declaration.
- //
- // A series of line comments appearing on consecutive lines, with no other
- // tokens appearing on those lines, will be treated as a single comment.
- //
- // leading_detached_comments will keep paragraphs of comments that appear
- // before (but not connected to) the current element. Each paragraph,
- // separated by empty lines, will be one comment element in the repeated
- // field.
- //
- // Only the comment content is provided; comment markers (e.g. //) are
- // stripped out. For block comments, leading whitespace and an asterisk
- // will be stripped from the beginning of each line other than the first.
- // Newlines are included in the output.
- //
- // Examples:
- //
- // optional int32 foo = 1; // Comment attached to foo.
- // // Comment attached to bar.
- // optional int32 bar = 2;
- //
- // optional string baz = 3;
- // // Comment attached to baz.
- // // Another line attached to baz.
- //
- // // Comment attached to qux.
- // //
- // // Another line attached to qux.
- // optional double qux = 4;
- //
- // // Detached comment for corge. This is not leading or trailing comments
- // // to qux or corge because there are blank lines separating it from
- // // both.
- //
- // // Detached comment for corge paragraph 2.
- //
- // optional string corge = 5;
- // /* Block comment attached
- // * to corge. Leading asterisks
- // * will be removed. */
- // /* Block comment attached to
- // * grault. */
- // optional int32 grault = 6;
- //
- // // ignored detached comments.
- LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"`
- TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"`
- LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} }
-func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) }
-func (*SourceCodeInfo_Location) ProtoMessage() {}
-func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{19, 0}
-}
-func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b)
-}
-func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic)
-}
-func (dst *SourceCodeInfo_Location) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SourceCodeInfo_Location.Merge(dst, src)
-}
-func (m *SourceCodeInfo_Location) XXX_Size() int {
- return xxx_messageInfo_SourceCodeInfo_Location.Size(m)
-}
-func (m *SourceCodeInfo_Location) XXX_DiscardUnknown() {
- xxx_messageInfo_SourceCodeInfo_Location.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SourceCodeInfo_Location proto.InternalMessageInfo
-
-func (m *SourceCodeInfo_Location) GetPath() []int32 {
- if m != nil {
- return m.Path
- }
- return nil
-}
-
-func (m *SourceCodeInfo_Location) GetSpan() []int32 {
- if m != nil {
- return m.Span
- }
- return nil
-}
-
-func (m *SourceCodeInfo_Location) GetLeadingComments() string {
- if m != nil && m.LeadingComments != nil {
- return *m.LeadingComments
- }
- return ""
-}
-
-func (m *SourceCodeInfo_Location) GetTrailingComments() string {
- if m != nil && m.TrailingComments != nil {
- return *m.TrailingComments
- }
- return ""
-}
-
-func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string {
- if m != nil {
- return m.LeadingDetachedComments
- }
- return nil
-}
-
-// Describes the relationship between generated code and its original source
-// file. A GeneratedCodeInfo message is associated with only one generated
-// source file, but may contain references to different source .proto files.
-type GeneratedCodeInfo struct {
- // An Annotation connects some span of text in generated code to an element
- // of its generating .proto file.
- Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} }
-func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) }
-func (*GeneratedCodeInfo) ProtoMessage() {}
-func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{20}
-}
-func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b)
-}
-func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic)
-}
-func (dst *GeneratedCodeInfo) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GeneratedCodeInfo.Merge(dst, src)
-}
-func (m *GeneratedCodeInfo) XXX_Size() int {
- return xxx_messageInfo_GeneratedCodeInfo.Size(m)
-}
-func (m *GeneratedCodeInfo) XXX_DiscardUnknown() {
- xxx_messageInfo_GeneratedCodeInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GeneratedCodeInfo proto.InternalMessageInfo
-
-func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation {
- if m != nil {
- return m.Annotation
- }
- return nil
-}
-
-type GeneratedCodeInfo_Annotation struct {
- // Identifies the element in the original source .proto file. This field
- // is formatted the same as SourceCodeInfo.Location.path.
- Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
- // Identifies the filesystem path to the original source .proto.
- SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"`
- // Identifies the starting offset in bytes in the generated code
- // that relates to the identified object.
- Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"`
- // Identifies the ending offset in bytes in the generated code that
- // relates to the identified offset. The end offset should be one past
- // the last relevant byte (so the length of the text = end - begin).
- End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} }
-func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) }
-func (*GeneratedCodeInfo_Annotation) ProtoMessage() {}
-func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) {
- return fileDescriptor_descriptor_4df4cb5f42392df6, []int{20, 0}
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic)
-}
-func (dst *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(dst, src)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Size() int {
- return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_DiscardUnknown() {
- xxx_messageInfo_GeneratedCodeInfo_Annotation.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GeneratedCodeInfo_Annotation proto.InternalMessageInfo
-
-func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 {
- if m != nil {
- return m.Path
- }
- return nil
-}
-
-func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string {
- if m != nil && m.SourceFile != nil {
- return *m.SourceFile
- }
- return ""
-}
-
-func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 {
- if m != nil && m.Begin != nil {
- return *m.Begin
- }
- return 0
-}
-
-func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-func init() {
- proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet")
- proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto")
- proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto")
- proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange")
- proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange")
- proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions")
- proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto")
- proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto")
- proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto")
- proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange")
- proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto")
- proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto")
- proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto")
- proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions")
- proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions")
- proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions")
- proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions")
- proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions")
- proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions")
- proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions")
- proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions")
- proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption")
- proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart")
- proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo")
- proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location")
- proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo")
- proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation")
- proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
- proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
- proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
- proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
- proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
- proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
-}
-
-func init() {
- proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_descriptor_4df4cb5f42392df6)
-}
-
-var fileDescriptor_descriptor_4df4cb5f42392df6 = []byte{
- // 2555 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdd, 0x6e, 0x1b, 0xc7,
- 0xf5, 0xcf, 0xf2, 0x4b, 0xe4, 0x21, 0x45, 0x8d, 0x46, 0x8a, 0xbd, 0x56, 0x3e, 0x2c, 0x33, 0x1f,
- 0x96, 0x9d, 0x7f, 0xa8, 0xc0, 0xb1, 0x1d, 0x47, 0xfe, 0x23, 0x2d, 0x45, 0xae, 0x15, 0xaa, 0x12,
- 0xc9, 0x2e, 0xa9, 0xe6, 0x03, 0x28, 0x16, 0xa3, 0xdd, 0x21, 0xb9, 0xf6, 0x72, 0x77, 0xb3, 0xbb,
- 0xb4, 0xad, 0xa0, 0x17, 0x06, 0x7a, 0xd5, 0xab, 0xde, 0x16, 0x45, 0xd1, 0x8b, 0xde, 0x04, 0xe8,
- 0x03, 0x14, 0xc8, 0x5d, 0x9f, 0xa0, 0x40, 0xde, 0xa0, 0x68, 0x0b, 0xb4, 0x8f, 0xd0, 0xcb, 0x62,
- 0x66, 0x76, 0x97, 0xbb, 0x24, 0x15, 0x2b, 0x01, 0xe2, 0x5c, 0x91, 0xf3, 0x9b, 0xdf, 0x39, 0x73,
- 0xe6, 0xcc, 0x99, 0x33, 0x67, 0x66, 0x61, 0x7b, 0xe4, 0x38, 0x23, 0x8b, 0xee, 0xba, 0x9e, 0x13,
- 0x38, 0xa7, 0xd3, 0xe1, 0xae, 0x41, 0x7d, 0xdd, 0x33, 0xdd, 0xc0, 0xf1, 0xea, 0x1c, 0xc3, 0x6b,
- 0x82, 0x51, 0x8f, 0x18, 0xb5, 0x63, 0x58, 0x7f, 0x60, 0x5a, 0xb4, 0x15, 0x13, 0xfb, 0x34, 0xc0,
- 0xf7, 0x20, 0x37, 0x34, 0x2d, 0x2a, 0x4b, 0xdb, 0xd9, 0x9d, 0xf2, 0xad, 0x37, 0xeb, 0x73, 0x42,
- 0xf5, 0xb4, 0x44, 0x8f, 0xc1, 0x2a, 0x97, 0xa8, 0xfd, 0x2b, 0x07, 0x1b, 0x4b, 0x7a, 0x31, 0x86,
- 0x9c, 0x4d, 0x26, 0x4c, 0xa3, 0xb4, 0x53, 0x52, 0xf9, 0x7f, 0x2c, 0xc3, 0x8a, 0x4b, 0xf4, 0x47,
- 0x64, 0x44, 0xe5, 0x0c, 0x87, 0xa3, 0x26, 0x7e, 0x1d, 0xc0, 0xa0, 0x2e, 0xb5, 0x0d, 0x6a, 0xeb,
- 0x67, 0x72, 0x76, 0x3b, 0xbb, 0x53, 0x52, 0x13, 0x08, 0x7e, 0x07, 0xd6, 0xdd, 0xe9, 0xa9, 0x65,
- 0xea, 0x5a, 0x82, 0x06, 0xdb, 0xd9, 0x9d, 0xbc, 0x8a, 0x44, 0x47, 0x6b, 0x46, 0xbe, 0x0e, 0x6b,
- 0x4f, 0x28, 0x79, 0x94, 0xa4, 0x96, 0x39, 0xb5, 0xca, 0xe0, 0x04, 0xb1, 0x09, 0x95, 0x09, 0xf5,
- 0x7d, 0x32, 0xa2, 0x5a, 0x70, 0xe6, 0x52, 0x39, 0xc7, 0x67, 0xbf, 0xbd, 0x30, 0xfb, 0xf9, 0x99,
- 0x97, 0x43, 0xa9, 0xc1, 0x99, 0x4b, 0x71, 0x03, 0x4a, 0xd4, 0x9e, 0x4e, 0x84, 0x86, 0xfc, 0x39,
- 0xfe, 0x53, 0xec, 0xe9, 0x64, 0x5e, 0x4b, 0x91, 0x89, 0x85, 0x2a, 0x56, 0x7c, 0xea, 0x3d, 0x36,
- 0x75, 0x2a, 0x17, 0xb8, 0x82, 0xeb, 0x0b, 0x0a, 0xfa, 0xa2, 0x7f, 0x5e, 0x47, 0x24, 0x87, 0x9b,
- 0x50, 0xa2, 0x4f, 0x03, 0x6a, 0xfb, 0xa6, 0x63, 0xcb, 0x2b, 0x5c, 0xc9, 0x5b, 0x4b, 0x56, 0x91,
- 0x5a, 0xc6, 0xbc, 0x8a, 0x99, 0x1c, 0xbe, 0x0b, 0x2b, 0x8e, 0x1b, 0x98, 0x8e, 0xed, 0xcb, 0xc5,
- 0x6d, 0x69, 0xa7, 0x7c, 0xeb, 0xd5, 0xa5, 0x81, 0xd0, 0x15, 0x1c, 0x35, 0x22, 0xe3, 0x36, 0x20,
- 0xdf, 0x99, 0x7a, 0x3a, 0xd5, 0x74, 0xc7, 0xa0, 0x9a, 0x69, 0x0f, 0x1d, 0xb9, 0xc4, 0x15, 0x5c,
- 0x5d, 0x9c, 0x08, 0x27, 0x36, 0x1d, 0x83, 0xb6, 0xed, 0xa1, 0xa3, 0x56, 0xfd, 0x54, 0x1b, 0x5f,
- 0x82, 0x82, 0x7f, 0x66, 0x07, 0xe4, 0xa9, 0x5c, 0xe1, 0x11, 0x12, 0xb6, 0x6a, 0x5f, 0x17, 0x60,
- 0xed, 0x22, 0x21, 0x76, 0x1f, 0xf2, 0x43, 0x36, 0x4b, 0x39, 0xf3, 0x5d, 0x7c, 0x20, 0x64, 0xd2,
- 0x4e, 0x2c, 0x7c, 0x4f, 0x27, 0x36, 0xa0, 0x6c, 0x53, 0x3f, 0xa0, 0x86, 0x88, 0x88, 0xec, 0x05,
- 0x63, 0x0a, 0x84, 0xd0, 0x62, 0x48, 0xe5, 0xbe, 0x57, 0x48, 0x7d, 0x0a, 0x6b, 0xb1, 0x49, 0x9a,
- 0x47, 0xec, 0x51, 0x14, 0x9b, 0xbb, 0xcf, 0xb3, 0xa4, 0xae, 0x44, 0x72, 0x2a, 0x13, 0x53, 0xab,
- 0x34, 0xd5, 0xc6, 0x2d, 0x00, 0xc7, 0xa6, 0xce, 0x50, 0x33, 0xa8, 0x6e, 0xc9, 0xc5, 0x73, 0xbc,
- 0xd4, 0x65, 0x94, 0x05, 0x2f, 0x39, 0x02, 0xd5, 0x2d, 0xfc, 0xe1, 0x2c, 0xd4, 0x56, 0xce, 0x89,
- 0x94, 0x63, 0xb1, 0xc9, 0x16, 0xa2, 0xed, 0x04, 0xaa, 0x1e, 0x65, 0x71, 0x4f, 0x8d, 0x70, 0x66,
- 0x25, 0x6e, 0x44, 0xfd, 0xb9, 0x33, 0x53, 0x43, 0x31, 0x31, 0xb1, 0x55, 0x2f, 0xd9, 0xc4, 0x6f,
- 0x40, 0x0c, 0x68, 0x3c, 0xac, 0x80, 0x67, 0xa1, 0x4a, 0x04, 0x76, 0xc8, 0x84, 0x6e, 0x7d, 0x09,
- 0xd5, 0xb4, 0x7b, 0xf0, 0x26, 0xe4, 0xfd, 0x80, 0x78, 0x01, 0x8f, 0xc2, 0xbc, 0x2a, 0x1a, 0x18,
- 0x41, 0x96, 0xda, 0x06, 0xcf, 0x72, 0x79, 0x95, 0xfd, 0xc5, 0x3f, 0x9d, 0x4d, 0x38, 0xcb, 0x27,
- 0xfc, 0xf6, 0xe2, 0x8a, 0xa6, 0x34, 0xcf, 0xcf, 0x7b, 0xeb, 0x03, 0x58, 0x4d, 0x4d, 0xe0, 0xa2,
- 0x43, 0xd7, 0x7e, 0x05, 0x2f, 0x2f, 0x55, 0x8d, 0x3f, 0x85, 0xcd, 0xa9, 0x6d, 0xda, 0x01, 0xf5,
- 0x5c, 0x8f, 0xb2, 0x88, 0x15, 0x43, 0xc9, 0xff, 0x5e, 0x39, 0x27, 0xe6, 0x4e, 0x92, 0x6c, 0xa1,
- 0x45, 0xdd, 0x98, 0x2e, 0x82, 0x37, 0x4b, 0xc5, 0xff, 0xac, 0xa0, 0x67, 0xcf, 0x9e, 0x3d, 0xcb,
- 0xd4, 0x7e, 0x57, 0x80, 0xcd, 0x65, 0x7b, 0x66, 0xe9, 0xf6, 0xbd, 0x04, 0x05, 0x7b, 0x3a, 0x39,
- 0xa5, 0x1e, 0x77, 0x52, 0x5e, 0x0d, 0x5b, 0xb8, 0x01, 0x79, 0x8b, 0x9c, 0x52, 0x4b, 0xce, 0x6d,
- 0x4b, 0x3b, 0xd5, 0x5b, 0xef, 0x5c, 0x68, 0x57, 0xd6, 0x8f, 0x98, 0x88, 0x2a, 0x24, 0xf1, 0x47,
- 0x90, 0x0b, 0x53, 0x34, 0xd3, 0x70, 0xf3, 0x62, 0x1a, 0xd8, 0x5e, 0x52, 0xb9, 0x1c, 0x7e, 0x05,
- 0x4a, 0xec, 0x57, 0xc4, 0x46, 0x81, 0xdb, 0x5c, 0x64, 0x00, 0x8b, 0x0b, 0xbc, 0x05, 0x45, 0xbe,
- 0x4d, 0x0c, 0x1a, 0x1d, 0x6d, 0x71, 0x9b, 0x05, 0x96, 0x41, 0x87, 0x64, 0x6a, 0x05, 0xda, 0x63,
- 0x62, 0x4d, 0x29, 0x0f, 0xf8, 0x92, 0x5a, 0x09, 0xc1, 0x5f, 0x30, 0x0c, 0x5f, 0x85, 0xb2, 0xd8,
- 0x55, 0xa6, 0x6d, 0xd0, 0xa7, 0x3c, 0x7b, 0xe6, 0x55, 0xb1, 0xd1, 0xda, 0x0c, 0x61, 0xc3, 0x3f,
- 0xf4, 0x1d, 0x3b, 0x0a, 0x4d, 0x3e, 0x04, 0x03, 0xf8, 0xf0, 0x1f, 0xcc, 0x27, 0xee, 0xd7, 0x96,
- 0x4f, 0x6f, 0x3e, 0xa6, 0x6a, 0x7f, 0xc9, 0x40, 0x8e, 0xe7, 0x8b, 0x35, 0x28, 0x0f, 0x3e, 0xeb,
- 0x29, 0x5a, 0xab, 0x7b, 0xb2, 0x7f, 0xa4, 0x20, 0x09, 0x57, 0x01, 0x38, 0xf0, 0xe0, 0xa8, 0xdb,
- 0x18, 0xa0, 0x4c, 0xdc, 0x6e, 0x77, 0x06, 0x77, 0x6f, 0xa3, 0x6c, 0x2c, 0x70, 0x22, 0x80, 0x5c,
- 0x92, 0xf0, 0xfe, 0x2d, 0x94, 0xc7, 0x08, 0x2a, 0x42, 0x41, 0xfb, 0x53, 0xa5, 0x75, 0xf7, 0x36,
- 0x2a, 0xa4, 0x91, 0xf7, 0x6f, 0xa1, 0x15, 0xbc, 0x0a, 0x25, 0x8e, 0xec, 0x77, 0xbb, 0x47, 0xa8,
- 0x18, 0xeb, 0xec, 0x0f, 0xd4, 0x76, 0xe7, 0x00, 0x95, 0x62, 0x9d, 0x07, 0x6a, 0xf7, 0xa4, 0x87,
- 0x20, 0xd6, 0x70, 0xac, 0xf4, 0xfb, 0x8d, 0x03, 0x05, 0x95, 0x63, 0xc6, 0xfe, 0x67, 0x03, 0xa5,
- 0x8f, 0x2a, 0x29, 0xb3, 0xde, 0xbf, 0x85, 0x56, 0xe3, 0x21, 0x94, 0xce, 0xc9, 0x31, 0xaa, 0xe2,
- 0x75, 0x58, 0x15, 0x43, 0x44, 0x46, 0xac, 0xcd, 0x41, 0x77, 0x6f, 0x23, 0x34, 0x33, 0x44, 0x68,
- 0x59, 0x4f, 0x01, 0x77, 0x6f, 0x23, 0x5c, 0x6b, 0x42, 0x9e, 0x47, 0x17, 0xc6, 0x50, 0x3d, 0x6a,
- 0xec, 0x2b, 0x47, 0x5a, 0xb7, 0x37, 0x68, 0x77, 0x3b, 0x8d, 0x23, 0x24, 0xcd, 0x30, 0x55, 0xf9,
- 0xf9, 0x49, 0x5b, 0x55, 0x5a, 0x28, 0x93, 0xc4, 0x7a, 0x4a, 0x63, 0xa0, 0xb4, 0x50, 0xb6, 0xa6,
- 0xc3, 0xe6, 0xb2, 0x3c, 0xb9, 0x74, 0x67, 0x24, 0x96, 0x38, 0x73, 0xce, 0x12, 0x73, 0x5d, 0x0b,
- 0x4b, 0xfc, 0xcf, 0x0c, 0x6c, 0x2c, 0x39, 0x2b, 0x96, 0x0e, 0xf2, 0x13, 0xc8, 0x8b, 0x10, 0x15,
- 0xa7, 0xe7, 0x8d, 0xa5, 0x87, 0x0e, 0x0f, 0xd8, 0x85, 0x13, 0x94, 0xcb, 0x25, 0x2b, 0x88, 0xec,
- 0x39, 0x15, 0x04, 0x53, 0xb1, 0x90, 0xd3, 0x7f, 0xb9, 0x90, 0xd3, 0xc5, 0xb1, 0x77, 0xf7, 0x22,
- 0xc7, 0x1e, 0xc7, 0xbe, 0x5b, 0x6e, 0xcf, 0x2f, 0xc9, 0xed, 0xf7, 0x61, 0x7d, 0x41, 0xd1, 0x85,
- 0x73, 0xec, 0xaf, 0x25, 0x90, 0xcf, 0x73, 0xce, 0x73, 0x32, 0x5d, 0x26, 0x95, 0xe9, 0xee, 0xcf,
- 0x7b, 0xf0, 0xda, 0xf9, 0x8b, 0xb0, 0xb0, 0xd6, 0x5f, 0x49, 0x70, 0x69, 0x79, 0xa5, 0xb8, 0xd4,
- 0x86, 0x8f, 0xa0, 0x30, 0xa1, 0xc1, 0xd8, 0x89, 0xaa, 0xa5, 0xb7, 0x97, 0x9c, 0xc1, 0xac, 0x7b,
- 0x7e, 0xb1, 0x43, 0xa9, 0xe4, 0x21, 0x9e, 0x3d, 0xaf, 0xdc, 0x13, 0xd6, 0x2c, 0x58, 0xfa, 0x9b,
- 0x0c, 0xbc, 0xbc, 0x54, 0xf9, 0x52, 0x43, 0x5f, 0x03, 0x30, 0x6d, 0x77, 0x1a, 0x88, 0x8a, 0x48,
- 0x24, 0xd8, 0x12, 0x47, 0x78, 0xf2, 0x62, 0xc9, 0x73, 0x1a, 0xc4, 0xfd, 0x59, 0xde, 0x0f, 0x02,
- 0xe2, 0x84, 0x7b, 0x33, 0x43, 0x73, 0xdc, 0xd0, 0xd7, 0xcf, 0x99, 0xe9, 0x42, 0x60, 0xbe, 0x07,
- 0x48, 0xb7, 0x4c, 0x6a, 0x07, 0x9a, 0x1f, 0x78, 0x94, 0x4c, 0x4c, 0x7b, 0xc4, 0x4f, 0x90, 0xe2,
- 0x5e, 0x7e, 0x48, 0x2c, 0x9f, 0xaa, 0x6b, 0xa2, 0xbb, 0x1f, 0xf5, 0x32, 0x09, 0x1e, 0x40, 0x5e,
- 0x42, 0xa2, 0x90, 0x92, 0x10, 0xdd, 0xb1, 0x44, 0xed, 0xeb, 0x22, 0x94, 0x13, 0x75, 0x35, 0xbe,
- 0x06, 0x95, 0x87, 0xe4, 0x31, 0xd1, 0xa2, 0xbb, 0x92, 0xf0, 0x44, 0x99, 0x61, 0xbd, 0xf0, 0xbe,
- 0xf4, 0x1e, 0x6c, 0x72, 0x8a, 0x33, 0x0d, 0xa8, 0xa7, 0xe9, 0x16, 0xf1, 0x7d, 0xee, 0xb4, 0x22,
- 0xa7, 0x62, 0xd6, 0xd7, 0x65, 0x5d, 0xcd, 0xa8, 0x07, 0xdf, 0x81, 0x0d, 0x2e, 0x31, 0x99, 0x5a,
- 0x81, 0xe9, 0x5a, 0x54, 0x63, 0xb7, 0x37, 0x9f, 0x9f, 0x24, 0xb1, 0x65, 0xeb, 0x8c, 0x71, 0x1c,
- 0x12, 0x98, 0x45, 0x3e, 0x6e, 0xc1, 0x6b, 0x5c, 0x6c, 0x44, 0x6d, 0xea, 0x91, 0x80, 0x6a, 0xf4,
- 0x8b, 0x29, 0xb1, 0x7c, 0x8d, 0xd8, 0x86, 0x36, 0x26, 0xfe, 0x58, 0xde, 0x64, 0x0a, 0xf6, 0x33,
- 0xb2, 0xa4, 0x5e, 0x61, 0xc4, 0x83, 0x90, 0xa7, 0x70, 0x5a, 0xc3, 0x36, 0x3e, 0x26, 0xfe, 0x18,
- 0xef, 0xc1, 0x25, 0xae, 0xc5, 0x0f, 0x3c, 0xd3, 0x1e, 0x69, 0xfa, 0x98, 0xea, 0x8f, 0xb4, 0x69,
- 0x30, 0xbc, 0x27, 0xbf, 0x92, 0x1c, 0x9f, 0x5b, 0xd8, 0xe7, 0x9c, 0x26, 0xa3, 0x9c, 0x04, 0xc3,
- 0x7b, 0xb8, 0x0f, 0x15, 0xb6, 0x18, 0x13, 0xf3, 0x4b, 0xaa, 0x0d, 0x1d, 0x8f, 0x1f, 0x8d, 0xd5,
- 0x25, 0xa9, 0x29, 0xe1, 0xc1, 0x7a, 0x37, 0x14, 0x38, 0x76, 0x0c, 0xba, 0x97, 0xef, 0xf7, 0x14,
- 0xa5, 0xa5, 0x96, 0x23, 0x2d, 0x0f, 0x1c, 0x8f, 0x05, 0xd4, 0xc8, 0x89, 0x1d, 0x5c, 0x16, 0x01,
- 0x35, 0x72, 0x22, 0xf7, 0xde, 0x81, 0x0d, 0x5d, 0x17, 0x73, 0x36, 0x75, 0x2d, 0xbc, 0x63, 0xf9,
- 0x32, 0x4a, 0x39, 0x4b, 0xd7, 0x0f, 0x04, 0x21, 0x8c, 0x71, 0x1f, 0x7f, 0x08, 0x2f, 0xcf, 0x9c,
- 0x95, 0x14, 0x5c, 0x5f, 0x98, 0xe5, 0xbc, 0xe8, 0x1d, 0xd8, 0x70, 0xcf, 0x16, 0x05, 0x71, 0x6a,
- 0x44, 0xf7, 0x6c, 0x5e, 0xec, 0x03, 0xd8, 0x74, 0xc7, 0xee, 0xa2, 0xdc, 0xcd, 0xa4, 0x1c, 0x76,
- 0xc7, 0xee, 0xbc, 0xe0, 0x5b, 0xfc, 0xc2, 0xed, 0x51, 0x9d, 0x04, 0xd4, 0x90, 0x2f, 0x27, 0xe9,
- 0x89, 0x0e, 0xbc, 0x0b, 0x48, 0xd7, 0x35, 0x6a, 0x93, 0x53, 0x8b, 0x6a, 0xc4, 0xa3, 0x36, 0xf1,
- 0xe5, 0xab, 0x49, 0x72, 0x55, 0xd7, 0x15, 0xde, 0xdb, 0xe0, 0x9d, 0xf8, 0x26, 0xac, 0x3b, 0xa7,
- 0x0f, 0x75, 0x11, 0x92, 0x9a, 0xeb, 0xd1, 0xa1, 0xf9, 0x54, 0x7e, 0x93, 0xfb, 0x77, 0x8d, 0x75,
- 0xf0, 0x80, 0xec, 0x71, 0x18, 0xdf, 0x00, 0xa4, 0xfb, 0x63, 0xe2, 0xb9, 0x3c, 0x27, 0xfb, 0x2e,
- 0xd1, 0xa9, 0xfc, 0x96, 0xa0, 0x0a, 0xbc, 0x13, 0xc1, 0x6c, 0x4b, 0xf8, 0x4f, 0xcc, 0x61, 0x10,
- 0x69, 0xbc, 0x2e, 0xb6, 0x04, 0xc7, 0x42, 0x6d, 0x3b, 0x80, 0x98, 0x2b, 0x52, 0x03, 0xef, 0x70,
- 0x5a, 0xd5, 0x1d, 0xbb, 0xc9, 0x71, 0xdf, 0x80, 0x55, 0xc6, 0x9c, 0x0d, 0x7a, 0x43, 0x14, 0x64,
- 0xee, 0x38, 0x31, 0xe2, 0x0f, 0x56, 0x1b, 0xd7, 0xf6, 0xa0, 0x92, 0x8c, 0x4f, 0x5c, 0x02, 0x11,
- 0xa1, 0x48, 0x62, 0xc5, 0x4a, 0xb3, 0xdb, 0x62, 0x65, 0xc6, 0xe7, 0x0a, 0xca, 0xb0, 0x72, 0xe7,
- 0xa8, 0x3d, 0x50, 0x34, 0xf5, 0xa4, 0x33, 0x68, 0x1f, 0x2b, 0x28, 0x9b, 0xa8, 0xab, 0x0f, 0x73,
- 0xc5, 0xb7, 0xd1, 0xf5, 0xda, 0x37, 0x19, 0xa8, 0xa6, 0x2f, 0x4a, 0xf8, 0xff, 0xe1, 0x72, 0xf4,
- 0xaa, 0xe1, 0xd3, 0x40, 0x7b, 0x62, 0x7a, 0x7c, 0xe3, 0x4c, 0x88, 0x38, 0xc4, 0xe2, 0xa5, 0xdb,
- 0x0c, 0x59, 0x7d, 0x1a, 0x7c, 0x62, 0x7a, 0x6c, 0x5b, 0x4c, 0x48, 0x80, 0x8f, 0xe0, 0xaa, 0xed,
- 0x68, 0x7e, 0x40, 0x6c, 0x83, 0x78, 0x86, 0x36, 0x7b, 0x4f, 0xd2, 0x88, 0xae, 0x53, 0xdf, 0x77,
- 0xc4, 0x81, 0x15, 0x6b, 0x79, 0xd5, 0x76, 0xfa, 0x21, 0x79, 0x96, 0xc9, 0x1b, 0x21, 0x75, 0x2e,
- 0xcc, 0xb2, 0xe7, 0x85, 0xd9, 0x2b, 0x50, 0x9a, 0x10, 0x57, 0xa3, 0x76, 0xe0, 0x9d, 0xf1, 0xf2,
- 0xb8, 0xa8, 0x16, 0x27, 0xc4, 0x55, 0x58, 0xfb, 0x85, 0xdc, 0x52, 0x0e, 0x73, 0xc5, 0x22, 0x2a,
- 0x1d, 0xe6, 0x8a, 0x25, 0x04, 0xb5, 0x7f, 0x64, 0xa1, 0x92, 0x2c, 0x97, 0xd9, 0xed, 0x43, 0xe7,
- 0x27, 0x8b, 0xc4, 0x73, 0xcf, 0x1b, 0xdf, 0x5a, 0x5c, 0xd7, 0x9b, 0xec, 0xc8, 0xd9, 0x2b, 0x88,
- 0x22, 0x56, 0x15, 0x92, 0xec, 0xb8, 0x67, 0xd9, 0x86, 0x8a, 0xa2, 0xa1, 0xa8, 0x86, 0x2d, 0x7c,
- 0x00, 0x85, 0x87, 0x3e, 0xd7, 0x5d, 0xe0, 0xba, 0xdf, 0xfc, 0x76, 0xdd, 0x87, 0x7d, 0xae, 0xbc,
- 0x74, 0xd8, 0xd7, 0x3a, 0x5d, 0xf5, 0xb8, 0x71, 0xa4, 0x86, 0xe2, 0xf8, 0x0a, 0xe4, 0x2c, 0xf2,
- 0xe5, 0x59, 0xfa, 0x70, 0xe2, 0xd0, 0x45, 0x17, 0xe1, 0x0a, 0xe4, 0x9e, 0x50, 0xf2, 0x28, 0x7d,
- 0x24, 0x70, 0xe8, 0x07, 0xdc, 0x0c, 0xbb, 0x90, 0xe7, 0xfe, 0xc2, 0x00, 0xa1, 0xc7, 0xd0, 0x4b,
- 0xb8, 0x08, 0xb9, 0x66, 0x57, 0x65, 0x1b, 0x02, 0x41, 0x45, 0xa0, 0x5a, 0xaf, 0xad, 0x34, 0x15,
- 0x94, 0xa9, 0xdd, 0x81, 0x82, 0x70, 0x02, 0xdb, 0x2c, 0xb1, 0x1b, 0xd0, 0x4b, 0x61, 0x33, 0xd4,
- 0x21, 0x45, 0xbd, 0x27, 0xc7, 0xfb, 0x8a, 0x8a, 0x32, 0xe9, 0xa5, 0xce, 0xa1, 0x7c, 0xcd, 0x87,
- 0x4a, 0xb2, 0x5e, 0x7e, 0x31, 0x77, 0xe1, 0xbf, 0x4a, 0x50, 0x4e, 0xd4, 0xbf, 0xac, 0x70, 0x21,
- 0x96, 0xe5, 0x3c, 0xd1, 0x88, 0x65, 0x12, 0x3f, 0x0c, 0x0d, 0xe0, 0x50, 0x83, 0x21, 0x17, 0x5d,
- 0xba, 0x17, 0xb4, 0x45, 0xf2, 0xa8, 0x50, 0xfb, 0xa3, 0x04, 0x68, 0xbe, 0x00, 0x9d, 0x33, 0x53,
- 0xfa, 0x31, 0xcd, 0xac, 0xfd, 0x41, 0x82, 0x6a, 0xba, 0xea, 0x9c, 0x33, 0xef, 0xda, 0x8f, 0x6a,
- 0xde, 0xdf, 0x33, 0xb0, 0x9a, 0xaa, 0x35, 0x2f, 0x6a, 0xdd, 0x17, 0xb0, 0x6e, 0x1a, 0x74, 0xe2,
- 0x3a, 0x01, 0xb5, 0xf5, 0x33, 0xcd, 0xa2, 0x8f, 0xa9, 0x25, 0xd7, 0x78, 0xd2, 0xd8, 0xfd, 0xf6,
- 0x6a, 0xb6, 0xde, 0x9e, 0xc9, 0x1d, 0x31, 0xb1, 0xbd, 0x8d, 0x76, 0x4b, 0x39, 0xee, 0x75, 0x07,
- 0x4a, 0xa7, 0xf9, 0x99, 0x76, 0xd2, 0xf9, 0x59, 0xa7, 0xfb, 0x49, 0x47, 0x45, 0xe6, 0x1c, 0xed,
- 0x07, 0xdc, 0xf6, 0x3d, 0x40, 0xf3, 0x46, 0xe1, 0xcb, 0xb0, 0xcc, 0x2c, 0xf4, 0x12, 0xde, 0x80,
- 0xb5, 0x4e, 0x57, 0xeb, 0xb7, 0x5b, 0x8a, 0xa6, 0x3c, 0x78, 0xa0, 0x34, 0x07, 0x7d, 0xf1, 0x3e,
- 0x11, 0xb3, 0x07, 0xa9, 0x0d, 0x5e, 0xfb, 0x7d, 0x16, 0x36, 0x96, 0x58, 0x82, 0x1b, 0xe1, 0xcd,
- 0x42, 0x5c, 0x76, 0xde, 0xbd, 0x88, 0xf5, 0x75, 0x56, 0x10, 0xf4, 0x88, 0x17, 0x84, 0x17, 0x91,
- 0x1b, 0xc0, 0xbc, 0x64, 0x07, 0xe6, 0xd0, 0xa4, 0x5e, 0xf8, 0x9c, 0x23, 0xae, 0x1b, 0x6b, 0x33,
- 0x5c, 0xbc, 0xe8, 0xfc, 0x1f, 0x60, 0xd7, 0xf1, 0xcd, 0xc0, 0x7c, 0x4c, 0x35, 0xd3, 0x8e, 0xde,
- 0x7e, 0xd8, 0xf5, 0x23, 0xa7, 0xa2, 0xa8, 0xa7, 0x6d, 0x07, 0x31, 0xdb, 0xa6, 0x23, 0x32, 0xc7,
- 0x66, 0xc9, 0x3c, 0xab, 0xa2, 0xa8, 0x27, 0x66, 0x5f, 0x83, 0x8a, 0xe1, 0x4c, 0x59, 0x4d, 0x26,
- 0x78, 0xec, 0xec, 0x90, 0xd4, 0xb2, 0xc0, 0x62, 0x4a, 0x58, 0x6d, 0xcf, 0x1e, 0x9d, 0x2a, 0x6a,
- 0x59, 0x60, 0x82, 0x72, 0x1d, 0xd6, 0xc8, 0x68, 0xe4, 0x31, 0xe5, 0x91, 0x22, 0x71, 0x7f, 0xa8,
- 0xc6, 0x30, 0x27, 0x6e, 0x1d, 0x42, 0x31, 0xf2, 0x03, 0x3b, 0xaa, 0x99, 0x27, 0x34, 0x57, 0x5c,
- 0x8a, 0x33, 0x3b, 0x25, 0xb5, 0x68, 0x47, 0x9d, 0xd7, 0xa0, 0x62, 0xfa, 0xda, 0xec, 0x0d, 0x3d,
- 0xb3, 0x9d, 0xd9, 0x29, 0xaa, 0x65, 0xd3, 0x8f, 0xdf, 0x1f, 0x6b, 0x5f, 0x65, 0xa0, 0x9a, 0xfe,
- 0x06, 0x80, 0x5b, 0x50, 0xb4, 0x1c, 0x9d, 0xf0, 0xd0, 0x12, 0x1f, 0xa0, 0x76, 0x9e, 0xf3, 0xd9,
- 0xa0, 0x7e, 0x14, 0xf2, 0xd5, 0x58, 0x72, 0xeb, 0x6f, 0x12, 0x14, 0x23, 0x18, 0x5f, 0x82, 0x9c,
- 0x4b, 0x82, 0x31, 0x57, 0x97, 0xdf, 0xcf, 0x20, 0x49, 0xe5, 0x6d, 0x86, 0xfb, 0x2e, 0xb1, 0x79,
- 0x08, 0x84, 0x38, 0x6b, 0xb3, 0x75, 0xb5, 0x28, 0x31, 0xf8, 0xe5, 0xc4, 0x99, 0x4c, 0xa8, 0x1d,
- 0xf8, 0xd1, 0xba, 0x86, 0x78, 0x33, 0x84, 0xf1, 0x3b, 0xb0, 0x1e, 0x78, 0xc4, 0xb4, 0x52, 0xdc,
- 0x1c, 0xe7, 0xa2, 0xa8, 0x23, 0x26, 0xef, 0xc1, 0x95, 0x48, 0xaf, 0x41, 0x03, 0xa2, 0x8f, 0xa9,
- 0x31, 0x13, 0x2a, 0xf0, 0x47, 0x88, 0xcb, 0x21, 0xa1, 0x15, 0xf6, 0x47, 0xb2, 0xb5, 0x6f, 0x24,
- 0x58, 0x8f, 0xae, 0x53, 0x46, 0xec, 0xac, 0x63, 0x00, 0x62, 0xdb, 0x4e, 0x90, 0x74, 0xd7, 0x62,
- 0x28, 0x2f, 0xc8, 0xd5, 0x1b, 0xb1, 0x90, 0x9a, 0x50, 0xb0, 0x35, 0x01, 0x98, 0xf5, 0x9c, 0xeb,
- 0xb6, 0xab, 0x50, 0x0e, 0x3f, 0xf0, 0xf0, 0xaf, 0x84, 0xe2, 0x02, 0x0e, 0x02, 0x62, 0xf7, 0x2e,
- 0xbc, 0x09, 0xf9, 0x53, 0x3a, 0x32, 0xed, 0xf0, 0xd9, 0x56, 0x34, 0xa2, 0x67, 0x92, 0x5c, 0xfc,
- 0x4c, 0xb2, 0xff, 0x5b, 0x09, 0x36, 0x74, 0x67, 0x32, 0x6f, 0xef, 0x3e, 0x9a, 0x7b, 0x05, 0xf0,
- 0x3f, 0x96, 0x3e, 0xff, 0x68, 0x64, 0x06, 0xe3, 0xe9, 0x69, 0x5d, 0x77, 0x26, 0xbb, 0x23, 0xc7,
- 0x22, 0xf6, 0x68, 0xf6, 0x99, 0x93, 0xff, 0xd1, 0xdf, 0x1d, 0x51, 0xfb, 0xdd, 0x91, 0x93, 0xf8,
- 0xe8, 0x79, 0x7f, 0xf6, 0xf7, 0xbf, 0x92, 0xf4, 0xa7, 0x4c, 0xf6, 0xa0, 0xb7, 0xff, 0xe7, 0xcc,
- 0xd6, 0x81, 0x18, 0xae, 0x17, 0xb9, 0x47, 0xa5, 0x43, 0x8b, 0xea, 0x6c, 0xca, 0xff, 0x0b, 0x00,
- 0x00, 0xff, 0xff, 0x1a, 0x28, 0x25, 0x79, 0x42, 0x1d, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
deleted file mode 100644
index 8697a50d..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
+++ /dev/null
@@ -1,872 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// 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.
-
-// Author: kenton@google.com (Kenton Varda)
-// Based on original Protocol Buffers design by
-// Sanjay Ghemawat, Jeff Dean, and others.
-//
-// The messages in this file describe the definitions found in .proto files.
-// A valid .proto file can be translated directly to a FileDescriptorProto
-// without any other information (e.g. without reading its imports).
-
-
-syntax = "proto2";
-
-package google.protobuf;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "DescriptorProtos";
-option csharp_namespace = "Google.Protobuf.Reflection";
-option objc_class_prefix = "GPB";
-option cc_enable_arenas = true;
-
-// descriptor.proto must be optimized for speed because reflection-based
-// algorithms don't work during bootstrapping.
-option optimize_for = SPEED;
-
-// The protocol compiler can output a FileDescriptorSet containing the .proto
-// files it parses.
-message FileDescriptorSet {
- repeated FileDescriptorProto file = 1;
-}
-
-// Describes a complete .proto file.
-message FileDescriptorProto {
- optional string name = 1; // file name, relative to root of source tree
- optional string package = 2; // e.g. "foo", "foo.bar", etc.
-
- // Names of files imported by this file.
- repeated string dependency = 3;
- // Indexes of the public imported files in the dependency list above.
- repeated int32 public_dependency = 10;
- // Indexes of the weak imported files in the dependency list.
- // For Google-internal migration only. Do not use.
- repeated int32 weak_dependency = 11;
-
- // All top-level definitions in this file.
- repeated DescriptorProto message_type = 4;
- repeated EnumDescriptorProto enum_type = 5;
- repeated ServiceDescriptorProto service = 6;
- repeated FieldDescriptorProto extension = 7;
-
- optional FileOptions options = 8;
-
- // This field contains optional information about the original source code.
- // You may safely remove this entire field without harming runtime
- // functionality of the descriptors -- the information is needed only by
- // development tools.
- optional SourceCodeInfo source_code_info = 9;
-
- // The syntax of the proto file.
- // The supported values are "proto2" and "proto3".
- optional string syntax = 12;
-}
-
-// Describes a message type.
-message DescriptorProto {
- optional string name = 1;
-
- repeated FieldDescriptorProto field = 2;
- repeated FieldDescriptorProto extension = 6;
-
- repeated DescriptorProto nested_type = 3;
- repeated EnumDescriptorProto enum_type = 4;
-
- message ExtensionRange {
- optional int32 start = 1;
- optional int32 end = 2;
-
- optional ExtensionRangeOptions options = 3;
- }
- repeated ExtensionRange extension_range = 5;
-
- repeated OneofDescriptorProto oneof_decl = 8;
-
- optional MessageOptions options = 7;
-
- // Range of reserved tag numbers. Reserved tag numbers may not be used by
- // fields or extension ranges in the same message. Reserved ranges may
- // not overlap.
- message ReservedRange {
- optional int32 start = 1; // Inclusive.
- optional int32 end = 2; // Exclusive.
- }
- repeated ReservedRange reserved_range = 9;
- // Reserved field names, which may not be used by fields in the same message.
- // A given name may only be reserved once.
- repeated string reserved_name = 10;
-}
-
-message ExtensionRangeOptions {
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-// Describes a field within a message.
-message FieldDescriptorProto {
- enum Type {
- // 0 is reserved for errors.
- // Order is weird for historical reasons.
- TYPE_DOUBLE = 1;
- TYPE_FLOAT = 2;
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
- // negative values are likely.
- TYPE_INT64 = 3;
- TYPE_UINT64 = 4;
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
- // negative values are likely.
- TYPE_INT32 = 5;
- TYPE_FIXED64 = 6;
- TYPE_FIXED32 = 7;
- TYPE_BOOL = 8;
- TYPE_STRING = 9;
- // Tag-delimited aggregate.
- // Group type is deprecated and not supported in proto3. However, Proto3
- // implementations should still be able to parse the group wire format and
- // treat group fields as unknown fields.
- TYPE_GROUP = 10;
- TYPE_MESSAGE = 11; // Length-delimited aggregate.
-
- // New in version 2.
- TYPE_BYTES = 12;
- TYPE_UINT32 = 13;
- TYPE_ENUM = 14;
- TYPE_SFIXED32 = 15;
- TYPE_SFIXED64 = 16;
- TYPE_SINT32 = 17; // Uses ZigZag encoding.
- TYPE_SINT64 = 18; // Uses ZigZag encoding.
- };
-
- enum Label {
- // 0 is reserved for errors
- LABEL_OPTIONAL = 1;
- LABEL_REQUIRED = 2;
- LABEL_REPEATED = 3;
- };
-
- optional string name = 1;
- optional int32 number = 3;
- optional Label label = 4;
-
- // If type_name is set, this need not be set. If both this and type_name
- // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
- optional Type type = 5;
-
- // For message and enum types, this is the name of the type. If the name
- // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
- // rules are used to find the type (i.e. first the nested types within this
- // message are searched, then within the parent, on up to the root
- // namespace).
- optional string type_name = 6;
-
- // For extensions, this is the name of the type being extended. It is
- // resolved in the same manner as type_name.
- optional string extendee = 2;
-
- // For numeric types, contains the original text representation of the value.
- // For booleans, "true" or "false".
- // For strings, contains the default text contents (not escaped in any way).
- // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
- // TODO(kenton): Base-64 encode?
- optional string default_value = 7;
-
- // If set, gives the index of a oneof in the containing type's oneof_decl
- // list. This field is a member of that oneof.
- optional int32 oneof_index = 9;
-
- // JSON name of this field. The value is set by protocol compiler. If the
- // user has set a "json_name" option on this field, that option's value
- // will be used. Otherwise, it's deduced from the field's name by converting
- // it to camelCase.
- optional string json_name = 10;
-
- optional FieldOptions options = 8;
-}
-
-// Describes a oneof.
-message OneofDescriptorProto {
- optional string name = 1;
- optional OneofOptions options = 2;
-}
-
-// Describes an enum type.
-message EnumDescriptorProto {
- optional string name = 1;
-
- repeated EnumValueDescriptorProto value = 2;
-
- optional EnumOptions options = 3;
-
- // Range of reserved numeric values. Reserved values may not be used by
- // entries in the same enum. Reserved ranges may not overlap.
- //
- // Note that this is distinct from DescriptorProto.ReservedRange in that it
- // is inclusive such that it can appropriately represent the entire int32
- // domain.
- message EnumReservedRange {
- optional int32 start = 1; // Inclusive.
- optional int32 end = 2; // Inclusive.
- }
-
- // Range of reserved numeric values. Reserved numeric values may not be used
- // by enum values in the same enum declaration. Reserved ranges may not
- // overlap.
- repeated EnumReservedRange reserved_range = 4;
-
- // Reserved enum value names, which may not be reused. A given name may only
- // be reserved once.
- repeated string reserved_name = 5;
-}
-
-// Describes a value within an enum.
-message EnumValueDescriptorProto {
- optional string name = 1;
- optional int32 number = 2;
-
- optional EnumValueOptions options = 3;
-}
-
-// Describes a service.
-message ServiceDescriptorProto {
- optional string name = 1;
- repeated MethodDescriptorProto method = 2;
-
- optional ServiceOptions options = 3;
-}
-
-// Describes a method of a service.
-message MethodDescriptorProto {
- optional string name = 1;
-
- // Input and output type names. These are resolved in the same way as
- // FieldDescriptorProto.type_name, but must refer to a message type.
- optional string input_type = 2;
- optional string output_type = 3;
-
- optional MethodOptions options = 4;
-
- // Identifies if client streams multiple client messages
- optional bool client_streaming = 5 [default=false];
- // Identifies if server streams multiple server messages
- optional bool server_streaming = 6 [default=false];
-}
-
-
-// ===================================================================
-// Options
-
-// Each of the definitions above may have "options" attached. These are
-// just annotations which may cause code to be generated slightly differently
-// or may contain hints for code that manipulates protocol messages.
-//
-// Clients may define custom options as extensions of the *Options messages.
-// These extensions may not yet be known at parsing time, so the parser cannot
-// store the values in them. Instead it stores them in a field in the *Options
-// message called uninterpreted_option. This field must have the same name
-// across all *Options messages. We then use this field to populate the
-// extensions when we build a descriptor, at which point all protos have been
-// parsed and so all extensions are known.
-//
-// Extension numbers for custom options may be chosen as follows:
-// * For options which will only be used within a single application or
-// organization, or for experimental options, use field numbers 50000
-// through 99999. It is up to you to ensure that you do not use the
-// same number for multiple options.
-// * For options which will be published and used publicly by multiple
-// independent entities, e-mail protobuf-global-extension-registry@google.com
-// to reserve extension numbers. Simply provide your project name (e.g.
-// Objective-C plugin) and your project website (if available) -- there's no
-// need to explain how you intend to use them. Usually you only need one
-// extension number. You can declare multiple options with only one extension
-// number by putting them in a sub-message. See the Custom Options section of
-// the docs for examples:
-// https://developers.google.com/protocol-buffers/docs/proto#options
-// If this turns out to be popular, a web service will be set up
-// to automatically assign option numbers.
-
-
-message FileOptions {
-
- // Sets the Java package where classes generated from this .proto will be
- // placed. By default, the proto package is used, but this is often
- // inappropriate because proto packages do not normally start with backwards
- // domain names.
- optional string java_package = 1;
-
-
- // If set, all the classes from the .proto file are wrapped in a single
- // outer class with the given name. This applies to both Proto1
- // (equivalent to the old "--one_java_file" option) and Proto2 (where
- // a .proto always translates to a single class, but you may want to
- // explicitly choose the class name).
- optional string java_outer_classname = 8;
-
- // If set true, then the Java code generator will generate a separate .java
- // file for each top-level message, enum, and service defined in the .proto
- // file. Thus, these types will *not* be nested inside the outer class
- // named by java_outer_classname. However, the outer class will still be
- // generated to contain the file's getDescriptor() method as well as any
- // top-level extensions defined in the file.
- optional bool java_multiple_files = 10 [default=false];
-
- // This option does nothing.
- optional bool java_generate_equals_and_hash = 20 [deprecated=true];
-
- // If set true, then the Java2 code generator will generate code that
- // throws an exception whenever an attempt is made to assign a non-UTF-8
- // byte sequence to a string field.
- // Message reflection will do the same.
- // However, an extension field still accepts non-UTF-8 byte sequences.
- // This option has no effect on when used with the lite runtime.
- optional bool java_string_check_utf8 = 27 [default=false];
-
-
- // Generated classes can be optimized for speed or code size.
- enum OptimizeMode {
- SPEED = 1; // Generate complete code for parsing, serialization,
- // etc.
- CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
- LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
- }
- optional OptimizeMode optimize_for = 9 [default=SPEED];
-
- // Sets the Go package where structs generated from this .proto will be
- // placed. If omitted, the Go package will be derived from the following:
- // - The basename of the package import path, if provided.
- // - Otherwise, the package statement in the .proto file, if present.
- // - Otherwise, the basename of the .proto file, without extension.
- optional string go_package = 11;
-
-
-
- // Should generic services be generated in each language? "Generic" services
- // are not specific to any particular RPC system. They are generated by the
- // main code generators in each language (without additional plugins).
- // Generic services were the only kind of service generation supported by
- // early versions of google.protobuf.
- //
- // Generic services are now considered deprecated in favor of using plugins
- // that generate code specific to your particular RPC system. Therefore,
- // these default to false. Old code which depends on generic services should
- // explicitly set them to true.
- optional bool cc_generic_services = 16 [default=false];
- optional bool java_generic_services = 17 [default=false];
- optional bool py_generic_services = 18 [default=false];
- optional bool php_generic_services = 42 [default=false];
-
- // Is this file deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for everything in the file, or it will be completely ignored; in the very
- // least, this is a formalization for deprecating files.
- optional bool deprecated = 23 [default=false];
-
- // Enables the use of arenas for the proto messages in this file. This applies
- // only to generated classes for C++.
- optional bool cc_enable_arenas = 31 [default=false];
-
-
- // Sets the objective c class prefix which is prepended to all objective c
- // generated classes from this .proto. There is no default.
- optional string objc_class_prefix = 36;
-
- // Namespace for generated classes; defaults to the package.
- optional string csharp_namespace = 37;
-
- // By default Swift generators will take the proto package and CamelCase it
- // replacing '.' with underscore and use that to prefix the types/symbols
- // defined. When this options is provided, they will use this value instead
- // to prefix the types/symbols defined.
- optional string swift_prefix = 39;
-
- // Sets the php class prefix which is prepended to all php generated classes
- // from this .proto. Default is empty.
- optional string php_class_prefix = 40;
-
- // Use this option to change the namespace of php generated classes. Default
- // is empty. When this option is empty, the package name will be used for
- // determining the namespace.
- optional string php_namespace = 41;
-
- // The parser stores options it doesn't recognize here.
- // See the documentation for the "Options" section above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message.
- // See the documentation for the "Options" section above.
- extensions 1000 to max;
-
- reserved 38;
-}
-
-message MessageOptions {
- // Set true to use the old proto1 MessageSet wire format for extensions.
- // This is provided for backwards-compatibility with the MessageSet wire
- // format. You should not use this for any other reason: It's less
- // efficient, has fewer features, and is more complicated.
- //
- // The message must be defined exactly as follows:
- // message Foo {
- // option message_set_wire_format = true;
- // extensions 4 to max;
- // }
- // Note that the message cannot have any defined fields; MessageSets only
- // have extensions.
- //
- // All extensions of your type must be singular messages; e.g. they cannot
- // be int32s, enums, or repeated messages.
- //
- // Because this is an option, the above two restrictions are not enforced by
- // the protocol compiler.
- optional bool message_set_wire_format = 1 [default=false];
-
- // Disables the generation of the standard "descriptor()" accessor, which can
- // conflict with a field of the same name. This is meant to make migration
- // from proto1 easier; new code should avoid fields named "descriptor".
- optional bool no_standard_descriptor_accessor = 2 [default=false];
-
- // Is this message deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the message, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating messages.
- optional bool deprecated = 3 [default=false];
-
- // Whether the message is an automatically generated map entry type for the
- // maps field.
- //
- // For maps fields:
- // map map_field = 1;
- // The parsed descriptor looks like:
- // message MapFieldEntry {
- // option map_entry = true;
- // optional KeyType key = 1;
- // optional ValueType value = 2;
- // }
- // repeated MapFieldEntry map_field = 1;
- //
- // Implementations may choose not to generate the map_entry=true message, but
- // use a native map in the target language to hold the keys and values.
- // The reflection APIs in such implementions still need to work as
- // if the field is a repeated message field.
- //
- // NOTE: Do not set the option in .proto files. Always use the maps syntax
- // instead. The option should only be implicitly set by the proto compiler
- // parser.
- optional bool map_entry = 7;
-
- reserved 8; // javalite_serializable
- reserved 9; // javanano_as_lite
-
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-message FieldOptions {
- // The ctype option instructs the C++ code generator to use a different
- // representation of the field than it normally would. See the specific
- // options below. This option is not yet implemented in the open source
- // release -- sorry, we'll try to include it in a future version!
- optional CType ctype = 1 [default = STRING];
- enum CType {
- // Default mode.
- STRING = 0;
-
- CORD = 1;
-
- STRING_PIECE = 2;
- }
- // The packed option can be enabled for repeated primitive fields to enable
- // a more efficient representation on the wire. Rather than repeatedly
- // writing the tag and type for each element, the entire array is encoded as
- // a single length-delimited blob. In proto3, only explicit setting it to
- // false will avoid using packed encoding.
- optional bool packed = 2;
-
- // The jstype option determines the JavaScript type used for values of the
- // field. The option is permitted only for 64 bit integral and fixed types
- // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
- // is represented as JavaScript string, which avoids loss of precision that
- // can happen when a large value is converted to a floating point JavaScript.
- // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
- // use the JavaScript "number" type. The behavior of the default option
- // JS_NORMAL is implementation dependent.
- //
- // This option is an enum to permit additional types to be added, e.g.
- // goog.math.Integer.
- optional JSType jstype = 6 [default = JS_NORMAL];
- enum JSType {
- // Use the default type.
- JS_NORMAL = 0;
-
- // Use JavaScript strings.
- JS_STRING = 1;
-
- // Use JavaScript numbers.
- JS_NUMBER = 2;
- }
-
- // Should this field be parsed lazily? Lazy applies only to message-type
- // fields. It means that when the outer message is initially parsed, the
- // inner message's contents will not be parsed but instead stored in encoded
- // form. The inner message will actually be parsed when it is first accessed.
- //
- // This is only a hint. Implementations are free to choose whether to use
- // eager or lazy parsing regardless of the value of this option. However,
- // setting this option true suggests that the protocol author believes that
- // using lazy parsing on this field is worth the additional bookkeeping
- // overhead typically needed to implement it.
- //
- // This option does not affect the public interface of any generated code;
- // all method signatures remain the same. Furthermore, thread-safety of the
- // interface is not affected by this option; const methods remain safe to
- // call from multiple threads concurrently, while non-const methods continue
- // to require exclusive access.
- //
- //
- // Note that implementations may choose not to check required fields within
- // a lazy sub-message. That is, calling IsInitialized() on the outer message
- // may return true even if the inner message has missing required fields.
- // This is necessary because otherwise the inner message would have to be
- // parsed in order to perform the check, defeating the purpose of lazy
- // parsing. An implementation which chooses not to check required fields
- // must be consistent about it. That is, for any particular sub-message, the
- // implementation must either *always* check its required fields, or *never*
- // check its required fields, regardless of whether or not the message has
- // been parsed.
- optional bool lazy = 5 [default=false];
-
- // Is this field deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for accessors, or it will be completely ignored; in the very least, this
- // is a formalization for deprecating fields.
- optional bool deprecated = 3 [default=false];
-
- // For Google-internal migration only. Do not use.
- optional bool weak = 10 [default=false];
-
-
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-
- reserved 4; // removed jtype
-}
-
-message OneofOptions {
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-message EnumOptions {
-
- // Set this option to true to allow mapping different tag names to the same
- // value.
- optional bool allow_alias = 2;
-
- // Is this enum deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the enum, or it will be completely ignored; in the very least, this
- // is a formalization for deprecating enums.
- optional bool deprecated = 3 [default=false];
-
- reserved 5; // javanano_as_lite
-
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-message EnumValueOptions {
- // Is this enum value deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the enum value, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating enum values.
- optional bool deprecated = 1 [default=false];
-
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-message ServiceOptions {
-
- // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
- // framework. We apologize for hoarding these numbers to ourselves, but
- // we were already using them long before we decided to release Protocol
- // Buffers.
-
- // Is this service deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the service, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating services.
- optional bool deprecated = 33 [default=false];
-
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-message MethodOptions {
-
- // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
- // framework. We apologize for hoarding these numbers to ourselves, but
- // we were already using them long before we decided to release Protocol
- // Buffers.
-
- // Is this method deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the method, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating methods.
- optional bool deprecated = 33 [default=false];
-
- // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
- // or neither? HTTP based RPC implementation may choose GET verb for safe
- // methods, and PUT verb for idempotent methods instead of the default POST.
- enum IdempotencyLevel {
- IDEMPOTENCY_UNKNOWN = 0;
- NO_SIDE_EFFECTS = 1; // implies idempotent
- IDEMPOTENT = 2; // idempotent, but may have side effects
- }
- optional IdempotencyLevel idempotency_level =
- 34 [default=IDEMPOTENCY_UNKNOWN];
-
- // The parser stores options it doesn't recognize here. See above.
- repeated UninterpretedOption uninterpreted_option = 999;
-
- // Clients can define custom options in extensions of this message. See above.
- extensions 1000 to max;
-}
-
-
-// A message representing a option the parser does not recognize. This only
-// appears in options protos created by the compiler::Parser class.
-// DescriptorPool resolves these when building Descriptor objects. Therefore,
-// options protos in descriptor objects (e.g. returned by Descriptor::options(),
-// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
-// in them.
-message UninterpretedOption {
- // The name of the uninterpreted option. Each string represents a segment in
- // a dot-separated name. is_extension is true iff a segment represents an
- // extension (denoted with parentheses in options specs in .proto files).
- // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
- // "foo.(bar.baz).qux".
- message NamePart {
- required string name_part = 1;
- required bool is_extension = 2;
- }
- repeated NamePart name = 2;
-
- // The value of the uninterpreted option, in whatever type the tokenizer
- // identified it as during parsing. Exactly one of these should be set.
- optional string identifier_value = 3;
- optional uint64 positive_int_value = 4;
- optional int64 negative_int_value = 5;
- optional double double_value = 6;
- optional bytes string_value = 7;
- optional string aggregate_value = 8;
-}
-
-// ===================================================================
-// Optional source code info
-
-// Encapsulates information about the original source file from which a
-// FileDescriptorProto was generated.
-message SourceCodeInfo {
- // A Location identifies a piece of source code in a .proto file which
- // corresponds to a particular definition. This information is intended
- // to be useful to IDEs, code indexers, documentation generators, and similar
- // tools.
- //
- // For example, say we have a file like:
- // message Foo {
- // optional string foo = 1;
- // }
- // Let's look at just the field definition:
- // optional string foo = 1;
- // ^ ^^ ^^ ^ ^^^
- // a bc de f ghi
- // We have the following locations:
- // span path represents
- // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
- // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
- // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
- // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
- // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
- //
- // Notes:
- // - A location may refer to a repeated field itself (i.e. not to any
- // particular index within it). This is used whenever a set of elements are
- // logically enclosed in a single code segment. For example, an entire
- // extend block (possibly containing multiple extension definitions) will
- // have an outer location whose path refers to the "extensions" repeated
- // field without an index.
- // - Multiple locations may have the same path. This happens when a single
- // logical declaration is spread out across multiple places. The most
- // obvious example is the "extend" block again -- there may be multiple
- // extend blocks in the same scope, each of which will have the same path.
- // - A location's span is not always a subset of its parent's span. For
- // example, the "extendee" of an extension declaration appears at the
- // beginning of the "extend" block and is shared by all extensions within
- // the block.
- // - Just because a location's span is a subset of some other location's span
- // does not mean that it is a descendent. For example, a "group" defines
- // both a type and a field in a single declaration. Thus, the locations
- // corresponding to the type and field and their components will overlap.
- // - Code which tries to interpret locations should probably be designed to
- // ignore those that it doesn't understand, as more types of locations could
- // be recorded in the future.
- repeated Location location = 1;
- message Location {
- // Identifies which part of the FileDescriptorProto was defined at this
- // location.
- //
- // Each element is a field number or an index. They form a path from
- // the root FileDescriptorProto to the place where the definition. For
- // example, this path:
- // [ 4, 3, 2, 7, 1 ]
- // refers to:
- // file.message_type(3) // 4, 3
- // .field(7) // 2, 7
- // .name() // 1
- // This is because FileDescriptorProto.message_type has field number 4:
- // repeated DescriptorProto message_type = 4;
- // and DescriptorProto.field has field number 2:
- // repeated FieldDescriptorProto field = 2;
- // and FieldDescriptorProto.name has field number 1:
- // optional string name = 1;
- //
- // Thus, the above path gives the location of a field name. If we removed
- // the last element:
- // [ 4, 3, 2, 7 ]
- // this path refers to the whole field declaration (from the beginning
- // of the label to the terminating semicolon).
- repeated int32 path = 1 [packed=true];
-
- // Always has exactly three or four elements: start line, start column,
- // end line (optional, otherwise assumed same as start line), end column.
- // These are packed into a single field for efficiency. Note that line
- // and column numbers are zero-based -- typically you will want to add
- // 1 to each before displaying to a user.
- repeated int32 span = 2 [packed=true];
-
- // If this SourceCodeInfo represents a complete declaration, these are any
- // comments appearing before and after the declaration which appear to be
- // attached to the declaration.
- //
- // A series of line comments appearing on consecutive lines, with no other
- // tokens appearing on those lines, will be treated as a single comment.
- //
- // leading_detached_comments will keep paragraphs of comments that appear
- // before (but not connected to) the current element. Each paragraph,
- // separated by empty lines, will be one comment element in the repeated
- // field.
- //
- // Only the comment content is provided; comment markers (e.g. //) are
- // stripped out. For block comments, leading whitespace and an asterisk
- // will be stripped from the beginning of each line other than the first.
- // Newlines are included in the output.
- //
- // Examples:
- //
- // optional int32 foo = 1; // Comment attached to foo.
- // // Comment attached to bar.
- // optional int32 bar = 2;
- //
- // optional string baz = 3;
- // // Comment attached to baz.
- // // Another line attached to baz.
- //
- // // Comment attached to qux.
- // //
- // // Another line attached to qux.
- // optional double qux = 4;
- //
- // // Detached comment for corge. This is not leading or trailing comments
- // // to qux or corge because there are blank lines separating it from
- // // both.
- //
- // // Detached comment for corge paragraph 2.
- //
- // optional string corge = 5;
- // /* Block comment attached
- // * to corge. Leading asterisks
- // * will be removed. */
- // /* Block comment attached to
- // * grault. */
- // optional int32 grault = 6;
- //
- // // ignored detached comments.
- optional string leading_comments = 3;
- optional string trailing_comments = 4;
- repeated string leading_detached_comments = 6;
- }
-}
-
-// Describes the relationship between generated code and its original source
-// file. A GeneratedCodeInfo message is associated with only one generated
-// source file, but may contain references to different source .proto files.
-message GeneratedCodeInfo {
- // An Annotation connects some span of text in generated code to an element
- // of its generating .proto file.
- repeated Annotation annotation = 1;
- message Annotation {
- // Identifies the element in the original source .proto file. This field
- // is formatted the same as SourceCodeInfo.Location.path.
- repeated int32 path = 1 [packed=true];
-
- // Identifies the filesystem path to the original source .proto.
- optional string source_file = 2;
-
- // Identifies the starting offset in bytes in the generated code
- // that relates to the identified object.
- optional int32 begin = 3;
-
- // Identifies the ending offset in bytes in the generated code that
- // relates to the identified offset. The end offset should be one past
- // the last relevant byte (so the length of the text = end - begin).
- optional int32 end = 4;
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go b/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go
deleted file mode 100644
index 0d6055d6..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
- A plugin for the Google protocol buffer compiler to generate Go code.
- Run it by building this program and putting it in your path with the name
- protoc-gen-go
- That word 'go' at the end becomes part of the option string set for the
- protocol compiler, so once the protocol compiler (protoc) is installed
- you can run
- protoc --go_out=output_directory input_directory/file.proto
- to generate Go bindings for the protocol defined by file.proto.
- With that input, the output will be written to
- output_directory/file.pb.go
-
- The generated code is documented in the package comment for
- the library.
-
- See the README and documentation for protocol buffers to learn more:
- https://developers.google.com/protocol-buffers/
-
-*/
-package documentation
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
deleted file mode 100644
index e0aba85f..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
+++ /dev/null
@@ -1,2928 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
- The code generator for the plugin for the Google protocol buffer compiler.
- It generates Go code from the protocol buffer description files read by the
- main routine.
-*/
-package generator
-
-import (
- "bufio"
- "bytes"
- "compress/gzip"
- "crypto/sha256"
- "encoding/hex"
- "fmt"
- "go/build"
- "go/parser"
- "go/printer"
- "go/token"
- "log"
- "os"
- "path"
- "sort"
- "strconv"
- "strings"
- "unicode"
- "unicode/utf8"
-
- "github.com/golang/protobuf/proto"
- "github.com/golang/protobuf/protoc-gen-go/generator/internal/remap"
-
- "github.com/golang/protobuf/protoc-gen-go/descriptor"
- plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
-)
-
-// generatedCodeVersion indicates a version of the generated code.
-// It is incremented whenever an incompatibility between the generated code and
-// proto package is introduced; the generated code references
-// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).
-const generatedCodeVersion = 2
-
-// A Plugin provides functionality to add to the output during Go code generation,
-// such as to produce RPC stubs.
-type Plugin interface {
- // Name identifies the plugin.
- Name() string
- // Init is called once after data structures are built but before
- // code generation begins.
- Init(g *Generator)
- // Generate produces the code generated by the plugin for this file,
- // except for the imports, by calling the generator's methods P, In, and Out.
- Generate(file *FileDescriptor)
- // GenerateImports produces the import declarations for this file.
- // It is called after Generate.
- GenerateImports(file *FileDescriptor)
-}
-
-var plugins []Plugin
-
-// RegisterPlugin installs a (second-order) plugin to be run when the Go output is generated.
-// It is typically called during initialization.
-func RegisterPlugin(p Plugin) {
- plugins = append(plugins, p)
-}
-
-// A GoImportPath is the import path of a Go package. e.g., "google.golang.org/genproto/protobuf".
-type GoImportPath string
-
-func (p GoImportPath) String() string { return strconv.Quote(string(p)) }
-
-// A GoPackageName is the name of a Go package. e.g., "protobuf".
-type GoPackageName string
-
-// Each type we import as a protocol buffer (other than FileDescriptorProto) needs
-// a pointer to the FileDescriptorProto that represents it. These types achieve that
-// wrapping by placing each Proto inside a struct with the pointer to its File. The
-// structs have the same names as their contents, with "Proto" removed.
-// FileDescriptor is used to store the things that it points to.
-
-// The file and package name method are common to messages and enums.
-type common struct {
- file *FileDescriptor // File this object comes from.
-}
-
-// GoImportPath is the import path of the Go package containing the type.
-func (c *common) GoImportPath() GoImportPath {
- return c.file.importPath
-}
-
-func (c *common) File() *FileDescriptor { return c.file }
-
-func fileIsProto3(file *descriptor.FileDescriptorProto) bool {
- return file.GetSyntax() == "proto3"
-}
-
-func (c *common) proto3() bool { return fileIsProto3(c.file.FileDescriptorProto) }
-
-// Descriptor represents a protocol buffer message.
-type Descriptor struct {
- common
- *descriptor.DescriptorProto
- parent *Descriptor // The containing message, if any.
- nested []*Descriptor // Inner messages, if any.
- enums []*EnumDescriptor // Inner enums, if any.
- ext []*ExtensionDescriptor // Extensions, if any.
- typename []string // Cached typename vector.
- index int // The index into the container, whether the file or another message.
- path string // The SourceCodeInfo path as comma-separated integers.
- group bool
-}
-
-// TypeName returns the elements of the dotted type name.
-// The package name is not part of this name.
-func (d *Descriptor) TypeName() []string {
- if d.typename != nil {
- return d.typename
- }
- n := 0
- for parent := d; parent != nil; parent = parent.parent {
- n++
- }
- s := make([]string, n)
- for parent := d; parent != nil; parent = parent.parent {
- n--
- s[n] = parent.GetName()
- }
- d.typename = s
- return s
-}
-
-// EnumDescriptor describes an enum. If it's at top level, its parent will be nil.
-// Otherwise it will be the descriptor of the message in which it is defined.
-type EnumDescriptor struct {
- common
- *descriptor.EnumDescriptorProto
- parent *Descriptor // The containing message, if any.
- typename []string // Cached typename vector.
- index int // The index into the container, whether the file or a message.
- path string // The SourceCodeInfo path as comma-separated integers.
-}
-
-// TypeName returns the elements of the dotted type name.
-// The package name is not part of this name.
-func (e *EnumDescriptor) TypeName() (s []string) {
- if e.typename != nil {
- return e.typename
- }
- name := e.GetName()
- if e.parent == nil {
- s = make([]string, 1)
- } else {
- pname := e.parent.TypeName()
- s = make([]string, len(pname)+1)
- copy(s, pname)
- }
- s[len(s)-1] = name
- e.typename = s
- return s
-}
-
-// Everything but the last element of the full type name, CamelCased.
-// The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... .
-func (e *EnumDescriptor) prefix() string {
- if e.parent == nil {
- // If the enum is not part of a message, the prefix is just the type name.
- return CamelCase(*e.Name) + "_"
- }
- typeName := e.TypeName()
- return CamelCaseSlice(typeName[0:len(typeName)-1]) + "_"
-}
-
-// The integer value of the named constant in this enumerated type.
-func (e *EnumDescriptor) integerValueAsString(name string) string {
- for _, c := range e.Value {
- if c.GetName() == name {
- return fmt.Sprint(c.GetNumber())
- }
- }
- log.Fatal("cannot find value for enum constant")
- return ""
-}
-
-// ExtensionDescriptor describes an extension. If it's at top level, its parent will be nil.
-// Otherwise it will be the descriptor of the message in which it is defined.
-type ExtensionDescriptor struct {
- common
- *descriptor.FieldDescriptorProto
- parent *Descriptor // The containing message, if any.
-}
-
-// TypeName returns the elements of the dotted type name.
-// The package name is not part of this name.
-func (e *ExtensionDescriptor) TypeName() (s []string) {
- name := e.GetName()
- if e.parent == nil {
- // top-level extension
- s = make([]string, 1)
- } else {
- pname := e.parent.TypeName()
- s = make([]string, len(pname)+1)
- copy(s, pname)
- }
- s[len(s)-1] = name
- return s
-}
-
-// DescName returns the variable name used for the generated descriptor.
-func (e *ExtensionDescriptor) DescName() string {
- // The full type name.
- typeName := e.TypeName()
- // Each scope of the extension is individually CamelCased, and all are joined with "_" with an "E_" prefix.
- for i, s := range typeName {
- typeName[i] = CamelCase(s)
- }
- return "E_" + strings.Join(typeName, "_")
-}
-
-// ImportedDescriptor describes a type that has been publicly imported from another file.
-type ImportedDescriptor struct {
- common
- o Object
-}
-
-func (id *ImportedDescriptor) TypeName() []string { return id.o.TypeName() }
-
-// FileDescriptor describes an protocol buffer descriptor file (.proto).
-// It includes slices of all the messages and enums defined within it.
-// Those slices are constructed by WrapTypes.
-type FileDescriptor struct {
- *descriptor.FileDescriptorProto
- desc []*Descriptor // All the messages defined in this file.
- enum []*EnumDescriptor // All the enums defined in this file.
- ext []*ExtensionDescriptor // All the top-level extensions defined in this file.
- imp []*ImportedDescriptor // All types defined in files publicly imported by this file.
-
- // Comments, stored as a map of path (comma-separated integers) to the comment.
- comments map[string]*descriptor.SourceCodeInfo_Location
-
- // The full list of symbols that are exported,
- // as a map from the exported object to its symbols.
- // This is used for supporting public imports.
- exported map[Object][]symbol
-
- fingerprint string // Fingerprint of this file's contents.
- importPath GoImportPath // Import path of this file's package.
- packageName GoPackageName // Name of this file's Go package.
-
- proto3 bool // whether to generate proto3 code for this file
-}
-
-// VarName is the variable name we'll use in the generated code to refer
-// to the compressed bytes of this descriptor. It is not exported, so
-// it is only valid inside the generated package.
-func (d *FileDescriptor) VarName() string {
- name := strings.Map(badToUnderscore, baseName(d.GetName()))
- return fmt.Sprintf("fileDescriptor_%s_%s", name, d.fingerprint)
-}
-
-// goPackageOption interprets the file's go_package option.
-// If there is no go_package, it returns ("", "", false).
-// If there's a simple name, it returns ("", pkg, true).
-// If the option implies an import path, it returns (impPath, pkg, true).
-func (d *FileDescriptor) goPackageOption() (impPath GoImportPath, pkg GoPackageName, ok bool) {
- opt := d.GetOptions().GetGoPackage()
- if opt == "" {
- return "", "", false
- }
- // A semicolon-delimited suffix delimits the import path and package name.
- sc := strings.Index(opt, ";")
- if sc >= 0 {
- return GoImportPath(opt[:sc]), cleanPackageName(opt[sc+1:]), true
- }
- // The presence of a slash implies there's an import path.
- slash := strings.LastIndex(opt, "/")
- if slash >= 0 {
- return GoImportPath(opt), cleanPackageName(opt[slash+1:]), true
- }
- return "", cleanPackageName(opt), true
-}
-
-// goFileName returns the output name for the generated Go file.
-func (d *FileDescriptor) goFileName(pathType pathType) string {
- name := *d.Name
- if ext := path.Ext(name); ext == ".proto" || ext == ".protodevel" {
- name = name[:len(name)-len(ext)]
- }
- name += ".pb.go"
-
- if pathType == pathTypeSourceRelative {
- return name
- }
-
- // Does the file have a "go_package" option?
- // If it does, it may override the filename.
- if impPath, _, ok := d.goPackageOption(); ok && impPath != "" {
- // Replace the existing dirname with the declared import path.
- _, name = path.Split(name)
- name = path.Join(string(impPath), name)
- return name
- }
-
- return name
-}
-
-func (d *FileDescriptor) addExport(obj Object, sym symbol) {
- d.exported[obj] = append(d.exported[obj], sym)
-}
-
-// symbol is an interface representing an exported Go symbol.
-type symbol interface {
- // GenerateAlias should generate an appropriate alias
- // for the symbol from the named package.
- GenerateAlias(g *Generator, pkg GoPackageName)
-}
-
-type messageSymbol struct {
- sym string
- hasExtensions, isMessageSet bool
- oneofTypes []string
-}
-
-type getterSymbol struct {
- name string
- typ string
- typeName string // canonical name in proto world; empty for proto.Message and similar
- genType bool // whether typ contains a generated type (message/group/enum)
-}
-
-func (ms *messageSymbol) GenerateAlias(g *Generator, pkg GoPackageName) {
- g.P("type ", ms.sym, " = ", pkg, ".", ms.sym)
- for _, name := range ms.oneofTypes {
- g.P("type ", name, " = ", pkg, ".", name)
- }
-}
-
-type enumSymbol struct {
- name string
- proto3 bool // Whether this came from a proto3 file.
-}
-
-func (es enumSymbol) GenerateAlias(g *Generator, pkg GoPackageName) {
- s := es.name
- g.P("type ", s, " = ", pkg, ".", s)
- g.P("var ", s, "_name = ", pkg, ".", s, "_name")
- g.P("var ", s, "_value = ", pkg, ".", s, "_value")
-}
-
-type constOrVarSymbol struct {
- sym string
- typ string // either "const" or "var"
- cast string // if non-empty, a type cast is required (used for enums)
-}
-
-func (cs constOrVarSymbol) GenerateAlias(g *Generator, pkg GoPackageName) {
- v := string(pkg) + "." + cs.sym
- if cs.cast != "" {
- v = cs.cast + "(" + v + ")"
- }
- g.P(cs.typ, " ", cs.sym, " = ", v)
-}
-
-// Object is an interface abstracting the abilities shared by enums, messages, extensions and imported objects.
-type Object interface {
- GoImportPath() GoImportPath
- TypeName() []string
- File() *FileDescriptor
-}
-
-// Generator is the type whose methods generate the output, stored in the associated response structure.
-type Generator struct {
- *bytes.Buffer
-
- Request *plugin.CodeGeneratorRequest // The input.
- Response *plugin.CodeGeneratorResponse // The output.
-
- Param map[string]string // Command-line parameters.
- PackageImportPath string // Go import path of the package we're generating code for
- ImportPrefix string // String to prefix to imported package file names.
- ImportMap map[string]string // Mapping from .proto file name to import path
-
- Pkg map[string]string // The names under which we import support packages
-
- outputImportPath GoImportPath // Package we're generating code for.
- allFiles []*FileDescriptor // All files in the tree
- allFilesByName map[string]*FileDescriptor // All files by filename.
- genFiles []*FileDescriptor // Those files we will generate output for.
- file *FileDescriptor // The file we are compiling now.
- packageNames map[GoImportPath]GoPackageName // Imported package names in the current file.
- usedPackages map[GoImportPath]bool // Packages used in current file.
- usedPackageNames map[GoPackageName]bool // Package names used in the current file.
- typeNameToObject map[string]Object // Key is a fully-qualified name in input syntax.
- init []string // Lines to emit in the init function.
- indent string
- pathType pathType // How to generate output filenames.
- writeOutput bool
- annotateCode bool // whether to store annotations
- annotations []*descriptor.GeneratedCodeInfo_Annotation // annotations to store
-}
-
-type pathType int
-
-const (
- pathTypeImport pathType = iota
- pathTypeSourceRelative
-)
-
-// New creates a new generator and allocates the request and response protobufs.
-func New() *Generator {
- g := new(Generator)
- g.Buffer = new(bytes.Buffer)
- g.Request = new(plugin.CodeGeneratorRequest)
- g.Response = new(plugin.CodeGeneratorResponse)
- return g
-}
-
-// Error reports a problem, including an error, and exits the program.
-func (g *Generator) Error(err error, msgs ...string) {
- s := strings.Join(msgs, " ") + ":" + err.Error()
- log.Print("protoc-gen-go: error:", s)
- os.Exit(1)
-}
-
-// Fail reports a problem and exits the program.
-func (g *Generator) Fail(msgs ...string) {
- s := strings.Join(msgs, " ")
- log.Print("protoc-gen-go: error:", s)
- os.Exit(1)
-}
-
-// CommandLineParameters breaks the comma-separated list of key=value pairs
-// in the parameter (a member of the request protobuf) into a key/value map.
-// It then sets file name mappings defined by those entries.
-func (g *Generator) CommandLineParameters(parameter string) {
- g.Param = make(map[string]string)
- for _, p := range strings.Split(parameter, ",") {
- if i := strings.Index(p, "="); i < 0 {
- g.Param[p] = ""
- } else {
- g.Param[p[0:i]] = p[i+1:]
- }
- }
-
- g.ImportMap = make(map[string]string)
- pluginList := "none" // Default list of plugin names to enable (empty means all).
- for k, v := range g.Param {
- switch k {
- case "import_prefix":
- g.ImportPrefix = v
- case "import_path":
- g.PackageImportPath = v
- case "paths":
- switch v {
- case "import":
- g.pathType = pathTypeImport
- case "source_relative":
- g.pathType = pathTypeSourceRelative
- default:
- g.Fail(fmt.Sprintf(`Unknown path type %q: want "import" or "source_relative".`, v))
- }
- case "plugins":
- pluginList = v
- case "annotate_code":
- if v == "true" {
- g.annotateCode = true
- }
- default:
- if len(k) > 0 && k[0] == 'M' {
- g.ImportMap[k[1:]] = v
- }
- }
- }
- if pluginList != "" {
- // Amend the set of plugins.
- enabled := make(map[string]bool)
- for _, name := range strings.Split(pluginList, "+") {
- enabled[name] = true
- }
- var nplugins []Plugin
- for _, p := range plugins {
- if enabled[p.Name()] {
- nplugins = append(nplugins, p)
- }
- }
- plugins = nplugins
- }
-}
-
-// DefaultPackageName returns the package name printed for the object.
-// If its file is in a different package, it returns the package name we're using for this file, plus ".".
-// Otherwise it returns the empty string.
-func (g *Generator) DefaultPackageName(obj Object) string {
- importPath := obj.GoImportPath()
- if importPath == g.outputImportPath {
- return ""
- }
- return string(g.GoPackageName(importPath)) + "."
-}
-
-// GoPackageName returns the name used for a package.
-func (g *Generator) GoPackageName(importPath GoImportPath) GoPackageName {
- if name, ok := g.packageNames[importPath]; ok {
- return name
- }
- name := cleanPackageName(baseName(string(importPath)))
- for i, orig := 1, name; g.usedPackageNames[name]; i++ {
- name = orig + GoPackageName(strconv.Itoa(i))
- }
- g.packageNames[importPath] = name
- g.usedPackageNames[name] = true
- return name
-}
-
-var globalPackageNames = map[GoPackageName]bool{
- "fmt": true,
- "math": true,
- "proto": true,
-}
-
-// Create and remember a guaranteed unique package name. Pkg is the candidate name.
-// The FileDescriptor parameter is unused.
-func RegisterUniquePackageName(pkg string, f *FileDescriptor) string {
- name := cleanPackageName(pkg)
- for i, orig := 1, name; globalPackageNames[name]; i++ {
- name = orig + GoPackageName(strconv.Itoa(i))
- }
- globalPackageNames[name] = true
- return string(name)
-}
-
-var isGoKeyword = map[string]bool{
- "break": true,
- "case": true,
- "chan": true,
- "const": true,
- "continue": true,
- "default": true,
- "else": true,
- "defer": true,
- "fallthrough": true,
- "for": true,
- "func": true,
- "go": true,
- "goto": true,
- "if": true,
- "import": true,
- "interface": true,
- "map": true,
- "package": true,
- "range": true,
- "return": true,
- "select": true,
- "struct": true,
- "switch": true,
- "type": true,
- "var": true,
-}
-
-func cleanPackageName(name string) GoPackageName {
- name = strings.Map(badToUnderscore, name)
- // Identifier must not be keyword: insert _.
- if isGoKeyword[name] {
- name = "_" + name
- }
- // Identifier must not begin with digit: insert _.
- if r, _ := utf8.DecodeRuneInString(name); unicode.IsDigit(r) {
- name = "_" + name
- }
- return GoPackageName(name)
-}
-
-// defaultGoPackage returns the package name to use,
-// derived from the import path of the package we're building code for.
-func (g *Generator) defaultGoPackage() GoPackageName {
- p := g.PackageImportPath
- if i := strings.LastIndex(p, "/"); i >= 0 {
- p = p[i+1:]
- }
- return cleanPackageName(p)
-}
-
-// SetPackageNames sets the package name for this run.
-// The package name must agree across all files being generated.
-// It also defines unique package names for all imported files.
-func (g *Generator) SetPackageNames() {
- g.outputImportPath = g.genFiles[0].importPath
-
- defaultPackageNames := make(map[GoImportPath]GoPackageName)
- for _, f := range g.genFiles {
- if _, p, ok := f.goPackageOption(); ok {
- defaultPackageNames[f.importPath] = p
- }
- }
- for _, f := range g.genFiles {
- if _, p, ok := f.goPackageOption(); ok {
- // Source file: option go_package = "quux/bar";
- f.packageName = p
- } else if p, ok := defaultPackageNames[f.importPath]; ok {
- // A go_package option in another file in the same package.
- //
- // This is a poor choice in general, since every source file should
- // contain a go_package option. Supported mainly for historical
- // compatibility.
- f.packageName = p
- } else if p := g.defaultGoPackage(); p != "" {
- // Command-line: import_path=quux/bar.
- //
- // The import_path flag sets a package name for files which don't
- // contain a go_package option.
- f.packageName = p
- } else if p := f.GetPackage(); p != "" {
- // Source file: package quux.bar;
- f.packageName = cleanPackageName(p)
- } else {
- // Source filename.
- f.packageName = cleanPackageName(baseName(f.GetName()))
- }
- }
-
- // Check that all files have a consistent package name and import path.
- for _, f := range g.genFiles[1:] {
- if a, b := g.genFiles[0].importPath, f.importPath; a != b {
- g.Fail(fmt.Sprintf("inconsistent package import paths: %v, %v", a, b))
- }
- if a, b := g.genFiles[0].packageName, f.packageName; a != b {
- g.Fail(fmt.Sprintf("inconsistent package names: %v, %v", a, b))
- }
- }
-
- // Names of support packages. These never vary (if there are conflicts,
- // we rename the conflicting package), so this could be removed someday.
- g.Pkg = map[string]string{
- "fmt": "fmt",
- "math": "math",
- "proto": "proto",
- }
-}
-
-// WrapTypes walks the incoming data, wrapping DescriptorProtos, EnumDescriptorProtos
-// and FileDescriptorProtos into file-referenced objects within the Generator.
-// It also creates the list of files to generate and so should be called before GenerateAllFiles.
-func (g *Generator) WrapTypes() {
- g.allFiles = make([]*FileDescriptor, 0, len(g.Request.ProtoFile))
- g.allFilesByName = make(map[string]*FileDescriptor, len(g.allFiles))
- genFileNames := make(map[string]bool)
- for _, n := range g.Request.FileToGenerate {
- genFileNames[n] = true
- }
- for _, f := range g.Request.ProtoFile {
- fd := &FileDescriptor{
- FileDescriptorProto: f,
- exported: make(map[Object][]symbol),
- proto3: fileIsProto3(f),
- }
- // The import path may be set in a number of ways.
- if substitution, ok := g.ImportMap[f.GetName()]; ok {
- // Command-line: M=foo.proto=quux/bar.
- //
- // Explicit mapping of source file to import path.
- fd.importPath = GoImportPath(substitution)
- } else if genFileNames[f.GetName()] && g.PackageImportPath != "" {
- // Command-line: import_path=quux/bar.
- //
- // The import_path flag sets the import path for every file that
- // we generate code for.
- fd.importPath = GoImportPath(g.PackageImportPath)
- } else if p, _, _ := fd.goPackageOption(); p != "" {
- // Source file: option go_package = "quux/bar";
- //
- // The go_package option sets the import path. Most users should use this.
- fd.importPath = p
- } else {
- // Source filename.
- //
- // Last resort when nothing else is available.
- fd.importPath = GoImportPath(path.Dir(f.GetName()))
- }
- // We must wrap the descriptors before we wrap the enums
- fd.desc = wrapDescriptors(fd)
- g.buildNestedDescriptors(fd.desc)
- fd.enum = wrapEnumDescriptors(fd, fd.desc)
- g.buildNestedEnums(fd.desc, fd.enum)
- fd.ext = wrapExtensions(fd)
- extractComments(fd)
- g.allFiles = append(g.allFiles, fd)
- g.allFilesByName[f.GetName()] = fd
- }
- for _, fd := range g.allFiles {
- fd.imp = wrapImported(fd, g)
- }
-
- g.genFiles = make([]*FileDescriptor, 0, len(g.Request.FileToGenerate))
- for _, fileName := range g.Request.FileToGenerate {
- fd := g.allFilesByName[fileName]
- if fd == nil {
- g.Fail("could not find file named", fileName)
- }
- fingerprint, err := fingerprintProto(fd.FileDescriptorProto)
- if err != nil {
- g.Error(err)
- }
- fd.fingerprint = fingerprint
- g.genFiles = append(g.genFiles, fd)
- }
-}
-
-// fingerprintProto returns a fingerprint for a message.
-// The fingerprint is intended to prevent conflicts between generated fileds,
-// not to provide cryptographic security.
-func fingerprintProto(m proto.Message) (string, error) {
- b, err := proto.Marshal(m)
- if err != nil {
- return "", err
- }
- h := sha256.Sum256(b)
- return hex.EncodeToString(h[:8]), nil
-}
-
-// Scan the descriptors in this file. For each one, build the slice of nested descriptors
-func (g *Generator) buildNestedDescriptors(descs []*Descriptor) {
- for _, desc := range descs {
- if len(desc.NestedType) != 0 {
- for _, nest := range descs {
- if nest.parent == desc {
- desc.nested = append(desc.nested, nest)
- }
- }
- if len(desc.nested) != len(desc.NestedType) {
- g.Fail("internal error: nesting failure for", desc.GetName())
- }
- }
- }
-}
-
-func (g *Generator) buildNestedEnums(descs []*Descriptor, enums []*EnumDescriptor) {
- for _, desc := range descs {
- if len(desc.EnumType) != 0 {
- for _, enum := range enums {
- if enum.parent == desc {
- desc.enums = append(desc.enums, enum)
- }
- }
- if len(desc.enums) != len(desc.EnumType) {
- g.Fail("internal error: enum nesting failure for", desc.GetName())
- }
- }
- }
-}
-
-// Construct the Descriptor
-func newDescriptor(desc *descriptor.DescriptorProto, parent *Descriptor, file *FileDescriptor, index int) *Descriptor {
- d := &Descriptor{
- common: common{file},
- DescriptorProto: desc,
- parent: parent,
- index: index,
- }
- if parent == nil {
- d.path = fmt.Sprintf("%d,%d", messagePath, index)
- } else {
- d.path = fmt.Sprintf("%s,%d,%d", parent.path, messageMessagePath, index)
- }
-
- // The only way to distinguish a group from a message is whether
- // the containing message has a TYPE_GROUP field that matches.
- if parent != nil {
- parts := d.TypeName()
- if file.Package != nil {
- parts = append([]string{*file.Package}, parts...)
- }
- exp := "." + strings.Join(parts, ".")
- for _, field := range parent.Field {
- if field.GetType() == descriptor.FieldDescriptorProto_TYPE_GROUP && field.GetTypeName() == exp {
- d.group = true
- break
- }
- }
- }
-
- for _, field := range desc.Extension {
- d.ext = append(d.ext, &ExtensionDescriptor{common{file}, field, d})
- }
-
- return d
-}
-
-// Return a slice of all the Descriptors defined within this file
-func wrapDescriptors(file *FileDescriptor) []*Descriptor {
- sl := make([]*Descriptor, 0, len(file.MessageType)+10)
- for i, desc := range file.MessageType {
- sl = wrapThisDescriptor(sl, desc, nil, file, i)
- }
- return sl
-}
-
-// Wrap this Descriptor, recursively
-func wrapThisDescriptor(sl []*Descriptor, desc *descriptor.DescriptorProto, parent *Descriptor, file *FileDescriptor, index int) []*Descriptor {
- sl = append(sl, newDescriptor(desc, parent, file, index))
- me := sl[len(sl)-1]
- for i, nested := range desc.NestedType {
- sl = wrapThisDescriptor(sl, nested, me, file, i)
- }
- return sl
-}
-
-// Construct the EnumDescriptor
-func newEnumDescriptor(desc *descriptor.EnumDescriptorProto, parent *Descriptor, file *FileDescriptor, index int) *EnumDescriptor {
- ed := &EnumDescriptor{
- common: common{file},
- EnumDescriptorProto: desc,
- parent: parent,
- index: index,
- }
- if parent == nil {
- ed.path = fmt.Sprintf("%d,%d", enumPath, index)
- } else {
- ed.path = fmt.Sprintf("%s,%d,%d", parent.path, messageEnumPath, index)
- }
- return ed
-}
-
-// Return a slice of all the EnumDescriptors defined within this file
-func wrapEnumDescriptors(file *FileDescriptor, descs []*Descriptor) []*EnumDescriptor {
- sl := make([]*EnumDescriptor, 0, len(file.EnumType)+10)
- // Top-level enums.
- for i, enum := range file.EnumType {
- sl = append(sl, newEnumDescriptor(enum, nil, file, i))
- }
- // Enums within messages. Enums within embedded messages appear in the outer-most message.
- for _, nested := range descs {
- for i, enum := range nested.EnumType {
- sl = append(sl, newEnumDescriptor(enum, nested, file, i))
- }
- }
- return sl
-}
-
-// Return a slice of all the top-level ExtensionDescriptors defined within this file.
-func wrapExtensions(file *FileDescriptor) []*ExtensionDescriptor {
- var sl []*ExtensionDescriptor
- for _, field := range file.Extension {
- sl = append(sl, &ExtensionDescriptor{common{file}, field, nil})
- }
- return sl
-}
-
-// Return a slice of all the types that are publicly imported into this file.
-func wrapImported(file *FileDescriptor, g *Generator) (sl []*ImportedDescriptor) {
- for _, index := range file.PublicDependency {
- df := g.fileByName(file.Dependency[index])
- for _, d := range df.desc {
- if d.GetOptions().GetMapEntry() {
- continue
- }
- sl = append(sl, &ImportedDescriptor{common{file}, d})
- }
- for _, e := range df.enum {
- sl = append(sl, &ImportedDescriptor{common{file}, e})
- }
- for _, ext := range df.ext {
- sl = append(sl, &ImportedDescriptor{common{file}, ext})
- }
- }
- return
-}
-
-func extractComments(file *FileDescriptor) {
- file.comments = make(map[string]*descriptor.SourceCodeInfo_Location)
- for _, loc := range file.GetSourceCodeInfo().GetLocation() {
- if loc.LeadingComments == nil {
- continue
- }
- var p []string
- for _, n := range loc.Path {
- p = append(p, strconv.Itoa(int(n)))
- }
- file.comments[strings.Join(p, ",")] = loc
- }
-}
-
-// BuildTypeNameMap builds the map from fully qualified type names to objects.
-// The key names for the map come from the input data, which puts a period at the beginning.
-// It should be called after SetPackageNames and before GenerateAllFiles.
-func (g *Generator) BuildTypeNameMap() {
- g.typeNameToObject = make(map[string]Object)
- for _, f := range g.allFiles {
- // The names in this loop are defined by the proto world, not us, so the
- // package name may be empty. If so, the dotted package name of X will
- // be ".X"; otherwise it will be ".pkg.X".
- dottedPkg := "." + f.GetPackage()
- if dottedPkg != "." {
- dottedPkg += "."
- }
- for _, enum := range f.enum {
- name := dottedPkg + dottedSlice(enum.TypeName())
- g.typeNameToObject[name] = enum
- }
- for _, desc := range f.desc {
- name := dottedPkg + dottedSlice(desc.TypeName())
- g.typeNameToObject[name] = desc
- }
- }
-}
-
-// ObjectNamed, given a fully-qualified input type name as it appears in the input data,
-// returns the descriptor for the message or enum with that name.
-func (g *Generator) ObjectNamed(typeName string) Object {
- o, ok := g.typeNameToObject[typeName]
- if !ok {
- g.Fail("can't find object with type", typeName)
- }
-
- // If the file of this object isn't a direct dependency of the current file,
- // or in the current file, then this object has been publicly imported into
- // a dependency of the current file.
- // We should return the ImportedDescriptor object for it instead.
- direct := *o.File().Name == *g.file.Name
- if !direct {
- for _, dep := range g.file.Dependency {
- if *g.fileByName(dep).Name == *o.File().Name {
- direct = true
- break
- }
- }
- }
- if !direct {
- found := false
- Loop:
- for _, dep := range g.file.Dependency {
- df := g.fileByName(*g.fileByName(dep).Name)
- for _, td := range df.imp {
- if td.o == o {
- // Found it!
- o = td
- found = true
- break Loop
- }
- }
- }
- if !found {
- log.Printf("protoc-gen-go: WARNING: failed finding publicly imported dependency for %v, used in %v", typeName, *g.file.Name)
- }
- }
-
- return o
-}
-
-// AnnotatedAtoms is a list of atoms (as consumed by P) that records the file name and proto AST path from which they originated.
-type AnnotatedAtoms struct {
- source string
- path string
- atoms []interface{}
-}
-
-// Annotate records the file name and proto AST path of a list of atoms
-// so that a later call to P can emit a link from each atom to its origin.
-func Annotate(file *FileDescriptor, path string, atoms ...interface{}) *AnnotatedAtoms {
- return &AnnotatedAtoms{source: *file.Name, path: path, atoms: atoms}
-}
-
-// printAtom prints the (atomic, non-annotation) argument to the generated output.
-func (g *Generator) printAtom(v interface{}) {
- switch v := v.(type) {
- case string:
- g.WriteString(v)
- case *string:
- g.WriteString(*v)
- case bool:
- fmt.Fprint(g, v)
- case *bool:
- fmt.Fprint(g, *v)
- case int:
- fmt.Fprint(g, v)
- case *int32:
- fmt.Fprint(g, *v)
- case *int64:
- fmt.Fprint(g, *v)
- case float64:
- fmt.Fprint(g, v)
- case *float64:
- fmt.Fprint(g, *v)
- case GoPackageName:
- g.WriteString(string(v))
- case GoImportPath:
- g.WriteString(strconv.Quote(string(v)))
- default:
- g.Fail(fmt.Sprintf("unknown type in printer: %T", v))
- }
-}
-
-// P prints the arguments to the generated output. It handles strings and int32s, plus
-// handling indirections because they may be *string, etc. Any inputs of type AnnotatedAtoms may emit
-// annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode
-// is true).
-func (g *Generator) P(str ...interface{}) {
- if !g.writeOutput {
- return
- }
- g.WriteString(g.indent)
- for _, v := range str {
- switch v := v.(type) {
- case *AnnotatedAtoms:
- begin := int32(g.Len())
- for _, v := range v.atoms {
- g.printAtom(v)
- }
- if g.annotateCode {
- end := int32(g.Len())
- var path []int32
- for _, token := range strings.Split(v.path, ",") {
- val, err := strconv.ParseInt(token, 10, 32)
- if err != nil {
- g.Fail("could not parse proto AST path: ", err.Error())
- }
- path = append(path, int32(val))
- }
- g.annotations = append(g.annotations, &descriptor.GeneratedCodeInfo_Annotation{
- Path: path,
- SourceFile: &v.source,
- Begin: &begin,
- End: &end,
- })
- }
- default:
- g.printAtom(v)
- }
- }
- g.WriteByte('\n')
-}
-
-// addInitf stores the given statement to be printed inside the file's init function.
-// The statement is given as a format specifier and arguments.
-func (g *Generator) addInitf(stmt string, a ...interface{}) {
- g.init = append(g.init, fmt.Sprintf(stmt, a...))
-}
-
-// In Indents the output one tab stop.
-func (g *Generator) In() { g.indent += "\t" }
-
-// Out unindents the output one tab stop.
-func (g *Generator) Out() {
- if len(g.indent) > 0 {
- g.indent = g.indent[1:]
- }
-}
-
-// GenerateAllFiles generates the output for all the files we're outputting.
-func (g *Generator) GenerateAllFiles() {
- // Initialize the plugins
- for _, p := range plugins {
- p.Init(g)
- }
- // Generate the output. The generator runs for every file, even the files
- // that we don't generate output for, so that we can collate the full list
- // of exported symbols to support public imports.
- genFileMap := make(map[*FileDescriptor]bool, len(g.genFiles))
- for _, file := range g.genFiles {
- genFileMap[file] = true
- }
- for _, file := range g.allFiles {
- g.Reset()
- g.annotations = nil
- g.writeOutput = genFileMap[file]
- g.generate(file)
- if !g.writeOutput {
- continue
- }
- fname := file.goFileName(g.pathType)
- g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
- Name: proto.String(fname),
- Content: proto.String(g.String()),
- })
- if g.annotateCode {
- // Store the generated code annotations in text, as the protoc plugin protocol requires that
- // strings contain valid UTF-8.
- g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
- Name: proto.String(file.goFileName(g.pathType) + ".meta"),
- Content: proto.String(proto.CompactTextString(&descriptor.GeneratedCodeInfo{Annotation: g.annotations})),
- })
- }
- }
-}
-
-// Run all the plugins associated with the file.
-func (g *Generator) runPlugins(file *FileDescriptor) {
- for _, p := range plugins {
- p.Generate(file)
- }
-}
-
-// Fill the response protocol buffer with the generated output for all the files we're
-// supposed to generate.
-func (g *Generator) generate(file *FileDescriptor) {
- g.file = file
- g.usedPackages = make(map[GoImportPath]bool)
- g.packageNames = make(map[GoImportPath]GoPackageName)
- g.usedPackageNames = make(map[GoPackageName]bool)
- for name := range globalPackageNames {
- g.usedPackageNames[name] = true
- }
-
- g.P("// This is a compile-time assertion to ensure that this generated file")
- g.P("// is compatible with the proto package it is being compiled against.")
- g.P("// A compilation error at this line likely means your copy of the")
- g.P("// proto package needs to be updated.")
- g.P("const _ = ", g.Pkg["proto"], ".ProtoPackageIsVersion", generatedCodeVersion, " // please upgrade the proto package")
- g.P()
-
- for _, td := range g.file.imp {
- g.generateImported(td)
- }
- for _, enum := range g.file.enum {
- g.generateEnum(enum)
- }
- for _, desc := range g.file.desc {
- // Don't generate virtual messages for maps.
- if desc.GetOptions().GetMapEntry() {
- continue
- }
- g.generateMessage(desc)
- }
- for _, ext := range g.file.ext {
- g.generateExtension(ext)
- }
- g.generateInitFunction()
-
- // Run the plugins before the imports so we know which imports are necessary.
- g.runPlugins(file)
-
- g.generateFileDescriptor(file)
-
- // Generate header and imports last, though they appear first in the output.
- rem := g.Buffer
- remAnno := g.annotations
- g.Buffer = new(bytes.Buffer)
- g.annotations = nil
- g.generateHeader()
- g.generateImports()
- if !g.writeOutput {
- return
- }
- // Adjust the offsets for annotations displaced by the header and imports.
- for _, anno := range remAnno {
- *anno.Begin += int32(g.Len())
- *anno.End += int32(g.Len())
- g.annotations = append(g.annotations, anno)
- }
- g.Write(rem.Bytes())
-
- // Reformat generated code and patch annotation locations.
- fset := token.NewFileSet()
- original := g.Bytes()
- if g.annotateCode {
- // make a copy independent of g; we'll need it after Reset.
- original = append([]byte(nil), original...)
- }
- ast, err := parser.ParseFile(fset, "", original, parser.ParseComments)
- if err != nil {
- // Print out the bad code with line numbers.
- // This should never happen in practice, but it can while changing generated code,
- // so consider this a debugging aid.
- var src bytes.Buffer
- s := bufio.NewScanner(bytes.NewReader(original))
- for line := 1; s.Scan(); line++ {
- fmt.Fprintf(&src, "%5d\t%s\n", line, s.Bytes())
- }
- g.Fail("bad Go source code was generated:", err.Error(), "\n"+src.String())
- }
- g.Reset()
- err = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(g, fset, ast)
- if err != nil {
- g.Fail("generated Go source code could not be reformatted:", err.Error())
- }
- if g.annotateCode {
- m, err := remap.Compute(original, g.Bytes())
- if err != nil {
- g.Fail("formatted generated Go source code could not be mapped back to the original code:", err.Error())
- }
- for _, anno := range g.annotations {
- new, ok := m.Find(int(*anno.Begin), int(*anno.End))
- if !ok {
- g.Fail("span in formatted generated Go source code could not be mapped back to the original code")
- }
- *anno.Begin = int32(new.Pos)
- *anno.End = int32(new.End)
- }
- }
-}
-
-// Generate the header, including package definition
-func (g *Generator) generateHeader() {
- g.P("// Code generated by protoc-gen-go. DO NOT EDIT.")
- if g.file.GetOptions().GetDeprecated() {
- g.P("// ", g.file.Name, " is a deprecated file.")
- } else {
- g.P("// source: ", g.file.Name)
- }
- g.P()
-
- importPath, _, _ := g.file.goPackageOption()
- if importPath == "" {
- g.P("package ", g.file.packageName)
- } else {
- g.P("package ", g.file.packageName, " // import ", GoImportPath(g.ImportPrefix)+importPath)
- }
- g.P()
-
- if loc, ok := g.file.comments[strconv.Itoa(packagePath)]; ok {
- g.P("/*")
- // not using g.PrintComments because this is a /* */ comment block.
- text := strings.TrimSuffix(loc.GetLeadingComments(), "\n")
- for _, line := range strings.Split(text, "\n") {
- line = strings.TrimPrefix(line, " ")
- // ensure we don't escape from the block comment
- line = strings.Replace(line, "*/", "* /", -1)
- g.P(line)
- }
- g.P("*/")
- g.P()
- }
-}
-
-// deprecationComment is the standard comment added to deprecated
-// messages, fields, enums, and enum values.
-var deprecationComment = "// Deprecated: Do not use."
-
-// PrintComments prints any comments from the source .proto file.
-// The path is a comma-separated list of integers.
-// It returns an indication of whether any comments were printed.
-// See descriptor.proto for its format.
-func (g *Generator) PrintComments(path string) bool {
- if !g.writeOutput {
- return false
- }
- if loc, ok := g.file.comments[path]; ok {
- text := strings.TrimSuffix(loc.GetLeadingComments(), "\n")
- for _, line := range strings.Split(text, "\n") {
- g.P("// ", strings.TrimPrefix(line, " "))
- }
- return true
- }
- return false
-}
-
-func (g *Generator) fileByName(filename string) *FileDescriptor {
- return g.allFilesByName[filename]
-}
-
-// weak returns whether the ith import of the current file is a weak import.
-func (g *Generator) weak(i int32) bool {
- for _, j := range g.file.WeakDependency {
- if j == i {
- return true
- }
- }
- return false
-}
-
-// Generate the imports
-func (g *Generator) generateImports() {
- // We almost always need a proto import. Rather than computing when we
- // do, which is tricky when there's a plugin, just import it and
- // reference it later. The same argument applies to the fmt and math packages.
- g.P("import "+g.Pkg["proto"]+" ", GoImportPath(g.ImportPrefix)+"github.com/golang/protobuf/proto")
- g.P("import " + g.Pkg["fmt"] + ` "fmt"`)
- g.P("import " + g.Pkg["math"] + ` "math"`)
- var (
- imports = make(map[GoImportPath]bool)
- strongImports = make(map[GoImportPath]bool)
- importPaths []string
- )
- for i, s := range g.file.Dependency {
- fd := g.fileByName(s)
- importPath := fd.importPath
- // Do not import our own package.
- if importPath == g.file.importPath {
- continue
- }
- if !imports[importPath] {
- importPaths = append(importPaths, string(importPath))
- }
- imports[importPath] = true
- if !g.weak(int32(i)) {
- strongImports[importPath] = true
- }
- }
- sort.Strings(importPaths)
- for i := range importPaths {
- importPath := GoImportPath(importPaths[i])
- packageName := g.GoPackageName(importPath)
- fullPath := GoImportPath(g.ImportPrefix) + importPath
- // Skip weak imports.
- if !strongImports[importPath] {
- g.P("// skipping weak import ", packageName, " ", fullPath)
- continue
- }
- // We need to import all the dependencies, even if we don't reference them,
- // because other code and tools depend on having the full transitive closure
- // of protocol buffer types in the binary.
- if _, ok := g.usedPackages[importPath]; !ok {
- packageName = "_"
- }
- g.P("import ", packageName, " ", fullPath)
- }
- g.P()
- // TODO: may need to worry about uniqueness across plugins
- for _, p := range plugins {
- p.GenerateImports(g.file)
- g.P()
- }
- g.P("// Reference imports to suppress errors if they are not otherwise used.")
- g.P("var _ = ", g.Pkg["proto"], ".Marshal")
- g.P("var _ = ", g.Pkg["fmt"], ".Errorf")
- g.P("var _ = ", g.Pkg["math"], ".Inf")
- g.P()
-}
-
-func (g *Generator) generateImported(id *ImportedDescriptor) {
- tn := id.TypeName()
- sn := tn[len(tn)-1]
- df := id.o.File()
- filename := *df.Name
- if df.importPath == g.file.importPath {
- // Don't generate type aliases for files in the same Go package as this one.
- g.P("// Ignoring public import of ", sn, " from ", filename)
- g.P()
- return
- }
- if !supportTypeAliases {
- g.Fail(fmt.Sprintf("%s: public imports require at least go1.9", filename))
- }
- g.P("// ", sn, " from public import ", filename)
- g.usedPackages[df.importPath] = true
-
- for _, sym := range df.exported[id.o] {
- sym.GenerateAlias(g, g.GoPackageName(df.importPath))
- }
-
- g.P()
-}
-
-// Generate the enum definitions for this EnumDescriptor.
-func (g *Generator) generateEnum(enum *EnumDescriptor) {
- // The full type name
- typeName := enum.TypeName()
- // The full type name, CamelCased.
- ccTypeName := CamelCaseSlice(typeName)
- ccPrefix := enum.prefix()
-
- deprecatedEnum := ""
- if enum.GetOptions().GetDeprecated() {
- deprecatedEnum = deprecationComment
- }
- g.PrintComments(enum.path)
- g.P("type ", Annotate(enum.file, enum.path, ccTypeName), " int32", deprecatedEnum)
- g.file.addExport(enum, enumSymbol{ccTypeName, enum.proto3()})
- g.P("const (")
- g.In()
- for i, e := range enum.Value {
- etorPath := fmt.Sprintf("%s,%d,%d", enum.path, enumValuePath, i)
- g.PrintComments(etorPath)
-
- deprecatedValue := ""
- if e.GetOptions().GetDeprecated() {
- deprecatedValue = deprecationComment
- }
-
- name := ccPrefix + *e.Name
- g.P(Annotate(enum.file, etorPath, name), " ", ccTypeName, " = ", e.Number, " ", deprecatedValue)
- g.file.addExport(enum, constOrVarSymbol{name, "const", ccTypeName})
- }
- g.Out()
- g.P(")")
- g.P("var ", ccTypeName, "_name = map[int32]string{")
- g.In()
- generated := make(map[int32]bool) // avoid duplicate values
- for _, e := range enum.Value {
- duplicate := ""
- if _, present := generated[*e.Number]; present {
- duplicate = "// Duplicate value: "
- }
- g.P(duplicate, e.Number, ": ", strconv.Quote(*e.Name), ",")
- generated[*e.Number] = true
- }
- g.Out()
- g.P("}")
- g.P("var ", ccTypeName, "_value = map[string]int32{")
- g.In()
- for _, e := range enum.Value {
- g.P(strconv.Quote(*e.Name), ": ", e.Number, ",")
- }
- g.Out()
- g.P("}")
-
- if !enum.proto3() {
- g.P("func (x ", ccTypeName, ") Enum() *", ccTypeName, " {")
- g.In()
- g.P("p := new(", ccTypeName, ")")
- g.P("*p = x")
- g.P("return p")
- g.Out()
- g.P("}")
- }
-
- g.P("func (x ", ccTypeName, ") String() string {")
- g.In()
- g.P("return ", g.Pkg["proto"], ".EnumName(", ccTypeName, "_name, int32(x))")
- g.Out()
- g.P("}")
-
- if !enum.proto3() {
- g.P("func (x *", ccTypeName, ") UnmarshalJSON(data []byte) error {")
- g.In()
- g.P("value, err := ", g.Pkg["proto"], ".UnmarshalJSONEnum(", ccTypeName, `_value, data, "`, ccTypeName, `")`)
- g.P("if err != nil {")
- g.In()
- g.P("return err")
- g.Out()
- g.P("}")
- g.P("*x = ", ccTypeName, "(value)")
- g.P("return nil")
- g.Out()
- g.P("}")
- }
-
- var indexes []string
- for m := enum.parent; m != nil; m = m.parent {
- // XXX: skip groups?
- indexes = append([]string{strconv.Itoa(m.index)}, indexes...)
- }
- indexes = append(indexes, strconv.Itoa(enum.index))
- g.P("func (", ccTypeName, ") EnumDescriptor() ([]byte, []int) {")
- g.In()
- g.P("return ", g.file.VarName(), ", []int{", strings.Join(indexes, ", "), "}")
- g.Out()
- g.P("}")
- if enum.file.GetPackage() == "google.protobuf" && enum.GetName() == "NullValue" {
- g.P("func (", ccTypeName, `) XXX_WellKnownType() string { return "`, enum.GetName(), `" }`)
- }
-
- g.P()
-}
-
-// The tag is a string like "varint,2,opt,name=fieldname,def=7" that
-// identifies details of the field for the protocol buffer marshaling and unmarshaling
-// code. The fields are:
-// wire encoding
-// protocol tag number
-// opt,req,rep for optional, required, or repeated
-// packed whether the encoding is "packed" (optional; repeated primitives only)
-// name= the original declared name
-// enum= the name of the enum type if it is an enum-typed field.
-// proto3 if this field is in a proto3 message
-// def= string representation of the default value, if any.
-// The default value must be in a representation that can be used at run-time
-// to generate the default value. Thus bools become 0 and 1, for instance.
-func (g *Generator) goTag(message *Descriptor, field *descriptor.FieldDescriptorProto, wiretype string) string {
- optrepreq := ""
- switch {
- case isOptional(field):
- optrepreq = "opt"
- case isRequired(field):
- optrepreq = "req"
- case isRepeated(field):
- optrepreq = "rep"
- }
- var defaultValue string
- if dv := field.DefaultValue; dv != nil { // set means an explicit default
- defaultValue = *dv
- // Some types need tweaking.
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- if defaultValue == "true" {
- defaultValue = "1"
- } else {
- defaultValue = "0"
- }
- case descriptor.FieldDescriptorProto_TYPE_STRING,
- descriptor.FieldDescriptorProto_TYPE_BYTES:
- // Nothing to do. Quoting is done for the whole tag.
- case descriptor.FieldDescriptorProto_TYPE_ENUM:
- // For enums we need to provide the integer constant.
- obj := g.ObjectNamed(field.GetTypeName())
- if id, ok := obj.(*ImportedDescriptor); ok {
- // It is an enum that was publicly imported.
- // We need the underlying type.
- obj = id.o
- }
- enum, ok := obj.(*EnumDescriptor)
- if !ok {
- log.Printf("obj is a %T", obj)
- if id, ok := obj.(*ImportedDescriptor); ok {
- log.Printf("id.o is a %T", id.o)
- }
- g.Fail("unknown enum type", CamelCaseSlice(obj.TypeName()))
- }
- defaultValue = enum.integerValueAsString(defaultValue)
- }
- defaultValue = ",def=" + defaultValue
- }
- enum := ""
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM {
- // We avoid using obj.GoPackageName(), because we want to use the
- // original (proto-world) package name.
- obj := g.ObjectNamed(field.GetTypeName())
- if id, ok := obj.(*ImportedDescriptor); ok {
- obj = id.o
- }
- enum = ",enum="
- if pkg := obj.File().GetPackage(); pkg != "" {
- enum += pkg + "."
- }
- enum += CamelCaseSlice(obj.TypeName())
- }
- packed := ""
- if (field.Options != nil && field.Options.GetPacked()) ||
- // Per https://developers.google.com/protocol-buffers/docs/proto3#simple:
- // "In proto3, repeated fields of scalar numeric types use packed encoding by default."
- (message.proto3() && (field.Options == nil || field.Options.Packed == nil) &&
- isRepeated(field) && isScalar(field)) {
- packed = ",packed"
- }
- fieldName := field.GetName()
- name := fieldName
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {
- // We must use the type name for groups instead of
- // the field name to preserve capitalization.
- // type_name in FieldDescriptorProto is fully-qualified,
- // but we only want the local part.
- name = *field.TypeName
- if i := strings.LastIndex(name, "."); i >= 0 {
- name = name[i+1:]
- }
- }
- if json := field.GetJsonName(); json != "" && json != name {
- // TODO: escaping might be needed, in which case
- // perhaps this should be in its own "json" tag.
- name += ",json=" + json
- }
- name = ",name=" + name
- if message.proto3() {
- // We only need the extra tag for []byte fields;
- // no need to add noise for the others.
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_BYTES {
- name += ",proto3"
- }
-
- }
- oneof := ""
- if field.OneofIndex != nil {
- oneof = ",oneof"
- }
- return strconv.Quote(fmt.Sprintf("%s,%d,%s%s%s%s%s%s",
- wiretype,
- field.GetNumber(),
- optrepreq,
- packed,
- name,
- enum,
- oneof,
- defaultValue))
-}
-
-func needsStar(typ descriptor.FieldDescriptorProto_Type) bool {
- switch typ {
- case descriptor.FieldDescriptorProto_TYPE_GROUP:
- return false
- case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- return false
- case descriptor.FieldDescriptorProto_TYPE_BYTES:
- return false
- }
- return true
-}
-
-// TypeName is the printed name appropriate for an item. If the object is in the current file,
-// TypeName drops the package name and underscores the rest.
-// Otherwise the object is from another package; and the result is the underscored
-// package name followed by the item name.
-// The result always has an initial capital.
-func (g *Generator) TypeName(obj Object) string {
- return g.DefaultPackageName(obj) + CamelCaseSlice(obj.TypeName())
-}
-
-// GoType returns a string representing the type name, and the wire type
-func (g *Generator) GoType(message *Descriptor, field *descriptor.FieldDescriptorProto) (typ string, wire string) {
- // TODO: Options.
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
- typ, wire = "float64", "fixed64"
- case descriptor.FieldDescriptorProto_TYPE_FLOAT:
- typ, wire = "float32", "fixed32"
- case descriptor.FieldDescriptorProto_TYPE_INT64:
- typ, wire = "int64", "varint"
- case descriptor.FieldDescriptorProto_TYPE_UINT64:
- typ, wire = "uint64", "varint"
- case descriptor.FieldDescriptorProto_TYPE_INT32:
- typ, wire = "int32", "varint"
- case descriptor.FieldDescriptorProto_TYPE_UINT32:
- typ, wire = "uint32", "varint"
- case descriptor.FieldDescriptorProto_TYPE_FIXED64:
- typ, wire = "uint64", "fixed64"
- case descriptor.FieldDescriptorProto_TYPE_FIXED32:
- typ, wire = "uint32", "fixed32"
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- typ, wire = "bool", "varint"
- case descriptor.FieldDescriptorProto_TYPE_STRING:
- typ, wire = "string", "bytes"
- case descriptor.FieldDescriptorProto_TYPE_GROUP:
- desc := g.ObjectNamed(field.GetTypeName())
- typ, wire = "*"+g.TypeName(desc), "group"
- case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- desc := g.ObjectNamed(field.GetTypeName())
- typ, wire = "*"+g.TypeName(desc), "bytes"
- case descriptor.FieldDescriptorProto_TYPE_BYTES:
- typ, wire = "[]byte", "bytes"
- case descriptor.FieldDescriptorProto_TYPE_ENUM:
- desc := g.ObjectNamed(field.GetTypeName())
- typ, wire = g.TypeName(desc), "varint"
- case descriptor.FieldDescriptorProto_TYPE_SFIXED32:
- typ, wire = "int32", "fixed32"
- case descriptor.FieldDescriptorProto_TYPE_SFIXED64:
- typ, wire = "int64", "fixed64"
- case descriptor.FieldDescriptorProto_TYPE_SINT32:
- typ, wire = "int32", "zigzag32"
- case descriptor.FieldDescriptorProto_TYPE_SINT64:
- typ, wire = "int64", "zigzag64"
- default:
- g.Fail("unknown type for", field.GetName())
- }
- if isRepeated(field) {
- typ = "[]" + typ
- } else if message != nil && message.proto3() {
- return
- } else if field.OneofIndex != nil && message != nil {
- return
- } else if needsStar(*field.Type) {
- typ = "*" + typ
- }
- return
-}
-
-func (g *Generator) RecordTypeUse(t string) {
- if _, ok := g.typeNameToObject[t]; ok {
- // Call ObjectNamed to get the true object to record the use.
- obj := g.ObjectNamed(t)
- g.usedPackages[obj.GoImportPath()] = true
- }
-}
-
-// Method names that may be generated. Fields with these names get an
-// underscore appended. Any change to this set is a potential incompatible
-// API change because it changes generated field names.
-var methodNames = [...]string{
- "Reset",
- "String",
- "ProtoMessage",
- "Marshal",
- "Unmarshal",
- "ExtensionRangeArray",
- "ExtensionMap",
- "Descriptor",
-}
-
-// Names of messages in the `google.protobuf` package for which
-// we will generate XXX_WellKnownType methods.
-var wellKnownTypes = map[string]bool{
- "Any": true,
- "Duration": true,
- "Empty": true,
- "Struct": true,
- "Timestamp": true,
-
- "Value": true,
- "ListValue": true,
- "DoubleValue": true,
- "FloatValue": true,
- "Int64Value": true,
- "UInt64Value": true,
- "Int32Value": true,
- "UInt32Value": true,
- "BoolValue": true,
- "StringValue": true,
- "BytesValue": true,
-}
-
-// Generate the type and default constant definitions for this Descriptor.
-func (g *Generator) generateMessage(message *Descriptor) {
- // The full type name
- typeName := message.TypeName()
- // The full type name, CamelCased.
- ccTypeName := CamelCaseSlice(typeName)
-
- usedNames := make(map[string]bool)
- for _, n := range methodNames {
- usedNames[n] = true
- }
- fieldNames := make(map[*descriptor.FieldDescriptorProto]string)
- fieldGetterNames := make(map[*descriptor.FieldDescriptorProto]string)
- fieldTypes := make(map[*descriptor.FieldDescriptorProto]string)
- mapFieldTypes := make(map[*descriptor.FieldDescriptorProto]string)
-
- oneofFieldName := make(map[int32]string) // indexed by oneof_index field of FieldDescriptorProto
- oneofDisc := make(map[int32]string) // name of discriminator method
- oneofTypeName := make(map[*descriptor.FieldDescriptorProto]string) // without star
- oneofInsertPoints := make(map[int32]int) // oneof_index => offset of g.Buffer
-
- comments := g.PrintComments(message.path)
-
- // Guarantee deprecation comments appear after user-provided comments.
- if message.GetOptions().GetDeprecated() {
- if comments {
- // Convention: Separate deprecation comments from original
- // comments with an empty line.
- g.P("//")
- }
- g.P(deprecationComment)
- }
-
- g.P("type ", Annotate(message.file, message.path, ccTypeName), " struct {")
- g.In()
-
- // allocNames finds a conflict-free variation of the given strings,
- // consistently mutating their suffixes.
- // It returns the same number of strings.
- allocNames := func(ns ...string) []string {
- Loop:
- for {
- for _, n := range ns {
- if usedNames[n] {
- for i := range ns {
- ns[i] += "_"
- }
- continue Loop
- }
- }
- for _, n := range ns {
- usedNames[n] = true
- }
- return ns
- }
- }
-
- for i, field := range message.Field {
- // Allocate the getter and the field at the same time so name
- // collisions create field/method consistent names.
- // TODO: This allocation occurs based on the order of the fields
- // in the proto file, meaning that a change in the field
- // ordering can change generated Method/Field names.
- base := CamelCase(*field.Name)
- ns := allocNames(base, "Get"+base)
- fieldName, fieldGetterName := ns[0], ns[1]
- typename, wiretype := g.GoType(message, field)
- jsonName := *field.Name
- tag := fmt.Sprintf("protobuf:%s json:%q", g.goTag(message, field, wiretype), jsonName+",omitempty")
-
- fieldNames[field] = fieldName
- fieldGetterNames[field] = fieldGetterName
-
- oneof := field.OneofIndex != nil
- if oneof && oneofFieldName[*field.OneofIndex] == "" {
- odp := message.OneofDecl[int(*field.OneofIndex)]
- fname := allocNames(CamelCase(odp.GetName()))[0]
-
- // This is the first field of a oneof we haven't seen before.
- // Generate the union field.
- oneofFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageOneofPath, *field.OneofIndex)
- com := g.PrintComments(oneofFullPath)
- if com {
- g.P("//")
- }
- g.P("// Types that are valid to be assigned to ", fname, ":")
- // Generate the rest of this comment later,
- // when we've computed any disambiguation.
- oneofInsertPoints[*field.OneofIndex] = g.Buffer.Len()
-
- dname := "is" + ccTypeName + "_" + fname
- oneofFieldName[*field.OneofIndex] = fname
- oneofDisc[*field.OneofIndex] = dname
- tag := `protobuf_oneof:"` + odp.GetName() + `"`
- g.P(Annotate(message.file, oneofFullPath, fname), " ", dname, " `", tag, "`")
- }
-
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE {
- desc := g.ObjectNamed(field.GetTypeName())
- if d, ok := desc.(*Descriptor); ok && d.GetOptions().GetMapEntry() {
- // Figure out the Go types and tags for the key and value types.
- keyField, valField := d.Field[0], d.Field[1]
- keyType, keyWire := g.GoType(d, keyField)
- valType, valWire := g.GoType(d, valField)
- keyTag, valTag := g.goTag(d, keyField, keyWire), g.goTag(d, valField, valWire)
-
- // We don't use stars, except for message-typed values.
- // Message and enum types are the only two possibly foreign types used in maps,
- // so record their use. They are not permitted as map keys.
- keyType = strings.TrimPrefix(keyType, "*")
- switch *valField.Type {
- case descriptor.FieldDescriptorProto_TYPE_ENUM:
- valType = strings.TrimPrefix(valType, "*")
- g.RecordTypeUse(valField.GetTypeName())
- case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- g.RecordTypeUse(valField.GetTypeName())
- default:
- valType = strings.TrimPrefix(valType, "*")
- }
-
- typename = fmt.Sprintf("map[%s]%s", keyType, valType)
- mapFieldTypes[field] = typename // record for the getter generation
-
- tag += fmt.Sprintf(" protobuf_key:%s protobuf_val:%s", keyTag, valTag)
- }
- }
-
- fieldTypes[field] = typename
-
- if oneof {
- tname := ccTypeName + "_" + fieldName
- // It is possible for this to collide with a message or enum
- // nested in this message. Check for collisions.
- for {
- ok := true
- for _, desc := range message.nested {
- if CamelCaseSlice(desc.TypeName()) == tname {
- ok = false
- break
- }
- }
- for _, enum := range message.enums {
- if CamelCaseSlice(enum.TypeName()) == tname {
- ok = false
- break
- }
- }
- if !ok {
- tname += "_"
- continue
- }
- break
- }
-
- oneofTypeName[field] = tname
- continue
- }
-
- fieldDeprecated := ""
- if field.GetOptions().GetDeprecated() {
- fieldDeprecated = deprecationComment
- }
-
- fieldFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i)
- g.PrintComments(fieldFullPath)
- g.P(Annotate(message.file, fieldFullPath, fieldName), "\t", typename, "\t`", tag, "`", fieldDeprecated)
- g.RecordTypeUse(field.GetTypeName())
- }
- g.P("XXX_NoUnkeyedLiteral\tstruct{} `json:\"-\"`") // prevent unkeyed struct literals
- if len(message.ExtensionRange) > 0 {
- messageset := ""
- if opts := message.Options; opts != nil && opts.GetMessageSetWireFormat() {
- messageset = "protobuf_messageset:\"1\" "
- }
- g.P(g.Pkg["proto"], ".XXX_InternalExtensions `", messageset, "json:\"-\"`")
- }
- g.P("XXX_unrecognized\t[]byte `json:\"-\"`")
- g.P("XXX_sizecache\tint32 `json:\"-\"`")
- g.Out()
- g.P("}")
-
- // Update g.Buffer to list valid oneof types.
- // We do this down here, after we've disambiguated the oneof type names.
- // We go in reverse order of insertion point to avoid invalidating offsets.
- for oi := int32(len(message.OneofDecl)); oi >= 0; oi-- {
- ip := oneofInsertPoints[oi]
- all := g.Buffer.Bytes()
- rem := all[ip:]
- g.Buffer = bytes.NewBuffer(all[:ip:ip]) // set cap so we don't scribble on rem
- oldLen := g.Buffer.Len()
- for _, field := range message.Field {
- if field.OneofIndex == nil || *field.OneofIndex != oi {
- continue
- }
- g.P("//\t*", oneofTypeName[field])
- }
- // If we've inserted text, we also need to fix up affected annotations (as
- // they contain offsets that may need to be changed).
- offset := int32(g.Buffer.Len() - oldLen)
- ip32 := int32(ip)
- for _, anno := range g.annotations {
- if *anno.Begin >= ip32 {
- *anno.Begin += offset
- }
- if *anno.End >= ip32 {
- *anno.End += offset
- }
- }
- g.Buffer.Write(rem)
- }
-
- // Reset, String and ProtoMessage methods.
- g.P("func (m *", ccTypeName, ") Reset() { *m = ", ccTypeName, "{} }")
- g.P("func (m *", ccTypeName, ") String() string { return ", g.Pkg["proto"], ".CompactTextString(m) }")
- g.P("func (*", ccTypeName, ") ProtoMessage() {}")
- var indexes []string
- for m := message; m != nil; m = m.parent {
- indexes = append([]string{strconv.Itoa(m.index)}, indexes...)
- }
- g.P("func (*", ccTypeName, ") Descriptor() ([]byte, []int) {")
- g.In()
- g.P("return ", g.file.VarName(), ", []int{", strings.Join(indexes, ", "), "}")
- g.Out()
- g.P("}")
- // TODO: Revisit the decision to use a XXX_WellKnownType method
- // if we change proto.MessageName to work with multiple equivalents.
- if message.file.GetPackage() == "google.protobuf" && wellKnownTypes[message.GetName()] {
- g.P("func (*", ccTypeName, `) XXX_WellKnownType() string { return "`, message.GetName(), `" }`)
- }
-
- // Extension support methods
- var hasExtensions, isMessageSet bool
- if len(message.ExtensionRange) > 0 {
- hasExtensions = true
- // message_set_wire_format only makes sense when extensions are defined.
- if opts := message.Options; opts != nil && opts.GetMessageSetWireFormat() {
- isMessageSet = true
- g.P()
- g.P("func (m *", ccTypeName, ") MarshalJSON() ([]byte, error) {")
- g.In()
- g.P("return ", g.Pkg["proto"], ".MarshalMessageSetJSON(&m.XXX_InternalExtensions)")
- g.Out()
- g.P("}")
- g.P("func (m *", ccTypeName, ") UnmarshalJSON(buf []byte) error {")
- g.In()
- g.P("return ", g.Pkg["proto"], ".UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions)")
- g.Out()
- g.P("}")
- }
-
- g.P()
- g.P("var extRange_", ccTypeName, " = []", g.Pkg["proto"], ".ExtensionRange{")
- g.In()
- for _, r := range message.ExtensionRange {
- end := fmt.Sprint(*r.End - 1) // make range inclusive on both ends
- g.P("{Start: ", r.Start, ", End: ", end, "},")
- }
- g.Out()
- g.P("}")
- g.P("func (*", ccTypeName, ") ExtensionRangeArray() []", g.Pkg["proto"], ".ExtensionRange {")
- g.In()
- g.P("return extRange_", ccTypeName)
- g.Out()
- g.P("}")
- }
-
- // TODO: It does not scale to keep adding another method for every
- // operation on protos that we want to switch over to using the
- // table-driven approach. Instead, we should only add a single method
- // that allows getting access to the *InternalMessageInfo struct and then
- // calling Unmarshal, Marshal, Merge, Size, and Discard directly on that.
-
- // Wrapper for table-driven marshaling and unmarshaling.
- g.P("func (m *", ccTypeName, ") XXX_Unmarshal(b []byte) error {")
- g.In()
- g.P("return xxx_messageInfo_", ccTypeName, ".Unmarshal(m, b)")
- g.Out()
- g.P("}")
-
- g.P("func (m *", ccTypeName, ") XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {")
- g.In()
- g.P("return xxx_messageInfo_", ccTypeName, ".Marshal(b, m, deterministic)")
- g.Out()
- g.P("}")
-
- g.P("func (dst *", ccTypeName, ") XXX_Merge(src ", g.Pkg["proto"], ".Message) {")
- g.In()
- g.P("xxx_messageInfo_", ccTypeName, ".Merge(dst, src)")
- g.Out()
- g.P("}")
-
- g.P("func (m *", ccTypeName, ") XXX_Size() int {") // avoid name clash with "Size" field in some message
- g.In()
- g.P("return xxx_messageInfo_", ccTypeName, ".Size(m)")
- g.Out()
- g.P("}")
-
- g.P("func (m *", ccTypeName, ") XXX_DiscardUnknown() {")
- g.In()
- g.P("xxx_messageInfo_", ccTypeName, ".DiscardUnknown(m)")
- g.Out()
- g.P("}")
-
- g.P("var xxx_messageInfo_", ccTypeName, " ", g.Pkg["proto"], ".InternalMessageInfo")
-
- // Default constants
- defNames := make(map[*descriptor.FieldDescriptorProto]string)
- for _, field := range message.Field {
- def := field.GetDefaultValue()
- if def == "" {
- continue
- }
- fieldname := "Default_" + ccTypeName + "_" + CamelCase(*field.Name)
- defNames[field] = fieldname
- typename, _ := g.GoType(message, field)
- if typename[0] == '*' {
- typename = typename[1:]
- }
- kind := "const "
- switch {
- case typename == "bool":
- case typename == "string":
- def = strconv.Quote(def)
- case typename == "[]byte":
- def = "[]byte(" + strconv.Quote(unescape(def)) + ")"
- kind = "var "
- case def == "inf", def == "-inf", def == "nan":
- // These names are known to, and defined by, the protocol language.
- switch def {
- case "inf":
- def = "math.Inf(1)"
- case "-inf":
- def = "math.Inf(-1)"
- case "nan":
- def = "math.NaN()"
- }
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_FLOAT {
- def = "float32(" + def + ")"
- }
- kind = "var "
- case *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM:
- // Must be an enum. Need to construct the prefixed name.
- obj := g.ObjectNamed(field.GetTypeName())
- var enum *EnumDescriptor
- if id, ok := obj.(*ImportedDescriptor); ok {
- // The enum type has been publicly imported.
- enum, _ = id.o.(*EnumDescriptor)
- } else {
- enum, _ = obj.(*EnumDescriptor)
- }
- if enum == nil {
- log.Printf("don't know how to generate constant for %s", fieldname)
- continue
- }
- def = g.DefaultPackageName(obj) + enum.prefix() + def
- }
- g.P(kind, fieldname, " ", typename, " = ", def)
- g.file.addExport(message, constOrVarSymbol{fieldname, kind, ""})
- }
- g.P()
-
- // Oneof per-field types, discriminants and getters.
- //
- // Generate unexported named types for the discriminant interfaces.
- // We shouldn't have to do this, but there was (~19 Aug 2015) a compiler/linker bug
- // that was triggered by using anonymous interfaces here.
- // TODO: Revisit this and consider reverting back to anonymous interfaces.
- for oi := range message.OneofDecl {
- dname := oneofDisc[int32(oi)]
- g.P("type ", dname, " interface {")
- g.In()
- g.P(dname, "()")
- g.Out()
- g.P("}")
- }
- g.P()
- var oneofTypes []string
- for i, field := range message.Field {
- if field.OneofIndex == nil {
- continue
- }
- _, wiretype := g.GoType(message, field)
- tag := "protobuf:" + g.goTag(message, field, wiretype)
- fieldFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i)
- g.P("type ", Annotate(message.file, fieldFullPath, oneofTypeName[field]), " struct{ ", Annotate(message.file, fieldFullPath, fieldNames[field]), " ", fieldTypes[field], " `", tag, "` }")
- g.RecordTypeUse(field.GetTypeName())
- oneofTypes = append(oneofTypes, oneofTypeName[field])
- }
- g.P()
- for _, field := range message.Field {
- if field.OneofIndex == nil {
- continue
- }
- g.P("func (*", oneofTypeName[field], ") ", oneofDisc[*field.OneofIndex], "() {}")
- }
- g.P()
- for oi := range message.OneofDecl {
- fname := oneofFieldName[int32(oi)]
- oneofFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageOneofPath, oi)
- g.P("func (m *", ccTypeName, ") ", Annotate(message.file, oneofFullPath, "Get"+fname), "() ", oneofDisc[int32(oi)], " {")
- g.P("if m != nil { return m.", fname, " }")
- g.P("return nil")
- g.P("}")
- }
- g.P()
-
- // Field getters
- for i, field := range message.Field {
- oneof := field.OneofIndex != nil
-
- fname := fieldNames[field]
- typename, _ := g.GoType(message, field)
- if t, ok := mapFieldTypes[field]; ok {
- typename = t
- }
- mname := fieldGetterNames[field]
- star := ""
- if needsStar(*field.Type) && typename[0] == '*' {
- typename = typename[1:]
- star = "*"
- }
- fieldFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i)
-
- if field.GetOptions().GetDeprecated() {
- g.P(deprecationComment)
- }
-
- g.P("func (m *", ccTypeName, ") ", Annotate(message.file, fieldFullPath, mname), "() "+typename+" {")
- g.In()
- def, hasDef := defNames[field]
- typeDefaultIsNil := false // whether this field type's default value is a literal nil unless specified
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_BYTES:
- typeDefaultIsNil = !hasDef
- case descriptor.FieldDescriptorProto_TYPE_GROUP, descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- typeDefaultIsNil = true
- }
- if isRepeated(field) {
- typeDefaultIsNil = true
- }
- if typeDefaultIsNil && !oneof {
- // A bytes field with no explicit default needs less generated code,
- // as does a message or group field, or a repeated field.
- g.P("if m != nil {")
- g.In()
- g.P("return m." + fname)
- g.Out()
- g.P("}")
- g.P("return nil")
- g.Out()
- g.P("}")
- g.P()
- continue
- }
- if !oneof {
- if message.proto3() {
- g.P("if m != nil {")
- } else {
- g.P("if m != nil && m." + fname + " != nil {")
- }
- g.In()
- g.P("return " + star + "m." + fname)
- g.Out()
- g.P("}")
- } else {
- uname := oneofFieldName[*field.OneofIndex]
- tname := oneofTypeName[field]
- g.P("if x, ok := m.Get", uname, "().(*", tname, "); ok {")
- g.P("return x.", fname)
- g.P("}")
- }
- if hasDef {
- if *field.Type != descriptor.FieldDescriptorProto_TYPE_BYTES {
- g.P("return " + def)
- } else {
- // The default is a []byte var.
- // Make a copy when returning it to be safe.
- g.P("return append([]byte(nil), ", def, "...)")
- }
- } else {
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- g.P("return false")
- case descriptor.FieldDescriptorProto_TYPE_STRING:
- g.P(`return ""`)
- case descriptor.FieldDescriptorProto_TYPE_GROUP,
- descriptor.FieldDescriptorProto_TYPE_MESSAGE,
- descriptor.FieldDescriptorProto_TYPE_BYTES:
- // This is only possible for oneof fields.
- g.P("return nil")
- case descriptor.FieldDescriptorProto_TYPE_ENUM:
- // The default default for an enum is the first value in the enum,
- // not zero.
- obj := g.ObjectNamed(field.GetTypeName())
- var enum *EnumDescriptor
- if id, ok := obj.(*ImportedDescriptor); ok {
- // The enum type has been publicly imported.
- enum, _ = id.o.(*EnumDescriptor)
- } else {
- enum, _ = obj.(*EnumDescriptor)
- }
- if enum == nil {
- log.Printf("don't know how to generate getter for %s", field.GetName())
- continue
- }
- if len(enum.Value) == 0 {
- g.P("return 0 // empty enum")
- } else {
- first := enum.Value[0].GetName()
- g.P("return ", g.DefaultPackageName(obj)+enum.prefix()+first)
- }
- default:
- g.P("return 0")
- }
- }
- g.Out()
- g.P("}")
- g.P()
- }
-
- if !message.group {
- ms := &messageSymbol{
- sym: ccTypeName,
- hasExtensions: hasExtensions,
- isMessageSet: isMessageSet,
- oneofTypes: oneofTypes,
- }
- g.file.addExport(message, ms)
- }
-
- // Oneof functions
- if len(message.OneofDecl) > 0 {
- fieldWire := make(map[*descriptor.FieldDescriptorProto]string)
-
- // method
- enc := "_" + ccTypeName + "_OneofMarshaler"
- dec := "_" + ccTypeName + "_OneofUnmarshaler"
- size := "_" + ccTypeName + "_OneofSizer"
- encSig := "(msg " + g.Pkg["proto"] + ".Message, b *" + g.Pkg["proto"] + ".Buffer) error"
- decSig := "(msg " + g.Pkg["proto"] + ".Message, tag, wire int, b *" + g.Pkg["proto"] + ".Buffer) (bool, error)"
- sizeSig := "(msg " + g.Pkg["proto"] + ".Message) (n int)"
-
- g.P("// XXX_OneofFuncs is for the internal use of the proto package.")
- g.P("func (*", ccTypeName, ") XXX_OneofFuncs() (func", encSig, ", func", decSig, ", func", sizeSig, ", []interface{}) {")
- g.P("return ", enc, ", ", dec, ", ", size, ", []interface{}{")
- for _, field := range message.Field {
- if field.OneofIndex == nil {
- continue
- }
- g.P("(*", oneofTypeName[field], ")(nil),")
- }
- g.P("}")
- g.P("}")
- g.P()
-
- // marshaler
- g.P("func ", enc, encSig, " {")
- g.P("m := msg.(*", ccTypeName, ")")
- for oi, odp := range message.OneofDecl {
- g.P("// ", odp.GetName())
- fname := oneofFieldName[int32(oi)]
- g.P("switch x := m.", fname, ".(type) {")
- for _, field := range message.Field {
- if field.OneofIndex == nil || int(*field.OneofIndex) != oi {
- continue
- }
- g.P("case *", oneofTypeName[field], ":")
- var wire, pre, post string
- val := "x." + fieldNames[field] // overridden for TYPE_BOOL
- canFail := false // only TYPE_MESSAGE and TYPE_GROUP can fail
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
- wire = "WireFixed64"
- pre = "b.EncodeFixed64(" + g.Pkg["math"] + ".Float64bits("
- post = "))"
- case descriptor.FieldDescriptorProto_TYPE_FLOAT:
- wire = "WireFixed32"
- pre = "b.EncodeFixed32(uint64(" + g.Pkg["math"] + ".Float32bits("
- post = ")))"
- case descriptor.FieldDescriptorProto_TYPE_INT64,
- descriptor.FieldDescriptorProto_TYPE_UINT64:
- wire = "WireVarint"
- pre, post = "b.EncodeVarint(uint64(", "))"
- case descriptor.FieldDescriptorProto_TYPE_INT32,
- descriptor.FieldDescriptorProto_TYPE_UINT32,
- descriptor.FieldDescriptorProto_TYPE_ENUM:
- wire = "WireVarint"
- pre, post = "b.EncodeVarint(uint64(", "))"
- case descriptor.FieldDescriptorProto_TYPE_FIXED64,
- descriptor.FieldDescriptorProto_TYPE_SFIXED64:
- wire = "WireFixed64"
- pre, post = "b.EncodeFixed64(uint64(", "))"
- case descriptor.FieldDescriptorProto_TYPE_FIXED32,
- descriptor.FieldDescriptorProto_TYPE_SFIXED32:
- wire = "WireFixed32"
- pre, post = "b.EncodeFixed32(uint64(", "))"
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- // bool needs special handling.
- g.P("t := uint64(0)")
- g.P("if ", val, " { t = 1 }")
- val = "t"
- wire = "WireVarint"
- pre, post = "b.EncodeVarint(", ")"
- case descriptor.FieldDescriptorProto_TYPE_STRING:
- wire = "WireBytes"
- pre, post = "b.EncodeStringBytes(", ")"
- case descriptor.FieldDescriptorProto_TYPE_GROUP:
- wire = "WireStartGroup"
- pre, post = "b.Marshal(", ")"
- canFail = true
- case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- wire = "WireBytes"
- pre, post = "b.EncodeMessage(", ")"
- canFail = true
- case descriptor.FieldDescriptorProto_TYPE_BYTES:
- wire = "WireBytes"
- pre, post = "b.EncodeRawBytes(", ")"
- case descriptor.FieldDescriptorProto_TYPE_SINT32:
- wire = "WireVarint"
- pre, post = "b.EncodeZigzag32(uint64(", "))"
- case descriptor.FieldDescriptorProto_TYPE_SINT64:
- wire = "WireVarint"
- pre, post = "b.EncodeZigzag64(uint64(", "))"
- default:
- g.Fail("unhandled oneof field type ", field.Type.String())
- }
- fieldWire[field] = wire
- g.P("b.EncodeVarint(", field.Number, "<<3|", g.Pkg["proto"], ".", wire, ")")
- if !canFail {
- g.P(pre, val, post)
- } else {
- g.P("if err := ", pre, val, post, "; err != nil {")
- g.P("return err")
- g.P("}")
- }
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {
- g.P("b.EncodeVarint(", field.Number, "<<3|", g.Pkg["proto"], ".WireEndGroup)")
- }
- }
- g.P("case nil:")
- g.P("default: return ", g.Pkg["fmt"], `.Errorf("`, ccTypeName, ".", fname, ` has unexpected type %T", x)`)
- g.P("}")
- }
- g.P("return nil")
- g.P("}")
- g.P()
-
- // unmarshaler
- g.P("func ", dec, decSig, " {")
- g.P("m := msg.(*", ccTypeName, ")")
- g.P("switch tag {")
- for _, field := range message.Field {
- if field.OneofIndex == nil {
- continue
- }
- odp := message.OneofDecl[int(*field.OneofIndex)]
- g.P("case ", field.Number, ": // ", odp.GetName(), ".", *field.Name)
- g.P("if wire != ", g.Pkg["proto"], ".", fieldWire[field], " {")
- g.P("return true, ", g.Pkg["proto"], ".ErrInternalBadWireType")
- g.P("}")
- lhs := "x, err" // overridden for TYPE_MESSAGE and TYPE_GROUP
- var dec, cast, cast2 string
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
- dec, cast = "b.DecodeFixed64()", g.Pkg["math"]+".Float64frombits"
- case descriptor.FieldDescriptorProto_TYPE_FLOAT:
- dec, cast, cast2 = "b.DecodeFixed32()", "uint32", g.Pkg["math"]+".Float32frombits"
- case descriptor.FieldDescriptorProto_TYPE_INT64:
- dec, cast = "b.DecodeVarint()", "int64"
- case descriptor.FieldDescriptorProto_TYPE_UINT64:
- dec = "b.DecodeVarint()"
- case descriptor.FieldDescriptorProto_TYPE_INT32:
- dec, cast = "b.DecodeVarint()", "int32"
- case descriptor.FieldDescriptorProto_TYPE_FIXED64:
- dec = "b.DecodeFixed64()"
- case descriptor.FieldDescriptorProto_TYPE_FIXED32:
- dec, cast = "b.DecodeFixed32()", "uint32"
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- dec = "b.DecodeVarint()"
- // handled specially below
- case descriptor.FieldDescriptorProto_TYPE_STRING:
- dec = "b.DecodeStringBytes()"
- case descriptor.FieldDescriptorProto_TYPE_GROUP:
- g.P("msg := new(", fieldTypes[field][1:], ")") // drop star
- lhs = "err"
- dec = "b.DecodeGroup(msg)"
- // handled specially below
- case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- g.P("msg := new(", fieldTypes[field][1:], ")") // drop star
- lhs = "err"
- dec = "b.DecodeMessage(msg)"
- // handled specially below
- case descriptor.FieldDescriptorProto_TYPE_BYTES:
- dec = "b.DecodeRawBytes(true)"
- case descriptor.FieldDescriptorProto_TYPE_UINT32:
- dec, cast = "b.DecodeVarint()", "uint32"
- case descriptor.FieldDescriptorProto_TYPE_ENUM:
- dec, cast = "b.DecodeVarint()", fieldTypes[field]
- case descriptor.FieldDescriptorProto_TYPE_SFIXED32:
- dec, cast = "b.DecodeFixed32()", "int32"
- case descriptor.FieldDescriptorProto_TYPE_SFIXED64:
- dec, cast = "b.DecodeFixed64()", "int64"
- case descriptor.FieldDescriptorProto_TYPE_SINT32:
- dec, cast = "b.DecodeZigzag32()", "int32"
- case descriptor.FieldDescriptorProto_TYPE_SINT64:
- dec, cast = "b.DecodeZigzag64()", "int64"
- default:
- g.Fail("unhandled oneof field type ", field.Type.String())
- }
- g.P(lhs, " := ", dec)
- val := "x"
- if cast != "" {
- val = cast + "(" + val + ")"
- }
- if cast2 != "" {
- val = cast2 + "(" + val + ")"
- }
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- val += " != 0"
- case descriptor.FieldDescriptorProto_TYPE_GROUP,
- descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- val = "msg"
- }
- g.P("m.", oneofFieldName[*field.OneofIndex], " = &", oneofTypeName[field], "{", val, "}")
- g.P("return true, err")
- }
- g.P("default: return false, nil")
- g.P("}")
- g.P("}")
- g.P()
-
- // sizer
- g.P("func ", size, sizeSig, " {")
- g.P("m := msg.(*", ccTypeName, ")")
- for oi, odp := range message.OneofDecl {
- g.P("// ", odp.GetName())
- fname := oneofFieldName[int32(oi)]
- g.P("switch x := m.", fname, ".(type) {")
- for _, field := range message.Field {
- if field.OneofIndex == nil || int(*field.OneofIndex) != oi {
- continue
- }
- g.P("case *", oneofTypeName[field], ":")
- val := "x." + fieldNames[field]
- var varint, fixed string
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
- fixed = "8"
- case descriptor.FieldDescriptorProto_TYPE_FLOAT:
- fixed = "4"
- case descriptor.FieldDescriptorProto_TYPE_INT64,
- descriptor.FieldDescriptorProto_TYPE_UINT64,
- descriptor.FieldDescriptorProto_TYPE_INT32,
- descriptor.FieldDescriptorProto_TYPE_UINT32,
- descriptor.FieldDescriptorProto_TYPE_ENUM:
- varint = val
- case descriptor.FieldDescriptorProto_TYPE_FIXED64,
- descriptor.FieldDescriptorProto_TYPE_SFIXED64:
- fixed = "8"
- case descriptor.FieldDescriptorProto_TYPE_FIXED32,
- descriptor.FieldDescriptorProto_TYPE_SFIXED32:
- fixed = "4"
- case descriptor.FieldDescriptorProto_TYPE_BOOL:
- fixed = "1"
- case descriptor.FieldDescriptorProto_TYPE_STRING:
- fixed = "len(" + val + ")"
- varint = fixed
- case descriptor.FieldDescriptorProto_TYPE_GROUP:
- fixed = g.Pkg["proto"] + ".Size(" + val + ")"
- case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
- g.P("s := ", g.Pkg["proto"], ".Size(", val, ")")
- fixed = "s"
- varint = fixed
- case descriptor.FieldDescriptorProto_TYPE_BYTES:
- fixed = "len(" + val + ")"
- varint = fixed
- case descriptor.FieldDescriptorProto_TYPE_SINT32:
- varint = "(uint32(" + val + ") << 1) ^ uint32((int32(" + val + ") >> 31))"
- case descriptor.FieldDescriptorProto_TYPE_SINT64:
- varint = "uint64(" + val + " << 1) ^ uint64((int64(" + val + ") >> 63))"
- default:
- g.Fail("unhandled oneof field type ", field.Type.String())
- }
- // Tag and wire varint is known statically,
- // so don't generate code for that part of the size computation.
- tagAndWireSize := proto.SizeVarint(uint64(*field.Number << 3)) // wire doesn't affect varint size
- g.P("n += ", tagAndWireSize, " // tag and wire")
- if varint != "" {
- g.P("n += ", g.Pkg["proto"], ".SizeVarint(uint64(", varint, "))")
- }
- if fixed != "" {
- g.P("n += ", fixed)
- }
- if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {
- g.P("n += ", tagAndWireSize, " // tag and wire")
- }
- }
- g.P("case nil:")
- g.P("default:")
- g.P("panic(", g.Pkg["fmt"], ".Sprintf(\"proto: unexpected type %T in oneof\", x))")
- g.P("}")
- }
- g.P("return n")
- g.P("}")
- g.P()
- }
-
- for _, ext := range message.ext {
- g.generateExtension(ext)
- }
-
- fullName := strings.Join(message.TypeName(), ".")
- if g.file.Package != nil {
- fullName = *g.file.Package + "." + fullName
- }
-
- g.addInitf("%s.RegisterType((*%s)(nil), %q)", g.Pkg["proto"], ccTypeName, fullName)
- // Register types for native map types.
- for _, k := range mapFieldKeys(mapFieldTypes) {
- fullName := strings.TrimPrefix(*k.TypeName, ".")
- g.addInitf("%s.RegisterMapType((%s)(nil), %q)", g.Pkg["proto"], mapFieldTypes[k], fullName)
- }
-}
-
-type byTypeName []*descriptor.FieldDescriptorProto
-
-func (a byTypeName) Len() int { return len(a) }
-func (a byTypeName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
-func (a byTypeName) Less(i, j int) bool { return *a[i].TypeName < *a[j].TypeName }
-
-// mapFieldKeys returns the keys of m in a consistent order.
-func mapFieldKeys(m map[*descriptor.FieldDescriptorProto]string) []*descriptor.FieldDescriptorProto {
- keys := make([]*descriptor.FieldDescriptorProto, 0, len(m))
- for k := range m {
- keys = append(keys, k)
- }
- sort.Sort(byTypeName(keys))
- return keys
-}
-
-var escapeChars = [256]byte{
- 'a': '\a', 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', 'v': '\v', '\\': '\\', '"': '"', '\'': '\'', '?': '?',
-}
-
-// unescape reverses the "C" escaping that protoc does for default values of bytes fields.
-// It is best effort in that it effectively ignores malformed input. Seemingly invalid escape
-// sequences are conveyed, unmodified, into the decoded result.
-func unescape(s string) string {
- // NB: Sadly, we can't use strconv.Unquote because protoc will escape both
- // single and double quotes, but strconv.Unquote only allows one or the
- // other (based on actual surrounding quotes of its input argument).
-
- var out []byte
- for len(s) > 0 {
- // regular character, or too short to be valid escape
- if s[0] != '\\' || len(s) < 2 {
- out = append(out, s[0])
- s = s[1:]
- } else if c := escapeChars[s[1]]; c != 0 {
- // escape sequence
- out = append(out, c)
- s = s[2:]
- } else if s[1] == 'x' || s[1] == 'X' {
- // hex escape, e.g. "\x80
- if len(s) < 4 {
- // too short to be valid
- out = append(out, s[:2]...)
- s = s[2:]
- continue
- }
- v, err := strconv.ParseUint(s[2:4], 16, 8)
- if err != nil {
- out = append(out, s[:4]...)
- } else {
- out = append(out, byte(v))
- }
- s = s[4:]
- } else if '0' <= s[1] && s[1] <= '7' {
- // octal escape, can vary from 1 to 3 octal digits; e.g., "\0" "\40" or "\164"
- // so consume up to 2 more bytes or up to end-of-string
- n := len(s[1:]) - len(strings.TrimLeft(s[1:], "01234567"))
- if n > 3 {
- n = 3
- }
- v, err := strconv.ParseUint(s[1:1+n], 8, 8)
- if err != nil {
- out = append(out, s[:1+n]...)
- } else {
- out = append(out, byte(v))
- }
- s = s[1+n:]
- } else {
- // bad escape, just propagate the slash as-is
- out = append(out, s[0])
- s = s[1:]
- }
- }
-
- return string(out)
-}
-
-func (g *Generator) generateExtension(ext *ExtensionDescriptor) {
- ccTypeName := ext.DescName()
-
- extObj := g.ObjectNamed(*ext.Extendee)
- var extDesc *Descriptor
- if id, ok := extObj.(*ImportedDescriptor); ok {
- // This is extending a publicly imported message.
- // We need the underlying type for goTag.
- extDesc = id.o.(*Descriptor)
- } else {
- extDesc = extObj.(*Descriptor)
- }
- extendedType := "*" + g.TypeName(extObj) // always use the original
- field := ext.FieldDescriptorProto
- fieldType, wireType := g.GoType(ext.parent, field)
- tag := g.goTag(extDesc, field, wireType)
- g.RecordTypeUse(*ext.Extendee)
- if n := ext.FieldDescriptorProto.TypeName; n != nil {
- // foreign extension type
- g.RecordTypeUse(*n)
- }
-
- typeName := ext.TypeName()
-
- // Special case for proto2 message sets: If this extension is extending
- // proto2.bridge.MessageSet, and its final name component is "message_set_extension",
- // then drop that last component.
- //
- // TODO: This should be implemented in the text formatter rather than the generator.
- // In addition, the situation for when to apply this special case is implemented
- // differently in other languages:
- // https://github.com/google/protobuf/blob/aff10976/src/google/protobuf/text_format.cc#L1560
- mset := false
- if extDesc.GetOptions().GetMessageSetWireFormat() && typeName[len(typeName)-1] == "message_set_extension" {
- typeName = typeName[:len(typeName)-1]
- mset = true
- }
-
- // For text formatting, the package must be exactly what the .proto file declares,
- // ignoring overrides such as the go_package option, and with no dot/underscore mapping.
- extName := strings.Join(typeName, ".")
- if g.file.Package != nil {
- extName = *g.file.Package + "." + extName
- }
-
- g.P("var ", ccTypeName, " = &", g.Pkg["proto"], ".ExtensionDesc{")
- g.In()
- g.P("ExtendedType: (", extendedType, ")(nil),")
- g.P("ExtensionType: (", fieldType, ")(nil),")
- g.P("Field: ", field.Number, ",")
- g.P(`Name: "`, extName, `",`)
- g.P("Tag: ", tag, ",")
- g.P(`Filename: "`, g.file.GetName(), `",`)
-
- g.Out()
- g.P("}")
- g.P()
-
- if mset {
- // Generate a bit more code to register with message_set.go.
- g.addInitf("%s.RegisterMessageSetType((%s)(nil), %d, %q)", g.Pkg["proto"], fieldType, *field.Number, extName)
- }
-
- g.file.addExport(ext, constOrVarSymbol{ccTypeName, "var", ""})
-}
-
-func (g *Generator) generateInitFunction() {
- for _, enum := range g.file.enum {
- g.generateEnumRegistration(enum)
- }
- for _, d := range g.file.desc {
- for _, ext := range d.ext {
- g.generateExtensionRegistration(ext)
- }
- }
- for _, ext := range g.file.ext {
- g.generateExtensionRegistration(ext)
- }
- if len(g.init) == 0 {
- return
- }
- g.P("func init() {")
- g.In()
- for _, l := range g.init {
- g.P(l)
- }
- g.Out()
- g.P("}")
- g.init = nil
-}
-
-func (g *Generator) generateFileDescriptor(file *FileDescriptor) {
- // Make a copy and trim source_code_info data.
- // TODO: Trim this more when we know exactly what we need.
- pb := proto.Clone(file.FileDescriptorProto).(*descriptor.FileDescriptorProto)
- pb.SourceCodeInfo = nil
-
- b, err := proto.Marshal(pb)
- if err != nil {
- g.Fail(err.Error())
- }
-
- var buf bytes.Buffer
- w, _ := gzip.NewWriterLevel(&buf, gzip.BestCompression)
- w.Write(b)
- w.Close()
- b = buf.Bytes()
-
- v := file.VarName()
- g.P()
- g.P("func init() { ", g.Pkg["proto"], ".RegisterFile(", strconv.Quote(*file.Name), ", ", v, ") }")
- g.P("var ", v, " = []byte{")
- g.In()
- g.P("// ", len(b), " bytes of a gzipped FileDescriptorProto")
- for len(b) > 0 {
- n := 16
- if n > len(b) {
- n = len(b)
- }
-
- s := ""
- for _, c := range b[:n] {
- s += fmt.Sprintf("0x%02x,", c)
- }
- g.P(s)
-
- b = b[n:]
- }
- g.Out()
- g.P("}")
-}
-
-func (g *Generator) generateEnumRegistration(enum *EnumDescriptor) {
- // // We always print the full (proto-world) package name here.
- pkg := enum.File().GetPackage()
- if pkg != "" {
- pkg += "."
- }
- // The full type name
- typeName := enum.TypeName()
- // The full type name, CamelCased.
- ccTypeName := CamelCaseSlice(typeName)
- g.addInitf("%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)", g.Pkg["proto"], pkg+ccTypeName, ccTypeName)
-}
-
-func (g *Generator) generateExtensionRegistration(ext *ExtensionDescriptor) {
- g.addInitf("%s.RegisterExtension(%s)", g.Pkg["proto"], ext.DescName())
-}
-
-// And now lots of helper functions.
-
-// Is c an ASCII lower-case letter?
-func isASCIILower(c byte) bool {
- return 'a' <= c && c <= 'z'
-}
-
-// Is c an ASCII digit?
-func isASCIIDigit(c byte) bool {
- return '0' <= c && c <= '9'
-}
-
-// CamelCase returns the CamelCased name.
-// If there is an interior underscore followed by a lower case letter,
-// drop the underscore and convert the letter to upper case.
-// There is a remote possibility of this rewrite causing a name collision,
-// but it's so remote we're prepared to pretend it's nonexistent - since the
-// C++ generator lowercases names, it's extremely unlikely to have two fields
-// with different capitalizations.
-// In short, _my_field_name_2 becomes XMyFieldName_2.
-func CamelCase(s string) string {
- if s == "" {
- return ""
- }
- t := make([]byte, 0, 32)
- i := 0
- if s[0] == '_' {
- // Need a capital letter; drop the '_'.
- t = append(t, 'X')
- i++
- }
- // Invariant: if the next letter is lower case, it must be converted
- // to upper case.
- // That is, we process a word at a time, where words are marked by _ or
- // upper case letter. Digits are treated as words.
- for ; i < len(s); i++ {
- c := s[i]
- if c == '_' && i+1 < len(s) && isASCIILower(s[i+1]) {
- continue // Skip the underscore in s.
- }
- if isASCIIDigit(c) {
- t = append(t, c)
- continue
- }
- // Assume we have a letter now - if not, it's a bogus identifier.
- // The next word is a sequence of characters that must start upper case.
- if isASCIILower(c) {
- c ^= ' ' // Make it a capital letter.
- }
- t = append(t, c) // Guaranteed not lower case.
- // Accept lower case sequence that follows.
- for i+1 < len(s) && isASCIILower(s[i+1]) {
- i++
- t = append(t, s[i])
- }
- }
- return string(t)
-}
-
-// CamelCaseSlice is like CamelCase, but the argument is a slice of strings to
-// be joined with "_".
-func CamelCaseSlice(elem []string) string { return CamelCase(strings.Join(elem, "_")) }
-
-// dottedSlice turns a sliced name into a dotted name.
-func dottedSlice(elem []string) string { return strings.Join(elem, ".") }
-
-// Is this field optional?
-func isOptional(field *descriptor.FieldDescriptorProto) bool {
- return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_OPTIONAL
-}
-
-// Is this field required?
-func isRequired(field *descriptor.FieldDescriptorProto) bool {
- return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REQUIRED
-}
-
-// Is this field repeated?
-func isRepeated(field *descriptor.FieldDescriptorProto) bool {
- return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED
-}
-
-// Is this field a scalar numeric type?
-func isScalar(field *descriptor.FieldDescriptorProto) bool {
- if field.Type == nil {
- return false
- }
- switch *field.Type {
- case descriptor.FieldDescriptorProto_TYPE_DOUBLE,
- descriptor.FieldDescriptorProto_TYPE_FLOAT,
- descriptor.FieldDescriptorProto_TYPE_INT64,
- descriptor.FieldDescriptorProto_TYPE_UINT64,
- descriptor.FieldDescriptorProto_TYPE_INT32,
- descriptor.FieldDescriptorProto_TYPE_FIXED64,
- descriptor.FieldDescriptorProto_TYPE_FIXED32,
- descriptor.FieldDescriptorProto_TYPE_BOOL,
- descriptor.FieldDescriptorProto_TYPE_UINT32,
- descriptor.FieldDescriptorProto_TYPE_ENUM,
- descriptor.FieldDescriptorProto_TYPE_SFIXED32,
- descriptor.FieldDescriptorProto_TYPE_SFIXED64,
- descriptor.FieldDescriptorProto_TYPE_SINT32,
- descriptor.FieldDescriptorProto_TYPE_SINT64:
- return true
- default:
- return false
- }
-}
-
-// badToUnderscore is the mapping function used to generate Go names from package names,
-// which can be dotted in the input .proto file. It replaces non-identifier characters such as
-// dot or dash with underscore.
-func badToUnderscore(r rune) rune {
- if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' {
- return r
- }
- return '_'
-}
-
-// baseName returns the last path element of the name, with the last dotted suffix removed.
-func baseName(name string) string {
- // First, find the last element
- if i := strings.LastIndex(name, "/"); i >= 0 {
- name = name[i+1:]
- }
- // Now drop the suffix
- if i := strings.LastIndex(name, "."); i >= 0 {
- name = name[0:i]
- }
- return name
-}
-
-// The SourceCodeInfo message describes the location of elements of a parsed
-// .proto file by way of a "path", which is a sequence of integers that
-// describe the route from a FileDescriptorProto to the relevant submessage.
-// The path alternates between a field number of a repeated field, and an index
-// into that repeated field. The constants below define the field numbers that
-// are used.
-//
-// See descriptor.proto for more information about this.
-const (
- // tag numbers in FileDescriptorProto
- packagePath = 2 // package
- messagePath = 4 // message_type
- enumPath = 5 // enum_type
- // tag numbers in DescriptorProto
- messageFieldPath = 2 // field
- messageMessagePath = 3 // nested_type
- messageEnumPath = 4 // enum_type
- messageOneofPath = 8 // oneof_decl
- // tag numbers in EnumDescriptorProto
- enumValuePath = 2 // value
-)
-
-var supportTypeAliases bool
-
-func init() {
- for _, tag := range build.Default.ReleaseTags {
- if tag == "go1.9" {
- supportTypeAliases = true
- return
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
deleted file mode 100644
index a9b61036..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
+++ /dev/null
@@ -1,117 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2017 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.
-
-/*
-Package remap handles tracking the locations of Go tokens in a source text
-across a rewrite by the Go formatter.
-*/
-package remap
-
-import (
- "fmt"
- "go/scanner"
- "go/token"
-)
-
-// A Location represents a span of byte offsets in the source text.
-type Location struct {
- Pos, End int // End is exclusive
-}
-
-// A Map represents a mapping between token locations in an input source text
-// and locations in the correspnding output text.
-type Map map[Location]Location
-
-// Find reports whether the specified span is recorded by m, and if so returns
-// the new location it was mapped to. If the input span was not found, the
-// returned location is the same as the input.
-func (m Map) Find(pos, end int) (Location, bool) {
- key := Location{
- Pos: pos,
- End: end,
- }
- if loc, ok := m[key]; ok {
- return loc, true
- }
- return key, false
-}
-
-func (m Map) add(opos, oend, npos, nend int) {
- m[Location{Pos: opos, End: oend}] = Location{Pos: npos, End: nend}
-}
-
-// Compute constructs a location mapping from input to output. An error is
-// reported if any of the tokens of output cannot be mapped.
-func Compute(input, output []byte) (Map, error) {
- itok := tokenize(input)
- otok := tokenize(output)
- if len(itok) != len(otok) {
- return nil, fmt.Errorf("wrong number of tokens, %d ≠ %d", len(itok), len(otok))
- }
- m := make(Map)
- for i, ti := range itok {
- to := otok[i]
- if ti.Token != to.Token {
- return nil, fmt.Errorf("token %d type mismatch: %s ≠ %s", i+1, ti, to)
- }
- m.add(ti.pos, ti.end, to.pos, to.end)
- }
- return m, nil
-}
-
-// tokinfo records the span and type of a source token.
-type tokinfo struct {
- pos, end int
- token.Token
-}
-
-func tokenize(src []byte) []tokinfo {
- fs := token.NewFileSet()
- var s scanner.Scanner
- s.Init(fs.AddFile("src", fs.Base(), len(src)), src, nil, scanner.ScanComments)
- var info []tokinfo
- for {
- pos, next, lit := s.Scan()
- switch next {
- case token.SEMICOLON:
- continue
- }
- info = append(info, tokinfo{
- pos: int(pos - 1),
- end: int(pos + token.Pos(len(lit)) - 1),
- Token: next,
- })
- if next == token.EOF {
- break
- }
- }
- return info
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap_test.go
deleted file mode 100644
index ccc7fca0..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap_test.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2017 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.
-
-package remap
-
-import (
- "go/format"
- "testing"
-)
-
-func TestErrors(t *testing.T) {
- tests := []struct {
- in, out string
- }{
- {"", "x"},
- {"x", ""},
- {"var x int = 5\n", "var x = 5\n"},
- {"these are \"one\" thing", "those are 'another' thing"},
- }
- for _, test := range tests {
- m, err := Compute([]byte(test.in), []byte(test.out))
- if err != nil {
- t.Logf("Got expected error: %v", err)
- continue
- }
- t.Errorf("Compute(%q, %q): got %+v, wanted error", test.in, test.out, m)
- }
-}
-
-func TestMatching(t *testing.T) {
- // The input is a source text that will be rearranged by the formatter.
- const input = `package foo
-var s int
-func main(){}
-`
-
- output, err := format.Source([]byte(input))
- if err != nil {
- t.Fatalf("Formatting failed: %v", err)
- }
- m, err := Compute([]byte(input), output)
- if err != nil {
- t.Fatalf("Unexpected error: %v", err)
- }
-
- // Verify that the mapped locations have the same text.
- for key, val := range m {
- want := input[key.Pos:key.End]
- got := string(output[val.Pos:val.End])
- if got != want {
- t.Errorf("Token at %d:%d: got %q, want %q", key.Pos, key.End, got, want)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go
deleted file mode 100644
index 571147cf..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2013 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.
-
-package generator
-
-import (
- "testing"
-
- "github.com/golang/protobuf/protoc-gen-go/descriptor"
-)
-
-func TestCamelCase(t *testing.T) {
- tests := []struct {
- in, want string
- }{
- {"one", "One"},
- {"one_two", "OneTwo"},
- {"_my_field_name_2", "XMyFieldName_2"},
- {"Something_Capped", "Something_Capped"},
- {"my_Name", "My_Name"},
- {"OneTwo", "OneTwo"},
- {"_", "X"},
- {"_a_", "XA_"},
- }
- for _, tc := range tests {
- if got := CamelCase(tc.in); got != tc.want {
- t.Errorf("CamelCase(%q) = %q, want %q", tc.in, got, tc.want)
- }
- }
-}
-
-func TestGoPackageOption(t *testing.T) {
- tests := []struct {
- in string
- impPath GoImportPath
- pkg GoPackageName
- ok bool
- }{
- {"", "", "", false},
- {"foo", "", "foo", true},
- {"github.com/golang/bar", "github.com/golang/bar", "bar", true},
- {"github.com/golang/bar;baz", "github.com/golang/bar", "baz", true},
- }
- for _, tc := range tests {
- d := &FileDescriptor{
- FileDescriptorProto: &descriptor.FileDescriptorProto{
- Options: &descriptor.FileOptions{
- GoPackage: &tc.in,
- },
- },
- }
- impPath, pkg, ok := d.goPackageOption()
- if impPath != tc.impPath || pkg != tc.pkg || ok != tc.ok {
- t.Errorf("go_package = %q => (%q, %q, %t), want (%q, %q, %t)", tc.in,
- impPath, pkg, ok, tc.impPath, tc.pkg, tc.ok)
- }
- }
-}
-
-func TestUnescape(t *testing.T) {
- tests := []struct {
- in string
- out string
- }{
- // successful cases, including all kinds of escapes
- {"", ""},
- {"foo bar baz frob nitz", "foo bar baz frob nitz"},
- {`\000\001\002\003\004\005\006\007`, string([]byte{0, 1, 2, 3, 4, 5, 6, 7})},
- {`\a\b\f\n\r\t\v\\\?\'\"`, string([]byte{'\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '?', '\'', '"'})},
- {`\x10\x20\x30\x40\x50\x60\x70\x80`, string([]byte{16, 32, 48, 64, 80, 96, 112, 128})},
- // variable length octal escapes
- {`\0\018\222\377\3\04\005\6\07`, string([]byte{0, 1, '8', 0222, 255, 3, 4, 5, 6, 7})},
- // malformed escape sequences left as is
- {"foo \\g bar", "foo \\g bar"},
- {"foo \\xg0 bar", "foo \\xg0 bar"},
- {"\\", "\\"},
- {"\\x", "\\x"},
- {"\\xf", "\\xf"},
- {"\\777", "\\777"}, // overflows byte
- }
- for _, tc := range tests {
- s := unescape(tc.in)
- if s != tc.out {
- t.Errorf("doUnescape(%q) = %q; should have been %q", tc.in, s, tc.out)
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/golden_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/golden_test.go
deleted file mode 100644
index 2630de68..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/golden_test.go
+++ /dev/null
@@ -1,422 +0,0 @@
-package main
-
-import (
- "bytes"
- "flag"
- "fmt"
- "go/build"
- "go/parser"
- "go/token"
- "io/ioutil"
- "os"
- "os/exec"
- "path/filepath"
- "regexp"
- "runtime"
- "strings"
- "testing"
-)
-
-// Set --regenerate to regenerate the golden files.
-var regenerate = flag.Bool("regenerate", false, "regenerate golden files")
-
-// When the environment variable RUN_AS_PROTOC_GEN_GO is set, we skip running
-// tests and instead act as protoc-gen-go. This allows the test binary to
-// pass itself to protoc.
-func init() {
- if os.Getenv("RUN_AS_PROTOC_GEN_GO") != "" {
- main()
- os.Exit(0)
- }
-}
-
-func TestGolden(t *testing.T) {
- workdir, err := ioutil.TempDir("", "proto-test")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(workdir)
-
- // Find all the proto files we need to compile. We assume that each directory
- // contains the files for a single package.
- supportTypeAliases := hasReleaseTag("go1.9")
- packages := map[string][]string{}
- err = filepath.Walk("testdata", func(path string, info os.FileInfo, err error) error {
- if filepath.Base(path) == "import_public" && !supportTypeAliases {
- // Public imports require type alias support.
- return filepath.SkipDir
- }
- if !strings.HasSuffix(path, ".proto") {
- return nil
- }
- dir := filepath.Dir(path)
- packages[dir] = append(packages[dir], path)
- return nil
- })
- if err != nil {
- t.Fatal(err)
- }
-
- // Compile each package, using this binary as protoc-gen-go.
- for _, sources := range packages {
- args := []string{"-Itestdata", "--go_out=plugins=grpc,paths=source_relative:" + workdir}
- args = append(args, sources...)
- protoc(t, args)
- }
-
- // Compare each generated file to the golden version.
- filepath.Walk(workdir, func(genPath string, info os.FileInfo, _ error) error {
- if info.IsDir() {
- return nil
- }
-
- // For each generated file, figure out the path to the corresponding
- // golden file in the testdata directory.
- relPath, err := filepath.Rel(workdir, genPath)
- if err != nil {
- t.Errorf("filepath.Rel(%q, %q): %v", workdir, genPath, err)
- return nil
- }
- if filepath.SplitList(relPath)[0] == ".." {
- t.Errorf("generated file %q is not relative to %q", genPath, workdir)
- }
- goldenPath := filepath.Join("testdata", relPath)
-
- got, err := ioutil.ReadFile(genPath)
- if err != nil {
- t.Error(err)
- return nil
- }
- if *regenerate {
- // If --regenerate set, just rewrite the golden files.
- err := ioutil.WriteFile(goldenPath, got, 0666)
- if err != nil {
- t.Error(err)
- }
- return nil
- }
-
- want, err := ioutil.ReadFile(goldenPath)
- if err != nil {
- t.Error(err)
- return nil
- }
-
- want = fdescRE.ReplaceAll(want, nil)
- got = fdescRE.ReplaceAll(got, nil)
- if bytes.Equal(got, want) {
- return nil
- }
-
- cmd := exec.Command("diff", "-u", goldenPath, genPath)
- out, _ := cmd.CombinedOutput()
- t.Errorf("golden file differs: %v\n%v", relPath, string(out))
- return nil
- })
-}
-
-var fdescRE = regexp.MustCompile(`(?ms)^var fileDescriptor.*}`)
-
-// Source files used by TestParameters.
-const (
- aProto = `
-syntax = "proto3";
-package test.alpha;
-option go_package = "package/alpha";
-import "beta/b.proto";
-message M { test.beta.M field = 1; }`
-
- bProto = `
-syntax = "proto3";
-package test.beta;
-// no go_package option
-message M {}`
-)
-
-func TestParameters(t *testing.T) {
- for _, test := range []struct {
- parameters string
- wantFiles map[string]bool
- wantImportsA map[string]bool
- wantPackageA string
- wantPackageB string
- }{{
- parameters: "",
- wantFiles: map[string]bool{
- "package/alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- wantPackageA: "alpha",
- wantPackageB: "test_beta",
- wantImportsA: map[string]bool{
- "github.com/golang/protobuf/proto": true,
- "beta": true,
- },
- }, {
- parameters: "import_prefix=prefix",
- wantFiles: map[string]bool{
- "package/alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- wantPackageA: "alpha",
- wantPackageB: "test_beta",
- wantImportsA: map[string]bool{
- // This really doesn't seem like useful behavior.
- "prefixgithub.com/golang/protobuf/proto": true,
- "prefixbeta": true,
- },
- }, {
- // import_path only affects the 'package' line.
- parameters: "import_path=import/path/of/pkg",
- wantPackageA: "alpha",
- wantPackageB: "pkg",
- wantFiles: map[string]bool{
- "package/alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- }, {
- parameters: "Mbeta/b.proto=package/gamma",
- wantFiles: map[string]bool{
- "package/alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- wantPackageA: "alpha",
- wantPackageB: "test_beta",
- wantImportsA: map[string]bool{
- "github.com/golang/protobuf/proto": true,
- // Rewritten by the M parameter.
- "package/gamma": true,
- },
- }, {
- parameters: "import_prefix=prefix,Mbeta/b.proto=package/gamma",
- wantFiles: map[string]bool{
- "package/alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- wantPackageA: "alpha",
- wantPackageB: "test_beta",
- wantImportsA: map[string]bool{
- // import_prefix applies after M.
- "prefixpackage/gamma": true,
- },
- }, {
- parameters: "paths=source_relative",
- wantFiles: map[string]bool{
- "alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- wantPackageA: "alpha",
- wantPackageB: "test_beta",
- }, {
- parameters: "paths=source_relative,import_prefix=prefix",
- wantFiles: map[string]bool{
- // import_prefix doesn't affect filenames.
- "alpha/a.pb.go": true,
- "beta/b.pb.go": true,
- },
- wantPackageA: "alpha",
- wantPackageB: "test_beta",
- }} {
- name := test.parameters
- if name == "" {
- name = "defaults"
- }
- // TODO: Switch to t.Run when we no longer support Go 1.6.
- t.Logf("TEST: %v", name)
- workdir, err := ioutil.TempDir("", "proto-test")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(workdir)
-
- for _, dir := range []string{"alpha", "beta", "out"} {
- if err := os.MkdirAll(filepath.Join(workdir, dir), 0777); err != nil {
- t.Fatal(err)
- }
- }
-
- if err := ioutil.WriteFile(filepath.Join(workdir, "alpha", "a.proto"), []byte(aProto), 0666); err != nil {
- t.Fatal(err)
- }
-
- if err := ioutil.WriteFile(filepath.Join(workdir, "beta", "b.proto"), []byte(bProto), 0666); err != nil {
- t.Fatal(err)
- }
-
- protoc(t, []string{
- "-I" + workdir,
- "--go_out=" + test.parameters + ":" + filepath.Join(workdir, "out"),
- filepath.Join(workdir, "alpha", "a.proto"),
- })
- protoc(t, []string{
- "-I" + workdir,
- "--go_out=" + test.parameters + ":" + filepath.Join(workdir, "out"),
- filepath.Join(workdir, "beta", "b.proto"),
- })
-
- contents := make(map[string]string)
- gotFiles := make(map[string]bool)
- outdir := filepath.Join(workdir, "out")
- filepath.Walk(outdir, func(p string, info os.FileInfo, _ error) error {
- if info.IsDir() {
- return nil
- }
- base := filepath.Base(p)
- if base == "a.pb.go" || base == "b.pb.go" {
- b, err := ioutil.ReadFile(p)
- if err != nil {
- t.Fatal(err)
- }
- contents[base] = string(b)
- }
- relPath, _ := filepath.Rel(outdir, p)
- gotFiles[relPath] = true
- return nil
- })
- for got := range gotFiles {
- if runtime.GOOS == "windows" {
- got = filepath.ToSlash(got)
- }
- if !test.wantFiles[got] {
- t.Errorf("unexpected output file: %v", got)
- }
- }
- for want := range test.wantFiles {
- if runtime.GOOS == "windows" {
- want = filepath.FromSlash(want)
- }
- if !gotFiles[want] {
- t.Errorf("missing output file: %v", want)
- }
- }
- gotPackageA, gotImports, err := parseFile(contents["a.pb.go"])
- if err != nil {
- t.Fatal(err)
- }
- gotPackageB, _, err := parseFile(contents["b.pb.go"])
- if err != nil {
- t.Fatal(err)
- }
- if got, want := gotPackageA, test.wantPackageA; want != got {
- t.Errorf("output file a.pb.go is package %q, want %q", got, want)
- }
- if got, want := gotPackageB, test.wantPackageB; want != got {
- t.Errorf("output file b.pb.go is package %q, want %q", got, want)
- }
- missingImport := false
- WantImport:
- for want := range test.wantImportsA {
- for _, imp := range gotImports {
- if `"`+want+`"` == imp {
- continue WantImport
- }
- }
- t.Errorf("output file a.pb.go does not contain expected import %q", want)
- missingImport = true
- }
- if missingImport {
- t.Error("got imports:")
- for _, imp := range gotImports {
- t.Errorf(" %v", imp)
- }
- }
- }
-}
-
-func TestPackageComment(t *testing.T) {
- workdir, err := ioutil.TempDir("", "proto-test")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(workdir)
-
- var packageRE = regexp.MustCompile(`(?m)^package .*`)
-
- for i, test := range []struct {
- goPackageOption string
- wantPackage string
- }{{
- goPackageOption: ``,
- wantPackage: `package proto_package`,
- }, {
- goPackageOption: `option go_package = "go_package";`,
- wantPackage: `package go_package`,
- }, {
- goPackageOption: `option go_package = "import/path/of/go_package";`,
- wantPackage: `package go_package // import "import/path/of/go_package"`,
- }, {
- goPackageOption: `option go_package = "import/path/of/something;go_package";`,
- wantPackage: `package go_package // import "import/path/of/something"`,
- }, {
- goPackageOption: `option go_package = "import_path;go_package";`,
- wantPackage: `package go_package // import "import_path"`,
- }} {
- srcName := filepath.Join(workdir, fmt.Sprintf("%d.proto", i))
- tgtName := filepath.Join(workdir, fmt.Sprintf("%d.pb.go", i))
-
- buf := &bytes.Buffer{}
- fmt.Fprintln(buf, `syntax = "proto3";`)
- fmt.Fprintln(buf, `package proto_package;`)
- fmt.Fprintln(buf, test.goPackageOption)
- if err := ioutil.WriteFile(srcName, buf.Bytes(), 0666); err != nil {
- t.Fatal(err)
- }
-
- protoc(t, []string{"-I" + workdir, "--go_out=paths=source_relative:" + workdir, srcName})
-
- out, err := ioutil.ReadFile(tgtName)
- if err != nil {
- t.Fatal(err)
- }
-
- pkg := packageRE.Find(out)
- if pkg == nil {
- t.Errorf("generated .pb.go contains no package line\n\nsource:\n%v\n\noutput:\n%v", buf.String(), string(out))
- continue
- }
-
- if got, want := string(pkg), test.wantPackage; got != want {
- t.Errorf("unexpected package statement with go_package = %q\n got: %v\nwant: %v", test.goPackageOption, got, want)
- }
- }
-}
-
-// parseFile returns a file's package name and a list of all packages it imports.
-func parseFile(source string) (packageName string, imports []string, err error) {
- fset := token.NewFileSet()
- f, err := parser.ParseFile(fset, "", source, parser.ImportsOnly)
- if err != nil {
- return "", nil, err
- }
- for _, imp := range f.Imports {
- imports = append(imports, imp.Path.Value)
- }
- return f.Name.Name, imports, nil
-}
-
-func protoc(t *testing.T, args []string) {
- cmd := exec.Command("protoc", "--plugin=protoc-gen-go="+os.Args[0])
- cmd.Args = append(cmd.Args, args...)
- // We set the RUN_AS_PROTOC_GEN_GO environment variable to indicate that
- // the subprocess should act as a proto compiler rather than a test.
- cmd.Env = append(os.Environ(), "RUN_AS_PROTOC_GEN_GO=1")
- out, err := cmd.CombinedOutput()
- if len(out) > 0 || err != nil {
- t.Log("RUNNING: ", strings.Join(cmd.Args, " "))
- }
- if len(out) > 0 {
- t.Log(string(out))
- }
- if err != nil {
- t.Fatalf("protoc: %v", err)
- }
-}
-
-func hasReleaseTag(want string) bool {
- for _, tag := range build.Default.ReleaseTags {
- if tag == want {
- return true
- }
- }
- return false
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/grpc/grpc.go b/vendor/github.com/golang/protobuf/protoc-gen-go/grpc/grpc.go
deleted file mode 100644
index 1723680a..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/grpc/grpc.go
+++ /dev/null
@@ -1,483 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 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.
-
-// Package grpc outputs gRPC service descriptions in Go code.
-// It runs as a plugin for the Go protocol buffer compiler plugin.
-// It is linked in to protoc-gen-go.
-package grpc
-
-import (
- "fmt"
- "path"
- "strconv"
- "strings"
-
- pb "github.com/golang/protobuf/protoc-gen-go/descriptor"
- "github.com/golang/protobuf/protoc-gen-go/generator"
-)
-
-// generatedCodeVersion indicates a version of the generated code.
-// It is incremented whenever an incompatibility between the generated code and
-// the grpc package is introduced; the generated code references
-// a constant, grpc.SupportPackageIsVersionN (where N is generatedCodeVersion).
-const generatedCodeVersion = 4
-
-// Paths for packages used by code generated in this file,
-// relative to the import_prefix of the generator.Generator.
-const (
- contextPkgPath = "golang.org/x/net/context"
- grpcPkgPath = "google.golang.org/grpc"
-)
-
-func init() {
- generator.RegisterPlugin(new(grpc))
-}
-
-// grpc is an implementation of the Go protocol buffer compiler's
-// plugin architecture. It generates bindings for gRPC support.
-type grpc struct {
- gen *generator.Generator
-}
-
-// Name returns the name of this plugin, "grpc".
-func (g *grpc) Name() string {
- return "grpc"
-}
-
-// The names for packages imported in the generated code.
-// They may vary from the final path component of the import path
-// if the name is used by other packages.
-var (
- contextPkg string
- grpcPkg string
-)
-
-// Init initializes the plugin.
-func (g *grpc) Init(gen *generator.Generator) {
- g.gen = gen
- contextPkg = generator.RegisterUniquePackageName("context", nil)
- grpcPkg = generator.RegisterUniquePackageName("grpc", nil)
-}
-
-// Given a type name defined in a .proto, return its object.
-// Also record that we're using it, to guarantee the associated import.
-func (g *grpc) objectNamed(name string) generator.Object {
- g.gen.RecordTypeUse(name)
- return g.gen.ObjectNamed(name)
-}
-
-// Given a type name defined in a .proto, return its name as we will print it.
-func (g *grpc) typeName(str string) string {
- return g.gen.TypeName(g.objectNamed(str))
-}
-
-// P forwards to g.gen.P.
-func (g *grpc) P(args ...interface{}) { g.gen.P(args...) }
-
-// Generate generates code for the services in the given file.
-func (g *grpc) Generate(file *generator.FileDescriptor) {
- if len(file.FileDescriptorProto.Service) == 0 {
- return
- }
-
- g.P("// Reference imports to suppress errors if they are not otherwise used.")
- g.P("var _ ", contextPkg, ".Context")
- g.P("var _ ", grpcPkg, ".ClientConn")
- g.P()
-
- // Assert version compatibility.
- g.P("// This is a compile-time assertion to ensure that this generated file")
- g.P("// is compatible with the grpc package it is being compiled against.")
- g.P("const _ = ", grpcPkg, ".SupportPackageIsVersion", generatedCodeVersion)
- g.P()
-
- for i, service := range file.FileDescriptorProto.Service {
- g.generateService(file, service, i)
- }
-}
-
-// GenerateImports generates the import declaration for this file.
-func (g *grpc) GenerateImports(file *generator.FileDescriptor) {
- if len(file.FileDescriptorProto.Service) == 0 {
- return
- }
- g.P("import (")
- g.P(contextPkg, " ", generator.GoImportPath(path.Join(string(g.gen.ImportPrefix), contextPkgPath)))
- g.P(grpcPkg, " ", generator.GoImportPath(path.Join(string(g.gen.ImportPrefix), grpcPkgPath)))
- g.P(")")
- g.P()
-}
-
-// reservedClientName records whether a client name is reserved on the client side.
-var reservedClientName = map[string]bool{
- // TODO: do we need any in gRPC?
-}
-
-func unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] }
-
-// deprecationComment is the standard comment added to deprecated
-// messages, fields, enums, and enum values.
-var deprecationComment = "// Deprecated: Do not use."
-
-// generateService generates all the code for the named service.
-func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.ServiceDescriptorProto, index int) {
- path := fmt.Sprintf("6,%d", index) // 6 means service.
-
- origServName := service.GetName()
- fullServName := origServName
- if pkg := file.GetPackage(); pkg != "" {
- fullServName = pkg + "." + fullServName
- }
- servName := generator.CamelCase(origServName)
- deprecated := service.GetOptions().GetDeprecated()
-
- g.P()
- g.P("// Client API for ", servName, " service")
- g.P()
-
- // Client interface.
- if deprecated {
- g.P(deprecationComment)
- }
- g.P("type ", servName, "Client interface {")
- for i, method := range service.Method {
- g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
- g.P(g.generateClientSignature(servName, method))
- }
- g.P("}")
- g.P()
-
- // Client structure.
- g.P("type ", unexport(servName), "Client struct {")
- g.P("cc *", grpcPkg, ".ClientConn")
- g.P("}")
- g.P()
-
- // NewClient factory.
- if deprecated {
- g.P(deprecationComment)
- }
- g.P("func New", servName, "Client (cc *", grpcPkg, ".ClientConn) ", servName, "Client {")
- g.P("return &", unexport(servName), "Client{cc}")
- g.P("}")
- g.P()
-
- var methodIndex, streamIndex int
- serviceDescVar := "_" + servName + "_serviceDesc"
- // Client method implementations.
- for _, method := range service.Method {
- var descExpr string
- if !method.GetServerStreaming() && !method.GetClientStreaming() {
- // Unary RPC method
- descExpr = fmt.Sprintf("&%s.Methods[%d]", serviceDescVar, methodIndex)
- methodIndex++
- } else {
- // Streaming RPC method
- descExpr = fmt.Sprintf("&%s.Streams[%d]", serviceDescVar, streamIndex)
- streamIndex++
- }
- g.generateClientMethod(servName, fullServName, serviceDescVar, method, descExpr)
- }
-
- g.P("// Server API for ", servName, " service")
- g.P()
-
- // Server interface.
- if deprecated {
- g.P(deprecationComment)
- }
- serverType := servName + "Server"
- g.P("type ", serverType, " interface {")
- for i, method := range service.Method {
- g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
- g.P(g.generateServerSignature(servName, method))
- }
- g.P("}")
- g.P()
-
- // Server registration.
- if deprecated {
- g.P(deprecationComment)
- }
- g.P("func Register", servName, "Server(s *", grpcPkg, ".Server, srv ", serverType, ") {")
- g.P("s.RegisterService(&", serviceDescVar, `, srv)`)
- g.P("}")
- g.P()
-
- // Server handler implementations.
- var handlerNames []string
- for _, method := range service.Method {
- hname := g.generateServerMethod(servName, fullServName, method)
- handlerNames = append(handlerNames, hname)
- }
-
- // Service descriptor.
- g.P("var ", serviceDescVar, " = ", grpcPkg, ".ServiceDesc {")
- g.P("ServiceName: ", strconv.Quote(fullServName), ",")
- g.P("HandlerType: (*", serverType, ")(nil),")
- g.P("Methods: []", grpcPkg, ".MethodDesc{")
- for i, method := range service.Method {
- if method.GetServerStreaming() || method.GetClientStreaming() {
- continue
- }
- g.P("{")
- g.P("MethodName: ", strconv.Quote(method.GetName()), ",")
- g.P("Handler: ", handlerNames[i], ",")
- g.P("},")
- }
- g.P("},")
- g.P("Streams: []", grpcPkg, ".StreamDesc{")
- for i, method := range service.Method {
- if !method.GetServerStreaming() && !method.GetClientStreaming() {
- continue
- }
- g.P("{")
- g.P("StreamName: ", strconv.Quote(method.GetName()), ",")
- g.P("Handler: ", handlerNames[i], ",")
- if method.GetServerStreaming() {
- g.P("ServerStreams: true,")
- }
- if method.GetClientStreaming() {
- g.P("ClientStreams: true,")
- }
- g.P("},")
- }
- g.P("},")
- g.P("Metadata: \"", file.GetName(), "\",")
- g.P("}")
- g.P()
-}
-
-// generateClientSignature returns the client-side signature for a method.
-func (g *grpc) generateClientSignature(servName string, method *pb.MethodDescriptorProto) string {
- origMethName := method.GetName()
- methName := generator.CamelCase(origMethName)
- if reservedClientName[methName] {
- methName += "_"
- }
- reqArg := ", in *" + g.typeName(method.GetInputType())
- if method.GetClientStreaming() {
- reqArg = ""
- }
- respName := "*" + g.typeName(method.GetOutputType())
- if method.GetServerStreaming() || method.GetClientStreaming() {
- respName = servName + "_" + generator.CamelCase(origMethName) + "Client"
- }
- return fmt.Sprintf("%s(ctx %s.Context%s, opts ...%s.CallOption) (%s, error)", methName, contextPkg, reqArg, grpcPkg, respName)
-}
-
-func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar string, method *pb.MethodDescriptorProto, descExpr string) {
- sname := fmt.Sprintf("/%s/%s", fullServName, method.GetName())
- methName := generator.CamelCase(method.GetName())
- inType := g.typeName(method.GetInputType())
- outType := g.typeName(method.GetOutputType())
-
- if method.GetOptions().GetDeprecated() {
- g.P(deprecationComment)
- }
- g.P("func (c *", unexport(servName), "Client) ", g.generateClientSignature(servName, method), "{")
- if !method.GetServerStreaming() && !method.GetClientStreaming() {
- g.P("out := new(", outType, ")")
- // TODO: Pass descExpr to Invoke.
- g.P("err := ", grpcPkg, `.Invoke(ctx, "`, sname, `", in, out, c.cc, opts...)`)
- g.P("if err != nil { return nil, err }")
- g.P("return out, nil")
- g.P("}")
- g.P()
- return
- }
- streamType := unexport(servName) + methName + "Client"
- g.P("stream, err := ", grpcPkg, ".NewClientStream(ctx, ", descExpr, `, c.cc, "`, sname, `", opts...)`)
- g.P("if err != nil { return nil, err }")
- g.P("x := &", streamType, "{stream}")
- if !method.GetClientStreaming() {
- g.P("if err := x.ClientStream.SendMsg(in); err != nil { return nil, err }")
- g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }")
- }
- g.P("return x, nil")
- g.P("}")
- g.P()
-
- genSend := method.GetClientStreaming()
- genRecv := method.GetServerStreaming()
- genCloseAndRecv := !method.GetServerStreaming()
-
- // Stream auxiliary types and methods.
- g.P("type ", servName, "_", methName, "Client interface {")
- if genSend {
- g.P("Send(*", inType, ") error")
- }
- if genRecv {
- g.P("Recv() (*", outType, ", error)")
- }
- if genCloseAndRecv {
- g.P("CloseAndRecv() (*", outType, ", error)")
- }
- g.P(grpcPkg, ".ClientStream")
- g.P("}")
- g.P()
-
- g.P("type ", streamType, " struct {")
- g.P(grpcPkg, ".ClientStream")
- g.P("}")
- g.P()
-
- if genSend {
- g.P("func (x *", streamType, ") Send(m *", inType, ") error {")
- g.P("return x.ClientStream.SendMsg(m)")
- g.P("}")
- g.P()
- }
- if genRecv {
- g.P("func (x *", streamType, ") Recv() (*", outType, ", error) {")
- g.P("m := new(", outType, ")")
- g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }")
- g.P("return m, nil")
- g.P("}")
- g.P()
- }
- if genCloseAndRecv {
- g.P("func (x *", streamType, ") CloseAndRecv() (*", outType, ", error) {")
- g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }")
- g.P("m := new(", outType, ")")
- g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }")
- g.P("return m, nil")
- g.P("}")
- g.P()
- }
-}
-
-// generateServerSignature returns the server-side signature for a method.
-func (g *grpc) generateServerSignature(servName string, method *pb.MethodDescriptorProto) string {
- origMethName := method.GetName()
- methName := generator.CamelCase(origMethName)
- if reservedClientName[methName] {
- methName += "_"
- }
-
- var reqArgs []string
- ret := "error"
- if !method.GetServerStreaming() && !method.GetClientStreaming() {
- reqArgs = append(reqArgs, contextPkg+".Context")
- ret = "(*" + g.typeName(method.GetOutputType()) + ", error)"
- }
- if !method.GetClientStreaming() {
- reqArgs = append(reqArgs, "*"+g.typeName(method.GetInputType()))
- }
- if method.GetServerStreaming() || method.GetClientStreaming() {
- reqArgs = append(reqArgs, servName+"_"+generator.CamelCase(origMethName)+"Server")
- }
-
- return methName + "(" + strings.Join(reqArgs, ", ") + ") " + ret
-}
-
-func (g *grpc) generateServerMethod(servName, fullServName string, method *pb.MethodDescriptorProto) string {
- methName := generator.CamelCase(method.GetName())
- hname := fmt.Sprintf("_%s_%s_Handler", servName, methName)
- inType := g.typeName(method.GetInputType())
- outType := g.typeName(method.GetOutputType())
-
- if !method.GetServerStreaming() && !method.GetClientStreaming() {
- g.P("func ", hname, "(srv interface{}, ctx ", contextPkg, ".Context, dec func(interface{}) error, interceptor ", grpcPkg, ".UnaryServerInterceptor) (interface{}, error) {")
- g.P("in := new(", inType, ")")
- g.P("if err := dec(in); err != nil { return nil, err }")
- g.P("if interceptor == nil { return srv.(", servName, "Server).", methName, "(ctx, in) }")
- g.P("info := &", grpcPkg, ".UnaryServerInfo{")
- g.P("Server: srv,")
- g.P("FullMethod: ", strconv.Quote(fmt.Sprintf("/%s/%s", fullServName, methName)), ",")
- g.P("}")
- g.P("handler := func(ctx ", contextPkg, ".Context, req interface{}) (interface{}, error) {")
- g.P("return srv.(", servName, "Server).", methName, "(ctx, req.(*", inType, "))")
- g.P("}")
- g.P("return interceptor(ctx, in, info, handler)")
- g.P("}")
- g.P()
- return hname
- }
- streamType := unexport(servName) + methName + "Server"
- g.P("func ", hname, "(srv interface{}, stream ", grpcPkg, ".ServerStream) error {")
- if !method.GetClientStreaming() {
- g.P("m := new(", inType, ")")
- g.P("if err := stream.RecvMsg(m); err != nil { return err }")
- g.P("return srv.(", servName, "Server).", methName, "(m, &", streamType, "{stream})")
- } else {
- g.P("return srv.(", servName, "Server).", methName, "(&", streamType, "{stream})")
- }
- g.P("}")
- g.P()
-
- genSend := method.GetServerStreaming()
- genSendAndClose := !method.GetServerStreaming()
- genRecv := method.GetClientStreaming()
-
- // Stream auxiliary types and methods.
- g.P("type ", servName, "_", methName, "Server interface {")
- if genSend {
- g.P("Send(*", outType, ") error")
- }
- if genSendAndClose {
- g.P("SendAndClose(*", outType, ") error")
- }
- if genRecv {
- g.P("Recv() (*", inType, ", error)")
- }
- g.P(grpcPkg, ".ServerStream")
- g.P("}")
- g.P()
-
- g.P("type ", streamType, " struct {")
- g.P(grpcPkg, ".ServerStream")
- g.P("}")
- g.P()
-
- if genSend {
- g.P("func (x *", streamType, ") Send(m *", outType, ") error {")
- g.P("return x.ServerStream.SendMsg(m)")
- g.P("}")
- g.P()
- }
- if genSendAndClose {
- g.P("func (x *", streamType, ") SendAndClose(m *", outType, ") error {")
- g.P("return x.ServerStream.SendMsg(m)")
- g.P("}")
- g.P()
- }
- if genRecv {
- g.P("func (x *", streamType, ") Recv() (*", inType, ", error) {")
- g.P("m := new(", inType, ")")
- g.P("if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err }")
- g.P("return m, nil")
- g.P("}")
- g.P()
- }
-
- return hname
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go b/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go
deleted file mode 100644
index 532a5500..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 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.
-
-package main
-
-import _ "github.com/golang/protobuf/protoc-gen-go/grpc"
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/main.go b/vendor/github.com/golang/protobuf/protoc-gen-go/main.go
deleted file mode 100644
index 8e2486de..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/main.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// protoc-gen-go is a plugin for the Google protocol buffer compiler to generate
-// Go code. Run it by building this program and putting it in your path with
-// the name
-// protoc-gen-go
-// That word 'go' at the end becomes part of the option string set for the
-// protocol compiler, so once the protocol compiler (protoc) is installed
-// you can run
-// protoc --go_out=output_directory input_directory/file.proto
-// to generate Go bindings for the protocol defined by file.proto.
-// With that input, the output will be written to
-// output_directory/file.pb.go
-//
-// The generated code is documented in the package comment for
-// the library.
-//
-// See the README and documentation for protocol buffers to learn more:
-// https://developers.google.com/protocol-buffers/
-package main
-
-import (
- "io/ioutil"
- "os"
-
- "github.com/golang/protobuf/proto"
- "github.com/golang/protobuf/protoc-gen-go/generator"
-)
-
-func main() {
- // Begin by allocating a generator. The request and response structures are stored there
- // so we can do error handling easily - the response structure contains the field to
- // report failure.
- g := generator.New()
-
- data, err := ioutil.ReadAll(os.Stdin)
- if err != nil {
- g.Error(err, "reading input")
- }
-
- if err := proto.Unmarshal(data, g.Request); err != nil {
- g.Error(err, "parsing input proto")
- }
-
- if len(g.Request.FileToGenerate) == 0 {
- g.Fail("no files to generate")
- }
-
- g.CommandLineParameters(g.Request.GetParameter())
-
- // Create a wrapped version of the Descriptors and EnumDescriptors that
- // point to the file that defines them.
- g.WrapTypes()
-
- g.SetPackageNames()
- g.BuildTypeNameMap()
-
- g.GenerateAllFiles()
-
- // Send back the results.
- data, err = proto.Marshal(g.Response)
- if err != nil {
- g.Error(err, "failed to marshal output proto")
- }
- _, err = os.Stdout.Write(data)
- if err != nil {
- g.Error(err, "failed to write output proto")
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
deleted file mode 100644
index 61bfc10e..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
+++ /dev/null
@@ -1,369 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/compiler/plugin.proto
-
-/*
-Package plugin_go is a generated protocol buffer package.
-
-It is generated from these files:
- google/protobuf/compiler/plugin.proto
-
-It has these top-level messages:
- Version
- CodeGeneratorRequest
- CodeGeneratorResponse
-*/
-package plugin_go
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// The version number of protocol compiler.
-type Version struct {
- Major *int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"`
- Minor *int32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"`
- Patch *int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"`
- // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
- // be empty for mainline stable releases.
- Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Version) Reset() { *m = Version{} }
-func (m *Version) String() string { return proto.CompactTextString(m) }
-func (*Version) ProtoMessage() {}
-func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
-func (m *Version) Unmarshal(b []byte) error {
- return xxx_messageInfo_Version.Unmarshal(m, b)
-}
-func (m *Version) Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Version.Marshal(b, m, deterministic)
-}
-func (dst *Version) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Version.Merge(dst, src)
-}
-func (m *Version) XXX_Size() int {
- return xxx_messageInfo_Version.Size(m)
-}
-func (m *Version) XXX_DiscardUnknown() {
- xxx_messageInfo_Version.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Version proto.InternalMessageInfo
-
-func (m *Version) GetMajor() int32 {
- if m != nil && m.Major != nil {
- return *m.Major
- }
- return 0
-}
-
-func (m *Version) GetMinor() int32 {
- if m != nil && m.Minor != nil {
- return *m.Minor
- }
- return 0
-}
-
-func (m *Version) GetPatch() int32 {
- if m != nil && m.Patch != nil {
- return *m.Patch
- }
- return 0
-}
-
-func (m *Version) GetSuffix() string {
- if m != nil && m.Suffix != nil {
- return *m.Suffix
- }
- return ""
-}
-
-// An encoded CodeGeneratorRequest is written to the plugin's stdin.
-type CodeGeneratorRequest struct {
- // The .proto files that were explicitly listed on the command-line. The
- // code generator should generate code only for these files. Each file's
- // descriptor will be included in proto_file, below.
- FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate,json=fileToGenerate" json:"file_to_generate,omitempty"`
- // The generator parameter passed on the command-line.
- Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
- // FileDescriptorProtos for all files in files_to_generate and everything
- // they import. The files will appear in topological order, so each file
- // appears before any file that imports it.
- //
- // protoc guarantees that all proto_files will be written after
- // the fields above, even though this is not technically guaranteed by the
- // protobuf wire format. This theoretically could allow a plugin to stream
- // in the FileDescriptorProtos and handle them one by one rather than read
- // the entire set into memory at once. However, as of this writing, this
- // is not similarly optimized on protoc's end -- it will store all fields in
- // memory at once before sending them to the plugin.
- //
- // Type names of fields and extensions in the FileDescriptorProto are always
- // fully qualified.
- ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
- // The version number of protocol compiler.
- CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
-func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
-func (*CodeGeneratorRequest) ProtoMessage() {}
-func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
-func (m *CodeGeneratorRequest) Unmarshal(b []byte) error {
- return xxx_messageInfo_CodeGeneratorRequest.Unmarshal(m, b)
-}
-func (m *CodeGeneratorRequest) Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_CodeGeneratorRequest.Marshal(b, m, deterministic)
-}
-func (dst *CodeGeneratorRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CodeGeneratorRequest.Merge(dst, src)
-}
-func (m *CodeGeneratorRequest) XXX_Size() int {
- return xxx_messageInfo_CodeGeneratorRequest.Size(m)
-}
-func (m *CodeGeneratorRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CodeGeneratorRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CodeGeneratorRequest proto.InternalMessageInfo
-
-func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
- if m != nil {
- return m.FileToGenerate
- }
- return nil
-}
-
-func (m *CodeGeneratorRequest) GetParameter() string {
- if m != nil && m.Parameter != nil {
- return *m.Parameter
- }
- return ""
-}
-
-func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
- if m != nil {
- return m.ProtoFile
- }
- return nil
-}
-
-func (m *CodeGeneratorRequest) GetCompilerVersion() *Version {
- if m != nil {
- return m.CompilerVersion
- }
- return nil
-}
-
-// The plugin writes an encoded CodeGeneratorResponse to stdout.
-type CodeGeneratorResponse struct {
- // Error message. If non-empty, code generation failed. The plugin process
- // should exit with status code zero even if it reports an error in this way.
- //
- // This should be used to indicate errors in .proto files which prevent the
- // code generator from generating correct code. Errors which indicate a
- // problem in protoc itself -- such as the input CodeGeneratorRequest being
- // unparseable -- should be reported by writing a message to stderr and
- // exiting with a non-zero status code.
- Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
- File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
-func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
-func (*CodeGeneratorResponse) ProtoMessage() {}
-func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
-func (m *CodeGeneratorResponse) Unmarshal(b []byte) error {
- return xxx_messageInfo_CodeGeneratorResponse.Unmarshal(m, b)
-}
-func (m *CodeGeneratorResponse) Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_CodeGeneratorResponse.Marshal(b, m, deterministic)
-}
-func (dst *CodeGeneratorResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CodeGeneratorResponse.Merge(dst, src)
-}
-func (m *CodeGeneratorResponse) XXX_Size() int {
- return xxx_messageInfo_CodeGeneratorResponse.Size(m)
-}
-func (m *CodeGeneratorResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CodeGeneratorResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CodeGeneratorResponse proto.InternalMessageInfo
-
-func (m *CodeGeneratorResponse) GetError() string {
- if m != nil && m.Error != nil {
- return *m.Error
- }
- return ""
-}
-
-func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
- if m != nil {
- return m.File
- }
- return nil
-}
-
-// Represents a single generated file.
-type CodeGeneratorResponse_File struct {
- // The file name, relative to the output directory. The name must not
- // contain "." or ".." components and must be relative, not be absolute (so,
- // the file cannot lie outside the output directory). "/" must be used as
- // the path separator, not "\".
- //
- // If the name is omitted, the content will be appended to the previous
- // file. This allows the generator to break large files into small chunks,
- // and allows the generated text to be streamed back to protoc so that large
- // files need not reside completely in memory at one time. Note that as of
- // this writing protoc does not optimize for this -- it will read the entire
- // CodeGeneratorResponse before writing files to disk.
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- // If non-empty, indicates that the named file should already exist, and the
- // content here is to be inserted into that file at a defined insertion
- // point. This feature allows a code generator to extend the output
- // produced by another code generator. The original generator may provide
- // insertion points by placing special annotations in the file that look
- // like:
- // @@protoc_insertion_point(NAME)
- // The annotation can have arbitrary text before and after it on the line,
- // which allows it to be placed in a comment. NAME should be replaced with
- // an identifier naming the point -- this is what other generators will use
- // as the insertion_point. Code inserted at this point will be placed
- // immediately above the line containing the insertion point (thus multiple
- // insertions to the same point will come out in the order they were added).
- // The double-@ is intended to make it unlikely that the generated code
- // could contain things that look like insertion points by accident.
- //
- // For example, the C++ code generator places the following line in the
- // .pb.h files that it generates:
- // // @@protoc_insertion_point(namespace_scope)
- // This line appears within the scope of the file's package namespace, but
- // outside of any particular class. Another plugin can then specify the
- // insertion_point "namespace_scope" to generate additional classes or
- // other declarations that should be placed in this scope.
- //
- // Note that if the line containing the insertion point begins with
- // whitespace, the same whitespace will be added to every line of the
- // inserted text. This is useful for languages like Python, where
- // indentation matters. In these languages, the insertion point comment
- // should be indented the same amount as any inserted code will need to be
- // in order to work correctly in that context.
- //
- // The code generator that generates the initial file and the one which
- // inserts into it must both run as part of a single invocation of protoc.
- // Code generators are executed in the order in which they appear on the
- // command line.
- //
- // If |insertion_point| is present, |name| must also be present.
- InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point,json=insertionPoint" json:"insertion_point,omitempty"`
- // The file contents.
- Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
-func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
-func (*CodeGeneratorResponse_File) ProtoMessage() {}
-func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }
-func (m *CodeGeneratorResponse_File) Unmarshal(b []byte) error {
- return xxx_messageInfo_CodeGeneratorResponse_File.Unmarshal(m, b)
-}
-func (m *CodeGeneratorResponse_File) Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_CodeGeneratorResponse_File.Marshal(b, m, deterministic)
-}
-func (dst *CodeGeneratorResponse_File) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CodeGeneratorResponse_File.Merge(dst, src)
-}
-func (m *CodeGeneratorResponse_File) XXX_Size() int {
- return xxx_messageInfo_CodeGeneratorResponse_File.Size(m)
-}
-func (m *CodeGeneratorResponse_File) XXX_DiscardUnknown() {
- xxx_messageInfo_CodeGeneratorResponse_File.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CodeGeneratorResponse_File proto.InternalMessageInfo
-
-func (m *CodeGeneratorResponse_File) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
- if m != nil && m.InsertionPoint != nil {
- return *m.InsertionPoint
- }
- return ""
-}
-
-func (m *CodeGeneratorResponse_File) GetContent() string {
- if m != nil && m.Content != nil {
- return *m.Content
- }
- return ""
-}
-
-func init() {
- proto.RegisterType((*Version)(nil), "google.protobuf.compiler.Version")
- proto.RegisterType((*CodeGeneratorRequest)(nil), "google.protobuf.compiler.CodeGeneratorRequest")
- proto.RegisterType((*CodeGeneratorResponse)(nil), "google.protobuf.compiler.CodeGeneratorResponse")
- proto.RegisterType((*CodeGeneratorResponse_File)(nil), "google.protobuf.compiler.CodeGeneratorResponse.File")
-}
-
-func init() { proto.RegisterFile("google/protobuf/compiler/plugin.proto", fileDescriptor0) }
-
-var fileDescriptor0 = []byte{
- // 417 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6a, 0x14, 0x41,
- 0x10, 0xc6, 0x19, 0x77, 0x63, 0x98, 0x8a, 0x64, 0x43, 0x13, 0xa5, 0x09, 0x39, 0x8c, 0x8b, 0xe2,
- 0x5c, 0x32, 0x0b, 0xc1, 0x8b, 0x78, 0x4b, 0x44, 0x3d, 0x78, 0x58, 0x1a, 0xf1, 0x20, 0xc8, 0x30,
- 0x99, 0xd4, 0x74, 0x5a, 0x66, 0xba, 0xc6, 0xee, 0x1e, 0xf1, 0x49, 0x7d, 0x0f, 0xdf, 0x40, 0xfa,
- 0xcf, 0x24, 0xb2, 0xb8, 0xa7, 0xee, 0xef, 0x57, 0xd5, 0xd5, 0x55, 0x1f, 0x05, 0x2f, 0x25, 0x91,
- 0xec, 0x71, 0x33, 0x1a, 0x72, 0x74, 0x33, 0x75, 0x9b, 0x96, 0x86, 0x51, 0xf5, 0x68, 0x36, 0x63,
- 0x3f, 0x49, 0xa5, 0xab, 0x10, 0x60, 0x3c, 0xa6, 0x55, 0x73, 0x5a, 0x35, 0xa7, 0x9d, 0x15, 0xbb,
- 0x05, 0x6e, 0xd1, 0xb6, 0x46, 0x8d, 0x8e, 0x4c, 0xcc, 0x5e, 0xb7, 0x70, 0xf8, 0x05, 0x8d, 0x55,
- 0xa4, 0xd9, 0x29, 0x1c, 0x0c, 0xcd, 0x77, 0x32, 0x3c, 0x2b, 0xb2, 0xf2, 0x40, 0x44, 0x11, 0xa8,
- 0xd2, 0x64, 0xf8, 0xa3, 0x44, 0xbd, 0xf0, 0x74, 0x6c, 0x5c, 0x7b, 0xc7, 0x17, 0x91, 0x06, 0xc1,
- 0x9e, 0xc1, 0x63, 0x3b, 0x75, 0x9d, 0xfa, 0xc5, 0x97, 0x45, 0x56, 0xe6, 0x22, 0xa9, 0xf5, 0x9f,
- 0x0c, 0x4e, 0xaf, 0xe9, 0x16, 0x3f, 0xa0, 0x46, 0xd3, 0x38, 0x32, 0x02, 0x7f, 0x4c, 0x68, 0x1d,
- 0x2b, 0xe1, 0xa4, 0x53, 0x3d, 0xd6, 0x8e, 0x6a, 0x19, 0x63, 0xc8, 0xb3, 0x62, 0x51, 0xe6, 0xe2,
- 0xd8, 0xf3, 0xcf, 0x94, 0x5e, 0x20, 0x3b, 0x87, 0x7c, 0x6c, 0x4c, 0x33, 0xa0, 0xc3, 0xd8, 0x4a,
- 0x2e, 0x1e, 0x00, 0xbb, 0x06, 0x08, 0xe3, 0xd4, 0xfe, 0x15, 0x5f, 0x15, 0x8b, 0xf2, 0xe8, 0xf2,
- 0x45, 0xb5, 0x6b, 0xcb, 0x7b, 0xd5, 0xe3, 0xbb, 0x7b, 0x03, 0xb6, 0x1e, 0x8b, 0x3c, 0x44, 0x7d,
- 0x84, 0x7d, 0x82, 0x93, 0xd9, 0xb8, 0xfa, 0x67, 0xf4, 0x24, 0x8c, 0x77, 0x74, 0xf9, 0xbc, 0xda,
- 0xe7, 0x70, 0x95, 0xcc, 0x13, 0xab, 0x99, 0x24, 0xb0, 0xfe, 0x9d, 0xc1, 0xd3, 0x9d, 0x99, 0xed,
- 0x48, 0xda, 0xa2, 0xf7, 0x0e, 0x8d, 0x49, 0x3e, 0xe7, 0x22, 0x0a, 0xf6, 0x11, 0x96, 0xff, 0x34,
- 0xff, 0x7a, 0xff, 0x8f, 0xff, 0x2d, 0x1a, 0x66, 0x13, 0xa1, 0xc2, 0xd9, 0x37, 0x58, 0x86, 0x79,
- 0x18, 0x2c, 0x75, 0x33, 0x60, 0xfa, 0x26, 0xdc, 0xd9, 0x2b, 0x58, 0x29, 0x6d, 0xd1, 0x38, 0x45,
- 0xba, 0x1e, 0x49, 0x69, 0x97, 0xcc, 0x3c, 0xbe, 0xc7, 0x5b, 0x4f, 0x19, 0x87, 0xc3, 0x96, 0xb4,
- 0x43, 0xed, 0xf8, 0x2a, 0x24, 0xcc, 0xf2, 0x4a, 0xc2, 0x79, 0x4b, 0xc3, 0xde, 0xfe, 0xae, 0x9e,
- 0x6c, 0xc3, 0x6e, 0x06, 0x7b, 0xed, 0xd7, 0x37, 0x52, 0xb9, 0xbb, 0xe9, 0xc6, 0x87, 0x37, 0x92,
- 0xfa, 0x46, 0xcb, 0x87, 0x65, 0x0c, 0x97, 0xf6, 0x42, 0xa2, 0xbe, 0x90, 0x94, 0x56, 0xfa, 0x6d,
- 0x3c, 0x6a, 0x49, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x15, 0x40, 0xc5, 0xfe, 0x02, 0x00,
- 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden
deleted file mode 100644
index 8953d0ff..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden
+++ /dev/null
@@ -1,83 +0,0 @@
-// Code generated by protoc-gen-go.
-// source: google/protobuf/compiler/plugin.proto
-// DO NOT EDIT!
-
-package google_protobuf_compiler
-
-import proto "github.com/golang/protobuf/proto"
-import "math"
-import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
-
-// Reference proto and math imports to suppress error if they are not otherwise used.
-var _ = proto.GetString
-var _ = math.Inf
-
-type CodeGeneratorRequest struct {
- FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate" json:"file_to_generate,omitempty"`
- Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
- ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file" json:"proto_file,omitempty"`
- XXX_unrecognized []byte `json:"-"`
-}
-
-func (this *CodeGeneratorRequest) Reset() { *this = CodeGeneratorRequest{} }
-func (this *CodeGeneratorRequest) String() string { return proto.CompactTextString(this) }
-func (*CodeGeneratorRequest) ProtoMessage() {}
-
-func (this *CodeGeneratorRequest) GetParameter() string {
- if this != nil && this.Parameter != nil {
- return *this.Parameter
- }
- return ""
-}
-
-type CodeGeneratorResponse struct {
- Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
- File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
- XXX_unrecognized []byte `json:"-"`
-}
-
-func (this *CodeGeneratorResponse) Reset() { *this = CodeGeneratorResponse{} }
-func (this *CodeGeneratorResponse) String() string { return proto.CompactTextString(this) }
-func (*CodeGeneratorResponse) ProtoMessage() {}
-
-func (this *CodeGeneratorResponse) GetError() string {
- if this != nil && this.Error != nil {
- return *this.Error
- }
- return ""
-}
-
-type CodeGeneratorResponse_File struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point" json:"insertion_point,omitempty"`
- Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
- XXX_unrecognized []byte `json:"-"`
-}
-
-func (this *CodeGeneratorResponse_File) Reset() { *this = CodeGeneratorResponse_File{} }
-func (this *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(this) }
-func (*CodeGeneratorResponse_File) ProtoMessage() {}
-
-func (this *CodeGeneratorResponse_File) GetName() string {
- if this != nil && this.Name != nil {
- return *this.Name
- }
- return ""
-}
-
-func (this *CodeGeneratorResponse_File) GetInsertionPoint() string {
- if this != nil && this.InsertionPoint != nil {
- return *this.InsertionPoint
- }
- return ""
-}
-
-func (this *CodeGeneratorResponse_File) GetContent() string {
- if this != nil && this.Content != nil {
- return *this.Content
- }
- return ""
-}
-
-func init() {
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto
deleted file mode 100644
index 5b557452..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto
+++ /dev/null
@@ -1,167 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// 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.
-
-// Author: kenton@google.com (Kenton Varda)
-//
-// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to
-// change.
-//
-// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
-// just a program that reads a CodeGeneratorRequest from stdin and writes a
-// CodeGeneratorResponse to stdout.
-//
-// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
-// of dealing with the raw protocol defined here.
-//
-// A plugin executable needs only to be placed somewhere in the path. The
-// plugin should be named "protoc-gen-$NAME", and will then be used when the
-// flag "--${NAME}_out" is passed to protoc.
-
-syntax = "proto2";
-package google.protobuf.compiler;
-option java_package = "com.google.protobuf.compiler";
-option java_outer_classname = "PluginProtos";
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/plugin;plugin_go";
-
-import "google/protobuf/descriptor.proto";
-
-// The version number of protocol compiler.
-message Version {
- optional int32 major = 1;
- optional int32 minor = 2;
- optional int32 patch = 3;
- // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
- // be empty for mainline stable releases.
- optional string suffix = 4;
-}
-
-// An encoded CodeGeneratorRequest is written to the plugin's stdin.
-message CodeGeneratorRequest {
- // The .proto files that were explicitly listed on the command-line. The
- // code generator should generate code only for these files. Each file's
- // descriptor will be included in proto_file, below.
- repeated string file_to_generate = 1;
-
- // The generator parameter passed on the command-line.
- optional string parameter = 2;
-
- // FileDescriptorProtos for all files in files_to_generate and everything
- // they import. The files will appear in topological order, so each file
- // appears before any file that imports it.
- //
- // protoc guarantees that all proto_files will be written after
- // the fields above, even though this is not technically guaranteed by the
- // protobuf wire format. This theoretically could allow a plugin to stream
- // in the FileDescriptorProtos and handle them one by one rather than read
- // the entire set into memory at once. However, as of this writing, this
- // is not similarly optimized on protoc's end -- it will store all fields in
- // memory at once before sending them to the plugin.
- //
- // Type names of fields and extensions in the FileDescriptorProto are always
- // fully qualified.
- repeated FileDescriptorProto proto_file = 15;
-
- // The version number of protocol compiler.
- optional Version compiler_version = 3;
-
-}
-
-// The plugin writes an encoded CodeGeneratorResponse to stdout.
-message CodeGeneratorResponse {
- // Error message. If non-empty, code generation failed. The plugin process
- // should exit with status code zero even if it reports an error in this way.
- //
- // This should be used to indicate errors in .proto files which prevent the
- // code generator from generating correct code. Errors which indicate a
- // problem in protoc itself -- such as the input CodeGeneratorRequest being
- // unparseable -- should be reported by writing a message to stderr and
- // exiting with a non-zero status code.
- optional string error = 1;
-
- // Represents a single generated file.
- message File {
- // The file name, relative to the output directory. The name must not
- // contain "." or ".." components and must be relative, not be absolute (so,
- // the file cannot lie outside the output directory). "/" must be used as
- // the path separator, not "\".
- //
- // If the name is omitted, the content will be appended to the previous
- // file. This allows the generator to break large files into small chunks,
- // and allows the generated text to be streamed back to protoc so that large
- // files need not reside completely in memory at one time. Note that as of
- // this writing protoc does not optimize for this -- it will read the entire
- // CodeGeneratorResponse before writing files to disk.
- optional string name = 1;
-
- // If non-empty, indicates that the named file should already exist, and the
- // content here is to be inserted into that file at a defined insertion
- // point. This feature allows a code generator to extend the output
- // produced by another code generator. The original generator may provide
- // insertion points by placing special annotations in the file that look
- // like:
- // @@protoc_insertion_point(NAME)
- // The annotation can have arbitrary text before and after it on the line,
- // which allows it to be placed in a comment. NAME should be replaced with
- // an identifier naming the point -- this is what other generators will use
- // as the insertion_point. Code inserted at this point will be placed
- // immediately above the line containing the insertion point (thus multiple
- // insertions to the same point will come out in the order they were added).
- // The double-@ is intended to make it unlikely that the generated code
- // could contain things that look like insertion points by accident.
- //
- // For example, the C++ code generator places the following line in the
- // .pb.h files that it generates:
- // // @@protoc_insertion_point(namespace_scope)
- // This line appears within the scope of the file's package namespace, but
- // outside of any particular class. Another plugin can then specify the
- // insertion_point "namespace_scope" to generate additional classes or
- // other declarations that should be placed in this scope.
- //
- // Note that if the line containing the insertion point begins with
- // whitespace, the same whitespace will be added to every line of the
- // inserted text. This is useful for languages like Python, where
- // indentation matters. In these languages, the insertion point comment
- // should be indented the same amount as any inserted code will need to be
- // in order to work correctly in that context.
- //
- // The code generator that generates the initial file and the one which
- // inserts into it must both run as part of a single invocation of protoc.
- // Code generators are executed in the order in which they appear on the
- // command line.
- //
- // If |insertion_point| is present, |name| must also be present.
- optional string insertion_point = 2;
-
- // The file contents.
- optional string content = 15;
- }
- repeated File file = 15;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go
deleted file mode 100644
index 6ebae9da..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go
+++ /dev/null
@@ -1,232 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// deprecated/deprecated.proto is a deprecated file.
-
-package deprecated // import "github.com/golang/protobuf/protoc-gen-go/testdata/deprecated"
-
-/*
-package deprecated contains only deprecated messages and services.
-*/
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-import (
- context "golang.org/x/net/context"
- grpc "google.golang.org/grpc"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// DeprecatedEnum contains deprecated values.
-type DeprecatedEnum int32 // Deprecated: Do not use.
-const (
- // DEPRECATED is the iota value of this enum.
- DeprecatedEnum_DEPRECATED DeprecatedEnum = 0 // Deprecated: Do not use.
-)
-
-var DeprecatedEnum_name = map[int32]string{
- 0: "DEPRECATED",
-}
-var DeprecatedEnum_value = map[string]int32{
- "DEPRECATED": 0,
-}
-
-func (x DeprecatedEnum) String() string {
- return proto.EnumName(DeprecatedEnum_name, int32(x))
-}
-func (DeprecatedEnum) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_deprecated_9e1889ba21817fad, []int{0}
-}
-
-// DeprecatedRequest is a request to DeprecatedCall.
-//
-// Deprecated: Do not use.
-type DeprecatedRequest struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeprecatedRequest) Reset() { *m = DeprecatedRequest{} }
-func (m *DeprecatedRequest) String() string { return proto.CompactTextString(m) }
-func (*DeprecatedRequest) ProtoMessage() {}
-func (*DeprecatedRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_deprecated_9e1889ba21817fad, []int{0}
-}
-func (m *DeprecatedRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DeprecatedRequest.Unmarshal(m, b)
-}
-func (m *DeprecatedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DeprecatedRequest.Marshal(b, m, deterministic)
-}
-func (dst *DeprecatedRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeprecatedRequest.Merge(dst, src)
-}
-func (m *DeprecatedRequest) XXX_Size() int {
- return xxx_messageInfo_DeprecatedRequest.Size(m)
-}
-func (m *DeprecatedRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeprecatedRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeprecatedRequest proto.InternalMessageInfo
-
-// Deprecated: Do not use.
-type DeprecatedResponse struct {
- // DeprecatedField contains a DeprecatedEnum.
- DeprecatedField DeprecatedEnum `protobuf:"varint,1,opt,name=deprecated_field,json=deprecatedField,enum=deprecated.DeprecatedEnum" json:"deprecated_field,omitempty"` // Deprecated: Do not use.
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeprecatedResponse) Reset() { *m = DeprecatedResponse{} }
-func (m *DeprecatedResponse) String() string { return proto.CompactTextString(m) }
-func (*DeprecatedResponse) ProtoMessage() {}
-func (*DeprecatedResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_deprecated_9e1889ba21817fad, []int{1}
-}
-func (m *DeprecatedResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DeprecatedResponse.Unmarshal(m, b)
-}
-func (m *DeprecatedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DeprecatedResponse.Marshal(b, m, deterministic)
-}
-func (dst *DeprecatedResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeprecatedResponse.Merge(dst, src)
-}
-func (m *DeprecatedResponse) XXX_Size() int {
- return xxx_messageInfo_DeprecatedResponse.Size(m)
-}
-func (m *DeprecatedResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_DeprecatedResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeprecatedResponse proto.InternalMessageInfo
-
-// Deprecated: Do not use.
-func (m *DeprecatedResponse) GetDeprecatedField() DeprecatedEnum {
- if m != nil {
- return m.DeprecatedField
- }
- return DeprecatedEnum_DEPRECATED
-}
-
-func init() {
- proto.RegisterType((*DeprecatedRequest)(nil), "deprecated.DeprecatedRequest")
- proto.RegisterType((*DeprecatedResponse)(nil), "deprecated.DeprecatedResponse")
- proto.RegisterEnum("deprecated.DeprecatedEnum", DeprecatedEnum_name, DeprecatedEnum_value)
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// Client API for DeprecatedService service
-
-// Deprecated: Do not use.
-type DeprecatedServiceClient interface {
- // DeprecatedCall takes a DeprecatedRequest and returns a DeprecatedResponse.
- DeprecatedCall(ctx context.Context, in *DeprecatedRequest, opts ...grpc.CallOption) (*DeprecatedResponse, error)
-}
-
-type deprecatedServiceClient struct {
- cc *grpc.ClientConn
-}
-
-// Deprecated: Do not use.
-func NewDeprecatedServiceClient(cc *grpc.ClientConn) DeprecatedServiceClient {
- return &deprecatedServiceClient{cc}
-}
-
-// Deprecated: Do not use.
-func (c *deprecatedServiceClient) DeprecatedCall(ctx context.Context, in *DeprecatedRequest, opts ...grpc.CallOption) (*DeprecatedResponse, error) {
- out := new(DeprecatedResponse)
- err := grpc.Invoke(ctx, "/deprecated.DeprecatedService/DeprecatedCall", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Server API for DeprecatedService service
-
-// Deprecated: Do not use.
-type DeprecatedServiceServer interface {
- // DeprecatedCall takes a DeprecatedRequest and returns a DeprecatedResponse.
- DeprecatedCall(context.Context, *DeprecatedRequest) (*DeprecatedResponse, error)
-}
-
-// Deprecated: Do not use.
-func RegisterDeprecatedServiceServer(s *grpc.Server, srv DeprecatedServiceServer) {
- s.RegisterService(&_DeprecatedService_serviceDesc, srv)
-}
-
-func _DeprecatedService_DeprecatedCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeprecatedRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeprecatedServiceServer).DeprecatedCall(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/deprecated.DeprecatedService/DeprecatedCall",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeprecatedServiceServer).DeprecatedCall(ctx, req.(*DeprecatedRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _DeprecatedService_serviceDesc = grpc.ServiceDesc{
- ServiceName: "deprecated.DeprecatedService",
- HandlerType: (*DeprecatedServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "DeprecatedCall",
- Handler: _DeprecatedService_DeprecatedCall_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "deprecated/deprecated.proto",
-}
-
-func init() {
- proto.RegisterFile("deprecated/deprecated.proto", fileDescriptor_deprecated_9e1889ba21817fad)
-}
-
-var fileDescriptor_deprecated_9e1889ba21817fad = []byte{
- // 248 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x49, 0x2d, 0x28,
- 0x4a, 0x4d, 0x4e, 0x2c, 0x49, 0x4d, 0xd1, 0x47, 0x30, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85,
- 0xb8, 0x10, 0x22, 0x4a, 0xe2, 0x5c, 0x82, 0x2e, 0x70, 0x5e, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71,
- 0x89, 0x15, 0x93, 0x04, 0xa3, 0x52, 0x32, 0x97, 0x10, 0xb2, 0x44, 0x71, 0x41, 0x7e, 0x5e, 0x71,
- 0xaa, 0x90, 0x27, 0x97, 0x00, 0x42, 0x73, 0x7c, 0x5a, 0x66, 0x6a, 0x4e, 0x8a, 0x04, 0xa3, 0x02,
- 0xa3, 0x06, 0x9f, 0x91, 0x94, 0x1e, 0x92, 0x3d, 0x08, 0x9d, 0xae, 0x79, 0xa5, 0xb9, 0x4e, 0x4c,
- 0x12, 0x8c, 0x41, 0xfc, 0x08, 0x69, 0x37, 0x90, 0x36, 0x90, 0x25, 0x5a, 0x1a, 0x5c, 0x7c, 0xa8,
- 0x4a, 0x85, 0x84, 0xb8, 0xb8, 0x5c, 0x5c, 0x03, 0x82, 0x5c, 0x9d, 0x1d, 0x43, 0x5c, 0x5d, 0x04,
- 0x18, 0xa4, 0x98, 0x38, 0x18, 0xa5, 0x98, 0x24, 0x18, 0x8d, 0xf2, 0x90, 0xdd, 0x19, 0x9c, 0x5a,
- 0x54, 0x96, 0x99, 0x9c, 0x2a, 0x14, 0x82, 0xac, 0xdd, 0x39, 0x31, 0x27, 0x47, 0x48, 0x16, 0xbb,
- 0x2b, 0xa0, 0x1e, 0x93, 0x92, 0xc3, 0x25, 0x0d, 0xf1, 0x9e, 0x12, 0x73, 0x07, 0x13, 0xa3, 0x14,
- 0x88, 0x70, 0x72, 0x8c, 0xb2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5,
- 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07, 0x07, 0x5f, 0x52, 0x69, 0x1a, 0x84, 0x91, 0xac,
- 0x9b, 0x9e, 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x5f, 0x92, 0x5a, 0x5c, 0x92, 0x92, 0x58, 0x92, 0x88,
- 0x14, 0xd2, 0x3b, 0x18, 0x19, 0x93, 0xd8, 0xc0, 0xaa, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff,
- 0x0e, 0xf5, 0x6c, 0x87, 0x8c, 0x01, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto
deleted file mode 100644
index b314166d..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto
+++ /dev/null
@@ -1,69 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-// package deprecated contains only deprecated messages and services.
-package deprecated;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/deprecated";
-
-option deprecated = true; // file-level deprecation
-
-// DeprecatedRequest is a request to DeprecatedCall.
-message DeprecatedRequest {
- option deprecated = true;
-}
-
-message DeprecatedResponse {
- // comment for DeprecatedResponse is omitted to guarantee deprecation
- // message doesn't append unnecessary comments.
- option deprecated = true;
- // DeprecatedField contains a DeprecatedEnum.
- DeprecatedEnum deprecated_field = 1 [deprecated=true];
-}
-
-// DeprecatedEnum contains deprecated values.
-enum DeprecatedEnum {
- option deprecated = true;
- // DEPRECATED is the iota value of this enum.
- DEPRECATED = 0 [deprecated=true];
-}
-
-// DeprecatedService is for making DeprecatedCalls
-service DeprecatedService {
- option deprecated = true;
-
- // DeprecatedCall takes a DeprecatedRequest and returns a DeprecatedResponse.
- rpc DeprecatedCall(DeprecatedRequest) returns (DeprecatedResponse) {
- option deprecated = true;
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go
deleted file mode 100644
index a08e8eda..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: extension_base/extension_base.proto
-
-package extension_base // import "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type BaseMessage struct {
- Height *int32 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BaseMessage) Reset() { *m = BaseMessage{} }
-func (m *BaseMessage) String() string { return proto.CompactTextString(m) }
-func (*BaseMessage) ProtoMessage() {}
-func (*BaseMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_base_41d3c712c9fc37fc, []int{0}
-}
-
-var extRange_BaseMessage = []proto.ExtensionRange{
- {Start: 4, End: 9},
- {Start: 16, End: 536870911},
-}
-
-func (*BaseMessage) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_BaseMessage
-}
-func (m *BaseMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_BaseMessage.Unmarshal(m, b)
-}
-func (m *BaseMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_BaseMessage.Marshal(b, m, deterministic)
-}
-func (dst *BaseMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BaseMessage.Merge(dst, src)
-}
-func (m *BaseMessage) XXX_Size() int {
- return xxx_messageInfo_BaseMessage.Size(m)
-}
-func (m *BaseMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_BaseMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BaseMessage proto.InternalMessageInfo
-
-func (m *BaseMessage) GetHeight() int32 {
- if m != nil && m.Height != nil {
- return *m.Height
- }
- return 0
-}
-
-// Another message that may be extended, using message_set_wire_format.
-type OldStyleMessage struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `protobuf_messageset:"1" json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OldStyleMessage) Reset() { *m = OldStyleMessage{} }
-func (m *OldStyleMessage) String() string { return proto.CompactTextString(m) }
-func (*OldStyleMessage) ProtoMessage() {}
-func (*OldStyleMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_base_41d3c712c9fc37fc, []int{1}
-}
-
-func (m *OldStyleMessage) MarshalJSON() ([]byte, error) {
- return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions)
-}
-func (m *OldStyleMessage) UnmarshalJSON(buf []byte) error {
- return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions)
-}
-
-var extRange_OldStyleMessage = []proto.ExtensionRange{
- {Start: 100, End: 2147483646},
-}
-
-func (*OldStyleMessage) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_OldStyleMessage
-}
-func (m *OldStyleMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OldStyleMessage.Unmarshal(m, b)
-}
-func (m *OldStyleMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OldStyleMessage.Marshal(b, m, deterministic)
-}
-func (dst *OldStyleMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OldStyleMessage.Merge(dst, src)
-}
-func (m *OldStyleMessage) XXX_Size() int {
- return xxx_messageInfo_OldStyleMessage.Size(m)
-}
-func (m *OldStyleMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_OldStyleMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OldStyleMessage proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*BaseMessage)(nil), "extension_base.BaseMessage")
- proto.RegisterType((*OldStyleMessage)(nil), "extension_base.OldStyleMessage")
-}
-
-func init() {
- proto.RegisterFile("extension_base/extension_base.proto", fileDescriptor_extension_base_41d3c712c9fc37fc)
-}
-
-var fileDescriptor_extension_base_41d3c712c9fc37fc = []byte{
- // 179 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xad, 0x28, 0x49,
- 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x8b, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x47, 0xe5, 0xea, 0x15, 0x14,
- 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0xa1, 0x8a, 0x2a, 0x99, 0x72, 0x71, 0x3b, 0x25, 0x16, 0xa7, 0xfa,
- 0xa6, 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x0a, 0x89, 0x71, 0xb1, 0x65, 0xa4, 0x66, 0xa6, 0x67, 0x94,
- 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x06, 0x41, 0x79, 0x5a, 0x2c, 0x1c, 0x2c, 0x02, 0x5c, 0x5a,
- 0x1c, 0x1c, 0x02, 0x02, 0x0d, 0x0d, 0x0d, 0x0d, 0x4c, 0x4a, 0xf2, 0x5c, 0xfc, 0xfe, 0x39, 0x29,
- 0xc1, 0x25, 0x95, 0x39, 0x30, 0xad, 0x5a, 0x1c, 0x1c, 0x29, 0x02, 0xff, 0xff, 0xff, 0xff, 0xcf,
- 0x6e, 0xc5, 0xc4, 0xc1, 0xe8, 0xe4, 0x14, 0xe5, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97,
- 0x9c, 0x9f, 0xab, 0x9f, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x0f, 0x76, 0x42, 0x52, 0x69, 0x1a,
- 0x84, 0x91, 0xac, 0x9b, 0x9e, 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x5f, 0x92, 0x5a, 0x5c, 0x92, 0x92,
- 0x58, 0x92, 0x88, 0xe6, 0x62, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x7f, 0xb7, 0x2a, 0xd1,
- 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto
deleted file mode 100644
index 0ba74def..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto
+++ /dev/null
@@ -1,48 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-package extension_base;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base";
-
-message BaseMessage {
- optional int32 height = 1;
- extensions 4 to 9;
- extensions 16 to max;
-}
-
-// Another message that may be extended, using message_set_wire_format.
-message OldStyleMessage {
- option message_set_wire_format = true;
- extensions 100 to max;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go
deleted file mode 100644
index b3732169..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: extension_extra/extension_extra.proto
-
-package extension_extra // import "github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type ExtraMessage struct {
- Width *int32 `protobuf:"varint,1,opt,name=width" json:"width,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ExtraMessage) Reset() { *m = ExtraMessage{} }
-func (m *ExtraMessage) String() string { return proto.CompactTextString(m) }
-func (*ExtraMessage) ProtoMessage() {}
-func (*ExtraMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_extra_83adf2410f49f816, []int{0}
-}
-func (m *ExtraMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ExtraMessage.Unmarshal(m, b)
-}
-func (m *ExtraMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ExtraMessage.Marshal(b, m, deterministic)
-}
-func (dst *ExtraMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExtraMessage.Merge(dst, src)
-}
-func (m *ExtraMessage) XXX_Size() int {
- return xxx_messageInfo_ExtraMessage.Size(m)
-}
-func (m *ExtraMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_ExtraMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExtraMessage proto.InternalMessageInfo
-
-func (m *ExtraMessage) GetWidth() int32 {
- if m != nil && m.Width != nil {
- return *m.Width
- }
- return 0
-}
-
-func init() {
- proto.RegisterType((*ExtraMessage)(nil), "extension_extra.ExtraMessage")
-}
-
-func init() {
- proto.RegisterFile("extension_extra/extension_extra.proto", fileDescriptor_extension_extra_83adf2410f49f816)
-}
-
-var fileDescriptor_extension_extra_83adf2410f49f816 = []byte{
- // 133 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xad, 0x28, 0x49,
- 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x8b, 0x4f, 0xad, 0x28, 0x29, 0x4a, 0xd4, 0x47, 0xe3, 0xeb, 0x15,
- 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0xa3, 0x09, 0x2b, 0xa9, 0x70, 0xf1, 0xb8, 0x82, 0x18, 0xbe,
- 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x22, 0x5c, 0xac, 0xe5, 0x99, 0x29, 0x25, 0x19, 0x12,
- 0x8c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x93, 0x73, 0x94, 0x63, 0x7a, 0x66, 0x49, 0x46,
- 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, 0xba, 0x3e, 0xd8, 0xc4,
- 0xa4, 0xd2, 0x34, 0x08, 0x23, 0x59, 0x37, 0x3d, 0x35, 0x4f, 0x37, 0x3d, 0x5f, 0xbf, 0x24, 0xb5,
- 0xb8, 0x24, 0x25, 0xb1, 0x04, 0xc3, 0x05, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xec, 0xe3,
- 0xb7, 0xa3, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto
deleted file mode 100644
index 1dd03e70..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto
+++ /dev/null
@@ -1,40 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2011 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-package extension_extra;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra";
-
-message ExtraMessage {
- optional int32 width = 1;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go
deleted file mode 100644
index 05247299..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go
+++ /dev/null
@@ -1,206 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Test that we can use protocol buffers that use extensions.
-
-package testdata
-
-import (
- "bytes"
- "regexp"
- "testing"
-
- "github.com/golang/protobuf/proto"
- base "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base"
- user "github.com/golang/protobuf/protoc-gen-go/testdata/extension_user"
-)
-
-func TestSingleFieldExtension(t *testing.T) {
- bm := &base.BaseMessage{
- Height: proto.Int32(178),
- }
-
- // Use extension within scope of another type.
- vol := proto.Uint32(11)
- err := proto.SetExtension(bm, user.E_LoudMessage_Volume, vol)
- if err != nil {
- t.Fatal("Failed setting extension:", err)
- }
- buf, err := proto.Marshal(bm)
- if err != nil {
- t.Fatal("Failed encoding message with extension:", err)
- }
- bm_new := new(base.BaseMessage)
- if err := proto.Unmarshal(buf, bm_new); err != nil {
- t.Fatal("Failed decoding message with extension:", err)
- }
- if !proto.HasExtension(bm_new, user.E_LoudMessage_Volume) {
- t.Fatal("Decoded message didn't contain extension.")
- }
- vol_out, err := proto.GetExtension(bm_new, user.E_LoudMessage_Volume)
- if err != nil {
- t.Fatal("Failed getting extension:", err)
- }
- if v := vol_out.(*uint32); *v != *vol {
- t.Errorf("vol_out = %v, expected %v", *v, *vol)
- }
- proto.ClearExtension(bm_new, user.E_LoudMessage_Volume)
- if proto.HasExtension(bm_new, user.E_LoudMessage_Volume) {
- t.Fatal("Failed clearing extension.")
- }
-}
-
-func TestMessageExtension(t *testing.T) {
- bm := &base.BaseMessage{
- Height: proto.Int32(179),
- }
-
- // Use extension that is itself a message.
- um := &user.UserMessage{
- Name: proto.String("Dave"),
- Rank: proto.String("Major"),
- }
- err := proto.SetExtension(bm, user.E_LoginMessage_UserMessage, um)
- if err != nil {
- t.Fatal("Failed setting extension:", err)
- }
- buf, err := proto.Marshal(bm)
- if err != nil {
- t.Fatal("Failed encoding message with extension:", err)
- }
- bm_new := new(base.BaseMessage)
- if err := proto.Unmarshal(buf, bm_new); err != nil {
- t.Fatal("Failed decoding message with extension:", err)
- }
- if !proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) {
- t.Fatal("Decoded message didn't contain extension.")
- }
- um_out, err := proto.GetExtension(bm_new, user.E_LoginMessage_UserMessage)
- if err != nil {
- t.Fatal("Failed getting extension:", err)
- }
- if n := um_out.(*user.UserMessage).Name; *n != *um.Name {
- t.Errorf("um_out.Name = %q, expected %q", *n, *um.Name)
- }
- if r := um_out.(*user.UserMessage).Rank; *r != *um.Rank {
- t.Errorf("um_out.Rank = %q, expected %q", *r, *um.Rank)
- }
- proto.ClearExtension(bm_new, user.E_LoginMessage_UserMessage)
- if proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) {
- t.Fatal("Failed clearing extension.")
- }
-}
-
-func TestTopLevelExtension(t *testing.T) {
- bm := &base.BaseMessage{
- Height: proto.Int32(179),
- }
-
- width := proto.Int32(17)
- err := proto.SetExtension(bm, user.E_Width, width)
- if err != nil {
- t.Fatal("Failed setting extension:", err)
- }
- buf, err := proto.Marshal(bm)
- if err != nil {
- t.Fatal("Failed encoding message with extension:", err)
- }
- bm_new := new(base.BaseMessage)
- if err := proto.Unmarshal(buf, bm_new); err != nil {
- t.Fatal("Failed decoding message with extension:", err)
- }
- if !proto.HasExtension(bm_new, user.E_Width) {
- t.Fatal("Decoded message didn't contain extension.")
- }
- width_out, err := proto.GetExtension(bm_new, user.E_Width)
- if err != nil {
- t.Fatal("Failed getting extension:", err)
- }
- if w := width_out.(*int32); *w != *width {
- t.Errorf("width_out = %v, expected %v", *w, *width)
- }
- proto.ClearExtension(bm_new, user.E_Width)
- if proto.HasExtension(bm_new, user.E_Width) {
- t.Fatal("Failed clearing extension.")
- }
-}
-
-func TestMessageSetWireFormat(t *testing.T) {
- osm := new(base.OldStyleMessage)
- osp := &user.OldStyleParcel{
- Name: proto.String("Dave"),
- Height: proto.Int32(178),
- }
-
- err := proto.SetExtension(osm, user.E_OldStyleParcel_MessageSetExtension, osp)
- if err != nil {
- t.Fatal("Failed setting extension:", err)
- }
-
- buf, err := proto.Marshal(osm)
- if err != nil {
- t.Fatal("Failed encoding message:", err)
- }
-
- // Data generated from Python implementation.
- expected := []byte{
- 11, 16, 209, 15, 26, 9, 10, 4, 68, 97, 118, 101, 16, 178, 1, 12,
- }
-
- if !bytes.Equal(expected, buf) {
- t.Errorf("Encoding mismatch.\nwant %+v\n got %+v", expected, buf)
- }
-
- // Check that it is restored correctly.
- osm = new(base.OldStyleMessage)
- if err := proto.Unmarshal(buf, osm); err != nil {
- t.Fatal("Failed decoding message:", err)
- }
- osp_out, err := proto.GetExtension(osm, user.E_OldStyleParcel_MessageSetExtension)
- if err != nil {
- t.Fatal("Failed getting extension:", err)
- }
- osp = osp_out.(*user.OldStyleParcel)
- if *osp.Name != "Dave" || *osp.Height != 178 {
- t.Errorf("Retrieved extension from decoded message is not correct: %+v", osp)
- }
-}
-
-func main() {
- // simpler than rigging up gotest
- testing.Main(regexp.MatchString, []testing.InternalTest{
- {"TestSingleFieldExtension", TestSingleFieldExtension},
- {"TestMessageExtension", TestMessageExtension},
- {"TestTopLevelExtension", TestTopLevelExtension},
- },
- []testing.InternalBenchmark{},
- []testing.InternalExample{})
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go
deleted file mode 100644
index c7187921..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go
+++ /dev/null
@@ -1,401 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: extension_user/extension_user.proto
-
-package extension_user // import "github.com/golang/protobuf/protoc-gen-go/testdata/extension_user"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import extension_base "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base"
-import extension_extra "github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type UserMessage struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Rank *string `protobuf:"bytes,2,opt,name=rank" json:"rank,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UserMessage) Reset() { *m = UserMessage{} }
-func (m *UserMessage) String() string { return proto.CompactTextString(m) }
-func (*UserMessage) ProtoMessage() {}
-func (*UserMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{0}
-}
-func (m *UserMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UserMessage.Unmarshal(m, b)
-}
-func (m *UserMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UserMessage.Marshal(b, m, deterministic)
-}
-func (dst *UserMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UserMessage.Merge(dst, src)
-}
-func (m *UserMessage) XXX_Size() int {
- return xxx_messageInfo_UserMessage.Size(m)
-}
-func (m *UserMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_UserMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UserMessage proto.InternalMessageInfo
-
-func (m *UserMessage) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *UserMessage) GetRank() string {
- if m != nil && m.Rank != nil {
- return *m.Rank
- }
- return ""
-}
-
-// Extend inside the scope of another type
-type LoudMessage struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *LoudMessage) Reset() { *m = LoudMessage{} }
-func (m *LoudMessage) String() string { return proto.CompactTextString(m) }
-func (*LoudMessage) ProtoMessage() {}
-func (*LoudMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{1}
-}
-
-var extRange_LoudMessage = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*LoudMessage) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_LoudMessage
-}
-func (m *LoudMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_LoudMessage.Unmarshal(m, b)
-}
-func (m *LoudMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_LoudMessage.Marshal(b, m, deterministic)
-}
-func (dst *LoudMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LoudMessage.Merge(dst, src)
-}
-func (m *LoudMessage) XXX_Size() int {
- return xxx_messageInfo_LoudMessage.Size(m)
-}
-func (m *LoudMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_LoudMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LoudMessage proto.InternalMessageInfo
-
-var E_LoudMessage_Volume = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: (*uint32)(nil),
- Field: 8,
- Name: "extension_user.LoudMessage.volume",
- Tag: "varint,8,opt,name=volume",
- Filename: "extension_user/extension_user.proto",
-}
-
-// Extend inside the scope of another type, using a message.
-type LoginMessage struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *LoginMessage) Reset() { *m = LoginMessage{} }
-func (m *LoginMessage) String() string { return proto.CompactTextString(m) }
-func (*LoginMessage) ProtoMessage() {}
-func (*LoginMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{2}
-}
-func (m *LoginMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_LoginMessage.Unmarshal(m, b)
-}
-func (m *LoginMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_LoginMessage.Marshal(b, m, deterministic)
-}
-func (dst *LoginMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LoginMessage.Merge(dst, src)
-}
-func (m *LoginMessage) XXX_Size() int {
- return xxx_messageInfo_LoginMessage.Size(m)
-}
-func (m *LoginMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_LoginMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LoginMessage proto.InternalMessageInfo
-
-var E_LoginMessage_UserMessage = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: (*UserMessage)(nil),
- Field: 16,
- Name: "extension_user.LoginMessage.user_message",
- Tag: "bytes,16,opt,name=user_message,json=userMessage",
- Filename: "extension_user/extension_user.proto",
-}
-
-type Detail struct {
- Color *string `protobuf:"bytes,1,opt,name=color" json:"color,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Detail) Reset() { *m = Detail{} }
-func (m *Detail) String() string { return proto.CompactTextString(m) }
-func (*Detail) ProtoMessage() {}
-func (*Detail) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{3}
-}
-func (m *Detail) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Detail.Unmarshal(m, b)
-}
-func (m *Detail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Detail.Marshal(b, m, deterministic)
-}
-func (dst *Detail) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Detail.Merge(dst, src)
-}
-func (m *Detail) XXX_Size() int {
- return xxx_messageInfo_Detail.Size(m)
-}
-func (m *Detail) XXX_DiscardUnknown() {
- xxx_messageInfo_Detail.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Detail proto.InternalMessageInfo
-
-func (m *Detail) GetColor() string {
- if m != nil && m.Color != nil {
- return *m.Color
- }
- return ""
-}
-
-// An extension of an extension
-type Announcement struct {
- Words *string `protobuf:"bytes,1,opt,name=words" json:"words,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Announcement) Reset() { *m = Announcement{} }
-func (m *Announcement) String() string { return proto.CompactTextString(m) }
-func (*Announcement) ProtoMessage() {}
-func (*Announcement) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{4}
-}
-func (m *Announcement) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Announcement.Unmarshal(m, b)
-}
-func (m *Announcement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Announcement.Marshal(b, m, deterministic)
-}
-func (dst *Announcement) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Announcement.Merge(dst, src)
-}
-func (m *Announcement) XXX_Size() int {
- return xxx_messageInfo_Announcement.Size(m)
-}
-func (m *Announcement) XXX_DiscardUnknown() {
- xxx_messageInfo_Announcement.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Announcement proto.InternalMessageInfo
-
-func (m *Announcement) GetWords() string {
- if m != nil && m.Words != nil {
- return *m.Words
- }
- return ""
-}
-
-var E_Announcement_LoudExt = &proto.ExtensionDesc{
- ExtendedType: (*LoudMessage)(nil),
- ExtensionType: (*Announcement)(nil),
- Field: 100,
- Name: "extension_user.Announcement.loud_ext",
- Tag: "bytes,100,opt,name=loud_ext,json=loudExt",
- Filename: "extension_user/extension_user.proto",
-}
-
-// Something that can be put in a message set.
-type OldStyleParcel struct {
- Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
- Height *int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OldStyleParcel) Reset() { *m = OldStyleParcel{} }
-func (m *OldStyleParcel) String() string { return proto.CompactTextString(m) }
-func (*OldStyleParcel) ProtoMessage() {}
-func (*OldStyleParcel) Descriptor() ([]byte, []int) {
- return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{5}
-}
-func (m *OldStyleParcel) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OldStyleParcel.Unmarshal(m, b)
-}
-func (m *OldStyleParcel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OldStyleParcel.Marshal(b, m, deterministic)
-}
-func (dst *OldStyleParcel) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OldStyleParcel.Merge(dst, src)
-}
-func (m *OldStyleParcel) XXX_Size() int {
- return xxx_messageInfo_OldStyleParcel.Size(m)
-}
-func (m *OldStyleParcel) XXX_DiscardUnknown() {
- xxx_messageInfo_OldStyleParcel.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OldStyleParcel proto.InternalMessageInfo
-
-func (m *OldStyleParcel) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *OldStyleParcel) GetHeight() int32 {
- if m != nil && m.Height != nil {
- return *m.Height
- }
- return 0
-}
-
-var E_OldStyleParcel_MessageSetExtension = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.OldStyleMessage)(nil),
- ExtensionType: (*OldStyleParcel)(nil),
- Field: 2001,
- Name: "extension_user.OldStyleParcel",
- Tag: "bytes,2001,opt,name=message_set_extension,json=messageSetExtension",
- Filename: "extension_user/extension_user.proto",
-}
-
-var E_UserMessage = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: (*UserMessage)(nil),
- Field: 5,
- Name: "extension_user.user_message",
- Tag: "bytes,5,opt,name=user_message,json=userMessage",
- Filename: "extension_user/extension_user.proto",
-}
-
-var E_ExtraMessage = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: (*extension_extra.ExtraMessage)(nil),
- Field: 9,
- Name: "extension_user.extra_message",
- Tag: "bytes,9,opt,name=extra_message,json=extraMessage",
- Filename: "extension_user/extension_user.proto",
-}
-
-var E_Width = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: (*int32)(nil),
- Field: 6,
- Name: "extension_user.width",
- Tag: "varint,6,opt,name=width",
- Filename: "extension_user/extension_user.proto",
-}
-
-var E_Area = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: (*int64)(nil),
- Field: 7,
- Name: "extension_user.area",
- Tag: "varint,7,opt,name=area",
- Filename: "extension_user/extension_user.proto",
-}
-
-var E_Detail = &proto.ExtensionDesc{
- ExtendedType: (*extension_base.BaseMessage)(nil),
- ExtensionType: ([]*Detail)(nil),
- Field: 17,
- Name: "extension_user.detail",
- Tag: "bytes,17,rep,name=detail",
- Filename: "extension_user/extension_user.proto",
-}
-
-func init() {
- proto.RegisterType((*UserMessage)(nil), "extension_user.UserMessage")
- proto.RegisterType((*LoudMessage)(nil), "extension_user.LoudMessage")
- proto.RegisterType((*LoginMessage)(nil), "extension_user.LoginMessage")
- proto.RegisterType((*Detail)(nil), "extension_user.Detail")
- proto.RegisterType((*Announcement)(nil), "extension_user.Announcement")
- proto.RegisterMessageSetType((*OldStyleParcel)(nil), 2001, "extension_user.OldStyleParcel")
- proto.RegisterType((*OldStyleParcel)(nil), "extension_user.OldStyleParcel")
- proto.RegisterExtension(E_LoudMessage_Volume)
- proto.RegisterExtension(E_LoginMessage_UserMessage)
- proto.RegisterExtension(E_Announcement_LoudExt)
- proto.RegisterExtension(E_OldStyleParcel_MessageSetExtension)
- proto.RegisterExtension(E_UserMessage)
- proto.RegisterExtension(E_ExtraMessage)
- proto.RegisterExtension(E_Width)
- proto.RegisterExtension(E_Area)
- proto.RegisterExtension(E_Detail)
-}
-
-func init() {
- proto.RegisterFile("extension_user/extension_user.proto", fileDescriptor_extension_user_af41b5e0bdfb7846)
-}
-
-var fileDescriptor_extension_user_af41b5e0bdfb7846 = []byte{
- // 492 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x51, 0x6f, 0x94, 0x40,
- 0x10, 0x0e, 0x6d, 0x8f, 0x5e, 0x87, 0x6b, 0xad, 0xa8, 0xcd, 0xa5, 0x6a, 0x25, 0x18, 0x13, 0x62,
- 0xd2, 0x23, 0x62, 0x7c, 0xe1, 0x49, 0x2f, 0xde, 0x93, 0x67, 0x34, 0x54, 0x5f, 0xf4, 0x81, 0xec,
- 0xc1, 0xc8, 0x91, 0xc2, 0xae, 0xd9, 0x5d, 0xec, 0xe9, 0xd3, 0xfd, 0x26, 0xff, 0x89, 0xff, 0xc8,
- 0xb0, 0x2c, 0x2d, 0x87, 0xc9, 0xc5, 0xbe, 0x90, 0xfd, 0x86, 0x6f, 0xbe, 0x99, 0xfd, 0x66, 0x00,
- 0x9e, 0xe2, 0x4a, 0x22, 0x15, 0x39, 0xa3, 0x71, 0x25, 0x90, 0xfb, 0x9b, 0x70, 0xf2, 0x9d, 0x33,
- 0xc9, 0xec, 0xa3, 0xcd, 0xe8, 0x69, 0x27, 0x69, 0x41, 0x04, 0xfa, 0x9b, 0xb0, 0x49, 0x3a, 0x7d,
- 0x76, 0x13, 0xc5, 0x95, 0xe4, 0xc4, 0xef, 0xe1, 0x86, 0xe6, 0xbe, 0x02, 0xeb, 0xb3, 0x40, 0xfe,
- 0x1e, 0x85, 0x20, 0x19, 0xda, 0x36, 0xec, 0x51, 0x52, 0xe2, 0xd8, 0x70, 0x0c, 0xef, 0x20, 0x52,
- 0xe7, 0x3a, 0xc6, 0x09, 0xbd, 0x1c, 0xef, 0x34, 0xb1, 0xfa, 0xec, 0xce, 0xc1, 0x9a, 0xb3, 0x2a,
- 0xd5, 0x69, 0xcf, 0x87, 0xc3, 0xf4, 0x78, 0xbd, 0x5e, 0xaf, 0x77, 0x82, 0x97, 0x60, 0xfe, 0x60,
- 0x45, 0x55, 0xa2, 0xfd, 0x70, 0xd2, 0xeb, 0x6b, 0x4a, 0x04, 0xea, 0x84, 0xf1, 0xd0, 0x31, 0xbc,
- 0xc3, 0x48, 0x53, 0xdd, 0x4b, 0x18, 0xcd, 0x59, 0x96, 0x53, 0xfd, 0x36, 0xf8, 0x0a, 0xa3, 0xfa,
- 0xa2, 0x71, 0xa9, 0xbb, 0xda, 0x2a, 0x75, 0xec, 0x18, 0x9e, 0x15, 0x74, 0x29, 0xca, 0xba, 0xce,
- 0xad, 0x22, 0xab, 0xba, 0x01, 0xee, 0x19, 0x98, 0x6f, 0x51, 0x92, 0xbc, 0xb0, 0xef, 0xc3, 0x20,
- 0x61, 0x05, 0xe3, 0xfa, 0xb6, 0x0d, 0x70, 0x7f, 0xc1, 0xe8, 0x0d, 0xa5, 0xac, 0xa2, 0x09, 0x96,
- 0x48, 0x65, 0xcd, 0xba, 0x62, 0x3c, 0x15, 0x2d, 0x4b, 0x81, 0xe0, 0x13, 0x0c, 0x0b, 0x56, 0xa5,
- 0xb5, 0x97, 0xf6, 0x3f, 0xb5, 0x3b, 0xd6, 0x8c, 0x53, 0xd5, 0xde, 0xa3, 0x3e, 0xa5, 0x5b, 0x22,
- 0xda, 0xaf, 0xa5, 0x66, 0x2b, 0xe9, 0xfe, 0x36, 0xe0, 0xe8, 0x43, 0x91, 0x5e, 0xc8, 0x9f, 0x05,
- 0x7e, 0x24, 0x3c, 0xc1, 0xa2, 0x33, 0x91, 0x9d, 0xeb, 0x89, 0x9c, 0x80, 0xb9, 0xc4, 0x3c, 0x5b,
- 0x4a, 0x35, 0x93, 0x41, 0xa4, 0x51, 0x20, 0xe1, 0x81, 0xb6, 0x2c, 0x16, 0x28, 0xe3, 0xeb, 0x92,
- 0xf6, 0x93, 0xbe, 0x81, 0x6d, 0x91, 0xb6, 0xcb, 0x3f, 0x77, 0x54, 0x9b, 0x67, 0xfd, 0x36, 0x37,
- 0x9b, 0x89, 0xee, 0x69, 0xf9, 0x0b, 0x94, 0xb3, 0x96, 0x18, 0xde, 0x6a, 0x5a, 0x83, 0xdb, 0x4d,
- 0x2b, 0x8c, 0xe1, 0x50, 0xad, 0xeb, 0xff, 0xa9, 0x1f, 0x28, 0xf5, 0xc7, 0x93, 0xfe, 0xae, 0xcf,
- 0xea, 0x67, 0xab, 0x3f, 0xc2, 0x0e, 0x0a, 0x5f, 0xc0, 0xe0, 0x2a, 0x4f, 0xe5, 0x72, 0xbb, 0xb0,
- 0xa9, 0x7c, 0x6e, 0x98, 0xa1, 0x0f, 0x7b, 0x84, 0x23, 0xd9, 0x9e, 0xb1, 0xef, 0x18, 0xde, 0x6e,
- 0xa4, 0x88, 0xe1, 0x3b, 0x30, 0xd3, 0x66, 0xe5, 0xb6, 0xa6, 0xdc, 0x75, 0x76, 0x3d, 0x2b, 0x38,
- 0xe9, 0x7b, 0xd3, 0x6c, 0x6b, 0xa4, 0x25, 0xa6, 0xd3, 0x2f, 0xaf, 0xb3, 0x5c, 0x2e, 0xab, 0xc5,
- 0x24, 0x61, 0xa5, 0x9f, 0xb1, 0x82, 0xd0, 0xcc, 0x57, 0x1f, 0xf3, 0xa2, 0xfa, 0xd6, 0x1c, 0x92,
- 0xf3, 0x0c, 0xe9, 0x79, 0xc6, 0x7c, 0x89, 0x42, 0xa6, 0x44, 0x92, 0xde, 0x7f, 0xe5, 0x6f, 0x00,
- 0x00, 0x00, 0xff, 0xff, 0xdf, 0x18, 0x64, 0x15, 0x77, 0x04, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto
deleted file mode 100644
index 033c186c..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto
+++ /dev/null
@@ -1,102 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-import "extension_base/extension_base.proto";
-import "extension_extra/extension_extra.proto";
-
-package extension_user;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/extension_user";
-
-message UserMessage {
- optional string name = 1;
- optional string rank = 2;
-}
-
-// Extend with a message
-extend extension_base.BaseMessage {
- optional UserMessage user_message = 5;
-}
-
-// Extend with a foreign message
-extend extension_base.BaseMessage {
- optional extension_extra.ExtraMessage extra_message = 9;
-}
-
-// Extend with some primitive types
-extend extension_base.BaseMessage {
- optional int32 width = 6;
- optional int64 area = 7;
-}
-
-// Extend inside the scope of another type
-message LoudMessage {
- extend extension_base.BaseMessage {
- optional uint32 volume = 8;
- }
- extensions 100 to max;
-}
-
-// Extend inside the scope of another type, using a message.
-message LoginMessage {
- extend extension_base.BaseMessage {
- optional UserMessage user_message = 16;
- }
-}
-
-// Extend with a repeated field
-extend extension_base.BaseMessage {
- repeated Detail detail = 17;
-}
-
-message Detail {
- optional string color = 1;
-}
-
-// An extension of an extension
-message Announcement {
- optional string words = 1;
- extend LoudMessage {
- optional Announcement loud_ext = 100;
- }
-}
-
-// Something that can be put in a message set.
-message OldStyleParcel {
- extend extension_base.OldStyleMessage {
- optional OldStyleParcel message_set_extension = 2001;
- }
-
- required string name = 1;
- optional int32 height = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go
deleted file mode 100644
index 0bb4cbfd..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go
+++ /dev/null
@@ -1,444 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: grpc/grpc.proto
-
-package testing // import "github.com/golang/protobuf/protoc-gen-go/testdata/grpc"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-import (
- context "golang.org/x/net/context"
- grpc "google.golang.org/grpc"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type SimpleRequest struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SimpleRequest) Reset() { *m = SimpleRequest{} }
-func (m *SimpleRequest) String() string { return proto.CompactTextString(m) }
-func (*SimpleRequest) ProtoMessage() {}
-func (*SimpleRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_grpc_65bf3902e49ee873, []int{0}
-}
-func (m *SimpleRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SimpleRequest.Unmarshal(m, b)
-}
-func (m *SimpleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SimpleRequest.Marshal(b, m, deterministic)
-}
-func (dst *SimpleRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SimpleRequest.Merge(dst, src)
-}
-func (m *SimpleRequest) XXX_Size() int {
- return xxx_messageInfo_SimpleRequest.Size(m)
-}
-func (m *SimpleRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_SimpleRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SimpleRequest proto.InternalMessageInfo
-
-type SimpleResponse struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SimpleResponse) Reset() { *m = SimpleResponse{} }
-func (m *SimpleResponse) String() string { return proto.CompactTextString(m) }
-func (*SimpleResponse) ProtoMessage() {}
-func (*SimpleResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_grpc_65bf3902e49ee873, []int{1}
-}
-func (m *SimpleResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SimpleResponse.Unmarshal(m, b)
-}
-func (m *SimpleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SimpleResponse.Marshal(b, m, deterministic)
-}
-func (dst *SimpleResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SimpleResponse.Merge(dst, src)
-}
-func (m *SimpleResponse) XXX_Size() int {
- return xxx_messageInfo_SimpleResponse.Size(m)
-}
-func (m *SimpleResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_SimpleResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SimpleResponse proto.InternalMessageInfo
-
-type StreamMsg struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StreamMsg) Reset() { *m = StreamMsg{} }
-func (m *StreamMsg) String() string { return proto.CompactTextString(m) }
-func (*StreamMsg) ProtoMessage() {}
-func (*StreamMsg) Descriptor() ([]byte, []int) {
- return fileDescriptor_grpc_65bf3902e49ee873, []int{2}
-}
-func (m *StreamMsg) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_StreamMsg.Unmarshal(m, b)
-}
-func (m *StreamMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_StreamMsg.Marshal(b, m, deterministic)
-}
-func (dst *StreamMsg) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StreamMsg.Merge(dst, src)
-}
-func (m *StreamMsg) XXX_Size() int {
- return xxx_messageInfo_StreamMsg.Size(m)
-}
-func (m *StreamMsg) XXX_DiscardUnknown() {
- xxx_messageInfo_StreamMsg.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StreamMsg proto.InternalMessageInfo
-
-type StreamMsg2 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StreamMsg2) Reset() { *m = StreamMsg2{} }
-func (m *StreamMsg2) String() string { return proto.CompactTextString(m) }
-func (*StreamMsg2) ProtoMessage() {}
-func (*StreamMsg2) Descriptor() ([]byte, []int) {
- return fileDescriptor_grpc_65bf3902e49ee873, []int{3}
-}
-func (m *StreamMsg2) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_StreamMsg2.Unmarshal(m, b)
-}
-func (m *StreamMsg2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_StreamMsg2.Marshal(b, m, deterministic)
-}
-func (dst *StreamMsg2) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StreamMsg2.Merge(dst, src)
-}
-func (m *StreamMsg2) XXX_Size() int {
- return xxx_messageInfo_StreamMsg2.Size(m)
-}
-func (m *StreamMsg2) XXX_DiscardUnknown() {
- xxx_messageInfo_StreamMsg2.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StreamMsg2 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest")
- proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse")
- proto.RegisterType((*StreamMsg)(nil), "grpc.testing.StreamMsg")
- proto.RegisterType((*StreamMsg2)(nil), "grpc.testing.StreamMsg2")
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// Client API for Test service
-
-type TestClient interface {
- UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error)
- // This RPC streams from the server only.
- Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error)
- // This RPC streams from the client.
- Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error)
- // This one streams in both directions.
- Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error)
-}
-
-type testClient struct {
- cc *grpc.ClientConn
-}
-
-func NewTestClient(cc *grpc.ClientConn) TestClient {
- return &testClient{cc}
-}
-
-func (c *testClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) {
- out := new(SimpleResponse)
- err := grpc.Invoke(ctx, "/grpc.testing.Test/UnaryCall", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *testClient) Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[0], c.cc, "/grpc.testing.Test/Downstream", opts...)
- if err != nil {
- return nil, err
- }
- x := &testDownstreamClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Test_DownstreamClient interface {
- Recv() (*StreamMsg, error)
- grpc.ClientStream
-}
-
-type testDownstreamClient struct {
- grpc.ClientStream
-}
-
-func (x *testDownstreamClient) Recv() (*StreamMsg, error) {
- m := new(StreamMsg)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *testClient) Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[1], c.cc, "/grpc.testing.Test/Upstream", opts...)
- if err != nil {
- return nil, err
- }
- x := &testUpstreamClient{stream}
- return x, nil
-}
-
-type Test_UpstreamClient interface {
- Send(*StreamMsg) error
- CloseAndRecv() (*SimpleResponse, error)
- grpc.ClientStream
-}
-
-type testUpstreamClient struct {
- grpc.ClientStream
-}
-
-func (x *testUpstreamClient) Send(m *StreamMsg) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *testUpstreamClient) CloseAndRecv() (*SimpleResponse, error) {
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- m := new(SimpleResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *testClient) Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[2], c.cc, "/grpc.testing.Test/Bidi", opts...)
- if err != nil {
- return nil, err
- }
- x := &testBidiClient{stream}
- return x, nil
-}
-
-type Test_BidiClient interface {
- Send(*StreamMsg) error
- Recv() (*StreamMsg2, error)
- grpc.ClientStream
-}
-
-type testBidiClient struct {
- grpc.ClientStream
-}
-
-func (x *testBidiClient) Send(m *StreamMsg) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *testBidiClient) Recv() (*StreamMsg2, error) {
- m := new(StreamMsg2)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// Server API for Test service
-
-type TestServer interface {
- UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
- // This RPC streams from the server only.
- Downstream(*SimpleRequest, Test_DownstreamServer) error
- // This RPC streams from the client.
- Upstream(Test_UpstreamServer) error
- // This one streams in both directions.
- Bidi(Test_BidiServer) error
-}
-
-func RegisterTestServer(s *grpc.Server, srv TestServer) {
- s.RegisterService(&_Test_serviceDesc, srv)
-}
-
-func _Test_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(SimpleRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TestServer).UnaryCall(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/grpc.testing.Test/UnaryCall",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TestServer).UnaryCall(ctx, req.(*SimpleRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Test_Downstream_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(SimpleRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(TestServer).Downstream(m, &testDownstreamServer{stream})
-}
-
-type Test_DownstreamServer interface {
- Send(*StreamMsg) error
- grpc.ServerStream
-}
-
-type testDownstreamServer struct {
- grpc.ServerStream
-}
-
-func (x *testDownstreamServer) Send(m *StreamMsg) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func _Test_Upstream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(TestServer).Upstream(&testUpstreamServer{stream})
-}
-
-type Test_UpstreamServer interface {
- SendAndClose(*SimpleResponse) error
- Recv() (*StreamMsg, error)
- grpc.ServerStream
-}
-
-type testUpstreamServer struct {
- grpc.ServerStream
-}
-
-func (x *testUpstreamServer) SendAndClose(m *SimpleResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *testUpstreamServer) Recv() (*StreamMsg, error) {
- m := new(StreamMsg)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func _Test_Bidi_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(TestServer).Bidi(&testBidiServer{stream})
-}
-
-type Test_BidiServer interface {
- Send(*StreamMsg2) error
- Recv() (*StreamMsg, error)
- grpc.ServerStream
-}
-
-type testBidiServer struct {
- grpc.ServerStream
-}
-
-func (x *testBidiServer) Send(m *StreamMsg2) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *testBidiServer) Recv() (*StreamMsg, error) {
- m := new(StreamMsg)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-var _Test_serviceDesc = grpc.ServiceDesc{
- ServiceName: "grpc.testing.Test",
- HandlerType: (*TestServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "UnaryCall",
- Handler: _Test_UnaryCall_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "Downstream",
- Handler: _Test_Downstream_Handler,
- ServerStreams: true,
- },
- {
- StreamName: "Upstream",
- Handler: _Test_Upstream_Handler,
- ClientStreams: true,
- },
- {
- StreamName: "Bidi",
- Handler: _Test_Bidi_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- Metadata: "grpc/grpc.proto",
-}
-
-func init() { proto.RegisterFile("grpc/grpc.proto", fileDescriptor_grpc_65bf3902e49ee873) }
-
-var fileDescriptor_grpc_65bf3902e49ee873 = []byte{
- // 244 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x2f, 0x2a, 0x48,
- 0xd6, 0x07, 0x11, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x3c, 0x60, 0x76, 0x49, 0x6a, 0x71,
- 0x49, 0x66, 0x5e, 0xba, 0x12, 0x3f, 0x17, 0x6f, 0x70, 0x66, 0x6e, 0x41, 0x4e, 0x6a, 0x50, 0x6a,
- 0x61, 0x69, 0x6a, 0x71, 0x89, 0x92, 0x00, 0x17, 0x1f, 0x4c, 0xa0, 0xb8, 0x20, 0x3f, 0xaf, 0x38,
- 0x55, 0x89, 0x9b, 0x8b, 0x33, 0xb8, 0xa4, 0x28, 0x35, 0x31, 0xd7, 0xb7, 0x38, 0x5d, 0x89, 0x87,
- 0x8b, 0x0b, 0xce, 0x31, 0x32, 0x9a, 0xc1, 0xc4, 0xc5, 0x12, 0x92, 0x5a, 0x5c, 0x22, 0xe4, 0xc6,
- 0xc5, 0x19, 0x9a, 0x97, 0x58, 0x54, 0xe9, 0x9c, 0x98, 0x93, 0x23, 0x24, 0xad, 0x87, 0x6c, 0x85,
- 0x1e, 0x8a, 0xf9, 0x52, 0x32, 0xd8, 0x25, 0x21, 0x76, 0x09, 0xb9, 0x70, 0x71, 0xb9, 0xe4, 0x97,
- 0xe7, 0x15, 0x83, 0xad, 0xc0, 0x6f, 0x90, 0x38, 0x9a, 0x24, 0xcc, 0x55, 0x06, 0x8c, 0x42, 0xce,
- 0x5c, 0x1c, 0xa1, 0x05, 0x50, 0x33, 0x70, 0x29, 0xc3, 0xef, 0x10, 0x0d, 0x46, 0x21, 0x5b, 0x2e,
- 0x16, 0xa7, 0xcc, 0x94, 0x4c, 0xdc, 0x06, 0x48, 0xe0, 0x90, 0x30, 0xd2, 0x60, 0x34, 0x60, 0x74,
- 0x72, 0x88, 0xb2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf,
- 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07, 0xc7, 0x40, 0x52, 0x69, 0x1a, 0x84, 0x91, 0xac, 0x9b, 0x9e,
- 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x0f, 0x32, 0x22, 0x25, 0xb1, 0x24, 0x11, 0x1c, 0x4d, 0xd6, 0x50,
- 0x03, 0x93, 0xd8, 0xc0, 0x8a, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0xb9, 0x95, 0x42,
- 0xc2, 0x01, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto
deleted file mode 100644
index 0e5c64a9..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto
+++ /dev/null
@@ -1,61 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package grpc.testing;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/grpc;testing";
-
-message SimpleRequest {
-}
-
-message SimpleResponse {
-}
-
-message StreamMsg {
-}
-
-message StreamMsg2 {
-}
-
-service Test {
- rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
-
- // This RPC streams from the server only.
- rpc Downstream(SimpleRequest) returns (stream StreamMsg);
-
- // This RPC streams from the client.
- rpc Upstream(stream StreamMsg) returns (SimpleResponse);
-
- // This one streams in both directions.
- rpc Bidi(stream StreamMsg) returns (stream StreamMsg2);
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go
deleted file mode 100644
index 5b780fd5..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go
+++ /dev/null
@@ -1,110 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: import_public/a.proto
-
-package import_public // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import sub "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// M from public import import_public/sub/a.proto
-type M = sub.M
-
-// E from public import import_public/sub/a.proto
-type E = sub.E
-
-var E_name = sub.E_name
-var E_value = sub.E_value
-
-const E_ZERO = E(sub.E_ZERO)
-
-// Ignoring public import of Local from import_public/b.proto
-
-type Public struct {
- M *sub.M `protobuf:"bytes,1,opt,name=m" json:"m,omitempty"`
- E sub.E `protobuf:"varint,2,opt,name=e,enum=goproto.test.import_public.sub.E" json:"e,omitempty"`
- Local *Local `protobuf:"bytes,3,opt,name=local" json:"local,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Public) Reset() { *m = Public{} }
-func (m *Public) String() string { return proto.CompactTextString(m) }
-func (*Public) ProtoMessage() {}
-func (*Public) Descriptor() ([]byte, []int) {
- return fileDescriptor_a_c0314c022b7c17d8, []int{0}
-}
-func (m *Public) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Public.Unmarshal(m, b)
-}
-func (m *Public) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Public.Marshal(b, m, deterministic)
-}
-func (dst *Public) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Public.Merge(dst, src)
-}
-func (m *Public) XXX_Size() int {
- return xxx_messageInfo_Public.Size(m)
-}
-func (m *Public) XXX_DiscardUnknown() {
- xxx_messageInfo_Public.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Public proto.InternalMessageInfo
-
-func (m *Public) GetM() *sub.M {
- if m != nil {
- return m.M
- }
- return nil
-}
-
-func (m *Public) GetE() sub.E {
- if m != nil {
- return m.E
- }
- return sub.E_ZERO
-}
-
-func (m *Public) GetLocal() *Local {
- if m != nil {
- return m.Local
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Public)(nil), "goproto.test.import_public.Public")
-}
-
-func init() { proto.RegisterFile("import_public/a.proto", fileDescriptor_a_c0314c022b7c17d8) }
-
-var fileDescriptor_a_c0314c022b7c17d8 = []byte{
- // 200 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x4f, 0xd4, 0x2b, 0x28, 0xca, 0x2f,
- 0xc9, 0x17, 0x92, 0x4a, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b, 0xf4, 0x50, 0xd4, 0x48,
- 0x49, 0xa2, 0x6a, 0x29, 0x2e, 0x4d, 0x82, 0x69, 0x93, 0x42, 0x33, 0x2d, 0x09, 0x22, 0xac, 0xb4,
- 0x98, 0x91, 0x8b, 0x2d, 0x00, 0x2c, 0x24, 0xa4, 0xcf, 0xc5, 0x98, 0x2b, 0xc1, 0xa8, 0xc0, 0xa8,
- 0xc1, 0x6d, 0xa4, 0xa8, 0x87, 0xdb, 0x12, 0xbd, 0xe2, 0xd2, 0x24, 0x3d, 0xdf, 0x20, 0xc6, 0x5c,
- 0x90, 0x86, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x3e, 0xc2, 0x1a, 0x5c, 0x83, 0x18, 0x53, 0x85,
- 0xcc, 0xb9, 0x58, 0x73, 0xf2, 0x93, 0x13, 0x73, 0x24, 0x98, 0x09, 0xdb, 0xe2, 0x03, 0x52, 0x18,
- 0x04, 0x51, 0xef, 0xe4, 0x18, 0x65, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f,
- 0xab, 0x9f, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x0f, 0xd6, 0x9a, 0x54, 0x9a, 0x06, 0x61, 0x24,
- 0xeb, 0xa6, 0xa7, 0xe6, 0xe9, 0xa6, 0xe7, 0xeb, 0x83, 0xcc, 0x4a, 0x49, 0x2c, 0x49, 0xd4, 0x47,
- 0x31, 0x2f, 0x80, 0x21, 0x80, 0x31, 0x89, 0x0d, 0xac, 0xd2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff,
- 0x70, 0xc5, 0xc3, 0x79, 0x5a, 0x01, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto
deleted file mode 100644
index 957ad897..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto
+++ /dev/null
@@ -1,45 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package goproto.test.import_public;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public";
-
-import public "import_public/sub/a.proto"; // Different Go package.
-import public "import_public/b.proto"; // Same Go package.
-
-message Public {
- goproto.test.import_public.sub.M m = 1;
- goproto.test.import_public.sub.E e = 2;
- Local local = 3;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go
deleted file mode 100644
index 427aa4f3..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go
+++ /dev/null
@@ -1,87 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: import_public/b.proto
-
-package import_public // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import sub "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Local struct {
- M *sub.M `protobuf:"bytes,1,opt,name=m" json:"m,omitempty"`
- E sub.E `protobuf:"varint,2,opt,name=e,enum=goproto.test.import_public.sub.E" json:"e,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Local) Reset() { *m = Local{} }
-func (m *Local) String() string { return proto.CompactTextString(m) }
-func (*Local) ProtoMessage() {}
-func (*Local) Descriptor() ([]byte, []int) {
- return fileDescriptor_b_7f20a805fad67bd0, []int{0}
-}
-func (m *Local) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Local.Unmarshal(m, b)
-}
-func (m *Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Local.Marshal(b, m, deterministic)
-}
-func (dst *Local) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Local.Merge(dst, src)
-}
-func (m *Local) XXX_Size() int {
- return xxx_messageInfo_Local.Size(m)
-}
-func (m *Local) XXX_DiscardUnknown() {
- xxx_messageInfo_Local.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Local proto.InternalMessageInfo
-
-func (m *Local) GetM() *sub.M {
- if m != nil {
- return m.M
- }
- return nil
-}
-
-func (m *Local) GetE() sub.E {
- if m != nil {
- return m.E
- }
- return sub.E_ZERO
-}
-
-func init() {
- proto.RegisterType((*Local)(nil), "goproto.test.import_public.Local")
-}
-
-func init() { proto.RegisterFile("import_public/b.proto", fileDescriptor_b_7f20a805fad67bd0) }
-
-var fileDescriptor_b_7f20a805fad67bd0 = []byte{
- // 174 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x4f, 0xd2, 0x2b, 0x28, 0xca, 0x2f,
- 0xc9, 0x17, 0x92, 0x4a, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b, 0xf4, 0x50, 0xd4, 0x48,
- 0x49, 0xa2, 0x6a, 0x29, 0x2e, 0x4d, 0xd2, 0x4f, 0x84, 0x68, 0x53, 0xca, 0xe4, 0x62, 0xf5, 0xc9,
- 0x4f, 0x4e, 0xcc, 0x11, 0xd2, 0xe7, 0x62, 0xcc, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52,
- 0xd4, 0xc3, 0x6d, 0x96, 0x5e, 0x71, 0x69, 0x92, 0x9e, 0x6f, 0x10, 0x63, 0x2e, 0x48, 0x43, 0xaa,
- 0x04, 0x93, 0x02, 0xa3, 0x06, 0x1f, 0x61, 0x0d, 0xae, 0x41, 0x8c, 0xa9, 0x4e, 0x8e, 0x51, 0xf6,
- 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0x39, 0x89, 0x79,
- 0xe9, 0xfa, 0x60, 0x6d, 0x49, 0xa5, 0x69, 0x10, 0x46, 0xb2, 0x6e, 0x7a, 0x6a, 0x9e, 0x6e, 0x7a,
- 0xbe, 0x3e, 0xc8, 0x9c, 0x94, 0xc4, 0x92, 0x44, 0x7d, 0x14, 0xb3, 0x92, 0xd8, 0xc0, 0xaa, 0x8c,
- 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x2b, 0x5f, 0x8e, 0x04, 0x01, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto
deleted file mode 100644
index 1dbca3e4..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto
+++ /dev/null
@@ -1,43 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package goproto.test.import_public;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public";
-
-import "import_public/sub/a.proto";
-
-message Local {
- goproto.test.import_public.sub.M m = 1;
- goproto.test.import_public.sub.E e = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go
deleted file mode 100644
index 4f8f6d24..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: import_public/sub/a.proto
-
-package sub // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type E int32
-
-const (
- E_ZERO E = 0
-)
-
-var E_name = map[int32]string{
- 0: "ZERO",
-}
-var E_value = map[string]int32{
- "ZERO": 0,
-}
-
-func (x E) String() string {
- return proto.EnumName(E_name, int32(x))
-}
-func (E) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_a_91ca0264a534463a, []int{0}
-}
-
-type M struct {
- // Field using a type in the same Go package, but a different source file.
- M2 *M2 `protobuf:"bytes,1,opt,name=m2" json:"m2,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M) Reset() { *m = M{} }
-func (m *M) String() string { return proto.CompactTextString(m) }
-func (*M) ProtoMessage() {}
-func (*M) Descriptor() ([]byte, []int) {
- return fileDescriptor_a_91ca0264a534463a, []int{0}
-}
-func (m *M) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M.Unmarshal(m, b)
-}
-func (m *M) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M.Marshal(b, m, deterministic)
-}
-func (dst *M) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M.Merge(dst, src)
-}
-func (m *M) XXX_Size() int {
- return xxx_messageInfo_M.Size(m)
-}
-func (m *M) XXX_DiscardUnknown() {
- xxx_messageInfo_M.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M proto.InternalMessageInfo
-
-func (m *M) GetM2() *M2 {
- if m != nil {
- return m.M2
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*M)(nil), "goproto.test.import_public.sub.M")
- proto.RegisterEnum("goproto.test.import_public.sub.E", E_name, E_value)
-}
-
-func init() { proto.RegisterFile("import_public/sub/a.proto", fileDescriptor_a_91ca0264a534463a) }
-
-var fileDescriptor_a_91ca0264a534463a = []byte{
- // 172 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x2f, 0x2e, 0x4d, 0xd2, 0x4f, 0xd4,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x4b, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b,
- 0xf4, 0x50, 0xd4, 0xe9, 0x15, 0x97, 0x26, 0x49, 0x61, 0xd1, 0x9a, 0x04, 0xd1, 0xaa, 0x64, 0xce,
- 0xc5, 0xe8, 0x2b, 0x64, 0xc4, 0xc5, 0x94, 0x6b, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4,
- 0xa4, 0x87, 0xdf, 0x30, 0x3d, 0x5f, 0xa3, 0x20, 0xa6, 0x5c, 0x23, 0x2d, 0x5e, 0x2e, 0x46, 0x57,
- 0x21, 0x0e, 0x2e, 0x96, 0x28, 0xd7, 0x20, 0x7f, 0x01, 0x06, 0x27, 0xd7, 0x28, 0xe7, 0xf4, 0xcc,
- 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0x7d,
- 0xb0, 0x39, 0x49, 0xa5, 0x69, 0x10, 0x46, 0xb2, 0x6e, 0x7a, 0x6a, 0x9e, 0x6e, 0x7a, 0xbe, 0x3e,
- 0xc8, 0xe0, 0x94, 0xc4, 0x92, 0x44, 0x7d, 0x0c, 0x67, 0x25, 0xb1, 0x81, 0x55, 0x1a, 0x03, 0x02,
- 0x00, 0x00, 0xff, 0xff, 0x81, 0xcc, 0x07, 0x7d, 0xed, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto
deleted file mode 100644
index 4494c818..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto
+++ /dev/null
@@ -1,47 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package goproto.test.import_public.sub;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub";
-
-import "import_public/sub/b.proto";
-
-message M {
- // Field using a type in the same Go package, but a different source file.
- M2 m2 = 1;
-}
-
-enum E {
- ZERO = 0;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go
deleted file mode 100644
index d57a3bb9..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: import_public/sub/b.proto
-
-package sub // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M2 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M2) Reset() { *m = M2{} }
-func (m *M2) String() string { return proto.CompactTextString(m) }
-func (*M2) ProtoMessage() {}
-func (*M2) Descriptor() ([]byte, []int) {
- return fileDescriptor_b_eba25180453d86b4, []int{0}
-}
-func (m *M2) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M2.Unmarshal(m, b)
-}
-func (m *M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M2.Marshal(b, m, deterministic)
-}
-func (dst *M2) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M2.Merge(dst, src)
-}
-func (m *M2) XXX_Size() int {
- return xxx_messageInfo_M2.Size(m)
-}
-func (m *M2) XXX_DiscardUnknown() {
- xxx_messageInfo_M2.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M2 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M2)(nil), "goproto.test.import_public.sub.M2")
-}
-
-func init() { proto.RegisterFile("import_public/sub/b.proto", fileDescriptor_b_eba25180453d86b4) }
-
-var fileDescriptor_b_eba25180453d86b4 = []byte{
- // 127 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x2f, 0x2e, 0x4d, 0xd2, 0x4f, 0xd2,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x4b, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b,
- 0xf4, 0x50, 0xd4, 0xe9, 0x15, 0x97, 0x26, 0x29, 0xb1, 0x70, 0x31, 0xf9, 0x1a, 0x39, 0xb9, 0x46,
- 0x39, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24,
- 0xe6, 0xa5, 0xeb, 0x83, 0xf5, 0x25, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, 0xe9, 0xa9, 0x79, 0xba,
- 0xe9, 0xf9, 0xfa, 0x20, 0x83, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0x31, 0x2c, 0x4d, 0x62, 0x03, 0xab,
- 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x64, 0x42, 0xe4, 0xa8, 0x90, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto
deleted file mode 100644
index c7299e0f..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto
+++ /dev/null
@@ -1,39 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package goproto.test.import_public.sub;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub";
-
-message M2 {
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go
deleted file mode 100644
index 7ef776bf..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// +build go1.9
-
-package testdata
-
-import (
- "testing"
-
- mainpb "github.com/golang/protobuf/protoc-gen-go/testdata/import_public"
- subpb "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"
-)
-
-func TestImportPublicLink(t *testing.T) {
- // mainpb.[ME] should be interchangable with subpb.[ME].
- var _ mainpb.M = subpb.M{}
- var _ mainpb.E = subpb.E(0)
- _ = &mainpb.Public{
- M: &mainpb.M{},
- E: mainpb.E_ZERO,
- Local: &mainpb.Local{
- M: &mainpb.M{},
- E: mainpb.E_ZERO,
- },
- }
- _ = &mainpb.Public{
- M: &subpb.M{},
- E: subpb.E_ZERO,
- Local: &mainpb.Local{
- M: &subpb.M{},
- E: subpb.E_ZERO,
- },
- }
- _ = &mainpb.M{
- M2: &subpb.M2{},
- }
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go
deleted file mode 100644
index ca312d6c..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/fmt/m.proto
-
-package fmt // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M) Reset() { *m = M{} }
-func (m *M) String() string { return proto.CompactTextString(m) }
-func (*M) ProtoMessage() {}
-func (*M) Descriptor() ([]byte, []int) {
- return fileDescriptor_m_867dd34c461422b8, []int{0}
-}
-func (m *M) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M.Unmarshal(m, b)
-}
-func (m *M) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M.Marshal(b, m, deterministic)
-}
-func (dst *M) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M.Merge(dst, src)
-}
-func (m *M) XXX_Size() int {
- return xxx_messageInfo_M.Size(m)
-}
-func (m *M) XXX_DiscardUnknown() {
- xxx_messageInfo_M.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M)(nil), "fmt.M")
-}
-
-func init() { proto.RegisterFile("imports/fmt/m.proto", fileDescriptor_m_867dd34c461422b8) }
-
-var fileDescriptor_m_867dd34c461422b8 = []byte{
- // 109 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x4f, 0xcb, 0x2d, 0xd1, 0xcf, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
- 0x62, 0x4e, 0xcb, 0x2d, 0x51, 0x62, 0xe6, 0x62, 0xf4, 0x75, 0xb2, 0x8f, 0xb2, 0x4d, 0xcf, 0x2c,
- 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07,
- 0x2b, 0x4a, 0x2a, 0x4d, 0x83, 0x30, 0x92, 0x75, 0xd3, 0x53, 0xf3, 0x74, 0xd3, 0xf3, 0xf5, 0x4b,
- 0x52, 0x8b, 0x4b, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0x91, 0x8c, 0x4c, 0x62, 0x03, 0xab, 0x31, 0x06,
- 0x04, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xc9, 0xee, 0xbe, 0x68, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto
deleted file mode 100644
index 142d8cfa..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package fmt;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt";
-message M {}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
deleted file mode 100644
index 82ec35e1..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
+++ /dev/null
@@ -1,130 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_a_1/m1.proto
-
-package test_a_1 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type E1 int32
-
-const (
- E1_E1_ZERO E1 = 0
-)
-
-var E1_name = map[int32]string{
- 0: "E1_ZERO",
-}
-var E1_value = map[string]int32{
- "E1_ZERO": 0,
-}
-
-func (x E1) String() string {
- return proto.EnumName(E1_name, int32(x))
-}
-func (E1) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_m1_56a2598431d21e61, []int{0}
-}
-
-type M1 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M1) Reset() { *m = M1{} }
-func (m *M1) String() string { return proto.CompactTextString(m) }
-func (*M1) ProtoMessage() {}
-func (*M1) Descriptor() ([]byte, []int) {
- return fileDescriptor_m1_56a2598431d21e61, []int{0}
-}
-func (m *M1) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M1.Unmarshal(m, b)
-}
-func (m *M1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M1.Marshal(b, m, deterministic)
-}
-func (dst *M1) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M1.Merge(dst, src)
-}
-func (m *M1) XXX_Size() int {
- return xxx_messageInfo_M1.Size(m)
-}
-func (m *M1) XXX_DiscardUnknown() {
- xxx_messageInfo_M1.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M1 proto.InternalMessageInfo
-
-type M1_1 struct {
- M1 *M1 `protobuf:"bytes,1,opt,name=m1" json:"m1,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M1_1) Reset() { *m = M1_1{} }
-func (m *M1_1) String() string { return proto.CompactTextString(m) }
-func (*M1_1) ProtoMessage() {}
-func (*M1_1) Descriptor() ([]byte, []int) {
- return fileDescriptor_m1_56a2598431d21e61, []int{1}
-}
-func (m *M1_1) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M1_1.Unmarshal(m, b)
-}
-func (m *M1_1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M1_1.Marshal(b, m, deterministic)
-}
-func (dst *M1_1) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M1_1.Merge(dst, src)
-}
-func (m *M1_1) XXX_Size() int {
- return xxx_messageInfo_M1_1.Size(m)
-}
-func (m *M1_1) XXX_DiscardUnknown() {
- xxx_messageInfo_M1_1.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M1_1 proto.InternalMessageInfo
-
-func (m *M1_1) GetM1() *M1 {
- if m != nil {
- return m.M1
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*M1)(nil), "test.a.M1")
- proto.RegisterType((*M1_1)(nil), "test.a.M1_1")
- proto.RegisterEnum("test.a.E1", E1_name, E1_value)
-}
-
-func init() { proto.RegisterFile("imports/test_a_1/m1.proto", fileDescriptor_m1_56a2598431d21e61) }
-
-var fileDescriptor_m1_56a2598431d21e61 = []byte{
- // 165 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd4, 0xcf, 0x35, 0xd4,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9,
- 0x1a, 0x2a, 0x29, 0x71, 0xb1, 0xf8, 0x1a, 0xc6, 0x1b, 0x0a, 0x49, 0x71, 0x31, 0xe5, 0x1a, 0x4a,
- 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x71, 0xe9, 0x41, 0x94, 0xe8, 0xf9, 0x1a, 0x06, 0x31, 0xe5,
- 0x1a, 0x6a, 0x09, 0x72, 0x31, 0xb9, 0x1a, 0x0a, 0x71, 0x73, 0xb1, 0xbb, 0x1a, 0xc6, 0x47, 0xb9,
- 0x06, 0xf9, 0x0b, 0x30, 0x38, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25,
- 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0xcd, 0x4f, 0x2a, 0x4d, 0x83,
- 0x30, 0x92, 0x75, 0xd3, 0x53, 0xf3, 0x74, 0xd3, 0xf3, 0xc1, 0x4e, 0x48, 0x49, 0x2c, 0x49, 0xd4,
- 0x47, 0x77, 0x53, 0x12, 0x1b, 0x58, 0xa1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xae, 0xc9,
- 0xcd, 0xae, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto
deleted file mode 100644
index da54c1ee..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto
+++ /dev/null
@@ -1,44 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package test.a;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1";
-
-message M1 {}
-
-message M1_1 {
- M1 m1 = 1;
-}
-
-enum E1 {
- E1_ZERO = 0;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
deleted file mode 100644
index 1b629bf3..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_a_1/m2.proto
-
-package test_a_1 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M2 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M2) Reset() { *m = M2{} }
-func (m *M2) String() string { return proto.CompactTextString(m) }
-func (*M2) ProtoMessage() {}
-func (*M2) Descriptor() ([]byte, []int) {
- return fileDescriptor_m2_ccd6356c045a9ac3, []int{0}
-}
-func (m *M2) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M2.Unmarshal(m, b)
-}
-func (m *M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M2.Marshal(b, m, deterministic)
-}
-func (dst *M2) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M2.Merge(dst, src)
-}
-func (m *M2) XXX_Size() int {
- return xxx_messageInfo_M2.Size(m)
-}
-func (m *M2) XXX_DiscardUnknown() {
- xxx_messageInfo_M2.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M2 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M2)(nil), "test.a.M2")
-}
-
-func init() { proto.RegisterFile("imports/test_a_1/m2.proto", fileDescriptor_m2_ccd6356c045a9ac3) }
-
-var fileDescriptor_m2_ccd6356c045a9ac3 = []byte{
- // 114 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd4, 0xcf, 0x35, 0xd2,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9,
- 0x1a, 0x39, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea,
- 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x15, 0x26, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba,
- 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0xb3, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0xd1, 0x0d, 0x4f,
- 0x62, 0x03, 0x2b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xe0, 0x7e, 0xc0, 0x77, 0x00,
- 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto
deleted file mode 100644
index 49499dc9..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package test.a;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1";
-message M2 {}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
deleted file mode 100644
index e3895d2b..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_a_2/m3.proto
-
-package test_a_2 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M3 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M3) Reset() { *m = M3{} }
-func (m *M3) String() string { return proto.CompactTextString(m) }
-func (*M3) ProtoMessage() {}
-func (*M3) Descriptor() ([]byte, []int) {
- return fileDescriptor_m3_de310e87d08d4216, []int{0}
-}
-func (m *M3) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M3.Unmarshal(m, b)
-}
-func (m *M3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M3.Marshal(b, m, deterministic)
-}
-func (dst *M3) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M3.Merge(dst, src)
-}
-func (m *M3) XXX_Size() int {
- return xxx_messageInfo_M3.Size(m)
-}
-func (m *M3) XXX_DiscardUnknown() {
- xxx_messageInfo_M3.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M3 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M3)(nil), "test.a.M3")
-}
-
-func init() { proto.RegisterFile("imports/test_a_2/m3.proto", fileDescriptor_m3_de310e87d08d4216) }
-
-var fileDescriptor_m3_de310e87d08d4216 = []byte{
- // 114 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd2, 0xcf, 0x35, 0xd6,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9,
- 0x1a, 0x3b, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea,
- 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x15, 0x26, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba,
- 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0xb3, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0xd1, 0x0d, 0x4f,
- 0x62, 0x03, 0x2b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x23, 0x86, 0x27, 0x47, 0x77, 0x00,
- 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto
deleted file mode 100644
index 5e811ef8..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package test.a;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2";
-message M3 {}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
deleted file mode 100644
index 65a3bad2..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_a_2/m4.proto
-
-package test_a_2 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M4 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M4) Reset() { *m = M4{} }
-func (m *M4) String() string { return proto.CompactTextString(m) }
-func (*M4) ProtoMessage() {}
-func (*M4) Descriptor() ([]byte, []int) {
- return fileDescriptor_m4_da12b386229f3791, []int{0}
-}
-func (m *M4) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M4.Unmarshal(m, b)
-}
-func (m *M4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M4.Marshal(b, m, deterministic)
-}
-func (dst *M4) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M4.Merge(dst, src)
-}
-func (m *M4) XXX_Size() int {
- return xxx_messageInfo_M4.Size(m)
-}
-func (m *M4) XXX_DiscardUnknown() {
- xxx_messageInfo_M4.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M4 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M4)(nil), "test.a.M4")
-}
-
-func init() { proto.RegisterFile("imports/test_a_2/m4.proto", fileDescriptor_m4_da12b386229f3791) }
-
-var fileDescriptor_m4_da12b386229f3791 = []byte{
- // 114 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd2, 0xcf, 0x35, 0xd1,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9,
- 0x9a, 0x38, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea,
- 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x15, 0x26, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba,
- 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0xb3, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0xd1, 0x0d, 0x4f,
- 0x62, 0x03, 0x2b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0xcb, 0x10, 0xc8, 0x77, 0x00,
- 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto
deleted file mode 100644
index 8f8fe3e1..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package test.a;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2";
-message M4 {}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
deleted file mode 100644
index 831f4149..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_b_1/m1.proto
-
-package beta // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M1 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M1) Reset() { *m = M1{} }
-func (m *M1) String() string { return proto.CompactTextString(m) }
-func (*M1) ProtoMessage() {}
-func (*M1) Descriptor() ([]byte, []int) {
- return fileDescriptor_m1_aff127b054aec649, []int{0}
-}
-func (m *M1) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M1.Unmarshal(m, b)
-}
-func (m *M1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M1.Marshal(b, m, deterministic)
-}
-func (dst *M1) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M1.Merge(dst, src)
-}
-func (m *M1) XXX_Size() int {
- return xxx_messageInfo_M1.Size(m)
-}
-func (m *M1) XXX_DiscardUnknown() {
- xxx_messageInfo_M1.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M1 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M1)(nil), "test.b.part1.M1")
-}
-
-func init() { proto.RegisterFile("imports/test_b_1/m1.proto", fileDescriptor_m1_aff127b054aec649) }
-
-var fileDescriptor_m1_aff127b054aec649 = []byte{
- // 125 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8a, 0x37, 0xd4, 0xcf, 0x35, 0xd4,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x09, 0xe9, 0x25, 0xe9, 0x15, 0x24, 0x16, 0x95,
- 0x18, 0x2a, 0xb1, 0x70, 0x31, 0xf9, 0x1a, 0x3a, 0x79, 0x46, 0xb9, 0xa7, 0x67, 0x96, 0x64, 0x94,
- 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x95, 0x27,
- 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0x13, 0x53, 0x12,
- 0x4b, 0x12, 0xf5, 0xd1, 0xad, 0xb0, 0x4e, 0x4a, 0x2d, 0x49, 0x4c, 0x62, 0x03, 0xab, 0x36, 0x06,
- 0x04, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xf1, 0x3b, 0x7f, 0x82, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto
deleted file mode 100644
index 2c35ec4a..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package test.b.part1;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1;beta";
-message M1 {}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
deleted file mode 100644
index bc741056..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_b_1/m2.proto
-
-package beta // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type M2 struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *M2) Reset() { *m = M2{} }
-func (m *M2) String() string { return proto.CompactTextString(m) }
-func (*M2) ProtoMessage() {}
-func (*M2) Descriptor() ([]byte, []int) {
- return fileDescriptor_m2_0c59cab35ba1b0d8, []int{0}
-}
-func (m *M2) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_M2.Unmarshal(m, b)
-}
-func (m *M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_M2.Marshal(b, m, deterministic)
-}
-func (dst *M2) XXX_Merge(src proto.Message) {
- xxx_messageInfo_M2.Merge(dst, src)
-}
-func (m *M2) XXX_Size() int {
- return xxx_messageInfo_M2.Size(m)
-}
-func (m *M2) XXX_DiscardUnknown() {
- xxx_messageInfo_M2.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_M2 proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*M2)(nil), "test.b.part2.M2")
-}
-
-func init() { proto.RegisterFile("imports/test_b_1/m2.proto", fileDescriptor_m2_0c59cab35ba1b0d8) }
-
-var fileDescriptor_m2_0c59cab35ba1b0d8 = []byte{
- // 125 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8a, 0x37, 0xd4, 0xcf, 0x35, 0xd2,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x09, 0xe9, 0x25, 0xe9, 0x15, 0x24, 0x16, 0x95,
- 0x18, 0x29, 0xb1, 0x70, 0x31, 0xf9, 0x1a, 0x39, 0x79, 0x46, 0xb9, 0xa7, 0x67, 0x96, 0x64, 0x94,
- 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x95, 0x27,
- 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0x13, 0x53, 0x12,
- 0x4b, 0x12, 0xf5, 0xd1, 0xad, 0xb0, 0x4e, 0x4a, 0x2d, 0x49, 0x4c, 0x62, 0x03, 0xab, 0x36, 0x06,
- 0x04, 0x00, 0x00, 0xff, 0xff, 0x44, 0x29, 0xbe, 0x6d, 0x82, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto
deleted file mode 100644
index 13723be4..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-package test.b.part2;
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1;beta";
-message M2 {}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
deleted file mode 100644
index 72daffdb..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_import_a1m1.proto
-
-package imports // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import test_a_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type A1M1 struct {
- F *test_a_1.M1 `protobuf:"bytes,1,opt,name=f" json:"f,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *A1M1) Reset() { *m = A1M1{} }
-func (m *A1M1) String() string { return proto.CompactTextString(m) }
-func (*A1M1) ProtoMessage() {}
-func (*A1M1) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_import_a1m1_d7f2b5c638a69f6e, []int{0}
-}
-func (m *A1M1) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_A1M1.Unmarshal(m, b)
-}
-func (m *A1M1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_A1M1.Marshal(b, m, deterministic)
-}
-func (dst *A1M1) XXX_Merge(src proto.Message) {
- xxx_messageInfo_A1M1.Merge(dst, src)
-}
-func (m *A1M1) XXX_Size() int {
- return xxx_messageInfo_A1M1.Size(m)
-}
-func (m *A1M1) XXX_DiscardUnknown() {
- xxx_messageInfo_A1M1.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_A1M1 proto.InternalMessageInfo
-
-func (m *A1M1) GetF() *test_a_1.M1 {
- if m != nil {
- return m.F
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*A1M1)(nil), "test.A1M1")
-}
-
-func init() {
- proto.RegisterFile("imports/test_import_a1m1.proto", fileDescriptor_test_import_a1m1_d7f2b5c638a69f6e)
-}
-
-var fileDescriptor_test_import_a1m1_d7f2b5c638a69f6e = []byte{
- // 149 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x87, 0x70, 0xe2, 0x13, 0x0d, 0x73, 0x0d,
- 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x58, 0x40, 0xe2, 0x52, 0x92, 0x28, 0xaa, 0x12, 0xe3,
- 0x0d, 0xf5, 0x61, 0x0a, 0x94, 0x14, 0xb8, 0x58, 0x1c, 0x0d, 0x7d, 0x0d, 0x85, 0x24, 0xb8, 0x18,
- 0xd3, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xb8, 0xf4, 0x40, 0xca, 0xf4, 0x12, 0xf5, 0x7c,
- 0x0d, 0x83, 0x18, 0xd3, 0x9c, 0xac, 0xa3, 0x2c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92,
- 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xc1, 0x9a, 0x93, 0x4a, 0xd3, 0x20,
- 0x8c, 0x64, 0xdd, 0xf4, 0xd4, 0x3c, 0xdd, 0xf4, 0x7c, 0xb0, 0xf9, 0x29, 0x89, 0x25, 0x89, 0xfa,
- 0x50, 0x0b, 0x93, 0xd8, 0xc0, 0xf2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x2f, 0x18,
- 0x23, 0xa8, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto
deleted file mode 100644
index abf07f2a..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto
+++ /dev/null
@@ -1,42 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package test;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports";
-
-import "imports/test_a_1/m1.proto";
-
-message A1M1 {
- test.a.M1 f = 1;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
deleted file mode 100644
index 9e36ebde..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_import_a1m2.proto
-
-package imports // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import test_a_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type A1M2 struct {
- F *test_a_1.M2 `protobuf:"bytes,1,opt,name=f" json:"f,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *A1M2) Reset() { *m = A1M2{} }
-func (m *A1M2) String() string { return proto.CompactTextString(m) }
-func (*A1M2) ProtoMessage() {}
-func (*A1M2) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_import_a1m2_9a3281ce9464e116, []int{0}
-}
-func (m *A1M2) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_A1M2.Unmarshal(m, b)
-}
-func (m *A1M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_A1M2.Marshal(b, m, deterministic)
-}
-func (dst *A1M2) XXX_Merge(src proto.Message) {
- xxx_messageInfo_A1M2.Merge(dst, src)
-}
-func (m *A1M2) XXX_Size() int {
- return xxx_messageInfo_A1M2.Size(m)
-}
-func (m *A1M2) XXX_DiscardUnknown() {
- xxx_messageInfo_A1M2.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_A1M2 proto.InternalMessageInfo
-
-func (m *A1M2) GetF() *test_a_1.M2 {
- if m != nil {
- return m.F
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*A1M2)(nil), "test.A1M2")
-}
-
-func init() {
- proto.RegisterFile("imports/test_import_a1m2.proto", fileDescriptor_test_import_a1m2_9a3281ce9464e116)
-}
-
-var fileDescriptor_test_import_a1m2_9a3281ce9464e116 = []byte{
- // 149 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0xcc, 0x2d, 0xc8,
- 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x87, 0x70, 0xe2, 0x13, 0x0d, 0x73, 0x8d,
- 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x58, 0x40, 0xe2, 0x52, 0x92, 0x28, 0xaa, 0x12, 0xe3,
- 0x0d, 0xf5, 0x61, 0x0a, 0x94, 0x14, 0xb8, 0x58, 0x1c, 0x0d, 0x7d, 0x8d, 0x84, 0x24, 0xb8, 0x18,
- 0xd3, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xb8, 0xf4, 0x40, 0xca, 0xf4, 0x12, 0xf5, 0x7c,
- 0x8d, 0x82, 0x18, 0xd3, 0x9c, 0xac, 0xa3, 0x2c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92,
- 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xc1, 0x9a, 0x93, 0x4a, 0xd3, 0x20,
- 0x8c, 0x64, 0xdd, 0xf4, 0xd4, 0x3c, 0xdd, 0xf4, 0x7c, 0xb0, 0xf9, 0x29, 0x89, 0x25, 0x89, 0xfa,
- 0x50, 0x0b, 0x93, 0xd8, 0xc0, 0xf2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x88, 0xfb,
- 0xea, 0xa8, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto
deleted file mode 100644
index 5c53950d..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto
+++ /dev/null
@@ -1,42 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package test;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports";
-
-import "imports/test_a_1/m2.proto";
-
-message A1M2 {
- test.a.M2 f = 1;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go
deleted file mode 100644
index f40e0b73..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go
+++ /dev/null
@@ -1,138 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: imports/test_import_all.proto
-
-package imports // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import fmt1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt"
-import test_a_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"
-import test_a_2 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2"
-import test_b_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type All struct {
- Am1 *test_a_1.M1 `protobuf:"bytes,1,opt,name=am1" json:"am1,omitempty"`
- Am2 *test_a_1.M2 `protobuf:"bytes,2,opt,name=am2" json:"am2,omitempty"`
- Am3 *test_a_2.M3 `protobuf:"bytes,3,opt,name=am3" json:"am3,omitempty"`
- Am4 *test_a_2.M4 `protobuf:"bytes,4,opt,name=am4" json:"am4,omitempty"`
- Bm1 *test_b_1.M1 `protobuf:"bytes,5,opt,name=bm1" json:"bm1,omitempty"`
- Bm2 *test_b_1.M2 `protobuf:"bytes,6,opt,name=bm2" json:"bm2,omitempty"`
- Fmt *fmt1.M `protobuf:"bytes,7,opt,name=fmt" json:"fmt,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *All) Reset() { *m = All{} }
-func (m *All) String() string { return proto.CompactTextString(m) }
-func (*All) ProtoMessage() {}
-func (*All) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_import_all_b41dc4592e4a4f3b, []int{0}
-}
-func (m *All) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_All.Unmarshal(m, b)
-}
-func (m *All) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_All.Marshal(b, m, deterministic)
-}
-func (dst *All) XXX_Merge(src proto.Message) {
- xxx_messageInfo_All.Merge(dst, src)
-}
-func (m *All) XXX_Size() int {
- return xxx_messageInfo_All.Size(m)
-}
-func (m *All) XXX_DiscardUnknown() {
- xxx_messageInfo_All.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_All proto.InternalMessageInfo
-
-func (m *All) GetAm1() *test_a_1.M1 {
- if m != nil {
- return m.Am1
- }
- return nil
-}
-
-func (m *All) GetAm2() *test_a_1.M2 {
- if m != nil {
- return m.Am2
- }
- return nil
-}
-
-func (m *All) GetAm3() *test_a_2.M3 {
- if m != nil {
- return m.Am3
- }
- return nil
-}
-
-func (m *All) GetAm4() *test_a_2.M4 {
- if m != nil {
- return m.Am4
- }
- return nil
-}
-
-func (m *All) GetBm1() *test_b_1.M1 {
- if m != nil {
- return m.Bm1
- }
- return nil
-}
-
-func (m *All) GetBm2() *test_b_1.M2 {
- if m != nil {
- return m.Bm2
- }
- return nil
-}
-
-func (m *All) GetFmt() *fmt1.M {
- if m != nil {
- return m.Fmt
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*All)(nil), "test.All")
-}
-
-func init() {
- proto.RegisterFile("imports/test_import_all.proto", fileDescriptor_test_import_all_b41dc4592e4a4f3b)
-}
-
-var fileDescriptor_test_import_all_b41dc4592e4a4f3b = []byte{
- // 258 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0xd0, 0xb1, 0x4e, 0xc3, 0x30,
- 0x10, 0x06, 0x60, 0x15, 0x97, 0x20, 0x99, 0x05, 0x85, 0xc5, 0x20, 0x90, 0x50, 0x27, 0x96, 0xda,
- 0xb2, 0x9d, 0x05, 0x31, 0xc1, 0xde, 0xa5, 0x23, 0x4b, 0x64, 0x97, 0xc6, 0x54, 0xf2, 0xd5, 0x51,
- 0x7a, 0x7d, 0x5e, 0x5e, 0x05, 0xd9, 0x07, 0x12, 0x84, 0x66, 0x4b, 0xfe, 0xef, 0xb7, 0xce, 0x3e,
- 0x7e, 0xbf, 0x83, 0x3e, 0x0d, 0x78, 0x50, 0xb8, 0x3d, 0x60, 0x4b, 0x3f, 0xad, 0x8b, 0x51, 0xf6,
- 0x43, 0xc2, 0x54, 0xcf, 0x73, 0x7c, 0x7b, 0xf3, 0xa7, 0xe4, 0x5a, 0xad, 0x40, 0x53, 0xe1, 0x14,
- 0x99, 0x09, 0x32, 0x0a, 0xec, 0x34, 0x35, 0x27, 0xc9, 0x4f, 0xcf, 0xf2, 0xbf, 0x67, 0x5d, 0xff,
- 0x50, 0x07, 0xa8, 0x80, 0xc2, 0xc5, 0xe7, 0x8c, 0xb3, 0x97, 0x18, 0xeb, 0x3b, 0xce, 0x1c, 0x68,
- 0x31, 0x7b, 0x98, 0x3d, 0x5e, 0x1a, 0x2e, 0xf3, 0x69, 0xe9, 0xe4, 0x4a, 0xaf, 0x73, 0x4c, 0x6a,
- 0xc4, 0xd9, 0x48, 0x4d, 0x56, 0x43, 0x6a, 0x05, 0x1b, 0xa9, 0xcd, 0x6a, 0x49, 0x1b, 0x31, 0x1f,
- 0x69, 0x93, 0xb5, 0xa9, 0x17, 0x9c, 0x79, 0xd0, 0xe2, 0xbc, 0xe8, 0x15, 0xa9, 0x97, 0xbd, 0x1b,
- 0x50, 0x97, 0xe9, 0x1e, 0x34, 0x75, 0x8c, 0xa8, 0xfe, 0x77, 0x4c, 0xb9, 0x83, 0x07, 0x53, 0x0b,
- 0xce, 0x3a, 0x40, 0x71, 0x51, 0x3a, 0x95, 0xec, 0x00, 0xe5, 0x6a, 0x9d, 0xa3, 0xd7, 0xe7, 0xb7,
- 0xa7, 0xb0, 0xc3, 0x8f, 0xa3, 0x97, 0x9b, 0x04, 0x2a, 0xa4, 0xe8, 0xf6, 0x41, 0x95, 0xc7, 0xfb,
- 0x63, 0x47, 0x1f, 0x9b, 0x65, 0xd8, 0xee, 0x97, 0x21, 0x95, 0xa5, 0xbd, 0x3b, 0x74, 0xea, 0x7b,
- 0x55, 0xbe, 0x2a, 0x6e, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x95, 0x39, 0xa3, 0x82, 0x03, 0x02,
- 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto
deleted file mode 100644
index 582d722e..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto
+++ /dev/null
@@ -1,58 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package test;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports";
-
-// test_a_1/m*.proto are in the same Go package and proto package.
-// test_a_*/*.proto are in different Go packages, but the same proto package.
-// test_b_1/*.proto are in the same Go package, but different proto packages.
-// fmt/m.proto has a package name which conflicts with "fmt".
-import "imports/test_a_1/m1.proto";
-import "imports/test_a_1/m2.proto";
-import "imports/test_a_2/m3.proto";
-import "imports/test_a_2/m4.proto";
-import "imports/test_b_1/m1.proto";
-import "imports/test_b_1/m2.proto";
-import "imports/fmt/m.proto";
-
-message All {
- test.a.M1 am1 = 1;
- test.a.M2 am2 = 2;
- test.a.M3 am3 = 3;
- test.a.M4 am4 = 4;
- test.b.part1.M1 bm1 = 5;
- test.b.part2.M2 bm2 = 6;
- fmt.M fmt = 7;
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go
deleted file mode 100644
index 7ec1f2db..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A simple binary to link together the protocol buffers in this test.
-
-package testdata
-
-import (
- "testing"
-
- importspb "github.com/golang/protobuf/protoc-gen-go/testdata/imports"
- multipb "github.com/golang/protobuf/protoc-gen-go/testdata/multi"
- mytestpb "github.com/golang/protobuf/protoc-gen-go/testdata/my_test"
-)
-
-func TestLink(t *testing.T) {
- _ = &multipb.Multi1{}
- _ = &mytestpb.Request{}
- _ = &importspb.All{}
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go
deleted file mode 100644
index da0fdf8f..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go
+++ /dev/null
@@ -1,96 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: multi/multi1.proto
-
-package multitest // import "github.com/golang/protobuf/protoc-gen-go/testdata/multi"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Multi1 struct {
- Multi2 *Multi2 `protobuf:"bytes,1,req,name=multi2" json:"multi2,omitempty"`
- Color *Multi2_Color `protobuf:"varint,2,opt,name=color,enum=multitest.Multi2_Color" json:"color,omitempty"`
- HatType *Multi3_HatType `protobuf:"varint,3,opt,name=hat_type,json=hatType,enum=multitest.Multi3_HatType" json:"hat_type,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Multi1) Reset() { *m = Multi1{} }
-func (m *Multi1) String() string { return proto.CompactTextString(m) }
-func (*Multi1) ProtoMessage() {}
-func (*Multi1) Descriptor() ([]byte, []int) {
- return fileDescriptor_multi1_08e50c6822e808b8, []int{0}
-}
-func (m *Multi1) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Multi1.Unmarshal(m, b)
-}
-func (m *Multi1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Multi1.Marshal(b, m, deterministic)
-}
-func (dst *Multi1) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Multi1.Merge(dst, src)
-}
-func (m *Multi1) XXX_Size() int {
- return xxx_messageInfo_Multi1.Size(m)
-}
-func (m *Multi1) XXX_DiscardUnknown() {
- xxx_messageInfo_Multi1.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Multi1 proto.InternalMessageInfo
-
-func (m *Multi1) GetMulti2() *Multi2 {
- if m != nil {
- return m.Multi2
- }
- return nil
-}
-
-func (m *Multi1) GetColor() Multi2_Color {
- if m != nil && m.Color != nil {
- return *m.Color
- }
- return Multi2_BLUE
-}
-
-func (m *Multi1) GetHatType() Multi3_HatType {
- if m != nil && m.HatType != nil {
- return *m.HatType
- }
- return Multi3_FEDORA
-}
-
-func init() {
- proto.RegisterType((*Multi1)(nil), "multitest.Multi1")
-}
-
-func init() { proto.RegisterFile("multi/multi1.proto", fileDescriptor_multi1_08e50c6822e808b8) }
-
-var fileDescriptor_multi1_08e50c6822e808b8 = []byte{
- // 200 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2d, 0xcd, 0x29,
- 0xc9, 0xd4, 0x07, 0x93, 0x86, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x60, 0x5e, 0x49,
- 0x6a, 0x71, 0x89, 0x14, 0xb2, 0xb4, 0x11, 0x44, 0x1a, 0x45, 0xcc, 0x18, 0x22, 0xa6, 0x34, 0x83,
- 0x91, 0x8b, 0xcd, 0x17, 0x6c, 0x86, 0x90, 0x26, 0x17, 0x1b, 0x44, 0xb9, 0x04, 0xa3, 0x02, 0x93,
- 0x06, 0xb7, 0x91, 0xa0, 0x1e, 0xdc, 0x38, 0x3d, 0xb0, 0x12, 0xa3, 0x20, 0xa8, 0x02, 0x21, 0x5d,
- 0x2e, 0xd6, 0xe4, 0xfc, 0x9c, 0xfc, 0x22, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x3e, 0x23, 0x71, 0x0c,
- 0x95, 0x7a, 0xce, 0x20, 0xe9, 0x20, 0x88, 0x2a, 0x21, 0x13, 0x2e, 0x8e, 0x8c, 0xc4, 0x92, 0xf8,
- 0x92, 0xca, 0x82, 0x54, 0x09, 0x66, 0xb0, 0x0e, 0x49, 0x74, 0x1d, 0xc6, 0x7a, 0x1e, 0x89, 0x25,
- 0x21, 0x95, 0x05, 0xa9, 0x41, 0xec, 0x19, 0x10, 0x86, 0x93, 0x73, 0x94, 0x63, 0x7a, 0x66, 0x49,
- 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, 0xba, 0x3e, 0xd8,
- 0xd5, 0x49, 0xa5, 0x69, 0x10, 0x46, 0xb2, 0x6e, 0x7a, 0x6a, 0x9e, 0x6e, 0x7a, 0xbe, 0x3e, 0xc8,
- 0xa0, 0x94, 0xc4, 0x92, 0x44, 0x88, 0xe7, 0xac, 0xe1, 0x86, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
- 0x60, 0x7d, 0xfc, 0x9f, 0x27, 0x01, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto
deleted file mode 100644
index d3a32041..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto
+++ /dev/null
@@ -1,46 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-import "multi/multi2.proto";
-import "multi/multi3.proto";
-
-package multitest;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/multi;multitest";
-
-message Multi1 {
- required Multi2 multi2 = 1;
- optional Multi2.Color color = 2;
- optional Multi3.HatType hat_type = 3;
-}
-
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go
deleted file mode 100644
index b66ce793..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: multi/multi2.proto
-
-package multitest // import "github.com/golang/protobuf/protoc-gen-go/testdata/multi"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Multi2_Color int32
-
-const (
- Multi2_BLUE Multi2_Color = 1
- Multi2_GREEN Multi2_Color = 2
- Multi2_RED Multi2_Color = 3
-)
-
-var Multi2_Color_name = map[int32]string{
- 1: "BLUE",
- 2: "GREEN",
- 3: "RED",
-}
-var Multi2_Color_value = map[string]int32{
- "BLUE": 1,
- "GREEN": 2,
- "RED": 3,
-}
-
-func (x Multi2_Color) Enum() *Multi2_Color {
- p := new(Multi2_Color)
- *p = x
- return p
-}
-func (x Multi2_Color) String() string {
- return proto.EnumName(Multi2_Color_name, int32(x))
-}
-func (x *Multi2_Color) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(Multi2_Color_value, data, "Multi2_Color")
- if err != nil {
- return err
- }
- *x = Multi2_Color(value)
- return nil
-}
-func (Multi2_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_multi2_c47490ad66d93e67, []int{0, 0}
-}
-
-type Multi2 struct {
- RequiredValue *int32 `protobuf:"varint,1,req,name=required_value,json=requiredValue" json:"required_value,omitempty"`
- Color *Multi2_Color `protobuf:"varint,2,opt,name=color,enum=multitest.Multi2_Color" json:"color,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Multi2) Reset() { *m = Multi2{} }
-func (m *Multi2) String() string { return proto.CompactTextString(m) }
-func (*Multi2) ProtoMessage() {}
-func (*Multi2) Descriptor() ([]byte, []int) {
- return fileDescriptor_multi2_c47490ad66d93e67, []int{0}
-}
-func (m *Multi2) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Multi2.Unmarshal(m, b)
-}
-func (m *Multi2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Multi2.Marshal(b, m, deterministic)
-}
-func (dst *Multi2) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Multi2.Merge(dst, src)
-}
-func (m *Multi2) XXX_Size() int {
- return xxx_messageInfo_Multi2.Size(m)
-}
-func (m *Multi2) XXX_DiscardUnknown() {
- xxx_messageInfo_Multi2.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Multi2 proto.InternalMessageInfo
-
-func (m *Multi2) GetRequiredValue() int32 {
- if m != nil && m.RequiredValue != nil {
- return *m.RequiredValue
- }
- return 0
-}
-
-func (m *Multi2) GetColor() Multi2_Color {
- if m != nil && m.Color != nil {
- return *m.Color
- }
- return Multi2_BLUE
-}
-
-func init() {
- proto.RegisterType((*Multi2)(nil), "multitest.Multi2")
- proto.RegisterEnum("multitest.Multi2_Color", Multi2_Color_name, Multi2_Color_value)
-}
-
-func init() { proto.RegisterFile("multi/multi2.proto", fileDescriptor_multi2_c47490ad66d93e67) }
-
-var fileDescriptor_multi2_c47490ad66d93e67 = []byte{
- // 202 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2d, 0xcd, 0x29,
- 0xc9, 0xd4, 0x07, 0x93, 0x46, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x60, 0x5e, 0x49,
- 0x6a, 0x71, 0x89, 0x52, 0x2b, 0x23, 0x17, 0x9b, 0x2f, 0x58, 0x4e, 0x48, 0x95, 0x8b, 0xaf, 0x28,
- 0xb5, 0xb0, 0x34, 0xb3, 0x28, 0x35, 0x25, 0xbe, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x51, 0x81,
- 0x49, 0x83, 0x35, 0x88, 0x17, 0x26, 0x1a, 0x06, 0x12, 0x14, 0xd2, 0xe5, 0x62, 0x4d, 0xce, 0xcf,
- 0xc9, 0x2f, 0x92, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x33, 0x12, 0xd7, 0x83, 0x1b, 0xa6, 0x07, 0x31,
- 0x48, 0xcf, 0x19, 0x24, 0x1d, 0x04, 0x51, 0xa5, 0xa4, 0xca, 0xc5, 0x0a, 0xe6, 0x0b, 0x71, 0x70,
- 0xb1, 0x38, 0xf9, 0x84, 0xba, 0x0a, 0x30, 0x0a, 0x71, 0x72, 0xb1, 0xba, 0x07, 0xb9, 0xba, 0xfa,
- 0x09, 0x30, 0x09, 0xb1, 0x73, 0x31, 0x07, 0xb9, 0xba, 0x08, 0x30, 0x3b, 0x39, 0x47, 0x39, 0xa6,
- 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5,
- 0xeb, 0x83, 0x5d, 0x9b, 0x54, 0x9a, 0x06, 0x61, 0x24, 0xeb, 0xa6, 0xa7, 0xe6, 0xe9, 0xa6, 0xe7,
- 0xeb, 0x83, 0xec, 0x4a, 0x49, 0x2c, 0x49, 0x84, 0x78, 0xca, 0x1a, 0x6e, 0x3f, 0x20, 0x00, 0x00,
- 0xff, 0xff, 0x49, 0x3b, 0x52, 0x44, 0xec, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto
deleted file mode 100644
index ec5b431e..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto
+++ /dev/null
@@ -1,48 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-package multitest;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/multi;multitest";
-
-message Multi2 {
- required int32 required_value = 1;
-
- enum Color {
- BLUE = 1;
- GREEN = 2;
- RED = 3;
- };
- optional Color color = 2;
-}
-
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go
deleted file mode 100644
index f03c350a..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: multi/multi3.proto
-
-package multitest // import "github.com/golang/protobuf/protoc-gen-go/testdata/multi"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Multi3_HatType int32
-
-const (
- Multi3_FEDORA Multi3_HatType = 1
- Multi3_FEZ Multi3_HatType = 2
-)
-
-var Multi3_HatType_name = map[int32]string{
- 1: "FEDORA",
- 2: "FEZ",
-}
-var Multi3_HatType_value = map[string]int32{
- "FEDORA": 1,
- "FEZ": 2,
-}
-
-func (x Multi3_HatType) Enum() *Multi3_HatType {
- p := new(Multi3_HatType)
- *p = x
- return p
-}
-func (x Multi3_HatType) String() string {
- return proto.EnumName(Multi3_HatType_name, int32(x))
-}
-func (x *Multi3_HatType) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(Multi3_HatType_value, data, "Multi3_HatType")
- if err != nil {
- return err
- }
- *x = Multi3_HatType(value)
- return nil
-}
-func (Multi3_HatType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_multi3_d55a72b4628b7875, []int{0, 0}
-}
-
-type Multi3 struct {
- HatType *Multi3_HatType `protobuf:"varint,1,opt,name=hat_type,json=hatType,enum=multitest.Multi3_HatType" json:"hat_type,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Multi3) Reset() { *m = Multi3{} }
-func (m *Multi3) String() string { return proto.CompactTextString(m) }
-func (*Multi3) ProtoMessage() {}
-func (*Multi3) Descriptor() ([]byte, []int) {
- return fileDescriptor_multi3_d55a72b4628b7875, []int{0}
-}
-func (m *Multi3) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Multi3.Unmarshal(m, b)
-}
-func (m *Multi3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Multi3.Marshal(b, m, deterministic)
-}
-func (dst *Multi3) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Multi3.Merge(dst, src)
-}
-func (m *Multi3) XXX_Size() int {
- return xxx_messageInfo_Multi3.Size(m)
-}
-func (m *Multi3) XXX_DiscardUnknown() {
- xxx_messageInfo_Multi3.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Multi3 proto.InternalMessageInfo
-
-func (m *Multi3) GetHatType() Multi3_HatType {
- if m != nil && m.HatType != nil {
- return *m.HatType
- }
- return Multi3_FEDORA
-}
-
-func init() {
- proto.RegisterType((*Multi3)(nil), "multitest.Multi3")
- proto.RegisterEnum("multitest.Multi3_HatType", Multi3_HatType_name, Multi3_HatType_value)
-}
-
-func init() { proto.RegisterFile("multi/multi3.proto", fileDescriptor_multi3_d55a72b4628b7875) }
-
-var fileDescriptor_multi3_d55a72b4628b7875 = []byte{
- // 170 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2d, 0xcd, 0x29,
- 0xc9, 0xd4, 0x07, 0x93, 0xc6, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x60, 0x5e, 0x49,
- 0x6a, 0x71, 0x89, 0x52, 0x1c, 0x17, 0x9b, 0x2f, 0x58, 0x4a, 0xc8, 0x84, 0x8b, 0x23, 0x23, 0xb1,
- 0x24, 0xbe, 0xa4, 0xb2, 0x20, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xcf, 0x48, 0x52, 0x0f, 0xae,
- 0x4e, 0x0f, 0xa2, 0x48, 0xcf, 0x23, 0xb1, 0x24, 0xa4, 0xb2, 0x20, 0x35, 0x88, 0x3d, 0x03, 0xc2,
- 0x50, 0x92, 0xe3, 0x62, 0x87, 0x8a, 0x09, 0x71, 0x71, 0xb1, 0xb9, 0xb9, 0xba, 0xf8, 0x07, 0x39,
- 0x0a, 0x30, 0x0a, 0xb1, 0x73, 0x31, 0xbb, 0xb9, 0x46, 0x09, 0x30, 0x39, 0x39, 0x47, 0x39, 0xa6,
- 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5,
- 0xeb, 0x83, 0x5d, 0x91, 0x54, 0x9a, 0x06, 0x61, 0x24, 0xeb, 0xa6, 0xa7, 0xe6, 0xe9, 0xa6, 0xe7,
- 0xeb, 0x83, 0x2c, 0x4a, 0x49, 0x2c, 0x49, 0x84, 0x38, 0xd6, 0x1a, 0x6e, 0x39, 0x20, 0x00, 0x00,
- 0xff, 0xff, 0xd5, 0xa4, 0x1a, 0x0e, 0xc4, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto
deleted file mode 100644
index 8690b881..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto
+++ /dev/null
@@ -1,45 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-package multitest;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/multi;multitest";
-
-message Multi3 {
- enum HatType {
- FEDORA = 1;
- FEZ = 2;
- };
- optional HatType hat_type = 1;
-}
-
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go
deleted file mode 100644
index 8cf6a698..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go
+++ /dev/null
@@ -1,1174 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: my_test/test.proto
-
-package test // import "github.com/golang/protobuf/protoc-gen-go/testdata/my_test"
-
-/*
-This package holds interesting messages.
-*/
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import _ "github.com/golang/protobuf/protoc-gen-go/testdata/multi"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type HatType int32
-
-const (
- // deliberately skipping 0
- HatType_FEDORA HatType = 1
- HatType_FEZ HatType = 2
-)
-
-var HatType_name = map[int32]string{
- 1: "FEDORA",
- 2: "FEZ",
-}
-var HatType_value = map[string]int32{
- "FEDORA": 1,
- "FEZ": 2,
-}
-
-func (x HatType) Enum() *HatType {
- p := new(HatType)
- *p = x
- return p
-}
-func (x HatType) String() string {
- return proto.EnumName(HatType_name, int32(x))
-}
-func (x *HatType) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(HatType_value, data, "HatType")
- if err != nil {
- return err
- }
- *x = HatType(value)
- return nil
-}
-func (HatType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{0}
-}
-
-// This enum represents days of the week.
-type Days int32
-
-const (
- Days_MONDAY Days = 1
- Days_TUESDAY Days = 2
- Days_LUNDI Days = 1
-)
-
-var Days_name = map[int32]string{
- 1: "MONDAY",
- 2: "TUESDAY",
- // Duplicate value: 1: "LUNDI",
-}
-var Days_value = map[string]int32{
- "MONDAY": 1,
- "TUESDAY": 2,
- "LUNDI": 1,
-}
-
-func (x Days) Enum() *Days {
- p := new(Days)
- *p = x
- return p
-}
-func (x Days) String() string {
- return proto.EnumName(Days_name, int32(x))
-}
-func (x *Days) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(Days_value, data, "Days")
- if err != nil {
- return err
- }
- *x = Days(value)
- return nil
-}
-func (Days) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{1}
-}
-
-type Request_Color int32
-
-const (
- Request_RED Request_Color = 0
- Request_GREEN Request_Color = 1
- Request_BLUE Request_Color = 2
-)
-
-var Request_Color_name = map[int32]string{
- 0: "RED",
- 1: "GREEN",
- 2: "BLUE",
-}
-var Request_Color_value = map[string]int32{
- "RED": 0,
- "GREEN": 1,
- "BLUE": 2,
-}
-
-func (x Request_Color) Enum() *Request_Color {
- p := new(Request_Color)
- *p = x
- return p
-}
-func (x Request_Color) String() string {
- return proto.EnumName(Request_Color_name, int32(x))
-}
-func (x *Request_Color) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(Request_Color_value, data, "Request_Color")
- if err != nil {
- return err
- }
- *x = Request_Color(value)
- return nil
-}
-func (Request_Color) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{0, 0}
-}
-
-type Reply_Entry_Game int32
-
-const (
- Reply_Entry_FOOTBALL Reply_Entry_Game = 1
- Reply_Entry_TENNIS Reply_Entry_Game = 2
-)
-
-var Reply_Entry_Game_name = map[int32]string{
- 1: "FOOTBALL",
- 2: "TENNIS",
-}
-var Reply_Entry_Game_value = map[string]int32{
- "FOOTBALL": 1,
- "TENNIS": 2,
-}
-
-func (x Reply_Entry_Game) Enum() *Reply_Entry_Game {
- p := new(Reply_Entry_Game)
- *p = x
- return p
-}
-func (x Reply_Entry_Game) String() string {
- return proto.EnumName(Reply_Entry_Game_name, int32(x))
-}
-func (x *Reply_Entry_Game) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(Reply_Entry_Game_value, data, "Reply_Entry_Game")
- if err != nil {
- return err
- }
- *x = Reply_Entry_Game(value)
- return nil
-}
-func (Reply_Entry_Game) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{1, 0, 0}
-}
-
-// This is a message that might be sent somewhere.
-type Request struct {
- Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"`
- // optional imp.ImportedMessage imported_message = 2;
- Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"`
- Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"`
- // optional imp.ImportedMessage.Owner owner = 6;
- Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"`
- Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup,json=somegroup" json:"somegroup,omitempty"`
- // This is a map field. It will generate map[int32]string.
- NameMapping map[int32]string `protobuf:"bytes,14,rep,name=name_mapping,json=nameMapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- // This is a map field whose value type is a message.
- MsgMapping map[int64]*Reply `protobuf:"bytes,15,rep,name=msg_mapping,json=msgMapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"`
- // This field should not conflict with any getters.
- GetKey_ *string `protobuf:"bytes,16,opt,name=get_key,json=getKey" json:"get_key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Request) Reset() { *m = Request{} }
-func (m *Request) String() string { return proto.CompactTextString(m) }
-func (*Request) ProtoMessage() {}
-func (*Request) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{0}
-}
-func (m *Request) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Request.Unmarshal(m, b)
-}
-func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Request.Marshal(b, m, deterministic)
-}
-func (dst *Request) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Request.Merge(dst, src)
-}
-func (m *Request) XXX_Size() int {
- return xxx_messageInfo_Request.Size(m)
-}
-func (m *Request) XXX_DiscardUnknown() {
- xxx_messageInfo_Request.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Request proto.InternalMessageInfo
-
-const Default_Request_Hat HatType = HatType_FEDORA
-
-var Default_Request_Deadline float32 = float32(math.Inf(1))
-
-func (m *Request) GetKey() []int64 {
- if m != nil {
- return m.Key
- }
- return nil
-}
-
-func (m *Request) GetHue() Request_Color {
- if m != nil && m.Hue != nil {
- return *m.Hue
- }
- return Request_RED
-}
-
-func (m *Request) GetHat() HatType {
- if m != nil && m.Hat != nil {
- return *m.Hat
- }
- return Default_Request_Hat
-}
-
-func (m *Request) GetDeadline() float32 {
- if m != nil && m.Deadline != nil {
- return *m.Deadline
- }
- return Default_Request_Deadline
-}
-
-func (m *Request) GetSomegroup() *Request_SomeGroup {
- if m != nil {
- return m.Somegroup
- }
- return nil
-}
-
-func (m *Request) GetNameMapping() map[int32]string {
- if m != nil {
- return m.NameMapping
- }
- return nil
-}
-
-func (m *Request) GetMsgMapping() map[int64]*Reply {
- if m != nil {
- return m.MsgMapping
- }
- return nil
-}
-
-func (m *Request) GetReset_() int32 {
- if m != nil && m.Reset_ != nil {
- return *m.Reset_
- }
- return 0
-}
-
-func (m *Request) GetGetKey_() string {
- if m != nil && m.GetKey_ != nil {
- return *m.GetKey_
- }
- return ""
-}
-
-type Request_SomeGroup struct {
- GroupField *int32 `protobuf:"varint,9,opt,name=group_field,json=groupField" json:"group_field,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Request_SomeGroup) Reset() { *m = Request_SomeGroup{} }
-func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) }
-func (*Request_SomeGroup) ProtoMessage() {}
-func (*Request_SomeGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{0, 0}
-}
-func (m *Request_SomeGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Request_SomeGroup.Unmarshal(m, b)
-}
-func (m *Request_SomeGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Request_SomeGroup.Marshal(b, m, deterministic)
-}
-func (dst *Request_SomeGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Request_SomeGroup.Merge(dst, src)
-}
-func (m *Request_SomeGroup) XXX_Size() int {
- return xxx_messageInfo_Request_SomeGroup.Size(m)
-}
-func (m *Request_SomeGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_Request_SomeGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Request_SomeGroup proto.InternalMessageInfo
-
-func (m *Request_SomeGroup) GetGroupField() int32 {
- if m != nil && m.GroupField != nil {
- return *m.GroupField
- }
- return 0
-}
-
-type Reply struct {
- Found []*Reply_Entry `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"`
- CompactKeys []int32 `protobuf:"varint,2,rep,packed,name=compact_keys,json=compactKeys" json:"compact_keys,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Reply) Reset() { *m = Reply{} }
-func (m *Reply) String() string { return proto.CompactTextString(m) }
-func (*Reply) ProtoMessage() {}
-func (*Reply) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{1}
-}
-
-var extRange_Reply = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*Reply) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_Reply
-}
-func (m *Reply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Reply.Unmarshal(m, b)
-}
-func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Reply.Marshal(b, m, deterministic)
-}
-func (dst *Reply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Reply.Merge(dst, src)
-}
-func (m *Reply) XXX_Size() int {
- return xxx_messageInfo_Reply.Size(m)
-}
-func (m *Reply) XXX_DiscardUnknown() {
- xxx_messageInfo_Reply.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Reply proto.InternalMessageInfo
-
-func (m *Reply) GetFound() []*Reply_Entry {
- if m != nil {
- return m.Found
- }
- return nil
-}
-
-func (m *Reply) GetCompactKeys() []int32 {
- if m != nil {
- return m.CompactKeys
- }
- return nil
-}
-
-type Reply_Entry struct {
- KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng,json=keyThatNeeds1234camelCasIng" json:"key_that_needs_1234camel_CasIng,omitempty"`
- Value *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"`
- XMyFieldName_2 *int64 `protobuf:"varint,3,opt,name=_my_field_name_2,json=MyFieldName2" json:"_my_field_name_2,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Reply_Entry) Reset() { *m = Reply_Entry{} }
-func (m *Reply_Entry) String() string { return proto.CompactTextString(m) }
-func (*Reply_Entry) ProtoMessage() {}
-func (*Reply_Entry) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{1, 0}
-}
-func (m *Reply_Entry) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Reply_Entry.Unmarshal(m, b)
-}
-func (m *Reply_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Reply_Entry.Marshal(b, m, deterministic)
-}
-func (dst *Reply_Entry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Reply_Entry.Merge(dst, src)
-}
-func (m *Reply_Entry) XXX_Size() int {
- return xxx_messageInfo_Reply_Entry.Size(m)
-}
-func (m *Reply_Entry) XXX_DiscardUnknown() {
- xxx_messageInfo_Reply_Entry.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Reply_Entry proto.InternalMessageInfo
-
-const Default_Reply_Entry_Value int64 = 7
-
-func (m *Reply_Entry) GetKeyThatNeeds_1234Camel_CasIng() int64 {
- if m != nil && m.KeyThatNeeds_1234Camel_CasIng != nil {
- return *m.KeyThatNeeds_1234Camel_CasIng
- }
- return 0
-}
-
-func (m *Reply_Entry) GetValue() int64 {
- if m != nil && m.Value != nil {
- return *m.Value
- }
- return Default_Reply_Entry_Value
-}
-
-func (m *Reply_Entry) GetXMyFieldName_2() int64 {
- if m != nil && m.XMyFieldName_2 != nil {
- return *m.XMyFieldName_2
- }
- return 0
-}
-
-type OtherBase struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OtherBase) Reset() { *m = OtherBase{} }
-func (m *OtherBase) String() string { return proto.CompactTextString(m) }
-func (*OtherBase) ProtoMessage() {}
-func (*OtherBase) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{2}
-}
-
-var extRange_OtherBase = []proto.ExtensionRange{
- {Start: 100, End: 536870911},
-}
-
-func (*OtherBase) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_OtherBase
-}
-func (m *OtherBase) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OtherBase.Unmarshal(m, b)
-}
-func (m *OtherBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OtherBase.Marshal(b, m, deterministic)
-}
-func (dst *OtherBase) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OtherBase.Merge(dst, src)
-}
-func (m *OtherBase) XXX_Size() int {
- return xxx_messageInfo_OtherBase.Size(m)
-}
-func (m *OtherBase) XXX_DiscardUnknown() {
- xxx_messageInfo_OtherBase.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OtherBase proto.InternalMessageInfo
-
-func (m *OtherBase) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-type ReplyExtensions struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ReplyExtensions) Reset() { *m = ReplyExtensions{} }
-func (m *ReplyExtensions) String() string { return proto.CompactTextString(m) }
-func (*ReplyExtensions) ProtoMessage() {}
-func (*ReplyExtensions) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{3}
-}
-func (m *ReplyExtensions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ReplyExtensions.Unmarshal(m, b)
-}
-func (m *ReplyExtensions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ReplyExtensions.Marshal(b, m, deterministic)
-}
-func (dst *ReplyExtensions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReplyExtensions.Merge(dst, src)
-}
-func (m *ReplyExtensions) XXX_Size() int {
- return xxx_messageInfo_ReplyExtensions.Size(m)
-}
-func (m *ReplyExtensions) XXX_DiscardUnknown() {
- xxx_messageInfo_ReplyExtensions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ReplyExtensions proto.InternalMessageInfo
-
-var E_ReplyExtensions_Time = &proto.ExtensionDesc{
- ExtendedType: (*Reply)(nil),
- ExtensionType: (*float64)(nil),
- Field: 101,
- Name: "my.test.ReplyExtensions.time",
- Tag: "fixed64,101,opt,name=time",
- Filename: "my_test/test.proto",
-}
-
-var E_ReplyExtensions_Carrot = &proto.ExtensionDesc{
- ExtendedType: (*Reply)(nil),
- ExtensionType: (*ReplyExtensions)(nil),
- Field: 105,
- Name: "my.test.ReplyExtensions.carrot",
- Tag: "bytes,105,opt,name=carrot",
- Filename: "my_test/test.proto",
-}
-
-var E_ReplyExtensions_Donut = &proto.ExtensionDesc{
- ExtendedType: (*OtherBase)(nil),
- ExtensionType: (*ReplyExtensions)(nil),
- Field: 101,
- Name: "my.test.ReplyExtensions.donut",
- Tag: "bytes,101,opt,name=donut",
- Filename: "my_test/test.proto",
-}
-
-type OtherReplyExtensions struct {
- Key *int32 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OtherReplyExtensions) Reset() { *m = OtherReplyExtensions{} }
-func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) }
-func (*OtherReplyExtensions) ProtoMessage() {}
-func (*OtherReplyExtensions) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{4}
-}
-func (m *OtherReplyExtensions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OtherReplyExtensions.Unmarshal(m, b)
-}
-func (m *OtherReplyExtensions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OtherReplyExtensions.Marshal(b, m, deterministic)
-}
-func (dst *OtherReplyExtensions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OtherReplyExtensions.Merge(dst, src)
-}
-func (m *OtherReplyExtensions) XXX_Size() int {
- return xxx_messageInfo_OtherReplyExtensions.Size(m)
-}
-func (m *OtherReplyExtensions) XXX_DiscardUnknown() {
- xxx_messageInfo_OtherReplyExtensions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OtherReplyExtensions proto.InternalMessageInfo
-
-func (m *OtherReplyExtensions) GetKey() int32 {
- if m != nil && m.Key != nil {
- return *m.Key
- }
- return 0
-}
-
-type OldReply struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `protobuf_messageset:"1" json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OldReply) Reset() { *m = OldReply{} }
-func (m *OldReply) String() string { return proto.CompactTextString(m) }
-func (*OldReply) ProtoMessage() {}
-func (*OldReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{5}
-}
-
-func (m *OldReply) MarshalJSON() ([]byte, error) {
- return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions)
-}
-func (m *OldReply) UnmarshalJSON(buf []byte) error {
- return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions)
-}
-
-var extRange_OldReply = []proto.ExtensionRange{
- {Start: 100, End: 2147483646},
-}
-
-func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_OldReply
-}
-func (m *OldReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OldReply.Unmarshal(m, b)
-}
-func (m *OldReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OldReply.Marshal(b, m, deterministic)
-}
-func (dst *OldReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OldReply.Merge(dst, src)
-}
-func (m *OldReply) XXX_Size() int {
- return xxx_messageInfo_OldReply.Size(m)
-}
-func (m *OldReply) XXX_DiscardUnknown() {
- xxx_messageInfo_OldReply.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OldReply proto.InternalMessageInfo
-
-type Communique struct {
- MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry,json=makeMeCry" 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_Height
- // *Communique_Today
- // *Communique_Maybe
- // *Communique_Delta_
- // *Communique_Msg
- // *Communique_Somegroup
- Union isCommunique_Union `protobuf_oneof:"union"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Communique) Reset() { *m = Communique{} }
-func (m *Communique) String() string { return proto.CompactTextString(m) }
-func (*Communique) ProtoMessage() {}
-func (*Communique) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{6}
-}
-func (m *Communique) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Communique.Unmarshal(m, b)
-}
-func (m *Communique) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Communique.Marshal(b, m, deterministic)
-}
-func (dst *Communique) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Communique.Merge(dst, src)
-}
-func (m *Communique) XXX_Size() int {
- return xxx_messageInfo_Communique.Size(m)
-}
-func (m *Communique) XXX_DiscardUnknown() {
- xxx_messageInfo_Communique.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Communique proto.InternalMessageInfo
-
-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,json=tempC,oneof"`
-}
-type Communique_Height struct {
- Height float32 `protobuf:"fixed32,9,opt,name=height,oneof"`
-}
-type Communique_Today struct {
- Today Days `protobuf:"varint,10,opt,name=today,enum=my.test.Days,oneof"`
-}
-type Communique_Maybe struct {
- Maybe bool `protobuf:"varint,11,opt,name=maybe,oneof"`
-}
-type Communique_Delta_ struct {
- Delta int32 `protobuf:"zigzag32,12,opt,name=delta,oneof"`
-}
-type Communique_Msg struct {
- Msg *Reply `protobuf:"bytes,16,opt,name=msg,oneof"`
-}
-type Communique_Somegroup struct {
- Somegroup *Communique_SomeGroup `protobuf:"group,14,opt,name=SomeGroup,json=somegroup,oneof"`
-}
-
-func (*Communique_Number) isCommunique_Union() {}
-func (*Communique_Name) isCommunique_Union() {}
-func (*Communique_Data) isCommunique_Union() {}
-func (*Communique_TempC) isCommunique_Union() {}
-func (*Communique_Height) isCommunique_Union() {}
-func (*Communique_Today) isCommunique_Union() {}
-func (*Communique_Maybe) isCommunique_Union() {}
-func (*Communique_Delta_) isCommunique_Union() {}
-func (*Communique_Msg) isCommunique_Union() {}
-func (*Communique_Somegroup) 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) GetHeight() float32 {
- if x, ok := m.GetUnion().(*Communique_Height); ok {
- return x.Height
- }
- return 0
-}
-
-func (m *Communique) GetToday() Days {
- if x, ok := m.GetUnion().(*Communique_Today); ok {
- return x.Today
- }
- return Days_MONDAY
-}
-
-func (m *Communique) GetMaybe() bool {
- if x, ok := m.GetUnion().(*Communique_Maybe); ok {
- return x.Maybe
- }
- return false
-}
-
-func (m *Communique) GetDelta() int32 {
- if x, ok := m.GetUnion().(*Communique_Delta_); ok {
- return x.Delta
- }
- return 0
-}
-
-func (m *Communique) GetMsg() *Reply {
- if x, ok := m.GetUnion().(*Communique_Msg); ok {
- return x.Msg
- }
- return nil
-}
-
-func (m *Communique) GetSomegroup() *Communique_SomeGroup {
- if x, ok := m.GetUnion().(*Communique_Somegroup); ok {
- return x.Somegroup
- }
- 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), func(msg proto.Message) (n int), []interface{}) {
- return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, _Communique_OneofSizer, []interface{}{
- (*Communique_Number)(nil),
- (*Communique_Name)(nil),
- (*Communique_Data)(nil),
- (*Communique_TempC)(nil),
- (*Communique_Height)(nil),
- (*Communique_Today)(nil),
- (*Communique_Maybe)(nil),
- (*Communique_Delta_)(nil),
- (*Communique_Msg)(nil),
- (*Communique_Somegroup)(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_Height:
- b.EncodeVarint(9<<3 | proto.WireFixed32)
- b.EncodeFixed32(uint64(math.Float32bits(x.Height)))
- case *Communique_Today:
- b.EncodeVarint(10<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.Today))
- case *Communique_Maybe:
- t := uint64(0)
- if x.Maybe {
- t = 1
- }
- b.EncodeVarint(11<<3 | proto.WireVarint)
- b.EncodeVarint(t)
- case *Communique_Delta_:
- b.EncodeVarint(12<<3 | proto.WireVarint)
- b.EncodeZigzag32(uint64(x.Delta))
- case *Communique_Msg:
- b.EncodeVarint(16<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Msg); err != nil {
- return err
- }
- case *Communique_Somegroup:
- b.EncodeVarint(14<<3 | proto.WireStartGroup)
- if err := b.Marshal(x.Somegroup); err != nil {
- return err
- }
- b.EncodeVarint(14<<3 | proto.WireEndGroup)
- 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.height
- if wire != proto.WireFixed32 {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeFixed32()
- m.Union = &Communique_Height{math.Float32frombits(uint32(x))}
- return true, err
- case 10: // union.today
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Communique_Today{Days(x)}
- return true, err
- case 11: // union.maybe
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Union = &Communique_Maybe{x != 0}
- return true, err
- case 12: // union.delta
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeZigzag32()
- m.Union = &Communique_Delta_{int32(x)}
- return true, err
- case 16: // union.msg
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Reply)
- err := b.DecodeMessage(msg)
- m.Union = &Communique_Msg{msg}
- return true, err
- case 14: // union.somegroup
- if wire != proto.WireStartGroup {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Communique_SomeGroup)
- err := b.DecodeGroup(msg)
- m.Union = &Communique_Somegroup{msg}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _Communique_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*Communique)
- // union
- switch x := m.Union.(type) {
- case *Communique_Number:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.Number))
- case *Communique_Name:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Name)))
- n += len(x.Name)
- case *Communique_Data:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.Data)))
- n += len(x.Data)
- case *Communique_TempC:
- n += 1 // tag and wire
- n += 8
- case *Communique_Height:
- n += 1 // tag and wire
- n += 4
- case *Communique_Today:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.Today))
- case *Communique_Maybe:
- n += 1 // tag and wire
- n += 1
- case *Communique_Delta_:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64((uint32(x.Delta) << 1) ^ uint32((int32(x.Delta) >> 31))))
- case *Communique_Msg:
- s := proto.Size(x.Msg)
- n += 2 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Communique_Somegroup:
- n += 1 // tag and wire
- n += proto.Size(x.Somegroup)
- n += 1 // tag and wire
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-type Communique_SomeGroup struct {
- Member *string `protobuf:"bytes,15,opt,name=member" json:"member,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Communique_SomeGroup) Reset() { *m = Communique_SomeGroup{} }
-func (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) }
-func (*Communique_SomeGroup) ProtoMessage() {}
-func (*Communique_SomeGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{6, 0}
-}
-func (m *Communique_SomeGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Communique_SomeGroup.Unmarshal(m, b)
-}
-func (m *Communique_SomeGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Communique_SomeGroup.Marshal(b, m, deterministic)
-}
-func (dst *Communique_SomeGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Communique_SomeGroup.Merge(dst, src)
-}
-func (m *Communique_SomeGroup) XXX_Size() int {
- return xxx_messageInfo_Communique_SomeGroup.Size(m)
-}
-func (m *Communique_SomeGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_Communique_SomeGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Communique_SomeGroup proto.InternalMessageInfo
-
-func (m *Communique_SomeGroup) GetMember() string {
- if m != nil && m.Member != nil {
- return *m.Member
- }
- return ""
-}
-
-type Communique_Delta struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Communique_Delta) Reset() { *m = Communique_Delta{} }
-func (m *Communique_Delta) String() string { return proto.CompactTextString(m) }
-func (*Communique_Delta) ProtoMessage() {}
-func (*Communique_Delta) Descriptor() ([]byte, []int) {
- return fileDescriptor_test_2309d445eee26af7, []int{6, 1}
-}
-func (m *Communique_Delta) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Communique_Delta.Unmarshal(m, b)
-}
-func (m *Communique_Delta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Communique_Delta.Marshal(b, m, deterministic)
-}
-func (dst *Communique_Delta) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Communique_Delta.Merge(dst, src)
-}
-func (m *Communique_Delta) XXX_Size() int {
- return xxx_messageInfo_Communique_Delta.Size(m)
-}
-func (m *Communique_Delta) XXX_DiscardUnknown() {
- xxx_messageInfo_Communique_Delta.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Communique_Delta proto.InternalMessageInfo
-
-var E_Tag = &proto.ExtensionDesc{
- ExtendedType: (*Reply)(nil),
- ExtensionType: (*string)(nil),
- Field: 103,
- Name: "my.test.tag",
- Tag: "bytes,103,opt,name=tag",
- Filename: "my_test/test.proto",
-}
-
-var E_Donut = &proto.ExtensionDesc{
- ExtendedType: (*Reply)(nil),
- ExtensionType: (*OtherReplyExtensions)(nil),
- Field: 106,
- Name: "my.test.donut",
- Tag: "bytes,106,opt,name=donut",
- Filename: "my_test/test.proto",
-}
-
-func init() {
- proto.RegisterType((*Request)(nil), "my.test.Request")
- proto.RegisterMapType((map[int64]*Reply)(nil), "my.test.Request.MsgMappingEntry")
- proto.RegisterMapType((map[int32]string)(nil), "my.test.Request.NameMappingEntry")
- proto.RegisterType((*Request_SomeGroup)(nil), "my.test.Request.SomeGroup")
- proto.RegisterType((*Reply)(nil), "my.test.Reply")
- proto.RegisterType((*Reply_Entry)(nil), "my.test.Reply.Entry")
- proto.RegisterType((*OtherBase)(nil), "my.test.OtherBase")
- proto.RegisterType((*ReplyExtensions)(nil), "my.test.ReplyExtensions")
- proto.RegisterType((*OtherReplyExtensions)(nil), "my.test.OtherReplyExtensions")
- proto.RegisterType((*OldReply)(nil), "my.test.OldReply")
- proto.RegisterType((*Communique)(nil), "my.test.Communique")
- proto.RegisterType((*Communique_SomeGroup)(nil), "my.test.Communique.SomeGroup")
- proto.RegisterType((*Communique_Delta)(nil), "my.test.Communique.Delta")
- proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value)
- proto.RegisterEnum("my.test.Days", Days_name, Days_value)
- proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value)
- proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
- proto.RegisterExtension(E_ReplyExtensions_Time)
- proto.RegisterExtension(E_ReplyExtensions_Carrot)
- proto.RegisterExtension(E_ReplyExtensions_Donut)
- proto.RegisterExtension(E_Tag)
- proto.RegisterExtension(E_Donut)
-}
-
-func init() { proto.RegisterFile("my_test/test.proto", fileDescriptor_test_2309d445eee26af7) }
-
-var fileDescriptor_test_2309d445eee26af7 = []byte{
- // 1033 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xdd, 0x6e, 0xe3, 0x44,
- 0x14, 0xce, 0xd8, 0x71, 0x7e, 0x4e, 0x42, 0x6b, 0x46, 0x55, 0x6b, 0x05, 0xed, 0xd6, 0x04, 0x8a,
- 0x4c, 0xc5, 0xa6, 0xda, 0x80, 0xc4, 0x2a, 0x88, 0xd5, 0x36, 0x3f, 0x6d, 0xaa, 0x6d, 0x12, 0x69,
- 0xda, 0x5e, 0xb0, 0x37, 0xd6, 0x34, 0x9e, 0x3a, 0xa6, 0x19, 0x3b, 0x6b, 0x8f, 0x11, 0xbe, 0xeb,
- 0x53, 0xc0, 0x6b, 0x70, 0xcf, 0x0b, 0xf1, 0x16, 0x45, 0x33, 0x0e, 0x49, 0xda, 0xa0, 0xbd, 0xb1,
- 0x7c, 0xce, 0xf9, 0xce, 0xe7, 0x39, 0x3f, 0xfe, 0x06, 0x30, 0xcf, 0x5c, 0xc1, 0x12, 0x71, 0x22,
- 0x1f, 0xad, 0x45, 0x1c, 0x89, 0x08, 0x97, 0x79, 0xd6, 0x92, 0x66, 0x03, 0xf3, 0x74, 0x2e, 0x82,
- 0x13, 0xf5, 0x7c, 0x9d, 0x07, 0x9b, 0xff, 0x14, 0xa1, 0x4c, 0xd8, 0xc7, 0x94, 0x25, 0x02, 0x9b,
- 0xa0, 0xdf, 0xb3, 0xcc, 0x42, 0xb6, 0xee, 0xe8, 0x44, 0xbe, 0x62, 0x07, 0xf4, 0x59, 0xca, 0x2c,
- 0xdd, 0x46, 0xce, 0x4e, 0x7b, 0xbf, 0xb5, 0x24, 0x6a, 0x2d, 0x13, 0x5a, 0xbd, 0x68, 0x1e, 0xc5,
- 0x44, 0x42, 0xf0, 0x31, 0xe8, 0x33, 0x2a, 0xac, 0xa2, 0x42, 0x9a, 0x2b, 0xe4, 0x90, 0x8a, 0xeb,
- 0x6c, 0xc1, 0x3a, 0xa5, 0xb3, 0x41, 0x7f, 0x42, 0x4e, 0x89, 0x04, 0xe1, 0x43, 0xa8, 0x78, 0x8c,
- 0x7a, 0xf3, 0x20, 0x64, 0x56, 0xd9, 0x46, 0x8e, 0xd6, 0xd1, 0x83, 0xf0, 0x8e, 0xac, 0x9c, 0xf8,
- 0x0d, 0x54, 0x93, 0x88, 0x33, 0x3f, 0x8e, 0xd2, 0x85, 0x55, 0xb1, 0x91, 0x03, 0xed, 0xc6, 0xd6,
- 0xc7, 0xaf, 0x22, 0xce, 0xce, 0x25, 0x82, 0xac, 0xc1, 0xb8, 0x0f, 0xf5, 0x90, 0x72, 0xe6, 0x72,
- 0xba, 0x58, 0x04, 0xa1, 0x6f, 0xed, 0xd8, 0xba, 0x53, 0x6b, 0x7f, 0xb9, 0x95, 0x3c, 0xa6, 0x9c,
- 0x8d, 0x72, 0xcc, 0x20, 0x14, 0x71, 0x46, 0x6a, 0xe1, 0xda, 0x83, 0x4f, 0xa1, 0xc6, 0x13, 0x7f,
- 0x45, 0xb2, 0xab, 0x48, 0xec, 0x2d, 0x92, 0x51, 0xe2, 0x3f, 0xe1, 0x00, 0xbe, 0x72, 0xe0, 0x3d,
- 0x30, 0x62, 0x96, 0x30, 0x61, 0xd5, 0x6d, 0xe4, 0x18, 0x24, 0x37, 0xf0, 0x01, 0x94, 0x7d, 0x26,
- 0x5c, 0xd9, 0x65, 0xd3, 0x46, 0x4e, 0x95, 0x94, 0x7c, 0x26, 0xde, 0xb3, 0xac, 0xf1, 0x1d, 0x54,
- 0x57, 0xf5, 0xe0, 0x43, 0xa8, 0xa9, 0x6a, 0xdc, 0xbb, 0x80, 0xcd, 0x3d, 0xab, 0xaa, 0x18, 0x40,
- 0xb9, 0xce, 0xa4, 0xa7, 0xf1, 0x16, 0xcc, 0xe7, 0x05, 0xac, 0x87, 0x27, 0xc1, 0x6a, 0x78, 0x7b,
- 0x60, 0xfc, 0x46, 0xe7, 0x29, 0xb3, 0x34, 0xf5, 0xa9, 0xdc, 0xe8, 0x68, 0x6f, 0x50, 0x63, 0x04,
- 0xbb, 0xcf, 0xce, 0xbe, 0x99, 0x8e, 0xf3, 0xf4, 0xaf, 0x37, 0xd3, 0x6b, 0xed, 0x9d, 0x8d, 0xf2,
- 0x17, 0xf3, 0x6c, 0x83, 0xae, 0x79, 0x04, 0x86, 0xda, 0x04, 0x5c, 0x06, 0x9d, 0x0c, 0xfa, 0x66,
- 0x01, 0x57, 0xc1, 0x38, 0x27, 0x83, 0xc1, 0xd8, 0x44, 0xb8, 0x02, 0xc5, 0xee, 0xe5, 0xcd, 0xc0,
- 0xd4, 0x9a, 0x7f, 0x6a, 0x60, 0xa8, 0x5c, 0x7c, 0x0c, 0xc6, 0x5d, 0x94, 0x86, 0x9e, 0x5a, 0xb5,
- 0x5a, 0x7b, 0xef, 0x29, 0x75, 0x2b, 0xef, 0x66, 0x0e, 0xc1, 0x47, 0x50, 0x9f, 0x46, 0x7c, 0x41,
- 0xa7, 0xaa, 0x6d, 0x89, 0xa5, 0xd9, 0xba, 0x63, 0x74, 0x35, 0x13, 0x91, 0xda, 0xd2, 0xff, 0x9e,
- 0x65, 0x49, 0xe3, 0x2f, 0x04, 0x46, 0x5e, 0x49, 0x1f, 0x0e, 0xef, 0x59, 0xe6, 0x8a, 0x19, 0x15,
- 0x6e, 0xc8, 0x98, 0x97, 0xb8, 0xaf, 0xdb, 0xdf, 0xff, 0x30, 0xa5, 0x9c, 0xcd, 0xdd, 0x1e, 0x4d,
- 0x2e, 0x42, 0xdf, 0x42, 0xb6, 0xe6, 0xe8, 0xe4, 0x8b, 0x7b, 0x96, 0x5d, 0xcf, 0xa8, 0x18, 0x4b,
- 0xd0, 0x0a, 0x93, 0x43, 0xf0, 0xc1, 0x66, 0xf5, 0x7a, 0x07, 0xfd, 0xb8, 0x2c, 0x18, 0x7f, 0x03,
- 0xa6, 0xcb, 0xb3, 0x7c, 0x34, 0xae, 0xda, 0xb5, 0xb6, 0xfa, 0x3f, 0x74, 0x52, 0x1f, 0x65, 0x6a,
- 0x3c, 0x72, 0x34, 0xed, 0xa6, 0x0d, 0xc5, 0x73, 0xca, 0x19, 0xae, 0x43, 0xe5, 0x6c, 0x32, 0xb9,
- 0xee, 0x9e, 0x5e, 0x5e, 0x9a, 0x08, 0x03, 0x94, 0xae, 0x07, 0xe3, 0xf1, 0xc5, 0x95, 0xa9, 0x1d,
- 0x57, 0x2a, 0x9e, 0xf9, 0xf0, 0xf0, 0xf0, 0xa0, 0x35, 0xbf, 0x85, 0xea, 0x44, 0xcc, 0x58, 0xdc,
- 0xa5, 0x09, 0xc3, 0x18, 0x8a, 0x92, 0x56, 0x8d, 0xa2, 0x4a, 0xd4, 0xfb, 0x06, 0xf4, 0x6f, 0x04,
- 0xbb, 0xaa, 0x4b, 0x83, 0xdf, 0x05, 0x0b, 0x93, 0x20, 0x0a, 0x93, 0x76, 0x13, 0x8a, 0x22, 0xe0,
- 0x0c, 0x3f, 0x1b, 0x91, 0xc5, 0x6c, 0xe4, 0x20, 0xa2, 0x62, 0xed, 0x77, 0x50, 0x9a, 0xd2, 0x38,
- 0x8e, 0xc4, 0x16, 0x2a, 0x50, 0xe3, 0xb5, 0x9e, 0x7a, 0xd7, 0xec, 0x64, 0x99, 0xd7, 0xee, 0x82,
- 0xe1, 0x45, 0x61, 0x2a, 0x30, 0x5e, 0x41, 0x57, 0x87, 0x56, 0x9f, 0xfa, 0x14, 0x49, 0x9e, 0xda,
- 0x74, 0x60, 0x4f, 0xe5, 0x3c, 0x0b, 0x6f, 0x2f, 0x6f, 0xd3, 0x82, 0xca, 0x64, 0xee, 0x29, 0x9c,
- 0xaa, 0xfe, 0xf1, 0xf1, 0xf1, 0xb1, 0xdc, 0xd1, 0x2a, 0xa8, 0xf9, 0x87, 0x0e, 0xd0, 0x8b, 0x38,
- 0x4f, 0xc3, 0xe0, 0x63, 0xca, 0xf0, 0x4b, 0xa8, 0x71, 0x7a, 0xcf, 0x5c, 0xce, 0xdc, 0x69, 0x9c,
- 0x53, 0x54, 0x48, 0x55, 0xba, 0x46, 0xac, 0x17, 0x67, 0xd8, 0x82, 0x52, 0x98, 0xf2, 0x5b, 0x16,
- 0x5b, 0x86, 0x64, 0x1f, 0x16, 0xc8, 0xd2, 0xc6, 0x7b, 0xcb, 0x46, 0x97, 0x64, 0xa3, 0x87, 0x85,
- 0xbc, 0xd5, 0xd2, 0xeb, 0x51, 0x41, 0x95, 0x30, 0xd5, 0xa5, 0x57, 0x5a, 0xf8, 0x00, 0x4a, 0x82,
- 0xf1, 0x85, 0x3b, 0x55, 0x72, 0x84, 0x86, 0x05, 0x62, 0x48, 0xbb, 0x27, 0xe9, 0x67, 0x2c, 0xf0,
- 0x67, 0x42, 0xfd, 0xa6, 0x9a, 0xa4, 0xcf, 0x6d, 0x7c, 0x04, 0x86, 0x88, 0x3c, 0x9a, 0x59, 0xa0,
- 0x34, 0xf1, 0xb3, 0x55, 0x6f, 0xfa, 0x34, 0x4b, 0x14, 0x81, 0x8c, 0xe2, 0x7d, 0x30, 0x38, 0xcd,
- 0x6e, 0x99, 0x55, 0x93, 0x27, 0x97, 0x7e, 0x65, 0x4a, 0xbf, 0xc7, 0xe6, 0x82, 0x2a, 0x01, 0xf9,
- 0x5c, 0xfa, 0x95, 0x89, 0x9b, 0xa0, 0xf3, 0xc4, 0x57, 0xf2, 0xb1, 0xf5, 0x53, 0x0e, 0x0b, 0x44,
- 0x06, 0xf1, 0xcf, 0x9b, 0xfa, 0xb9, 0xa3, 0xf4, 0xf3, 0xc5, 0x0a, 0xb9, 0xee, 0xdd, 0x5a, 0x42,
- 0x87, 0x85, 0x0d, 0x11, 0x6d, 0x7c, 0xb5, 0x29, 0x46, 0xfb, 0x50, 0xe2, 0x4c, 0xf5, 0x6f, 0x37,
- 0x57, 0xac, 0xdc, 0x6a, 0x94, 0xc1, 0xe8, 0xcb, 0x03, 0x75, 0xcb, 0x60, 0xa4, 0x61, 0x10, 0x85,
- 0xc7, 0x2f, 0xa1, 0xbc, 0x94, 0x7b, 0xb9, 0xe6, 0xb9, 0xe0, 0x9b, 0x48, 0x8a, 0xc2, 0xd9, 0xe0,
- 0x83, 0xa9, 0x1d, 0xb7, 0xa0, 0x28, 0x4b, 0x97, 0xc1, 0xd1, 0x64, 0xdc, 0x3f, 0xfd, 0xc5, 0x44,
- 0xb8, 0x06, 0xe5, 0xeb, 0x9b, 0xc1, 0x95, 0x34, 0x34, 0xa9, 0x1a, 0x97, 0x37, 0xe3, 0xfe, 0x85,
- 0x89, 0x1a, 0x9a, 0x89, 0x3a, 0x36, 0xe8, 0x82, 0xfa, 0x5b, 0xfb, 0xea, 0xab, 0x63, 0xc8, 0x50,
- 0xa7, 0xf7, 0xdf, 0x4a, 0x3e, 0xc7, 0xfc, 0xaa, 0xba, 0xf3, 0xe2, 0xe9, 0xa2, 0xfe, 0xff, 0x4e,
- 0x76, 0xdf, 0x7d, 0x78, 0xeb, 0x07, 0x62, 0x96, 0xde, 0xb6, 0xa6, 0x11, 0x3f, 0xf1, 0xa3, 0x39,
- 0x0d, 0xfd, 0x13, 0x75, 0x39, 0xde, 0xa6, 0x77, 0xf9, 0xcb, 0xf4, 0x95, 0xcf, 0xc2, 0x57, 0x7e,
- 0xa4, 0x6e, 0x55, 0xb9, 0x0f, 0x27, 0xcb, 0x6b, 0xf6, 0x27, 0xf9, 0xf8, 0x37, 0x00, 0x00, 0xff,
- 0xff, 0x12, 0xd5, 0x46, 0x00, 0x75, 0x07, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto
deleted file mode 100644
index 1ef3fd02..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto
+++ /dev/null
@@ -1,158 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-
-// This package holds interesting messages.
-package my.test; // dotted package name
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/my_test;test";
-
-//import "imp.proto";
-import "multi/multi1.proto"; // unused import
-
-enum HatType {
- // deliberately skipping 0
- FEDORA = 1;
- FEZ = 2;
-}
-
-// This enum represents days of the week.
-enum Days {
- option allow_alias = true;
-
- MONDAY = 1;
- TUESDAY = 2;
- LUNDI = 1; // same value as MONDAY
-}
-
-// This is a message that might be sent somewhere.
-message Request {
- enum Color {
- RED = 0;
- GREEN = 1;
- BLUE = 2;
- }
- repeated int64 key = 1;
-// optional imp.ImportedMessage imported_message = 2;
- optional Color hue = 3; // no default
- optional HatType hat = 4 [default=FEDORA];
-// optional imp.ImportedMessage.Owner owner = 6;
- optional float deadline = 7 [default=inf];
- optional group SomeGroup = 8 {
- optional int32 group_field = 9;
- }
-
- // These foreign types are in imp2.proto,
- // which is publicly imported by imp.proto.
-// optional imp.PubliclyImportedMessage pub = 10;
-// optional imp.PubliclyImportedEnum pub_enum = 13 [default=HAIR];
-
-
- // This is a map field. It will generate map[int32]string.
- map name_mapping = 14;
- // This is a map field whose value type is a message.
- map msg_mapping = 15;
-
- optional int32 reset = 12;
- // This field should not conflict with any getters.
- optional string get_key = 16;
-}
-
-message Reply {
- message Entry {
- required int64 key_that_needs_1234camel_CasIng = 1;
- optional int64 value = 2 [default=7];
- optional int64 _my_field_name_2 = 3;
- enum Game {
- FOOTBALL = 1;
- TENNIS = 2;
- }
- }
- repeated Entry found = 1;
- repeated int32 compact_keys = 2 [packed=true];
- extensions 100 to max;
-}
-
-message OtherBase {
- optional string name = 1;
- extensions 100 to max;
-}
-
-message ReplyExtensions {
- extend Reply {
- optional double time = 101;
- optional ReplyExtensions carrot = 105;
- }
- extend OtherBase {
- optional ReplyExtensions donut = 101;
- }
-}
-
-message OtherReplyExtensions {
- optional int32 key = 1;
-}
-
-// top-level extension
-extend Reply {
- optional string tag = 103;
- optional OtherReplyExtensions donut = 106;
-// optional imp.ImportedMessage elephant = 107; // extend with message from another file.
-}
-
-message OldReply {
- // Extensions will be encoded in MessageSet wire format.
- option message_set_wire_format = true;
- extensions 100 to max;
-}
-
-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;
- float height = 9;
- Days today = 10;
- bool maybe = 11;
- sint32 delta = 12; // name will conflict with Delta below
- Reply msg = 16; // requires two bytes to encode field tag
- group SomeGroup = 14 {
- optional string member = 15;
- }
- }
-
- message Delta {}
-}
-
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go
deleted file mode 100644
index 3b0ad849..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go
+++ /dev/null
@@ -1,196 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: proto3/proto3.proto
-
-package proto3 // import "github.com/golang/protobuf/protoc-gen-go/testdata/proto3"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-type Request_Flavour int32
-
-const (
- Request_SWEET Request_Flavour = 0
- Request_SOUR Request_Flavour = 1
- Request_UMAMI Request_Flavour = 2
- Request_GOPHERLICIOUS Request_Flavour = 3
-)
-
-var Request_Flavour_name = map[int32]string{
- 0: "SWEET",
- 1: "SOUR",
- 2: "UMAMI",
- 3: "GOPHERLICIOUS",
-}
-var Request_Flavour_value = map[string]int32{
- "SWEET": 0,
- "SOUR": 1,
- "UMAMI": 2,
- "GOPHERLICIOUS": 3,
-}
-
-func (x Request_Flavour) String() string {
- return proto.EnumName(Request_Flavour_name, int32(x))
-}
-func (Request_Flavour) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_proto3_a752e09251f17e01, []int{0, 0}
-}
-
-type Request struct {
- Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Key []int64 `protobuf:"varint,2,rep,packed,name=key" json:"key,omitempty"`
- Taste Request_Flavour `protobuf:"varint,3,opt,name=taste,enum=proto3.Request_Flavour" json:"taste,omitempty"`
- Book *Book `protobuf:"bytes,4,opt,name=book" json:"book,omitempty"`
- Unpacked []int64 `protobuf:"varint,5,rep,name=unpacked" json:"unpacked,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Request) Reset() { *m = Request{} }
-func (m *Request) String() string { return proto.CompactTextString(m) }
-func (*Request) ProtoMessage() {}
-func (*Request) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_a752e09251f17e01, []int{0}
-}
-func (m *Request) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Request.Unmarshal(m, b)
-}
-func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Request.Marshal(b, m, deterministic)
-}
-func (dst *Request) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Request.Merge(dst, src)
-}
-func (m *Request) XXX_Size() int {
- return xxx_messageInfo_Request.Size(m)
-}
-func (m *Request) XXX_DiscardUnknown() {
- xxx_messageInfo_Request.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Request proto.InternalMessageInfo
-
-func (m *Request) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *Request) GetKey() []int64 {
- if m != nil {
- return m.Key
- }
- return nil
-}
-
-func (m *Request) GetTaste() Request_Flavour {
- if m != nil {
- return m.Taste
- }
- return Request_SWEET
-}
-
-func (m *Request) GetBook() *Book {
- if m != nil {
- return m.Book
- }
- return nil
-}
-
-func (m *Request) GetUnpacked() []int64 {
- if m != nil {
- return m.Unpacked
- }
- return nil
-}
-
-type Book struct {
- Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"`
- RawData []byte `protobuf:"bytes,2,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Book) Reset() { *m = Book{} }
-func (m *Book) String() string { return proto.CompactTextString(m) }
-func (*Book) ProtoMessage() {}
-func (*Book) Descriptor() ([]byte, []int) {
- return fileDescriptor_proto3_a752e09251f17e01, []int{1}
-}
-func (m *Book) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Book.Unmarshal(m, b)
-}
-func (m *Book) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Book.Marshal(b, m, deterministic)
-}
-func (dst *Book) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Book.Merge(dst, src)
-}
-func (m *Book) XXX_Size() int {
- return xxx_messageInfo_Book.Size(m)
-}
-func (m *Book) XXX_DiscardUnknown() {
- xxx_messageInfo_Book.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Book proto.InternalMessageInfo
-
-func (m *Book) GetTitle() string {
- if m != nil {
- return m.Title
- }
- return ""
-}
-
-func (m *Book) GetRawData() []byte {
- if m != nil {
- return m.RawData
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Request)(nil), "proto3.Request")
- proto.RegisterType((*Book)(nil), "proto3.Book")
- proto.RegisterEnum("proto3.Request_Flavour", Request_Flavour_name, Request_Flavour_value)
-}
-
-func init() { proto.RegisterFile("proto3/proto3.proto", fileDescriptor_proto3_a752e09251f17e01) }
-
-var fileDescriptor_proto3_a752e09251f17e01 = []byte{
- // 306 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x90, 0xcf, 0x4e, 0xf2, 0x40,
- 0x14, 0xc5, 0x99, 0xfe, 0xf9, 0x80, 0xfb, 0xa1, 0x19, 0xaf, 0x26, 0x8e, 0x1b, 0x33, 0x61, 0xd5,
- 0x0d, 0x25, 0xc1, 0x85, 0xc6, 0xb8, 0x11, 0x45, 0x25, 0x91, 0x60, 0x06, 0x89, 0x89, 0x1b, 0x33,
- 0x85, 0xb1, 0x92, 0x42, 0x07, 0xcb, 0x54, 0xe2, 0xcb, 0xfa, 0x2c, 0xa6, 0x9d, 0xe2, 0xea, 0x9e,
- 0x7b, 0xe7, 0xe4, 0x77, 0x32, 0x07, 0x0e, 0xd7, 0x99, 0x36, 0xfa, 0xac, 0x6b, 0x47, 0x58, 0x0e,
- 0xfc, 0x67, 0xb7, 0xf6, 0x0f, 0x81, 0xba, 0x50, 0x9f, 0xb9, 0xda, 0x18, 0x44, 0xf0, 0x52, 0xb9,
- 0x52, 0x8c, 0x70, 0x12, 0x34, 0x45, 0xa9, 0x91, 0x82, 0x9b, 0xa8, 0x6f, 0xe6, 0x70, 0x37, 0x70,
- 0x45, 0x21, 0xb1, 0x03, 0xbe, 0x91, 0x1b, 0xa3, 0x98, 0xcb, 0x49, 0xb0, 0xdf, 0x3b, 0x0e, 0x2b,
- 0x6e, 0x45, 0x09, 0xef, 0x96, 0xf2, 0x4b, 0xe7, 0x99, 0xb0, 0x2e, 0xe4, 0xe0, 0x45, 0x5a, 0x27,
- 0xcc, 0xe3, 0x24, 0xf8, 0xdf, 0x6b, 0xed, 0xdc, 0x7d, 0xad, 0x13, 0x51, 0xbe, 0xe0, 0x29, 0x34,
- 0xf2, 0x74, 0x2d, 0x67, 0x89, 0x9a, 0x33, 0xbf, 0xc8, 0xe9, 0x3b, 0xb4, 0x26, 0xfe, 0x6e, 0xed,
- 0x2b, 0xa8, 0x57, 0x4c, 0x6c, 0x82, 0x3f, 0x79, 0x19, 0x0c, 0x9e, 0x69, 0x0d, 0x1b, 0xe0, 0x4d,
- 0xc6, 0x53, 0x41, 0x49, 0x71, 0x9c, 0x8e, 0xae, 0x47, 0x43, 0xea, 0xe0, 0x01, 0xec, 0xdd, 0x8f,
- 0x9f, 0x1e, 0x06, 0xe2, 0x71, 0x78, 0x33, 0x1c, 0x4f, 0x27, 0xd4, 0x6d, 0x9f, 0x83, 0x57, 0x64,
- 0xe1, 0x11, 0xf8, 0x66, 0x61, 0x96, 0xbb, 0xdf, 0xd9, 0x05, 0x4f, 0xa0, 0x91, 0xc9, 0xed, 0xdb,
- 0x5c, 0x1a, 0xc9, 0x1c, 0x4e, 0x82, 0x96, 0xa8, 0x67, 0x72, 0x7b, 0x2b, 0x8d, 0xec, 0x5f, 0xbe,
- 0x5e, 0xc4, 0x0b, 0xf3, 0x91, 0x47, 0xe1, 0x4c, 0xaf, 0xba, 0xb1, 0x5e, 0xca, 0x34, 0xb6, 0x1d,
- 0x46, 0xf9, 0xbb, 0x15, 0xb3, 0x4e, 0xac, 0xd2, 0x4e, 0xac, 0xbb, 0x46, 0x6d, 0x4c, 0xc1, 0xa8,
- 0x3a, 0x8e, 0xaa, 0x76, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xec, 0x71, 0xee, 0xdb, 0x7b, 0x01,
- 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto
deleted file mode 100644
index 79954e4e..00000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto
+++ /dev/null
@@ -1,55 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2014 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package proto3;
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/proto3";
-
-message Request {
- enum Flavour {
- SWEET = 0;
- SOUR = 1;
- UMAMI = 2;
- GOPHERLICIOUS = 3;
- }
- string name = 1;
- repeated int64 key = 2;
- Flavour taste = 3;
- Book book = 4;
- repeated int64 unpacked = 5 [packed=false];
-}
-
-message Book {
- string title = 1;
- bytes raw_data = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any.go b/vendor/github.com/golang/protobuf/ptypes/any.go
deleted file mode 100644
index b2af97f4..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/any.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package ptypes
-
-// This file implements functions to marshal proto.Message to/from
-// google.protobuf.Any message.
-
-import (
- "fmt"
- "reflect"
- "strings"
-
- "github.com/golang/protobuf/proto"
- "github.com/golang/protobuf/ptypes/any"
-)
-
-const googleApis = "type.googleapis.com/"
-
-// AnyMessageName returns the name of the message contained in a google.protobuf.Any message.
-//
-// Note that regular type assertions should be done using the Is
-// function. AnyMessageName is provided for less common use cases like filtering a
-// sequence of Any messages based on a set of allowed message type names.
-func AnyMessageName(any *any.Any) (string, error) {
- if any == nil {
- return "", fmt.Errorf("message is nil")
- }
- slash := strings.LastIndex(any.TypeUrl, "/")
- if slash < 0 {
- return "", fmt.Errorf("message type url %q is invalid", any.TypeUrl)
- }
- return any.TypeUrl[slash+1:], nil
-}
-
-// MarshalAny takes the protocol buffer and encodes it into google.protobuf.Any.
-func MarshalAny(pb proto.Message) (*any.Any, error) {
- value, err := proto.Marshal(pb)
- if err != nil {
- return nil, err
- }
- return &any.Any{TypeUrl: googleApis + proto.MessageName(pb), Value: value}, nil
-}
-
-// DynamicAny is a value that can be passed to UnmarshalAny to automatically
-// allocate a proto.Message for the type specified in a google.protobuf.Any
-// message. The allocated message is stored in the embedded proto.Message.
-//
-// Example:
-//
-// var x ptypes.DynamicAny
-// if err := ptypes.UnmarshalAny(a, &x); err != nil { ... }
-// fmt.Printf("unmarshaled message: %v", x.Message)
-type DynamicAny struct {
- proto.Message
-}
-
-// Empty returns a new proto.Message of the type specified in a
-// google.protobuf.Any message. It returns an error if corresponding message
-// type isn't linked in.
-func Empty(any *any.Any) (proto.Message, error) {
- aname, err := AnyMessageName(any)
- if err != nil {
- return nil, err
- }
-
- t := proto.MessageType(aname)
- if t == nil {
- return nil, fmt.Errorf("any: message type %q isn't linked in", aname)
- }
- return reflect.New(t.Elem()).Interface().(proto.Message), nil
-}
-
-// UnmarshalAny parses the protocol buffer representation in a google.protobuf.Any
-// message and places the decoded result in pb. It returns an error if type of
-// contents of Any message does not match type of pb message.
-//
-// pb can be a proto.Message, or a *DynamicAny.
-func UnmarshalAny(any *any.Any, pb proto.Message) error {
- if d, ok := pb.(*DynamicAny); ok {
- if d.Message == nil {
- var err error
- d.Message, err = Empty(any)
- if err != nil {
- return err
- }
- }
- return UnmarshalAny(any, d.Message)
- }
-
- aname, err := AnyMessageName(any)
- if err != nil {
- return err
- }
-
- mname := proto.MessageName(pb)
- if aname != mname {
- return fmt.Errorf("mismatched message type: got %q want %q", aname, mname)
- }
- return proto.Unmarshal(any.Value, pb)
-}
-
-// Is returns true if any value contains a given message type.
-func Is(any *any.Any, pb proto.Message) bool {
- aname, err := AnyMessageName(any)
- if err != nil {
- return false
- }
-
- return aname == proto.MessageName(pb)
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
deleted file mode 100644
index f67edc7d..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
+++ /dev/null
@@ -1,191 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/any.proto
-
-package any // import "github.com/golang/protobuf/ptypes/any"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// `Any` contains an arbitrary serialized protocol buffer message along with a
-// URL that describes the type of the serialized message.
-//
-// Protobuf library provides support to pack/unpack Any values in the form
-// of utility functions or additional generated methods of the Any type.
-//
-// Example 1: Pack and unpack a message in C++.
-//
-// Foo foo = ...;
-// Any any;
-// any.PackFrom(foo);
-// ...
-// if (any.UnpackTo(&foo)) {
-// ...
-// }
-//
-// Example 2: Pack and unpack a message in Java.
-//
-// Foo foo = ...;
-// Any any = Any.pack(foo);
-// ...
-// if (any.is(Foo.class)) {
-// foo = any.unpack(Foo.class);
-// }
-//
-// Example 3: Pack and unpack a message in Python.
-//
-// foo = Foo(...)
-// any = Any()
-// any.Pack(foo)
-// ...
-// if any.Is(Foo.DESCRIPTOR):
-// any.Unpack(foo)
-// ...
-//
-// Example 4: Pack and unpack a message in Go
-//
-// foo := &pb.Foo{...}
-// any, err := ptypes.MarshalAny(foo)
-// ...
-// foo := &pb.Foo{}
-// if err := ptypes.UnmarshalAny(any, foo); err != nil {
-// ...
-// }
-//
-// The pack methods provided by protobuf library will by default use
-// 'type.googleapis.com/full.type.name' as the type URL and the unpack
-// methods only use the fully qualified type name after the last '/'
-// in the type URL, for example "foo.bar.com/x/y.z" will yield type
-// name "y.z".
-//
-//
-// JSON
-// ====
-// The JSON representation of an `Any` value uses the regular
-// representation of the deserialized, embedded message, with an
-// additional field `@type` which contains the type URL. Example:
-//
-// package google.profile;
-// message Person {
-// string first_name = 1;
-// string last_name = 2;
-// }
-//
-// {
-// "@type": "type.googleapis.com/google.profile.Person",
-// "firstName": ,
-// "lastName":
-// }
-//
-// If the embedded message type is well-known and has a custom JSON
-// representation, that representation will be embedded adding a field
-// `value` which holds the custom JSON in addition to the `@type`
-// field. Example (for message [google.protobuf.Duration][]):
-//
-// {
-// "@type": "type.googleapis.com/google.protobuf.Duration",
-// "value": "1.212s"
-// }
-//
-type Any struct {
- // A URL/resource name whose content describes the type of the
- // serialized protocol buffer message.
- //
- // For URLs which use the scheme `http`, `https`, or no scheme, the
- // following restrictions and interpretations apply:
- //
- // * If no scheme is provided, `https` is assumed.
- // * The last segment of the URL's path must represent the fully
- // qualified name of the type (as in `path/google.protobuf.Duration`).
- // The name should be in a canonical form (e.g., leading "." is
- // not accepted).
- // * An HTTP GET on the URL must yield a [google.protobuf.Type][]
- // value in binary format, or produce an error.
- // * Applications are allowed to cache lookup results based on the
- // URL, or have them precompiled into a binary to avoid any
- // lookup. Therefore, binary compatibility needs to be preserved
- // on changes to types. (Use versioned type names to manage
- // breaking changes.)
- //
- // Schemes other than `http`, `https` (or the empty scheme) might be
- // used with implementation specific semantics.
- //
- TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"`
- // Must be a valid serialized protocol buffer of the above specified type.
- Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Any) Reset() { *m = Any{} }
-func (m *Any) String() string { return proto.CompactTextString(m) }
-func (*Any) ProtoMessage() {}
-func (*Any) Descriptor() ([]byte, []int) {
- return fileDescriptor_any_744b9ca530f228db, []int{0}
-}
-func (*Any) XXX_WellKnownType() string { return "Any" }
-func (m *Any) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Any.Unmarshal(m, b)
-}
-func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Any.Marshal(b, m, deterministic)
-}
-func (dst *Any) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Any.Merge(dst, src)
-}
-func (m *Any) XXX_Size() int {
- return xxx_messageInfo_Any.Size(m)
-}
-func (m *Any) XXX_DiscardUnknown() {
- xxx_messageInfo_Any.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Any proto.InternalMessageInfo
-
-func (m *Any) GetTypeUrl() string {
- if m != nil {
- return m.TypeUrl
- }
- return ""
-}
-
-func (m *Any) GetValue() []byte {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Any)(nil), "google.protobuf.Any")
-}
-
-func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_any_744b9ca530f228db) }
-
-var fileDescriptor_any_744b9ca530f228db = []byte{
- // 185 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
- 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
- 0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x25, 0x33, 0x2e, 0x66, 0xc7, 0xbc, 0x4a,
- 0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2, 0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46,
- 0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7,
- 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc2, 0x71, 0xca, 0xe7, 0x12, 0x4e, 0xce,
- 0xcf, 0xd5, 0x43, 0x33, 0xce, 0x89, 0xc3, 0x31, 0xaf, 0x32, 0x00, 0xc4, 0x09, 0x60, 0x8c, 0x52,
- 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc,
- 0x4b, 0x47, 0xb8, 0xa8, 0x00, 0x64, 0x7a, 0x31, 0xc8, 0x61, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c,
- 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x8c, 0x0a, 0x80, 0x2a, 0xd1, 0x0b, 0x4f, 0xcd, 0xc9, 0xf1, 0xce,
- 0xcb, 0x2f, 0xcf, 0x0b, 0x01, 0x29, 0x4d, 0x62, 0x03, 0xeb, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff,
- 0xff, 0x13, 0xf8, 0xe8, 0x42, 0xdd, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.proto b/vendor/github.com/golang/protobuf/ptypes/any/any.proto
deleted file mode 100644
index c7486676..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/any/any.proto
+++ /dev/null
@@ -1,149 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option go_package = "github.com/golang/protobuf/ptypes/any";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "AnyProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-
-// `Any` contains an arbitrary serialized protocol buffer message along with a
-// URL that describes the type of the serialized message.
-//
-// Protobuf library provides support to pack/unpack Any values in the form
-// of utility functions or additional generated methods of the Any type.
-//
-// Example 1: Pack and unpack a message in C++.
-//
-// Foo foo = ...;
-// Any any;
-// any.PackFrom(foo);
-// ...
-// if (any.UnpackTo(&foo)) {
-// ...
-// }
-//
-// Example 2: Pack and unpack a message in Java.
-//
-// Foo foo = ...;
-// Any any = Any.pack(foo);
-// ...
-// if (any.is(Foo.class)) {
-// foo = any.unpack(Foo.class);
-// }
-//
-// Example 3: Pack and unpack a message in Python.
-//
-// foo = Foo(...)
-// any = Any()
-// any.Pack(foo)
-// ...
-// if any.Is(Foo.DESCRIPTOR):
-// any.Unpack(foo)
-// ...
-//
-// Example 4: Pack and unpack a message in Go
-//
-// foo := &pb.Foo{...}
-// any, err := ptypes.MarshalAny(foo)
-// ...
-// foo := &pb.Foo{}
-// if err := ptypes.UnmarshalAny(any, foo); err != nil {
-// ...
-// }
-//
-// The pack methods provided by protobuf library will by default use
-// 'type.googleapis.com/full.type.name' as the type URL and the unpack
-// methods only use the fully qualified type name after the last '/'
-// in the type URL, for example "foo.bar.com/x/y.z" will yield type
-// name "y.z".
-//
-//
-// JSON
-// ====
-// The JSON representation of an `Any` value uses the regular
-// representation of the deserialized, embedded message, with an
-// additional field `@type` which contains the type URL. Example:
-//
-// package google.profile;
-// message Person {
-// string first_name = 1;
-// string last_name = 2;
-// }
-//
-// {
-// "@type": "type.googleapis.com/google.profile.Person",
-// "firstName": ,
-// "lastName":
-// }
-//
-// If the embedded message type is well-known and has a custom JSON
-// representation, that representation will be embedded adding a field
-// `value` which holds the custom JSON in addition to the `@type`
-// field. Example (for message [google.protobuf.Duration][]):
-//
-// {
-// "@type": "type.googleapis.com/google.protobuf.Duration",
-// "value": "1.212s"
-// }
-//
-message Any {
- // A URL/resource name whose content describes the type of the
- // serialized protocol buffer message.
- //
- // For URLs which use the scheme `http`, `https`, or no scheme, the
- // following restrictions and interpretations apply:
- //
- // * If no scheme is provided, `https` is assumed.
- // * The last segment of the URL's path must represent the fully
- // qualified name of the type (as in `path/google.protobuf.Duration`).
- // The name should be in a canonical form (e.g., leading "." is
- // not accepted).
- // * An HTTP GET on the URL must yield a [google.protobuf.Type][]
- // value in binary format, or produce an error.
- // * Applications are allowed to cache lookup results based on the
- // URL, or have them precompiled into a binary to avoid any
- // lookup. Therefore, binary compatibility needs to be preserved
- // on changes to types. (Use versioned type names to manage
- // breaking changes.)
- //
- // Schemes other than `http`, `https` (or the empty scheme) might be
- // used with implementation specific semantics.
- //
- string type_url = 1;
-
- // Must be a valid serialized protocol buffer of the above specified type.
- bytes value = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any_test.go b/vendor/github.com/golang/protobuf/ptypes/any_test.go
deleted file mode 100644
index ed675b48..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/any_test.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package ptypes
-
-import (
- "testing"
-
- "github.com/golang/protobuf/proto"
- pb "github.com/golang/protobuf/protoc-gen-go/descriptor"
- "github.com/golang/protobuf/ptypes/any"
-)
-
-func TestMarshalUnmarshal(t *testing.T) {
- orig := &any.Any{Value: []byte("test")}
-
- packed, err := MarshalAny(orig)
- if err != nil {
- t.Errorf("MarshalAny(%+v): got: _, %v exp: _, nil", orig, err)
- }
-
- unpacked := &any.Any{}
- err = UnmarshalAny(packed, unpacked)
- if err != nil || !proto.Equal(unpacked, orig) {
- t.Errorf("got: %v, %+v; want nil, %+v", err, unpacked, orig)
- }
-}
-
-func TestIs(t *testing.T) {
- a, err := MarshalAny(&pb.FileDescriptorProto{})
- if err != nil {
- t.Fatal(err)
- }
- if Is(a, &pb.DescriptorProto{}) {
- t.Error("FileDescriptorProto is not a DescriptorProto, but Is says it is")
- }
- if !Is(a, &pb.FileDescriptorProto{}) {
- t.Error("FileDescriptorProto is indeed a FileDescriptorProto, but Is says it is not")
- }
-}
-
-func TestIsDifferentUrlPrefixes(t *testing.T) {
- m := &pb.FileDescriptorProto{}
- a := &any.Any{TypeUrl: "foo/bar/" + proto.MessageName(m)}
- if !Is(a, m) {
- t.Errorf("message with type url %q didn't satisfy Is for type %q", a.TypeUrl, proto.MessageName(m))
- }
-}
-
-func TestUnmarshalDynamic(t *testing.T) {
- want := &pb.FileDescriptorProto{Name: proto.String("foo")}
- a, err := MarshalAny(want)
- if err != nil {
- t.Fatal(err)
- }
- var got DynamicAny
- if err := UnmarshalAny(a, &got); err != nil {
- t.Fatal(err)
- }
- if !proto.Equal(got.Message, want) {
- t.Errorf("invalid result from UnmarshalAny, got %q want %q", got.Message, want)
- }
-}
-
-func TestEmpty(t *testing.T) {
- want := &pb.FileDescriptorProto{}
- a, err := MarshalAny(want)
- if err != nil {
- t.Fatal(err)
- }
- got, err := Empty(a)
- if err != nil {
- t.Fatal(err)
- }
- if !proto.Equal(got, want) {
- t.Errorf("unequal empty message, got %q, want %q", got, want)
- }
-
- // that's a valid type_url for a message which shouldn't be linked into this
- // test binary. We want an error.
- a.TypeUrl = "type.googleapis.com/google.protobuf.FieldMask"
- if _, err := Empty(a); err == nil {
- t.Errorf("got no error for an attempt to create a message of type %q, which shouldn't be linked in", a.TypeUrl)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/doc.go b/vendor/github.com/golang/protobuf/ptypes/doc.go
deleted file mode 100644
index c0d595da..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/doc.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-/*
-Package ptypes contains code for interacting with well-known types.
-*/
-package ptypes
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration.go b/vendor/github.com/golang/protobuf/ptypes/duration.go
deleted file mode 100644
index 65cb0f8e..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration.go
+++ /dev/null
@@ -1,102 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package ptypes
-
-// This file implements conversions between google.protobuf.Duration
-// and time.Duration.
-
-import (
- "errors"
- "fmt"
- "time"
-
- durpb "github.com/golang/protobuf/ptypes/duration"
-)
-
-const (
- // Range of a durpb.Duration in seconds, as specified in
- // google/protobuf/duration.proto. This is about 10,000 years in seconds.
- maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60)
- minSeconds = -maxSeconds
-)
-
-// validateDuration determines whether the durpb.Duration is valid according to the
-// definition in google/protobuf/duration.proto. A valid durpb.Duration
-// may still be too large to fit into a time.Duration (the range of durpb.Duration
-// is about 10,000 years, and the range of time.Duration is about 290).
-func validateDuration(d *durpb.Duration) error {
- if d == nil {
- return errors.New("duration: nil Duration")
- }
- if d.Seconds < minSeconds || d.Seconds > maxSeconds {
- return fmt.Errorf("duration: %v: seconds out of range", d)
- }
- if d.Nanos <= -1e9 || d.Nanos >= 1e9 {
- return fmt.Errorf("duration: %v: nanos out of range", d)
- }
- // Seconds and Nanos must have the same sign, unless d.Nanos is zero.
- if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) {
- return fmt.Errorf("duration: %v: seconds and nanos have different signs", d)
- }
- return nil
-}
-
-// Duration converts a durpb.Duration to a time.Duration. Duration
-// returns an error if the durpb.Duration is invalid or is too large to be
-// represented in a time.Duration.
-func Duration(p *durpb.Duration) (time.Duration, error) {
- if err := validateDuration(p); err != nil {
- return 0, err
- }
- d := time.Duration(p.Seconds) * time.Second
- if int64(d/time.Second) != p.Seconds {
- return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
- }
- if p.Nanos != 0 {
- d += time.Duration(p.Nanos)
- if (d < 0) != (p.Nanos < 0) {
- return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
- }
- }
- return d, nil
-}
-
-// DurationProto converts a time.Duration to a durpb.Duration.
-func DurationProto(d time.Duration) *durpb.Duration {
- nanos := d.Nanoseconds()
- secs := nanos / 1e9
- nanos -= secs * 1e9
- return &durpb.Duration{
- Seconds: secs,
- Nanos: int32(nanos),
- }
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
deleted file mode 100644
index 4d75473b..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
+++ /dev/null
@@ -1,159 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/duration.proto
-
-package duration // import "github.com/golang/protobuf/ptypes/duration"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// A Duration represents a signed, fixed-length span of time represented
-// as a count of seconds and fractions of seconds at nanosecond
-// resolution. It is independent of any calendar and concepts like "day"
-// or "month". It is related to Timestamp in that the difference between
-// two Timestamp values is a Duration and it can be added or subtracted
-// from a Timestamp. Range is approximately +-10,000 years.
-//
-// # Examples
-//
-// Example 1: Compute Duration from two Timestamps in pseudo code.
-//
-// Timestamp start = ...;
-// Timestamp end = ...;
-// Duration duration = ...;
-//
-// duration.seconds = end.seconds - start.seconds;
-// duration.nanos = end.nanos - start.nanos;
-//
-// if (duration.seconds < 0 && duration.nanos > 0) {
-// duration.seconds += 1;
-// duration.nanos -= 1000000000;
-// } else if (durations.seconds > 0 && duration.nanos < 0) {
-// duration.seconds -= 1;
-// duration.nanos += 1000000000;
-// }
-//
-// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
-//
-// Timestamp start = ...;
-// Duration duration = ...;
-// Timestamp end = ...;
-//
-// end.seconds = start.seconds + duration.seconds;
-// end.nanos = start.nanos + duration.nanos;
-//
-// if (end.nanos < 0) {
-// end.seconds -= 1;
-// end.nanos += 1000000000;
-// } else if (end.nanos >= 1000000000) {
-// end.seconds += 1;
-// end.nanos -= 1000000000;
-// }
-//
-// Example 3: Compute Duration from datetime.timedelta in Python.
-//
-// td = datetime.timedelta(days=3, minutes=10)
-// duration = Duration()
-// duration.FromTimedelta(td)
-//
-// # JSON Mapping
-//
-// In JSON format, the Duration type is encoded as a string rather than an
-// object, where the string ends in the suffix "s" (indicating seconds) and
-// is preceded by the number of seconds, with nanoseconds expressed as
-// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
-// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
-// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
-// microsecond should be expressed in JSON format as "3.000001s".
-//
-//
-type Duration struct {
- // Signed seconds of the span of time. Must be from -315,576,000,000
- // to +315,576,000,000 inclusive. Note: these bounds are computed from:
- // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
- Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
- // Signed fractions of a second at nanosecond resolution of the span
- // of time. Durations less than one second are represented with a 0
- // `seconds` field and a positive or negative `nanos` field. For durations
- // of one second or more, a non-zero value for the `nanos` field must be
- // of the same sign as the `seconds` field. Must be from -999,999,999
- // to +999,999,999 inclusive.
- Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Duration) Reset() { *m = Duration{} }
-func (m *Duration) String() string { return proto.CompactTextString(m) }
-func (*Duration) ProtoMessage() {}
-func (*Duration) Descriptor() ([]byte, []int) {
- return fileDescriptor_duration_e7d612259e3f0613, []int{0}
-}
-func (*Duration) XXX_WellKnownType() string { return "Duration" }
-func (m *Duration) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Duration.Unmarshal(m, b)
-}
-func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
-}
-func (dst *Duration) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Duration.Merge(dst, src)
-}
-func (m *Duration) XXX_Size() int {
- return xxx_messageInfo_Duration.Size(m)
-}
-func (m *Duration) XXX_DiscardUnknown() {
- xxx_messageInfo_Duration.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Duration proto.InternalMessageInfo
-
-func (m *Duration) GetSeconds() int64 {
- if m != nil {
- return m.Seconds
- }
- return 0
-}
-
-func (m *Duration) GetNanos() int32 {
- if m != nil {
- return m.Nanos
- }
- return 0
-}
-
-func init() {
- proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
-}
-
-func init() {
- proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_duration_e7d612259e3f0613)
-}
-
-var fileDescriptor_duration_e7d612259e3f0613 = []byte{
- // 190 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
- 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a,
- 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0x56,
- 0x5c, 0x1c, 0x2e, 0x50, 0x25, 0x42, 0x12, 0x5c, 0xec, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5,
- 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x30, 0xae, 0x90, 0x08, 0x17, 0x6b, 0x5e, 0x62, 0x5e,
- 0x7e, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x84, 0xe3, 0x54, 0xc3, 0x25, 0x9c, 0x9c,
- 0x9f, 0xab, 0x87, 0x66, 0xa4, 0x13, 0x2f, 0xcc, 0xc0, 0x00, 0x90, 0x48, 0x00, 0x63, 0x94, 0x56,
- 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e,
- 0x3a, 0xc2, 0x7d, 0x05, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x70, 0x67, 0xfe, 0x60, 0x64, 0x5c, 0xc4,
- 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x6e, 0x00, 0x54, 0xa9, 0x5e, 0x78,
- 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x4b, 0x12, 0x1b, 0xd8, 0x0c, 0x63,
- 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x84, 0x30, 0xff, 0xf3, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto b/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto
deleted file mode 100644
index 975fce41..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto
+++ /dev/null
@@ -1,117 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/duration";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "DurationProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-
-// A Duration represents a signed, fixed-length span of time represented
-// as a count of seconds and fractions of seconds at nanosecond
-// resolution. It is independent of any calendar and concepts like "day"
-// or "month". It is related to Timestamp in that the difference between
-// two Timestamp values is a Duration and it can be added or subtracted
-// from a Timestamp. Range is approximately +-10,000 years.
-//
-// # Examples
-//
-// Example 1: Compute Duration from two Timestamps in pseudo code.
-//
-// Timestamp start = ...;
-// Timestamp end = ...;
-// Duration duration = ...;
-//
-// duration.seconds = end.seconds - start.seconds;
-// duration.nanos = end.nanos - start.nanos;
-//
-// if (duration.seconds < 0 && duration.nanos > 0) {
-// duration.seconds += 1;
-// duration.nanos -= 1000000000;
-// } else if (durations.seconds > 0 && duration.nanos < 0) {
-// duration.seconds -= 1;
-// duration.nanos += 1000000000;
-// }
-//
-// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
-//
-// Timestamp start = ...;
-// Duration duration = ...;
-// Timestamp end = ...;
-//
-// end.seconds = start.seconds + duration.seconds;
-// end.nanos = start.nanos + duration.nanos;
-//
-// if (end.nanos < 0) {
-// end.seconds -= 1;
-// end.nanos += 1000000000;
-// } else if (end.nanos >= 1000000000) {
-// end.seconds += 1;
-// end.nanos -= 1000000000;
-// }
-//
-// Example 3: Compute Duration from datetime.timedelta in Python.
-//
-// td = datetime.timedelta(days=3, minutes=10)
-// duration = Duration()
-// duration.FromTimedelta(td)
-//
-// # JSON Mapping
-//
-// In JSON format, the Duration type is encoded as a string rather than an
-// object, where the string ends in the suffix "s" (indicating seconds) and
-// is preceded by the number of seconds, with nanoseconds expressed as
-// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
-// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
-// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
-// microsecond should be expressed in JSON format as "3.000001s".
-//
-//
-message Duration {
-
- // Signed seconds of the span of time. Must be from -315,576,000,000
- // to +315,576,000,000 inclusive. Note: these bounds are computed from:
- // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
- int64 seconds = 1;
-
- // Signed fractions of a second at nanosecond resolution of the span
- // of time. Durations less than one second are represented with a 0
- // `seconds` field and a positive or negative `nanos` field. For durations
- // of one second or more, a non-zero value for the `nanos` field must be
- // of the same sign as the `seconds` field. Must be from -999,999,999
- // to +999,999,999 inclusive.
- int32 nanos = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration_test.go b/vendor/github.com/golang/protobuf/ptypes/duration_test.go
deleted file mode 100644
index e00491a3..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration_test.go
+++ /dev/null
@@ -1,121 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package ptypes
-
-import (
- "math"
- "testing"
- "time"
-
- "github.com/golang/protobuf/proto"
- durpb "github.com/golang/protobuf/ptypes/duration"
-)
-
-const (
- minGoSeconds = math.MinInt64 / int64(1e9)
- maxGoSeconds = math.MaxInt64 / int64(1e9)
-)
-
-var durationTests = []struct {
- proto *durpb.Duration
- isValid bool
- inRange bool
- dur time.Duration
-}{
- // The zero duration.
- {&durpb.Duration{Seconds: 0, Nanos: 0}, true, true, 0},
- // Some ordinary non-zero durations.
- {&durpb.Duration{Seconds: 100, Nanos: 0}, true, true, 100 * time.Second},
- {&durpb.Duration{Seconds: -100, Nanos: 0}, true, true, -100 * time.Second},
- {&durpb.Duration{Seconds: 100, Nanos: 987}, true, true, 100*time.Second + 987},
- {&durpb.Duration{Seconds: -100, Nanos: -987}, true, true, -(100*time.Second + 987)},
- // The largest duration representable in Go.
- {&durpb.Duration{Seconds: maxGoSeconds, Nanos: int32(math.MaxInt64 - 1e9*maxGoSeconds)}, true, true, math.MaxInt64},
- // The smallest duration representable in Go.
- {&durpb.Duration{Seconds: minGoSeconds, Nanos: int32(math.MinInt64 - 1e9*minGoSeconds)}, true, true, math.MinInt64},
- {nil, false, false, 0},
- {&durpb.Duration{Seconds: -100, Nanos: 987}, false, false, 0},
- {&durpb.Duration{Seconds: 100, Nanos: -987}, false, false, 0},
- {&durpb.Duration{Seconds: math.MinInt64, Nanos: 0}, false, false, 0},
- {&durpb.Duration{Seconds: math.MaxInt64, Nanos: 0}, false, false, 0},
- // The largest valid duration.
- {&durpb.Duration{Seconds: maxSeconds, Nanos: 1e9 - 1}, true, false, 0},
- // The smallest valid duration.
- {&durpb.Duration{Seconds: minSeconds, Nanos: -(1e9 - 1)}, true, false, 0},
- // The smallest invalid duration above the valid range.
- {&durpb.Duration{Seconds: maxSeconds + 1, Nanos: 0}, false, false, 0},
- // The largest invalid duration below the valid range.
- {&durpb.Duration{Seconds: minSeconds - 1, Nanos: -(1e9 - 1)}, false, false, 0},
- // One nanosecond past the largest duration representable in Go.
- {&durpb.Duration{Seconds: maxGoSeconds, Nanos: int32(math.MaxInt64-1e9*maxGoSeconds) + 1}, true, false, 0},
- // One nanosecond past the smallest duration representable in Go.
- {&durpb.Duration{Seconds: minGoSeconds, Nanos: int32(math.MinInt64-1e9*minGoSeconds) - 1}, true, false, 0},
- // One second past the largest duration representable in Go.
- {&durpb.Duration{Seconds: maxGoSeconds + 1, Nanos: int32(math.MaxInt64 - 1e9*maxGoSeconds)}, true, false, 0},
- // One second past the smallest duration representable in Go.
- {&durpb.Duration{Seconds: minGoSeconds - 1, Nanos: int32(math.MinInt64 - 1e9*minGoSeconds)}, true, false, 0},
-}
-
-func TestValidateDuration(t *testing.T) {
- for _, test := range durationTests {
- err := validateDuration(test.proto)
- gotValid := (err == nil)
- if gotValid != test.isValid {
- t.Errorf("validateDuration(%v) = %t, want %t", test.proto, gotValid, test.isValid)
- }
- }
-}
-
-func TestDuration(t *testing.T) {
- for _, test := range durationTests {
- got, err := Duration(test.proto)
- gotOK := (err == nil)
- wantOK := test.isValid && test.inRange
- if gotOK != wantOK {
- t.Errorf("Duration(%v) ok = %t, want %t", test.proto, gotOK, wantOK)
- }
- if err == nil && got != test.dur {
- t.Errorf("Duration(%v) = %v, want %v", test.proto, got, test.dur)
- }
- }
-}
-
-func TestDurationProto(t *testing.T) {
- for _, test := range durationTests {
- if test.isValid && test.inRange {
- got := DurationProto(test.dur)
- if !proto.Equal(got, test.proto) {
- t.Errorf("DurationProto(%v) = %v, want %v", test.dur, got, test.proto)
- }
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go b/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go
deleted file mode 100644
index a69b403c..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/empty.proto
-
-package empty // import "github.com/golang/protobuf/ptypes/empty"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// A generic empty message that you can re-use to avoid defining duplicated
-// empty messages in your APIs. A typical example is to use it as the request
-// or the response type of an API method. For instance:
-//
-// service Foo {
-// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
-// }
-//
-// The JSON representation for `Empty` is empty JSON object `{}`.
-type Empty struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Empty) Reset() { *m = Empty{} }
-func (m *Empty) String() string { return proto.CompactTextString(m) }
-func (*Empty) ProtoMessage() {}
-func (*Empty) Descriptor() ([]byte, []int) {
- return fileDescriptor_empty_39e6d6db0632e5b2, []int{0}
-}
-func (*Empty) XXX_WellKnownType() string { return "Empty" }
-func (m *Empty) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Empty.Unmarshal(m, b)
-}
-func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
-}
-func (dst *Empty) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Empty.Merge(dst, src)
-}
-func (m *Empty) XXX_Size() int {
- return xxx_messageInfo_Empty.Size(m)
-}
-func (m *Empty) XXX_DiscardUnknown() {
- xxx_messageInfo_Empty.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Empty proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Empty)(nil), "google.protobuf.Empty")
-}
-
-func init() { proto.RegisterFile("google/protobuf/empty.proto", fileDescriptor_empty_39e6d6db0632e5b2) }
-
-var fileDescriptor_empty_39e6d6db0632e5b2 = []byte{
- // 148 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcf, 0xcf, 0x4f,
- 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcd, 0x2d, 0x28,
- 0xa9, 0xd4, 0x03, 0x73, 0x85, 0xf8, 0x21, 0x92, 0x7a, 0x30, 0x49, 0x25, 0x76, 0x2e, 0x56, 0x57,
- 0x90, 0xbc, 0x53, 0x19, 0x97, 0x70, 0x72, 0x7e, 0xae, 0x1e, 0x9a, 0xbc, 0x13, 0x17, 0x58, 0x36,
- 0x00, 0xc4, 0x0d, 0x60, 0x8c, 0x52, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf,
- 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0x47, 0x58, 0x53, 0x50, 0x52, 0x59, 0x90, 0x5a, 0x0c,
- 0xb1, 0xed, 0x07, 0x23, 0xe3, 0x22, 0x26, 0x66, 0xf7, 0x00, 0xa7, 0x55, 0x4c, 0x72, 0xee, 0x10,
- 0x13, 0x03, 0xa0, 0xea, 0xf4, 0xc2, 0x53, 0x73, 0x72, 0xbc, 0xf3, 0xf2, 0xcb, 0xf3, 0x42, 0x40,
- 0xea, 0x93, 0xd8, 0xc0, 0x06, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x64, 0xd4, 0xb3, 0xa6,
- 0xb7, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto b/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto
deleted file mode 100644
index 03cacd23..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto
+++ /dev/null
@@ -1,52 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option go_package = "github.com/golang/protobuf/ptypes/empty";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "EmptyProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-option cc_enable_arenas = true;
-
-// A generic empty message that you can re-use to avoid defining duplicated
-// empty messages in your APIs. A typical example is to use it as the request
-// or the response type of an API method. For instance:
-//
-// service Foo {
-// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
-// }
-//
-// The JSON representation for `Empty` is empty JSON object `{}`.
-message Empty {}
diff --git a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go b/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
deleted file mode 100644
index 442c0e09..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
+++ /dev/null
@@ -1,440 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/struct.proto
-
-package structpb // import "github.com/golang/protobuf/ptypes/struct"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// `NullValue` is a singleton enumeration to represent the null value for the
-// `Value` type union.
-//
-// The JSON representation for `NullValue` is JSON `null`.
-type NullValue int32
-
-const (
- // Null value.
- NullValue_NULL_VALUE NullValue = 0
-)
-
-var NullValue_name = map[int32]string{
- 0: "NULL_VALUE",
-}
-var NullValue_value = map[string]int32{
- "NULL_VALUE": 0,
-}
-
-func (x NullValue) String() string {
- return proto.EnumName(NullValue_name, int32(x))
-}
-func (NullValue) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_struct_3a5a94e0c7801b27, []int{0}
-}
-func (NullValue) XXX_WellKnownType() string { return "NullValue" }
-
-// `Struct` represents a structured data value, consisting of fields
-// which map to dynamically typed values. In some languages, `Struct`
-// might be supported by a native representation. For example, in
-// scripting languages like JS a struct is represented as an
-// object. The details of that representation are described together
-// with the proto support for the language.
-//
-// The JSON representation for `Struct` is JSON object.
-type Struct struct {
- // Unordered map of dynamically typed values.
- Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Struct) Reset() { *m = Struct{} }
-func (m *Struct) String() string { return proto.CompactTextString(m) }
-func (*Struct) ProtoMessage() {}
-func (*Struct) Descriptor() ([]byte, []int) {
- return fileDescriptor_struct_3a5a94e0c7801b27, []int{0}
-}
-func (*Struct) XXX_WellKnownType() string { return "Struct" }
-func (m *Struct) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Struct.Unmarshal(m, b)
-}
-func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Struct.Marshal(b, m, deterministic)
-}
-func (dst *Struct) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Struct.Merge(dst, src)
-}
-func (m *Struct) XXX_Size() int {
- return xxx_messageInfo_Struct.Size(m)
-}
-func (m *Struct) XXX_DiscardUnknown() {
- xxx_messageInfo_Struct.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Struct proto.InternalMessageInfo
-
-func (m *Struct) GetFields() map[string]*Value {
- if m != nil {
- return m.Fields
- }
- return nil
-}
-
-// `Value` represents a dynamically typed value which can be either
-// null, a number, a string, a boolean, a recursive struct value, or a
-// list of values. A producer of value is expected to set one of that
-// variants, absence of any variant indicates an error.
-//
-// The JSON representation for `Value` is JSON value.
-type Value struct {
- // The kind of value.
- //
- // Types that are valid to be assigned to Kind:
- // *Value_NullValue
- // *Value_NumberValue
- // *Value_StringValue
- // *Value_BoolValue
- // *Value_StructValue
- // *Value_ListValue
- Kind isValue_Kind `protobuf_oneof:"kind"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Value) Reset() { *m = Value{} }
-func (m *Value) String() string { return proto.CompactTextString(m) }
-func (*Value) ProtoMessage() {}
-func (*Value) Descriptor() ([]byte, []int) {
- return fileDescriptor_struct_3a5a94e0c7801b27, []int{1}
-}
-func (*Value) XXX_WellKnownType() string { return "Value" }
-func (m *Value) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Value.Unmarshal(m, b)
-}
-func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Value.Marshal(b, m, deterministic)
-}
-func (dst *Value) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Value.Merge(dst, src)
-}
-func (m *Value) XXX_Size() int {
- return xxx_messageInfo_Value.Size(m)
-}
-func (m *Value) XXX_DiscardUnknown() {
- xxx_messageInfo_Value.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Value proto.InternalMessageInfo
-
-type isValue_Kind interface {
- isValue_Kind()
-}
-
-type Value_NullValue struct {
- NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,enum=google.protobuf.NullValue,oneof"`
-}
-type Value_NumberValue struct {
- NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,oneof"`
-}
-type Value_StringValue struct {
- StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,oneof"`
-}
-type Value_BoolValue struct {
- BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,oneof"`
-}
-type Value_StructValue struct {
- StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,oneof"`
-}
-type Value_ListValue struct {
- ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,oneof"`
-}
-
-func (*Value_NullValue) isValue_Kind() {}
-func (*Value_NumberValue) isValue_Kind() {}
-func (*Value_StringValue) isValue_Kind() {}
-func (*Value_BoolValue) isValue_Kind() {}
-func (*Value_StructValue) isValue_Kind() {}
-func (*Value_ListValue) isValue_Kind() {}
-
-func (m *Value) GetKind() isValue_Kind {
- if m != nil {
- return m.Kind
- }
- return nil
-}
-
-func (m *Value) GetNullValue() NullValue {
- if x, ok := m.GetKind().(*Value_NullValue); ok {
- return x.NullValue
- }
- return NullValue_NULL_VALUE
-}
-
-func (m *Value) GetNumberValue() float64 {
- if x, ok := m.GetKind().(*Value_NumberValue); ok {
- return x.NumberValue
- }
- return 0
-}
-
-func (m *Value) GetStringValue() string {
- if x, ok := m.GetKind().(*Value_StringValue); ok {
- return x.StringValue
- }
- return ""
-}
-
-func (m *Value) GetBoolValue() bool {
- if x, ok := m.GetKind().(*Value_BoolValue); ok {
- return x.BoolValue
- }
- return false
-}
-
-func (m *Value) GetStructValue() *Struct {
- if x, ok := m.GetKind().(*Value_StructValue); ok {
- return x.StructValue
- }
- return nil
-}
-
-func (m *Value) GetListValue() *ListValue {
- if x, ok := m.GetKind().(*Value_ListValue); ok {
- return x.ListValue
- }
- return nil
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{
- (*Value_NullValue)(nil),
- (*Value_NumberValue)(nil),
- (*Value_StringValue)(nil),
- (*Value_BoolValue)(nil),
- (*Value_StructValue)(nil),
- (*Value_ListValue)(nil),
- }
-}
-
-func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*Value)
- // kind
- switch x := m.Kind.(type) {
- case *Value_NullValue:
- b.EncodeVarint(1<<3 | proto.WireVarint)
- b.EncodeVarint(uint64(x.NullValue))
- case *Value_NumberValue:
- b.EncodeVarint(2<<3 | proto.WireFixed64)
- b.EncodeFixed64(math.Float64bits(x.NumberValue))
- case *Value_StringValue:
- b.EncodeVarint(3<<3 | proto.WireBytes)
- b.EncodeStringBytes(x.StringValue)
- case *Value_BoolValue:
- t := uint64(0)
- if x.BoolValue {
- t = 1
- }
- b.EncodeVarint(4<<3 | proto.WireVarint)
- b.EncodeVarint(t)
- case *Value_StructValue:
- b.EncodeVarint(5<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.StructValue); err != nil {
- return err
- }
- case *Value_ListValue:
- b.EncodeVarint(6<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.ListValue); err != nil {
- return err
- }
- case nil:
- default:
- return fmt.Errorf("Value.Kind has unexpected type %T", x)
- }
- return nil
-}
-
-func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*Value)
- switch tag {
- case 1: // kind.null_value
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Kind = &Value_NullValue{NullValue(x)}
- return true, err
- case 2: // kind.number_value
- if wire != proto.WireFixed64 {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeFixed64()
- m.Kind = &Value_NumberValue{math.Float64frombits(x)}
- return true, err
- case 3: // kind.string_value
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeStringBytes()
- m.Kind = &Value_StringValue{x}
- return true, err
- case 4: // kind.bool_value
- if wire != proto.WireVarint {
- return true, proto.ErrInternalBadWireType
- }
- x, err := b.DecodeVarint()
- m.Kind = &Value_BoolValue{x != 0}
- return true, err
- case 5: // kind.struct_value
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(Struct)
- err := b.DecodeMessage(msg)
- m.Kind = &Value_StructValue{msg}
- return true, err
- case 6: // kind.list_value
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(ListValue)
- err := b.DecodeMessage(msg)
- m.Kind = &Value_ListValue{msg}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _Value_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*Value)
- // kind
- switch x := m.Kind.(type) {
- case *Value_NullValue:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(x.NullValue))
- case *Value_NumberValue:
- n += 1 // tag and wire
- n += 8
- case *Value_StringValue:
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(len(x.StringValue)))
- n += len(x.StringValue)
- case *Value_BoolValue:
- n += 1 // tag and wire
- n += 1
- case *Value_StructValue:
- s := proto.Size(x.StructValue)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Value_ListValue:
- s := proto.Size(x.ListValue)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-// `ListValue` is a wrapper around a repeated field of values.
-//
-// The JSON representation for `ListValue` is JSON array.
-type ListValue struct {
- // Repeated field of dynamically typed values.
- Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListValue) Reset() { *m = ListValue{} }
-func (m *ListValue) String() string { return proto.CompactTextString(m) }
-func (*ListValue) ProtoMessage() {}
-func (*ListValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_struct_3a5a94e0c7801b27, []int{2}
-}
-func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
-func (m *ListValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ListValue.Unmarshal(m, b)
-}
-func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ListValue.Marshal(b, m, deterministic)
-}
-func (dst *ListValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListValue.Merge(dst, src)
-}
-func (m *ListValue) XXX_Size() int {
- return xxx_messageInfo_ListValue.Size(m)
-}
-func (m *ListValue) XXX_DiscardUnknown() {
- xxx_messageInfo_ListValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListValue proto.InternalMessageInfo
-
-func (m *ListValue) GetValues() []*Value {
- if m != nil {
- return m.Values
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
- proto.RegisterMapType((map[string]*Value)(nil), "google.protobuf.Struct.FieldsEntry")
- proto.RegisterType((*Value)(nil), "google.protobuf.Value")
- proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
- proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
-}
-
-func init() {
- proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_struct_3a5a94e0c7801b27)
-}
-
-var fileDescriptor_struct_3a5a94e0c7801b27 = []byte{
- // 417 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8b, 0xd3, 0x40,
- 0x14, 0xc7, 0x3b, 0xc9, 0x36, 0x98, 0x17, 0x59, 0x97, 0x11, 0xb4, 0xac, 0xa2, 0xa1, 0x7b, 0x09,
- 0x22, 0x29, 0xd6, 0x8b, 0x18, 0x2f, 0x06, 0xd6, 0x5d, 0x30, 0x2c, 0x31, 0xba, 0x15, 0xbc, 0x94,
- 0x26, 0x4d, 0x63, 0xe8, 0x74, 0x26, 0x24, 0x33, 0x4a, 0x8f, 0x7e, 0x0b, 0xcf, 0x1e, 0x3d, 0xfa,
- 0xe9, 0x3c, 0xca, 0xcc, 0x24, 0xa9, 0xb4, 0xf4, 0x94, 0xbc, 0xf7, 0x7e, 0xef, 0x3f, 0xef, 0xff,
- 0x66, 0xe0, 0x71, 0xc1, 0x58, 0x41, 0xf2, 0x49, 0x55, 0x33, 0xce, 0x52, 0xb1, 0x9a, 0x34, 0xbc,
- 0x16, 0x19, 0xf7, 0x55, 0x8c, 0xef, 0xe9, 0xaa, 0xdf, 0x55, 0xc7, 0x3f, 0x11, 0x58, 0x1f, 0x15,
- 0x81, 0x03, 0xb0, 0x56, 0x65, 0x4e, 0x96, 0xcd, 0x08, 0xb9, 0xa6, 0xe7, 0x4c, 0x2f, 0xfc, 0x3d,
- 0xd8, 0xd7, 0xa0, 0xff, 0x4e, 0x51, 0x97, 0x94, 0xd7, 0xdb, 0xa4, 0x6d, 0x39, 0xff, 0x00, 0xce,
- 0x7f, 0x69, 0x7c, 0x06, 0xe6, 0x3a, 0xdf, 0x8e, 0x90, 0x8b, 0x3c, 0x3b, 0x91, 0xbf, 0xf8, 0x39,
- 0x0c, 0xbf, 0x2d, 0x88, 0xc8, 0x47, 0x86, 0x8b, 0x3c, 0x67, 0xfa, 0xe0, 0x40, 0x7c, 0x26, 0xab,
- 0x89, 0x86, 0x5e, 0x1b, 0xaf, 0xd0, 0xf8, 0x8f, 0x01, 0x43, 0x95, 0xc4, 0x01, 0x00, 0x15, 0x84,
- 0xcc, 0xb5, 0x80, 0x14, 0x3d, 0x9d, 0x9e, 0x1f, 0x08, 0xdc, 0x08, 0x42, 0x14, 0x7f, 0x3d, 0x48,
- 0x6c, 0xda, 0x05, 0xf8, 0x02, 0xee, 0x52, 0xb1, 0x49, 0xf3, 0x7a, 0xbe, 0x3b, 0x1f, 0x5d, 0x0f,
- 0x12, 0x47, 0x67, 0x7b, 0xa8, 0xe1, 0x75, 0x49, 0x8b, 0x16, 0x32, 0xe5, 0xe0, 0x12, 0xd2, 0x59,
- 0x0d, 0x3d, 0x05, 0x48, 0x19, 0xeb, 0xc6, 0x38, 0x71, 0x91, 0x77, 0x47, 0x1e, 0x25, 0x73, 0x1a,
- 0x78, 0xa3, 0x54, 0x44, 0xc6, 0x5b, 0x64, 0xa8, 0xac, 0x3e, 0x3c, 0xb2, 0xc7, 0x56, 0x5e, 0x64,
- 0xbc, 0x77, 0x49, 0xca, 0xa6, 0xeb, 0xb5, 0x54, 0xef, 0xa1, 0xcb, 0xa8, 0x6c, 0x78, 0xef, 0x92,
- 0x74, 0x41, 0x68, 0xc1, 0xc9, 0xba, 0xa4, 0xcb, 0x71, 0x00, 0x76, 0x4f, 0x60, 0x1f, 0x2c, 0x25,
- 0xd6, 0xdd, 0xe8, 0xb1, 0xa5, 0xb7, 0xd4, 0xb3, 0x47, 0x60, 0xf7, 0x4b, 0xc4, 0xa7, 0x00, 0x37,
- 0xb7, 0x51, 0x34, 0x9f, 0xbd, 0x8d, 0x6e, 0x2f, 0xcf, 0x06, 0xe1, 0x0f, 0x04, 0xf7, 0x33, 0xb6,
- 0xd9, 0x97, 0x08, 0x1d, 0xed, 0x26, 0x96, 0x71, 0x8c, 0xbe, 0xbc, 0x28, 0x4a, 0xfe, 0x55, 0xa4,
- 0x7e, 0xc6, 0x36, 0x93, 0x82, 0x91, 0x05, 0x2d, 0x76, 0x4f, 0xb1, 0xe2, 0xdb, 0x2a, 0x6f, 0xda,
- 0x17, 0x19, 0xe8, 0x4f, 0x95, 0xfe, 0x45, 0xe8, 0x97, 0x61, 0x5e, 0xc5, 0xe1, 0x6f, 0xe3, 0xc9,
- 0x95, 0x16, 0x8f, 0xbb, 0xf9, 0x3e, 0xe7, 0x84, 0xbc, 0xa7, 0xec, 0x3b, 0xfd, 0x24, 0x3b, 0x53,
- 0x4b, 0x49, 0xbd, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x1b, 0x59, 0xf8, 0xe5, 0x02, 0x00,
- 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto b/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto
deleted file mode 100644
index 7d7808e7..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto
+++ /dev/null
@@ -1,96 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/struct;structpb";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "StructProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-
-
-// `Struct` represents a structured data value, consisting of fields
-// which map to dynamically typed values. In some languages, `Struct`
-// might be supported by a native representation. For example, in
-// scripting languages like JS a struct is represented as an
-// object. The details of that representation are described together
-// with the proto support for the language.
-//
-// The JSON representation for `Struct` is JSON object.
-message Struct {
- // Unordered map of dynamically typed values.
- map fields = 1;
-}
-
-// `Value` represents a dynamically typed value which can be either
-// null, a number, a string, a boolean, a recursive struct value, or a
-// list of values. A producer of value is expected to set one of that
-// variants, absence of any variant indicates an error.
-//
-// The JSON representation for `Value` is JSON value.
-message Value {
- // The kind of value.
- oneof kind {
- // Represents a null value.
- NullValue null_value = 1;
- // Represents a double value.
- double number_value = 2;
- // Represents a string value.
- string string_value = 3;
- // Represents a boolean value.
- bool bool_value = 4;
- // Represents a structured value.
- Struct struct_value = 5;
- // Represents a repeated `Value`.
- ListValue list_value = 6;
- }
-}
-
-// `NullValue` is a singleton enumeration to represent the null value for the
-// `Value` type union.
-//
-// The JSON representation for `NullValue` is JSON `null`.
-enum NullValue {
- // Null value.
- NULL_VALUE = 0;
-}
-
-// `ListValue` is a wrapper around a repeated field of values.
-//
-// The JSON representation for `ListValue` is JSON array.
-message ListValue {
- // Repeated field of dynamically typed values.
- repeated Value values = 1;
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/vendor/github.com/golang/protobuf/ptypes/timestamp.go
deleted file mode 100644
index 47f10dbc..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp.go
+++ /dev/null
@@ -1,134 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package ptypes
-
-// This file implements operations on google.protobuf.Timestamp.
-
-import (
- "errors"
- "fmt"
- "time"
-
- tspb "github.com/golang/protobuf/ptypes/timestamp"
-)
-
-const (
- // Seconds field of the earliest valid Timestamp.
- // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- minValidSeconds = -62135596800
- // Seconds field just after the latest valid Timestamp.
- // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- maxValidSeconds = 253402300800
-)
-
-// validateTimestamp determines whether a Timestamp is valid.
-// A valid timestamp represents a time in the range
-// [0001-01-01, 10000-01-01) and has a Nanos field
-// in the range [0, 1e9).
-//
-// If the Timestamp is valid, validateTimestamp returns nil.
-// Otherwise, it returns an error that describes
-// the problem.
-//
-// Every valid Timestamp can be represented by a time.Time, but the converse is not true.
-func validateTimestamp(ts *tspb.Timestamp) error {
- if ts == nil {
- return errors.New("timestamp: nil Timestamp")
- }
- if ts.Seconds < minValidSeconds {
- return fmt.Errorf("timestamp: %v before 0001-01-01", ts)
- }
- if ts.Seconds >= maxValidSeconds {
- return fmt.Errorf("timestamp: %v after 10000-01-01", ts)
- }
- if ts.Nanos < 0 || ts.Nanos >= 1e9 {
- return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts)
- }
- return nil
-}
-
-// Timestamp converts a google.protobuf.Timestamp proto to a time.Time.
-// It returns an error if the argument is invalid.
-//
-// Unlike most Go functions, if Timestamp returns an error, the first return value
-// is not the zero time.Time. Instead, it is the value obtained from the
-// time.Unix function when passed the contents of the Timestamp, in the UTC
-// locale. This may or may not be a meaningful time; many invalid Timestamps
-// do map to valid time.Times.
-//
-// A nil Timestamp returns an error. The first return value in that case is
-// undefined.
-func Timestamp(ts *tspb.Timestamp) (time.Time, error) {
- // Don't return the zero value on error, because corresponds to a valid
- // timestamp. Instead return whatever time.Unix gives us.
- var t time.Time
- if ts == nil {
- t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp
- } else {
- t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
- }
- return t, validateTimestamp(ts)
-}
-
-// TimestampNow returns a google.protobuf.Timestamp for the current time.
-func TimestampNow() *tspb.Timestamp {
- ts, err := TimestampProto(time.Now())
- if err != nil {
- panic("ptypes: time.Now() out of Timestamp range")
- }
- return ts
-}
-
-// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
-// It returns an error if the resulting Timestamp is invalid.
-func TimestampProto(t time.Time) (*tspb.Timestamp, error) {
- seconds := t.Unix()
- nanos := int32(t.Sub(time.Unix(seconds, 0)))
- ts := &tspb.Timestamp{
- Seconds: seconds,
- Nanos: nanos,
- }
- if err := validateTimestamp(ts); err != nil {
- return nil, err
- }
- return ts, nil
-}
-
-// TimestampString returns the RFC 3339 string for valid Timestamps. For invalid
-// Timestamps, it returns an error message in parentheses.
-func TimestampString(ts *tspb.Timestamp) string {
- t, err := Timestamp(ts)
- if err != nil {
- return fmt.Sprintf("(%v)", err)
- }
- return t.Format(time.RFC3339Nano)
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
deleted file mode 100644
index e9c22228..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
+++ /dev/null
@@ -1,175 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/timestamp.proto
-
-package timestamp // import "github.com/golang/protobuf/ptypes/timestamp"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// A Timestamp represents a point in time independent of any time zone
-// or calendar, represented as seconds and fractions of seconds at
-// nanosecond resolution in UTC Epoch time. It is encoded using the
-// Proleptic Gregorian Calendar which extends the Gregorian calendar
-// backwards to year one. It is encoded assuming all minutes are 60
-// seconds long, i.e. leap seconds are "smeared" so that no leap second
-// table is needed for interpretation. Range is from
-// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
-// By restricting to that range, we ensure that we can convert to
-// and from RFC 3339 date strings.
-// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
-//
-// # Examples
-//
-// Example 1: Compute Timestamp from POSIX `time()`.
-//
-// Timestamp timestamp;
-// timestamp.set_seconds(time(NULL));
-// timestamp.set_nanos(0);
-//
-// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
-//
-// struct timeval tv;
-// gettimeofday(&tv, NULL);
-//
-// Timestamp timestamp;
-// timestamp.set_seconds(tv.tv_sec);
-// timestamp.set_nanos(tv.tv_usec * 1000);
-//
-// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
-//
-// FILETIME ft;
-// GetSystemTimeAsFileTime(&ft);
-// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
-//
-// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
-// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
-// Timestamp timestamp;
-// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
-// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
-//
-// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
-//
-// long millis = System.currentTimeMillis();
-//
-// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
-// .setNanos((int) ((millis % 1000) * 1000000)).build();
-//
-//
-// Example 5: Compute Timestamp from current time in Python.
-//
-// timestamp = Timestamp()
-// timestamp.GetCurrentTime()
-//
-// # JSON Mapping
-//
-// In JSON format, the Timestamp type is encoded as a string in the
-// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
-// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
-// where {year} is always expressed using four digits while {month}, {day},
-// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
-// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
-// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
-// is required, though only UTC (as indicated by "Z") is presently supported.
-//
-// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
-// 01:30 UTC on January 15, 2017.
-//
-// In JavaScript, one can convert a Date object to this format using the
-// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
-// method. In Python, a standard `datetime.datetime` object can be converted
-// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
-// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
-// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
-// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
-// to obtain a formatter capable of generating timestamps in this format.
-//
-//
-type Timestamp struct {
- // Represents seconds of UTC time since Unix epoch
- // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
- // 9999-12-31T23:59:59Z inclusive.
- Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
- // Non-negative fractions of a second at nanosecond resolution. Negative
- // second values with fractions must still have non-negative nanos values
- // that count forward in time. Must be from 0 to 999,999,999
- // inclusive.
- Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Timestamp) Reset() { *m = Timestamp{} }
-func (m *Timestamp) String() string { return proto.CompactTextString(m) }
-func (*Timestamp) ProtoMessage() {}
-func (*Timestamp) Descriptor() ([]byte, []int) {
- return fileDescriptor_timestamp_b826e8e5fba671a8, []int{0}
-}
-func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
-func (m *Timestamp) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Timestamp.Unmarshal(m, b)
-}
-func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
-}
-func (dst *Timestamp) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Timestamp.Merge(dst, src)
-}
-func (m *Timestamp) XXX_Size() int {
- return xxx_messageInfo_Timestamp.Size(m)
-}
-func (m *Timestamp) XXX_DiscardUnknown() {
- xxx_messageInfo_Timestamp.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Timestamp proto.InternalMessageInfo
-
-func (m *Timestamp) GetSeconds() int64 {
- if m != nil {
- return m.Seconds
- }
- return 0
-}
-
-func (m *Timestamp) GetNanos() int32 {
- if m != nil {
- return m.Nanos
- }
- return 0
-}
-
-func init() {
- proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
-}
-
-func init() {
- proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_timestamp_b826e8e5fba671a8)
-}
-
-var fileDescriptor_timestamp_b826e8e5fba671a8 = []byte{
- // 191 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f,
- 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d,
- 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x03, 0x0b, 0x09, 0xf1, 0x43, 0x14, 0xe8, 0xc1, 0x14, 0x28,
- 0x59, 0x73, 0x71, 0x86, 0xc0, 0xd4, 0x08, 0x49, 0x70, 0xb1, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5,
- 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x79, 0x89,
- 0x79, 0xf9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x53, 0x1d, 0x97, 0x70,
- 0x72, 0x7e, 0xae, 0x1e, 0x9a, 0x99, 0x4e, 0x7c, 0x70, 0x13, 0x03, 0x40, 0x42, 0x01, 0x8c, 0x51,
- 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0x39, 0x89,
- 0x79, 0xe9, 0x08, 0x27, 0x16, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x23, 0x5c, 0xfa, 0x83, 0x91, 0x71,
- 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, 0xc9, 0x01, 0x50, 0xb5, 0x7a,
- 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x20, 0x3d, 0x49, 0x6c, 0x60, 0x43,
- 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x77, 0x4a, 0x07, 0xf7, 0x00, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
deleted file mode 100644
index 06750ab1..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
+++ /dev/null
@@ -1,133 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/timestamp";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "TimestampProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-
-// A Timestamp represents a point in time independent of any time zone
-// or calendar, represented as seconds and fractions of seconds at
-// nanosecond resolution in UTC Epoch time. It is encoded using the
-// Proleptic Gregorian Calendar which extends the Gregorian calendar
-// backwards to year one. It is encoded assuming all minutes are 60
-// seconds long, i.e. leap seconds are "smeared" so that no leap second
-// table is needed for interpretation. Range is from
-// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
-// By restricting to that range, we ensure that we can convert to
-// and from RFC 3339 date strings.
-// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
-//
-// # Examples
-//
-// Example 1: Compute Timestamp from POSIX `time()`.
-//
-// Timestamp timestamp;
-// timestamp.set_seconds(time(NULL));
-// timestamp.set_nanos(0);
-//
-// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
-//
-// struct timeval tv;
-// gettimeofday(&tv, NULL);
-//
-// Timestamp timestamp;
-// timestamp.set_seconds(tv.tv_sec);
-// timestamp.set_nanos(tv.tv_usec * 1000);
-//
-// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
-//
-// FILETIME ft;
-// GetSystemTimeAsFileTime(&ft);
-// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
-//
-// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
-// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
-// Timestamp timestamp;
-// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
-// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
-//
-// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
-//
-// long millis = System.currentTimeMillis();
-//
-// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
-// .setNanos((int) ((millis % 1000) * 1000000)).build();
-//
-//
-// Example 5: Compute Timestamp from current time in Python.
-//
-// timestamp = Timestamp()
-// timestamp.GetCurrentTime()
-//
-// # JSON Mapping
-//
-// In JSON format, the Timestamp type is encoded as a string in the
-// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
-// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
-// where {year} is always expressed using four digits while {month}, {day},
-// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
-// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
-// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
-// is required, though only UTC (as indicated by "Z") is presently supported.
-//
-// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
-// 01:30 UTC on January 15, 2017.
-//
-// In JavaScript, one can convert a Date object to this format using the
-// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
-// method. In Python, a standard `datetime.datetime` object can be converted
-// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
-// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
-// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
-// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
-// to obtain a formatter capable of generating timestamps in this format.
-//
-//
-message Timestamp {
-
- // Represents seconds of UTC time since Unix epoch
- // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
- // 9999-12-31T23:59:59Z inclusive.
- int64 seconds = 1;
-
- // Non-negative fractions of a second at nanosecond resolution. Negative
- // second values with fractions must still have non-negative nanos values
- // that count forward in time. Must be from 0 to 999,999,999
- // inclusive.
- int32 nanos = 2;
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp_test.go b/vendor/github.com/golang/protobuf/ptypes/timestamp_test.go
deleted file mode 100644
index 6e3c969b..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp_test.go
+++ /dev/null
@@ -1,153 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 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.
-
-package ptypes
-
-import (
- "math"
- "testing"
- "time"
-
- "github.com/golang/protobuf/proto"
- tspb "github.com/golang/protobuf/ptypes/timestamp"
-)
-
-var tests = []struct {
- ts *tspb.Timestamp
- valid bool
- t time.Time
-}{
- // The timestamp representing the Unix epoch date.
- {&tspb.Timestamp{Seconds: 0, Nanos: 0}, true, utcDate(1970, 1, 1)},
- // The smallest representable timestamp.
- {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: math.MinInt32}, false,
- time.Unix(math.MinInt64, math.MinInt32).UTC()},
- // The smallest representable timestamp with non-negative nanos.
- {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: 0}, false, time.Unix(math.MinInt64, 0).UTC()},
- // The earliest valid timestamp.
- {&tspb.Timestamp{Seconds: minValidSeconds, Nanos: 0}, true, utcDate(1, 1, 1)},
- //"0001-01-01T00:00:00Z"},
- // The largest representable timestamp.
- {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: math.MaxInt32}, false,
- time.Unix(math.MaxInt64, math.MaxInt32).UTC()},
- // The largest representable timestamp with nanos in range.
- {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: 1e9 - 1}, false,
- time.Unix(math.MaxInt64, 1e9-1).UTC()},
- // The largest valid timestamp.
- {&tspb.Timestamp{Seconds: maxValidSeconds - 1, Nanos: 1e9 - 1}, true,
- time.Date(9999, 12, 31, 23, 59, 59, 1e9-1, time.UTC)},
- // The smallest invalid timestamp that is larger than the valid range.
- {&tspb.Timestamp{Seconds: maxValidSeconds, Nanos: 0}, false, time.Unix(maxValidSeconds, 0).UTC()},
- // A date before the epoch.
- {&tspb.Timestamp{Seconds: -281836800, Nanos: 0}, true, utcDate(1961, 1, 26)},
- // A date after the epoch.
- {&tspb.Timestamp{Seconds: 1296000000, Nanos: 0}, true, utcDate(2011, 1, 26)},
- // A date after the epoch, in the middle of the day.
- {&tspb.Timestamp{Seconds: 1296012345, Nanos: 940483}, true,
- time.Date(2011, 1, 26, 3, 25, 45, 940483, time.UTC)},
-}
-
-func TestValidateTimestamp(t *testing.T) {
- for _, s := range tests {
- got := validateTimestamp(s.ts)
- if (got == nil) != s.valid {
- t.Errorf("validateTimestamp(%v) = %v, want %v", s.ts, got, s.valid)
- }
- }
-}
-
-func TestTimestamp(t *testing.T) {
- for _, s := range tests {
- got, err := Timestamp(s.ts)
- if (err == nil) != s.valid {
- t.Errorf("Timestamp(%v) error = %v, but valid = %t", s.ts, err, s.valid)
- } else if s.valid && got != s.t {
- t.Errorf("Timestamp(%v) = %v, want %v", s.ts, got, s.t)
- }
- }
- // Special case: a nil Timestamp is an error, but returns the 0 Unix time.
- got, err := Timestamp(nil)
- want := time.Unix(0, 0).UTC()
- if got != want {
- t.Errorf("Timestamp(nil) = %v, want %v", got, want)
- }
- if err == nil {
- t.Errorf("Timestamp(nil) error = nil, expected error")
- }
-}
-
-func TestTimestampProto(t *testing.T) {
- for _, s := range tests {
- got, err := TimestampProto(s.t)
- if (err == nil) != s.valid {
- t.Errorf("TimestampProto(%v) error = %v, but valid = %t", s.t, err, s.valid)
- } else if s.valid && !proto.Equal(got, s.ts) {
- t.Errorf("TimestampProto(%v) = %v, want %v", s.t, got, s.ts)
- }
- }
- // No corresponding special case here: no time.Time results in a nil Timestamp.
-}
-
-func TestTimestampString(t *testing.T) {
- for _, test := range []struct {
- ts *tspb.Timestamp
- want string
- }{
- // Not much testing needed because presumably time.Format is
- // well-tested.
- {&tspb.Timestamp{Seconds: 0, Nanos: 0}, "1970-01-01T00:00:00Z"},
- {&tspb.Timestamp{Seconds: minValidSeconds - 1, Nanos: 0}, "(timestamp: seconds:-62135596801 before 0001-01-01)"},
- } {
- got := TimestampString(test.ts)
- if got != test.want {
- t.Errorf("TimestampString(%v) = %q, want %q", test.ts, got, test.want)
- }
- }
-}
-
-func utcDate(year, month, day int) time.Time {
- return time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.UTC)
-}
-
-func TestTimestampNow(t *testing.T) {
- // Bracket the expected time.
- before := time.Now()
- ts := TimestampNow()
- after := time.Now()
-
- tm, err := Timestamp(ts)
- if err != nil {
- t.Errorf("between %v and %v\nTimestampNow() = %v\nwhich is invalid (%v)", before, after, ts, err)
- }
- if tm.Before(before) || tm.After(after) {
- t.Errorf("between %v and %v\nTimestamp(TimestampNow()) = %v", before, after, tm)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go b/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
deleted file mode 100644
index d1fc4d0b..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
+++ /dev/null
@@ -1,443 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/wrappers.proto
-
-package wrappers // import "github.com/golang/protobuf/ptypes/wrappers"
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
-
-// Wrapper message for `double`.
-//
-// The JSON representation for `DoubleValue` is JSON number.
-type DoubleValue struct {
- // The double value.
- Value float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DoubleValue) Reset() { *m = DoubleValue{} }
-func (m *DoubleValue) String() string { return proto.CompactTextString(m) }
-func (*DoubleValue) ProtoMessage() {}
-func (*DoubleValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{0}
-}
-func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" }
-func (m *DoubleValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DoubleValue.Unmarshal(m, b)
-}
-func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
-}
-func (dst *DoubleValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DoubleValue.Merge(dst, src)
-}
-func (m *DoubleValue) XXX_Size() int {
- return xxx_messageInfo_DoubleValue.Size(m)
-}
-func (m *DoubleValue) XXX_DiscardUnknown() {
- xxx_messageInfo_DoubleValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DoubleValue proto.InternalMessageInfo
-
-func (m *DoubleValue) GetValue() float64 {
- if m != nil {
- return m.Value
- }
- return 0
-}
-
-// Wrapper message for `float`.
-//
-// The JSON representation for `FloatValue` is JSON number.
-type FloatValue struct {
- // The float value.
- Value float32 `protobuf:"fixed32,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FloatValue) Reset() { *m = FloatValue{} }
-func (m *FloatValue) String() string { return proto.CompactTextString(m) }
-func (*FloatValue) ProtoMessage() {}
-func (*FloatValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{1}
-}
-func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" }
-func (m *FloatValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FloatValue.Unmarshal(m, b)
-}
-func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
-}
-func (dst *FloatValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FloatValue.Merge(dst, src)
-}
-func (m *FloatValue) XXX_Size() int {
- return xxx_messageInfo_FloatValue.Size(m)
-}
-func (m *FloatValue) XXX_DiscardUnknown() {
- xxx_messageInfo_FloatValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FloatValue proto.InternalMessageInfo
-
-func (m *FloatValue) GetValue() float32 {
- if m != nil {
- return m.Value
- }
- return 0
-}
-
-// Wrapper message for `int64`.
-//
-// The JSON representation for `Int64Value` is JSON string.
-type Int64Value struct {
- // The int64 value.
- Value int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Int64Value) Reset() { *m = Int64Value{} }
-func (m *Int64Value) String() string { return proto.CompactTextString(m) }
-func (*Int64Value) ProtoMessage() {}
-func (*Int64Value) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{2}
-}
-func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" }
-func (m *Int64Value) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Int64Value.Unmarshal(m, b)
-}
-func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
-}
-func (dst *Int64Value) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Int64Value.Merge(dst, src)
-}
-func (m *Int64Value) XXX_Size() int {
- return xxx_messageInfo_Int64Value.Size(m)
-}
-func (m *Int64Value) XXX_DiscardUnknown() {
- xxx_messageInfo_Int64Value.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Int64Value proto.InternalMessageInfo
-
-func (m *Int64Value) GetValue() int64 {
- if m != nil {
- return m.Value
- }
- return 0
-}
-
-// Wrapper message for `uint64`.
-//
-// The JSON representation for `UInt64Value` is JSON string.
-type UInt64Value struct {
- // The uint64 value.
- Value uint64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UInt64Value) Reset() { *m = UInt64Value{} }
-func (m *UInt64Value) String() string { return proto.CompactTextString(m) }
-func (*UInt64Value) ProtoMessage() {}
-func (*UInt64Value) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{3}
-}
-func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" }
-func (m *UInt64Value) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UInt64Value.Unmarshal(m, b)
-}
-func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
-}
-func (dst *UInt64Value) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UInt64Value.Merge(dst, src)
-}
-func (m *UInt64Value) XXX_Size() int {
- return xxx_messageInfo_UInt64Value.Size(m)
-}
-func (m *UInt64Value) XXX_DiscardUnknown() {
- xxx_messageInfo_UInt64Value.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UInt64Value proto.InternalMessageInfo
-
-func (m *UInt64Value) GetValue() uint64 {
- if m != nil {
- return m.Value
- }
- return 0
-}
-
-// Wrapper message for `int32`.
-//
-// The JSON representation for `Int32Value` is JSON number.
-type Int32Value struct {
- // The int32 value.
- Value int32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Int32Value) Reset() { *m = Int32Value{} }
-func (m *Int32Value) String() string { return proto.CompactTextString(m) }
-func (*Int32Value) ProtoMessage() {}
-func (*Int32Value) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{4}
-}
-func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" }
-func (m *Int32Value) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Int32Value.Unmarshal(m, b)
-}
-func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
-}
-func (dst *Int32Value) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Int32Value.Merge(dst, src)
-}
-func (m *Int32Value) XXX_Size() int {
- return xxx_messageInfo_Int32Value.Size(m)
-}
-func (m *Int32Value) XXX_DiscardUnknown() {
- xxx_messageInfo_Int32Value.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Int32Value proto.InternalMessageInfo
-
-func (m *Int32Value) GetValue() int32 {
- if m != nil {
- return m.Value
- }
- return 0
-}
-
-// Wrapper message for `uint32`.
-//
-// The JSON representation for `UInt32Value` is JSON number.
-type UInt32Value struct {
- // The uint32 value.
- Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UInt32Value) Reset() { *m = UInt32Value{} }
-func (m *UInt32Value) String() string { return proto.CompactTextString(m) }
-func (*UInt32Value) ProtoMessage() {}
-func (*UInt32Value) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{5}
-}
-func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" }
-func (m *UInt32Value) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UInt32Value.Unmarshal(m, b)
-}
-func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
-}
-func (dst *UInt32Value) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UInt32Value.Merge(dst, src)
-}
-func (m *UInt32Value) XXX_Size() int {
- return xxx_messageInfo_UInt32Value.Size(m)
-}
-func (m *UInt32Value) XXX_DiscardUnknown() {
- xxx_messageInfo_UInt32Value.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UInt32Value proto.InternalMessageInfo
-
-func (m *UInt32Value) GetValue() uint32 {
- if m != nil {
- return m.Value
- }
- return 0
-}
-
-// Wrapper message for `bool`.
-//
-// The JSON representation for `BoolValue` is JSON `true` and `false`.
-type BoolValue struct {
- // The bool value.
- Value bool `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BoolValue) Reset() { *m = BoolValue{} }
-func (m *BoolValue) String() string { return proto.CompactTextString(m) }
-func (*BoolValue) ProtoMessage() {}
-func (*BoolValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{6}
-}
-func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" }
-func (m *BoolValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_BoolValue.Unmarshal(m, b)
-}
-func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
-}
-func (dst *BoolValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BoolValue.Merge(dst, src)
-}
-func (m *BoolValue) XXX_Size() int {
- return xxx_messageInfo_BoolValue.Size(m)
-}
-func (m *BoolValue) XXX_DiscardUnknown() {
- xxx_messageInfo_BoolValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BoolValue proto.InternalMessageInfo
-
-func (m *BoolValue) GetValue() bool {
- if m != nil {
- return m.Value
- }
- return false
-}
-
-// Wrapper message for `string`.
-//
-// The JSON representation for `StringValue` is JSON string.
-type StringValue struct {
- // The string value.
- Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StringValue) Reset() { *m = StringValue{} }
-func (m *StringValue) String() string { return proto.CompactTextString(m) }
-func (*StringValue) ProtoMessage() {}
-func (*StringValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{7}
-}
-func (*StringValue) XXX_WellKnownType() string { return "StringValue" }
-func (m *StringValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_StringValue.Unmarshal(m, b)
-}
-func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
-}
-func (dst *StringValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StringValue.Merge(dst, src)
-}
-func (m *StringValue) XXX_Size() int {
- return xxx_messageInfo_StringValue.Size(m)
-}
-func (m *StringValue) XXX_DiscardUnknown() {
- xxx_messageInfo_StringValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StringValue proto.InternalMessageInfo
-
-func (m *StringValue) GetValue() string {
- if m != nil {
- return m.Value
- }
- return ""
-}
-
-// Wrapper message for `bytes`.
-//
-// The JSON representation for `BytesValue` is JSON string.
-type BytesValue struct {
- // The bytes value.
- Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BytesValue) Reset() { *m = BytesValue{} }
-func (m *BytesValue) String() string { return proto.CompactTextString(m) }
-func (*BytesValue) ProtoMessage() {}
-func (*BytesValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_wrappers_16c7c35c009f3253, []int{8}
-}
-func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" }
-func (m *BytesValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_BytesValue.Unmarshal(m, b)
-}
-func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
-}
-func (dst *BytesValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BytesValue.Merge(dst, src)
-}
-func (m *BytesValue) XXX_Size() int {
- return xxx_messageInfo_BytesValue.Size(m)
-}
-func (m *BytesValue) XXX_DiscardUnknown() {
- xxx_messageInfo_BytesValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BytesValue proto.InternalMessageInfo
-
-func (m *BytesValue) GetValue() []byte {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*DoubleValue)(nil), "google.protobuf.DoubleValue")
- proto.RegisterType((*FloatValue)(nil), "google.protobuf.FloatValue")
- proto.RegisterType((*Int64Value)(nil), "google.protobuf.Int64Value")
- proto.RegisterType((*UInt64Value)(nil), "google.protobuf.UInt64Value")
- proto.RegisterType((*Int32Value)(nil), "google.protobuf.Int32Value")
- proto.RegisterType((*UInt32Value)(nil), "google.protobuf.UInt32Value")
- proto.RegisterType((*BoolValue)(nil), "google.protobuf.BoolValue")
- proto.RegisterType((*StringValue)(nil), "google.protobuf.StringValue")
- proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue")
-}
-
-func init() {
- proto.RegisterFile("google/protobuf/wrappers.proto", fileDescriptor_wrappers_16c7c35c009f3253)
-}
-
-var fileDescriptor_wrappers_16c7c35c009f3253 = []byte{
- // 259 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
- 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x2f, 0x4a, 0x2c,
- 0x28, 0x48, 0x2d, 0x2a, 0xd6, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0xca,
- 0x5c, 0xdc, 0x2e, 0xf9, 0xa5, 0x49, 0x39, 0xa9, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x42, 0x22, 0x5c,
- 0xac, 0x65, 0x20, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x63, 0x10, 0x84, 0xa3, 0xa4, 0xc4, 0xc5,
- 0xe5, 0x96, 0x93, 0x9f, 0x58, 0x82, 0x45, 0x0d, 0x13, 0x92, 0x1a, 0xcf, 0xbc, 0x12, 0x33, 0x13,
- 0x2c, 0x6a, 0x98, 0x61, 0x6a, 0x94, 0xb9, 0xb8, 0x43, 0x71, 0x29, 0x62, 0x41, 0x35, 0xc8, 0xd8,
- 0x08, 0x8b, 0x1a, 0x56, 0x34, 0x83, 0xb0, 0x2a, 0xe2, 0x85, 0x29, 0x52, 0xe4, 0xe2, 0x74, 0xca,
- 0xcf, 0xcf, 0xc1, 0xa2, 0x84, 0x03, 0xc9, 0x9c, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0x74, 0x2c, 0x8a,
- 0x38, 0x91, 0x1c, 0xe4, 0x54, 0x59, 0x92, 0x5a, 0x8c, 0x45, 0x0d, 0x0f, 0x54, 0x8d, 0x53, 0x0d,
- 0x97, 0x70, 0x72, 0x7e, 0xae, 0x1e, 0x5a, 0xe8, 0x3a, 0xf1, 0x86, 0x43, 0x83, 0x3f, 0x00, 0x24,
- 0x12, 0xc0, 0x18, 0xa5, 0x95, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f,
- 0x9e, 0x9f, 0x93, 0x98, 0x97, 0x8e, 0x88, 0xaa, 0x82, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x78, 0x8c,
- 0xfd, 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x6e,
- 0x00, 0x54, 0xa9, 0x5e, 0x78, 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x4b,
- 0x12, 0x1b, 0xd8, 0x0c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x19, 0x6c, 0xb9, 0xb8, 0xfe,
- 0x01, 0x00, 0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto b/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto
deleted file mode 100644
index 01947639..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto
+++ /dev/null
@@ -1,118 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// 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.
-
-// Wrappers for primitive (non-message) types. These types are useful
-// for embedding primitives in the `google.protobuf.Any` type and for places
-// where we need to distinguish between the absence of a primitive
-// typed field and its default value.
-
-syntax = "proto3";
-
-package google.protobuf;
-
-option csharp_namespace = "Google.Protobuf.WellKnownTypes";
-option cc_enable_arenas = true;
-option go_package = "github.com/golang/protobuf/ptypes/wrappers";
-option java_package = "com.google.protobuf";
-option java_outer_classname = "WrappersProto";
-option java_multiple_files = true;
-option objc_class_prefix = "GPB";
-
-// Wrapper message for `double`.
-//
-// The JSON representation for `DoubleValue` is JSON number.
-message DoubleValue {
- // The double value.
- double value = 1;
-}
-
-// Wrapper message for `float`.
-//
-// The JSON representation for `FloatValue` is JSON number.
-message FloatValue {
- // The float value.
- float value = 1;
-}
-
-// Wrapper message for `int64`.
-//
-// The JSON representation for `Int64Value` is JSON string.
-message Int64Value {
- // The int64 value.
- int64 value = 1;
-}
-
-// Wrapper message for `uint64`.
-//
-// The JSON representation for `UInt64Value` is JSON string.
-message UInt64Value {
- // The uint64 value.
- uint64 value = 1;
-}
-
-// Wrapper message for `int32`.
-//
-// The JSON representation for `Int32Value` is JSON number.
-message Int32Value {
- // The int32 value.
- int32 value = 1;
-}
-
-// Wrapper message for `uint32`.
-//
-// The JSON representation for `UInt32Value` is JSON number.
-message UInt32Value {
- // The uint32 value.
- uint32 value = 1;
-}
-
-// Wrapper message for `bool`.
-//
-// The JSON representation for `BoolValue` is JSON `true` and `false`.
-message BoolValue {
- // The bool value.
- bool value = 1;
-}
-
-// Wrapper message for `string`.
-//
-// The JSON representation for `StringValue` is JSON string.
-message StringValue {
- // The string value.
- string value = 1;
-}
-
-// Wrapper message for `bytes`.
-//
-// The JSON representation for `BytesValue` is JSON string.
-message BytesValue {
- // The bytes value.
- bytes value = 1;
-}
diff --git a/vendor/github.com/golang/protobuf/regenerate.sh b/vendor/github.com/golang/protobuf/regenerate.sh
deleted file mode 100755
index dc7e2d1f..00000000
--- a/vendor/github.com/golang/protobuf/regenerate.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# Install the working tree's protoc-gen-gen in a tempdir.
-tmpdir=$(mktemp -d -t regen-wkt.XXXXXX)
-trap 'rm -rf $tmpdir' EXIT
-mkdir -p $tmpdir/bin
-PATH=$tmpdir/bin:$PATH
-GOBIN=$tmpdir/bin go install ./protoc-gen-go
-
-# Public imports require at least Go 1.9.
-supportTypeAliases=""
-if go list -f '{{context.ReleaseTags}}' runtime | grep -q go1.9; then
- supportTypeAliases=1
-fi
-
-# Generate various test protos.
-PROTO_DIRS=(
- conformance/internal/conformance_proto
- jsonpb/jsonpb_test_proto
- proto
- protoc-gen-go/testdata
-)
-for dir in ${PROTO_DIRS[@]}; do
- for p in `find $dir -name "*.proto"`; do
- if [[ $p == */import_public/* && ! $supportTypeAliases ]]; then
- echo "# $p (skipped)"
- continue;
- fi
- echo "# $p"
- protoc -I$dir --go_out=plugins=grpc,paths=source_relative:$dir $p
- done
-done
-
-# Deriving the location of the source protos from the path to the
-# protoc binary may be a bit odd, but this is what protoc itself does.
-PROTO_INCLUDE=$(dirname $(dirname $(which protoc)))/include
-
-# Well-known types.
-WKT_PROTOS=(any duration empty struct timestamp wrappers)
-for p in ${WKT_PROTOS[@]}; do
- echo "# google/protobuf/$p.proto"
- protoc --go_out=paths=source_relative:$tmpdir google/protobuf/$p.proto
- cp $tmpdir/google/protobuf/$p.pb.go ptypes/$p
- cp $PROTO_INCLUDE/google/protobuf/$p.proto ptypes/$p
-done
-
-# descriptor.proto.
-echo "# google/protobuf/descriptor.proto"
-protoc --go_out=paths=source_relative:$tmpdir google/protobuf/descriptor.proto
-cp $tmpdir/google/protobuf/descriptor.pb.go protoc-gen-go/descriptor
-cp $PROTO_INCLUDE/google/protobuf/descriptor.proto protoc-gen-go/descriptor
diff --git a/vendor/github.com/gorilla/context/context_test.go b/vendor/github.com/gorilla/context/context_test.go
deleted file mode 100644
index d70e91a2..00000000
--- a/vendor/github.com/gorilla/context/context_test.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package context
-
-import (
- "net/http"
- "testing"
-)
-
-type keyType int
-
-const (
- key1 keyType = iota
- key2
-)
-
-func TestContext(t *testing.T) {
- assertEqual := func(val interface{}, exp interface{}) {
- if val != exp {
- t.Errorf("Expected %v, got %v.", exp, val)
- }
- }
-
- r, _ := http.NewRequest("GET", "http://localhost:8080/", nil)
- emptyR, _ := http.NewRequest("GET", "http://localhost:8080/", nil)
-
- // Get()
- assertEqual(Get(r, key1), nil)
-
- // Set()
- Set(r, key1, "1")
- assertEqual(Get(r, key1), "1")
- assertEqual(len(data[r]), 1)
-
- Set(r, key2, "2")
- assertEqual(Get(r, key2), "2")
- assertEqual(len(data[r]), 2)
-
- //GetOk
- value, ok := GetOk(r, key1)
- assertEqual(value, "1")
- assertEqual(ok, true)
-
- value, ok = GetOk(r, "not exists")
- assertEqual(value, nil)
- assertEqual(ok, false)
-
- Set(r, "nil value", nil)
- value, ok = GetOk(r, "nil value")
- assertEqual(value, nil)
- assertEqual(ok, true)
-
- // GetAll()
- values := GetAll(r)
- assertEqual(len(values), 3)
-
- // GetAll() for empty request
- values = GetAll(emptyR)
- if values != nil {
- t.Error("GetAll didn't return nil value for invalid request")
- }
-
- // GetAllOk()
- values, ok = GetAllOk(r)
- assertEqual(len(values), 3)
- assertEqual(ok, true)
-
- // GetAllOk() for empty request
- values, ok = GetAllOk(emptyR)
- assertEqual(len(values), 0)
- assertEqual(ok, false)
-
- // Delete()
- Delete(r, key1)
- assertEqual(Get(r, key1), nil)
- assertEqual(len(data[r]), 2)
-
- Delete(r, key2)
- assertEqual(Get(r, key2), nil)
- assertEqual(len(data[r]), 1)
-
- // Clear()
- Clear(r)
- assertEqual(len(data), 0)
-}
-
-func parallelReader(r *http.Request, key string, iterations int, wait, done chan struct{}) {
- <-wait
- for i := 0; i < iterations; i++ {
- Get(r, key)
- }
- done <- struct{}{}
-
-}
-
-func parallelWriter(r *http.Request, key, value string, iterations int, wait, done chan struct{}) {
- <-wait
- for i := 0; i < iterations; i++ {
- Set(r, key, value)
- }
- done <- struct{}{}
-
-}
-
-func benchmarkMutex(b *testing.B, numReaders, numWriters, iterations int) {
-
- b.StopTimer()
- r, _ := http.NewRequest("GET", "http://localhost:8080/", nil)
- done := make(chan struct{})
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- wait := make(chan struct{})
-
- for i := 0; i < numReaders; i++ {
- go parallelReader(r, "test", iterations, wait, done)
- }
-
- for i := 0; i < numWriters; i++ {
- go parallelWriter(r, "test", "123", iterations, wait, done)
- }
-
- close(wait)
-
- for i := 0; i < numReaders+numWriters; i++ {
- <-done
- }
-
- }
-
-}
-
-func BenchmarkMutexSameReadWrite1(b *testing.B) {
- benchmarkMutex(b, 1, 1, 32)
-}
-func BenchmarkMutexSameReadWrite2(b *testing.B) {
- benchmarkMutex(b, 2, 2, 32)
-}
-func BenchmarkMutexSameReadWrite4(b *testing.B) {
- benchmarkMutex(b, 4, 4, 32)
-}
-func BenchmarkMutex1(b *testing.B) {
- benchmarkMutex(b, 2, 8, 32)
-}
-func BenchmarkMutex2(b *testing.B) {
- benchmarkMutex(b, 16, 4, 64)
-}
-func BenchmarkMutex3(b *testing.B) {
- benchmarkMutex(b, 1, 2, 128)
-}
-func BenchmarkMutex4(b *testing.B) {
- benchmarkMutex(b, 128, 32, 256)
-}
-func BenchmarkMutex5(b *testing.B) {
- benchmarkMutex(b, 1024, 2048, 64)
-}
-func BenchmarkMutex6(b *testing.B) {
- benchmarkMutex(b, 2048, 1024, 512)
-}
diff --git a/vendor/github.com/gorilla/mux/bench_test.go b/vendor/github.com/gorilla/mux/bench_test.go
deleted file mode 100644
index 522156dc..00000000
--- a/vendor/github.com/gorilla/mux/bench_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import (
- "net/http"
- "net/http/httptest"
- "testing"
-)
-
-func BenchmarkMux(b *testing.B) {
- router := new(Router)
- handler := func(w http.ResponseWriter, r *http.Request) {}
- router.HandleFunc("/v1/{v1}", handler)
-
- request, _ := http.NewRequest("GET", "/v1/anything", nil)
- for i := 0; i < b.N; i++ {
- router.ServeHTTP(nil, request)
- }
-}
-
-func BenchmarkMuxAlternativeInRegexp(b *testing.B) {
- router := new(Router)
- handler := func(w http.ResponseWriter, r *http.Request) {}
- router.HandleFunc("/v1/{v1:(?:a|b)}", handler)
-
- requestA, _ := http.NewRequest("GET", "/v1/a", nil)
- requestB, _ := http.NewRequest("GET", "/v1/b", nil)
- for i := 0; i < b.N; i++ {
- router.ServeHTTP(nil, requestA)
- router.ServeHTTP(nil, requestB)
- }
-}
-
-func BenchmarkManyPathVariables(b *testing.B) {
- router := new(Router)
- handler := func(w http.ResponseWriter, r *http.Request) {}
- router.HandleFunc("/v1/{v1}/{v2}/{v3}/{v4}/{v5}", handler)
-
- matchingRequest, _ := http.NewRequest("GET", "/v1/1/2/3/4/5", nil)
- notMatchingRequest, _ := http.NewRequest("GET", "/v1/1/2/3/4", nil)
- recorder := httptest.NewRecorder()
- for i := 0; i < b.N; i++ {
- router.ServeHTTP(nil, matchingRequest)
- router.ServeHTTP(recorder, notMatchingRequest)
- }
-}
diff --git a/vendor/github.com/gorilla/mux/context_gorilla_test.go b/vendor/github.com/gorilla/mux/context_gorilla_test.go
deleted file mode 100644
index ffaf384c..00000000
--- a/vendor/github.com/gorilla/mux/context_gorilla_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// +build !go1.7
-
-package mux
-
-import (
- "net/http"
- "testing"
-
- "github.com/gorilla/context"
-)
-
-// Tests that the context is cleared or not cleared properly depending on
-// the configuration of the router
-func TestKeepContext(t *testing.T) {
- func1 := func(w http.ResponseWriter, r *http.Request) {}
-
- r := NewRouter()
- r.HandleFunc("/", func1).Name("func1")
-
- req, _ := http.NewRequest("GET", "http://localhost/", nil)
- context.Set(req, "t", 1)
-
- res := new(http.ResponseWriter)
- r.ServeHTTP(*res, req)
-
- if _, ok := context.GetOk(req, "t"); ok {
- t.Error("Context should have been cleared at end of request")
- }
-
- r.KeepContext = true
-
- req, _ = http.NewRequest("GET", "http://localhost/", nil)
- context.Set(req, "t", 1)
-
- r.ServeHTTP(*res, req)
- if _, ok := context.GetOk(req, "t"); !ok {
- t.Error("Context should NOT have been cleared at end of request")
- }
-
-}
diff --git a/vendor/github.com/gorilla/mux/context_native_test.go b/vendor/github.com/gorilla/mux/context_native_test.go
deleted file mode 100644
index c150edf0..00000000
--- a/vendor/github.com/gorilla/mux/context_native_test.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// +build go1.7
-
-package mux
-
-import (
- "context"
- "net/http"
- "testing"
- "time"
-)
-
-func TestNativeContextMiddleware(t *testing.T) {
- withTimeout := func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- ctx, cancel := context.WithTimeout(r.Context(), time.Minute)
- defer cancel()
- h.ServeHTTP(w, r.WithContext(ctx))
- })
- }
-
- r := NewRouter()
- r.Handle("/path/{foo}", withTimeout(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- vars := Vars(r)
- if vars["foo"] != "bar" {
- t.Fatal("Expected foo var to be set")
- }
- })))
-
- rec := NewRecorder()
- req := newRequest("GET", "/path/bar")
- r.ServeHTTP(rec, req)
-}
diff --git a/vendor/github.com/gorilla/mux/example_authentication_middleware_test.go b/vendor/github.com/gorilla/mux/example_authentication_middleware_test.go
deleted file mode 100644
index 67df3218..00000000
--- a/vendor/github.com/gorilla/mux/example_authentication_middleware_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package mux_test
-
-import (
- "log"
- "net/http"
-
- "github.com/gorilla/mux"
-)
-
-// Define our struct
-type authenticationMiddleware struct {
- tokenUsers map[string]string
-}
-
-// Initialize it somewhere
-func (amw *authenticationMiddleware) Populate() {
- amw.tokenUsers["00000000"] = "user0"
- amw.tokenUsers["aaaaaaaa"] = "userA"
- amw.tokenUsers["05f717e5"] = "randomUser"
- amw.tokenUsers["deadbeef"] = "user0"
-}
-
-// Middleware function, which will be called for each request
-func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- token := r.Header.Get("X-Session-Token")
-
- if user, found := amw.tokenUsers[token]; found {
- // We found the token in our map
- log.Printf("Authenticated user %s\n", user)
- next.ServeHTTP(w, r)
- } else {
- http.Error(w, "Forbidden", http.StatusForbidden)
- }
- })
-}
-
-func Example_authenticationMiddleware() {
- r := mux.NewRouter()
- r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
- // Do something here
- })
- amw := authenticationMiddleware{}
- amw.Populate()
- r.Use(amw.Middleware)
-}
diff --git a/vendor/github.com/gorilla/mux/example_route_test.go b/vendor/github.com/gorilla/mux/example_route_test.go
deleted file mode 100644
index 11255707..00000000
--- a/vendor/github.com/gorilla/mux/example_route_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package mux_test
-
-import (
- "fmt"
- "net/http"
-
- "github.com/gorilla/mux"
-)
-
-// This example demonstrates setting a regular expression matcher for
-// the header value. A plain word will match any value that contains a
-// matching substring as if the pattern was wrapped with `.*`.
-func ExampleRoute_HeadersRegexp() {
- r := mux.NewRouter()
- route := r.NewRoute().HeadersRegexp("Accept", "html")
-
- req1, _ := http.NewRequest("GET", "example.com", nil)
- req1.Header.Add("Accept", "text/plain")
- req1.Header.Add("Accept", "text/html")
-
- req2, _ := http.NewRequest("GET", "example.com", nil)
- req2.Header.Set("Accept", "application/xhtml+xml")
-
- matchInfo := &mux.RouteMatch{}
- fmt.Printf("Match: %v %q\n", route.Match(req1, matchInfo), req1.Header["Accept"])
- fmt.Printf("Match: %v %q\n", route.Match(req2, matchInfo), req2.Header["Accept"])
- // Output:
- // Match: true ["text/plain" "text/html"]
- // Match: true ["application/xhtml+xml"]
-}
-
-// This example demonstrates setting a strict regular expression matcher
-// for the header value. Using the start and end of string anchors, the
-// value must be an exact match.
-func ExampleRoute_HeadersRegexp_exactMatch() {
- r := mux.NewRouter()
- route := r.NewRoute().HeadersRegexp("Origin", "^https://example.co$")
-
- yes, _ := http.NewRequest("GET", "example.co", nil)
- yes.Header.Set("Origin", "https://example.co")
-
- no, _ := http.NewRequest("GET", "example.co.uk", nil)
- no.Header.Set("Origin", "https://example.co.uk")
-
- matchInfo := &mux.RouteMatch{}
- fmt.Printf("Match: %v %q\n", route.Match(yes, matchInfo), yes.Header["Origin"])
- fmt.Printf("Match: %v %q\n", route.Match(no, matchInfo), no.Header["Origin"])
- // Output:
- // Match: true ["https://example.co"]
- // Match: false ["https://example.co.uk"]
-}
diff --git a/vendor/github.com/gorilla/mux/middleware_test.go b/vendor/github.com/gorilla/mux/middleware_test.go
deleted file mode 100644
index acf4e160..00000000
--- a/vendor/github.com/gorilla/mux/middleware_test.go
+++ /dev/null
@@ -1,377 +0,0 @@
-package mux
-
-import (
- "bytes"
- "net/http"
- "net/http/httptest"
- "testing"
-)
-
-type testMiddleware struct {
- timesCalled uint
-}
-
-func (tm *testMiddleware) Middleware(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- tm.timesCalled++
- h.ServeHTTP(w, r)
- })
-}
-
-func dummyHandler(w http.ResponseWriter, r *http.Request) {}
-
-func TestMiddlewareAdd(t *testing.T) {
- router := NewRouter()
- router.HandleFunc("/", dummyHandler).Methods("GET")
-
- mw := &testMiddleware{}
-
- router.useInterface(mw)
- if len(router.middlewares) != 1 || router.middlewares[0] != mw {
- t.Fatal("Middleware was not added correctly")
- }
-
- router.Use(mw.Middleware)
- if len(router.middlewares) != 2 {
- t.Fatal("MiddlewareFunc method was not added correctly")
- }
-
- banalMw := func(handler http.Handler) http.Handler {
- return handler
- }
- router.Use(banalMw)
- if len(router.middlewares) != 3 {
- t.Fatal("MiddlewareFunc method was not added correctly")
- }
-}
-
-func TestMiddleware(t *testing.T) {
- router := NewRouter()
- router.HandleFunc("/", dummyHandler).Methods("GET")
-
- mw := &testMiddleware{}
- router.useInterface(mw)
-
- rw := NewRecorder()
- req := newRequest("GET", "/")
-
- // Test regular middleware call
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 1 {
- t.Fatalf("Expected %d calls, but got only %d", 1, mw.timesCalled)
- }
-
- // Middleware should not be called for 404
- req = newRequest("GET", "/not/found")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 1 {
- t.Fatalf("Expected %d calls, but got only %d", 1, mw.timesCalled)
- }
-
- // Middleware should not be called if there is a method mismatch
- req = newRequest("POST", "/")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 1 {
- t.Fatalf("Expected %d calls, but got only %d", 1, mw.timesCalled)
- }
-
- // Add the middleware again as function
- router.Use(mw.Middleware)
- req = newRequest("GET", "/")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 3 {
- t.Fatalf("Expected %d calls, but got only %d", 3, mw.timesCalled)
- }
-
-}
-
-func TestMiddlewareSubrouter(t *testing.T) {
- router := NewRouter()
- router.HandleFunc("/", dummyHandler).Methods("GET")
-
- subrouter := router.PathPrefix("/sub").Subrouter()
- subrouter.HandleFunc("/x", dummyHandler).Methods("GET")
-
- mw := &testMiddleware{}
- subrouter.useInterface(mw)
-
- rw := NewRecorder()
- req := newRequest("GET", "/")
-
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 0 {
- t.Fatalf("Expected %d calls, but got only %d", 0, mw.timesCalled)
- }
-
- req = newRequest("GET", "/sub/")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 0 {
- t.Fatalf("Expected %d calls, but got only %d", 0, mw.timesCalled)
- }
-
- req = newRequest("GET", "/sub/x")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 1 {
- t.Fatalf("Expected %d calls, but got only %d", 1, mw.timesCalled)
- }
-
- req = newRequest("GET", "/sub/not/found")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 1 {
- t.Fatalf("Expected %d calls, but got only %d", 1, mw.timesCalled)
- }
-
- router.useInterface(mw)
-
- req = newRequest("GET", "/")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 2 {
- t.Fatalf("Expected %d calls, but got only %d", 2, mw.timesCalled)
- }
-
- req = newRequest("GET", "/sub/x")
- router.ServeHTTP(rw, req)
- if mw.timesCalled != 4 {
- t.Fatalf("Expected %d calls, but got only %d", 4, mw.timesCalled)
- }
-}
-
-func TestMiddlewareExecution(t *testing.T) {
- mwStr := []byte("Middleware\n")
- handlerStr := []byte("Logic\n")
-
- router := NewRouter()
- router.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- })
-
- rw := NewRecorder()
- req := newRequest("GET", "/")
-
- // Test handler-only call
- router.ServeHTTP(rw, req)
-
- if bytes.Compare(rw.Body.Bytes(), handlerStr) != 0 {
- t.Fatal("Handler response is not what it should be")
- }
-
- // Test middleware call
- rw = NewRecorder()
-
- router.Use(func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write(mwStr)
- h.ServeHTTP(w, r)
- })
- })
-
- router.ServeHTTP(rw, req)
- if bytes.Compare(rw.Body.Bytes(), append(mwStr, handlerStr...)) != 0 {
- t.Fatal("Middleware + handler response is not what it should be")
- }
-}
-
-func TestMiddlewareNotFound(t *testing.T) {
- mwStr := []byte("Middleware\n")
- handlerStr := []byte("Logic\n")
-
- router := NewRouter()
- router.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- })
- router.Use(func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write(mwStr)
- h.ServeHTTP(w, r)
- })
- })
-
- // Test not found call with default handler
- rw := NewRecorder()
- req := newRequest("GET", "/notfound")
-
- router.ServeHTTP(rw, req)
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a 404")
- }
-
- // Test not found call with custom handler
- rw = NewRecorder()
- req = newRequest("GET", "/notfound")
-
- router.NotFoundHandler = http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- rw.Write([]byte("Custom 404 handler"))
- })
- router.ServeHTTP(rw, req)
-
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a custom 404")
- }
-}
-
-func TestMiddlewareMethodMismatch(t *testing.T) {
- mwStr := []byte("Middleware\n")
- handlerStr := []byte("Logic\n")
-
- router := NewRouter()
- router.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- }).Methods("GET")
-
- router.Use(func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write(mwStr)
- h.ServeHTTP(w, r)
- })
- })
-
- // Test method mismatch
- rw := NewRecorder()
- req := newRequest("POST", "/")
-
- router.ServeHTTP(rw, req)
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a method mismatch")
- }
-
- // Test not found call
- rw = NewRecorder()
- req = newRequest("POST", "/")
-
- router.MethodNotAllowedHandler = http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- rw.Write([]byte("Method not allowed"))
- })
- router.ServeHTTP(rw, req)
-
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a method mismatch")
- }
-}
-
-func TestMiddlewareNotFoundSubrouter(t *testing.T) {
- mwStr := []byte("Middleware\n")
- handlerStr := []byte("Logic\n")
-
- router := NewRouter()
- router.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- })
-
- subrouter := router.PathPrefix("/sub/").Subrouter()
- subrouter.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- })
-
- router.Use(func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write(mwStr)
- h.ServeHTTP(w, r)
- })
- })
-
- // Test not found call for default handler
- rw := NewRecorder()
- req := newRequest("GET", "/sub/notfound")
-
- router.ServeHTTP(rw, req)
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a 404")
- }
-
- // Test not found call with custom handler
- rw = NewRecorder()
- req = newRequest("GET", "/sub/notfound")
-
- subrouter.NotFoundHandler = http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- rw.Write([]byte("Custom 404 handler"))
- })
- router.ServeHTTP(rw, req)
-
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a custom 404")
- }
-}
-
-func TestMiddlewareMethodMismatchSubrouter(t *testing.T) {
- mwStr := []byte("Middleware\n")
- handlerStr := []byte("Logic\n")
-
- router := NewRouter()
- router.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- })
-
- subrouter := router.PathPrefix("/sub/").Subrouter()
- subrouter.HandleFunc("/", func(w http.ResponseWriter, e *http.Request) {
- w.Write(handlerStr)
- }).Methods("GET")
-
- router.Use(func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write(mwStr)
- h.ServeHTTP(w, r)
- })
- })
-
- // Test method mismatch without custom handler
- rw := NewRecorder()
- req := newRequest("POST", "/sub/")
-
- router.ServeHTTP(rw, req)
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a method mismatch")
- }
-
- // Test method mismatch with custom handler
- rw = NewRecorder()
- req = newRequest("POST", "/sub/")
-
- router.MethodNotAllowedHandler = http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- rw.Write([]byte("Method not allowed"))
- })
- router.ServeHTTP(rw, req)
-
- if bytes.Contains(rw.Body.Bytes(), mwStr) {
- t.Fatal("Middleware was called for a method mismatch")
- }
-}
-
-func TestCORSMethodMiddleware(t *testing.T) {
- router := NewRouter()
-
- cases := []struct {
- path string
- response string
- method string
- testURL string
- expectedAllowedMethods string
- }{
- {"/g/{o}", "a", "POST", "/g/asdf", "POST,PUT,GET,OPTIONS"},
- {"/g/{o}", "b", "PUT", "/g/bla", "POST,PUT,GET,OPTIONS"},
- {"/g/{o}", "c", "GET", "/g/orilla", "POST,PUT,GET,OPTIONS"},
- {"/g", "d", "POST", "/g", "POST,OPTIONS"},
- }
-
- for _, tt := range cases {
- router.HandleFunc(tt.path, stringHandler(tt.response)).Methods(tt.method)
- }
-
- router.Use(CORSMethodMiddleware(router))
-
- for _, tt := range cases {
- rr := httptest.NewRecorder()
- req := newRequest(tt.method, tt.testURL)
-
- router.ServeHTTP(rr, req)
-
- if rr.Body.String() != tt.response {
- t.Errorf("Expected body '%s', found '%s'", tt.response, rr.Body.String())
- }
-
- allowedMethods := rr.HeaderMap.Get("Access-Control-Allow-Methods")
-
- if allowedMethods != tt.expectedAllowedMethods {
- t.Errorf("Expected Access-Control-Allow-Methods '%s', found '%s'", tt.expectedAllowedMethods, allowedMethods)
- }
- }
-}
diff --git a/vendor/github.com/gorilla/mux/mux_test.go b/vendor/github.com/gorilla/mux/mux_test.go
deleted file mode 100644
index af21329f..00000000
--- a/vendor/github.com/gorilla/mux/mux_test.go
+++ /dev/null
@@ -1,2364 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import (
- "bufio"
- "bytes"
- "errors"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "strings"
- "testing"
-)
-
-func (r *Route) GoString() string {
- matchers := make([]string, len(r.matchers))
- for i, m := range r.matchers {
- matchers[i] = fmt.Sprintf("%#v", m)
- }
- return fmt.Sprintf("&Route{matchers:[]matcher{%s}}", strings.Join(matchers, ", "))
-}
-
-func (r *routeRegexp) GoString() string {
- return fmt.Sprintf("&routeRegexp{template: %q, regexpType: %v, options: %v, regexp: regexp.MustCompile(%q), reverse: %q, varsN: %v, varsR: %v", r.template, r.regexpType, r.options, r.regexp.String(), r.reverse, r.varsN, r.varsR)
-}
-
-type routeTest struct {
- title string // title of the test
- route *Route // the route being tested
- request *http.Request // a request to test the route
- vars map[string]string // the expected vars of the match
- scheme string // the expected scheme of the built URL
- host string // the expected host of the built URL
- path string // the expected path of the built URL
- query string // the expected query string of the built URL
- pathTemplate string // the expected path template of the route
- hostTemplate string // the expected host template of the route
- queriesTemplate string // the expected query template of the route
- methods []string // the expected route methods
- pathRegexp string // the expected path regexp
- queriesRegexp string // the expected query regexp
- shouldMatch bool // whether the request is expected to match the route at all
- shouldRedirect bool // whether the request should result in a redirect
-}
-
-func TestHost(t *testing.T) {
- // newRequestHost a new request with a method, url, and host header
- newRequestHost := func(method, url, host string) *http.Request {
- req, err := http.NewRequest(method, url, nil)
- if err != nil {
- panic(err)
- }
- req.Host = host
- return req
- }
-
- tests := []routeTest{
- {
- title: "Host route match",
- route: new(Route).Host("aaa.bbb.ccc"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc",
- path: "",
- shouldMatch: true,
- },
- {
- title: "Host route, wrong host in request URL",
- route: new(Route).Host("aaa.bbb.ccc"),
- request: newRequest("GET", "http://aaa.222.ccc/111/222/333"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc",
- path: "",
- shouldMatch: false,
- },
- {
- title: "Host route with port, match",
- route: new(Route).Host("aaa.bbb.ccc:1234"),
- request: newRequest("GET", "http://aaa.bbb.ccc:1234/111/222/333"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc:1234",
- path: "",
- shouldMatch: true,
- },
- {
- title: "Host route with port, wrong port in request URL",
- route: new(Route).Host("aaa.bbb.ccc:1234"),
- request: newRequest("GET", "http://aaa.bbb.ccc:9999/111/222/333"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc:1234",
- path: "",
- shouldMatch: false,
- },
- {
- title: "Host route, match with host in request header",
- route: new(Route).Host("aaa.bbb.ccc"),
- request: newRequestHost("GET", "/111/222/333", "aaa.bbb.ccc"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc",
- path: "",
- shouldMatch: true,
- },
- {
- title: "Host route, wrong host in request header",
- route: new(Route).Host("aaa.bbb.ccc"),
- request: newRequestHost("GET", "/111/222/333", "aaa.222.ccc"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc",
- path: "",
- shouldMatch: false,
- },
- // BUG {new(Route).Host("aaa.bbb.ccc:1234"), newRequestHost("GET", "/111/222/333", "aaa.bbb.ccc:1234"), map[string]string{}, "aaa.bbb.ccc:1234", "", true},
- {
- title: "Host route with port, wrong host in request header",
- route: new(Route).Host("aaa.bbb.ccc:1234"),
- request: newRequestHost("GET", "/111/222/333", "aaa.bbb.ccc:9999"),
- vars: map[string]string{},
- host: "aaa.bbb.ccc:1234",
- path: "",
- shouldMatch: false,
- },
- {
- title: "Host route with pattern, match",
- route: new(Route).Host("aaa.{v1:[a-z]{3}}.ccc"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v1": "bbb"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `aaa.{v1:[a-z]{3}}.ccc`,
- shouldMatch: true,
- },
- {
- title: "Host route with pattern, additional capturing group, match",
- route: new(Route).Host("aaa.{v1:[a-z]{2}(?:b|c)}.ccc"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v1": "bbb"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `aaa.{v1:[a-z]{2}(?:b|c)}.ccc`,
- shouldMatch: true,
- },
- {
- title: "Host route with pattern, wrong host in request URL",
- route: new(Route).Host("aaa.{v1:[a-z]{3}}.ccc"),
- request: newRequest("GET", "http://aaa.222.ccc/111/222/333"),
- vars: map[string]string{"v1": "bbb"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `aaa.{v1:[a-z]{3}}.ccc`,
- shouldMatch: false,
- },
- {
- title: "Host route with multiple patterns, match",
- route: new(Route).Host("{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v1": "aaa", "v2": "bbb", "v3": "ccc"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}`,
- shouldMatch: true,
- },
- {
- title: "Host route with multiple patterns, wrong host in request URL",
- route: new(Route).Host("{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}"),
- request: newRequest("GET", "http://aaa.222.ccc/111/222/333"),
- vars: map[string]string{"v1": "aaa", "v2": "bbb", "v3": "ccc"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}`,
- shouldMatch: false,
- },
- {
- title: "Host route with hyphenated name and pattern, match",
- route: new(Route).Host("aaa.{v-1:[a-z]{3}}.ccc"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v-1": "bbb"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `aaa.{v-1:[a-z]{3}}.ccc`,
- shouldMatch: true,
- },
- {
- title: "Host route with hyphenated name and pattern, additional capturing group, match",
- route: new(Route).Host("aaa.{v-1:[a-z]{2}(?:b|c)}.ccc"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v-1": "bbb"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `aaa.{v-1:[a-z]{2}(?:b|c)}.ccc`,
- shouldMatch: true,
- },
- {
- title: "Host route with multiple hyphenated names and patterns, match",
- route: new(Route).Host("{v-1:[a-z]{3}}.{v-2:[a-z]{3}}.{v-3:[a-z]{3}}"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v-1": "aaa", "v-2": "bbb", "v-3": "ccc"},
- host: "aaa.bbb.ccc",
- path: "",
- hostTemplate: `{v-1:[a-z]{3}}.{v-2:[a-z]{3}}.{v-3:[a-z]{3}}`,
- shouldMatch: true,
- },
- }
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- }
-}
-
-func TestPath(t *testing.T) {
- tests := []routeTest{
- {
- title: "Path route, match",
- route: new(Route).Path("/111/222/333"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{},
- host: "",
- path: "/111/222/333",
- shouldMatch: true,
- },
- {
- title: "Path route, match with trailing slash in request and path",
- route: new(Route).Path("/111/"),
- request: newRequest("GET", "http://localhost/111/"),
- vars: map[string]string{},
- host: "",
- path: "/111/",
- shouldMatch: true,
- },
- {
- title: "Path route, do not match with trailing slash in path",
- route: new(Route).Path("/111/"),
- request: newRequest("GET", "http://localhost/111"),
- vars: map[string]string{},
- host: "",
- path: "/111",
- pathTemplate: `/111/`,
- pathRegexp: `^/111/$`,
- shouldMatch: false,
- },
- {
- title: "Path route, do not match with trailing slash in request",
- route: new(Route).Path("/111"),
- request: newRequest("GET", "http://localhost/111/"),
- vars: map[string]string{},
- host: "",
- path: "/111/",
- pathTemplate: `/111`,
- shouldMatch: false,
- },
- {
- title: "Path route, match root with no host",
- route: new(Route).Path("/"),
- request: newRequest("GET", "/"),
- vars: map[string]string{},
- host: "",
- path: "/",
- pathTemplate: `/`,
- pathRegexp: `^/$`,
- shouldMatch: true,
- },
- {
- title: "Path route, match root with no host, App Engine format",
- route: new(Route).Path("/"),
- request: func() *http.Request {
- r := newRequest("GET", "http://localhost/")
- r.RequestURI = "/"
- return r
- }(),
- vars: map[string]string{},
- host: "",
- path: "/",
- pathTemplate: `/`,
- shouldMatch: true,
- },
- {
- title: "Path route, wrong path in request in request URL",
- route: new(Route).Path("/111/222/333"),
- request: newRequest("GET", "http://localhost/1/2/3"),
- vars: map[string]string{},
- host: "",
- path: "/111/222/333",
- shouldMatch: false,
- },
- {
- title: "Path route with pattern, match",
- route: new(Route).Path("/111/{v1:[0-9]{3}}/333"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{"v1": "222"},
- host: "",
- path: "/111/222/333",
- pathTemplate: `/111/{v1:[0-9]{3}}/333`,
- shouldMatch: true,
- },
- {
- title: "Path route with pattern, URL in request does not match",
- route: new(Route).Path("/111/{v1:[0-9]{3}}/333"),
- request: newRequest("GET", "http://localhost/111/aaa/333"),
- vars: map[string]string{"v1": "222"},
- host: "",
- path: "/111/222/333",
- pathTemplate: `/111/{v1:[0-9]{3}}/333`,
- pathRegexp: `^/111/(?P[0-9]{3})/333$`,
- shouldMatch: false,
- },
- {
- title: "Path route with multiple patterns, match",
- route: new(Route).Path("/{v1:[0-9]{3}}/{v2:[0-9]{3}}/{v3:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{"v1": "111", "v2": "222", "v3": "333"},
- host: "",
- path: "/111/222/333",
- pathTemplate: `/{v1:[0-9]{3}}/{v2:[0-9]{3}}/{v3:[0-9]{3}}`,
- pathRegexp: `^/(?P[0-9]{3})/(?P[0-9]{3})/(?P[0-9]{3})$`,
- shouldMatch: true,
- },
- {
- title: "Path route with multiple patterns, URL in request does not match",
- route: new(Route).Path("/{v1:[0-9]{3}}/{v2:[0-9]{3}}/{v3:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/aaa/333"),
- vars: map[string]string{"v1": "111", "v2": "222", "v3": "333"},
- host: "",
- path: "/111/222/333",
- pathTemplate: `/{v1:[0-9]{3}}/{v2:[0-9]{3}}/{v3:[0-9]{3}}`,
- pathRegexp: `^/(?P[0-9]{3})/(?P[0-9]{3})/(?P[0-9]{3})$`,
- shouldMatch: false,
- },
- {
- title: "Path route with multiple patterns with pipe, match",
- route: new(Route).Path("/{category:a|(?:b/c)}/{product}/{id:[0-9]+}"),
- request: newRequest("GET", "http://localhost/a/product_name/1"),
- vars: map[string]string{"category": "a", "product": "product_name", "id": "1"},
- host: "",
- path: "/a/product_name/1",
- pathTemplate: `/{category:a|(?:b/c)}/{product}/{id:[0-9]+}`,
- pathRegexp: `^/(?Pa|(?:b/c))/(?P[^/]+)/(?P[0-9]+)$`,
- shouldMatch: true,
- },
- {
- title: "Path route with hyphenated name and pattern, match",
- route: new(Route).Path("/111/{v-1:[0-9]{3}}/333"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{"v-1": "222"},
- host: "",
- path: "/111/222/333",
- pathTemplate: `/111/{v-1:[0-9]{3}}/333`,
- pathRegexp: `^/111/(?P[0-9]{3})/333$`,
- shouldMatch: true,
- },
- {
- title: "Path route with multiple hyphenated names and patterns, match",
- route: new(Route).Path("/{v-1:[0-9]{3}}/{v-2:[0-9]{3}}/{v-3:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{"v-1": "111", "v-2": "222", "v-3": "333"},
- host: "",
- path: "/111/222/333",
- pathTemplate: `/{v-1:[0-9]{3}}/{v-2:[0-9]{3}}/{v-3:[0-9]{3}}`,
- pathRegexp: `^/(?P[0-9]{3})/(?P[0-9]{3})/(?P[0-9]{3})$`,
- shouldMatch: true,
- },
- {
- title: "Path route with multiple hyphenated names and patterns with pipe, match",
- route: new(Route).Path("/{product-category:a|(?:b/c)}/{product-name}/{product-id:[0-9]+}"),
- request: newRequest("GET", "http://localhost/a/product_name/1"),
- vars: map[string]string{"product-category": "a", "product-name": "product_name", "product-id": "1"},
- host: "",
- path: "/a/product_name/1",
- pathTemplate: `/{product-category:a|(?:b/c)}/{product-name}/{product-id:[0-9]+}`,
- pathRegexp: `^/(?Pa|(?:b/c))/(?P[^/]+)/(?P[0-9]+)$`,
- shouldMatch: true,
- },
- {
- title: "Path route with multiple hyphenated names and patterns with pipe and case insensitive, match",
- route: new(Route).Path("/{type:(?i:daily|mini|variety)}-{date:\\d{4,4}-\\d{2,2}-\\d{2,2}}"),
- request: newRequest("GET", "http://localhost/daily-2016-01-01"),
- vars: map[string]string{"type": "daily", "date": "2016-01-01"},
- host: "",
- path: "/daily-2016-01-01",
- pathTemplate: `/{type:(?i:daily|mini|variety)}-{date:\d{4,4}-\d{2,2}-\d{2,2}}`,
- pathRegexp: `^/(?P(?i:daily|mini|variety))-(?P\d{4,4}-\d{2,2}-\d{2,2})$`,
- shouldMatch: true,
- },
- {
- title: "Path route with empty match right after other match",
- route: new(Route).Path(`/{v1:[0-9]*}{v2:[a-z]*}/{v3:[0-9]*}`),
- request: newRequest("GET", "http://localhost/111/222"),
- vars: map[string]string{"v1": "111", "v2": "", "v3": "222"},
- host: "",
- path: "/111/222",
- pathTemplate: `/{v1:[0-9]*}{v2:[a-z]*}/{v3:[0-9]*}`,
- pathRegexp: `^/(?P[0-9]*)(?P[a-z]*)/(?P[0-9]*)$`,
- shouldMatch: true,
- },
- {
- title: "Path route with single pattern with pipe, match",
- route: new(Route).Path("/{category:a|b/c}"),
- request: newRequest("GET", "http://localhost/a"),
- vars: map[string]string{"category": "a"},
- host: "",
- path: "/a",
- pathTemplate: `/{category:a|b/c}`,
- shouldMatch: true,
- },
- {
- title: "Path route with single pattern with pipe, match",
- route: new(Route).Path("/{category:a|b/c}"),
- request: newRequest("GET", "http://localhost/b/c"),
- vars: map[string]string{"category": "b/c"},
- host: "",
- path: "/b/c",
- pathTemplate: `/{category:a|b/c}`,
- shouldMatch: true,
- },
- {
- title: "Path route with multiple patterns with pipe, match",
- route: new(Route).Path("/{category:a|b/c}/{product}/{id:[0-9]+}"),
- request: newRequest("GET", "http://localhost/a/product_name/1"),
- vars: map[string]string{"category": "a", "product": "product_name", "id": "1"},
- host: "",
- path: "/a/product_name/1",
- pathTemplate: `/{category:a|b/c}/{product}/{id:[0-9]+}`,
- shouldMatch: true,
- },
- {
- title: "Path route with multiple patterns with pipe, match",
- route: new(Route).Path("/{category:a|b/c}/{product}/{id:[0-9]+}"),
- request: newRequest("GET", "http://localhost/b/c/product_name/1"),
- vars: map[string]string{"category": "b/c", "product": "product_name", "id": "1"},
- host: "",
- path: "/b/c/product_name/1",
- pathTemplate: `/{category:a|b/c}/{product}/{id:[0-9]+}`,
- shouldMatch: true,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testUseEscapedRoute(t, test)
- testRegexp(t, test)
- }
-}
-
-func TestPathPrefix(t *testing.T) {
- tests := []routeTest{
- {
- title: "PathPrefix route, match",
- route: new(Route).PathPrefix("/111"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{},
- host: "",
- path: "/111",
- shouldMatch: true,
- },
- {
- title: "PathPrefix route, match substring",
- route: new(Route).PathPrefix("/1"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{},
- host: "",
- path: "/1",
- shouldMatch: true,
- },
- {
- title: "PathPrefix route, URL prefix in request does not match",
- route: new(Route).PathPrefix("/111"),
- request: newRequest("GET", "http://localhost/1/2/3"),
- vars: map[string]string{},
- host: "",
- path: "/111",
- shouldMatch: false,
- },
- {
- title: "PathPrefix route with pattern, match",
- route: new(Route).PathPrefix("/111/{v1:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{"v1": "222"},
- host: "",
- path: "/111/222",
- pathTemplate: `/111/{v1:[0-9]{3}}`,
- shouldMatch: true,
- },
- {
- title: "PathPrefix route with pattern, URL prefix in request does not match",
- route: new(Route).PathPrefix("/111/{v1:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/aaa/333"),
- vars: map[string]string{"v1": "222"},
- host: "",
- path: "/111/222",
- pathTemplate: `/111/{v1:[0-9]{3}}`,
- shouldMatch: false,
- },
- {
- title: "PathPrefix route with multiple patterns, match",
- route: new(Route).PathPrefix("/{v1:[0-9]{3}}/{v2:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/222/333"),
- vars: map[string]string{"v1": "111", "v2": "222"},
- host: "",
- path: "/111/222",
- pathTemplate: `/{v1:[0-9]{3}}/{v2:[0-9]{3}}`,
- shouldMatch: true,
- },
- {
- title: "PathPrefix route with multiple patterns, URL prefix in request does not match",
- route: new(Route).PathPrefix("/{v1:[0-9]{3}}/{v2:[0-9]{3}}"),
- request: newRequest("GET", "http://localhost/111/aaa/333"),
- vars: map[string]string{"v1": "111", "v2": "222"},
- host: "",
- path: "/111/222",
- pathTemplate: `/{v1:[0-9]{3}}/{v2:[0-9]{3}}`,
- shouldMatch: false,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testUseEscapedRoute(t, test)
- }
-}
-
-func TestSchemeHostPath(t *testing.T) {
- tests := []routeTest{
- {
- title: "Host and Path route, match",
- route: new(Route).Host("aaa.bbb.ccc").Path("/111/222/333"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{},
- scheme: "http",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/111/222/333`,
- hostTemplate: `aaa.bbb.ccc`,
- shouldMatch: true,
- },
- {
- title: "Scheme, Host, and Path route, match",
- route: new(Route).Schemes("https").Host("aaa.bbb.ccc").Path("/111/222/333"),
- request: newRequest("GET", "https://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{},
- scheme: "https",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/111/222/333`,
- hostTemplate: `aaa.bbb.ccc`,
- shouldMatch: true,
- },
- {
- title: "Host and Path route, wrong host in request URL",
- route: new(Route).Host("aaa.bbb.ccc").Path("/111/222/333"),
- request: newRequest("GET", "http://aaa.222.ccc/111/222/333"),
- vars: map[string]string{},
- scheme: "http",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/111/222/333`,
- hostTemplate: `aaa.bbb.ccc`,
- shouldMatch: false,
- },
- {
- title: "Host and Path route with pattern, match",
- route: new(Route).Host("aaa.{v1:[a-z]{3}}.ccc").Path("/111/{v2:[0-9]{3}}/333"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v1": "bbb", "v2": "222"},
- scheme: "http",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/111/{v2:[0-9]{3}}/333`,
- hostTemplate: `aaa.{v1:[a-z]{3}}.ccc`,
- shouldMatch: true,
- },
- {
- title: "Scheme, Host, and Path route with host and path patterns, match",
- route: new(Route).Schemes("ftp", "ssss").Host("aaa.{v1:[a-z]{3}}.ccc").Path("/111/{v2:[0-9]{3}}/333"),
- request: newRequest("GET", "ssss://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v1": "bbb", "v2": "222"},
- scheme: "ftp",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/111/{v2:[0-9]{3}}/333`,
- hostTemplate: `aaa.{v1:[a-z]{3}}.ccc`,
- shouldMatch: true,
- },
- {
- title: "Host and Path route with pattern, URL in request does not match",
- route: new(Route).Host("aaa.{v1:[a-z]{3}}.ccc").Path("/111/{v2:[0-9]{3}}/333"),
- request: newRequest("GET", "http://aaa.222.ccc/111/222/333"),
- vars: map[string]string{"v1": "bbb", "v2": "222"},
- scheme: "http",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/111/{v2:[0-9]{3}}/333`,
- hostTemplate: `aaa.{v1:[a-z]{3}}.ccc`,
- shouldMatch: false,
- },
- {
- title: "Host and Path route with multiple patterns, match",
- route: new(Route).Host("{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}").Path("/{v4:[0-9]{3}}/{v5:[0-9]{3}}/{v6:[0-9]{3}}"),
- request: newRequest("GET", "http://aaa.bbb.ccc/111/222/333"),
- vars: map[string]string{"v1": "aaa", "v2": "bbb", "v3": "ccc", "v4": "111", "v5": "222", "v6": "333"},
- scheme: "http",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/{v4:[0-9]{3}}/{v5:[0-9]{3}}/{v6:[0-9]{3}}`,
- hostTemplate: `{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}`,
- shouldMatch: true,
- },
- {
- title: "Host and Path route with multiple patterns, URL in request does not match",
- route: new(Route).Host("{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}").Path("/{v4:[0-9]{3}}/{v5:[0-9]{3}}/{v6:[0-9]{3}}"),
- request: newRequest("GET", "http://aaa.222.ccc/111/222/333"),
- vars: map[string]string{"v1": "aaa", "v2": "bbb", "v3": "ccc", "v4": "111", "v5": "222", "v6": "333"},
- scheme: "http",
- host: "aaa.bbb.ccc",
- path: "/111/222/333",
- pathTemplate: `/{v4:[0-9]{3}}/{v5:[0-9]{3}}/{v6:[0-9]{3}}`,
- hostTemplate: `{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}`,
- shouldMatch: false,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testUseEscapedRoute(t, test)
- }
-}
-
-func TestHeaders(t *testing.T) {
- // newRequestHeaders creates a new request with a method, url, and headers
- newRequestHeaders := func(method, url string, headers map[string]string) *http.Request {
- req, err := http.NewRequest(method, url, nil)
- if err != nil {
- panic(err)
- }
- for k, v := range headers {
- req.Header.Add(k, v)
- }
- return req
- }
-
- tests := []routeTest{
- {
- title: "Headers route, match",
- route: new(Route).Headers("foo", "bar", "baz", "ding"),
- request: newRequestHeaders("GET", "http://localhost", map[string]string{"foo": "bar", "baz": "ding"}),
- vars: map[string]string{},
- host: "",
- path: "",
- shouldMatch: true,
- },
- {
- title: "Headers route, bad header values",
- route: new(Route).Headers("foo", "bar", "baz", "ding"),
- request: newRequestHeaders("GET", "http://localhost", map[string]string{"foo": "bar", "baz": "dong"}),
- vars: map[string]string{},
- host: "",
- path: "",
- shouldMatch: false,
- },
- {
- title: "Headers route, regex header values to match",
- route: new(Route).Headers("foo", "ba[zr]"),
- request: newRequestHeaders("GET", "http://localhost", map[string]string{"foo": "bar"}),
- vars: map[string]string{},
- host: "",
- path: "",
- shouldMatch: false,
- },
- {
- title: "Headers route, regex header values to match",
- route: new(Route).HeadersRegexp("foo", "ba[zr]"),
- request: newRequestHeaders("GET", "http://localhost", map[string]string{"foo": "baz"}),
- vars: map[string]string{},
- host: "",
- path: "",
- shouldMatch: true,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- }
-}
-
-func TestMethods(t *testing.T) {
- tests := []routeTest{
- {
- title: "Methods route, match GET",
- route: new(Route).Methods("GET", "POST"),
- request: newRequest("GET", "http://localhost"),
- vars: map[string]string{},
- host: "",
- path: "",
- methods: []string{"GET", "POST"},
- shouldMatch: true,
- },
- {
- title: "Methods route, match POST",
- route: new(Route).Methods("GET", "POST"),
- request: newRequest("POST", "http://localhost"),
- vars: map[string]string{},
- host: "",
- path: "",
- methods: []string{"GET", "POST"},
- shouldMatch: true,
- },
- {
- title: "Methods route, bad method",
- route: new(Route).Methods("GET", "POST"),
- request: newRequest("PUT", "http://localhost"),
- vars: map[string]string{},
- host: "",
- path: "",
- methods: []string{"GET", "POST"},
- shouldMatch: false,
- },
- {
- title: "Route without methods",
- route: new(Route),
- request: newRequest("PUT", "http://localhost"),
- vars: map[string]string{},
- host: "",
- path: "",
- methods: []string{},
- shouldMatch: true,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testMethods(t, test)
- }
-}
-
-func TestQueries(t *testing.T) {
- tests := []routeTest{
- {
- title: "Queries route, match",
- route: new(Route).Queries("foo", "bar", "baz", "ding"),
- request: newRequest("GET", "http://localhost?foo=bar&baz=ding"),
- vars: map[string]string{},
- host: "",
- path: "",
- query: "foo=bar&baz=ding",
- queriesTemplate: "foo=bar,baz=ding",
- queriesRegexp: "^foo=bar$,^baz=ding$",
- shouldMatch: true,
- },
- {
- title: "Queries route, match with a query string",
- route: new(Route).Host("www.example.com").Path("/api").Queries("foo", "bar", "baz", "ding"),
- request: newRequest("GET", "http://www.example.com/api?foo=bar&baz=ding"),
- vars: map[string]string{},
- host: "",
- path: "",
- query: "foo=bar&baz=ding",
- pathTemplate: `/api`,
- hostTemplate: `www.example.com`,
- queriesTemplate: "foo=bar,baz=ding",
- queriesRegexp: "^foo=bar$,^baz=ding$",
- shouldMatch: true,
- },
- {
- title: "Queries route, match with a query string out of order",
- route: new(Route).Host("www.example.com").Path("/api").Queries("foo", "bar", "baz", "ding"),
- request: newRequest("GET", "http://www.example.com/api?baz=ding&foo=bar"),
- vars: map[string]string{},
- host: "",
- path: "",
- query: "foo=bar&baz=ding",
- pathTemplate: `/api`,
- hostTemplate: `www.example.com`,
- queriesTemplate: "foo=bar,baz=ding",
- queriesRegexp: "^foo=bar$,^baz=ding$",
- shouldMatch: true,
- },
- {
- title: "Queries route, bad query",
- route: new(Route).Queries("foo", "bar", "baz", "ding"),
- request: newRequest("GET", "http://localhost?foo=bar&baz=dong"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo=bar,baz=ding",
- queriesRegexp: "^foo=bar$,^baz=ding$",
- shouldMatch: false,
- },
- {
- title: "Queries route with pattern, match",
- route: new(Route).Queries("foo", "{v1}"),
- request: newRequest("GET", "http://localhost?foo=bar"),
- vars: map[string]string{"v1": "bar"},
- host: "",
- path: "",
- query: "foo=bar",
- queriesTemplate: "foo={v1}",
- queriesRegexp: "^foo=(?P.*)$",
- shouldMatch: true,
- },
- {
- title: "Queries route with multiple patterns, match",
- route: new(Route).Queries("foo", "{v1}", "baz", "{v2}"),
- request: newRequest("GET", "http://localhost?foo=bar&baz=ding"),
- vars: map[string]string{"v1": "bar", "v2": "ding"},
- host: "",
- path: "",
- query: "foo=bar&baz=ding",
- queriesTemplate: "foo={v1},baz={v2}",
- queriesRegexp: "^foo=(?P.*)$,^baz=(?P.*)$",
- shouldMatch: true,
- },
- {
- title: "Queries route with regexp pattern, match",
- route: new(Route).Queries("foo", "{v1:[0-9]+}"),
- request: newRequest("GET", "http://localhost?foo=10"),
- vars: map[string]string{"v1": "10"},
- host: "",
- path: "",
- query: "foo=10",
- queriesTemplate: "foo={v1:[0-9]+}",
- queriesRegexp: "^foo=(?P[0-9]+)$",
- shouldMatch: true,
- },
- {
- title: "Queries route with regexp pattern, regexp does not match",
- route: new(Route).Queries("foo", "{v1:[0-9]+}"),
- request: newRequest("GET", "http://localhost?foo=a"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo={v1:[0-9]+}",
- queriesRegexp: "^foo=(?P[0-9]+)$",
- shouldMatch: false,
- },
- {
- title: "Queries route with regexp pattern with quantifier, match",
- route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
- request: newRequest("GET", "http://localhost?foo=1"),
- vars: map[string]string{"v1": "1"},
- host: "",
- path: "",
- query: "foo=1",
- queriesTemplate: "foo={v1:[0-9]{1}}",
- queriesRegexp: "^foo=(?P[0-9]{1})$",
- shouldMatch: true,
- },
- {
- title: "Queries route with regexp pattern with quantifier, additional variable in query string, match",
- route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
- request: newRequest("GET", "http://localhost?bar=2&foo=1"),
- vars: map[string]string{"v1": "1"},
- host: "",
- path: "",
- query: "foo=1",
- queriesTemplate: "foo={v1:[0-9]{1}}",
- queriesRegexp: "^foo=(?P[0-9]{1})$",
- shouldMatch: true,
- },
- {
- title: "Queries route with regexp pattern with quantifier, regexp does not match",
- route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
- request: newRequest("GET", "http://localhost?foo=12"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo={v1:[0-9]{1}}",
- queriesRegexp: "^foo=(?P[0-9]{1})$",
- shouldMatch: false,
- },
- {
- title: "Queries route with regexp pattern with quantifier, additional capturing group",
- route: new(Route).Queries("foo", "{v1:[0-9]{1}(?:a|b)}"),
- request: newRequest("GET", "http://localhost?foo=1a"),
- vars: map[string]string{"v1": "1a"},
- host: "",
- path: "",
- query: "foo=1a",
- queriesTemplate: "foo={v1:[0-9]{1}(?:a|b)}",
- queriesRegexp: "^foo=(?P[0-9]{1}(?:a|b))$",
- shouldMatch: true,
- },
- {
- title: "Queries route with regexp pattern with quantifier, additional variable in query string, regexp does not match",
- route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
- request: newRequest("GET", "http://localhost?foo=12"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo={v1:[0-9]{1}}",
- queriesRegexp: "^foo=(?P[0-9]{1})$",
- shouldMatch: false,
- },
- {
- title: "Queries route with hyphenated name, match",
- route: new(Route).Queries("foo", "{v-1}"),
- request: newRequest("GET", "http://localhost?foo=bar"),
- vars: map[string]string{"v-1": "bar"},
- host: "",
- path: "",
- query: "foo=bar",
- queriesTemplate: "foo={v-1}",
- queriesRegexp: "^foo=(?P.*)$",
- shouldMatch: true,
- },
- {
- title: "Queries route with multiple hyphenated names, match",
- route: new(Route).Queries("foo", "{v-1}", "baz", "{v-2}"),
- request: newRequest("GET", "http://localhost?foo=bar&baz=ding"),
- vars: map[string]string{"v-1": "bar", "v-2": "ding"},
- host: "",
- path: "",
- query: "foo=bar&baz=ding",
- queriesTemplate: "foo={v-1},baz={v-2}",
- queriesRegexp: "^foo=(?P.*)$,^baz=(?P.*)$",
- shouldMatch: true,
- },
- {
- title: "Queries route with hyphenate name and pattern, match",
- route: new(Route).Queries("foo", "{v-1:[0-9]+}"),
- request: newRequest("GET", "http://localhost?foo=10"),
- vars: map[string]string{"v-1": "10"},
- host: "",
- path: "",
- query: "foo=10",
- queriesTemplate: "foo={v-1:[0-9]+}",
- queriesRegexp: "^foo=(?P[0-9]+)$",
- shouldMatch: true,
- },
- {
- title: "Queries route with hyphenated name and pattern with quantifier, additional capturing group",
- route: new(Route).Queries("foo", "{v-1:[0-9]{1}(?:a|b)}"),
- request: newRequest("GET", "http://localhost?foo=1a"),
- vars: map[string]string{"v-1": "1a"},
- host: "",
- path: "",
- query: "foo=1a",
- queriesTemplate: "foo={v-1:[0-9]{1}(?:a|b)}",
- queriesRegexp: "^foo=(?P[0-9]{1}(?:a|b))$",
- shouldMatch: true,
- },
- {
- title: "Queries route with empty value, should match",
- route: new(Route).Queries("foo", ""),
- request: newRequest("GET", "http://localhost?foo=bar"),
- vars: map[string]string{},
- host: "",
- path: "",
- query: "foo=",
- queriesTemplate: "foo=",
- queriesRegexp: "^foo=.*$",
- shouldMatch: true,
- },
- {
- title: "Queries route with empty value and no parameter in request, should not match",
- route: new(Route).Queries("foo", ""),
- request: newRequest("GET", "http://localhost"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo=",
- queriesRegexp: "^foo=.*$",
- shouldMatch: false,
- },
- {
- title: "Queries route with empty value and empty parameter in request, should match",
- route: new(Route).Queries("foo", ""),
- request: newRequest("GET", "http://localhost?foo="),
- vars: map[string]string{},
- host: "",
- path: "",
- query: "foo=",
- queriesTemplate: "foo=",
- queriesRegexp: "^foo=.*$",
- shouldMatch: true,
- },
- {
- title: "Queries route with overlapping value, should not match",
- route: new(Route).Queries("foo", "bar"),
- request: newRequest("GET", "http://localhost?foo=barfoo"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo=bar",
- queriesRegexp: "^foo=bar$",
- shouldMatch: false,
- },
- {
- title: "Queries route with no parameter in request, should not match",
- route: new(Route).Queries("foo", "{bar}"),
- request: newRequest("GET", "http://localhost"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo={bar}",
- queriesRegexp: "^foo=(?P.*)$",
- shouldMatch: false,
- },
- {
- title: "Queries route with empty parameter in request, should match",
- route: new(Route).Queries("foo", "{bar}"),
- request: newRequest("GET", "http://localhost?foo="),
- vars: map[string]string{"foo": ""},
- host: "",
- path: "",
- query: "foo=",
- queriesTemplate: "foo={bar}",
- queriesRegexp: "^foo=(?P.*)$",
- shouldMatch: true,
- },
- {
- title: "Queries route, bad submatch",
- route: new(Route).Queries("foo", "bar", "baz", "ding"),
- request: newRequest("GET", "http://localhost?fffoo=bar&baz=dingggg"),
- vars: map[string]string{},
- host: "",
- path: "",
- queriesTemplate: "foo=bar,baz=ding",
- queriesRegexp: "^foo=bar$,^baz=ding$",
- shouldMatch: false,
- },
- {
- title: "Queries route with pattern, match, escaped value",
- route: new(Route).Queries("foo", "{v1}"),
- request: newRequest("GET", "http://localhost?foo=%25bar%26%20%2F%3D%3F"),
- vars: map[string]string{"v1": "%bar& /=?"},
- host: "",
- path: "",
- query: "foo=%25bar%26+%2F%3D%3F",
- queriesTemplate: "foo={v1}",
- queriesRegexp: "^foo=(?P.*)$",
- shouldMatch: true,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testQueriesTemplates(t, test)
- testUseEscapedRoute(t, test)
- testQueriesRegexp(t, test)
- }
-}
-
-func TestSchemes(t *testing.T) {
- tests := []routeTest{
- // Schemes
- {
- title: "Schemes route, default scheme, match http, build http",
- route: new(Route).Host("localhost"),
- request: newRequest("GET", "http://localhost"),
- scheme: "http",
- host: "localhost",
- shouldMatch: true,
- },
- {
- title: "Schemes route, match https, build https",
- route: new(Route).Schemes("https", "ftp").Host("localhost"),
- request: newRequest("GET", "https://localhost"),
- scheme: "https",
- host: "localhost",
- shouldMatch: true,
- },
- {
- title: "Schemes route, match ftp, build https",
- route: new(Route).Schemes("https", "ftp").Host("localhost"),
- request: newRequest("GET", "ftp://localhost"),
- scheme: "https",
- host: "localhost",
- shouldMatch: true,
- },
- {
- title: "Schemes route, match ftp, build ftp",
- route: new(Route).Schemes("ftp", "https").Host("localhost"),
- request: newRequest("GET", "ftp://localhost"),
- scheme: "ftp",
- host: "localhost",
- shouldMatch: true,
- },
- {
- title: "Schemes route, bad scheme",
- route: new(Route).Schemes("https", "ftp").Host("localhost"),
- request: newRequest("GET", "http://localhost"),
- scheme: "https",
- host: "localhost",
- shouldMatch: false,
- },
- }
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- }
-}
-
-func TestMatcherFunc(t *testing.T) {
- m := func(r *http.Request, m *RouteMatch) bool {
- if r.URL.Host == "aaa.bbb.ccc" {
- return true
- }
- return false
- }
-
- tests := []routeTest{
- {
- title: "MatchFunc route, match",
- route: new(Route).MatcherFunc(m),
- request: newRequest("GET", "http://aaa.bbb.ccc"),
- vars: map[string]string{},
- host: "",
- path: "",
- shouldMatch: true,
- },
- {
- title: "MatchFunc route, non-match",
- route: new(Route).MatcherFunc(m),
- request: newRequest("GET", "http://aaa.222.ccc"),
- vars: map[string]string{},
- host: "",
- path: "",
- shouldMatch: false,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- }
-}
-
-func TestBuildVarsFunc(t *testing.T) {
- tests := []routeTest{
- {
- title: "BuildVarsFunc set on route",
- route: new(Route).Path(`/111/{v1:\d}{v2:.*}`).BuildVarsFunc(func(vars map[string]string) map[string]string {
- vars["v1"] = "3"
- vars["v2"] = "a"
- return vars
- }),
- request: newRequest("GET", "http://localhost/111/2"),
- path: "/111/3a",
- pathTemplate: `/111/{v1:\d}{v2:.*}`,
- shouldMatch: true,
- },
- {
- title: "BuildVarsFunc set on route and parent route",
- route: new(Route).PathPrefix(`/{v1:\d}`).BuildVarsFunc(func(vars map[string]string) map[string]string {
- vars["v1"] = "2"
- return vars
- }).Subrouter().Path(`/{v2:\w}`).BuildVarsFunc(func(vars map[string]string) map[string]string {
- vars["v2"] = "b"
- return vars
- }),
- request: newRequest("GET", "http://localhost/1/a"),
- path: "/2/b",
- pathTemplate: `/{v1:\d}/{v2:\w}`,
- shouldMatch: true,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- }
-}
-
-func TestSubRouter(t *testing.T) {
- subrouter1 := new(Route).Host("{v1:[a-z]+}.google.com").Subrouter()
- subrouter2 := new(Route).PathPrefix("/foo/{v1}").Subrouter()
- subrouter3 := new(Route).PathPrefix("/foo").Subrouter()
- subrouter4 := new(Route).PathPrefix("/foo/bar").Subrouter()
- subrouter5 := new(Route).PathPrefix("/{category}").Subrouter()
-
- tests := []routeTest{
- {
- route: subrouter1.Path("/{v2:[a-z]+}"),
- request: newRequest("GET", "http://aaa.google.com/bbb"),
- vars: map[string]string{"v1": "aaa", "v2": "bbb"},
- host: "aaa.google.com",
- path: "/bbb",
- pathTemplate: `/{v2:[a-z]+}`,
- hostTemplate: `{v1:[a-z]+}.google.com`,
- shouldMatch: true,
- },
- {
- route: subrouter1.Path("/{v2:[a-z]+}"),
- request: newRequest("GET", "http://111.google.com/111"),
- vars: map[string]string{"v1": "aaa", "v2": "bbb"},
- host: "aaa.google.com",
- path: "/bbb",
- pathTemplate: `/{v2:[a-z]+}`,
- hostTemplate: `{v1:[a-z]+}.google.com`,
- shouldMatch: false,
- },
- {
- route: subrouter2.Path("/baz/{v2}"),
- request: newRequest("GET", "http://localhost/foo/bar/baz/ding"),
- vars: map[string]string{"v1": "bar", "v2": "ding"},
- host: "",
- path: "/foo/bar/baz/ding",
- pathTemplate: `/foo/{v1}/baz/{v2}`,
- shouldMatch: true,
- },
- {
- route: subrouter2.Path("/baz/{v2}"),
- request: newRequest("GET", "http://localhost/foo/bar"),
- vars: map[string]string{"v1": "bar", "v2": "ding"},
- host: "",
- path: "/foo/bar/baz/ding",
- pathTemplate: `/foo/{v1}/baz/{v2}`,
- shouldMatch: false,
- },
- {
- route: subrouter3.Path("/"),
- request: newRequest("GET", "http://localhost/foo/"),
- vars: map[string]string{},
- host: "",
- path: "/foo/",
- pathTemplate: `/foo/`,
- shouldMatch: true,
- },
- {
- route: subrouter3.Path(""),
- request: newRequest("GET", "http://localhost/foo"),
- vars: map[string]string{},
- host: "",
- path: "/foo",
- pathTemplate: `/foo`,
- shouldMatch: true,
- },
-
- {
- route: subrouter4.Path("/"),
- request: newRequest("GET", "http://localhost/foo/bar/"),
- vars: map[string]string{},
- host: "",
- path: "/foo/bar/",
- pathTemplate: `/foo/bar/`,
- shouldMatch: true,
- },
- {
- route: subrouter4.Path(""),
- request: newRequest("GET", "http://localhost/foo/bar"),
- vars: map[string]string{},
- host: "",
- path: "/foo/bar",
- pathTemplate: `/foo/bar`,
- shouldMatch: true,
- },
- {
- route: subrouter5.Path("/"),
- request: newRequest("GET", "http://localhost/baz/"),
- vars: map[string]string{"category": "baz"},
- host: "",
- path: "/baz/",
- pathTemplate: `/{category}/`,
- shouldMatch: true,
- },
- {
- route: subrouter5.Path(""),
- request: newRequest("GET", "http://localhost/baz"),
- vars: map[string]string{"category": "baz"},
- host: "",
- path: "/baz",
- pathTemplate: `/{category}`,
- shouldMatch: true,
- },
- {
- title: "Build with scheme on parent router",
- route: new(Route).Schemes("ftp").Host("google.com").Subrouter().Path("/"),
- request: newRequest("GET", "ftp://google.com/"),
- scheme: "ftp",
- host: "google.com",
- path: "/",
- pathTemplate: `/`,
- hostTemplate: `google.com`,
- shouldMatch: true,
- },
- {
- title: "Prefer scheme on child route when building URLs",
- route: new(Route).Schemes("https", "ftp").Host("google.com").Subrouter().Schemes("ftp").Path("/"),
- request: newRequest("GET", "ftp://google.com/"),
- scheme: "ftp",
- host: "google.com",
- path: "/",
- pathTemplate: `/`,
- hostTemplate: `google.com`,
- shouldMatch: true,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testUseEscapedRoute(t, test)
- }
-}
-
-func TestNamedRoutes(t *testing.T) {
- r1 := NewRouter()
- r1.NewRoute().Name("a")
- r1.NewRoute().Name("b")
- r1.NewRoute().Name("c")
-
- r2 := r1.NewRoute().Subrouter()
- r2.NewRoute().Name("d")
- r2.NewRoute().Name("e")
- r2.NewRoute().Name("f")
-
- r3 := r2.NewRoute().Subrouter()
- r3.NewRoute().Name("g")
- r3.NewRoute().Name("h")
- r3.NewRoute().Name("i")
-
- if r1.namedRoutes == nil || len(r1.namedRoutes) != 9 {
- t.Errorf("Expected 9 named routes, got %v", r1.namedRoutes)
- } else if r1.Get("i") == nil {
- t.Errorf("Subroute name not registered")
- }
-}
-
-func TestStrictSlash(t *testing.T) {
- r := NewRouter()
- r.StrictSlash(true)
-
- tests := []routeTest{
- {
- title: "Redirect path without slash",
- route: r.NewRoute().Path("/111/"),
- request: newRequest("GET", "http://localhost/111"),
- vars: map[string]string{},
- host: "",
- path: "/111/",
- shouldMatch: true,
- shouldRedirect: true,
- },
- {
- title: "Do not redirect path with slash",
- route: r.NewRoute().Path("/111/"),
- request: newRequest("GET", "http://localhost/111/"),
- vars: map[string]string{},
- host: "",
- path: "/111/",
- shouldMatch: true,
- shouldRedirect: false,
- },
- {
- title: "Redirect path with slash",
- route: r.NewRoute().Path("/111"),
- request: newRequest("GET", "http://localhost/111/"),
- vars: map[string]string{},
- host: "",
- path: "/111",
- shouldMatch: true,
- shouldRedirect: true,
- },
- {
- title: "Do not redirect path without slash",
- route: r.NewRoute().Path("/111"),
- request: newRequest("GET", "http://localhost/111"),
- vars: map[string]string{},
- host: "",
- path: "/111",
- shouldMatch: true,
- shouldRedirect: false,
- },
- {
- title: "Propagate StrictSlash to subrouters",
- route: r.NewRoute().PathPrefix("/static/").Subrouter().Path("/images/"),
- request: newRequest("GET", "http://localhost/static/images"),
- vars: map[string]string{},
- host: "",
- path: "/static/images/",
- shouldMatch: true,
- shouldRedirect: true,
- },
- {
- title: "Ignore StrictSlash for path prefix",
- route: r.NewRoute().PathPrefix("/static/"),
- request: newRequest("GET", "http://localhost/static/logo.png"),
- vars: map[string]string{},
- host: "",
- path: "/static/",
- shouldMatch: true,
- shouldRedirect: false,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- testUseEscapedRoute(t, test)
- }
-}
-
-func TestUseEncodedPath(t *testing.T) {
- r := NewRouter()
- r.UseEncodedPath()
-
- tests := []routeTest{
- {
- title: "Router with useEncodedPath, URL with encoded slash does match",
- route: r.NewRoute().Path("/v1/{v1}/v2"),
- request: newRequest("GET", "http://localhost/v1/1%2F2/v2"),
- vars: map[string]string{"v1": "1%2F2"},
- host: "",
- path: "/v1/1%2F2/v2",
- pathTemplate: `/v1/{v1}/v2`,
- shouldMatch: true,
- },
- {
- title: "Router with useEncodedPath, URL with encoded slash doesn't match",
- route: r.NewRoute().Path("/v1/1/2/v2"),
- request: newRequest("GET", "http://localhost/v1/1%2F2/v2"),
- vars: map[string]string{"v1": "1%2F2"},
- host: "",
- path: "/v1/1%2F2/v2",
- pathTemplate: `/v1/1/2/v2`,
- shouldMatch: false,
- },
- }
-
- for _, test := range tests {
- testRoute(t, test)
- testTemplate(t, test)
- }
-}
-
-func TestWalkSingleDepth(t *testing.T) {
- r0 := NewRouter()
- r1 := NewRouter()
- r2 := NewRouter()
-
- r0.Path("/g")
- r0.Path("/o")
- r0.Path("/d").Handler(r1)
- r0.Path("/r").Handler(r2)
- r0.Path("/a")
-
- r1.Path("/z")
- r1.Path("/i")
- r1.Path("/l")
- r1.Path("/l")
-
- r2.Path("/i")
- r2.Path("/l")
- r2.Path("/l")
-
- paths := []string{"g", "o", "r", "i", "l", "l", "a"}
- depths := []int{0, 0, 0, 1, 1, 1, 0}
- i := 0
- err := r0.Walk(func(route *Route, router *Router, ancestors []*Route) error {
- matcher := route.matchers[0].(*routeRegexp)
- if matcher.template == "/d" {
- return SkipRouter
- }
- if len(ancestors) != depths[i] {
- t.Errorf(`Expected depth of %d at i = %d; got "%d"`, depths[i], i, len(ancestors))
- }
- if matcher.template != "/"+paths[i] {
- t.Errorf(`Expected "/%s" at i = %d; got "%s"`, paths[i], i, matcher.template)
- }
- i++
- return nil
- })
- if err != nil {
- panic(err)
- }
- if i != len(paths) {
- t.Errorf("Expected %d routes, found %d", len(paths), i)
- }
-}
-
-func TestWalkNested(t *testing.T) {
- router := NewRouter()
-
- g := router.Path("/g").Subrouter()
- o := g.PathPrefix("/o").Subrouter()
- r := o.PathPrefix("/r").Subrouter()
- i := r.PathPrefix("/i").Subrouter()
- l1 := i.PathPrefix("/l").Subrouter()
- l2 := l1.PathPrefix("/l").Subrouter()
- l2.Path("/a")
-
- testCases := []struct {
- path string
- ancestors []*Route
- }{
- {"/g", []*Route{}},
- {"/g/o", []*Route{g.parent.(*Route)}},
- {"/g/o/r", []*Route{g.parent.(*Route), o.parent.(*Route)}},
- {"/g/o/r/i", []*Route{g.parent.(*Route), o.parent.(*Route), r.parent.(*Route)}},
- {"/g/o/r/i/l", []*Route{g.parent.(*Route), o.parent.(*Route), r.parent.(*Route), i.parent.(*Route)}},
- {"/g/o/r/i/l/l", []*Route{g.parent.(*Route), o.parent.(*Route), r.parent.(*Route), i.parent.(*Route), l1.parent.(*Route)}},
- {"/g/o/r/i/l/l/a", []*Route{g.parent.(*Route), o.parent.(*Route), r.parent.(*Route), i.parent.(*Route), l1.parent.(*Route), l2.parent.(*Route)}},
- }
-
- idx := 0
- err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
- path := testCases[idx].path
- tpl := route.regexp.path.template
- if tpl != path {
- t.Errorf(`Expected %s got %s`, path, tpl)
- }
- currWantAncestors := testCases[idx].ancestors
- if !reflect.DeepEqual(currWantAncestors, ancestors) {
- t.Errorf(`Expected %+v got %+v`, currWantAncestors, ancestors)
- }
- idx++
- return nil
- })
- if err != nil {
- panic(err)
- }
- if idx != len(testCases) {
- t.Errorf("Expected %d routes, found %d", len(testCases), idx)
- }
-}
-
-func TestWalkSubrouters(t *testing.T) {
- router := NewRouter()
-
- g := router.Path("/g").Subrouter()
- o := g.PathPrefix("/o").Subrouter()
- o.Methods("GET")
- o.Methods("PUT")
-
- // all 4 routes should be matched, but final 2 routes do not have path templates
- paths := []string{"/g", "/g/o", "", ""}
- idx := 0
- err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
- path := paths[idx]
- tpl, _ := route.GetPathTemplate()
- if tpl != path {
- t.Errorf(`Expected %s got %s`, path, tpl)
- }
- idx++
- return nil
- })
- if err != nil {
- panic(err)
- }
- if idx != len(paths) {
- t.Errorf("Expected %d routes, found %d", len(paths), idx)
- }
-}
-
-func TestWalkErrorRoute(t *testing.T) {
- router := NewRouter()
- router.Path("/g")
- expectedError := errors.New("error")
- err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
- return expectedError
- })
- if err != expectedError {
- t.Errorf("Expected %v routes, found %v", expectedError, err)
- }
-}
-
-func TestWalkErrorMatcher(t *testing.T) {
- router := NewRouter()
- expectedError := router.Path("/g").Subrouter().Path("").GetError()
- err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
- return route.GetError()
- })
- if err != expectedError {
- t.Errorf("Expected %v routes, found %v", expectedError, err)
- }
-}
-
-func TestWalkErrorHandler(t *testing.T) {
- handler := NewRouter()
- expectedError := handler.Path("/path").Subrouter().Path("").GetError()
- router := NewRouter()
- router.Path("/g").Handler(handler)
- err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
- return route.GetError()
- })
- if err != expectedError {
- t.Errorf("Expected %v routes, found %v", expectedError, err)
- }
-}
-
-func TestSubrouterErrorHandling(t *testing.T) {
- superRouterCalled := false
- subRouterCalled := false
-
- router := NewRouter()
- router.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- superRouterCalled = true
- })
- subRouter := router.PathPrefix("/bign8").Subrouter()
- subRouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- subRouterCalled = true
- })
-
- req, _ := http.NewRequest("GET", "http://localhost/bign8/was/here", nil)
- router.ServeHTTP(NewRecorder(), req)
-
- if superRouterCalled {
- t.Error("Super router 404 handler called when sub-router 404 handler is available.")
- }
- if !subRouterCalled {
- t.Error("Sub-router 404 handler was not called.")
- }
-}
-
-// See: https://github.com/gorilla/mux/issues/200
-func TestPanicOnCapturingGroups(t *testing.T) {
- defer func() {
- if recover() == nil {
- t.Errorf("(Test that capturing groups now fail fast) Expected panic, however test completed successfully.\n")
- }
- }()
- NewRouter().NewRoute().Path("/{type:(promo|special)}/{promoId}.json")
-}
-
-// ----------------------------------------------------------------------------
-// Helpers
-// ----------------------------------------------------------------------------
-
-func getRouteTemplate(route *Route) string {
- host, err := route.GetHostTemplate()
- if err != nil {
- host = "none"
- }
- path, err := route.GetPathTemplate()
- if err != nil {
- path = "none"
- }
- return fmt.Sprintf("Host: %v, Path: %v", host, path)
-}
-
-func testRoute(t *testing.T, test routeTest) {
- request := test.request
- route := test.route
- vars := test.vars
- shouldMatch := test.shouldMatch
- query := test.query
- shouldRedirect := test.shouldRedirect
- uri := url.URL{
- Scheme: test.scheme,
- Host: test.host,
- Path: test.path,
- }
- if uri.Scheme == "" {
- uri.Scheme = "http"
- }
-
- var match RouteMatch
- ok := route.Match(request, &match)
- if ok != shouldMatch {
- msg := "Should match"
- if !shouldMatch {
- msg = "Should not match"
- }
- t.Errorf("(%v) %v:\nRoute: %#v\nRequest: %#v\nVars: %v\n", test.title, msg, route, request, vars)
- return
- }
- if shouldMatch {
- if vars != nil && !stringMapEqual(vars, match.Vars) {
- t.Errorf("(%v) Vars not equal: expected %v, got %v", test.title, vars, match.Vars)
- return
- }
- if test.scheme != "" {
- u, err := route.URL(mapToPairs(match.Vars)...)
- if err != nil {
- t.Fatalf("(%v) URL error: %v -- %v", test.title, err, getRouteTemplate(route))
- }
- if uri.Scheme != u.Scheme {
- t.Errorf("(%v) URLScheme not equal: expected %v, got %v", test.title, uri.Scheme, u.Scheme)
- return
- }
- }
- if test.host != "" {
- u, err := test.route.URLHost(mapToPairs(match.Vars)...)
- if err != nil {
- t.Fatalf("(%v) URLHost error: %v -- %v", test.title, err, getRouteTemplate(route))
- }
- if uri.Scheme != u.Scheme {
- t.Errorf("(%v) URLHost scheme not equal: expected %v, got %v -- %v", test.title, uri.Scheme, u.Scheme, getRouteTemplate(route))
- return
- }
- if uri.Host != u.Host {
- t.Errorf("(%v) URLHost host not equal: expected %v, got %v -- %v", test.title, uri.Host, u.Host, getRouteTemplate(route))
- return
- }
- }
- if test.path != "" {
- u, err := route.URLPath(mapToPairs(match.Vars)...)
- if err != nil {
- t.Fatalf("(%v) URLPath error: %v -- %v", test.title, err, getRouteTemplate(route))
- }
- if uri.Path != u.Path {
- t.Errorf("(%v) URLPath not equal: expected %v, got %v -- %v", test.title, uri.Path, u.Path, getRouteTemplate(route))
- return
- }
- }
- if test.host != "" && test.path != "" {
- u, err := route.URL(mapToPairs(match.Vars)...)
- if err != nil {
- t.Fatalf("(%v) URL error: %v -- %v", test.title, err, getRouteTemplate(route))
- }
- if expected, got := uri.String(), u.String(); expected != got {
- t.Errorf("(%v) URL not equal: expected %v, got %v -- %v", test.title, expected, got, getRouteTemplate(route))
- return
- }
- }
- if query != "" {
- u, _ := route.URL(mapToPairs(match.Vars)...)
- if query != u.RawQuery {
- t.Errorf("(%v) URL query not equal: expected %v, got %v", test.title, query, u.RawQuery)
- return
- }
- }
- if shouldRedirect && match.Handler == nil {
- t.Errorf("(%v) Did not redirect", test.title)
- return
- }
- if !shouldRedirect && match.Handler != nil {
- t.Errorf("(%v) Unexpected redirect", test.title)
- return
- }
- }
-}
-
-func testUseEscapedRoute(t *testing.T, test routeTest) {
- test.route.useEncodedPath = true
- testRoute(t, test)
-}
-
-func testTemplate(t *testing.T, test routeTest) {
- route := test.route
- pathTemplate := test.pathTemplate
- if len(pathTemplate) == 0 {
- pathTemplate = test.path
- }
- hostTemplate := test.hostTemplate
- if len(hostTemplate) == 0 {
- hostTemplate = test.host
- }
-
- routePathTemplate, pathErr := route.GetPathTemplate()
- if pathErr == nil && routePathTemplate != pathTemplate {
- t.Errorf("(%v) GetPathTemplate not equal: expected %v, got %v", test.title, pathTemplate, routePathTemplate)
- }
-
- routeHostTemplate, hostErr := route.GetHostTemplate()
- if hostErr == nil && routeHostTemplate != hostTemplate {
- t.Errorf("(%v) GetHostTemplate not equal: expected %v, got %v", test.title, hostTemplate, routeHostTemplate)
- }
-}
-
-func testMethods(t *testing.T, test routeTest) {
- route := test.route
- methods, _ := route.GetMethods()
- if strings.Join(methods, ",") != strings.Join(test.methods, ",") {
- t.Errorf("(%v) GetMethods not equal: expected %v, got %v", test.title, test.methods, methods)
- }
-}
-
-func testRegexp(t *testing.T, test routeTest) {
- route := test.route
- routePathRegexp, regexpErr := route.GetPathRegexp()
- if test.pathRegexp != "" && regexpErr == nil && routePathRegexp != test.pathRegexp {
- t.Errorf("(%v) GetPathRegexp not equal: expected %v, got %v", test.title, test.pathRegexp, routePathRegexp)
- }
-}
-
-func testQueriesRegexp(t *testing.T, test routeTest) {
- route := test.route
- queries, queriesErr := route.GetQueriesRegexp()
- gotQueries := strings.Join(queries, ",")
- if test.queriesRegexp != "" && queriesErr == nil && gotQueries != test.queriesRegexp {
- t.Errorf("(%v) GetQueriesRegexp not equal: expected %v, got %v", test.title, test.queriesRegexp, gotQueries)
- }
-}
-
-func testQueriesTemplates(t *testing.T, test routeTest) {
- route := test.route
- queries, queriesErr := route.GetQueriesTemplates()
- gotQueries := strings.Join(queries, ",")
- if test.queriesTemplate != "" && queriesErr == nil && gotQueries != test.queriesTemplate {
- t.Errorf("(%v) GetQueriesTemplates not equal: expected %v, got %v", test.title, test.queriesTemplate, gotQueries)
- }
-}
-
-type TestA301ResponseWriter struct {
- hh http.Header
- status int
-}
-
-func (ho *TestA301ResponseWriter) Header() http.Header {
- return http.Header(ho.hh)
-}
-
-func (ho *TestA301ResponseWriter) Write(b []byte) (int, error) {
- return 0, nil
-}
-
-func (ho *TestA301ResponseWriter) WriteHeader(code int) {
- ho.status = code
-}
-
-func Test301Redirect(t *testing.T) {
- m := make(http.Header)
-
- func1 := func(w http.ResponseWriter, r *http.Request) {}
- func2 := func(w http.ResponseWriter, r *http.Request) {}
-
- r := NewRouter()
- r.HandleFunc("/api/", func2).Name("func2")
- r.HandleFunc("/", func1).Name("func1")
-
- req, _ := http.NewRequest("GET", "http://localhost//api/?abc=def", nil)
-
- res := TestA301ResponseWriter{
- hh: m,
- status: 0,
- }
- r.ServeHTTP(&res, req)
-
- if "http://localhost/api/?abc=def" != res.hh["Location"][0] {
- t.Errorf("Should have complete URL with query string")
- }
-}
-
-func TestSkipClean(t *testing.T) {
- func1 := func(w http.ResponseWriter, r *http.Request) {}
- func2 := func(w http.ResponseWriter, r *http.Request) {}
-
- r := NewRouter()
- r.SkipClean(true)
- r.HandleFunc("/api/", func2).Name("func2")
- r.HandleFunc("/", func1).Name("func1")
-
- req, _ := http.NewRequest("GET", "http://localhost//api/?abc=def", nil)
- res := NewRecorder()
- r.ServeHTTP(res, req)
-
- if len(res.HeaderMap["Location"]) != 0 {
- t.Errorf("Shouldn't redirect since skip clean is disabled")
- }
-}
-
-// https://plus.google.com/101022900381697718949/posts/eWy6DjFJ6uW
-func TestSubrouterHeader(t *testing.T) {
- expected := "func1 response"
- func1 := func(w http.ResponseWriter, r *http.Request) {
- fmt.Fprint(w, expected)
- }
- func2 := func(http.ResponseWriter, *http.Request) {}
-
- r := NewRouter()
- s := r.Headers("SomeSpecialHeader", "").Subrouter()
- s.HandleFunc("/", func1).Name("func1")
- r.HandleFunc("/", func2).Name("func2")
-
- req, _ := http.NewRequest("GET", "http://localhost/", nil)
- req.Header.Add("SomeSpecialHeader", "foo")
- match := new(RouteMatch)
- matched := r.Match(req, match)
- if !matched {
- t.Errorf("Should match request")
- }
- if match.Route.GetName() != "func1" {
- t.Errorf("Expecting func1 handler, got %s", match.Route.GetName())
- }
- resp := NewRecorder()
- match.Handler.ServeHTTP(resp, req)
- if resp.Body.String() != expected {
- t.Errorf("Expecting %q", expected)
- }
-}
-
-func TestNoMatchMethodErrorHandler(t *testing.T) {
- func1 := func(w http.ResponseWriter, r *http.Request) {}
-
- r := NewRouter()
- r.HandleFunc("/", func1).Methods("GET", "POST")
-
- req, _ := http.NewRequest("PUT", "http://localhost/", nil)
- match := new(RouteMatch)
- matched := r.Match(req, match)
-
- if matched {
- t.Error("Should not have matched route for methods")
- }
-
- if match.MatchErr != ErrMethodMismatch {
- t.Error("Should get ErrMethodMismatch error")
- }
-
- resp := NewRecorder()
- r.ServeHTTP(resp, req)
- if resp.Code != 405 {
- t.Errorf("Expecting code %v", 405)
- }
-
- // Add matching route
- r.HandleFunc("/", func1).Methods("PUT")
-
- match = new(RouteMatch)
- matched = r.Match(req, match)
-
- if !matched {
- t.Error("Should have matched route for methods")
- }
-
- if match.MatchErr != nil {
- t.Error("Should not have any matching error. Found:", match.MatchErr)
- }
-}
-
-func TestErrMatchNotFound(t *testing.T) {
- emptyHandler := func(w http.ResponseWriter, r *http.Request) {}
-
- r := NewRouter()
- r.HandleFunc("/", emptyHandler)
- s := r.PathPrefix("/sub/").Subrouter()
- s.HandleFunc("/", emptyHandler)
-
- // Regular 404 not found
- req, _ := http.NewRequest("GET", "/sub/whatever", nil)
- match := new(RouteMatch)
- matched := r.Match(req, match)
-
- if matched {
- t.Errorf("Subrouter should not have matched that, got %v", match.Route)
- }
- // Even without a custom handler, MatchErr is set to ErrNotFound
- if match.MatchErr != ErrNotFound {
- t.Errorf("Expected ErrNotFound MatchErr, but was %v", match.MatchErr)
- }
-
- // Now lets add a 404 handler to subrouter
- s.NotFoundHandler = http.NotFoundHandler()
- req, _ = http.NewRequest("GET", "/sub/whatever", nil)
-
- // Test the subrouter first
- match = new(RouteMatch)
- matched = s.Match(req, match)
- // Now we should get a match
- if !matched {
- t.Errorf("Subrouter should have matched %s", req.RequestURI)
- }
- // But MatchErr should be set to ErrNotFound anyway
- if match.MatchErr != ErrNotFound {
- t.Errorf("Expected ErrNotFound MatchErr, but was %v", match.MatchErr)
- }
-
- // Now test the parent (MatchErr should propagate)
- match = new(RouteMatch)
- matched = r.Match(req, match)
-
- // Now we should get a match
- if !matched {
- t.Errorf("Router should have matched %s via subrouter", req.RequestURI)
- }
- // But MatchErr should be set to ErrNotFound anyway
- if match.MatchErr != ErrNotFound {
- t.Errorf("Expected ErrNotFound MatchErr, but was %v", match.MatchErr)
- }
-}
-
-// methodsSubrouterTest models the data necessary for testing handler
-// matching for subrouters created after HTTP methods matcher registration.
-type methodsSubrouterTest struct {
- title string
- wantCode int
- router *Router
- // method is the input into the request and expected response
- method string
- // input request path
- path string
- // redirectTo is the expected location path for strict-slash matches
- redirectTo string
-}
-
-// methodHandler writes the method string in response.
-func methodHandler(method string) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte(method))
- }
-}
-
-// TestMethodsSubrouterCatchall matches handlers for subrouters where a
-// catchall handler is set for a mis-matching method.
-func TestMethodsSubrouterCatchall(t *testing.T) {
- t.Parallel()
-
- router := NewRouter()
- router.Methods("PATCH").Subrouter().PathPrefix("/").HandlerFunc(methodHandler("PUT"))
- router.Methods("GET").Subrouter().HandleFunc("/foo", methodHandler("GET"))
- router.Methods("POST").Subrouter().HandleFunc("/foo", methodHandler("POST"))
- router.Methods("DELETE").Subrouter().HandleFunc("/foo", methodHandler("DELETE"))
-
- tests := []methodsSubrouterTest{
- {
- title: "match GET handler",
- router: router,
- path: "http://localhost/foo",
- method: "GET",
- wantCode: http.StatusOK,
- },
- {
- title: "match POST handler",
- router: router,
- method: "POST",
- path: "http://localhost/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "match DELETE handler",
- router: router,
- method: "DELETE",
- path: "http://localhost/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "disallow PUT method",
- router: router,
- method: "PUT",
- path: "http://localhost/foo",
- wantCode: http.StatusMethodNotAllowed,
- },
- }
-
- for _, test := range tests {
- testMethodsSubrouter(t, test)
- }
-}
-
-// TestMethodsSubrouterStrictSlash matches handlers on subrouters with
-// strict-slash matchers.
-func TestMethodsSubrouterStrictSlash(t *testing.T) {
- t.Parallel()
-
- router := NewRouter()
- sub := router.PathPrefix("/").Subrouter()
- sub.StrictSlash(true).Path("/foo").Methods("GET").Subrouter().HandleFunc("", methodHandler("GET"))
- sub.StrictSlash(true).Path("/foo/").Methods("PUT").Subrouter().HandleFunc("/", methodHandler("PUT"))
- sub.StrictSlash(true).Path("/foo/").Methods("POST").Subrouter().HandleFunc("/", methodHandler("POST"))
-
- tests := []methodsSubrouterTest{
- {
- title: "match POST handler",
- router: router,
- method: "POST",
- path: "http://localhost/foo/",
- wantCode: http.StatusOK,
- },
- {
- title: "match GET handler",
- router: router,
- method: "GET",
- path: "http://localhost/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "match POST handler, redirect strict-slash",
- router: router,
- method: "POST",
- path: "http://localhost/foo",
- redirectTo: "http://localhost/foo/",
- wantCode: http.StatusMovedPermanently,
- },
- {
- title: "match GET handler, redirect strict-slash",
- router: router,
- method: "GET",
- path: "http://localhost/foo/",
- redirectTo: "http://localhost/foo",
- wantCode: http.StatusMovedPermanently,
- },
- {
- title: "disallow DELETE method",
- router: router,
- method: "DELETE",
- path: "http://localhost/foo",
- wantCode: http.StatusMethodNotAllowed,
- },
- }
-
- for _, test := range tests {
- testMethodsSubrouter(t, test)
- }
-}
-
-// TestMethodsSubrouterPathPrefix matches handlers on subrouters created
-// on a router with a path prefix matcher and method matcher.
-func TestMethodsSubrouterPathPrefix(t *testing.T) {
- t.Parallel()
-
- router := NewRouter()
- router.PathPrefix("/1").Methods("POST").Subrouter().HandleFunc("/2", methodHandler("POST"))
- router.PathPrefix("/1").Methods("DELETE").Subrouter().HandleFunc("/2", methodHandler("DELETE"))
- router.PathPrefix("/1").Methods("PUT").Subrouter().HandleFunc("/2", methodHandler("PUT"))
- router.PathPrefix("/1").Methods("POST").Subrouter().HandleFunc("/2", methodHandler("POST2"))
-
- tests := []methodsSubrouterTest{
- {
- title: "match first POST handler",
- router: router,
- method: "POST",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "match DELETE handler",
- router: router,
- method: "DELETE",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "match PUT handler",
- router: router,
- method: "PUT",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "disallow PATCH method",
- router: router,
- method: "PATCH",
- path: "http://localhost/1/2",
- wantCode: http.StatusMethodNotAllowed,
- },
- }
-
- for _, test := range tests {
- testMethodsSubrouter(t, test)
- }
-}
-
-// TestMethodsSubrouterSubrouter matches handlers on subrouters produced
-// from method matchers registered on a root subrouter.
-func TestMethodsSubrouterSubrouter(t *testing.T) {
- t.Parallel()
-
- router := NewRouter()
- sub := router.PathPrefix("/1").Subrouter()
- sub.Methods("POST").Subrouter().HandleFunc("/2", methodHandler("POST"))
- sub.Methods("GET").Subrouter().HandleFunc("/2", methodHandler("GET"))
- sub.Methods("PATCH").Subrouter().HandleFunc("/2", methodHandler("PATCH"))
- sub.HandleFunc("/2", methodHandler("PUT")).Subrouter().Methods("PUT")
- sub.HandleFunc("/2", methodHandler("POST2")).Subrouter().Methods("POST")
-
- tests := []methodsSubrouterTest{
- {
- title: "match first POST handler",
- router: router,
- method: "POST",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "match GET handler",
- router: router,
- method: "GET",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "match PATCH handler",
- router: router,
- method: "PATCH",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "match PUT handler",
- router: router,
- method: "PUT",
- path: "http://localhost/1/2",
- wantCode: http.StatusOK,
- },
- {
- title: "disallow DELETE method",
- router: router,
- method: "DELETE",
- path: "http://localhost/1/2",
- wantCode: http.StatusMethodNotAllowed,
- },
- }
-
- for _, test := range tests {
- testMethodsSubrouter(t, test)
- }
-}
-
-// TestMethodsSubrouterPathVariable matches handlers on matching paths
-// with path variables in them.
-func TestMethodsSubrouterPathVariable(t *testing.T) {
- t.Parallel()
-
- router := NewRouter()
- router.Methods("GET").Subrouter().HandleFunc("/foo", methodHandler("GET"))
- router.Methods("POST").Subrouter().HandleFunc("/{any}", methodHandler("POST"))
- router.Methods("DELETE").Subrouter().HandleFunc("/1/{any}", methodHandler("DELETE"))
- router.Methods("PUT").Subrouter().HandleFunc("/1/{any}", methodHandler("PUT"))
-
- tests := []methodsSubrouterTest{
- {
- title: "match GET handler",
- router: router,
- method: "GET",
- path: "http://localhost/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "match POST handler",
- router: router,
- method: "POST",
- path: "http://localhost/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "match DELETE handler",
- router: router,
- method: "DELETE",
- path: "http://localhost/1/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "match PUT handler",
- router: router,
- method: "PUT",
- path: "http://localhost/1/foo",
- wantCode: http.StatusOK,
- },
- {
- title: "disallow PATCH method",
- router: router,
- method: "PATCH",
- path: "http://localhost/1/foo",
- wantCode: http.StatusMethodNotAllowed,
- },
- }
-
- for _, test := range tests {
- testMethodsSubrouter(t, test)
- }
-}
-
-func ExampleSetURLVars() {
- req, _ := http.NewRequest("GET", "/foo", nil)
- req = SetURLVars(req, map[string]string{"foo": "bar"})
-
- fmt.Println(Vars(req)["foo"])
-
- // Output: bar
-}
-
-// testMethodsSubrouter runs an individual methodsSubrouterTest.
-func testMethodsSubrouter(t *testing.T, test methodsSubrouterTest) {
- // Execute request
- req, _ := http.NewRequest(test.method, test.path, nil)
- resp := NewRecorder()
- test.router.ServeHTTP(resp, req)
-
- switch test.wantCode {
- case http.StatusMethodNotAllowed:
- if resp.Code != http.StatusMethodNotAllowed {
- t.Errorf(`(%s) Expected "405 Method Not Allowed", but got %d code`, test.title, resp.Code)
- } else if matchedMethod := resp.Body.String(); matchedMethod != "" {
- t.Errorf(`(%s) Expected "405 Method Not Allowed", but %q handler was called`, test.title, matchedMethod)
- }
-
- case http.StatusMovedPermanently:
- if gotLocation := resp.HeaderMap.Get("Location"); gotLocation != test.redirectTo {
- t.Errorf("(%s) Expected %q route-match to redirect to %q, but got %q", test.title, test.method, test.redirectTo, gotLocation)
- }
-
- case http.StatusOK:
- if matchedMethod := resp.Body.String(); matchedMethod != test.method {
- t.Errorf("(%s) Expected %q handler to be called, but %q handler was called", test.title, test.method, matchedMethod)
- }
-
- default:
- expectedCodes := []int{http.StatusMethodNotAllowed, http.StatusMovedPermanently, http.StatusOK}
- t.Errorf("(%s) Expected wantCode to be one of: %v, but got %d", test.title, expectedCodes, test.wantCode)
- }
-}
-
-// mapToPairs converts a string map to a slice of string pairs
-func mapToPairs(m map[string]string) []string {
- var i int
- p := make([]string, len(m)*2)
- for k, v := range m {
- p[i] = k
- p[i+1] = v
- i += 2
- }
- return p
-}
-
-// stringMapEqual checks the equality of two string maps
-func stringMapEqual(m1, m2 map[string]string) bool {
- nil1 := m1 == nil
- nil2 := m2 == nil
- if nil1 != nil2 || len(m1) != len(m2) {
- return false
- }
- for k, v := range m1 {
- if v != m2[k] {
- return false
- }
- }
- return true
-}
-
-// stringHandler returns a handler func that writes a message 's' to the
-// http.ResponseWriter.
-func stringHandler(s string) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte(s))
- }
-}
-
-// newRequest is a helper function to create a new request with a method and url.
-// The request returned is a 'server' request as opposed to a 'client' one through
-// simulated write onto the wire and read off of the wire.
-// The differences between requests are detailed in the net/http package.
-func newRequest(method, url string) *http.Request {
- req, err := http.NewRequest(method, url, nil)
- if err != nil {
- panic(err)
- }
- // extract the escaped original host+path from url
- // http://localhost/path/here?v=1#frag -> //localhost/path/here
- opaque := ""
- if i := len(req.URL.Scheme); i > 0 {
- opaque = url[i+1:]
- }
-
- if i := strings.LastIndex(opaque, "?"); i > -1 {
- opaque = opaque[:i]
- }
- if i := strings.LastIndex(opaque, "#"); i > -1 {
- opaque = opaque[:i]
- }
-
- // Escaped host+path workaround as detailed in https://golang.org/pkg/net/url/#URL
- // for < 1.5 client side workaround
- req.URL.Opaque = opaque
-
- // Simulate writing to wire
- var buff bytes.Buffer
- req.Write(&buff)
- ioreader := bufio.NewReader(&buff)
-
- // Parse request off of 'wire'
- req, err = http.ReadRequest(ioreader)
- if err != nil {
- panic(err)
- }
- return req
-}
diff --git a/vendor/github.com/gorilla/mux/old_test.go b/vendor/github.com/gorilla/mux/old_test.go
deleted file mode 100644
index b228983c..00000000
--- a/vendor/github.com/gorilla/mux/old_test.go
+++ /dev/null
@@ -1,704 +0,0 @@
-// Old tests ported to Go1. This is a mess. Want to drop it one day.
-
-// Copyright 2011 Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import (
- "bytes"
- "net/http"
- "testing"
-)
-
-// ----------------------------------------------------------------------------
-// ResponseRecorder
-// ----------------------------------------------------------------------------
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// ResponseRecorder is an implementation of http.ResponseWriter that
-// records its mutations for later inspection in tests.
-type ResponseRecorder struct {
- Code int // the HTTP response code from WriteHeader
- HeaderMap http.Header // the HTTP response headers
- Body *bytes.Buffer // if non-nil, the bytes.Buffer to append written data to
- Flushed bool
-}
-
-// NewRecorder returns an initialized ResponseRecorder.
-func NewRecorder() *ResponseRecorder {
- return &ResponseRecorder{
- HeaderMap: make(http.Header),
- Body: new(bytes.Buffer),
- }
-}
-
-// Header returns the response headers.
-func (rw *ResponseRecorder) Header() http.Header {
- return rw.HeaderMap
-}
-
-// Write always succeeds and writes to rw.Body, if not nil.
-func (rw *ResponseRecorder) Write(buf []byte) (int, error) {
- if rw.Body != nil {
- rw.Body.Write(buf)
- }
- if rw.Code == 0 {
- rw.Code = http.StatusOK
- }
- return len(buf), nil
-}
-
-// WriteHeader sets rw.Code.
-func (rw *ResponseRecorder) WriteHeader(code int) {
- rw.Code = code
-}
-
-// Flush sets rw.Flushed to true.
-func (rw *ResponseRecorder) Flush() {
- rw.Flushed = true
-}
-
-// ----------------------------------------------------------------------------
-
-func TestRouteMatchers(t *testing.T) {
- var scheme, host, path, query, method string
- var headers map[string]string
- var resultVars map[bool]map[string]string
-
- router := NewRouter()
- router.NewRoute().Host("{var1}.google.com").
- Path("/{var2:[a-z]+}/{var3:[0-9]+}").
- Queries("foo", "bar").
- Methods("GET").
- Schemes("https").
- Headers("x-requested-with", "XMLHttpRequest")
- router.NewRoute().Host("www.{var4}.com").
- PathPrefix("/foo/{var5:[a-z]+}/{var6:[0-9]+}").
- Queries("baz", "ding").
- Methods("POST").
- Schemes("http").
- Headers("Content-Type", "application/json")
-
- reset := func() {
- // Everything match.
- scheme = "https"
- host = "www.google.com"
- path = "/product/42"
- query = "?foo=bar"
- method = "GET"
- headers = map[string]string{"X-Requested-With": "XMLHttpRequest"}
- resultVars = map[bool]map[string]string{
- true: {"var1": "www", "var2": "product", "var3": "42"},
- false: {},
- }
- }
-
- reset2 := func() {
- // Everything match.
- scheme = "http"
- host = "www.google.com"
- path = "/foo/product/42/path/that/is/ignored"
- query = "?baz=ding"
- method = "POST"
- headers = map[string]string{"Content-Type": "application/json"}
- resultVars = map[bool]map[string]string{
- true: {"var4": "google", "var5": "product", "var6": "42"},
- false: {},
- }
- }
-
- match := func(shouldMatch bool) {
- url := scheme + "://" + host + path + query
- request, _ := http.NewRequest(method, url, nil)
- for key, value := range headers {
- request.Header.Add(key, value)
- }
-
- var routeMatch RouteMatch
- matched := router.Match(request, &routeMatch)
- if matched != shouldMatch {
- t.Errorf("Expected: %v\nGot: %v\nRequest: %v %v", shouldMatch, matched, request.Method, url)
- }
-
- if matched {
- currentRoute := routeMatch.Route
- if currentRoute == nil {
- t.Errorf("Expected a current route.")
- }
- vars := routeMatch.Vars
- expectedVars := resultVars[shouldMatch]
- if len(vars) != len(expectedVars) {
- t.Errorf("Expected vars: %v Got: %v.", expectedVars, vars)
- }
- for name, value := range vars {
- if expectedVars[name] != value {
- t.Errorf("Expected vars: %v Got: %v.", expectedVars, vars)
- }
- }
- }
- }
-
- // 1st route --------------------------------------------------------------
-
- // Everything match.
- reset()
- match(true)
-
- // Scheme doesn't match.
- reset()
- scheme = "http"
- match(false)
-
- // Host doesn't match.
- reset()
- host = "www.mygoogle.com"
- match(false)
-
- // Path doesn't match.
- reset()
- path = "/product/notdigits"
- match(false)
-
- // Query doesn't match.
- reset()
- query = "?foo=baz"
- match(false)
-
- // Method doesn't match.
- reset()
- method = "POST"
- match(false)
-
- // Header doesn't match.
- reset()
- headers = map[string]string{}
- match(false)
-
- // Everything match, again.
- reset()
- match(true)
-
- // 2nd route --------------------------------------------------------------
- // Everything match.
- reset2()
- match(true)
-
- // Scheme doesn't match.
- reset2()
- scheme = "https"
- match(false)
-
- // Host doesn't match.
- reset2()
- host = "sub.google.com"
- match(false)
-
- // Path doesn't match.
- reset2()
- path = "/bar/product/42"
- match(false)
-
- // Query doesn't match.
- reset2()
- query = "?foo=baz"
- match(false)
-
- // Method doesn't match.
- reset2()
- method = "GET"
- match(false)
-
- // Header doesn't match.
- reset2()
- headers = map[string]string{}
- match(false)
-
- // Everything match, again.
- reset2()
- match(true)
-}
-
-type headerMatcherTest struct {
- matcher headerMatcher
- headers map[string]string
- result bool
-}
-
-var headerMatcherTests = []headerMatcherTest{
- {
- matcher: headerMatcher(map[string]string{"x-requested-with": "XMLHttpRequest"}),
- headers: map[string]string{"X-Requested-With": "XMLHttpRequest"},
- result: true,
- },
- {
- matcher: headerMatcher(map[string]string{"x-requested-with": ""}),
- headers: map[string]string{"X-Requested-With": "anything"},
- result: true,
- },
- {
- matcher: headerMatcher(map[string]string{"x-requested-with": "XMLHttpRequest"}),
- headers: map[string]string{},
- result: false,
- },
-}
-
-type hostMatcherTest struct {
- matcher *Route
- url string
- vars map[string]string
- result bool
-}
-
-var hostMatcherTests = []hostMatcherTest{
- {
- matcher: NewRouter().NewRoute().Host("{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}"),
- url: "http://abc.def.ghi/",
- vars: map[string]string{"foo": "abc", "bar": "def", "baz": "ghi"},
- result: true,
- },
- {
- matcher: NewRouter().NewRoute().Host("{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}"),
- url: "http://a.b.c/",
- vars: map[string]string{"foo": "abc", "bar": "def", "baz": "ghi"},
- result: false,
- },
-}
-
-type methodMatcherTest struct {
- matcher methodMatcher
- method string
- result bool
-}
-
-var methodMatcherTests = []methodMatcherTest{
- {
- matcher: methodMatcher([]string{"GET", "POST", "PUT"}),
- method: "GET",
- result: true,
- },
- {
- matcher: methodMatcher([]string{"GET", "POST", "PUT"}),
- method: "POST",
- result: true,
- },
- {
- matcher: methodMatcher([]string{"GET", "POST", "PUT"}),
- method: "PUT",
- result: true,
- },
- {
- matcher: methodMatcher([]string{"GET", "POST", "PUT"}),
- method: "DELETE",
- result: false,
- },
-}
-
-type pathMatcherTest struct {
- matcher *Route
- url string
- vars map[string]string
- result bool
-}
-
-var pathMatcherTests = []pathMatcherTest{
- {
- matcher: NewRouter().NewRoute().Path("/{foo:[0-9][0-9][0-9]}/{bar:[0-9][0-9][0-9]}/{baz:[0-9][0-9][0-9]}"),
- url: "http://localhost:8080/123/456/789",
- vars: map[string]string{"foo": "123", "bar": "456", "baz": "789"},
- result: true,
- },
- {
- matcher: NewRouter().NewRoute().Path("/{foo:[0-9][0-9][0-9]}/{bar:[0-9][0-9][0-9]}/{baz:[0-9][0-9][0-9]}"),
- url: "http://localhost:8080/1/2/3",
- vars: map[string]string{"foo": "123", "bar": "456", "baz": "789"},
- result: false,
- },
-}
-
-type schemeMatcherTest struct {
- matcher schemeMatcher
- url string
- result bool
-}
-
-var schemeMatcherTests = []schemeMatcherTest{
- {
- matcher: schemeMatcher([]string{"http", "https"}),
- url: "http://localhost:8080/",
- result: true,
- },
- {
- matcher: schemeMatcher([]string{"http", "https"}),
- url: "https://localhost:8080/",
- result: true,
- },
- {
- matcher: schemeMatcher([]string{"https"}),
- url: "http://localhost:8080/",
- result: false,
- },
- {
- matcher: schemeMatcher([]string{"http"}),
- url: "https://localhost:8080/",
- result: false,
- },
-}
-
-type urlBuildingTest struct {
- route *Route
- vars []string
- url string
-}
-
-var urlBuildingTests = []urlBuildingTest{
- {
- route: new(Route).Host("foo.domain.com"),
- vars: []string{},
- url: "http://foo.domain.com",
- },
- {
- route: new(Route).Host("{subdomain}.domain.com"),
- vars: []string{"subdomain", "bar"},
- url: "http://bar.domain.com",
- },
- {
- route: new(Route).Host("foo.domain.com").Path("/articles"),
- vars: []string{},
- url: "http://foo.domain.com/articles",
- },
- {
- route: new(Route).Path("/articles"),
- vars: []string{},
- url: "/articles",
- },
- {
- route: new(Route).Path("/articles/{category}/{id:[0-9]+}"),
- vars: []string{"category", "technology", "id", "42"},
- url: "/articles/technology/42",
- },
- {
- route: new(Route).Host("{subdomain}.domain.com").Path("/articles/{category}/{id:[0-9]+}"),
- vars: []string{"subdomain", "foo", "category", "technology", "id", "42"},
- url: "http://foo.domain.com/articles/technology/42",
- },
-}
-
-func TestHeaderMatcher(t *testing.T) {
- for _, v := range headerMatcherTests {
- request, _ := http.NewRequest("GET", "http://localhost:8080/", nil)
- for key, value := range v.headers {
- request.Header.Add(key, value)
- }
- var routeMatch RouteMatch
- result := v.matcher.Match(request, &routeMatch)
- if result != v.result {
- if v.result {
- t.Errorf("%#v: should match %v.", v.matcher, request.Header)
- } else {
- t.Errorf("%#v: should not match %v.", v.matcher, request.Header)
- }
- }
- }
-}
-
-func TestHostMatcher(t *testing.T) {
- for _, v := range hostMatcherTests {
- request, _ := http.NewRequest("GET", v.url, nil)
- var routeMatch RouteMatch
- result := v.matcher.Match(request, &routeMatch)
- vars := routeMatch.Vars
- if result != v.result {
- if v.result {
- t.Errorf("%#v: should match %v.", v.matcher, v.url)
- } else {
- t.Errorf("%#v: should not match %v.", v.matcher, v.url)
- }
- }
- if result {
- if len(vars) != len(v.vars) {
- t.Errorf("%#v: vars length should be %v, got %v.", v.matcher, len(v.vars), len(vars))
- }
- for name, value := range vars {
- if v.vars[name] != value {
- t.Errorf("%#v: expected value %v for key %v, got %v.", v.matcher, v.vars[name], name, value)
- }
- }
- } else {
- if len(vars) != 0 {
- t.Errorf("%#v: vars length should be 0, got %v.", v.matcher, len(vars))
- }
- }
- }
-}
-
-func TestMethodMatcher(t *testing.T) {
- for _, v := range methodMatcherTests {
- request, _ := http.NewRequest(v.method, "http://localhost:8080/", nil)
- var routeMatch RouteMatch
- result := v.matcher.Match(request, &routeMatch)
- if result != v.result {
- if v.result {
- t.Errorf("%#v: should match %v.", v.matcher, v.method)
- } else {
- t.Errorf("%#v: should not match %v.", v.matcher, v.method)
- }
- }
- }
-}
-
-func TestPathMatcher(t *testing.T) {
- for _, v := range pathMatcherTests {
- request, _ := http.NewRequest("GET", v.url, nil)
- var routeMatch RouteMatch
- result := v.matcher.Match(request, &routeMatch)
- vars := routeMatch.Vars
- if result != v.result {
- if v.result {
- t.Errorf("%#v: should match %v.", v.matcher, v.url)
- } else {
- t.Errorf("%#v: should not match %v.", v.matcher, v.url)
- }
- }
- if result {
- if len(vars) != len(v.vars) {
- t.Errorf("%#v: vars length should be %v, got %v.", v.matcher, len(v.vars), len(vars))
- }
- for name, value := range vars {
- if v.vars[name] != value {
- t.Errorf("%#v: expected value %v for key %v, got %v.", v.matcher, v.vars[name], name, value)
- }
- }
- } else {
- if len(vars) != 0 {
- t.Errorf("%#v: vars length should be 0, got %v.", v.matcher, len(vars))
- }
- }
- }
-}
-
-func TestSchemeMatcher(t *testing.T) {
- for _, v := range schemeMatcherTests {
- request, _ := http.NewRequest("GET", v.url, nil)
- var routeMatch RouteMatch
- result := v.matcher.Match(request, &routeMatch)
- if result != v.result {
- if v.result {
- t.Errorf("%#v: should match %v.", v.matcher, v.url)
- } else {
- t.Errorf("%#v: should not match %v.", v.matcher, v.url)
- }
- }
- }
-}
-
-func TestUrlBuilding(t *testing.T) {
-
- for _, v := range urlBuildingTests {
- u, _ := v.route.URL(v.vars...)
- url := u.String()
- if url != v.url {
- t.Errorf("expected %v, got %v", v.url, url)
- /*
- reversePath := ""
- reverseHost := ""
- if v.route.pathTemplate != nil {
- reversePath = v.route.pathTemplate.Reverse
- }
- if v.route.hostTemplate != nil {
- reverseHost = v.route.hostTemplate.Reverse
- }
-
- t.Errorf("%#v:\nexpected: %q\ngot: %q\nreverse path: %q\nreverse host: %q", v.route, v.url, url, reversePath, reverseHost)
- */
- }
- }
-
- ArticleHandler := func(w http.ResponseWriter, r *http.Request) {
- }
-
- router := NewRouter()
- router.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler).Name("article")
-
- url, _ := router.Get("article").URL("category", "technology", "id", "42")
- expected := "/articles/technology/42"
- if url.String() != expected {
- t.Errorf("Expected %v, got %v", expected, url.String())
- }
-}
-
-func TestMatchedRouteName(t *testing.T) {
- routeName := "stock"
- router := NewRouter()
- route := router.NewRoute().Path("/products/").Name(routeName)
-
- url := "http://www.example.com/products/"
- request, _ := http.NewRequest("GET", url, nil)
- var rv RouteMatch
- ok := router.Match(request, &rv)
-
- if !ok || rv.Route != route {
- t.Errorf("Expected same route, got %+v.", rv.Route)
- }
-
- retName := rv.Route.GetName()
- if retName != routeName {
- t.Errorf("Expected %q, got %q.", routeName, retName)
- }
-}
-
-func TestSubRouting(t *testing.T) {
- // Example from docs.
- router := NewRouter()
- subrouter := router.NewRoute().Host("www.example.com").Subrouter()
- route := subrouter.NewRoute().Path("/products/").Name("products")
-
- url := "http://www.example.com/products/"
- request, _ := http.NewRequest("GET", url, nil)
- var rv RouteMatch
- ok := router.Match(request, &rv)
-
- if !ok || rv.Route != route {
- t.Errorf("Expected same route, got %+v.", rv.Route)
- }
-
- u, _ := router.Get("products").URL()
- builtURL := u.String()
- // Yay, subroute aware of the domain when building!
- if builtURL != url {
- t.Errorf("Expected %q, got %q.", url, builtURL)
- }
-}
-
-func TestVariableNames(t *testing.T) {
- route := new(Route).Host("{arg1}.domain.com").Path("/{arg1}/{arg2:[0-9]+}")
- if route.err == nil {
- t.Errorf("Expected error for duplicated variable names")
- }
-}
-
-func TestRedirectSlash(t *testing.T) {
- var route *Route
- var routeMatch RouteMatch
- r := NewRouter()
-
- r.StrictSlash(false)
- route = r.NewRoute()
- if route.strictSlash != false {
- t.Errorf("Expected false redirectSlash.")
- }
-
- r.StrictSlash(true)
- route = r.NewRoute()
- if route.strictSlash != true {
- t.Errorf("Expected true redirectSlash.")
- }
-
- route = new(Route)
- route.strictSlash = true
- route.Path("/{arg1}/{arg2:[0-9]+}/")
- request, _ := http.NewRequest("GET", "http://localhost/foo/123", nil)
- routeMatch = RouteMatch{}
- _ = route.Match(request, &routeMatch)
- vars := routeMatch.Vars
- if vars["arg1"] != "foo" {
- t.Errorf("Expected foo.")
- }
- if vars["arg2"] != "123" {
- t.Errorf("Expected 123.")
- }
- rsp := NewRecorder()
- routeMatch.Handler.ServeHTTP(rsp, request)
- if rsp.HeaderMap.Get("Location") != "http://localhost/foo/123/" {
- t.Errorf("Expected redirect header.")
- }
-
- route = new(Route)
- route.strictSlash = true
- route.Path("/{arg1}/{arg2:[0-9]+}")
- request, _ = http.NewRequest("GET", "http://localhost/foo/123/", nil)
- routeMatch = RouteMatch{}
- _ = route.Match(request, &routeMatch)
- vars = routeMatch.Vars
- if vars["arg1"] != "foo" {
- t.Errorf("Expected foo.")
- }
- if vars["arg2"] != "123" {
- t.Errorf("Expected 123.")
- }
- rsp = NewRecorder()
- routeMatch.Handler.ServeHTTP(rsp, request)
- if rsp.HeaderMap.Get("Location") != "http://localhost/foo/123" {
- t.Errorf("Expected redirect header.")
- }
-}
-
-// Test for the new regexp library, still not available in stable Go.
-func TestNewRegexp(t *testing.T) {
- var p *routeRegexp
- var matches []string
-
- tests := map[string]map[string][]string{
- "/{foo:a{2}}": {
- "/a": nil,
- "/aa": {"aa"},
- "/aaa": nil,
- "/aaaa": nil,
- },
- "/{foo:a{2,}}": {
- "/a": nil,
- "/aa": {"aa"},
- "/aaa": {"aaa"},
- "/aaaa": {"aaaa"},
- },
- "/{foo:a{2,3}}": {
- "/a": nil,
- "/aa": {"aa"},
- "/aaa": {"aaa"},
- "/aaaa": nil,
- },
- "/{foo:[a-z]{3}}/{bar:[a-z]{2}}": {
- "/a": nil,
- "/ab": nil,
- "/abc": nil,
- "/abcd": nil,
- "/abc/ab": {"abc", "ab"},
- "/abc/abc": nil,
- "/abcd/ab": nil,
- },
- `/{foo:\w{3,}}/{bar:\d{2,}}`: {
- "/a": nil,
- "/ab": nil,
- "/abc": nil,
- "/abc/1": nil,
- "/abc/12": {"abc", "12"},
- "/abcd/12": {"abcd", "12"},
- "/abcd/123": {"abcd", "123"},
- },
- }
-
- for pattern, paths := range tests {
- p, _ = newRouteRegexp(pattern, regexpTypePath, routeRegexpOptions{})
- for path, result := range paths {
- matches = p.regexp.FindStringSubmatch(path)
- if result == nil {
- if matches != nil {
- t.Errorf("%v should not match %v.", pattern, path)
- }
- } else {
- if len(matches) != len(result)+1 {
- t.Errorf("Expected %v matches, got %v.", len(result)+1, len(matches))
- } else {
- for k, v := range result {
- if matches[k+1] != v {
- t.Errorf("Expected %v, got %v.", v, matches[k+1])
- }
- }
- }
- }
- }
- }
-}
diff --git a/vendor/github.com/lib/pq/.travis.sh b/vendor/github.com/lib/pq/.travis.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/lib/pq/array_test.go b/vendor/github.com/lib/pq/array_test.go
deleted file mode 100644
index f724bcd8..00000000
--- a/vendor/github.com/lib/pq/array_test.go
+++ /dev/null
@@ -1,1311 +0,0 @@
-package pq
-
-import (
- "bytes"
- "database/sql"
- "database/sql/driver"
- "math/rand"
- "reflect"
- "strings"
- "testing"
-)
-
-func TestParseArray(t *testing.T) {
- for _, tt := range []struct {
- input string
- delim string
- dims []int
- elems [][]byte
- }{
- {`{}`, `,`, nil, [][]byte{}},
- {`{NULL}`, `,`, []int{1}, [][]byte{nil}},
- {`{a}`, `,`, []int{1}, [][]byte{{'a'}}},
- {`{a,b}`, `,`, []int{2}, [][]byte{{'a'}, {'b'}}},
- {`{{a,b}}`, `,`, []int{1, 2}, [][]byte{{'a'}, {'b'}}},
- {`{{a},{b}}`, `,`, []int{2, 1}, [][]byte{{'a'}, {'b'}}},
- {`{{{a,b},{c,d},{e,f}}}`, `,`, []int{1, 3, 2}, [][]byte{
- {'a'}, {'b'}, {'c'}, {'d'}, {'e'}, {'f'},
- }},
- {`{""}`, `,`, []int{1}, [][]byte{{}}},
- {`{","}`, `,`, []int{1}, [][]byte{{','}}},
- {`{",",","}`, `,`, []int{2}, [][]byte{{','}, {','}}},
- {`{{",",","}}`, `,`, []int{1, 2}, [][]byte{{','}, {','}}},
- {`{{","},{","}}`, `,`, []int{2, 1}, [][]byte{{','}, {','}}},
- {`{{{",",","},{",",","},{",",","}}}`, `,`, []int{1, 3, 2}, [][]byte{
- {','}, {','}, {','}, {','}, {','}, {','},
- }},
- {`{"\"}"}`, `,`, []int{1}, [][]byte{{'"', '}'}}},
- {`{"\"","\""}`, `,`, []int{2}, [][]byte{{'"'}, {'"'}}},
- {`{{"\"","\""}}`, `,`, []int{1, 2}, [][]byte{{'"'}, {'"'}}},
- {`{{"\""},{"\""}}`, `,`, []int{2, 1}, [][]byte{{'"'}, {'"'}}},
- {`{{{"\"","\""},{"\"","\""},{"\"","\""}}}`, `,`, []int{1, 3, 2}, [][]byte{
- {'"'}, {'"'}, {'"'}, {'"'}, {'"'}, {'"'},
- }},
- {`{axyzb}`, `xyz`, []int{2}, [][]byte{{'a'}, {'b'}}},
- } {
- dims, elems, err := parseArray([]byte(tt.input), []byte(tt.delim))
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %q", tt.input, err)
- }
- if !reflect.DeepEqual(dims, tt.dims) {
- t.Errorf("Expected %v dimensions for %q, got %v", tt.dims, tt.input, dims)
- }
- if !reflect.DeepEqual(elems, tt.elems) {
- t.Errorf("Expected %v elements for %q, got %v", tt.elems, tt.input, elems)
- }
- }
-}
-
-func TestParseArrayError(t *testing.T) {
- for _, tt := range []struct {
- input, err string
- }{
- {``, "expected '{' at offset 0"},
- {`x`, "expected '{' at offset 0"},
- {`}`, "expected '{' at offset 0"},
- {`{`, "expected '}' at offset 1"},
- {`{{}`, "expected '}' at offset 3"},
- {`{}}`, "unexpected '}' at offset 2"},
- {`{,}`, "unexpected ',' at offset 1"},
- {`{,x}`, "unexpected ',' at offset 1"},
- {`{x,}`, "unexpected '}' at offset 3"},
- {`{x,{`, "unexpected '{' at offset 3"},
- {`{x},`, "unexpected ',' at offset 3"},
- {`{x}}`, "unexpected '}' at offset 3"},
- {`{{x}`, "expected '}' at offset 4"},
- {`{""x}`, "unexpected 'x' at offset 3"},
- {`{{a},{b,c}}`, "multidimensional arrays must have elements with matching dimensions"},
- } {
- _, _, err := parseArray([]byte(tt.input), []byte{','})
-
- if err == nil {
- t.Fatalf("Expected error for %q, got none", tt.input)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for %q, got %q", tt.err, tt.input, err)
- }
- }
-}
-
-func TestArrayScanner(t *testing.T) {
- var s sql.Scanner = Array(&[]bool{})
- if _, ok := s.(*BoolArray); !ok {
- t.Errorf("Expected *BoolArray, got %T", s)
- }
-
- s = Array(&[]float64{})
- if _, ok := s.(*Float64Array); !ok {
- t.Errorf("Expected *Float64Array, got %T", s)
- }
-
- s = Array(&[]int64{})
- if _, ok := s.(*Int64Array); !ok {
- t.Errorf("Expected *Int64Array, got %T", s)
- }
-
- s = Array(&[]string{})
- if _, ok := s.(*StringArray); !ok {
- t.Errorf("Expected *StringArray, got %T", s)
- }
-
- for _, tt := range []interface{}{
- &[]sql.Scanner{},
- &[][]bool{},
- &[][]float64{},
- &[][]int64{},
- &[][]string{},
- } {
- s = Array(tt)
- if _, ok := s.(GenericArray); !ok {
- t.Errorf("Expected GenericArray for %T, got %T", tt, s)
- }
- }
-}
-
-func TestArrayValuer(t *testing.T) {
- var v driver.Valuer = Array([]bool{})
- if _, ok := v.(*BoolArray); !ok {
- t.Errorf("Expected *BoolArray, got %T", v)
- }
-
- v = Array([]float64{})
- if _, ok := v.(*Float64Array); !ok {
- t.Errorf("Expected *Float64Array, got %T", v)
- }
-
- v = Array([]int64{})
- if _, ok := v.(*Int64Array); !ok {
- t.Errorf("Expected *Int64Array, got %T", v)
- }
-
- v = Array([]string{})
- if _, ok := v.(*StringArray); !ok {
- t.Errorf("Expected *StringArray, got %T", v)
- }
-
- for _, tt := range []interface{}{
- nil,
- []driver.Value{},
- [][]bool{},
- [][]float64{},
- [][]int64{},
- [][]string{},
- } {
- v = Array(tt)
- if _, ok := v.(GenericArray); !ok {
- t.Errorf("Expected GenericArray for %T, got %T", tt, v)
- }
- }
-}
-
-func TestBoolArrayScanUnsupported(t *testing.T) {
- var arr BoolArray
- err := arr.Scan(1)
-
- if err == nil {
- t.Fatal("Expected error when scanning from int")
- }
- if !strings.Contains(err.Error(), "int to BoolArray") {
- t.Errorf("Expected type to be mentioned when scanning, got %q", err)
- }
-}
-
-func TestBoolArrayScanEmpty(t *testing.T) {
- var arr BoolArray
- err := arr.Scan(`{}`)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr == nil || len(arr) != 0 {
- t.Errorf("Expected empty, got %#v", arr)
- }
-}
-
-func TestBoolArrayScanNil(t *testing.T) {
- arr := BoolArray{true, true, true}
- err := arr.Scan(nil)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr != nil {
- t.Errorf("Expected nil, got %+v", arr)
- }
-}
-
-var BoolArrayStringTests = []struct {
- str string
- arr BoolArray
-}{
- {`{}`, BoolArray{}},
- {`{t}`, BoolArray{true}},
- {`{f,t}`, BoolArray{false, true}},
-}
-
-func TestBoolArrayScanBytes(t *testing.T) {
- for _, tt := range BoolArrayStringTests {
- bytes := []byte(tt.str)
- arr := BoolArray{true, true, true}
- err := arr.Scan(bytes)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", bytes, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, bytes, arr)
- }
- }
-}
-
-func BenchmarkBoolArrayScanBytes(b *testing.B) {
- var a BoolArray
- var x interface{} = []byte(`{t,f,t,f,t,f,t,f,t,f}`)
-
- for i := 0; i < b.N; i++ {
- a = BoolArray{}
- a.Scan(x)
- }
-}
-
-func TestBoolArrayScanString(t *testing.T) {
- for _, tt := range BoolArrayStringTests {
- arr := BoolArray{true, true, true}
- err := arr.Scan(tt.str)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", tt.str, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, tt.str, arr)
- }
- }
-}
-
-func TestBoolArrayScanError(t *testing.T) {
- for _, tt := range []struct {
- input, err string
- }{
- {``, "unable to parse array"},
- {`{`, "unable to parse array"},
- {`{{t},{f}}`, "cannot convert ARRAY[2][1] to BoolArray"},
- {`{NULL}`, `could not parse boolean array index 0: invalid boolean ""`},
- {`{a}`, `could not parse boolean array index 0: invalid boolean "a"`},
- {`{t,b}`, `could not parse boolean array index 1: invalid boolean "b"`},
- {`{t,f,cd}`, `could not parse boolean array index 2: invalid boolean "cd"`},
- } {
- arr := BoolArray{true, true, true}
- err := arr.Scan(tt.input)
-
- if err == nil {
- t.Fatalf("Expected error for %q, got none", tt.input)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for %q, got %q", tt.err, tt.input, err)
- }
- if !reflect.DeepEqual(arr, BoolArray{true, true, true}) {
- t.Errorf("Expected destination not to change for %q, got %+v", tt.input, arr)
- }
- }
-}
-
-func TestBoolArrayValue(t *testing.T) {
- result, err := BoolArray(nil).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for nil, got %v", err)
- }
- if result != nil {
- t.Errorf("Expected nil, got %q", result)
- }
-
- result, err = BoolArray([]bool{}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for empty, got %v", err)
- }
- if expected := `{}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected empty, got %q", result)
- }
-
- result, err = BoolArray([]bool{false, true, false}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if expected := `{f,t,f}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected %q, got %q", expected, result)
- }
-}
-
-func BenchmarkBoolArrayValue(b *testing.B) {
- rand.Seed(1)
- x := make([]bool, 10)
- for i := 0; i < len(x); i++ {
- x[i] = rand.Intn(2) == 0
- }
- a := BoolArray(x)
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func TestByteaArrayScanUnsupported(t *testing.T) {
- var arr ByteaArray
- err := arr.Scan(1)
-
- if err == nil {
- t.Fatal("Expected error when scanning from int")
- }
- if !strings.Contains(err.Error(), "int to ByteaArray") {
- t.Errorf("Expected type to be mentioned when scanning, got %q", err)
- }
-}
-
-func TestByteaArrayScanEmpty(t *testing.T) {
- var arr ByteaArray
- err := arr.Scan(`{}`)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr == nil || len(arr) != 0 {
- t.Errorf("Expected empty, got %#v", arr)
- }
-}
-
-func TestByteaArrayScanNil(t *testing.T) {
- arr := ByteaArray{{2}, {6}, {0, 0}}
- err := arr.Scan(nil)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr != nil {
- t.Errorf("Expected nil, got %+v", arr)
- }
-}
-
-var ByteaArrayStringTests = []struct {
- str string
- arr ByteaArray
-}{
- {`{}`, ByteaArray{}},
- {`{NULL}`, ByteaArray{nil}},
- {`{"\\xfeff"}`, ByteaArray{{'\xFE', '\xFF'}}},
- {`{"\\xdead","\\xbeef"}`, ByteaArray{{'\xDE', '\xAD'}, {'\xBE', '\xEF'}}},
-}
-
-func TestByteaArrayScanBytes(t *testing.T) {
- for _, tt := range ByteaArrayStringTests {
- bytes := []byte(tt.str)
- arr := ByteaArray{{2}, {6}, {0, 0}}
- err := arr.Scan(bytes)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", bytes, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, bytes, arr)
- }
- }
-}
-
-func BenchmarkByteaArrayScanBytes(b *testing.B) {
- var a ByteaArray
- var x interface{} = []byte(`{"\\xfe","\\xff","\\xdead","\\xbeef","\\xfe","\\xff","\\xdead","\\xbeef","\\xfe","\\xff"}`)
-
- for i := 0; i < b.N; i++ {
- a = ByteaArray{}
- a.Scan(x)
- }
-}
-
-func TestByteaArrayScanString(t *testing.T) {
- for _, tt := range ByteaArrayStringTests {
- arr := ByteaArray{{2}, {6}, {0, 0}}
- err := arr.Scan(tt.str)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", tt.str, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, tt.str, arr)
- }
- }
-}
-
-func TestByteaArrayScanError(t *testing.T) {
- for _, tt := range []struct {
- input, err string
- }{
- {``, "unable to parse array"},
- {`{`, "unable to parse array"},
- {`{{"\\xfeff"},{"\\xbeef"}}`, "cannot convert ARRAY[2][1] to ByteaArray"},
- {`{"\\abc"}`, "could not parse bytea array index 0: could not parse bytea value"},
- } {
- arr := ByteaArray{{2}, {6}, {0, 0}}
- err := arr.Scan(tt.input)
-
- if err == nil {
- t.Fatalf("Expected error for %q, got none", tt.input)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for %q, got %q", tt.err, tt.input, err)
- }
- if !reflect.DeepEqual(arr, ByteaArray{{2}, {6}, {0, 0}}) {
- t.Errorf("Expected destination not to change for %q, got %+v", tt.input, arr)
- }
- }
-}
-
-func TestByteaArrayValue(t *testing.T) {
- result, err := ByteaArray(nil).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for nil, got %v", err)
- }
- if result != nil {
- t.Errorf("Expected nil, got %q", result)
- }
-
- result, err = ByteaArray([][]byte{}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for empty, got %v", err)
- }
- if expected := `{}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected empty, got %q", result)
- }
-
- result, err = ByteaArray([][]byte{{'\xDE', '\xAD', '\xBE', '\xEF'}, {'\xFE', '\xFF'}, {}}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if expected := `{"\\xdeadbeef","\\xfeff","\\x"}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected %q, got %q", expected, result)
- }
-}
-
-func BenchmarkByteaArrayValue(b *testing.B) {
- rand.Seed(1)
- x := make([][]byte, 10)
- for i := 0; i < len(x); i++ {
- x[i] = make([]byte, len(x))
- for j := 0; j < len(x); j++ {
- x[i][j] = byte(rand.Int())
- }
- }
- a := ByteaArray(x)
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func TestFloat64ArrayScanUnsupported(t *testing.T) {
- var arr Float64Array
- err := arr.Scan(true)
-
- if err == nil {
- t.Fatal("Expected error when scanning from bool")
- }
- if !strings.Contains(err.Error(), "bool to Float64Array") {
- t.Errorf("Expected type to be mentioned when scanning, got %q", err)
- }
-}
-
-func TestFloat64ArrayScanEmpty(t *testing.T) {
- var arr Float64Array
- err := arr.Scan(`{}`)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr == nil || len(arr) != 0 {
- t.Errorf("Expected empty, got %#v", arr)
- }
-}
-
-func TestFloat64ArrayScanNil(t *testing.T) {
- arr := Float64Array{5, 5, 5}
- err := arr.Scan(nil)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr != nil {
- t.Errorf("Expected nil, got %+v", arr)
- }
-}
-
-var Float64ArrayStringTests = []struct {
- str string
- arr Float64Array
-}{
- {`{}`, Float64Array{}},
- {`{1.2}`, Float64Array{1.2}},
- {`{3.456,7.89}`, Float64Array{3.456, 7.89}},
- {`{3,1,2}`, Float64Array{3, 1, 2}},
-}
-
-func TestFloat64ArrayScanBytes(t *testing.T) {
- for _, tt := range Float64ArrayStringTests {
- bytes := []byte(tt.str)
- arr := Float64Array{5, 5, 5}
- err := arr.Scan(bytes)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", bytes, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, bytes, arr)
- }
- }
-}
-
-func BenchmarkFloat64ArrayScanBytes(b *testing.B) {
- var a Float64Array
- var x interface{} = []byte(`{1.2,3.4,5.6,7.8,9.01,2.34,5.67,8.90,1.234,5.678}`)
-
- for i := 0; i < b.N; i++ {
- a = Float64Array{}
- a.Scan(x)
- }
-}
-
-func TestFloat64ArrayScanString(t *testing.T) {
- for _, tt := range Float64ArrayStringTests {
- arr := Float64Array{5, 5, 5}
- err := arr.Scan(tt.str)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", tt.str, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, tt.str, arr)
- }
- }
-}
-
-func TestFloat64ArrayScanError(t *testing.T) {
- for _, tt := range []struct {
- input, err string
- }{
- {``, "unable to parse array"},
- {`{`, "unable to parse array"},
- {`{{5.6},{7.8}}`, "cannot convert ARRAY[2][1] to Float64Array"},
- {`{NULL}`, "parsing array element index 0:"},
- {`{a}`, "parsing array element index 0:"},
- {`{5.6,a}`, "parsing array element index 1:"},
- {`{5.6,7.8,a}`, "parsing array element index 2:"},
- } {
- arr := Float64Array{5, 5, 5}
- err := arr.Scan(tt.input)
-
- if err == nil {
- t.Fatalf("Expected error for %q, got none", tt.input)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for %q, got %q", tt.err, tt.input, err)
- }
- if !reflect.DeepEqual(arr, Float64Array{5, 5, 5}) {
- t.Errorf("Expected destination not to change for %q, got %+v", tt.input, arr)
- }
- }
-}
-
-func TestFloat64ArrayValue(t *testing.T) {
- result, err := Float64Array(nil).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for nil, got %v", err)
- }
- if result != nil {
- t.Errorf("Expected nil, got %q", result)
- }
-
- result, err = Float64Array([]float64{}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for empty, got %v", err)
- }
- if expected := `{}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected empty, got %q", result)
- }
-
- result, err = Float64Array([]float64{1.2, 3.4, 5.6}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if expected := `{1.2,3.4,5.6}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected %q, got %q", expected, result)
- }
-}
-
-func BenchmarkFloat64ArrayValue(b *testing.B) {
- rand.Seed(1)
- x := make([]float64, 10)
- for i := 0; i < len(x); i++ {
- x[i] = rand.NormFloat64()
- }
- a := Float64Array(x)
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func TestInt64ArrayScanUnsupported(t *testing.T) {
- var arr Int64Array
- err := arr.Scan(true)
-
- if err == nil {
- t.Fatal("Expected error when scanning from bool")
- }
- if !strings.Contains(err.Error(), "bool to Int64Array") {
- t.Errorf("Expected type to be mentioned when scanning, got %q", err)
- }
-}
-
-func TestInt64ArrayScanEmpty(t *testing.T) {
- var arr Int64Array
- err := arr.Scan(`{}`)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr == nil || len(arr) != 0 {
- t.Errorf("Expected empty, got %#v", arr)
- }
-}
-
-func TestInt64ArrayScanNil(t *testing.T) {
- arr := Int64Array{5, 5, 5}
- err := arr.Scan(nil)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr != nil {
- t.Errorf("Expected nil, got %+v", arr)
- }
-}
-
-var Int64ArrayStringTests = []struct {
- str string
- arr Int64Array
-}{
- {`{}`, Int64Array{}},
- {`{12}`, Int64Array{12}},
- {`{345,678}`, Int64Array{345, 678}},
-}
-
-func TestInt64ArrayScanBytes(t *testing.T) {
- for _, tt := range Int64ArrayStringTests {
- bytes := []byte(tt.str)
- arr := Int64Array{5, 5, 5}
- err := arr.Scan(bytes)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", bytes, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, bytes, arr)
- }
- }
-}
-
-func BenchmarkInt64ArrayScanBytes(b *testing.B) {
- var a Int64Array
- var x interface{} = []byte(`{1,2,3,4,5,6,7,8,9,0}`)
-
- for i := 0; i < b.N; i++ {
- a = Int64Array{}
- a.Scan(x)
- }
-}
-
-func TestInt64ArrayScanString(t *testing.T) {
- for _, tt := range Int64ArrayStringTests {
- arr := Int64Array{5, 5, 5}
- err := arr.Scan(tt.str)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", tt.str, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, tt.str, arr)
- }
- }
-}
-
-func TestInt64ArrayScanError(t *testing.T) {
- for _, tt := range []struct {
- input, err string
- }{
- {``, "unable to parse array"},
- {`{`, "unable to parse array"},
- {`{{5},{6}}`, "cannot convert ARRAY[2][1] to Int64Array"},
- {`{NULL}`, "parsing array element index 0:"},
- {`{a}`, "parsing array element index 0:"},
- {`{5,a}`, "parsing array element index 1:"},
- {`{5,6,a}`, "parsing array element index 2:"},
- } {
- arr := Int64Array{5, 5, 5}
- err := arr.Scan(tt.input)
-
- if err == nil {
- t.Fatalf("Expected error for %q, got none", tt.input)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for %q, got %q", tt.err, tt.input, err)
- }
- if !reflect.DeepEqual(arr, Int64Array{5, 5, 5}) {
- t.Errorf("Expected destination not to change for %q, got %+v", tt.input, arr)
- }
- }
-}
-
-func TestInt64ArrayValue(t *testing.T) {
- result, err := Int64Array(nil).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for nil, got %v", err)
- }
- if result != nil {
- t.Errorf("Expected nil, got %q", result)
- }
-
- result, err = Int64Array([]int64{}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for empty, got %v", err)
- }
- if expected := `{}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected empty, got %q", result)
- }
-
- result, err = Int64Array([]int64{1, 2, 3}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if expected := `{1,2,3}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected %q, got %q", expected, result)
- }
-}
-
-func BenchmarkInt64ArrayValue(b *testing.B) {
- rand.Seed(1)
- x := make([]int64, 10)
- for i := 0; i < len(x); i++ {
- x[i] = rand.Int63()
- }
- a := Int64Array(x)
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func TestStringArrayScanUnsupported(t *testing.T) {
- var arr StringArray
- err := arr.Scan(true)
-
- if err == nil {
- t.Fatal("Expected error when scanning from bool")
- }
- if !strings.Contains(err.Error(), "bool to StringArray") {
- t.Errorf("Expected type to be mentioned when scanning, got %q", err)
- }
-}
-
-func TestStringArrayScanEmpty(t *testing.T) {
- var arr StringArray
- err := arr.Scan(`{}`)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr == nil || len(arr) != 0 {
- t.Errorf("Expected empty, got %#v", arr)
- }
-}
-
-func TestStringArrayScanNil(t *testing.T) {
- arr := StringArray{"x", "x", "x"}
- err := arr.Scan(nil)
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if arr != nil {
- t.Errorf("Expected nil, got %+v", arr)
- }
-}
-
-var StringArrayStringTests = []struct {
- str string
- arr StringArray
-}{
- {`{}`, StringArray{}},
- {`{t}`, StringArray{"t"}},
- {`{f,1}`, StringArray{"f", "1"}},
- {`{"a\\b","c d",","}`, StringArray{"a\\b", "c d", ","}},
-}
-
-func TestStringArrayScanBytes(t *testing.T) {
- for _, tt := range StringArrayStringTests {
- bytes := []byte(tt.str)
- arr := StringArray{"x", "x", "x"}
- err := arr.Scan(bytes)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", bytes, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, bytes, arr)
- }
- }
-}
-
-func BenchmarkStringArrayScanBytes(b *testing.B) {
- var a StringArray
- var x interface{} = []byte(`{a,b,c,d,e,f,g,h,i,j}`)
- var y interface{} = []byte(`{"\a","\b","\c","\d","\e","\f","\g","\h","\i","\j"}`)
-
- for i := 0; i < b.N; i++ {
- a = StringArray{}
- a.Scan(x)
- a = StringArray{}
- a.Scan(y)
- }
-}
-
-func TestStringArrayScanString(t *testing.T) {
- for _, tt := range StringArrayStringTests {
- arr := StringArray{"x", "x", "x"}
- err := arr.Scan(tt.str)
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", tt.str, err)
- }
- if !reflect.DeepEqual(arr, tt.arr) {
- t.Errorf("Expected %+v for %q, got %+v", tt.arr, tt.str, arr)
- }
- }
-}
-
-func TestStringArrayScanError(t *testing.T) {
- for _, tt := range []struct {
- input, err string
- }{
- {``, "unable to parse array"},
- {`{`, "unable to parse array"},
- {`{{a},{b}}`, "cannot convert ARRAY[2][1] to StringArray"},
- {`{NULL}`, "parsing array element index 0: cannot convert nil to string"},
- {`{a,NULL}`, "parsing array element index 1: cannot convert nil to string"},
- {`{a,b,NULL}`, "parsing array element index 2: cannot convert nil to string"},
- } {
- arr := StringArray{"x", "x", "x"}
- err := arr.Scan(tt.input)
-
- if err == nil {
- t.Fatalf("Expected error for %q, got none", tt.input)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for %q, got %q", tt.err, tt.input, err)
- }
- if !reflect.DeepEqual(arr, StringArray{"x", "x", "x"}) {
- t.Errorf("Expected destination not to change for %q, got %+v", tt.input, arr)
- }
- }
-}
-
-func TestStringArrayValue(t *testing.T) {
- result, err := StringArray(nil).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for nil, got %v", err)
- }
- if result != nil {
- t.Errorf("Expected nil, got %q", result)
- }
-
- result, err = StringArray([]string{}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error for empty, got %v", err)
- }
- if expected := `{}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected empty, got %q", result)
- }
-
- result, err = StringArray([]string{`a`, `\b`, `c"`, `d,e`}).Value()
-
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if expected := `{"a","\\b","c\"","d,e"}`; !reflect.DeepEqual(result, expected) {
- t.Errorf("Expected %q, got %q", expected, result)
- }
-}
-
-func BenchmarkStringArrayValue(b *testing.B) {
- x := make([]string, 10)
- for i := 0; i < len(x); i++ {
- x[i] = strings.Repeat(`abc"def\ghi`, 5)
- }
- a := StringArray(x)
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func TestGenericArrayScanUnsupported(t *testing.T) {
- var s string
- var ss []string
- var nsa [1]sql.NullString
-
- for _, tt := range []struct {
- src, dest interface{}
- err string
- }{
- {nil, nil, "destination is not a pointer to array or slice"},
- {nil, true, "destination bool is not a pointer to array or slice"},
- {nil, &s, "destination *string is not a pointer to array or slice"},
- {nil, ss, "destination []string is not a pointer to array or slice"},
- {nil, &nsa, " to [1]sql.NullString"},
- {true, &ss, "bool to []string"},
- {`{{x}}`, &ss, "multidimensional ARRAY[1][1] is not implemented"},
- {`{{x},{x}}`, &ss, "multidimensional ARRAY[2][1] is not implemented"},
- {`{x}`, &ss, "scanning to string is not implemented"},
- } {
- err := GenericArray{tt.dest}.Scan(tt.src)
-
- if err == nil {
- t.Fatalf("Expected error for [%#v %#v]", tt.src, tt.dest)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for [%#v %#v], got %q", tt.err, tt.src, tt.dest, err)
- }
- }
-}
-
-func TestGenericArrayScanScannerArrayBytes(t *testing.T) {
- src, expected, nsa := []byte(`{NULL,abc,"\""}`),
- [3]sql.NullString{{}, {String: `abc`, Valid: true}, {String: `"`, Valid: true}},
- [3]sql.NullString{{String: ``, Valid: true}, {}, {}}
-
- if err := (GenericArray{&nsa}).Scan(src); err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if !reflect.DeepEqual(nsa, expected) {
- t.Errorf("Expected %v, got %v", expected, nsa)
- }
-}
-
-func TestGenericArrayScanScannerArrayString(t *testing.T) {
- src, expected, nsa := `{NULL,"\"",xyz}`,
- [3]sql.NullString{{}, {String: `"`, Valid: true}, {String: `xyz`, Valid: true}},
- [3]sql.NullString{{String: ``, Valid: true}, {}, {}}
-
- if err := (GenericArray{&nsa}).Scan(src); err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if !reflect.DeepEqual(nsa, expected) {
- t.Errorf("Expected %v, got %v", expected, nsa)
- }
-}
-
-func TestGenericArrayScanScannerSliceEmpty(t *testing.T) {
- var nss []sql.NullString
-
- if err := (GenericArray{&nss}).Scan(`{}`); err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if nss == nil || len(nss) != 0 {
- t.Errorf("Expected empty, got %#v", nss)
- }
-}
-
-func TestGenericArrayScanScannerSliceNil(t *testing.T) {
- nss := []sql.NullString{{String: ``, Valid: true}, {}}
-
- if err := (GenericArray{&nss}).Scan(nil); err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if nss != nil {
- t.Errorf("Expected nil, got %+v", nss)
- }
-}
-
-func TestGenericArrayScanScannerSliceBytes(t *testing.T) {
- src, expected, nss := []byte(`{NULL,abc,"\""}`),
- []sql.NullString{{}, {String: `abc`, Valid: true}, {String: `"`, Valid: true}},
- []sql.NullString{{String: ``, Valid: true}, {}, {}, {}, {}}
-
- if err := (GenericArray{&nss}).Scan(src); err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if !reflect.DeepEqual(nss, expected) {
- t.Errorf("Expected %v, got %v", expected, nss)
- }
-}
-
-func BenchmarkGenericArrayScanScannerSliceBytes(b *testing.B) {
- var a GenericArray
- var x interface{} = []byte(`{a,b,c,d,e,f,g,h,i,j}`)
- var y interface{} = []byte(`{"\a","\b","\c","\d","\e","\f","\g","\h","\i","\j"}`)
-
- for i := 0; i < b.N; i++ {
- a = GenericArray{new([]sql.NullString)}
- a.Scan(x)
- a = GenericArray{new([]sql.NullString)}
- a.Scan(y)
- }
-}
-
-func TestGenericArrayScanScannerSliceString(t *testing.T) {
- src, expected, nss := `{NULL,"\"",xyz}`,
- []sql.NullString{{}, {String: `"`, Valid: true}, {String: `xyz`, Valid: true}},
- []sql.NullString{{String: ``, Valid: true}, {}, {}}
-
- if err := (GenericArray{&nss}).Scan(src); err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if !reflect.DeepEqual(nss, expected) {
- t.Errorf("Expected %v, got %v", expected, nss)
- }
-}
-
-type TildeNullInt64 struct{ sql.NullInt64 }
-
-func (TildeNullInt64) ArrayDelimiter() string { return "~" }
-
-func TestGenericArrayScanDelimiter(t *testing.T) {
- src, expected, tnis := `{12~NULL~76}`,
- []TildeNullInt64{{sql.NullInt64{Int64: 12, Valid: true}}, {}, {sql.NullInt64{Int64: 76, Valid: true}}},
- []TildeNullInt64{{sql.NullInt64{Int64: 0, Valid: true}}, {}}
-
- if err := (GenericArray{&tnis}).Scan(src); err != nil {
- t.Fatalf("Expected no error for %#v, got %v", src, err)
- }
- if !reflect.DeepEqual(tnis, expected) {
- t.Errorf("Expected %v for %#v, got %v", expected, src, tnis)
- }
-}
-
-func TestGenericArrayScanErrors(t *testing.T) {
- var sa [1]string
- var nis []sql.NullInt64
- var pss *[]string
-
- for _, tt := range []struct {
- src, dest interface{}
- err string
- }{
- {nil, pss, "destination *[]string is nil"},
- {`{`, &sa, "unable to parse"},
- {`{}`, &sa, "cannot convert ARRAY[0] to [1]string"},
- {`{x,x}`, &sa, "cannot convert ARRAY[2] to [1]string"},
- {`{x}`, &nis, `parsing array element index 0: converting`},
- } {
- err := GenericArray{tt.dest}.Scan(tt.src)
-
- if err == nil {
- t.Fatalf("Expected error for [%#v %#v]", tt.src, tt.dest)
- }
- if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("Expected error to contain %q for [%#v %#v], got %q", tt.err, tt.src, tt.dest, err)
- }
- }
-}
-
-func TestGenericArrayValueUnsupported(t *testing.T) {
- _, err := GenericArray{true}.Value()
-
- if err == nil {
- t.Fatal("Expected error for bool")
- }
- if !strings.Contains(err.Error(), "bool to array") {
- t.Errorf("Expected type to be mentioned, got %q", err)
- }
-}
-
-type ByteArrayValuer [1]byte
-type ByteSliceValuer []byte
-type FuncArrayValuer struct {
- delimiter func() string
- value func() (driver.Value, error)
-}
-
-func (a ByteArrayValuer) Value() (driver.Value, error) { return a[:], nil }
-func (b ByteSliceValuer) Value() (driver.Value, error) { return []byte(b), nil }
-func (f FuncArrayValuer) ArrayDelimiter() string { return f.delimiter() }
-func (f FuncArrayValuer) Value() (driver.Value, error) { return f.value() }
-
-func TestGenericArrayValue(t *testing.T) {
- result, err := GenericArray{nil}.Value()
-
- if err != nil {
- t.Fatalf("Expected no error for nil, got %v", err)
- }
- if result != nil {
- t.Errorf("Expected nil, got %q", result)
- }
-
- for _, tt := range []interface{}{
- []bool(nil),
- [][]int(nil),
- []*int(nil),
- []sql.NullString(nil),
- } {
- result, err := GenericArray{tt}.Value()
-
- if err != nil {
- t.Fatalf("Expected no error for %#v, got %v", tt, err)
- }
- if result != nil {
- t.Errorf("Expected nil for %#v, got %q", tt, result)
- }
- }
-
- Tilde := func(v driver.Value) FuncArrayValuer {
- return FuncArrayValuer{
- func() string { return "~" },
- func() (driver.Value, error) { return v, nil }}
- }
-
- for _, tt := range []struct {
- result string
- input interface{}
- }{
- {`{}`, []bool{}},
- {`{true}`, []bool{true}},
- {`{true,false}`, []bool{true, false}},
- {`{true,false}`, [2]bool{true, false}},
-
- {`{}`, [][]int{{}}},
- {`{}`, [][]int{{}, {}}},
- {`{{1}}`, [][]int{{1}}},
- {`{{1},{2}}`, [][]int{{1}, {2}}},
- {`{{1,2},{3,4}}`, [][]int{{1, 2}, {3, 4}}},
- {`{{1,2},{3,4}}`, [2][2]int{{1, 2}, {3, 4}}},
-
- {`{"a","\\b","c\"","d,e"}`, []string{`a`, `\b`, `c"`, `d,e`}},
- {`{"a","\\b","c\"","d,e"}`, [][]byte{{'a'}, {'\\', 'b'}, {'c', '"'}, {'d', ',', 'e'}}},
-
- {`{NULL}`, []*int{nil}},
- {`{0,NULL}`, []*int{new(int), nil}},
-
- {`{NULL}`, []sql.NullString{{}}},
- {`{"\"",NULL}`, []sql.NullString{{String: `"`, Valid: true}, {}}},
-
- {`{"a","b"}`, []ByteArrayValuer{{'a'}, {'b'}}},
- {`{{"a","b"},{"c","d"}}`, [][]ByteArrayValuer{{{'a'}, {'b'}}, {{'c'}, {'d'}}}},
-
- {`{"e","f"}`, []ByteSliceValuer{{'e'}, {'f'}}},
- {`{{"e","f"},{"g","h"}}`, [][]ByteSliceValuer{{{'e'}, {'f'}}, {{'g'}, {'h'}}}},
-
- {`{1~2}`, []FuncArrayValuer{Tilde(int64(1)), Tilde(int64(2))}},
- {`{{1~2}~{3~4}}`, [][]FuncArrayValuer{{Tilde(int64(1)), Tilde(int64(2))}, {Tilde(int64(3)), Tilde(int64(4))}}},
- } {
- result, err := GenericArray{tt.input}.Value()
-
- if err != nil {
- t.Fatalf("Expected no error for %q, got %v", tt.input, err)
- }
- if !reflect.DeepEqual(result, tt.result) {
- t.Errorf("Expected %q for %q, got %q", tt.result, tt.input, result)
- }
- }
-}
-
-func TestGenericArrayValueErrors(t *testing.T) {
- v := []interface{}{func() {}}
- if _, err := (GenericArray{v}).Value(); err == nil {
- t.Errorf("Expected error for %q, got nil", v)
- }
-
- v = []interface{}{nil, func() {}}
- if _, err := (GenericArray{v}).Value(); err == nil {
- t.Errorf("Expected error for %q, got nil", v)
- }
-}
-
-func BenchmarkGenericArrayValueBools(b *testing.B) {
- rand.Seed(1)
- x := make([]bool, 10)
- for i := 0; i < len(x); i++ {
- x[i] = rand.Intn(2) == 0
- }
- a := GenericArray{x}
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func BenchmarkGenericArrayValueFloat64s(b *testing.B) {
- rand.Seed(1)
- x := make([]float64, 10)
- for i := 0; i < len(x); i++ {
- x[i] = rand.NormFloat64()
- }
- a := GenericArray{x}
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func BenchmarkGenericArrayValueInt64s(b *testing.B) {
- rand.Seed(1)
- x := make([]int64, 10)
- for i := 0; i < len(x); i++ {
- x[i] = rand.Int63()
- }
- a := GenericArray{x}
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func BenchmarkGenericArrayValueByteSlices(b *testing.B) {
- x := make([][]byte, 10)
- for i := 0; i < len(x); i++ {
- x[i] = bytes.Repeat([]byte(`abc"def\ghi`), 5)
- }
- a := GenericArray{x}
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func BenchmarkGenericArrayValueStrings(b *testing.B) {
- x := make([]string, 10)
- for i := 0; i < len(x); i++ {
- x[i] = strings.Repeat(`abc"def\ghi`, 5)
- }
- a := GenericArray{x}
-
- for i := 0; i < b.N; i++ {
- a.Value()
- }
-}
-
-func TestArrayScanBackend(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- for _, tt := range []struct {
- s string
- d sql.Scanner
- e interface{}
- }{
- {`ARRAY[true, false]`, new(BoolArray), &BoolArray{true, false}},
- {`ARRAY[E'\\xdead', E'\\xbeef']`, new(ByteaArray), &ByteaArray{{'\xDE', '\xAD'}, {'\xBE', '\xEF'}}},
- {`ARRAY[1.2, 3.4]`, new(Float64Array), &Float64Array{1.2, 3.4}},
- {`ARRAY[1, 2, 3]`, new(Int64Array), &Int64Array{1, 2, 3}},
- {`ARRAY['a', E'\\b', 'c"', 'd,e']`, new(StringArray), &StringArray{`a`, `\b`, `c"`, `d,e`}},
- } {
- err := db.QueryRow(`SELECT ` + tt.s).Scan(tt.d)
- if err != nil {
- t.Errorf("Expected no error when scanning %s into %T, got %v", tt.s, tt.d, err)
- }
- if !reflect.DeepEqual(tt.d, tt.e) {
- t.Errorf("Expected %v when scanning %s into %T, got %v", tt.e, tt.s, tt.d, tt.d)
- }
- }
-}
-
-func TestArrayValueBackend(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- for _, tt := range []struct {
- s string
- v driver.Valuer
- }{
- {`ARRAY[true, false]`, BoolArray{true, false}},
- {`ARRAY[E'\\xdead', E'\\xbeef']`, ByteaArray{{'\xDE', '\xAD'}, {'\xBE', '\xEF'}}},
- {`ARRAY[1.2, 3.4]`, Float64Array{1.2, 3.4}},
- {`ARRAY[1, 2, 3]`, Int64Array{1, 2, 3}},
- {`ARRAY['a', E'\\b', 'c"', 'd,e']`, StringArray{`a`, `\b`, `c"`, `d,e`}},
- } {
- var x int
- err := db.QueryRow(`SELECT 1 WHERE `+tt.s+` <> $1`, tt.v).Scan(&x)
- if err != sql.ErrNoRows {
- t.Errorf("Expected %v to equal %s, got %v", tt.v, tt.s, err)
- }
- }
-}
diff --git a/vendor/github.com/lib/pq/bench_test.go b/vendor/github.com/lib/pq/bench_test.go
deleted file mode 100644
index 33d7a02f..00000000
--- a/vendor/github.com/lib/pq/bench_test.go
+++ /dev/null
@@ -1,436 +0,0 @@
-// +build go1.1
-
-package pq
-
-import (
- "bufio"
- "bytes"
- "context"
- "database/sql"
- "database/sql/driver"
- "io"
- "math/rand"
- "net"
- "runtime"
- "strconv"
- "strings"
- "sync"
- "testing"
- "time"
-
- "github.com/lib/pq/oid"
-)
-
-var (
- selectStringQuery = "SELECT '" + strings.Repeat("0123456789", 10) + "'"
- selectSeriesQuery = "SELECT generate_series(1, 100)"
-)
-
-func BenchmarkSelectString(b *testing.B) {
- var result string
- benchQuery(b, selectStringQuery, &result)
-}
-
-func BenchmarkSelectSeries(b *testing.B) {
- var result int
- benchQuery(b, selectSeriesQuery, &result)
-}
-
-func benchQuery(b *testing.B, query string, result interface{}) {
- b.StopTimer()
- db := openTestConn(b)
- defer db.Close()
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- benchQueryLoop(b, db, query, result)
- }
-}
-
-func benchQueryLoop(b *testing.B, db *sql.DB, query string, result interface{}) {
- rows, err := db.Query(query)
- if err != nil {
- b.Fatal(err)
- }
- defer rows.Close()
- for rows.Next() {
- err = rows.Scan(result)
- if err != nil {
- b.Fatal("failed to scan", err)
- }
- }
-}
-
-// reading from circularConn yields content[:prefixLen] once, followed by
-// content[prefixLen:] over and over again. It never returns EOF.
-type circularConn struct {
- content string
- prefixLen int
- pos int
- net.Conn // for all other net.Conn methods that will never be called
-}
-
-func (r *circularConn) Read(b []byte) (n int, err error) {
- n = copy(b, r.content[r.pos:])
- r.pos += n
- if r.pos >= len(r.content) {
- r.pos = r.prefixLen
- }
- return
-}
-
-func (r *circularConn) Write(b []byte) (n int, err error) { return len(b), nil }
-
-func (r *circularConn) Close() error { return nil }
-
-func fakeConn(content string, prefixLen int) *conn {
- c := &circularConn{content: content, prefixLen: prefixLen}
- return &conn{buf: bufio.NewReader(c), c: c}
-}
-
-// This benchmark is meant to be the same as BenchmarkSelectString, but takes
-// out some of the factors this package can't control. The numbers are less noisy,
-// but also the costs of network communication aren't accurately represented.
-func BenchmarkMockSelectString(b *testing.B) {
- b.StopTimer()
- // taken from a recorded run of BenchmarkSelectString
- // See: http://www.postgresql.org/docs/current/static/protocol-message-formats.html
- const response = "1\x00\x00\x00\x04" +
- "t\x00\x00\x00\x06\x00\x00" +
- "T\x00\x00\x00!\x00\x01?column?\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xc1\xff\xfe\xff\xff\xff\xff\x00\x00" +
- "Z\x00\x00\x00\x05I" +
- "2\x00\x00\x00\x04" +
- "D\x00\x00\x00n\x00\x01\x00\x00\x00d0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" +
- "C\x00\x00\x00\rSELECT 1\x00" +
- "Z\x00\x00\x00\x05I" +
- "3\x00\x00\x00\x04" +
- "Z\x00\x00\x00\x05I"
- c := fakeConn(response, 0)
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- benchMockQuery(b, c, selectStringQuery)
- }
-}
-
-var seriesRowData = func() string {
- var buf bytes.Buffer
- for i := 1; i <= 100; i++ {
- digits := byte(2)
- if i >= 100 {
- digits = 3
- } else if i < 10 {
- digits = 1
- }
- buf.WriteString("D\x00\x00\x00")
- buf.WriteByte(10 + digits)
- buf.WriteString("\x00\x01\x00\x00\x00")
- buf.WriteByte(digits)
- buf.WriteString(strconv.Itoa(i))
- }
- return buf.String()
-}()
-
-func BenchmarkMockSelectSeries(b *testing.B) {
- b.StopTimer()
- var response = "1\x00\x00\x00\x04" +
- "t\x00\x00\x00\x06\x00\x00" +
- "T\x00\x00\x00!\x00\x01?column?\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xc1\xff\xfe\xff\xff\xff\xff\x00\x00" +
- "Z\x00\x00\x00\x05I" +
- "2\x00\x00\x00\x04" +
- seriesRowData +
- "C\x00\x00\x00\x0fSELECT 100\x00" +
- "Z\x00\x00\x00\x05I" +
- "3\x00\x00\x00\x04" +
- "Z\x00\x00\x00\x05I"
- c := fakeConn(response, 0)
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- benchMockQuery(b, c, selectSeriesQuery)
- }
-}
-
-func benchMockQuery(b *testing.B, c *conn, query string) {
- stmt, err := c.Prepare(query)
- if err != nil {
- b.Fatal(err)
- }
- defer stmt.Close()
- rows, err := stmt.(driver.StmtQueryContext).QueryContext(context.Background(), nil)
- if err != nil {
- b.Fatal(err)
- }
- defer rows.Close()
- var dest [1]driver.Value
- for {
- if err := rows.Next(dest[:]); err != nil {
- if err == io.EOF {
- break
- }
- b.Fatal(err)
- }
- }
-}
-
-func BenchmarkPreparedSelectString(b *testing.B) {
- var result string
- benchPreparedQuery(b, selectStringQuery, &result)
-}
-
-func BenchmarkPreparedSelectSeries(b *testing.B) {
- var result int
- benchPreparedQuery(b, selectSeriesQuery, &result)
-}
-
-func benchPreparedQuery(b *testing.B, query string, result interface{}) {
- b.StopTimer()
- db := openTestConn(b)
- defer db.Close()
- stmt, err := db.Prepare(query)
- if err != nil {
- b.Fatal(err)
- }
- defer stmt.Close()
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- benchPreparedQueryLoop(b, db, stmt, result)
- }
-}
-
-func benchPreparedQueryLoop(b *testing.B, db *sql.DB, stmt *sql.Stmt, result interface{}) {
- rows, err := stmt.Query()
- if err != nil {
- b.Fatal(err)
- }
- if !rows.Next() {
- rows.Close()
- b.Fatal("no rows")
- }
- defer rows.Close()
- for rows.Next() {
- err = rows.Scan(&result)
- if err != nil {
- b.Fatal("failed to scan")
- }
- }
-}
-
-// See the comment for BenchmarkMockSelectString.
-func BenchmarkMockPreparedSelectString(b *testing.B) {
- b.StopTimer()
- const parseResponse = "1\x00\x00\x00\x04" +
- "t\x00\x00\x00\x06\x00\x00" +
- "T\x00\x00\x00!\x00\x01?column?\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xc1\xff\xfe\xff\xff\xff\xff\x00\x00" +
- "Z\x00\x00\x00\x05I"
- const responses = parseResponse +
- "2\x00\x00\x00\x04" +
- "D\x00\x00\x00n\x00\x01\x00\x00\x00d0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" +
- "C\x00\x00\x00\rSELECT 1\x00" +
- "Z\x00\x00\x00\x05I"
- c := fakeConn(responses, len(parseResponse))
-
- stmt, err := c.Prepare(selectStringQuery)
- if err != nil {
- b.Fatal(err)
- }
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- benchPreparedMockQuery(b, c, stmt)
- }
-}
-
-func BenchmarkMockPreparedSelectSeries(b *testing.B) {
- b.StopTimer()
- const parseResponse = "1\x00\x00\x00\x04" +
- "t\x00\x00\x00\x06\x00\x00" +
- "T\x00\x00\x00!\x00\x01?column?\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xc1\xff\xfe\xff\xff\xff\xff\x00\x00" +
- "Z\x00\x00\x00\x05I"
- var responses = parseResponse +
- "2\x00\x00\x00\x04" +
- seriesRowData +
- "C\x00\x00\x00\x0fSELECT 100\x00" +
- "Z\x00\x00\x00\x05I"
- c := fakeConn(responses, len(parseResponse))
-
- stmt, err := c.Prepare(selectSeriesQuery)
- if err != nil {
- b.Fatal(err)
- }
- b.StartTimer()
-
- for i := 0; i < b.N; i++ {
- benchPreparedMockQuery(b, c, stmt)
- }
-}
-
-func benchPreparedMockQuery(b *testing.B, c *conn, stmt driver.Stmt) {
- rows, err := stmt.(driver.StmtQueryContext).QueryContext(context.Background(), nil)
- if err != nil {
- b.Fatal(err)
- }
- defer rows.Close()
- var dest [1]driver.Value
- for {
- if err := rows.Next(dest[:]); err != nil {
- if err == io.EOF {
- break
- }
- b.Fatal(err)
- }
- }
-}
-
-func BenchmarkEncodeInt64(b *testing.B) {
- for i := 0; i < b.N; i++ {
- encode(¶meterStatus{}, int64(1234), oid.T_int8)
- }
-}
-
-func BenchmarkEncodeFloat64(b *testing.B) {
- for i := 0; i < b.N; i++ {
- encode(¶meterStatus{}, 3.14159, oid.T_float8)
- }
-}
-
-var testByteString = []byte("abcdefghijklmnopqrstuvwxyz")
-
-func BenchmarkEncodeByteaHex(b *testing.B) {
- for i := 0; i < b.N; i++ {
- encode(¶meterStatus{serverVersion: 90000}, testByteString, oid.T_bytea)
- }
-}
-func BenchmarkEncodeByteaEscape(b *testing.B) {
- for i := 0; i < b.N; i++ {
- encode(¶meterStatus{serverVersion: 84000}, testByteString, oid.T_bytea)
- }
-}
-
-func BenchmarkEncodeBool(b *testing.B) {
- for i := 0; i < b.N; i++ {
- encode(¶meterStatus{}, true, oid.T_bool)
- }
-}
-
-var testTimestamptz = time.Date(2001, time.January, 1, 0, 0, 0, 0, time.Local)
-
-func BenchmarkEncodeTimestamptz(b *testing.B) {
- for i := 0; i < b.N; i++ {
- encode(¶meterStatus{}, testTimestamptz, oid.T_timestamptz)
- }
-}
-
-var testIntBytes = []byte("1234")
-
-func BenchmarkDecodeInt64(b *testing.B) {
- for i := 0; i < b.N; i++ {
- decode(¶meterStatus{}, testIntBytes, oid.T_int8, formatText)
- }
-}
-
-var testFloatBytes = []byte("3.14159")
-
-func BenchmarkDecodeFloat64(b *testing.B) {
- for i := 0; i < b.N; i++ {
- decode(¶meterStatus{}, testFloatBytes, oid.T_float8, formatText)
- }
-}
-
-var testBoolBytes = []byte{'t'}
-
-func BenchmarkDecodeBool(b *testing.B) {
- for i := 0; i < b.N; i++ {
- decode(¶meterStatus{}, testBoolBytes, oid.T_bool, formatText)
- }
-}
-
-func TestDecodeBool(t *testing.T) {
- db := openTestConn(t)
- rows, err := db.Query("select true")
- if err != nil {
- t.Fatal(err)
- }
- rows.Close()
-}
-
-var testTimestamptzBytes = []byte("2013-09-17 22:15:32.360754-07")
-
-func BenchmarkDecodeTimestamptz(b *testing.B) {
- for i := 0; i < b.N; i++ {
- decode(¶meterStatus{}, testTimestamptzBytes, oid.T_timestamptz, formatText)
- }
-}
-
-func BenchmarkDecodeTimestamptzMultiThread(b *testing.B) {
- oldProcs := runtime.GOMAXPROCS(0)
- defer runtime.GOMAXPROCS(oldProcs)
- runtime.GOMAXPROCS(runtime.NumCPU())
- globalLocationCache = newLocationCache()
-
- f := func(wg *sync.WaitGroup, loops int) {
- defer wg.Done()
- for i := 0; i < loops; i++ {
- decode(¶meterStatus{}, testTimestamptzBytes, oid.T_timestamptz, formatText)
- }
- }
-
- wg := &sync.WaitGroup{}
- b.ResetTimer()
- for j := 0; j < 10; j++ {
- wg.Add(1)
- go f(wg, b.N/10)
- }
- wg.Wait()
-}
-
-func BenchmarkLocationCache(b *testing.B) {
- globalLocationCache = newLocationCache()
- for i := 0; i < b.N; i++ {
- globalLocationCache.getLocation(rand.Intn(10000))
- }
-}
-
-func BenchmarkLocationCacheMultiThread(b *testing.B) {
- oldProcs := runtime.GOMAXPROCS(0)
- defer runtime.GOMAXPROCS(oldProcs)
- runtime.GOMAXPROCS(runtime.NumCPU())
- globalLocationCache = newLocationCache()
-
- f := func(wg *sync.WaitGroup, loops int) {
- defer wg.Done()
- for i := 0; i < loops; i++ {
- globalLocationCache.getLocation(rand.Intn(10000))
- }
- }
-
- wg := &sync.WaitGroup{}
- b.ResetTimer()
- for j := 0; j < 10; j++ {
- wg.Add(1)
- go f(wg, b.N/10)
- }
- wg.Wait()
-}
-
-// Stress test the performance of parsing results from the wire.
-func BenchmarkResultParsing(b *testing.B) {
- b.StopTimer()
-
- db := openTestConn(b)
- defer db.Close()
- _, err := db.Exec("BEGIN")
- if err != nil {
- b.Fatal(err)
- }
-
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- res, err := db.Query("SELECT generate_series(1, 50000)")
- if err != nil {
- b.Fatal(err)
- }
- res.Close()
- }
-}
diff --git a/vendor/github.com/lib/pq/certs/README b/vendor/github.com/lib/pq/certs/README
deleted file mode 100644
index 24ab7b25..00000000
--- a/vendor/github.com/lib/pq/certs/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains certificates and private keys for testing some
-SSL-related functionality in Travis. Do NOT use these certificates for
-anything other than testing.
diff --git a/vendor/github.com/lib/pq/certs/bogus_root.crt b/vendor/github.com/lib/pq/certs/bogus_root.crt
deleted file mode 100644
index 1239db3a..00000000
--- a/vendor/github.com/lib/pq/certs/bogus_root.crt
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDBjCCAe6gAwIBAgIQSnDYp/Naet9HOZljF5PuwDANBgkqhkiG9w0BAQsFADAr
-MRIwEAYDVQQKEwlDb2Nrcm9hY2gxFTATBgNVBAMTDENvY2tyb2FjaCBDQTAeFw0x
-NjAyMDcxNjQ0MzdaFw0xNzAyMDYxNjQ0MzdaMCsxEjAQBgNVBAoTCUNvY2tyb2Fj
-aDEVMBMGA1UEAxMMQ29ja3JvYWNoIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAxdln3/UdgP7ayA/G1kT7upjLe4ERwQjYQ25q0e1+vgsB5jhiirxJ
-e0+WkhhYu/mwoSAXzvlsbZ2PWFyfdanZeD/Lh6SvIeWXVVaPcWVWL1TEcoN2jr5+
-E85MMHmbbmaT2he8s6br2tM/UZxyTQ2XRprIzApbDssyw1c0Yufcpu3C6267FLEl
-IfcWrzDhnluFhthhtGXv3ToD8IuMScMC5qlKBXtKmD1B5x14ngO/ecNJ+OlEi0HU
-mavK4KWgI2rDXRZ2EnCpyTZdkc3kkRnzKcg653oOjMDRZdrhfIrha+Jq38ACsUmZ
-Su7Sp5jkIHOCO8Zg+l6GKVSq37dKMapD8wIDAQABoyYwJDAOBgNVHQ8BAf8EBAMC
-AuQwEgYDVR0TAQH/BAgwBgEB/wIBATANBgkqhkiG9w0BAQsFAAOCAQEAwZ2Tu0Yu
-rrSVdMdoPEjT1IZd+5OhM/SLzL0ddtvTithRweLHsw2lDQYlXFqr24i3UGZJQ1sp
-cqSrNwswgLUQT3vWyTjmM51HEb2vMYWKmjZ+sBQYAUP1CadrN/+OTfNGnlF1+B4w
-IXOzh7EvQmJJnNybLe4a/aRvj1NE2n8Z898B76SVU9WbfKKz8VwLzuIPDqkKcZda
-lMy5yzthyztV9YjcWs2zVOUGZvGdAhDrvZuUq6mSmxrBEvR2LBOggmVf3tGRT+Ls
-lW7c9Lrva5zLHuqmoPP07A+vuI9a0D1X44jwGDuPWJ5RnTOQ63Uez12mKNjqleHw
-DnkwNanuO8dhAA==
------END CERTIFICATE-----
diff --git a/vendor/github.com/lib/pq/certs/postgresql.crt b/vendor/github.com/lib/pq/certs/postgresql.crt
deleted file mode 100644
index 6e6b4284..00000000
--- a/vendor/github.com/lib/pq/certs/postgresql.crt
+++ /dev/null
@@ -1,69 +0,0 @@
-Certificate:
- Data:
- Version: 3 (0x2)
- Serial Number: 2 (0x2)
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=pq CA
- Validity
- Not Before: Oct 11 15:10:11 2014 GMT
- Not After : Oct 8 15:10:11 2024 GMT
- Subject: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=pqgosslcert
- Subject Public Key Info:
- Public Key Algorithm: rsaEncryption
- RSA Public Key: (1024 bit)
- Modulus (1024 bit):
- 00:e3:8c:06:9a:70:54:51:d1:34:34:83:39:cd:a2:
- 59:0f:05:ed:8d:d8:0e:34:d0:92:f4:09:4d:ee:8c:
- 78:55:49:24:f8:3c:e0:34:58:02:b2:e7:94:58:c1:
- e8:e5:bb:d1:af:f6:54:c1:40:b1:90:70:79:0d:35:
- 54:9c:8f:16:e9:c2:f0:92:e6:64:49:38:c1:76:f8:
- 47:66:c4:5b:4a:b6:a9:43:ce:c8:be:6c:4d:2b:94:
- 97:3c:55:bc:d1:d0:6e:b7:53:ae:89:5c:4b:6b:86:
- 40:be:c1:ae:1e:64:ce:9c:ae:87:0a:69:e5:c8:21:
- 12:be:ae:1d:f6:45:df:16:a7
- Exponent: 65537 (0x10001)
- X509v3 extensions:
- X509v3 Subject Key Identifier:
- 9B:25:31:63:A2:D8:06:FF:CB:E3:E9:96:FF:0D:BA:DC:12:7D:04:CF
- X509v3 Authority Key Identifier:
- keyid:52:93:ED:1E:76:0A:9F:65:4F:DE:19:66:C1:D5:22:40:35:CB:A0:72
-
- X509v3 Basic Constraints:
- CA:FALSE
- X509v3 Key Usage:
- Digital Signature, Non Repudiation, Key Encipherment
- Signature Algorithm: sha256WithRSAEncryption
- 3e:f5:f8:0b:4e:11:bd:00:86:1f:ce:dc:97:02:98:91:11:f5:
- 65:f6:f2:8a:b2:3e:47:92:05:69:28:c9:e9:b4:f7:cf:93:d1:
- 2d:81:5d:00:3c:23:be:da:70:ea:59:e1:2c:d3:25:49:ae:a6:
- 95:54:c1:10:df:23:e3:fe:d6:e4:76:c7:6b:73:ad:1b:34:7c:
- e2:56:cc:c0:37:ae:c5:7a:11:20:6c:3d:05:0e:99:cd:22:6c:
- cf:59:a1:da:28:d4:65:ba:7d:2f:2b:3d:69:6d:a6:c1:ae:57:
- bf:56:64:13:79:f8:48:46:65:eb:81:67:28:0b:7b:de:47:10:
- b3:80:3c:31:d1:58:94:01:51:4a:c7:c8:1a:01:a8:af:c4:cd:
- bb:84:a5:d9:8b:b4:b9:a1:64:3e:95:d9:90:1d:d5:3f:67:cc:
- 3b:ba:f5:b4:d1:33:77:ee:c2:d2:3e:7e:c5:66:6e:b7:35:4c:
- 60:57:b0:b8:be:36:c8:f3:d3:95:8c:28:4a:c9:f7:27:a4:0d:
- e5:96:99:eb:f5:c8:bd:f3:84:6d:ef:02:f9:8a:36:7d:6b:5f:
- 36:68:37:41:d9:74:ae:c6:78:2e:44:86:a1:ad:43:ca:fb:b5:
- 3e:ba:10:23:09:02:ac:62:d1:d0:83:c8:95:b9:e3:5e:30:ff:
- 5b:2b:38:fa
------BEGIN CERTIFICATE-----
-MIIDEzCCAfugAwIBAgIBAjANBgkqhkiG9w0BAQsFADBeMQswCQYDVQQGEwJVUzEP
-MA0GA1UECBMGTmV2YWRhMRIwEAYDVQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdp
-dGh1Yi5jb20vbGliL3BxMQ4wDAYDVQQDEwVwcSBDQTAeFw0xNDEwMTExNTEwMTFa
-Fw0yNDEwMDgxNTEwMTFaMGQxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGEx
-EjAQBgNVBAcTCUxhcyBWZWdhczEaMBgGA1UEChMRZ2l0aHViLmNvbS9saWIvcHEx
-FDASBgNVBAMTC3BxZ29zc2xjZXJ0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
-gQDjjAaacFRR0TQ0gznNolkPBe2N2A400JL0CU3ujHhVSST4POA0WAKy55RYwejl
-u9Gv9lTBQLGQcHkNNVScjxbpwvCS5mRJOMF2+EdmxFtKtqlDzsi+bE0rlJc8VbzR
-0G63U66JXEtrhkC+wa4eZM6crocKaeXIIRK+rh32Rd8WpwIDAQABo1owWDAdBgNV
-HQ4EFgQUmyUxY6LYBv/L4+mW/w263BJ9BM8wHwYDVR0jBBgwFoAUUpPtHnYKn2VP
-3hlmwdUiQDXLoHIwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJKoZIhvcNAQEL
-BQADggEBAD71+AtOEb0Ahh/O3JcCmJER9WX28oqyPkeSBWkoyem098+T0S2BXQA8
-I77acOpZ4SzTJUmuppVUwRDfI+P+1uR2x2tzrRs0fOJWzMA3rsV6ESBsPQUOmc0i
-bM9Zodoo1GW6fS8rPWltpsGuV79WZBN5+EhGZeuBZygLe95HELOAPDHRWJQBUUrH
-yBoBqK/EzbuEpdmLtLmhZD6V2ZAd1T9nzDu69bTRM3fuwtI+fsVmbrc1TGBXsLi+
-Nsjz05WMKErJ9yekDeWWmev1yL3zhG3vAvmKNn1rXzZoN0HZdK7GeC5EhqGtQ8r7
-tT66ECMJAqxi0dCDyJW5414w/1srOPo=
------END CERTIFICATE-----
diff --git a/vendor/github.com/lib/pq/certs/postgresql.key b/vendor/github.com/lib/pq/certs/postgresql.key
deleted file mode 100644
index eb8b20be..00000000
--- a/vendor/github.com/lib/pq/certs/postgresql.key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICWwIBAAKBgQDjjAaacFRR0TQ0gznNolkPBe2N2A400JL0CU3ujHhVSST4POA0
-WAKy55RYwejlu9Gv9lTBQLGQcHkNNVScjxbpwvCS5mRJOMF2+EdmxFtKtqlDzsi+
-bE0rlJc8VbzR0G63U66JXEtrhkC+wa4eZM6crocKaeXIIRK+rh32Rd8WpwIDAQAB
-AoGAM5dM6/kp9P700i8qjOgRPym96Zoh5nGfz/rIE5z/r36NBkdvIg8OVZfR96nH
-b0b9TOMR5lsPp0sI9yivTWvX6qyvLJRWy2vvx17hXK9NxXUNTAm0PYZUTvCtcPeX
-RnJpzQKNZQPkFzF0uXBc4CtPK2Vz0+FGvAelrhYAxnw1dIkCQQD+9qaW5QhXjsjb
-Nl85CmXgxPmGROcgLQCO+omfrjf9UXrituU9Dz6auym5lDGEdMFnkzfr+wpasEy9
-mf5ZZOhDAkEA5HjXfVGaCtpydOt6hDon/uZsyssCK2lQ7NSuE3vP+sUsYMzIpEoy
-t3VWXqKbo+g9KNDTP4WEliqp1aiSIylzzQJANPeqzihQnlgEdD4MdD4rwhFJwVIp
-Le8Lcais1KaN7StzOwxB/XhgSibd2TbnPpw+3bSg5n5lvUdo+e62/31OHwJAU1jS
-I+F09KikQIr28u3UUWT2IzTT4cpVv1AHAQyV3sG3YsjSGT0IK20eyP9BEBZU2WL0
-7aNjrvR5aHxKc5FXsQJABsFtyGpgI5X4xufkJZVZ+Mklz2n7iXa+XPatMAHFxAtb
-EEMt60rngwMjXAzBSC6OYuYogRRAY3UCacNC5VhLYQ==
------END RSA PRIVATE KEY-----
diff --git a/vendor/github.com/lib/pq/certs/root.crt b/vendor/github.com/lib/pq/certs/root.crt
deleted file mode 100644
index aecf8f62..00000000
--- a/vendor/github.com/lib/pq/certs/root.crt
+++ /dev/null
@@ -1,24 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIEAzCCAuugAwIBAgIJANmheROCdW1NMA0GCSqGSIb3DQEBBQUAMF4xCzAJBgNV
-BAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGExEjAQBgNVBAcTCUxhcyBWZWdhczEaMBgG
-A1UEChMRZ2l0aHViLmNvbS9saWIvcHExDjAMBgNVBAMTBXBxIENBMB4XDTE0MTAx
-MTE1MDQyOVoXDTI0MTAwODE1MDQyOVowXjELMAkGA1UEBhMCVVMxDzANBgNVBAgT
-Bk5ldmFkYTESMBAGA1UEBxMJTGFzIFZlZ2FzMRowGAYDVQQKExFnaXRodWIuY29t
-L2xpYi9wcTEOMAwGA1UEAxMFcHEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
-ggEKAoIBAQCV4PxP7ShzWBzUCThcKk3qZtOLtHmszQVtbqhvgTpm1kTRtKBdVMu0
-pLAHQ3JgJCnAYgH0iZxVGoMP16T3irdgsdC48+nNTFM2T0cCdkfDURGIhSFN47cb
-Pgy306BcDUD2q7ucW33+dlFSRuGVewocoh4BWM/vMtMvvWzdi4Ag/L/jhb+5wZxZ
-sWymsadOVSDePEMKOvlCa3EdVwVFV40TVyDb+iWBUivDAYsS2a3KajuJrO6MbZiE
-Sp2RCIkZS2zFmzWxVRi9ZhzIZhh7EVF9JAaNC3T52jhGUdlRq3YpBTMnd89iOh74
-6jWXG7wSuPj3haFzyNhmJ0ZUh+2Ynoh1AgMBAAGjgcMwgcAwHQYDVR0OBBYEFFKT
-7R52Cp9lT94ZZsHVIkA1y6ByMIGQBgNVHSMEgYgwgYWAFFKT7R52Cp9lT94ZZsHV
-IkA1y6ByoWKkYDBeMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGTmV2YWRhMRIwEAYD
-VQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdpdGh1Yi5jb20vbGliL3BxMQ4wDAYD
-VQQDEwVwcSBDQYIJANmheROCdW1NMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF
-BQADggEBAAEhCLWkqJNMI8b4gkbmj5fqQ/4+oO83bZ3w2Oqf6eZ8I8BC4f2NOyE6
-tRUlq5+aU7eqC1cOAvGjO+YHN/bF/DFpwLlzvUSXt+JP/pYcUjL7v+pIvwqec9hD
-ndvM4iIbkD/H/OYQ3L+N3W+G1x7AcFIX+bGCb3PzYVQAjxreV6//wgKBosMGFbZo
-HPxT9RPMun61SViF04H5TNs0derVn1+5eiiYENeAhJzQNyZoOOUuX1X/Inx9bEPh
-C5vFBtSMgIytPgieRJVWAiMLYsfpIAStrHztRAbBs2DU01LmMgRvHdxgFEKinC/d
-UHZZQDP+6pT+zADrGhQGXe4eThaO6f0=
------END CERTIFICATE-----
diff --git a/vendor/github.com/lib/pq/certs/server.crt b/vendor/github.com/lib/pq/certs/server.crt
deleted file mode 100644
index ddc995a6..00000000
--- a/vendor/github.com/lib/pq/certs/server.crt
+++ /dev/null
@@ -1,81 +0,0 @@
-Certificate:
- Data:
- Version: 3 (0x2)
- Serial Number: 1 (0x1)
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=pq CA
- Validity
- Not Before: Oct 11 15:05:15 2014 GMT
- Not After : Oct 8 15:05:15 2024 GMT
- Subject: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=postgres
- Subject Public Key Info:
- Public Key Algorithm: rsaEncryption
- RSA Public Key: (2048 bit)
- Modulus (2048 bit):
- 00:d7:8a:4c:85:fb:17:a5:3c:8f:e0:72:11:29:ce:
- 3f:b0:1f:3f:7d:c6:ee:7f:a7:fc:02:2b:35:47:08:
- a6:3d:90:df:5c:56:14:94:00:c7:6d:d1:d2:e2:61:
- 95:77:b8:e3:a6:66:31:f9:1f:21:7d:62:e1:27:da:
- 94:37:61:4a:ea:63:53:a0:61:b8:9c:bb:a5:e2:e7:
- b7:a6:d8:0f:05:04:c7:29:e2:ea:49:2b:7f:de:15:
- 00:a6:18:70:50:c7:0c:de:9a:f9:5a:96:b0:e1:94:
- 06:c6:6d:4a:21:3b:b4:0f:a5:6d:92:86:34:b2:4e:
- d7:0e:a7:19:c0:77:0b:7b:87:c8:92:de:42:ff:86:
- d2:b7:9a:a4:d4:15:23:ca:ad:a5:69:21:b8:ce:7e:
- 66:cb:85:5d:b9:ed:8b:2d:09:8d:94:e4:04:1e:72:
- ec:ef:d0:76:90:15:5a:a4:f7:91:4b:e9:ce:4e:9d:
- 5d:9a:70:17:9c:d8:e9:73:83:ea:3d:61:99:a6:cd:
- ac:91:40:5a:88:77:e5:4e:2a:8e:3d:13:f3:f9:38:
- 6f:81:6b:8a:95:ca:0e:07:ab:6f:da:b4:8c:d9:ff:
- aa:78:03:aa:c7:c2:cf:6f:64:92:d3:d8:83:d5:af:
- f1:23:18:a7:2e:7b:17:0b:e7:7d:f1:fa:a8:41:a3:
- 04:57
- Exponent: 65537 (0x10001)
- X509v3 extensions:
- X509v3 Subject Key Identifier:
- EE:F0:B3:46:DC:C7:09:EB:0E:B6:2F:E5:FE:62:60:45:44:9F:59:CC
- X509v3 Authority Key Identifier:
- keyid:52:93:ED:1E:76:0A:9F:65:4F:DE:19:66:C1:D5:22:40:35:CB:A0:72
-
- X509v3 Basic Constraints:
- CA:FALSE
- X509v3 Key Usage:
- Digital Signature, Non Repudiation, Key Encipherment
- Signature Algorithm: sha256WithRSAEncryption
- 7e:5a:6e:be:bf:d2:6c:c1:d6:fa:b6:fb:3f:06:53:36:08:87:
- 9d:95:b1:39:af:9e:f6:47:38:17:39:da:25:7c:f2:ad:0c:e3:
- ab:74:19:ca:fb:8c:a0:50:c0:1d:19:8a:9c:21:ed:0f:3a:d1:
- 96:54:2e:10:09:4f:b8:70:f7:2b:99:43:d2:c6:15:bc:3f:24:
- 7d:28:39:32:3f:8d:a4:4f:40:75:7f:3e:0d:1c:d1:69:f2:4e:
- 98:83:47:97:d2:25:ac:c9:36:86:2f:04:a6:c4:86:c7:c4:00:
- 5f:7f:b9:ad:fc:bf:e9:f5:78:d7:82:1a:51:0d:fc:ab:9e:92:
- 1d:5f:0c:18:d1:82:e0:14:c9:ce:91:89:71:ff:49:49:ff:35:
- bf:7b:44:78:42:c1:d0:66:65:bb:28:2e:60:ca:9b:20:12:a9:
- 90:61:b1:96:ec:15:46:c9:37:f7:07:90:8a:89:45:2a:3f:37:
- ec:dc:e3:e5:8f:c3:3a:57:80:a5:54:60:0c:e1:b2:26:99:2b:
- 40:7e:36:d1:9a:70:02:ec:63:f4:3b:72:ae:81:fb:30:20:6d:
- cb:48:46:c6:b5:8f:39:b1:84:05:25:55:8d:f5:62:f6:1b:46:
- 2e:da:a3:4c:26:12:44:d7:56:b6:b8:a9:ca:d3:ab:71:45:7c:
- 9f:48:6d:1e
------BEGIN CERTIFICATE-----
-MIIDlDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADBeMQswCQYDVQQGEwJVUzEP
-MA0GA1UECBMGTmV2YWRhMRIwEAYDVQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdp
-dGh1Yi5jb20vbGliL3BxMQ4wDAYDVQQDEwVwcSBDQTAeFw0xNDEwMTExNTA1MTVa
-Fw0yNDEwMDgxNTA1MTVaMGExCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGEx
-EjAQBgNVBAcTCUxhcyBWZWdhczEaMBgGA1UEChMRZ2l0aHViLmNvbS9saWIvcHEx
-ETAPBgNVBAMTCHBvc3RncmVzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEA14pMhfsXpTyP4HIRKc4/sB8/fcbuf6f8Ais1RwimPZDfXFYUlADHbdHS4mGV
-d7jjpmYx+R8hfWLhJ9qUN2FK6mNToGG4nLul4ue3ptgPBQTHKeLqSSt/3hUAphhw
-UMcM3pr5Wpaw4ZQGxm1KITu0D6VtkoY0sk7XDqcZwHcLe4fIkt5C/4bSt5qk1BUj
-yq2laSG4zn5my4Vdue2LLQmNlOQEHnLs79B2kBVapPeRS+nOTp1dmnAXnNjpc4Pq
-PWGZps2skUBaiHflTiqOPRPz+ThvgWuKlcoOB6tv2rSM2f+qeAOqx8LPb2SS09iD
-1a/xIxinLnsXC+d98fqoQaMEVwIDAQABo1owWDAdBgNVHQ4EFgQU7vCzRtzHCesO
-ti/l/mJgRUSfWcwwHwYDVR0jBBgwFoAUUpPtHnYKn2VP3hlmwdUiQDXLoHIwCQYD
-VR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJKoZIhvcNAQELBQADggEBAH5abr6/0mzB
-1vq2+z8GUzYIh52VsTmvnvZHOBc52iV88q0M46t0Gcr7jKBQwB0Zipwh7Q860ZZU
-LhAJT7hw9yuZQ9LGFbw/JH0oOTI/jaRPQHV/Pg0c0WnyTpiDR5fSJazJNoYvBKbE
-hsfEAF9/ua38v+n1eNeCGlEN/Kuekh1fDBjRguAUyc6RiXH/SUn/Nb97RHhCwdBm
-ZbsoLmDKmyASqZBhsZbsFUbJN/cHkIqJRSo/N+zc4+WPwzpXgKVUYAzhsiaZK0B+
-NtGacALsY/Q7cq6B+zAgbctIRsa1jzmxhAUlVY31YvYbRi7ao0wmEkTXVra4qcrT
-q3FFfJ9IbR4=
------END CERTIFICATE-----
diff --git a/vendor/github.com/lib/pq/certs/server.key b/vendor/github.com/lib/pq/certs/server.key
deleted file mode 100644
index bd7b019b..00000000
--- a/vendor/github.com/lib/pq/certs/server.key
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEogIBAAKCAQEA14pMhfsXpTyP4HIRKc4/sB8/fcbuf6f8Ais1RwimPZDfXFYU
-lADHbdHS4mGVd7jjpmYx+R8hfWLhJ9qUN2FK6mNToGG4nLul4ue3ptgPBQTHKeLq
-SSt/3hUAphhwUMcM3pr5Wpaw4ZQGxm1KITu0D6VtkoY0sk7XDqcZwHcLe4fIkt5C
-/4bSt5qk1BUjyq2laSG4zn5my4Vdue2LLQmNlOQEHnLs79B2kBVapPeRS+nOTp1d
-mnAXnNjpc4PqPWGZps2skUBaiHflTiqOPRPz+ThvgWuKlcoOB6tv2rSM2f+qeAOq
-x8LPb2SS09iD1a/xIxinLnsXC+d98fqoQaMEVwIDAQABAoIBAF3ZoihUhJ82F4+r
-Gz4QyDpv4L1reT2sb1aiabhcU8ZK5nbWJG+tRyjSS/i2dNaEcttpdCj9HR/zhgZM
-bm0OuAgG58rVwgS80CZUruq++Qs+YVojq8/gWPTiQD4SNhV2Fmx3HkwLgUk3oxuT
-SsvdqzGE3okGVrutCIcgy126eA147VPMoej1Bb3fO6npqK0pFPhZfAc0YoqJuM+k
-obRm5pAnGUipyLCFXjA9HYPKwYZw2RtfdA3CiImHeanSdqS+ctrC9y8BV40Th7gZ
-haXdKUNdjmIxV695QQ1mkGqpKLZFqhzKioGQ2/Ly2d1iaKN9fZltTusu8unepWJ2
-tlT9qMECgYEA9uHaF1t2CqE+AJvWTihHhPIIuLxoOQXYea1qvxfcH/UMtaLKzCNm
-lQ5pqCGsPvp+10f36yttO1ZehIvlVNXuJsjt0zJmPtIolNuJY76yeussfQ9jHheB
-5uPEzCFlHzxYbBUyqgWaF6W74okRGzEGJXjYSP0yHPPdU4ep2q3bGiUCgYEA34Af
-wBSuQSK7uLxArWHvQhyuvi43ZGXls6oRGl+Ysj54s8BP6XGkq9hEJ6G4yxgyV+BR
-DUOs5X8/TLT8POuIMYvKTQthQyCk0eLv2FLdESDuuKx0kBVY3s8lK3/z5HhrdOiN
-VMNZU+xDKgKc3hN9ypkk8vcZe6EtH7Y14e0rVcsCgYBTgxi8F/M5K0wG9rAqphNz
-VFBA9XKn/2M33cKjO5X5tXIEKzpAjaUQvNxexG04rJGljzG8+mar0M6ONahw5yD1
-O7i/XWgazgpuOEkkVYiYbd8RutfDgR4vFVMn3hAP3eDnRtBplRWH9Ec3HTiNIys6
-F8PKBOQjyRZQQC7jyzW3hQKBgACe5HeuFwXLSOYsb6mLmhR+6+VPT4wR1F95W27N
-USk9jyxAnngxfpmTkiziABdgS9N+pfr5cyN4BP77ia/Jn6kzkC5Cl9SN5KdIkA3z
-vPVtN/x/ThuQU5zaymmig1ThGLtMYggYOslG4LDfLPxY5YKIhle+Y+259twdr2yf
-Mf2dAoGAaGv3tWMgnIdGRk6EQL/yb9PKHo7ShN+tKNlGaK7WwzBdKs+Fe8jkgcr7
-pz4Ne887CmxejdISzOCcdT+Zm9Bx6I/uZwWOtDvWpIgIxVX9a9URj/+D1MxTE/y4
-d6H+c89yDY62I2+drMpdjCd3EtCaTlxpTbRS+s1eAHMH7aEkcCE=
------END RSA PRIVATE KEY-----
diff --git a/vendor/github.com/lib/pq/conn_test.go b/vendor/github.com/lib/pq/conn_test.go
deleted file mode 100644
index e654b85b..00000000
--- a/vendor/github.com/lib/pq/conn_test.go
+++ /dev/null
@@ -1,1659 +0,0 @@
-package pq
-
-import (
- "context"
- "database/sql"
- "database/sql/driver"
- "fmt"
- "io"
- "net"
- "os"
- "reflect"
- "strings"
- "testing"
- "time"
-)
-
-type Fatalistic interface {
- Fatal(args ...interface{})
-}
-
-func forceBinaryParameters() bool {
- bp := os.Getenv("PQTEST_BINARY_PARAMETERS")
- if bp == "yes" {
- return true
- } else if bp == "" || bp == "no" {
- return false
- } else {
- panic("unexpected value for PQTEST_BINARY_PARAMETERS")
- }
-}
-
-func testConninfo(conninfo string) string {
- defaultTo := func(envvar string, value string) {
- if os.Getenv(envvar) == "" {
- os.Setenv(envvar, value)
- }
- }
- defaultTo("PGDATABASE", "pqgotest")
- defaultTo("PGSSLMODE", "disable")
- defaultTo("PGCONNECT_TIMEOUT", "20")
-
- if forceBinaryParameters() &&
- !strings.HasPrefix(conninfo, "postgres://") &&
- !strings.HasPrefix(conninfo, "postgresql://") {
- conninfo = conninfo + " binary_parameters=yes"
- }
- return conninfo
-}
-
-func openTestConnConninfo(conninfo string) (*sql.DB, error) {
- return sql.Open("postgres", testConninfo(conninfo))
-}
-
-func openTestConn(t Fatalistic) *sql.DB {
- conn, err := openTestConnConninfo("")
- if err != nil {
- t.Fatal(err)
- }
-
- return conn
-}
-
-func getServerVersion(t *testing.T, db *sql.DB) int {
- var version int
- err := db.QueryRow("SHOW server_version_num").Scan(&version)
- if err != nil {
- t.Fatal(err)
- }
- return version
-}
-
-func TestReconnect(t *testing.T) {
- db1 := openTestConn(t)
- defer db1.Close()
- tx, err := db1.Begin()
- if err != nil {
- t.Fatal(err)
- }
- var pid1 int
- err = tx.QueryRow("SELECT pg_backend_pid()").Scan(&pid1)
- if err != nil {
- t.Fatal(err)
- }
- db2 := openTestConn(t)
- defer db2.Close()
- _, err = db2.Exec("SELECT pg_terminate_backend($1)", pid1)
- if err != nil {
- t.Fatal(err)
- }
- // The rollback will probably "fail" because we just killed
- // its connection above
- _ = tx.Rollback()
-
- const expected int = 42
- var result int
- err = db1.QueryRow(fmt.Sprintf("SELECT %d", expected)).Scan(&result)
- if err != nil {
- t.Fatal(err)
- }
- if result != expected {
- t.Errorf("got %v; expected %v", result, expected)
- }
-}
-
-func TestCommitInFailedTransaction(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- rows, err := txn.Query("SELECT error")
- if err == nil {
- rows.Close()
- t.Fatal("expected failure")
- }
- err = txn.Commit()
- if err != ErrInFailedTransaction {
- t.Fatalf("expected ErrInFailedTransaction; got %#v", err)
- }
-}
-
-func TestOpenURL(t *testing.T) {
- testURL := func(url string) {
- db, err := openTestConnConninfo(url)
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
- // database/sql might not call our Open at all unless we do something with
- // the connection
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- txn.Rollback()
- }
- testURL("postgres://")
- testURL("postgresql://")
-}
-
-const pgpassFile = "/tmp/pqgotest_pgpass"
-
-func TestPgpass(t *testing.T) {
- if os.Getenv("TRAVIS") != "true" {
- t.Skip("not running under Travis, skipping pgpass tests")
- }
-
- testAssert := func(conninfo string, expected string, reason string) {
- conn, err := openTestConnConninfo(conninfo)
- if err != nil {
- t.Fatal(err)
- }
- defer conn.Close()
-
- txn, err := conn.Begin()
- if err != nil {
- if expected != "fail" {
- t.Fatalf(reason, err)
- }
- return
- }
- rows, err := txn.Query("SELECT USER")
- if err != nil {
- txn.Rollback()
- if expected != "fail" {
- t.Fatalf(reason, err)
- }
- } else {
- rows.Close()
- if expected != "ok" {
- t.Fatalf(reason, err)
- }
- }
- txn.Rollback()
- }
- testAssert("", "ok", "missing .pgpass, unexpected error %#v")
- os.Setenv("PGPASSFILE", pgpassFile)
- testAssert("host=/tmp", "fail", ", unexpected error %#v")
- os.Remove(pgpassFile)
- pgpass, err := os.OpenFile(pgpassFile, os.O_RDWR|os.O_CREATE, 0644)
- if err != nil {
- t.Fatalf("Unexpected error writing pgpass file %#v", err)
- }
- _, err = pgpass.WriteString(`# comment
-server:5432:some_db:some_user:pass_A
-*:5432:some_db:some_user:pass_B
-localhost:*:*:*:pass_C
-*:*:*:*:pass_fallback
-`)
- if err != nil {
- t.Fatalf("Unexpected error writing pgpass file %#v", err)
- }
- pgpass.Close()
-
- assertPassword := func(extra values, expected string) {
- o := values{
- "host": "localhost",
- "sslmode": "disable",
- "connect_timeout": "20",
- "user": "majid",
- "port": "5432",
- "extra_float_digits": "2",
- "dbname": "pqgotest",
- "client_encoding": "UTF8",
- "datestyle": "ISO, MDY",
- }
- for k, v := range extra {
- o[k] = v
- }
- (&conn{}).handlePgpass(o)
- if pw := o["password"]; pw != expected {
- t.Fatalf("For %v expected %s got %s", extra, expected, pw)
- }
- }
- // wrong permissions for the pgpass file means it should be ignored
- assertPassword(values{"host": "example.com", "user": "foo"}, "")
- // fix the permissions and check if it has taken effect
- os.Chmod(pgpassFile, 0600)
- assertPassword(values{"host": "server", "dbname": "some_db", "user": "some_user"}, "pass_A")
- assertPassword(values{"host": "example.com", "user": "foo"}, "pass_fallback")
- assertPassword(values{"host": "example.com", "dbname": "some_db", "user": "some_user"}, "pass_B")
- // localhost also matches the default "" and UNIX sockets
- assertPassword(values{"host": "", "user": "some_user"}, "pass_C")
- assertPassword(values{"host": "/tmp", "user": "some_user"}, "pass_C")
- // cleanup
- os.Remove(pgpassFile)
- os.Setenv("PGPASSFILE", "")
-}
-
-func TestExec(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Exec("CREATE TEMP TABLE temp (a int)")
- if err != nil {
- t.Fatal(err)
- }
-
- r, err := db.Exec("INSERT INTO temp VALUES (1)")
- if err != nil {
- t.Fatal(err)
- }
-
- if n, _ := r.RowsAffected(); n != 1 {
- t.Fatalf("expected 1 row affected, not %d", n)
- }
-
- r, err = db.Exec("INSERT INTO temp VALUES ($1), ($2), ($3)", 1, 2, 3)
- if err != nil {
- t.Fatal(err)
- }
-
- if n, _ := r.RowsAffected(); n != 3 {
- t.Fatalf("expected 3 rows affected, not %d", n)
- }
-
- // SELECT doesn't send the number of returned rows in the command tag
- // before 9.0
- if getServerVersion(t, db) >= 90000 {
- r, err = db.Exec("SELECT g FROM generate_series(1, 2) g")
- if err != nil {
- t.Fatal(err)
- }
- if n, _ := r.RowsAffected(); n != 2 {
- t.Fatalf("expected 2 rows affected, not %d", n)
- }
-
- r, err = db.Exec("SELECT g FROM generate_series(1, $1) g", 3)
- if err != nil {
- t.Fatal(err)
- }
- if n, _ := r.RowsAffected(); n != 3 {
- t.Fatalf("expected 3 rows affected, not %d", n)
- }
- }
-}
-
-func TestStatment(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- st, err := db.Prepare("SELECT 1")
- if err != nil {
- t.Fatal(err)
- }
-
- st1, err := db.Prepare("SELECT 2")
- if err != nil {
- t.Fatal(err)
- }
-
- r, err := st.Query()
- if err != nil {
- t.Fatal(err)
- }
- defer r.Close()
-
- if !r.Next() {
- t.Fatal("expected row")
- }
-
- var i int
- err = r.Scan(&i)
- if err != nil {
- t.Fatal(err)
- }
-
- if i != 1 {
- t.Fatalf("expected 1, got %d", i)
- }
-
- // st1
-
- r1, err := st1.Query()
- if err != nil {
- t.Fatal(err)
- }
- defer r1.Close()
-
- if !r1.Next() {
- if r.Err() != nil {
- t.Fatal(r1.Err())
- }
- t.Fatal("expected row")
- }
-
- err = r1.Scan(&i)
- if err != nil {
- t.Fatal(err)
- }
-
- if i != 2 {
- t.Fatalf("expected 2, got %d", i)
- }
-}
-
-func TestRowsCloseBeforeDone(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- r, err := db.Query("SELECT 1")
- if err != nil {
- t.Fatal(err)
- }
-
- err = r.Close()
- if err != nil {
- t.Fatal(err)
- }
-
- if r.Next() {
- t.Fatal("unexpected row")
- }
-
- if r.Err() != nil {
- t.Fatal(r.Err())
- }
-}
-
-func TestParameterCountMismatch(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- var notused int
- err := db.QueryRow("SELECT false", 1).Scan(¬used)
- if err == nil {
- t.Fatal("expected err")
- }
- // make sure we clean up correctly
- err = db.QueryRow("SELECT 1").Scan(¬used)
- if err != nil {
- t.Fatal(err)
- }
-
- err = db.QueryRow("SELECT $1").Scan(¬used)
- if err == nil {
- t.Fatal("expected err")
- }
- // make sure we clean up correctly
- err = db.QueryRow("SELECT 1").Scan(¬used)
- if err != nil {
- t.Fatal(err)
- }
-}
-
-// Test that EmptyQueryResponses are handled correctly.
-func TestEmptyQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- res, err := db.Exec("")
- if err != nil {
- t.Fatal(err)
- }
- if _, err := res.RowsAffected(); err != errNoRowsAffected {
- t.Fatalf("expected %s, got %v", errNoRowsAffected, err)
- }
- if _, err := res.LastInsertId(); err != errNoLastInsertID {
- t.Fatalf("expected %s, got %v", errNoLastInsertID, err)
- }
- rows, err := db.Query("")
- if err != nil {
- t.Fatal(err)
- }
- cols, err := rows.Columns()
- if err != nil {
- t.Fatal(err)
- }
- if len(cols) != 0 {
- t.Fatalf("unexpected number of columns %d in response to an empty query", len(cols))
- }
- if rows.Next() {
- t.Fatal("unexpected row")
- }
- if rows.Err() != nil {
- t.Fatal(rows.Err())
- }
-
- stmt, err := db.Prepare("")
- if err != nil {
- t.Fatal(err)
- }
- res, err = stmt.Exec()
- if err != nil {
- t.Fatal(err)
- }
- if _, err := res.RowsAffected(); err != errNoRowsAffected {
- t.Fatalf("expected %s, got %v", errNoRowsAffected, err)
- }
- if _, err := res.LastInsertId(); err != errNoLastInsertID {
- t.Fatalf("expected %s, got %v", errNoLastInsertID, err)
- }
- rows, err = stmt.Query()
- if err != nil {
- t.Fatal(err)
- }
- cols, err = rows.Columns()
- if err != nil {
- t.Fatal(err)
- }
- if len(cols) != 0 {
- t.Fatalf("unexpected number of columns %d in response to an empty query", len(cols))
- }
- if rows.Next() {
- t.Fatal("unexpected row")
- }
- if rows.Err() != nil {
- t.Fatal(rows.Err())
- }
-}
-
-// Test that rows.Columns() is correct even if there are no result rows.
-func TestEmptyResultSetColumns(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- rows, err := db.Query("SELECT 1 AS a, text 'bar' AS bar WHERE FALSE")
- if err != nil {
- t.Fatal(err)
- }
- cols, err := rows.Columns()
- if err != nil {
- t.Fatal(err)
- }
- if len(cols) != 2 {
- t.Fatalf("unexpected number of columns %d in response to an empty query", len(cols))
- }
- if rows.Next() {
- t.Fatal("unexpected row")
- }
- if rows.Err() != nil {
- t.Fatal(rows.Err())
- }
- if cols[0] != "a" || cols[1] != "bar" {
- t.Fatalf("unexpected Columns result %v", cols)
- }
-
- stmt, err := db.Prepare("SELECT $1::int AS a, text 'bar' AS bar WHERE FALSE")
- if err != nil {
- t.Fatal(err)
- }
- rows, err = stmt.Query(1)
- if err != nil {
- t.Fatal(err)
- }
- cols, err = rows.Columns()
- if err != nil {
- t.Fatal(err)
- }
- if len(cols) != 2 {
- t.Fatalf("unexpected number of columns %d in response to an empty query", len(cols))
- }
- if rows.Next() {
- t.Fatal("unexpected row")
- }
- if rows.Err() != nil {
- t.Fatal(rows.Err())
- }
- if cols[0] != "a" || cols[1] != "bar" {
- t.Fatalf("unexpected Columns result %v", cols)
- }
-
-}
-
-func TestEncodeDecode(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- q := `
- SELECT
- E'\\000\\001\\002'::bytea,
- 'foobar'::text,
- NULL::integer,
- '2000-1-1 01:02:03.04-7'::timestamptz,
- 0::boolean,
- 123,
- -321,
- 3.14::float8
- WHERE
- E'\\000\\001\\002'::bytea = $1
- AND 'foobar'::text = $2
- AND $3::integer is NULL
- `
- // AND '2000-1-1 12:00:00.000000-7'::timestamp = $3
-
- exp1 := []byte{0, 1, 2}
- exp2 := "foobar"
-
- r, err := db.Query(q, exp1, exp2, nil)
- if err != nil {
- t.Fatal(err)
- }
- defer r.Close()
-
- if !r.Next() {
- if r.Err() != nil {
- t.Fatal(r.Err())
- }
- t.Fatal("expected row")
- }
-
- var got1 []byte
- var got2 string
- var got3 = sql.NullInt64{Valid: true}
- var got4 time.Time
- var got5, got6, got7, got8 interface{}
-
- err = r.Scan(&got1, &got2, &got3, &got4, &got5, &got6, &got7, &got8)
- if err != nil {
- t.Fatal(err)
- }
-
- if !reflect.DeepEqual(exp1, got1) {
- t.Errorf("expected %q byte: %q", exp1, got1)
- }
-
- if !reflect.DeepEqual(exp2, got2) {
- t.Errorf("expected %q byte: %q", exp2, got2)
- }
-
- if got3.Valid {
- t.Fatal("expected invalid")
- }
-
- if got4.Year() != 2000 {
- t.Fatal("wrong year")
- }
-
- if got5 != false {
- t.Fatalf("expected false, got %q", got5)
- }
-
- if got6 != int64(123) {
- t.Fatalf("expected 123, got %d", got6)
- }
-
- if got7 != int64(-321) {
- t.Fatalf("expected -321, got %d", got7)
- }
-
- if got8 != float64(3.14) {
- t.Fatalf("expected 3.14, got %f", got8)
- }
-}
-
-func TestNoData(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- st, err := db.Prepare("SELECT 1 WHERE true = false")
- if err != nil {
- t.Fatal(err)
- }
- defer st.Close()
-
- r, err := st.Query()
- if err != nil {
- t.Fatal(err)
- }
- defer r.Close()
-
- if r.Next() {
- if r.Err() != nil {
- t.Fatal(r.Err())
- }
- t.Fatal("unexpected row")
- }
-
- _, err = db.Query("SELECT * FROM nonexistenttable WHERE age=$1", 20)
- if err == nil {
- t.Fatal("Should have raised an error on non existent table")
- }
-
- _, err = db.Query("SELECT * FROM nonexistenttable")
- if err == nil {
- t.Fatal("Should have raised an error on non existent table")
- }
-}
-
-func TestErrorDuringStartup(t *testing.T) {
- // Don't use the normal connection setup, this is intended to
- // blow up in the startup packet from a non-existent user.
- db, err := openTestConnConninfo("user=thisuserreallydoesntexist")
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
-
- _, err = db.Begin()
- if err == nil {
- t.Fatal("expected error")
- }
-
- e, ok := err.(*Error)
- if !ok {
- t.Fatalf("expected Error, got %#v", err)
- } else if e.Code.Name() != "invalid_authorization_specification" && e.Code.Name() != "invalid_password" {
- t.Fatalf("expected invalid_authorization_specification or invalid_password, got %s (%+v)", e.Code.Name(), err)
- }
-}
-
-type testConn struct {
- closed bool
- net.Conn
-}
-
-func (c *testConn) Close() error {
- c.closed = true
- return c.Conn.Close()
-}
-
-type testDialer struct {
- conns []*testConn
-}
-
-func (d *testDialer) Dial(ntw, addr string) (net.Conn, error) {
- c, err := net.Dial(ntw, addr)
- if err != nil {
- return nil, err
- }
- tc := &testConn{Conn: c}
- d.conns = append(d.conns, tc)
- return tc, nil
-}
-
-func (d *testDialer) DialTimeout(ntw, addr string, timeout time.Duration) (net.Conn, error) {
- c, err := net.DialTimeout(ntw, addr, timeout)
- if err != nil {
- return nil, err
- }
- tc := &testConn{Conn: c}
- d.conns = append(d.conns, tc)
- return tc, nil
-}
-
-func TestErrorDuringStartupClosesConn(t *testing.T) {
- // Don't use the normal connection setup, this is intended to
- // blow up in the startup packet from a non-existent user.
- var d testDialer
- c, err := DialOpen(&d, testConninfo("user=thisuserreallydoesntexist"))
- if err == nil {
- c.Close()
- t.Fatal("expected dial error")
- }
- if len(d.conns) != 1 {
- t.Fatalf("got len(d.conns) = %d, want = %d", len(d.conns), 1)
- }
- if !d.conns[0].closed {
- t.Error("connection leaked")
- }
-}
-
-func TestBadConn(t *testing.T) {
- var err error
-
- cn := conn{}
- func() {
- defer cn.errRecover(&err)
- panic(io.EOF)
- }()
- if err != driver.ErrBadConn {
- t.Fatalf("expected driver.ErrBadConn, got: %#v", err)
- }
- if !cn.bad {
- t.Fatalf("expected cn.bad")
- }
-
- cn = conn{}
- func() {
- defer cn.errRecover(&err)
- e := &Error{Severity: Efatal}
- panic(e)
- }()
- if err != driver.ErrBadConn {
- t.Fatalf("expected driver.ErrBadConn, got: %#v", err)
- }
- if !cn.bad {
- t.Fatalf("expected cn.bad")
- }
-}
-
-// TestCloseBadConn tests that the underlying connection can be closed with
-// Close after an error.
-func TestCloseBadConn(t *testing.T) {
- nc, err := net.Dial("tcp", "localhost:5432")
- if err != nil {
- t.Fatal(err)
- }
- cn := conn{c: nc}
- func() {
- defer cn.errRecover(&err)
- panic(io.EOF)
- }()
- // Verify we can write before closing.
- if _, err := nc.Write(nil); err != nil {
- t.Fatal(err)
- }
- // First close should close the connection.
- if err := cn.Close(); err != nil {
- t.Fatal(err)
- }
-
- // During the Go 1.9 cycle, https://github.com/golang/go/commit/3792db5
- // changed this error from
- //
- // net.errClosing = errors.New("use of closed network connection")
- //
- // to
- //
- // internal/poll.ErrClosing = errors.New("use of closed file or network connection")
- const errClosing = "use of closed"
-
- // Verify write after closing fails.
- if _, err := nc.Write(nil); err == nil {
- t.Fatal("expected error")
- } else if !strings.Contains(err.Error(), errClosing) {
- t.Fatalf("expected %s error, got %s", errClosing, err)
- }
- // Verify second close fails.
- if err := cn.Close(); err == nil {
- t.Fatal("expected error")
- } else if !strings.Contains(err.Error(), errClosing) {
- t.Fatalf("expected %s error, got %s", errClosing, err)
- }
-}
-
-func TestErrorOnExec(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMPORARY TABLE foo(f1 int PRIMARY KEY)")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = txn.Exec("INSERT INTO foo VALUES (0), (0)")
- if err == nil {
- t.Fatal("Should have raised error")
- }
-
- e, ok := err.(*Error)
- if !ok {
- t.Fatalf("expected Error, got %#v", err)
- } else if e.Code.Name() != "unique_violation" {
- t.Fatalf("expected unique_violation, got %s (%+v)", e.Code.Name(), err)
- }
-}
-
-func TestErrorOnQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMPORARY TABLE foo(f1 int PRIMARY KEY)")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = txn.Query("INSERT INTO foo VALUES (0), (0)")
- if err == nil {
- t.Fatal("Should have raised error")
- }
-
- e, ok := err.(*Error)
- if !ok {
- t.Fatalf("expected Error, got %#v", err)
- } else if e.Code.Name() != "unique_violation" {
- t.Fatalf("expected unique_violation, got %s (%+v)", e.Code.Name(), err)
- }
-}
-
-func TestErrorOnQueryRowSimpleQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMPORARY TABLE foo(f1 int PRIMARY KEY)")
- if err != nil {
- t.Fatal(err)
- }
-
- var v int
- err = txn.QueryRow("INSERT INTO foo VALUES (0), (0)").Scan(&v)
- if err == nil {
- t.Fatal("Should have raised error")
- }
-
- e, ok := err.(*Error)
- if !ok {
- t.Fatalf("expected Error, got %#v", err)
- } else if e.Code.Name() != "unique_violation" {
- t.Fatalf("expected unique_violation, got %s (%+v)", e.Code.Name(), err)
- }
-}
-
-// Test the QueryRow bug workarounds in stmt.exec() and simpleQuery()
-func TestQueryRowBugWorkaround(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- // stmt.exec()
- _, err := db.Exec("CREATE TEMP TABLE notnulltemp (a varchar(10) not null)")
- if err != nil {
- t.Fatal(err)
- }
-
- var a string
- err = db.QueryRow("INSERT INTO notnulltemp(a) values($1) RETURNING a", nil).Scan(&a)
- if err == sql.ErrNoRows {
- t.Fatalf("expected constraint violation error; got: %v", err)
- }
- pge, ok := err.(*Error)
- if !ok {
- t.Fatalf("expected *Error; got: %#v", err)
- }
- if pge.Code.Name() != "not_null_violation" {
- t.Fatalf("expected not_null_violation; got: %s (%+v)", pge.Code.Name(), err)
- }
-
- // Test workaround in simpleQuery()
- tx, err := db.Begin()
- if err != nil {
- t.Fatalf("unexpected error %s in Begin", err)
- }
- defer tx.Rollback()
-
- _, err = tx.Exec("SET LOCAL check_function_bodies TO FALSE")
- if err != nil {
- t.Fatalf("could not disable check_function_bodies: %s", err)
- }
- _, err = tx.Exec(`
-CREATE OR REPLACE FUNCTION bad_function()
-RETURNS integer
--- hack to prevent the function from being inlined
-SET check_function_bodies TO TRUE
-AS $$
- SELECT text 'bad'
-$$ LANGUAGE sql`)
- if err != nil {
- t.Fatalf("could not create function: %s", err)
- }
-
- err = tx.QueryRow("SELECT * FROM bad_function()").Scan(&a)
- if err == nil {
- t.Fatalf("expected error")
- }
- pge, ok = err.(*Error)
- if !ok {
- t.Fatalf("expected *Error; got: %#v", err)
- }
- if pge.Code.Name() != "invalid_function_definition" {
- t.Fatalf("expected invalid_function_definition; got: %s (%+v)", pge.Code.Name(), err)
- }
-
- err = tx.Rollback()
- if err != nil {
- t.Fatalf("unexpected error %s in Rollback", err)
- }
-
- // Also test that simpleQuery()'s workaround works when the query fails
- // after a row has been received.
- rows, err := db.Query(`
-select
- (select generate_series(1, ss.i))
-from (select gs.i
- from generate_series(1, 2) gs(i)
- order by gs.i limit 2) ss`)
- if err != nil {
- t.Fatalf("query failed: %s", err)
- }
- if !rows.Next() {
- t.Fatalf("expected at least one result row; got %s", rows.Err())
- }
- var i int
- err = rows.Scan(&i)
- if err != nil {
- t.Fatalf("rows.Scan() failed: %s", err)
- }
- if i != 1 {
- t.Fatalf("unexpected value for i: %d", i)
- }
- if rows.Next() {
- t.Fatalf("unexpected row")
- }
- pge, ok = rows.Err().(*Error)
- if !ok {
- t.Fatalf("expected *Error; got: %#v", err)
- }
- if pge.Code.Name() != "cardinality_violation" {
- t.Fatalf("expected cardinality_violation; got: %s (%+v)", pge.Code.Name(), rows.Err())
- }
-}
-
-func TestSimpleQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- r, err := db.Query("select 1")
- if err != nil {
- t.Fatal(err)
- }
- defer r.Close()
-
- if !r.Next() {
- t.Fatal("expected row")
- }
-}
-
-func TestBindError(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Exec("create temp table test (i integer)")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Query("select * from test where i=$1", "hhh")
- if err == nil {
- t.Fatal("expected an error")
- }
-
- // Should not get error here
- r, err := db.Query("select * from test where i=$1", 1)
- if err != nil {
- t.Fatal(err)
- }
- defer r.Close()
-}
-
-func TestParseErrorInExtendedQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Query("PARSE_ERROR $1", 1)
- pqErr, _ := err.(*Error)
- // Expecting a syntax error.
- if err == nil || pqErr == nil || pqErr.Code != "42601" {
- t.Fatalf("expected syntax error, got %s", err)
- }
-
- rows, err := db.Query("SELECT 1")
- if err != nil {
- t.Fatal(err)
- }
- rows.Close()
-}
-
-// TestReturning tests that an INSERT query using the RETURNING clause returns a row.
-func TestReturning(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Exec("CREATE TEMP TABLE distributors (did integer default 0, dname text)")
- if err != nil {
- t.Fatal(err)
- }
-
- rows, err := db.Query("INSERT INTO distributors (did, dname) VALUES (DEFAULT, 'XYZ Widgets') " +
- "RETURNING did;")
- if err != nil {
- t.Fatal(err)
- }
- if !rows.Next() {
- t.Fatal("no rows")
- }
- var did int
- err = rows.Scan(&did)
- if err != nil {
- t.Fatal(err)
- }
- if did != 0 {
- t.Fatalf("bad value for did: got %d, want %d", did, 0)
- }
-
- if rows.Next() {
- t.Fatal("unexpected next row")
- }
- err = rows.Err()
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestIssue186(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- // Exec() a query which returns results
- _, err := db.Exec("VALUES (1), (2), (3)")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("VALUES ($1), ($2), ($3)", 1, 2, 3)
- if err != nil {
- t.Fatal(err)
- }
-
- // Query() a query which doesn't return any results
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- rows, err := txn.Query("CREATE TEMP TABLE foo(f1 int)")
- if err != nil {
- t.Fatal(err)
- }
- if err = rows.Close(); err != nil {
- t.Fatal(err)
- }
-
- // small trick to get NoData from a parameterized query
- _, err = txn.Exec("CREATE RULE nodata AS ON INSERT TO foo DO INSTEAD NOTHING")
- if err != nil {
- t.Fatal(err)
- }
- rows, err = txn.Query("INSERT INTO foo VALUES ($1)", 1)
- if err != nil {
- t.Fatal(err)
- }
- if err = rows.Close(); err != nil {
- t.Fatal(err)
- }
-}
-
-func TestIssue196(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- row := db.QueryRow("SELECT float4 '0.10000122' = $1, float8 '35.03554004971999' = $2",
- float32(0.10000122), float64(35.03554004971999))
-
- var float4match, float8match bool
- err := row.Scan(&float4match, &float8match)
- if err != nil {
- t.Fatal(err)
- }
- if !float4match {
- t.Errorf("Expected float4 fidelity to be maintained; got no match")
- }
- if !float8match {
- t.Errorf("Expected float8 fidelity to be maintained; got no match")
- }
-}
-
-// Test that any CommandComplete messages sent before the query results are
-// ignored.
-func TestIssue282(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- var searchPath string
- err := db.QueryRow(`
- SET LOCAL search_path TO pg_catalog;
- SET LOCAL search_path TO pg_catalog;
- SHOW search_path`).Scan(&searchPath)
- if err != nil {
- t.Fatal(err)
- }
- if searchPath != "pg_catalog" {
- t.Fatalf("unexpected search_path %s", searchPath)
- }
-}
-
-func TestReadFloatPrecision(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- row := db.QueryRow("SELECT float4 '0.10000122', float8 '35.03554004971999'")
- var float4val float32
- var float8val float64
- err := row.Scan(&float4val, &float8val)
- if err != nil {
- t.Fatal(err)
- }
- if float4val != float32(0.10000122) {
- t.Errorf("Expected float4 fidelity to be maintained; got no match")
- }
- if float8val != float64(35.03554004971999) {
- t.Errorf("Expected float8 fidelity to be maintained; got no match")
- }
-}
-
-func TestXactMultiStmt(t *testing.T) {
- // minified test case based on bug reports from
- // pico303@gmail.com and rangelspam@gmail.com
- t.Skip("Skipping failing test")
- db := openTestConn(t)
- defer db.Close()
-
- tx, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer tx.Commit()
-
- rows, err := tx.Query("select 1")
- if err != nil {
- t.Fatal(err)
- }
-
- if rows.Next() {
- var val int32
- if err = rows.Scan(&val); err != nil {
- t.Fatal(err)
- }
- } else {
- t.Fatal("Expected at least one row in first query in xact")
- }
-
- rows2, err := tx.Query("select 2")
- if err != nil {
- t.Fatal(err)
- }
-
- if rows2.Next() {
- var val2 int32
- if err := rows2.Scan(&val2); err != nil {
- t.Fatal(err)
- }
- } else {
- t.Fatal("Expected at least one row in second query in xact")
- }
-
- if err = rows.Err(); err != nil {
- t.Fatal(err)
- }
-
- if err = rows2.Err(); err != nil {
- t.Fatal(err)
- }
-
- if err = tx.Commit(); err != nil {
- t.Fatal(err)
- }
-}
-
-var envParseTests = []struct {
- Expected map[string]string
- Env []string
-}{
- {
- Env: []string{"PGDATABASE=hello", "PGUSER=goodbye"},
- Expected: map[string]string{"dbname": "hello", "user": "goodbye"},
- },
- {
- Env: []string{"PGDATESTYLE=ISO, MDY"},
- Expected: map[string]string{"datestyle": "ISO, MDY"},
- },
- {
- Env: []string{"PGCONNECT_TIMEOUT=30"},
- Expected: map[string]string{"connect_timeout": "30"},
- },
-}
-
-func TestParseEnviron(t *testing.T) {
- for i, tt := range envParseTests {
- results := parseEnviron(tt.Env)
- if !reflect.DeepEqual(tt.Expected, results) {
- t.Errorf("%d: Expected: %#v Got: %#v", i, tt.Expected, results)
- }
- }
-}
-
-func TestParseComplete(t *testing.T) {
- tpc := func(commandTag string, command string, affectedRows int64, shouldFail bool) {
- defer func() {
- if p := recover(); p != nil {
- if !shouldFail {
- t.Error(p)
- }
- }
- }()
- cn := &conn{}
- res, c := cn.parseComplete(commandTag)
- if c != command {
- t.Errorf("Expected %v, got %v", command, c)
- }
- n, err := res.RowsAffected()
- if err != nil {
- t.Fatal(err)
- }
- if n != affectedRows {
- t.Errorf("Expected %d, got %d", affectedRows, n)
- }
- }
-
- tpc("ALTER TABLE", "ALTER TABLE", 0, false)
- tpc("INSERT 0 1", "INSERT", 1, false)
- tpc("UPDATE 100", "UPDATE", 100, false)
- tpc("SELECT 100", "SELECT", 100, false)
- tpc("FETCH 100", "FETCH", 100, false)
- // allow COPY (and others) without row count
- tpc("COPY", "COPY", 0, false)
- // don't fail on command tags we don't recognize
- tpc("UNKNOWNCOMMANDTAG", "UNKNOWNCOMMANDTAG", 0, false)
-
- // failure cases
- tpc("INSERT 1", "", 0, true) // missing oid
- tpc("UPDATE 0 1", "", 0, true) // too many numbers
- tpc("SELECT foo", "", 0, true) // invalid row count
-}
-
-// Test interface conformance.
-var (
- _ driver.ExecerContext = (*conn)(nil)
- _ driver.QueryerContext = (*conn)(nil)
-)
-
-func TestNullAfterNonNull(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- r, err := db.Query("SELECT 9::integer UNION SELECT NULL::integer")
- if err != nil {
- t.Fatal(err)
- }
-
- var n sql.NullInt64
-
- if !r.Next() {
- if r.Err() != nil {
- t.Fatal(err)
- }
- t.Fatal("expected row")
- }
-
- if err := r.Scan(&n); err != nil {
- t.Fatal(err)
- }
-
- if n.Int64 != 9 {
- t.Fatalf("expected 2, not %d", n.Int64)
- }
-
- if !r.Next() {
- if r.Err() != nil {
- t.Fatal(err)
- }
- t.Fatal("expected row")
- }
-
- if err := r.Scan(&n); err != nil {
- t.Fatal(err)
- }
-
- if n.Valid {
- t.Fatal("expected n to be invalid")
- }
-
- if n.Int64 != 0 {
- t.Fatalf("expected n to 2, not %d", n.Int64)
- }
-}
-
-func Test64BitErrorChecking(t *testing.T) {
- defer func() {
- if err := recover(); err != nil {
- t.Fatal("panic due to 0xFFFFFFFF != -1 " +
- "when int is 64 bits")
- }
- }()
-
- db := openTestConn(t)
- defer db.Close()
-
- r, err := db.Query(`SELECT *
-FROM (VALUES (0::integer, NULL::text), (1, 'test string')) AS t;`)
-
- if err != nil {
- t.Fatal(err)
- }
-
- defer r.Close()
-
- for r.Next() {
- }
-}
-
-func TestCommit(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Exec("CREATE TEMP TABLE temp (a int)")
- if err != nil {
- t.Fatal(err)
- }
- sqlInsert := "INSERT INTO temp VALUES (1)"
- sqlSelect := "SELECT * FROM temp"
- tx, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- _, err = tx.Exec(sqlInsert)
- if err != nil {
- t.Fatal(err)
- }
- err = tx.Commit()
- if err != nil {
- t.Fatal(err)
- }
- var i int
- err = db.QueryRow(sqlSelect).Scan(&i)
- if err != nil {
- t.Fatal(err)
- }
- if i != 1 {
- t.Fatalf("expected 1, got %d", i)
- }
-}
-
-func TestErrorClass(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Query("SELECT int 'notint'")
- if err == nil {
- t.Fatal("expected error")
- }
- pge, ok := err.(*Error)
- if !ok {
- t.Fatalf("expected *pq.Error, got %#+v", err)
- }
- if pge.Code.Class() != "22" {
- t.Fatalf("expected class 28, got %v", pge.Code.Class())
- }
- if pge.Code.Class().Name() != "data_exception" {
- t.Fatalf("expected data_exception, got %v", pge.Code.Class().Name())
- }
-}
-
-func TestParseOpts(t *testing.T) {
- tests := []struct {
- in string
- expected values
- valid bool
- }{
- {"dbname=hello user=goodbye", values{"dbname": "hello", "user": "goodbye"}, true},
- {"dbname=hello user=goodbye ", values{"dbname": "hello", "user": "goodbye"}, true},
- {"dbname = hello user=goodbye", values{"dbname": "hello", "user": "goodbye"}, true},
- {"dbname=hello user =goodbye", values{"dbname": "hello", "user": "goodbye"}, true},
- {"dbname=hello user= goodbye", values{"dbname": "hello", "user": "goodbye"}, true},
- {"host=localhost password='correct horse battery staple'", values{"host": "localhost", "password": "correct horse battery staple"}, true},
- {"dbname=データベース password=パスワード", values{"dbname": "データベース", "password": "パスワード"}, true},
- {"dbname=hello user=''", values{"dbname": "hello", "user": ""}, true},
- {"user='' dbname=hello", values{"dbname": "hello", "user": ""}, true},
- // The last option value is an empty string if there's no non-whitespace after its =
- {"dbname=hello user= ", values{"dbname": "hello", "user": ""}, true},
-
- // The parser ignores spaces after = and interprets the next set of non-whitespace characters as the value.
- {"user= password=foo", values{"user": "password=foo"}, true},
-
- // Backslash escapes next char
- {`user=a\ \'\\b`, values{"user": `a '\b`}, true},
- {`user='a \'b'`, values{"user": `a 'b`}, true},
-
- // Incomplete escape
- {`user=x\`, values{}, false},
-
- // No '=' after the key
- {"postgre://marko@internet", values{}, false},
- {"dbname user=goodbye", values{}, false},
- {"user=foo blah", values{}, false},
- {"user=foo blah ", values{}, false},
-
- // Unterminated quoted value
- {"dbname=hello user='unterminated", values{}, false},
- }
-
- for _, test := range tests {
- o := make(values)
- err := parseOpts(test.in, o)
-
- switch {
- case err != nil && test.valid:
- t.Errorf("%q got unexpected error: %s", test.in, err)
- case err == nil && test.valid && !reflect.DeepEqual(test.expected, o):
- t.Errorf("%q got: %#v want: %#v", test.in, o, test.expected)
- case err == nil && !test.valid:
- t.Errorf("%q expected an error", test.in)
- }
- }
-}
-
-func TestRuntimeParameters(t *testing.T) {
- tests := []struct {
- conninfo string
- param string
- expected string
- success bool
- }{
- // invalid parameter
- {"DOESNOTEXIST=foo", "", "", false},
- // we can only work with a specific value for these two
- {"client_encoding=SQL_ASCII", "", "", false},
- {"datestyle='ISO, YDM'", "", "", false},
- // "options" should work exactly as it does in libpq
- {"options='-c search_path=pqgotest'", "search_path", "pqgotest", true},
- // pq should override client_encoding in this case
- {"options='-c client_encoding=SQL_ASCII'", "client_encoding", "UTF8", true},
- // allow client_encoding to be set explicitly
- {"client_encoding=UTF8", "client_encoding", "UTF8", true},
- // test a runtime parameter not supported by libpq
- {"work_mem='139kB'", "work_mem", "139kB", true},
- // test fallback_application_name
- {"application_name=foo fallback_application_name=bar", "application_name", "foo", true},
- {"application_name='' fallback_application_name=bar", "application_name", "", true},
- {"fallback_application_name=bar", "application_name", "bar", true},
- }
-
- for _, test := range tests {
- db, err := openTestConnConninfo(test.conninfo)
- if err != nil {
- t.Fatal(err)
- }
-
- // application_name didn't exist before 9.0
- if test.param == "application_name" && getServerVersion(t, db) < 90000 {
- db.Close()
- continue
- }
-
- tryGetParameterValue := func() (value string, success bool) {
- defer db.Close()
- row := db.QueryRow("SELECT current_setting($1)", test.param)
- err = row.Scan(&value)
- if err != nil {
- return "", false
- }
- return value, true
- }
-
- value, success := tryGetParameterValue()
- if success != test.success && !test.success {
- t.Fatalf("%v: unexpected error: %v", test.conninfo, err)
- }
- if success != test.success {
- t.Fatalf("unexpected outcome %v (was expecting %v) for conninfo \"%s\"",
- success, test.success, test.conninfo)
- }
- if value != test.expected {
- t.Fatalf("bad value for %s: got %s, want %s with conninfo \"%s\"",
- test.param, value, test.expected, test.conninfo)
- }
- }
-}
-
-func TestIsUTF8(t *testing.T) {
- var cases = []struct {
- name string
- want bool
- }{
- {"unicode", true},
- {"utf-8", true},
- {"utf_8", true},
- {"UTF-8", true},
- {"UTF8", true},
- {"utf8", true},
- {"u n ic_ode", true},
- {"ut_f%8", true},
- {"ubf8", false},
- {"punycode", false},
- }
-
- for _, test := range cases {
- if g := isUTF8(test.name); g != test.want {
- t.Errorf("isUTF8(%q) = %v want %v", test.name, g, test.want)
- }
- }
-}
-
-func TestQuoteIdentifier(t *testing.T) {
- var cases = []struct {
- input string
- want string
- }{
- {`foo`, `"foo"`},
- {`foo bar baz`, `"foo bar baz"`},
- {`foo"bar`, `"foo""bar"`},
- {"foo\x00bar", `"foo"`},
- {"\x00foo", `""`},
- }
-
- for _, test := range cases {
- got := QuoteIdentifier(test.input)
- if got != test.want {
- t.Errorf("QuoteIdentifier(%q) = %v want %v", test.input, got, test.want)
- }
- }
-}
-
-func TestRowsResultTag(t *testing.T) {
- type ResultTag interface {
- Result() driver.Result
- Tag() string
- }
-
- tests := []struct {
- query string
- tag string
- ra int64
- }{
- {
- query: "CREATE TEMP TABLE temp (a int)",
- tag: "CREATE TABLE",
- },
- {
- query: "INSERT INTO temp VALUES (1), (2)",
- tag: "INSERT",
- ra: 2,
- },
- {
- query: "SELECT 1",
- },
- // A SELECT anywhere should take precedent.
- {
- query: "SELECT 1; INSERT INTO temp VALUES (1), (2)",
- },
- {
- query: "INSERT INTO temp VALUES (1), (2); SELECT 1",
- },
- // Multiple statements that don't return rows should return the last tag.
- {
- query: "CREATE TEMP TABLE t (a int); DROP TABLE t",
- tag: "DROP TABLE",
- },
- // Ensure a rows-returning query in any position among various tags-returing
- // statements will prefer the rows.
- {
- query: "SELECT 1; CREATE TEMP TABLE t (a int); DROP TABLE t",
- },
- {
- query: "CREATE TEMP TABLE t (a int); SELECT 1; DROP TABLE t",
- },
- {
- query: "CREATE TEMP TABLE t (a int); DROP TABLE t; SELECT 1",
- },
- // Verify that an no-results query doesn't set the tag.
- {
- query: "CREATE TEMP TABLE t (a int); SELECT 1 WHERE FALSE; DROP TABLE t;",
- },
- }
-
- // If this is the only test run, this will correct the connection string.
- openTestConn(t).Close()
-
- conn, err := Open("")
- if err != nil {
- t.Fatal(err)
- }
- defer conn.Close()
- q := conn.(driver.QueryerContext)
-
- for _, test := range tests {
- if rows, err := q.QueryContext(context.Background(), test.query, nil); err != nil {
- t.Fatalf("%s: %s", test.query, err)
- } else {
- r := rows.(ResultTag)
- if tag := r.Tag(); tag != test.tag {
- t.Fatalf("%s: unexpected tag %q", test.query, tag)
- }
- res := r.Result()
- if ra, _ := res.RowsAffected(); ra != test.ra {
- t.Fatalf("%s: unexpected rows affected: %d", test.query, ra)
- }
- rows.Close()
- }
- }
-}
-
-// TestQuickClose tests that closing a query early allows a subsequent query to work.
-func TestQuickClose(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- tx, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- rows, err := tx.Query("SELECT 1; SELECT 2;")
- if err != nil {
- t.Fatal(err)
- }
- if err := rows.Close(); err != nil {
- t.Fatal(err)
- }
-
- var id int
- if err := tx.QueryRow("SELECT 3").Scan(&id); err != nil {
- t.Fatal(err)
- }
- if id != 3 {
- t.Fatalf("unexpected %d", id)
- }
- if err := tx.Commit(); err != nil {
- t.Fatal(err)
- }
-}
diff --git a/vendor/github.com/lib/pq/connector_example_test.go b/vendor/github.com/lib/pq/connector_example_test.go
deleted file mode 100644
index 5b66cf4b..00000000
--- a/vendor/github.com/lib/pq/connector_example_test.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// +build go1.10
-
-package pq_test
-
-import (
- "database/sql"
- "fmt"
-
- "github.com/lib/pq"
-)
-
-func ExampleNewConnector() {
- name := ""
- connector, err := pq.NewConnector(name)
- if err != nil {
- fmt.Println(err)
- return
- }
- db := sql.OpenDB(connector)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer db.Close()
-
- // Use the DB
- txn, err := db.Begin()
- if err != nil {
- fmt.Println(err)
- return
- }
- txn.Rollback()
-}
diff --git a/vendor/github.com/lib/pq/connector_test.go b/vendor/github.com/lib/pq/connector_test.go
deleted file mode 100644
index 3d2c67b0..00000000
--- a/vendor/github.com/lib/pq/connector_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// +build go1.10
-
-package pq
-
-import (
- "context"
- "database/sql"
- "database/sql/driver"
- "testing"
-)
-
-func TestNewConnector_WorksWithOpenDB(t *testing.T) {
- name := ""
- c, err := NewConnector(name)
- if err != nil {
- t.Fatal(err)
- }
- db := sql.OpenDB(c)
- defer db.Close()
- // database/sql might not call our Open at all unless we do something with
- // the connection
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- txn.Rollback()
-}
-
-func TestNewConnector_Connect(t *testing.T) {
- name := ""
- c, err := NewConnector(name)
- if err != nil {
- t.Fatal(err)
- }
- db, err := c.Connect(context.Background())
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
- // database/sql might not call our Open at all unless we do something with
- // the connection
- txn, err := db.(driver.ConnBeginTx).BeginTx(context.Background(), driver.TxOptions{})
- if err != nil {
- t.Fatal(err)
- }
- txn.Rollback()
-}
-
-func TestNewConnector_Driver(t *testing.T) {
- name := ""
- c, err := NewConnector(name)
- if err != nil {
- t.Fatal(err)
- }
- db, err := c.Driver().Open(name)
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
- // database/sql might not call our Open at all unless we do something with
- // the connection
- txn, err := db.(driver.ConnBeginTx).BeginTx(context.Background(), driver.TxOptions{})
- if err != nil {
- t.Fatal(err)
- }
- txn.Rollback()
-}
diff --git a/vendor/github.com/lib/pq/copy_test.go b/vendor/github.com/lib/pq/copy_test.go
deleted file mode 100644
index a888a894..00000000
--- a/vendor/github.com/lib/pq/copy_test.go
+++ /dev/null
@@ -1,468 +0,0 @@
-package pq
-
-import (
- "bytes"
- "database/sql"
- "database/sql/driver"
- "net"
- "strings"
- "testing"
-)
-
-func TestCopyInStmt(t *testing.T) {
- stmt := CopyIn("table name")
- if stmt != `COPY "table name" () FROM STDIN` {
- t.Fatal(stmt)
- }
-
- stmt = CopyIn("table name", "column 1", "column 2")
- if stmt != `COPY "table name" ("column 1", "column 2") FROM STDIN` {
- t.Fatal(stmt)
- }
-
- stmt = CopyIn(`table " name """`, `co"lumn""`)
- if stmt != `COPY "table "" name """"""" ("co""lumn""""") FROM STDIN` {
- t.Fatal(stmt)
- }
-}
-
-func TestCopyInSchemaStmt(t *testing.T) {
- stmt := CopyInSchema("schema name", "table name")
- if stmt != `COPY "schema name"."table name" () FROM STDIN` {
- t.Fatal(stmt)
- }
-
- stmt = CopyInSchema("schema name", "table name", "column 1", "column 2")
- if stmt != `COPY "schema name"."table name" ("column 1", "column 2") FROM STDIN` {
- t.Fatal(stmt)
- }
-
- stmt = CopyInSchema(`schema " name """`, `table " name """`, `co"lumn""`)
- if stmt != `COPY "schema "" name """"""".`+
- `"table "" name """"""" ("co""lumn""""") FROM STDIN` {
- t.Fatal(stmt)
- }
-}
-
-func TestCopyInMultipleValues(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (a int, b varchar)")
- if err != nil {
- t.Fatal(err)
- }
-
- stmt, err := txn.Prepare(CopyIn("temp", "a", "b"))
- if err != nil {
- t.Fatal(err)
- }
-
- longString := strings.Repeat("#", 500)
-
- for i := 0; i < 500; i++ {
- _, err = stmt.Exec(int64(i), longString)
- if err != nil {
- t.Fatal(err)
- }
- }
-
- _, err = stmt.Exec()
- if err != nil {
- t.Fatal(err)
- }
-
- err = stmt.Close()
- if err != nil {
- t.Fatal(err)
- }
-
- var num int
- err = txn.QueryRow("SELECT COUNT(*) FROM temp").Scan(&num)
- if err != nil {
- t.Fatal(err)
- }
-
- if num != 500 {
- t.Fatalf("expected 500 items, not %d", num)
- }
-}
-
-func TestCopyInRaiseStmtTrigger(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- if getServerVersion(t, db) < 90000 {
- var exists int
- err := db.QueryRow("SELECT 1 FROM pg_language WHERE lanname = 'plpgsql'").Scan(&exists)
- if err == sql.ErrNoRows {
- t.Skip("language PL/PgSQL does not exist; skipping TestCopyInRaiseStmtTrigger")
- } else if err != nil {
- t.Fatal(err)
- }
- }
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (a int, b varchar)")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = txn.Exec(`
- CREATE OR REPLACE FUNCTION pg_temp.temptest()
- RETURNS trigger AS
- $BODY$ begin
- raise notice 'Hello world';
- return new;
- end $BODY$
- LANGUAGE plpgsql`)
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = txn.Exec(`
- CREATE TRIGGER temptest_trigger
- BEFORE INSERT
- ON temp
- FOR EACH ROW
- EXECUTE PROCEDURE pg_temp.temptest()`)
- if err != nil {
- t.Fatal(err)
- }
-
- stmt, err := txn.Prepare(CopyIn("temp", "a", "b"))
- if err != nil {
- t.Fatal(err)
- }
-
- longString := strings.Repeat("#", 500)
-
- _, err = stmt.Exec(int64(1), longString)
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = stmt.Exec()
- if err != nil {
- t.Fatal(err)
- }
-
- err = stmt.Close()
- if err != nil {
- t.Fatal(err)
- }
-
- var num int
- err = txn.QueryRow("SELECT COUNT(*) FROM temp").Scan(&num)
- if err != nil {
- t.Fatal(err)
- }
-
- if num != 1 {
- t.Fatalf("expected 1 items, not %d", num)
- }
-}
-
-func TestCopyInTypes(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (num INTEGER, text VARCHAR, blob BYTEA, nothing VARCHAR)")
- if err != nil {
- t.Fatal(err)
- }
-
- stmt, err := txn.Prepare(CopyIn("temp", "num", "text", "blob", "nothing"))
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = stmt.Exec(int64(1234567890), "Héllö\n ☃!\r\t\\", []byte{0, 255, 9, 10, 13}, nil)
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = stmt.Exec()
- if err != nil {
- t.Fatal(err)
- }
-
- err = stmt.Close()
- if err != nil {
- t.Fatal(err)
- }
-
- var num int
- var text string
- var blob []byte
- var nothing sql.NullString
-
- err = txn.QueryRow("SELECT * FROM temp").Scan(&num, &text, &blob, ¬hing)
- if err != nil {
- t.Fatal(err)
- }
-
- if num != 1234567890 {
- t.Fatal("unexpected result", num)
- }
- if text != "Héllö\n ☃!\r\t\\" {
- t.Fatal("unexpected result", text)
- }
- if !bytes.Equal(blob, []byte{0, 255, 9, 10, 13}) {
- t.Fatal("unexpected result", blob)
- }
- if nothing.Valid {
- t.Fatal("unexpected result", nothing.String)
- }
-}
-
-func TestCopyInWrongType(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (num INTEGER)")
- if err != nil {
- t.Fatal(err)
- }
-
- stmt, err := txn.Prepare(CopyIn("temp", "num"))
- if err != nil {
- t.Fatal(err)
- }
- defer stmt.Close()
-
- _, err = stmt.Exec("Héllö\n ☃!\r\t\\")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = stmt.Exec()
- if err == nil {
- t.Fatal("expected error")
- }
- if pge := err.(*Error); pge.Code.Name() != "invalid_text_representation" {
- t.Fatalf("expected 'invalid input syntax for integer' error, got %s (%+v)", pge.Code.Name(), pge)
- }
-}
-
-func TestCopyOutsideOfTxnError(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- _, err := db.Prepare(CopyIn("temp", "num"))
- if err == nil {
- t.Fatal("COPY outside of transaction did not return an error")
- }
- if err != errCopyNotSupportedOutsideTxn {
- t.Fatalf("expected %s, got %s", err, err.Error())
- }
-}
-
-func TestCopyInBinaryError(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (num INTEGER)")
- if err != nil {
- t.Fatal(err)
- }
- _, err = txn.Prepare("COPY temp (num) FROM STDIN WITH binary")
- if err != errBinaryCopyNotSupported {
- t.Fatalf("expected %s, got %+v", errBinaryCopyNotSupported, err)
- }
- // check that the protocol is in a valid state
- err = txn.Rollback()
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestCopyFromError(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (num INTEGER)")
- if err != nil {
- t.Fatal(err)
- }
- _, err = txn.Prepare("COPY temp (num) TO STDOUT")
- if err != errCopyToNotSupported {
- t.Fatalf("expected %s, got %+v", errCopyToNotSupported, err)
- }
- // check that the protocol is in a valid state
- err = txn.Rollback()
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestCopySyntaxError(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Prepare("COPY ")
- if err == nil {
- t.Fatal("expected error")
- }
- if pge := err.(*Error); pge.Code.Name() != "syntax_error" {
- t.Fatalf("expected syntax error, got %s (%+v)", pge.Code.Name(), pge)
- }
- // check that the protocol is in a valid state
- err = txn.Rollback()
- if err != nil {
- t.Fatal(err)
- }
-}
-
-// Tests for connection errors in copyin.resploop()
-func TestCopyRespLoopConnectionError(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- var pid int
- err = txn.QueryRow("SELECT pg_backend_pid()").Scan(&pid)
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (a int)")
- if err != nil {
- t.Fatal(err)
- }
-
- stmt, err := txn.Prepare(CopyIn("temp", "a"))
- if err != nil {
- t.Fatal(err)
- }
- defer stmt.Close()
-
- _, err = db.Exec("SELECT pg_terminate_backend($1)", pid)
- if err != nil {
- t.Fatal(err)
- }
-
- if getServerVersion(t, db) < 90500 {
- // We have to try and send something over, since postgres before
- // version 9.5 won't process SIGTERMs while it's waiting for
- // CopyData/CopyEnd messages; see tcop/postgres.c.
- _, err = stmt.Exec(1)
- if err != nil {
- t.Fatal(err)
- }
- }
- _, err = stmt.Exec()
- if err == nil {
- t.Fatalf("expected error")
- }
- switch pge := err.(type) {
- case *Error:
- if pge.Code.Name() != "admin_shutdown" {
- t.Fatalf("expected admin_shutdown, got %s", pge.Code.Name())
- }
- case *net.OpError:
- // ignore
- default:
- if err == driver.ErrBadConn {
- // likely an EPIPE
- } else {
- t.Fatalf("unexpected error, got %+#v", err)
- }
- }
-
- _ = stmt.Close()
-}
-
-func BenchmarkCopyIn(b *testing.B) {
- db := openTestConn(b)
- defer db.Close()
-
- txn, err := db.Begin()
- if err != nil {
- b.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("CREATE TEMP TABLE temp (a int, b varchar)")
- if err != nil {
- b.Fatal(err)
- }
-
- stmt, err := txn.Prepare(CopyIn("temp", "a", "b"))
- if err != nil {
- b.Fatal(err)
- }
-
- for i := 0; i < b.N; i++ {
- _, err = stmt.Exec(int64(i), "hello world!")
- if err != nil {
- b.Fatal(err)
- }
- }
-
- _, err = stmt.Exec()
- if err != nil {
- b.Fatal(err)
- }
-
- err = stmt.Close()
- if err != nil {
- b.Fatal(err)
- }
-
- var num int
- err = txn.QueryRow("SELECT COUNT(*) FROM temp").Scan(&num)
- if err != nil {
- b.Fatal(err)
- }
-
- if num != b.N {
- b.Fatalf("expected %d items, not %d", b.N, num)
- }
-}
diff --git a/vendor/github.com/lib/pq/encode_test.go b/vendor/github.com/lib/pq/encode_test.go
deleted file mode 100644
index d58798a4..00000000
--- a/vendor/github.com/lib/pq/encode_test.go
+++ /dev/null
@@ -1,766 +0,0 @@
-package pq
-
-import (
- "bytes"
- "database/sql"
- "fmt"
- "regexp"
- "testing"
- "time"
-
- "github.com/lib/pq/oid"
-)
-
-func TestScanTimestamp(t *testing.T) {
- var nt NullTime
- tn := time.Now()
- nt.Scan(tn)
- if !nt.Valid {
- t.Errorf("Expected Valid=false")
- }
- if nt.Time != tn {
- t.Errorf("Time value mismatch")
- }
-}
-
-func TestScanNilTimestamp(t *testing.T) {
- var nt NullTime
- nt.Scan(nil)
- if nt.Valid {
- t.Errorf("Expected Valid=false")
- }
-}
-
-var timeTests = []struct {
- str string
- timeval time.Time
-}{
- {"22001-02-03", time.Date(22001, time.February, 3, 0, 0, 0, 0, time.FixedZone("", 0))},
- {"2001-02-03", time.Date(2001, time.February, 3, 0, 0, 0, 0, time.FixedZone("", 0))},
- {"0001-12-31 BC", time.Date(0, time.December, 31, 0, 0, 0, 0, time.FixedZone("", 0))},
- {"2001-02-03 BC", time.Date(-2000, time.February, 3, 0, 0, 0, 0, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06", time.Date(2001, time.February, 3, 4, 5, 6, 0, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.000001", time.Date(2001, time.February, 3, 4, 5, 6, 1000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.00001", time.Date(2001, time.February, 3, 4, 5, 6, 10000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.0001", time.Date(2001, time.February, 3, 4, 5, 6, 100000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.001", time.Date(2001, time.February, 3, 4, 5, 6, 1000000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.01", time.Date(2001, time.February, 3, 4, 5, 6, 10000000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.1", time.Date(2001, time.February, 3, 4, 5, 6, 100000000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.12", time.Date(2001, time.February, 3, 4, 5, 6, 120000000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.123", time.Date(2001, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.1234", time.Date(2001, time.February, 3, 4, 5, 6, 123400000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.12345", time.Date(2001, time.February, 3, 4, 5, 6, 123450000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.123456", time.Date(2001, time.February, 3, 4, 5, 6, 123456000, time.FixedZone("", 0))},
- {"2001-02-03 04:05:06.123-07", time.Date(2001, time.February, 3, 4, 5, 6, 123000000,
- time.FixedZone("", -7*60*60))},
- {"2001-02-03 04:05:06-07", time.Date(2001, time.February, 3, 4, 5, 6, 0,
- time.FixedZone("", -7*60*60))},
- {"2001-02-03 04:05:06-07:42", time.Date(2001, time.February, 3, 4, 5, 6, 0,
- time.FixedZone("", -(7*60*60+42*60)))},
- {"2001-02-03 04:05:06-07:30:09", time.Date(2001, time.February, 3, 4, 5, 6, 0,
- time.FixedZone("", -(7*60*60+30*60+9)))},
- {"2001-02-03 04:05:06+07", time.Date(2001, time.February, 3, 4, 5, 6, 0,
- time.FixedZone("", 7*60*60))},
- {"0011-02-03 04:05:06 BC", time.Date(-10, time.February, 3, 4, 5, 6, 0, time.FixedZone("", 0))},
- {"0011-02-03 04:05:06.123 BC", time.Date(-10, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0))},
- {"0011-02-03 04:05:06.123-07 BC", time.Date(-10, time.February, 3, 4, 5, 6, 123000000,
- time.FixedZone("", -7*60*60))},
- {"0001-02-03 04:05:06.123", time.Date(1, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0))},
- {"0001-02-03 04:05:06.123 BC", time.Date(1, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0)).AddDate(-1, 0, 0)},
- {"0001-02-03 04:05:06.123 BC", time.Date(0, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0))},
- {"0002-02-03 04:05:06.123 BC", time.Date(0, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0)).AddDate(-1, 0, 0)},
- {"0002-02-03 04:05:06.123 BC", time.Date(-1, time.February, 3, 4, 5, 6, 123000000, time.FixedZone("", 0))},
- {"12345-02-03 04:05:06.1", time.Date(12345, time.February, 3, 4, 5, 6, 100000000, time.FixedZone("", 0))},
- {"123456-02-03 04:05:06.1", time.Date(123456, time.February, 3, 4, 5, 6, 100000000, time.FixedZone("", 0))},
-}
-
-// Test that parsing the string results in the expected value.
-func TestParseTs(t *testing.T) {
- for i, tt := range timeTests {
- val, err := ParseTimestamp(nil, tt.str)
- if err != nil {
- t.Errorf("%d: got error: %v", i, err)
- } else if val.String() != tt.timeval.String() {
- t.Errorf("%d: expected to parse %q into %q; got %q",
- i, tt.str, tt.timeval, val)
- }
- }
-}
-
-var timeErrorTests = []string{
- "BC",
- " BC",
- "2001",
- "2001-2-03",
- "2001-02-3",
- "2001-02-03 ",
- "2001-02-03 B",
- "2001-02-03 04",
- "2001-02-03 04:",
- "2001-02-03 04:05",
- "2001-02-03 04:05 B",
- "2001-02-03 04:05 BC",
- "2001-02-03 04:05:",
- "2001-02-03 04:05:6",
- "2001-02-03 04:05:06 B",
- "2001-02-03 04:05:06BC",
- "2001-02-03 04:05:06.123 B",
-}
-
-// Test that parsing the string results in an error.
-func TestParseTsErrors(t *testing.T) {
- for i, tt := range timeErrorTests {
- _, err := ParseTimestamp(nil, tt)
- if err == nil {
- t.Errorf("%d: expected an error from parsing: %v", i, tt)
- }
- }
-}
-
-// Now test that sending the value into the database and parsing it back
-// returns the same time.Time value.
-func TestEncodeAndParseTs(t *testing.T) {
- db, err := openTestConnConninfo("timezone='Etc/UTC'")
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
-
- for i, tt := range timeTests {
- var dbstr string
- err = db.QueryRow("SELECT ($1::timestamptz)::text", tt.timeval).Scan(&dbstr)
- if err != nil {
- t.Errorf("%d: could not send value %q to the database: %s", i, tt.timeval, err)
- continue
- }
-
- val, err := ParseTimestamp(nil, dbstr)
- if err != nil {
- t.Errorf("%d: could not parse value %q: %s", i, dbstr, err)
- continue
- }
- val = val.In(tt.timeval.Location())
- if val.String() != tt.timeval.String() {
- t.Errorf("%d: expected to parse %q into %q; got %q", i, dbstr, tt.timeval, val)
- }
- }
-}
-
-var formatTimeTests = []struct {
- time time.Time
- expected string
-}{
- {time.Time{}, "0001-01-01 00:00:00Z"},
- {time.Date(2001, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", 0)), "2001-02-03 04:05:06.123456789Z"},
- {time.Date(2001, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", 2*60*60)), "2001-02-03 04:05:06.123456789+02:00"},
- {time.Date(2001, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", -6*60*60)), "2001-02-03 04:05:06.123456789-06:00"},
- {time.Date(2001, time.February, 3, 4, 5, 6, 0, time.FixedZone("", -(7*60*60+30*60+9))), "2001-02-03 04:05:06-07:30:09"},
-
- {time.Date(1, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", 0)), "0001-02-03 04:05:06.123456789Z"},
- {time.Date(1, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", 2*60*60)), "0001-02-03 04:05:06.123456789+02:00"},
- {time.Date(1, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", -6*60*60)), "0001-02-03 04:05:06.123456789-06:00"},
-
- {time.Date(0, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", 0)), "0001-02-03 04:05:06.123456789Z BC"},
- {time.Date(0, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", 2*60*60)), "0001-02-03 04:05:06.123456789+02:00 BC"},
- {time.Date(0, time.February, 3, 4, 5, 6, 123456789, time.FixedZone("", -6*60*60)), "0001-02-03 04:05:06.123456789-06:00 BC"},
-
- {time.Date(1, time.February, 3, 4, 5, 6, 0, time.FixedZone("", -(7*60*60+30*60+9))), "0001-02-03 04:05:06-07:30:09"},
- {time.Date(0, time.February, 3, 4, 5, 6, 0, time.FixedZone("", -(7*60*60+30*60+9))), "0001-02-03 04:05:06-07:30:09 BC"},
-}
-
-func TestFormatTs(t *testing.T) {
- for i, tt := range formatTimeTests {
- val := string(formatTs(tt.time))
- if val != tt.expected {
- t.Errorf("%d: incorrect time format %q, want %q", i, val, tt.expected)
- }
- }
-}
-
-func TestFormatTsBackend(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- var str string
- err := db.QueryRow("SELECT '2001-02-03T04:05:06.007-08:09:10'::time::text").Scan(&str)
- if err == nil {
- t.Fatalf("PostgreSQL is accepting an ISO timestamp input for time")
- }
-
- for i, tt := range formatTimeTests {
- for _, typ := range []string{"date", "time", "timetz", "timestamp", "timestamptz"} {
- err = db.QueryRow("SELECT $1::"+typ+"::text", tt.time).Scan(&str)
- if err != nil {
- t.Errorf("%d: incorrect time format for %v on the backend: %v", i, typ, err)
- }
- }
- }
-}
-
-func TestTimestampWithTimeZone(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- tx, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer tx.Rollback()
-
- // try several different locations, all included in Go's zoneinfo.zip
- for _, locName := range []string{
- "UTC",
- "America/Chicago",
- "America/New_York",
- "Australia/Darwin",
- "Australia/Perth",
- } {
- loc, err := time.LoadLocation(locName)
- if err != nil {
- t.Logf("Could not load time zone %s - skipping", locName)
- continue
- }
-
- // Postgres timestamps have a resolution of 1 microsecond, so don't
- // use the full range of the Nanosecond argument
- refTime := time.Date(2012, 11, 6, 10, 23, 42, 123456000, loc)
-
- for _, pgTimeZone := range []string{"US/Eastern", "Australia/Darwin"} {
- // Switch Postgres's timezone to test different output timestamp formats
- _, err = tx.Exec(fmt.Sprintf("set time zone '%s'", pgTimeZone))
- if err != nil {
- t.Fatal(err)
- }
-
- var gotTime time.Time
- row := tx.QueryRow("select $1::timestamp with time zone", refTime)
- err = row.Scan(&gotTime)
- if err != nil {
- t.Fatal(err)
- }
-
- if !refTime.Equal(gotTime) {
- t.Errorf("timestamps not equal: %s != %s", refTime, gotTime)
- }
-
- // check that the time zone is set correctly based on TimeZone
- pgLoc, err := time.LoadLocation(pgTimeZone)
- if err != nil {
- t.Logf("Could not load time zone %s - skipping", pgLoc)
- continue
- }
- translated := refTime.In(pgLoc)
- if translated.String() != gotTime.String() {
- t.Errorf("timestamps not equal: %s != %s", translated, gotTime)
- }
- }
- }
-}
-
-func TestTimestampWithOutTimezone(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- test := func(ts, pgts string) {
- r, err := db.Query("SELECT $1::timestamp", pgts)
- if err != nil {
- t.Fatalf("Could not run query: %v", err)
- }
-
- if !r.Next() {
- t.Fatal("Expected at least one row")
- }
-
- var result time.Time
- err = r.Scan(&result)
- if err != nil {
- t.Fatalf("Did not expect error scanning row: %v", err)
- }
-
- expected, err := time.Parse(time.RFC3339, ts)
- if err != nil {
- t.Fatalf("Could not parse test time literal: %v", err)
- }
-
- if !result.Equal(expected) {
- t.Fatalf("Expected time to match %v: got mismatch %v",
- expected, result)
- }
-
- if r.Next() {
- t.Fatal("Expected only one row")
- }
- }
-
- test("2000-01-01T00:00:00Z", "2000-01-01T00:00:00")
-
- // Test higher precision time
- test("2013-01-04T20:14:58.80033Z", "2013-01-04 20:14:58.80033")
-}
-
-func TestInfinityTimestamp(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
- var err error
- var resultT time.Time
-
- expectedErrorStrRegexp := regexp.MustCompile(
- `^sql: Scan error on column index 0(, name "timestamp(tz)?"|): unsupported`)
-
- type testCases []struct {
- Query string
- Param string
- ExpectedErrorStrRegexp *regexp.Regexp
- ExpectedVal interface{}
- }
- tc := testCases{
- {"SELECT $1::timestamp", "-infinity", expectedErrorStrRegexp, "-infinity"},
- {"SELECT $1::timestamptz", "-infinity", expectedErrorStrRegexp, "-infinity"},
- {"SELECT $1::timestamp", "infinity", expectedErrorStrRegexp, "infinity"},
- {"SELECT $1::timestamptz", "infinity", expectedErrorStrRegexp, "infinity"},
- }
- // try to assert []byte to time.Time
- for _, q := range tc {
- err = db.QueryRow(q.Query, q.Param).Scan(&resultT)
- if !q.ExpectedErrorStrRegexp.MatchString(err.Error()) {
- t.Errorf("Scanning -/+infinity, expected error to match regexp %q, got %q",
- q.ExpectedErrorStrRegexp, err)
- }
- }
- // yield []byte
- for _, q := range tc {
- var resultI interface{}
- err = db.QueryRow(q.Query, q.Param).Scan(&resultI)
- if err != nil {
- t.Errorf("Scanning -/+infinity, expected no error, got %q", err)
- }
- result, ok := resultI.([]byte)
- if !ok {
- t.Errorf("Scanning -/+infinity, expected []byte, got %#v", resultI)
- }
- if string(result) != q.ExpectedVal {
- t.Errorf("Scanning -/+infinity, expected %q, got %q", q.ExpectedVal, result)
- }
- }
-
- y1500 := time.Date(1500, time.January, 1, 0, 0, 0, 0, time.UTC)
- y2500 := time.Date(2500, time.January, 1, 0, 0, 0, 0, time.UTC)
- EnableInfinityTs(y1500, y2500)
-
- err = db.QueryRow("SELECT $1::timestamp", "infinity").Scan(&resultT)
- if err != nil {
- t.Errorf("Scanning infinity, expected no error, got %q", err)
- }
- if !resultT.Equal(y2500) {
- t.Errorf("Scanning infinity, expected %q, got %q", y2500, resultT)
- }
-
- err = db.QueryRow("SELECT $1::timestamptz", "infinity").Scan(&resultT)
- if err != nil {
- t.Errorf("Scanning infinity, expected no error, got %q", err)
- }
- if !resultT.Equal(y2500) {
- t.Errorf("Scanning Infinity, expected time %q, got %q", y2500, resultT.String())
- }
-
- err = db.QueryRow("SELECT $1::timestamp", "-infinity").Scan(&resultT)
- if err != nil {
- t.Errorf("Scanning -infinity, expected no error, got %q", err)
- }
- if !resultT.Equal(y1500) {
- t.Errorf("Scanning -infinity, expected time %q, got %q", y1500, resultT.String())
- }
-
- err = db.QueryRow("SELECT $1::timestamptz", "-infinity").Scan(&resultT)
- if err != nil {
- t.Errorf("Scanning -infinity, expected no error, got %q", err)
- }
- if !resultT.Equal(y1500) {
- t.Errorf("Scanning -infinity, expected time %q, got %q", y1500, resultT.String())
- }
-
- ym1500 := time.Date(-1500, time.January, 1, 0, 0, 0, 0, time.UTC)
- y11500 := time.Date(11500, time.January, 1, 0, 0, 0, 0, time.UTC)
- var s string
- err = db.QueryRow("SELECT $1::timestamp::text", ym1500).Scan(&s)
- if err != nil {
- t.Errorf("Encoding -infinity, expected no error, got %q", err)
- }
- if s != "-infinity" {
- t.Errorf("Encoding -infinity, expected %q, got %q", "-infinity", s)
- }
- err = db.QueryRow("SELECT $1::timestamptz::text", ym1500).Scan(&s)
- if err != nil {
- t.Errorf("Encoding -infinity, expected no error, got %q", err)
- }
- if s != "-infinity" {
- t.Errorf("Encoding -infinity, expected %q, got %q", "-infinity", s)
- }
-
- err = db.QueryRow("SELECT $1::timestamp::text", y11500).Scan(&s)
- if err != nil {
- t.Errorf("Encoding infinity, expected no error, got %q", err)
- }
- if s != "infinity" {
- t.Errorf("Encoding infinity, expected %q, got %q", "infinity", s)
- }
- err = db.QueryRow("SELECT $1::timestamptz::text", y11500).Scan(&s)
- if err != nil {
- t.Errorf("Encoding infinity, expected no error, got %q", err)
- }
- if s != "infinity" {
- t.Errorf("Encoding infinity, expected %q, got %q", "infinity", s)
- }
-
- disableInfinityTs()
-
- var panicErrorString string
- func() {
- defer func() {
- panicErrorString, _ = recover().(string)
- }()
- EnableInfinityTs(y2500, y1500)
- }()
- if panicErrorString != infinityTsNegativeMustBeSmaller {
- t.Errorf("Expected error, %q, got %q", infinityTsNegativeMustBeSmaller, panicErrorString)
- }
-}
-
-func TestStringWithNul(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- hello0world := string("hello\x00world")
- _, err := db.Query("SELECT $1::text", &hello0world)
- if err == nil {
- t.Fatal("Postgres accepts a string with nul in it; " +
- "injection attacks may be plausible")
- }
-}
-
-func TestByteSliceToText(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- b := []byte("hello world")
- row := db.QueryRow("SELECT $1::text", b)
-
- var result []byte
- err := row.Scan(&result)
- if err != nil {
- t.Fatal(err)
- }
-
- if string(result) != string(b) {
- t.Fatalf("expected %v but got %v", b, result)
- }
-}
-
-func TestStringToBytea(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- b := "hello world"
- row := db.QueryRow("SELECT $1::bytea", b)
-
- var result []byte
- err := row.Scan(&result)
- if err != nil {
- t.Fatal(err)
- }
-
- if !bytes.Equal(result, []byte(b)) {
- t.Fatalf("expected %v but got %v", b, result)
- }
-}
-
-func TestTextByteSliceToUUID(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- b := []byte("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11")
- row := db.QueryRow("SELECT $1::uuid", b)
-
- var result string
- err := row.Scan(&result)
- if forceBinaryParameters() {
- pqErr := err.(*Error)
- if pqErr == nil {
- t.Errorf("Expected to get error")
- } else if pqErr.Code != "22P03" {
- t.Fatalf("Expected to get invalid binary encoding error (22P03), got %s", pqErr.Code)
- }
- } else {
- if err != nil {
- t.Fatal(err)
- }
-
- if result != string(b) {
- t.Fatalf("expected %v but got %v", b, result)
- }
- }
-}
-
-func TestBinaryByteSlicetoUUID(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- b := []byte{'\xa0', '\xee', '\xbc', '\x99',
- '\x9c', '\x0b',
- '\x4e', '\xf8',
- '\xbb', '\x00', '\x6b',
- '\xb9', '\xbd', '\x38', '\x0a', '\x11'}
- row := db.QueryRow("SELECT $1::uuid", b)
-
- var result string
- err := row.Scan(&result)
- if forceBinaryParameters() {
- if err != nil {
- t.Fatal(err)
- }
-
- if result != string("a0eebc99-9c0b-4ef8-bb00-6bb9bd380a11") {
- t.Fatalf("expected %v but got %v", b, result)
- }
- } else {
- pqErr := err.(*Error)
- if pqErr == nil {
- t.Errorf("Expected to get error")
- } else if pqErr.Code != "22021" {
- t.Fatalf("Expected to get invalid byte sequence for encoding error (22021), got %s", pqErr.Code)
- }
- }
-}
-
-func TestStringToUUID(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- s := "a0eebc99-9c0b-4ef8-bb00-6bb9bd380a11"
- row := db.QueryRow("SELECT $1::uuid", s)
-
- var result string
- err := row.Scan(&result)
- if err != nil {
- t.Fatal(err)
- }
-
- if result != s {
- t.Fatalf("expected %v but got %v", s, result)
- }
-}
-
-func TestTextByteSliceToInt(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- expected := 12345678
- b := []byte(fmt.Sprintf("%d", expected))
- row := db.QueryRow("SELECT $1::int", b)
-
- var result int
- err := row.Scan(&result)
- if forceBinaryParameters() {
- pqErr := err.(*Error)
- if pqErr == nil {
- t.Errorf("Expected to get error")
- } else if pqErr.Code != "22P03" {
- t.Fatalf("Expected to get invalid binary encoding error (22P03), got %s", pqErr.Code)
- }
- } else {
- if err != nil {
- t.Fatal(err)
- }
- if result != expected {
- t.Fatalf("expected %v but got %v", expected, result)
- }
- }
-}
-
-func TestBinaryByteSliceToInt(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- expected := 12345678
- b := []byte{'\x00', '\xbc', '\x61', '\x4e'}
- row := db.QueryRow("SELECT $1::int", b)
-
- var result int
- err := row.Scan(&result)
- if forceBinaryParameters() {
- if err != nil {
- t.Fatal(err)
- }
- if result != expected {
- t.Fatalf("expected %v but got %v", expected, result)
- }
- } else {
- pqErr := err.(*Error)
- if pqErr == nil {
- t.Errorf("Expected to get error")
- } else if pqErr.Code != "22021" {
- t.Fatalf("Expected to get invalid byte sequence for encoding error (22021), got %s", pqErr.Code)
- }
- }
-}
-
-func TestTextDecodeIntoString(t *testing.T) {
- input := []byte("hello world")
- want := string(input)
- for _, typ := range []oid.Oid{oid.T_char, oid.T_varchar, oid.T_text} {
- got := decode(¶meterStatus{}, input, typ, formatText)
- if got != want {
- t.Errorf("invalid string decoding output for %T(%+v), got %v but expected %v", typ, typ, got, want)
- }
- }
-}
-
-func TestByteaOutputFormatEncoding(t *testing.T) {
- input := []byte("\\x\x00\x01\x02\xFF\xFEabcdefg0123")
- want := []byte("\\x5c78000102fffe6162636465666730313233")
- got := encode(¶meterStatus{serverVersion: 90000}, input, oid.T_bytea)
- if !bytes.Equal(want, got) {
- t.Errorf("invalid hex bytea output, got %v but expected %v", got, want)
- }
-
- want = []byte("\\\\x\\000\\001\\002\\377\\376abcdefg0123")
- got = encode(¶meterStatus{serverVersion: 84000}, input, oid.T_bytea)
- if !bytes.Equal(want, got) {
- t.Errorf("invalid escape bytea output, got %v but expected %v", got, want)
- }
-}
-
-func TestByteaOutputFormats(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- if getServerVersion(t, db) < 90000 {
- // skip
- return
- }
-
- testByteaOutputFormat := func(f string, usePrepared bool) {
- expectedData := []byte("\x5c\x78\x00\xff\x61\x62\x63\x01\x08")
- sqlQuery := "SELECT decode('5c7800ff6162630108', 'hex')"
-
- var data []byte
-
- // use a txn to avoid relying on getting the same connection
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
- defer txn.Rollback()
-
- _, err = txn.Exec("SET LOCAL bytea_output TO " + f)
- if err != nil {
- t.Fatal(err)
- }
- var rows *sql.Rows
- var stmt *sql.Stmt
- if usePrepared {
- stmt, err = txn.Prepare(sqlQuery)
- if err != nil {
- t.Fatal(err)
- }
- rows, err = stmt.Query()
- } else {
- // use Query; QueryRow would hide the actual error
- rows, err = txn.Query(sqlQuery)
- }
- if err != nil {
- t.Fatal(err)
- }
- if !rows.Next() {
- if rows.Err() != nil {
- t.Fatal(rows.Err())
- }
- t.Fatal("shouldn't happen")
- }
- err = rows.Scan(&data)
- if err != nil {
- t.Fatal(err)
- }
- err = rows.Close()
- if err != nil {
- t.Fatal(err)
- }
- if stmt != nil {
- err = stmt.Close()
- if err != nil {
- t.Fatal(err)
- }
- }
- if !bytes.Equal(data, expectedData) {
- t.Errorf("unexpected bytea value %v for format %s; expected %v", data, f, expectedData)
- }
- }
-
- testByteaOutputFormat("hex", false)
- testByteaOutputFormat("escape", false)
- testByteaOutputFormat("hex", true)
- testByteaOutputFormat("escape", true)
-}
-
-func TestAppendEncodedText(t *testing.T) {
- var buf []byte
-
- buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, int64(10))
- buf = append(buf, '\t')
- buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, 42.0000000001)
- buf = append(buf, '\t')
- buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, "hello\tworld")
- buf = append(buf, '\t')
- buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, []byte{0, 128, 255})
-
- if string(buf) != "10\t42.0000000001\thello\\tworld\t\\\\x0080ff" {
- t.Fatal(string(buf))
- }
-}
-
-func TestAppendEscapedText(t *testing.T) {
- if esc := appendEscapedText(nil, "hallo\tescape"); string(esc) != "hallo\\tescape" {
- t.Fatal(string(esc))
- }
- if esc := appendEscapedText(nil, "hallo\\tescape\n"); string(esc) != "hallo\\\\tescape\\n" {
- t.Fatal(string(esc))
- }
- if esc := appendEscapedText(nil, "\n\r\t\f"); string(esc) != "\\n\\r\\t\f" {
- t.Fatal(string(esc))
- }
-}
-
-func TestAppendEscapedTextExistingBuffer(t *testing.T) {
- buf := []byte("123\t")
- if esc := appendEscapedText(buf, "hallo\tescape"); string(esc) != "123\thallo\\tescape" {
- t.Fatal(string(esc))
- }
- buf = []byte("123\t")
- if esc := appendEscapedText(buf, "hallo\\tescape\n"); string(esc) != "123\thallo\\\\tescape\\n" {
- t.Fatal(string(esc))
- }
- buf = []byte("123\t")
- if esc := appendEscapedText(buf, "\n\r\t\f"); string(esc) != "123\t\\n\\r\\t\f" {
- t.Fatal(string(esc))
- }
-}
-
-func BenchmarkAppendEscapedText(b *testing.B) {
- longString := ""
- for i := 0; i < 100; i++ {
- longString += "123456789\n"
- }
- for i := 0; i < b.N; i++ {
- appendEscapedText(nil, longString)
- }
-}
-
-func BenchmarkAppendEscapedTextNoEscape(b *testing.B) {
- longString := ""
- for i := 0; i < 100; i++ {
- longString += "1234567890"
- }
- for i := 0; i < b.N; i++ {
- appendEscapedText(nil, longString)
- }
-}
diff --git a/vendor/github.com/lib/pq/example/listen/doc.go b/vendor/github.com/lib/pq/example/listen/doc.go
deleted file mode 100644
index 91e2ddba..00000000
--- a/vendor/github.com/lib/pq/example/listen/doc.go
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-
-Package listen is a self-contained Go program which uses the LISTEN / NOTIFY
-mechanism to avoid polling the database while waiting for more work to arrive.
-
- //
- // You can see the program in action by defining a function similar to
- // the following:
- //
- // CREATE OR REPLACE FUNCTION public.get_work()
- // RETURNS bigint
- // LANGUAGE sql
- // AS $$
- // SELECT CASE WHEN random() >= 0.2 THEN int8 '1' END
- // $$
- // ;
-
- package main
-
- import (
- "database/sql"
- "fmt"
- "time"
-
- "github.com/lib/pq"
- )
-
- func doWork(db *sql.DB, work int64) {
- // work here
- }
-
- func getWork(db *sql.DB) {
- for {
- // get work from the database here
- var work sql.NullInt64
- err := db.QueryRow("SELECT get_work()").Scan(&work)
- if err != nil {
- fmt.Println("call to get_work() failed: ", err)
- time.Sleep(10 * time.Second)
- continue
- }
- if !work.Valid {
- // no more work to do
- fmt.Println("ran out of work")
- return
- }
-
- fmt.Println("starting work on ", work.Int64)
- go doWork(db, work.Int64)
- }
- }
-
- func waitForNotification(l *pq.Listener) {
- select {
- case <-l.Notify:
- fmt.Println("received notification, new work available")
- case <-time.After(90 * time.Second):
- go l.Ping()
- // Check if there's more work available, just in case it takes
- // a while for the Listener to notice connection loss and
- // reconnect.
- fmt.Println("received no work for 90 seconds, checking for new work")
- }
- }
-
- func main() {
- var conninfo string = ""
-
- db, err := sql.Open("postgres", conninfo)
- if err != nil {
- panic(err)
- }
-
- reportProblem := func(ev pq.ListenerEventType, err error) {
- if err != nil {
- fmt.Println(err.Error())
- }
- }
-
- minReconn := 10 * time.Second
- maxReconn := time.Minute
- listener := pq.NewListener(conninfo, minReconn, maxReconn, reportProblem)
- err = listener.Listen("getwork")
- if err != nil {
- panic(err)
- }
-
- fmt.Println("entering main loop")
- for {
- // process all available work before waiting for notifications
- getWork(db)
- waitForNotification(listener)
- }
- }
-
-
-*/
-package listen
diff --git a/vendor/github.com/lib/pq/go.mod b/vendor/github.com/lib/pq/go.mod
new file mode 100644
index 00000000..edf0b343
--- /dev/null
+++ b/vendor/github.com/lib/pq/go.mod
@@ -0,0 +1 @@
+module github.com/lib/pq
diff --git a/vendor/github.com/lib/pq/go18_test.go b/vendor/github.com/lib/pq/go18_test.go
deleted file mode 100644
index 1a88a5b4..00000000
--- a/vendor/github.com/lib/pq/go18_test.go
+++ /dev/null
@@ -1,321 +0,0 @@
-// +build go1.8
-
-package pq
-
-import (
- "context"
- "database/sql"
- "runtime"
- "strings"
- "testing"
- "time"
-)
-
-func TestMultipleSimpleQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- rows, err := db.Query("select 1; set time zone default; select 2; select 3")
- if err != nil {
- t.Fatal(err)
- }
- defer rows.Close()
-
- var i int
- for rows.Next() {
- if err := rows.Scan(&i); err != nil {
- t.Fatal(err)
- }
- if i != 1 {
- t.Fatalf("expected 1, got %d", i)
- }
- }
- if !rows.NextResultSet() {
- t.Fatal("expected more result sets", rows.Err())
- }
- for rows.Next() {
- if err := rows.Scan(&i); err != nil {
- t.Fatal(err)
- }
- if i != 2 {
- t.Fatalf("expected 2, got %d", i)
- }
- }
-
- // Make sure that if we ignore a result we can still query.
-
- rows, err = db.Query("select 4; select 5")
- if err != nil {
- t.Fatal(err)
- }
- defer rows.Close()
-
- for rows.Next() {
- if err := rows.Scan(&i); err != nil {
- t.Fatal(err)
- }
- if i != 4 {
- t.Fatalf("expected 4, got %d", i)
- }
- }
- if !rows.NextResultSet() {
- t.Fatal("expected more result sets", rows.Err())
- }
- for rows.Next() {
- if err := rows.Scan(&i); err != nil {
- t.Fatal(err)
- }
- if i != 5 {
- t.Fatalf("expected 5, got %d", i)
- }
- }
- if rows.NextResultSet() {
- t.Fatal("unexpected result set")
- }
-}
-
-const contextRaceIterations = 100
-
-func TestContextCancelExec(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- ctx, cancel := context.WithCancel(context.Background())
-
- // Delay execution for just a bit until db.ExecContext has begun.
- defer time.AfterFunc(time.Millisecond*10, cancel).Stop()
-
- // Not canceled until after the exec has started.
- if _, err := db.ExecContext(ctx, "select pg_sleep(1)"); err == nil {
- t.Fatal("expected error")
- } else if err.Error() != "pq: canceling statement due to user request" {
- t.Fatalf("unexpected error: %s", err)
- }
-
- // Context is already canceled, so error should come before execution.
- if _, err := db.ExecContext(ctx, "select pg_sleep(1)"); err == nil {
- t.Fatal("expected error")
- } else if err.Error() != "context canceled" {
- t.Fatalf("unexpected error: %s", err)
- }
-
- for i := 0; i < contextRaceIterations; i++ {
- func() {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
- if _, err := db.ExecContext(ctx, "select 1"); err != nil {
- t.Fatal(err)
- }
- }()
-
- if _, err := db.Exec("select 1"); err != nil {
- t.Fatal(err)
- }
- }
-}
-
-func TestContextCancelQuery(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- ctx, cancel := context.WithCancel(context.Background())
-
- // Delay execution for just a bit until db.QueryContext has begun.
- defer time.AfterFunc(time.Millisecond*10, cancel).Stop()
-
- // Not canceled until after the exec has started.
- if _, err := db.QueryContext(ctx, "select pg_sleep(1)"); err == nil {
- t.Fatal("expected error")
- } else if err.Error() != "pq: canceling statement due to user request" {
- t.Fatalf("unexpected error: %s", err)
- }
-
- // Context is already canceled, so error should come before execution.
- if _, err := db.QueryContext(ctx, "select pg_sleep(1)"); err == nil {
- t.Fatal("expected error")
- } else if err.Error() != "context canceled" {
- t.Fatalf("unexpected error: %s", err)
- }
-
- for i := 0; i < contextRaceIterations; i++ {
- func() {
- ctx, cancel := context.WithCancel(context.Background())
- rows, err := db.QueryContext(ctx, "select 1")
- cancel()
- if err != nil {
- t.Fatal(err)
- } else if err := rows.Close(); err != nil {
- t.Fatal(err)
- }
- }()
-
- if rows, err := db.Query("select 1"); err != nil {
- t.Fatal(err)
- } else if err := rows.Close(); err != nil {
- t.Fatal(err)
- }
- }
-}
-
-// TestIssue617 tests that a failed query in QueryContext doesn't lead to a
-// goroutine leak.
-func TestIssue617(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- const N = 10
-
- numGoroutineStart := runtime.NumGoroutine()
- for i := 0; i < N; i++ {
- func() {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
- _, err := db.QueryContext(ctx, `SELECT * FROM DOESNOTEXIST`)
- pqErr, _ := err.(*Error)
- // Expecting "pq: relation \"doesnotexist\" does not exist" error.
- if err == nil || pqErr == nil || pqErr.Code != "42P01" {
- t.Fatalf("expected undefined table error, got %v", err)
- }
- }()
- }
- numGoroutineFinish := runtime.NumGoroutine()
-
- // We use N/2 and not N because the GC and other actors may increase or
- // decrease the number of goroutines.
- if numGoroutineFinish-numGoroutineStart >= N/2 {
- t.Errorf("goroutine leak detected, was %d, now %d", numGoroutineStart, numGoroutineFinish)
- }
-}
-
-func TestContextCancelBegin(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- ctx, cancel := context.WithCancel(context.Background())
- tx, err := db.BeginTx(ctx, nil)
- if err != nil {
- t.Fatal(err)
- }
-
- // Delay execution for just a bit until tx.Exec has begun.
- defer time.AfterFunc(time.Millisecond*10, cancel).Stop()
-
- // Not canceled until after the exec has started.
- if _, err := tx.Exec("select pg_sleep(1)"); err == nil {
- t.Fatal("expected error")
- } else if err.Error() != "pq: canceling statement due to user request" {
- t.Fatalf("unexpected error: %s", err)
- }
-
- // Transaction is canceled, so expect an error.
- if _, err := tx.Query("select pg_sleep(1)"); err == nil {
- t.Fatal("expected error")
- } else if err != sql.ErrTxDone {
- t.Fatalf("unexpected error: %s", err)
- }
-
- // Context is canceled, so cannot begin a transaction.
- if _, err := db.BeginTx(ctx, nil); err == nil {
- t.Fatal("expected error")
- } else if err.Error() != "context canceled" {
- t.Fatalf("unexpected error: %s", err)
- }
-
- for i := 0; i < contextRaceIterations; i++ {
- func() {
- ctx, cancel := context.WithCancel(context.Background())
- tx, err := db.BeginTx(ctx, nil)
- cancel()
- if err != nil {
- t.Fatal(err)
- } else if err := tx.Rollback(); err != nil &&
- err.Error() != "pq: canceling statement due to user request" &&
- err != sql.ErrTxDone {
- t.Fatal(err)
- }
- }()
-
- if tx, err := db.Begin(); err != nil {
- t.Fatal(err)
- } else if err := tx.Rollback(); err != nil {
- t.Fatal(err)
- }
- }
-}
-
-func TestTxOptions(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
- ctx := context.Background()
-
- tests := []struct {
- level sql.IsolationLevel
- isolation string
- }{
- {
- level: sql.LevelDefault,
- isolation: "",
- },
- {
- level: sql.LevelReadUncommitted,
- isolation: "read uncommitted",
- },
- {
- level: sql.LevelReadCommitted,
- isolation: "read committed",
- },
- {
- level: sql.LevelRepeatableRead,
- isolation: "repeatable read",
- },
- {
- level: sql.LevelSerializable,
- isolation: "serializable",
- },
- }
-
- for _, test := range tests {
- for _, ro := range []bool{true, false} {
- tx, err := db.BeginTx(ctx, &sql.TxOptions{
- Isolation: test.level,
- ReadOnly: ro,
- })
- if err != nil {
- t.Fatal(err)
- }
-
- var isolation string
- err = tx.QueryRow("select current_setting('transaction_isolation')").Scan(&isolation)
- if err != nil {
- t.Fatal(err)
- }
-
- if test.isolation != "" && isolation != test.isolation {
- t.Errorf("wrong isolation level: %s != %s", isolation, test.isolation)
- }
-
- var isRO string
- err = tx.QueryRow("select current_setting('transaction_read_only')").Scan(&isRO)
- if err != nil {
- t.Fatal(err)
- }
-
- if ro != (isRO == "on") {
- t.Errorf("read/[write,only] not set: %t != %s for level %s",
- ro, isRO, test.isolation)
- }
-
- tx.Rollback()
- }
- }
-
- _, err := db.BeginTx(ctx, &sql.TxOptions{
- Isolation: sql.LevelLinearizable,
- })
- if err == nil {
- t.Fatal("expected LevelLinearizable to fail")
- }
- if !strings.Contains(err.Error(), "isolation level not supported") {
- t.Errorf("Expected error to mention isolation level, got %q", err)
- }
-}
diff --git a/vendor/github.com/lib/pq/hstore/hstore_test.go b/vendor/github.com/lib/pq/hstore/hstore_test.go
deleted file mode 100644
index 1c9f2bd4..00000000
--- a/vendor/github.com/lib/pq/hstore/hstore_test.go
+++ /dev/null
@@ -1,148 +0,0 @@
-package hstore
-
-import (
- "database/sql"
- "os"
- "testing"
-
- _ "github.com/lib/pq"
-)
-
-type Fatalistic interface {
- Fatal(args ...interface{})
-}
-
-func openTestConn(t Fatalistic) *sql.DB {
- datname := os.Getenv("PGDATABASE")
- sslmode := os.Getenv("PGSSLMODE")
-
- if datname == "" {
- os.Setenv("PGDATABASE", "pqgotest")
- }
-
- if sslmode == "" {
- os.Setenv("PGSSLMODE", "disable")
- }
-
- conn, err := sql.Open("postgres", "")
- if err != nil {
- t.Fatal(err)
- }
-
- return conn
-}
-
-func TestHstore(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- // quitely create hstore if it doesn't exist
- _, err := db.Exec("CREATE EXTENSION IF NOT EXISTS hstore")
- if err != nil {
- t.Skipf("Skipping hstore tests - hstore extension create failed: %s", err.Error())
- }
-
- hs := Hstore{}
-
- // test for null-valued hstores
- err = db.QueryRow("SELECT NULL::hstore").Scan(&hs)
- if err != nil {
- t.Fatal(err)
- }
- if hs.Map != nil {
- t.Fatalf("expected null map")
- }
-
- err = db.QueryRow("SELECT $1::hstore", hs).Scan(&hs)
- if err != nil {
- t.Fatalf("re-query null map failed: %s", err.Error())
- }
- if hs.Map != nil {
- t.Fatalf("expected null map")
- }
-
- // test for empty hstores
- err = db.QueryRow("SELECT ''::hstore").Scan(&hs)
- if err != nil {
- t.Fatal(err)
- }
- if hs.Map == nil {
- t.Fatalf("expected empty map, got null map")
- }
- if len(hs.Map) != 0 {
- t.Fatalf("expected empty map, got len(map)=%d", len(hs.Map))
- }
-
- err = db.QueryRow("SELECT $1::hstore", hs).Scan(&hs)
- if err != nil {
- t.Fatalf("re-query empty map failed: %s", err.Error())
- }
- if hs.Map == nil {
- t.Fatalf("expected empty map, got null map")
- }
- if len(hs.Map) != 0 {
- t.Fatalf("expected empty map, got len(map)=%d", len(hs.Map))
- }
-
- // a few example maps to test out
- hsOnePair := Hstore{
- Map: map[string]sql.NullString{
- "key1": {String: "value1", Valid: true},
- },
- }
-
- hsThreePairs := Hstore{
- Map: map[string]sql.NullString{
- "key1": {String: "value1", Valid: true},
- "key2": {String: "value2", Valid: true},
- "key3": {String: "value3", Valid: true},
- },
- }
-
- hsSmorgasbord := Hstore{
- Map: map[string]sql.NullString{
- "nullstring": {String: "NULL", Valid: true},
- "actuallynull": {String: "", Valid: false},
- "NULL": {String: "NULL string key", Valid: true},
- "withbracket": {String: "value>42", Valid: true},
- "withequal": {String: "value=42", Valid: true},
- `"withquotes1"`: {String: `this "should" be fine`, Valid: true},
- `"withquotes"2"`: {String: `this "should\" also be fine`, Valid: true},
- "embedded1": {String: "value1=>x1", Valid: true},
- "embedded2": {String: `"value2"=>x2`, Valid: true},
- "withnewlines": {String: "\n\nvalue\t=>2", Valid: true},
- "<>": {String: `this, "should,\" also, => be fine`, Valid: true},
- },
- }
-
- // test encoding in query params, then decoding during Scan
- testBidirectional := func(h Hstore) {
- err = db.QueryRow("SELECT $1::hstore", h).Scan(&hs)
- if err != nil {
- t.Fatalf("re-query %d-pair map failed: %s", len(h.Map), err.Error())
- }
- if hs.Map == nil {
- t.Fatalf("expected %d-pair map, got null map", len(h.Map))
- }
- if len(hs.Map) != len(h.Map) {
- t.Fatalf("expected %d-pair map, got len(map)=%d", len(h.Map), len(hs.Map))
- }
-
- for key, val := range hs.Map {
- otherval, found := h.Map[key]
- if !found {
- t.Fatalf(" key '%v' not found in %d-pair map", key, len(h.Map))
- }
- if otherval.Valid != val.Valid {
- t.Fatalf(" value %v <> %v in %d-pair map", otherval, val, len(h.Map))
- }
- if otherval.String != val.String {
- t.Fatalf(" value '%v' <> '%v' in %d-pair map", otherval.String, val.String, len(h.Map))
- }
- }
- }
-
- testBidirectional(hsOnePair)
- testBidirectional(hsThreePairs)
- testBidirectional(hsSmorgasbord)
-}
diff --git a/vendor/github.com/lib/pq/issues_test.go b/vendor/github.com/lib/pq/issues_test.go
deleted file mode 100644
index 3a330a0a..00000000
--- a/vendor/github.com/lib/pq/issues_test.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package pq
-
-import "testing"
-
-func TestIssue494(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- query := `CREATE TEMP TABLE t (i INT PRIMARY KEY)`
- if _, err := db.Exec(query); err != nil {
- t.Fatal(err)
- }
-
- txn, err := db.Begin()
- if err != nil {
- t.Fatal(err)
- }
-
- if _, err := txn.Prepare(CopyIn("t", "i")); err != nil {
- t.Fatal(err)
- }
-
- if _, err := txn.Query("SELECT 1"); err == nil {
- t.Fatal("expected error")
- }
-}
diff --git a/vendor/github.com/lib/pq/notify.go b/vendor/github.com/lib/pq/notify.go
index 947d189f..850bb904 100644
--- a/vendor/github.com/lib/pq/notify.go
+++ b/vendor/github.com/lib/pq/notify.go
@@ -725,6 +725,9 @@ func (l *Listener) Close() error {
}
l.isClosed = true
+ // Unblock calls to Listen()
+ l.reconnectCond.Broadcast()
+
return nil
}
diff --git a/vendor/github.com/lib/pq/notify_test.go b/vendor/github.com/lib/pq/notify_test.go
deleted file mode 100644
index 075666dd..00000000
--- a/vendor/github.com/lib/pq/notify_test.go
+++ /dev/null
@@ -1,570 +0,0 @@
-package pq
-
-import (
- "errors"
- "fmt"
- "io"
- "os"
- "runtime"
- "sync"
- "testing"
- "time"
-)
-
-var errNilNotification = errors.New("nil notification")
-
-func expectNotification(t *testing.T, ch <-chan *Notification, relname string, extra string) error {
- select {
- case n := <-ch:
- if n == nil {
- return errNilNotification
- }
- if n.Channel != relname || n.Extra != extra {
- return fmt.Errorf("unexpected notification %v", n)
- }
- return nil
- case <-time.After(1500 * time.Millisecond):
- return fmt.Errorf("timeout")
- }
-}
-
-func expectNoNotification(t *testing.T, ch <-chan *Notification) error {
- select {
- case n := <-ch:
- return fmt.Errorf("unexpected notification %v", n)
- case <-time.After(100 * time.Millisecond):
- return nil
- }
-}
-
-func expectEvent(t *testing.T, eventch <-chan ListenerEventType, et ListenerEventType) error {
- select {
- case e := <-eventch:
- if e != et {
- return fmt.Errorf("unexpected event %v", e)
- }
- return nil
- case <-time.After(1500 * time.Millisecond):
- panic("expectEvent timeout")
- }
-}
-
-func expectNoEvent(t *testing.T, eventch <-chan ListenerEventType) error {
- select {
- case e := <-eventch:
- return fmt.Errorf("unexpected event %v", e)
- case <-time.After(100 * time.Millisecond):
- return nil
- }
-}
-
-func newTestListenerConn(t *testing.T) (*ListenerConn, <-chan *Notification) {
- datname := os.Getenv("PGDATABASE")
- sslmode := os.Getenv("PGSSLMODE")
-
- if datname == "" {
- os.Setenv("PGDATABASE", "pqgotest")
- }
-
- if sslmode == "" {
- os.Setenv("PGSSLMODE", "disable")
- }
-
- notificationChan := make(chan *Notification)
- l, err := NewListenerConn("", notificationChan)
- if err != nil {
- t.Fatal(err)
- }
-
- return l, notificationChan
-}
-
-func TestNewListenerConn(t *testing.T) {
- l, _ := newTestListenerConn(t)
-
- defer l.Close()
-}
-
-func TestConnListen(t *testing.T) {
- l, channel := newTestListenerConn(t)
-
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- ok, err := l.Listen("notify_test")
- if !ok || err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, channel, "notify_test", "")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestConnUnlisten(t *testing.T) {
- l, channel := newTestListenerConn(t)
-
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- ok, err := l.Listen("notify_test")
- if !ok || err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, channel, "notify_test", "")
- if err != nil {
- t.Fatal(err)
- }
-
- ok, err = l.Unlisten("notify_test")
- if !ok || err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNoNotification(t, channel)
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestConnUnlistenAll(t *testing.T) {
- l, channel := newTestListenerConn(t)
-
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- ok, err := l.Listen("notify_test")
- if !ok || err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, channel, "notify_test", "")
- if err != nil {
- t.Fatal(err)
- }
-
- ok, err = l.UnlistenAll()
- if !ok || err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNoNotification(t, channel)
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestConnClose(t *testing.T) {
- l, _ := newTestListenerConn(t)
- defer l.Close()
-
- err := l.Close()
- if err != nil {
- t.Fatal(err)
- }
- err = l.Close()
- if err != errListenerConnClosed {
- t.Fatalf("expected errListenerConnClosed; got %v", err)
- }
-}
-
-func TestConnPing(t *testing.T) {
- l, _ := newTestListenerConn(t)
- defer l.Close()
- err := l.Ping()
- if err != nil {
- t.Fatal(err)
- }
- err = l.Close()
- if err != nil {
- t.Fatal(err)
- }
- err = l.Ping()
- if err != errListenerConnClosed {
- t.Fatalf("expected errListenerConnClosed; got %v", err)
- }
-}
-
-// Test for deadlock where a query fails while another one is queued
-func TestConnExecDeadlock(t *testing.T) {
- l, _ := newTestListenerConn(t)
- defer l.Close()
-
- var wg sync.WaitGroup
- wg.Add(2)
-
- go func() {
- l.ExecSimpleQuery("SELECT pg_sleep(60)")
- wg.Done()
- }()
- runtime.Gosched()
- go func() {
- l.ExecSimpleQuery("SELECT 1")
- wg.Done()
- }()
- // give the two goroutines some time to get into position
- runtime.Gosched()
- // calls Close on the net.Conn; equivalent to a network failure
- l.Close()
-
- defer time.AfterFunc(10*time.Second, func() {
- panic("timed out")
- }).Stop()
- wg.Wait()
-}
-
-// Test for ListenerConn being closed while a slow query is executing
-func TestListenerConnCloseWhileQueryIsExecuting(t *testing.T) {
- l, _ := newTestListenerConn(t)
- defer l.Close()
-
- var wg sync.WaitGroup
- wg.Add(1)
-
- go func() {
- sent, err := l.ExecSimpleQuery("SELECT pg_sleep(60)")
- if sent {
- panic("expected sent=false")
- }
- // could be any of a number of errors
- if err == nil {
- panic("expected error")
- }
- wg.Done()
- }()
- // give the above goroutine some time to get into position
- runtime.Gosched()
- err := l.Close()
- if err != nil {
- t.Fatal(err)
- }
-
- defer time.AfterFunc(10*time.Second, func() {
- panic("timed out")
- }).Stop()
- wg.Wait()
-}
-
-func TestNotifyExtra(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- if getServerVersion(t, db) < 90000 {
- t.Skip("skipping NOTIFY payload test since the server does not appear to support it")
- }
-
- l, channel := newTestListenerConn(t)
- defer l.Close()
-
- ok, err := l.Listen("notify_test")
- if !ok || err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_test, 'something'")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, channel, "notify_test", "something")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-// create a new test listener and also set the timeouts
-func newTestListenerTimeout(t *testing.T, min time.Duration, max time.Duration) (*Listener, <-chan ListenerEventType) {
- datname := os.Getenv("PGDATABASE")
- sslmode := os.Getenv("PGSSLMODE")
-
- if datname == "" {
- os.Setenv("PGDATABASE", "pqgotest")
- }
-
- if sslmode == "" {
- os.Setenv("PGSSLMODE", "disable")
- }
-
- eventch := make(chan ListenerEventType, 16)
- l := NewListener("", min, max, func(t ListenerEventType, err error) { eventch <- t })
- err := expectEvent(t, eventch, ListenerEventConnected)
- if err != nil {
- t.Fatal(err)
- }
- return l, eventch
-}
-
-func newTestListener(t *testing.T) (*Listener, <-chan ListenerEventType) {
- return newTestListenerTimeout(t, time.Hour, time.Hour)
-}
-
-func TestListenerListen(t *testing.T) {
- l, _ := newTestListener(t)
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- err := l.Listen("notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestListenerUnlisten(t *testing.T) {
- l, _ := newTestListener(t)
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- err := l.Listen("notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = l.Unlisten("notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNoNotification(t, l.Notify)
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestListenerUnlistenAll(t *testing.T) {
- l, _ := newTestListener(t)
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- err := l.Listen("notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = l.UnlistenAll()
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNoNotification(t, l.Notify)
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestListenerFailedQuery(t *testing.T) {
- l, eventch := newTestListener(t)
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- err := l.Listen("notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-
- // shouldn't cause a disconnect
- ok, err := l.cn.ExecSimpleQuery("SELECT error")
- if !ok {
- t.Fatalf("could not send query to server: %v", err)
- }
- _, ok = err.(PGError)
- if !ok {
- t.Fatalf("unexpected error %v", err)
- }
- err = expectNoEvent(t, eventch)
- if err != nil {
- t.Fatal(err)
- }
-
- // should still work
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestListenerReconnect(t *testing.T) {
- l, eventch := newTestListenerTimeout(t, 20*time.Millisecond, time.Hour)
- defer l.Close()
-
- db := openTestConn(t)
- defer db.Close()
-
- err := l.Listen("notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-
- // kill the connection and make sure it comes back up
- ok, err := l.cn.ExecSimpleQuery("SELECT pg_terminate_backend(pg_backend_pid())")
- if ok {
- t.Fatalf("could not kill the connection: %v", err)
- }
- if err != io.EOF {
- t.Fatalf("unexpected error %v", err)
- }
- err = expectEvent(t, eventch, ListenerEventDisconnected)
- if err != nil {
- t.Fatal(err)
- }
- err = expectEvent(t, eventch, ListenerEventReconnected)
- if err != nil {
- t.Fatal(err)
- }
-
- // should still work
- _, err = db.Exec("NOTIFY notify_listen_test")
- if err != nil {
- t.Fatal(err)
- }
-
- // should get nil after Reconnected
- err = expectNotification(t, l.Notify, "", "")
- if err != errNilNotification {
- t.Fatal(err)
- }
-
- err = expectNotification(t, l.Notify, "notify_listen_test", "")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-func TestListenerClose(t *testing.T) {
- l, _ := newTestListenerTimeout(t, 20*time.Millisecond, time.Hour)
- defer l.Close()
-
- err := l.Close()
- if err != nil {
- t.Fatal(err)
- }
- err = l.Close()
- if err != errListenerClosed {
- t.Fatalf("expected errListenerClosed; got %v", err)
- }
-}
-
-func TestListenerPing(t *testing.T) {
- l, _ := newTestListenerTimeout(t, 20*time.Millisecond, time.Hour)
- defer l.Close()
-
- err := l.Ping()
- if err != nil {
- t.Fatal(err)
- }
-
- err = l.Close()
- if err != nil {
- t.Fatal(err)
- }
-
- err = l.Ping()
- if err != errListenerClosed {
- t.Fatalf("expected errListenerClosed; got %v", err)
- }
-}
diff --git a/vendor/github.com/lib/pq/rows_test.go b/vendor/github.com/lib/pq/rows_test.go
deleted file mode 100644
index 3033bc01..00000000
--- a/vendor/github.com/lib/pq/rows_test.go
+++ /dev/null
@@ -1,220 +0,0 @@
-// +build go1.8
-
-package pq
-
-import (
- "math"
- "reflect"
- "testing"
-
- "github.com/lib/pq/oid"
-)
-
-func TestDataTypeName(t *testing.T) {
- tts := []struct {
- typ oid.Oid
- name string
- }{
- {oid.T_int8, "INT8"},
- {oid.T_int4, "INT4"},
- {oid.T_int2, "INT2"},
- {oid.T_varchar, "VARCHAR"},
- {oid.T_text, "TEXT"},
- {oid.T_bool, "BOOL"},
- {oid.T_numeric, "NUMERIC"},
- {oid.T_date, "DATE"},
- {oid.T_time, "TIME"},
- {oid.T_timetz, "TIMETZ"},
- {oid.T_timestamp, "TIMESTAMP"},
- {oid.T_timestamptz, "TIMESTAMPTZ"},
- {oid.T_bytea, "BYTEA"},
- }
-
- for i, tt := range tts {
- dt := fieldDesc{OID: tt.typ}
- if name := dt.Name(); name != tt.name {
- t.Errorf("(%d) got: %s want: %s", i, name, tt.name)
- }
- }
-}
-
-func TestDataType(t *testing.T) {
- tts := []struct {
- typ oid.Oid
- kind reflect.Kind
- }{
- {oid.T_int8, reflect.Int64},
- {oid.T_int4, reflect.Int32},
- {oid.T_int2, reflect.Int16},
- {oid.T_varchar, reflect.String},
- {oid.T_text, reflect.String},
- {oid.T_bool, reflect.Bool},
- {oid.T_date, reflect.Struct},
- {oid.T_time, reflect.Struct},
- {oid.T_timetz, reflect.Struct},
- {oid.T_timestamp, reflect.Struct},
- {oid.T_timestamptz, reflect.Struct},
- {oid.T_bytea, reflect.Slice},
- }
-
- for i, tt := range tts {
- dt := fieldDesc{OID: tt.typ}
- if kind := dt.Type().Kind(); kind != tt.kind {
- t.Errorf("(%d) got: %s want: %s", i, kind, tt.kind)
- }
- }
-}
-
-func TestDataTypeLength(t *testing.T) {
- tts := []struct {
- typ oid.Oid
- len int
- mod int
- length int64
- ok bool
- }{
- {oid.T_int4, 0, -1, 0, false},
- {oid.T_varchar, 65535, 9, 5, true},
- {oid.T_text, 65535, -1, math.MaxInt64, true},
- {oid.T_bytea, 65535, -1, math.MaxInt64, true},
- }
-
- for i, tt := range tts {
- dt := fieldDesc{OID: tt.typ, Len: tt.len, Mod: tt.mod}
- if l, k := dt.Length(); k != tt.ok || l != tt.length {
- t.Errorf("(%d) got: %d, %t want: %d, %t", i, l, k, tt.length, tt.ok)
- }
- }
-}
-
-func TestDataTypePrecisionScale(t *testing.T) {
- tts := []struct {
- typ oid.Oid
- mod int
- precision, scale int64
- ok bool
- }{
- {oid.T_int4, -1, 0, 0, false},
- {oid.T_numeric, 589830, 9, 2, true},
- {oid.T_text, -1, 0, 0, false},
- }
-
- for i, tt := range tts {
- dt := fieldDesc{OID: tt.typ, Mod: tt.mod}
- p, s, k := dt.PrecisionScale()
- if k != tt.ok {
- t.Errorf("(%d) got: %t want: %t", i, k, tt.ok)
- }
- if p != tt.precision {
- t.Errorf("(%d) wrong precision got: %d want: %d", i, p, tt.precision)
- }
- if s != tt.scale {
- t.Errorf("(%d) wrong scale got: %d want: %d", i, s, tt.scale)
- }
- }
-}
-
-func TestRowsColumnTypes(t *testing.T) {
- columnTypesTests := []struct {
- Name string
- TypeName string
- Length struct {
- Len int64
- OK bool
- }
- DecimalSize struct {
- Precision int64
- Scale int64
- OK bool
- }
- ScanType reflect.Type
- }{
- {
- Name: "a",
- TypeName: "INT4",
- Length: struct {
- Len int64
- OK bool
- }{
- Len: 0,
- OK: false,
- },
- DecimalSize: struct {
- Precision int64
- Scale int64
- OK bool
- }{
- Precision: 0,
- Scale: 0,
- OK: false,
- },
- ScanType: reflect.TypeOf(int32(0)),
- }, {
- Name: "bar",
- TypeName: "TEXT",
- Length: struct {
- Len int64
- OK bool
- }{
- Len: math.MaxInt64,
- OK: true,
- },
- DecimalSize: struct {
- Precision int64
- Scale int64
- OK bool
- }{
- Precision: 0,
- Scale: 0,
- OK: false,
- },
- ScanType: reflect.TypeOf(""),
- },
- }
-
- db := openTestConn(t)
- defer db.Close()
-
- rows, err := db.Query("SELECT 1 AS a, text 'bar' AS bar, 1.28::numeric(9, 2) AS dec")
- if err != nil {
- t.Fatal(err)
- }
-
- columns, err := rows.ColumnTypes()
- if err != nil {
- t.Fatal(err)
- }
- if len(columns) != 3 {
- t.Errorf("expected 3 columns found %d", len(columns))
- }
-
- for i, tt := range columnTypesTests {
- c := columns[i]
- if c.Name() != tt.Name {
- t.Errorf("(%d) got: %s, want: %s", i, c.Name(), tt.Name)
- }
- if c.DatabaseTypeName() != tt.TypeName {
- t.Errorf("(%d) got: %s, want: %s", i, c.DatabaseTypeName(), tt.TypeName)
- }
- l, ok := c.Length()
- if l != tt.Length.Len {
- t.Errorf("(%d) got: %d, want: %d", i, l, tt.Length.Len)
- }
- if ok != tt.Length.OK {
- t.Errorf("(%d) got: %t, want: %t", i, ok, tt.Length.OK)
- }
- p, s, ok := c.DecimalSize()
- if p != tt.DecimalSize.Precision {
- t.Errorf("(%d) got: %d, want: %d", i, p, tt.DecimalSize.Precision)
- }
- if s != tt.DecimalSize.Scale {
- t.Errorf("(%d) got: %d, want: %d", i, s, tt.DecimalSize.Scale)
- }
- if ok != tt.DecimalSize.OK {
- t.Errorf("(%d) got: %t, want: %t", i, ok, tt.DecimalSize.OK)
- }
- if c.ScanType() != tt.ScanType {
- t.Errorf("(%d) got: %v, want: %v", i, c.ScanType(), tt.ScanType)
- }
- }
-}
diff --git a/vendor/github.com/lib/pq/ssl_test.go b/vendor/github.com/lib/pq/ssl_test.go
deleted file mode 100644
index 3eafbfd2..00000000
--- a/vendor/github.com/lib/pq/ssl_test.go
+++ /dev/null
@@ -1,279 +0,0 @@
-package pq
-
-// This file contains SSL tests
-
-import (
- _ "crypto/sha256"
- "crypto/x509"
- "database/sql"
- "os"
- "path/filepath"
- "testing"
-)
-
-func maybeSkipSSLTests(t *testing.T) {
- // Require some special variables for testing certificates
- if os.Getenv("PQSSLCERTTEST_PATH") == "" {
- t.Skip("PQSSLCERTTEST_PATH not set, skipping SSL tests")
- }
-
- value := os.Getenv("PQGOSSLTESTS")
- if value == "" || value == "0" {
- t.Skip("PQGOSSLTESTS not enabled, skipping SSL tests")
- } else if value != "1" {
- t.Fatalf("unexpected value %q for PQGOSSLTESTS", value)
- }
-}
-
-func openSSLConn(t *testing.T, conninfo string) (*sql.DB, error) {
- db, err := openTestConnConninfo(conninfo)
- if err != nil {
- // should never fail
- t.Fatal(err)
- }
- // Do something with the connection to see whether it's working or not.
- tx, err := db.Begin()
- if err == nil {
- return db, tx.Rollback()
- }
- _ = db.Close()
- return nil, err
-}
-
-func checkSSLSetup(t *testing.T, conninfo string) {
- _, err := openSSLConn(t, conninfo)
- if pge, ok := err.(*Error); ok {
- if pge.Code.Name() != "invalid_authorization_specification" {
- t.Fatalf("unexpected error code '%s'", pge.Code.Name())
- }
- } else {
- t.Fatalf("expected %T, got %v", (*Error)(nil), err)
- }
-}
-
-// Connect over SSL and run a simple query to test the basics
-func TestSSLConnection(t *testing.T) {
- maybeSkipSSLTests(t)
- // Environment sanity check: should fail without SSL
- checkSSLSetup(t, "sslmode=disable user=pqgossltest")
-
- db, err := openSSLConn(t, "sslmode=require user=pqgossltest")
- if err != nil {
- t.Fatal(err)
- }
- rows, err := db.Query("SELECT 1")
- if err != nil {
- t.Fatal(err)
- }
- rows.Close()
-}
-
-// Test sslmode=verify-full
-func TestSSLVerifyFull(t *testing.T) {
- maybeSkipSSLTests(t)
- // Environment sanity check: should fail without SSL
- checkSSLSetup(t, "sslmode=disable user=pqgossltest")
-
- // Not OK according to the system CA
- _, err := openSSLConn(t, "host=postgres sslmode=verify-full user=pqgossltest")
- if err == nil {
- t.Fatal("expected error")
- }
- _, ok := err.(x509.UnknownAuthorityError)
- if !ok {
- t.Fatalf("expected x509.UnknownAuthorityError, got %#+v", err)
- }
-
- rootCertPath := filepath.Join(os.Getenv("PQSSLCERTTEST_PATH"), "root.crt")
- rootCert := "sslrootcert=" + rootCertPath + " "
- // No match on Common Name
- _, err = openSSLConn(t, rootCert+"host=127.0.0.1 sslmode=verify-full user=pqgossltest")
- if err == nil {
- t.Fatal("expected error")
- }
- _, ok = err.(x509.HostnameError)
- if !ok {
- t.Fatalf("expected x509.HostnameError, got %#+v", err)
- }
- // OK
- _, err = openSSLConn(t, rootCert+"host=postgres sslmode=verify-full user=pqgossltest")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-// Test sslmode=require sslrootcert=rootCertPath
-func TestSSLRequireWithRootCert(t *testing.T) {
- maybeSkipSSLTests(t)
- // Environment sanity check: should fail without SSL
- checkSSLSetup(t, "sslmode=disable user=pqgossltest")
-
- bogusRootCertPath := filepath.Join(os.Getenv("PQSSLCERTTEST_PATH"), "bogus_root.crt")
- bogusRootCert := "sslrootcert=" + bogusRootCertPath + " "
-
- // Not OK according to the bogus CA
- _, err := openSSLConn(t, bogusRootCert+"host=postgres sslmode=require user=pqgossltest")
- if err == nil {
- t.Fatal("expected error")
- }
- _, ok := err.(x509.UnknownAuthorityError)
- if !ok {
- t.Fatalf("expected x509.UnknownAuthorityError, got %s, %#+v", err, err)
- }
-
- nonExistentCertPath := filepath.Join(os.Getenv("PQSSLCERTTEST_PATH"), "non_existent.crt")
- nonExistentCert := "sslrootcert=" + nonExistentCertPath + " "
-
- // No match on Common Name, but that's OK because we're not validating anything.
- _, err = openSSLConn(t, nonExistentCert+"host=127.0.0.1 sslmode=require user=pqgossltest")
- if err != nil {
- t.Fatal(err)
- }
-
- rootCertPath := filepath.Join(os.Getenv("PQSSLCERTTEST_PATH"), "root.crt")
- rootCert := "sslrootcert=" + rootCertPath + " "
-
- // No match on Common Name, but that's OK because we're not validating the CN.
- _, err = openSSLConn(t, rootCert+"host=127.0.0.1 sslmode=require user=pqgossltest")
- if err != nil {
- t.Fatal(err)
- }
- // Everything OK
- _, err = openSSLConn(t, rootCert+"host=postgres sslmode=require user=pqgossltest")
- if err != nil {
- t.Fatal(err)
- }
-}
-
-// Test sslmode=verify-ca
-func TestSSLVerifyCA(t *testing.T) {
- maybeSkipSSLTests(t)
- // Environment sanity check: should fail without SSL
- checkSSLSetup(t, "sslmode=disable user=pqgossltest")
-
- // Not OK according to the system CA
- {
- _, err := openSSLConn(t, "host=postgres sslmode=verify-ca user=pqgossltest")
- if _, ok := err.(x509.UnknownAuthorityError); !ok {
- t.Fatalf("expected %T, got %#+v", x509.UnknownAuthorityError{}, err)
- }
- }
-
- // Still not OK according to the system CA; empty sslrootcert is treated as unspecified.
- {
- _, err := openSSLConn(t, "host=postgres sslmode=verify-ca user=pqgossltest sslrootcert=''")
- if _, ok := err.(x509.UnknownAuthorityError); !ok {
- t.Fatalf("expected %T, got %#+v", x509.UnknownAuthorityError{}, err)
- }
- }
-
- rootCertPath := filepath.Join(os.Getenv("PQSSLCERTTEST_PATH"), "root.crt")
- rootCert := "sslrootcert=" + rootCertPath + " "
- // No match on Common Name, but that's OK
- if _, err := openSSLConn(t, rootCert+"host=127.0.0.1 sslmode=verify-ca user=pqgossltest"); err != nil {
- t.Fatal(err)
- }
- // Everything OK
- if _, err := openSSLConn(t, rootCert+"host=postgres sslmode=verify-ca user=pqgossltest"); err != nil {
- t.Fatal(err)
- }
-}
-
-// Authenticate over SSL using client certificates
-func TestSSLClientCertificates(t *testing.T) {
- maybeSkipSSLTests(t)
- // Environment sanity check: should fail without SSL
- checkSSLSetup(t, "sslmode=disable user=pqgossltest")
-
- const baseinfo = "sslmode=require user=pqgosslcert"
-
- // Certificate not specified, should fail
- {
- _, err := openSSLConn(t, baseinfo)
- if pge, ok := err.(*Error); ok {
- if pge.Code.Name() != "invalid_authorization_specification" {
- t.Fatalf("unexpected error code '%s'", pge.Code.Name())
- }
- } else {
- t.Fatalf("expected %T, got %v", (*Error)(nil), err)
- }
- }
-
- // Empty certificate specified, should fail
- {
- _, err := openSSLConn(t, baseinfo+" sslcert=''")
- if pge, ok := err.(*Error); ok {
- if pge.Code.Name() != "invalid_authorization_specification" {
- t.Fatalf("unexpected error code '%s'", pge.Code.Name())
- }
- } else {
- t.Fatalf("expected %T, got %v", (*Error)(nil), err)
- }
- }
-
- // Non-existent certificate specified, should fail
- {
- _, err := openSSLConn(t, baseinfo+" sslcert=/tmp/filedoesnotexist")
- if pge, ok := err.(*Error); ok {
- if pge.Code.Name() != "invalid_authorization_specification" {
- t.Fatalf("unexpected error code '%s'", pge.Code.Name())
- }
- } else {
- t.Fatalf("expected %T, got %v", (*Error)(nil), err)
- }
- }
-
- certpath, ok := os.LookupEnv("PQSSLCERTTEST_PATH")
- if !ok {
- t.Fatalf("PQSSLCERTTEST_PATH not present in environment")
- }
-
- sslcert := filepath.Join(certpath, "postgresql.crt")
-
- // Cert present, key not specified, should fail
- {
- _, err := openSSLConn(t, baseinfo+" sslcert="+sslcert)
- if _, ok := err.(*os.PathError); !ok {
- t.Fatalf("expected %T, got %#+v", (*os.PathError)(nil), err)
- }
- }
-
- // Cert present, empty key specified, should fail
- {
- _, err := openSSLConn(t, baseinfo+" sslcert="+sslcert+" sslkey=''")
- if _, ok := err.(*os.PathError); !ok {
- t.Fatalf("expected %T, got %#+v", (*os.PathError)(nil), err)
- }
- }
-
- // Cert present, non-existent key, should fail
- {
- _, err := openSSLConn(t, baseinfo+" sslcert="+sslcert+" sslkey=/tmp/filedoesnotexist")
- if _, ok := err.(*os.PathError); !ok {
- t.Fatalf("expected %T, got %#+v", (*os.PathError)(nil), err)
- }
- }
-
- // Key has wrong permissions (passing the cert as the key), should fail
- if _, err := openSSLConn(t, baseinfo+" sslcert="+sslcert+" sslkey="+sslcert); err != ErrSSLKeyHasWorldPermissions {
- t.Fatalf("expected %s, got %#+v", ErrSSLKeyHasWorldPermissions, err)
- }
-
- sslkey := filepath.Join(certpath, "postgresql.key")
-
- // Should work
- if db, err := openSSLConn(t, baseinfo+" sslcert="+sslcert+" sslkey="+sslkey); err != nil {
- t.Fatal(err)
- } else {
- rows, err := db.Query("SELECT 1")
- if err != nil {
- t.Fatal(err)
- }
- if err := rows.Close(); err != nil {
- t.Fatal(err)
- }
- if err := db.Close(); err != nil {
- t.Fatal(err)
- }
- }
-}
diff --git a/vendor/github.com/lib/pq/url_test.go b/vendor/github.com/lib/pq/url_test.go
deleted file mode 100644
index 4ff0ce03..00000000
--- a/vendor/github.com/lib/pq/url_test.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package pq
-
-import (
- "testing"
-)
-
-func TestSimpleParseURL(t *testing.T) {
- expected := "host=hostname.remote"
- str, err := ParseURL("postgres://hostname.remote")
- if err != nil {
- t.Fatal(err)
- }
-
- if str != expected {
- t.Fatalf("unexpected result from ParseURL:\n+ %v\n- %v", str, expected)
- }
-}
-
-func TestIPv6LoopbackParseURL(t *testing.T) {
- expected := "host=::1 port=1234"
- str, err := ParseURL("postgres://[::1]:1234")
- if err != nil {
- t.Fatal(err)
- }
-
- if str != expected {
- t.Fatalf("unexpected result from ParseURL:\n+ %v\n- %v", str, expected)
- }
-}
-
-func TestFullParseURL(t *testing.T) {
- expected := `dbname=database host=hostname.remote password=top\ secret port=1234 user=username`
- str, err := ParseURL("postgres://username:top%20secret@hostname.remote:1234/database")
- if err != nil {
- t.Fatal(err)
- }
-
- if str != expected {
- t.Fatalf("unexpected result from ParseURL:\n+ %s\n- %s", str, expected)
- }
-}
-
-func TestInvalidProtocolParseURL(t *testing.T) {
- _, err := ParseURL("http://hostname.remote")
- switch err {
- case nil:
- t.Fatal("Expected an error from parsing invalid protocol")
- default:
- msg := "invalid connection protocol: http"
- if err.Error() != msg {
- t.Fatalf("Unexpected error message:\n+ %s\n- %s",
- err.Error(), msg)
- }
- }
-}
-
-func TestMinimalURL(t *testing.T) {
- cs, err := ParseURL("postgres://")
- if err != nil {
- t.Fatal(err)
- }
-
- if cs != "" {
- t.Fatalf("expected blank connection string, got: %q", cs)
- }
-}
diff --git a/vendor/github.com/lib/pq/uuid_test.go b/vendor/github.com/lib/pq/uuid_test.go
deleted file mode 100644
index 8ecee2fd..00000000
--- a/vendor/github.com/lib/pq/uuid_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package pq
-
-import (
- "reflect"
- "strings"
- "testing"
-)
-
-func TestDecodeUUIDBinaryError(t *testing.T) {
- t.Parallel()
- _, err := decodeUUIDBinary([]byte{0x12, 0x34})
-
- if err == nil {
- t.Fatal("Expected error, got none")
- }
- if !strings.HasPrefix(err.Error(), "pq:") {
- t.Errorf("Expected error to start with %q, got %q", "pq:", err.Error())
- }
- if !strings.Contains(err.Error(), "bad length: 2") {
- t.Errorf("Expected error to contain length, got %q", err.Error())
- }
-}
-
-func BenchmarkDecodeUUIDBinary(b *testing.B) {
- x := []byte{0x03, 0xa3, 0x52, 0x2f, 0x89, 0x28, 0x49, 0x87, 0x84, 0xd6, 0x93, 0x7b, 0x36, 0xec, 0x27, 0x6f}
-
- for i := 0; i < b.N; i++ {
- decodeUUIDBinary(x)
- }
-}
-
-func TestDecodeUUIDBackend(t *testing.T) {
- db := openTestConn(t)
- defer db.Close()
-
- var s = "a0ecc91d-a13f-4fe4-9fce-7e09777cc70a"
- var scanned interface{}
-
- err := db.QueryRow(`SELECT $1::uuid`, s).Scan(&scanned)
- if err != nil {
- t.Fatalf("Expected no error, got %v", err)
- }
- if !reflect.DeepEqual(scanned, []byte(s)) {
- t.Errorf("Expected []byte(%q), got %T(%q)", s, scanned, scanned)
- }
-}
diff --git a/vendor/github.com/tdewolff/minify/.gitattributes b/vendor/github.com/tdewolff/minify/.gitattributes
deleted file mode 100644
index 4c50ee14..00000000
--- a/vendor/github.com/tdewolff/minify/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-benchmarks/sample_* linguist-generated=true
diff --git a/vendor/github.com/tdewolff/minify/.gitignore b/vendor/github.com/tdewolff/minify/.gitignore
deleted file mode 100644
index 3f3e864b..00000000
--- a/vendor/github.com/tdewolff/minify/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-dist/
-benchmarks/*
-!benchmarks/*.go
-!benchmarks/sample_*
diff --git a/vendor/github.com/tdewolff/minify/.goreleaser.yml b/vendor/github.com/tdewolff/minify/.goreleaser.yml
deleted file mode 100644
index afaa1cb5..00000000
--- a/vendor/github.com/tdewolff/minify/.goreleaser.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-builds:
- - binary: minify
- main: ./cmd/minify/
- ldflags: -s -w -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.Date={{.Date}}
- env:
- - CGO_ENABLED=0
- goos:
- - linux
- - windows
- - darwin
- - freebsd
- - netbsd
- - openbsd
- goarch:
- - amd64
-archive:
- format: tar.gz
- format_overrides:
- - goos: windows
- format: zip
- name_template: "{{.Binary}}_{{.Version}}_{{.Os}}_{{.Arch}}"
- files:
- - README.md
- - LICENSE.md
-snapshot:
- name_template: "devel"
-release:
- draft: true
diff --git a/vendor/github.com/tdewolff/minify/.travis.yml b/vendor/github.com/tdewolff/minify/.travis.yml
deleted file mode 100644
index 4c14dfb2..00000000
--- a/vendor/github.com/tdewolff/minify/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: go
-before_install:
- - go get github.com/mattn/goveralls
-script:
- - goveralls -v -service travis-ci -repotoken $COVERALLS_TOKEN -ignore=cmd/minify/* || go test -v ./...
diff --git a/vendor/github.com/tdewolff/minify/LICENSE.md b/vendor/github.com/tdewolff/minify/LICENSE.md
deleted file mode 100644
index 41677de4..00000000
--- a/vendor/github.com/tdewolff/minify/LICENSE.md
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2015 Taco de Wolff
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/tdewolff/minify/README.md b/vendor/github.com/tdewolff/minify/README.md
deleted file mode 100644
index f051b09c..00000000
--- a/vendor/github.com/tdewolff/minify/README.md
+++ /dev/null
@@ -1,590 +0,0 @@
-# Minify [![Build Status](https://travis-ci.org/tdewolff/minify.svg?branch=master)](https://travis-ci.org/tdewolff/minify) [![GoDoc](http://godoc.org/github.com/tdewolff/minify?status.svg)](http://godoc.org/github.com/tdewolff/minify) [![Coverage Status](https://coveralls.io/repos/github/tdewolff/minify/badge.svg?branch=master)](https://coveralls.io/github/tdewolff/minify?branch=master) [![Join the chat at https://gitter.im/tdewolff/minify](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tdewolff/minify?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-**[Online demo](http://go.tacodewolff.nl/minify) if you need to minify files *now*.**
-
-**[Command line tool](https://github.com/tdewolff/minify/tree/master/cmd/minify) that minifies concurrently and supports watching file changes.**
-
-**[All releases](https://github.com/tdewolff/minify/releases) for various platforms.**
-
----
-
-Minify is a minifier package written in [Go][1]. It provides HTML5, CSS3, JS, JSON, SVG and XML minifiers and an interface to implement any other minifier. Minification is the process of removing bytes from a file (such as whitespace) without changing its output and therefore shrinking its size and speeding up transmission over the internet and possibly parsing. The implemented minifiers are designed for high performance.
-
-The core functionality associates mimetypes with minification functions, allowing embedded resources (like CSS or JS within HTML files) to be minified as well. Users can add new implementations that are triggered based on a mimetype (or pattern), or redirect to an external command (like ClosureCompiler, UglifyCSS, ...).
-
-#### Table of Contents
-
-- [Minify](#minify)
- - [Prologue](#prologue)
- - [Installation](#installation)
- - [API stability](#api-stability)
- - [Testing](#testing)
- - [Performance](#performance)
- - [HTML](#html)
- - [Whitespace removal](#whitespace-removal)
- - [CSS](#css)
- - [JS](#js)
- - [JSON](#json)
- - [SVG](#svg)
- - [XML](#xml)
- - [Usage](#usage)
- - [New](#new)
- - [From reader](#from-reader)
- - [From bytes](#from-bytes)
- - [From string](#from-string)
- - [To reader](#to-reader)
- - [To writer](#to-writer)
- - [Middleware](#middleware)
- - [Custom minifier](#custom-minifier)
- - [Mediatypes](#mediatypes)
- - [Examples](#examples)
- - [Common minifiers](#common-minifiers)
- - [Custom minifier](#custom-minifier-example)
- - [ResponseWriter](#responsewriter)
- - [Templates](#templates)
- - [License](#license)
-
-### Status
-
-* CSS: **fully implemented**
-* HTML: **fully implemented**
-* JS: improved JSmin implementation
-* JSON: **fully implemented**
-* SVG: partially implemented; in development
-* XML: **fully implemented**
-
-### Roadmap
-
-- [ ] General speed-up of all minifiers (use ASM for whitespace funcs)
-- [ ] Improve JS minifiers by shortening variables and proper semicolon omission
-- [ ] Speed-up SVG minifier, it is very slow
-- [x] Proper parser error reporting and line number + column information
-- [ ] Generation of source maps (uncertain, might slow down parsers too much if it cannot run separately nicely)
-- [ ] Look into compression of images, fonts and other web resources (into package `compress`)?
-- [ ] Create a cmd to pack webfiles (much like webpack), ie. merging CSS and JS files, inlining small external files, minification and gzipping. This would work on HTML files.
-- [ ] Create a package to format files, much like `gofmt` for Go files?
-
-## Prologue
-Minifiers or bindings to minifiers exist in almost all programming languages. Some implementations are merely using several regular-expressions to trim whitespace and comments (even though regex for parsing HTML/XML is ill-advised, for a good read see [Regular Expressions: Now You Have Two Problems](http://blog.codinghorror.com/regular-expressions-now-you-have-two-problems/)). Some implementations are much more profound, such as the [YUI Compressor](http://yui.github.io/yuicompressor/) and [Google Closure Compiler](https://github.com/google/closure-compiler) for JS. As most existing implementations either use JavaScript, use regexes, and don't focus on performance, they are pretty slow.
-
-This minifier proves to be that fast and extensive minifier that can handle HTML and any other filetype it may contain (CSS, JS, ...). It is usually orders of magnitude faster than existing minifiers.
-
-## Installation
-Run the following command
-
- go get github.com/tdewolff/minify
-
-or add the following imports and run the project with `go get`
-``` go
-import (
- "github.com/tdewolff/minify"
- "github.com/tdewolff/minify/css"
- "github.com/tdewolff/minify/html"
- "github.com/tdewolff/minify/js"
- "github.com/tdewolff/minify/json"
- "github.com/tdewolff/minify/svg"
- "github.com/tdewolff/minify/xml"
-)
-```
-
-## API stability
-There is no guarantee for absolute stability, but I take issues and bugs seriously and don't take API changes lightly. The library will be maintained in a compatible way unless vital bugs prevent me from doing so. There has been one API change after v1 which added options support and I took the opportunity to push through some more API clean up as well. There are no plans whatsoever for future API changes.
-
-## Testing
-For all subpackages and the imported `parse` and `buffer` packages, test coverage of 100% is pursued. Besides full coverage, the minifiers are [fuzz tested](https://github.com/tdewolff/fuzz) using [github.com/dvyukov/go-fuzz](http://www.github.com/dvyukov/go-fuzz), see [the wiki](https://github.com/tdewolff/minify/wiki) for the most important bugs found by fuzz testing. Furthermore am I working on adding visual testing to ensure that minification doesn't change anything visually. By using the WebKit browser to render the original and minified pages we can check whether any pixel is different.
-
-These tests ensure that everything works as intended, the code does not crash (whatever the input) and that it doesn't change the final result visually. If you still encounter a bug, please report [here](https://github.com/tdewolff/minify/issues)!
-
-## Performance
-The benchmarks directory contains a number of standardized samples used to compare performance between changes. To give an indication of the speed of this library, I've ran the tests on my Thinkpad T460 (i5-6300U quad-core 2.4GHz running Arch Linux) using Go 1.9.2.
-
-```
-name time/op
-CSS/sample_bootstrap.css-4 2.26ms ± 0%
-CSS/sample_gumby.css-4 2.92ms ± 1%
-HTML/sample_amazon.html-4 2.33ms ± 2%
-HTML/sample_bbc.html-4 1.02ms ± 1%
-HTML/sample_blogpost.html-4 171µs ± 2%
-HTML/sample_es6.html-4 14.5ms ± 0%
-HTML/sample_stackoverflow.html-4 2.41ms ± 1%
-HTML/sample_wikipedia.html-4 4.76ms ± 0%
-JS/sample_ace.js-4 7.41ms ± 0%
-JS/sample_dot.js-4 63.7µs ± 0%
-JS/sample_jquery.js-4 2.99ms ± 0%
-JS/sample_jqueryui.js-4 5.92ms ± 2%
-JS/sample_moment.js-4 1.09ms ± 1%
-JSON/sample_large.json-4 2.95ms ± 0%
-JSON/sample_testsuite.json-4 1.51ms ± 1%
-JSON/sample_twitter.json-4 6.75µs ± 1%
-SVG/sample_arctic.svg-4 62.3ms ± 1%
-SVG/sample_gopher.svg-4 218µs ± 0%
-SVG/sample_usa.svg-4 33.1ms ± 3%
-XML/sample_books.xml-4 36.2µs ± 0%
-XML/sample_catalog.xml-4 14.9µs ± 0%
-XML/sample_omg.xml-4 6.31ms ± 1%
-
-name speed
-CSS/sample_bootstrap.css-4 60.8MB/s ± 0%
-CSS/sample_gumby.css-4 63.9MB/s ± 1%
-HTML/sample_amazon.html-4 203MB/s ± 2%
-HTML/sample_bbc.html-4 113MB/s ± 1%
-HTML/sample_blogpost.html-4 123MB/s ± 2%
-HTML/sample_es6.html-4 70.7MB/s ± 0%
-HTML/sample_stackoverflow.html-4 85.2MB/s ± 1%
-HTML/sample_wikipedia.html-4 93.6MB/s ± 0%
-JS/sample_ace.js-4 86.9MB/s ± 0%
-JS/sample_dot.js-4 81.0MB/s ± 0%
-JS/sample_jquery.js-4 82.8MB/s ± 0%
-JS/sample_jqueryui.js-4 79.3MB/s ± 2%
-JS/sample_moment.js-4 91.2MB/s ± 1%
-JSON/sample_large.json-4 258MB/s ± 0%
-JSON/sample_testsuite.json-4 457MB/s ± 1%
-JSON/sample_twitter.json-4 226MB/s ± 1%
-SVG/sample_arctic.svg-4 23.6MB/s ± 1%
-SVG/sample_gopher.svg-4 26.7MB/s ± 0%
-SVG/sample_usa.svg-4 30.9MB/s ± 3%
-XML/sample_books.xml-4 122MB/s ± 0%
-XML/sample_catalog.xml-4 130MB/s ± 0%
-XML/sample_omg.xml-4 180MB/s ± 1%
-```
-
-## HTML
-
-HTML (with JS and CSS) minification typically shaves off about 10%.
-
-The HTML5 minifier uses these minifications:
-
-- strip unnecessary whitespace and otherwise collapse it to one space (or newline if it originally contained a newline)
-- strip superfluous quotes, or uses single/double quotes whichever requires fewer escapes
-- strip default attribute values and attribute boolean values
-- strip some empty attributes
-- strip unrequired tags (`html`, `head`, `body`, ...)
-- strip unrequired end tags (`tr`, `td`, `li`, ... and often `p`)
-- strip default protocols (`http:`, `https:` and `javascript:`)
-- strip all comments (including conditional comments, old IE versions are not supported anymore by Microsoft)
-- shorten `doctype` and `meta` charset
-- lowercase tags, attributes and some values to enhance gzip compression
-
-Options:
-
-- `KeepConditionalComments` preserve all IE conditional comments such as `` and ``, see https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx#syntax
-- `KeepDefaultAttrVals` preserve default attribute values such as `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Search
-
-
-
-
-
-
-
-
-
- All
-
-
-
-
-
-All Departments
-Amazon Instant Video
-Appliances
-Apps & Games
-Arts, Crafts & Sewing
-Automotive
-Baby
-Beauty
-Books
-CDs & Vinyl
-Cell Phones & Accessories
-Clothing, Shoes & Jewelry
- Women
- Men
- Girls
- Boys
- Baby
-Collectibles & Fine Art
-Computers
-Credit and Payment Cards
-Digital Music
-Electronics
-Gift Cards
-Grocery & Gourmet Food
-Health & Personal Care
-Home & Kitchen
-Industrial & Scientific
-Kindle Store
-Luggage & Travel Gear
-Magazine Subscriptions
-Movies & TV
-Musical Instruments
-Office Products
-Patio, Lawn & Garden
-Pet Supplies
-Prime Pantry
-Software
-Sports & Outdoors
-Tools & Home Improvement
-Toys & Games
-Video Games
-Wine
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
After viewing product detail pages, look here to find an easy way to navigate back to pages you are interested in.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
After viewing product detail pages, look here to find an easy way to navigate back to pages you are interested in.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Our recommendations service is currently unavailable. Please refresh this page or try again later.
-
We apologize for the inconvenience!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
v
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_arctic.svg b/vendor/github.com/tdewolff/minify/benchmarks/sample_arctic.svg
deleted file mode 100644
index 26cb992a..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_arctic.svg
+++ /dev/null
@@ -1,13940 +0,0 @@
-
-
-
-
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sea
-
-
- Kara
-
-
- Bay
-
-
- Bay
-
-
- A r c t i c
-
-
- Beaufort
-
-
- Laptev
-
-
- Barents Sea
-
-
- Greenland
-
-
- Baffin
-
-
- Hudson
-
-
- Sea
-
-
- Sea
-
-
- Sea
-
-
- Sea of
-
-
- Okhotsk
-
-
- Lake
-
-
- Lake
-
-
- Great Bear
-
-
- Great Slave
-
-
- Sea
-
-
- Baltic
-
-
- Black Sea
-
-
- Sea
-
-
- Bering
-
-
- Strait
-
-
- Chukchi
-
-
- average minimum
-
-
- extent of sea ice
-
-
-
-
- n
-
-
-
- e
-
-
-
- L
-
-
-
-
- a
-
-
-
-
- a
-
-
- m
-
-
- y
-
-
-
- l
-
-
-
- o
-
-
-
- K
-
-
-
-
-
- n
-
-
-
- a
-
-
-
- d
-
-
-
- l
-
-
-
- A
-
-
-
-
-
- y
-
-
-
- u
-
-
-
- y
-
-
-
- l
-
-
-
- i
-
-
-
- V
-
-
-
-
-
- n
-
-
-
- o
-
-
-
- k
-
-
-
- u
-
-
-
- Y
-
-
-
-
-
- a
-
-
-
- n
-
-
-
- e
-
-
-
- L
-
-
-
-
-
- r
-
-
-
- e
-
-
-
- v
-
-
-
- i
-
-
-
- R
-
-
-
-
-
- y
-
-
-
- e
-
-
-
- s
-
-
-
- i
-
-
-
- n
-
-
-
- e
-
-
-
- Y
-
-
-
- Lake
-
-
- Lake
-
-
- Ladoga
-
-
- Onega
-
-
-
-
- a
-
-
-
- g
-
-
-
- l
-
-
-
- o
-
-
-
- V
-
-
-
-
-
- v
-
-
-
- i
-
-
-
- R
-
-
-
-
-
- r
-
-
-
- e
-
-
-
-
-
- n
-
-
-
- e
-
-
-
- k
-
-
-
- c
-
-
-
- a
-
-
-
- M
-
-
-
-
-
- e
-
-
-
- i
-
-
-
- z
-
-
-
- North
-
-
- Sea
-
-
- East
-
-
- Siberian
-
-
- N o r t h P a c i f i c
-
-
- Lake
-
-
- Athabasca
-
-
- O c e a n
-
-
- Bering Sea
-
-
- O c e a n
-
-
- Denmark Strait
-
-
- Davis Strait
-
-
- N o r t h A t l a n t i c O c e a n
-
-
- Labrador
-
-
- Sea
-
-
- Norwegian
-
-
- Sea
-
-
-
-
- c
-
-
-
- e
-
-
-
- P
-
-
-
-
-
- a
-
-
-
- r
-
-
-
- o
-
-
-
- h
-
-
-
-
-
- '
-
-
-
- b
-
-
-
- O
-
-
-
-
-
- '
-
-
-
- b
-
-
-
- O
-
-
-
-
- h
-
-
- s
-
-
- y
-
-
- t
-
-
- r
-
-
- I
-
-
-
-
-
- m
-
-
-
- a
-
-
-
- K
-
-
-
-
- a
-
-
-
- n
-
-
- o
-
-
- D
-
-
-
-
-
- r
-
-
-
- e
-
-
-
- p
-
-
-
- e
-
-
-
- i
-
-
-
- n
-
-
-
- D
-
-
-
- Sea
-
-
-
- r
-
-
-
- u
-
-
-
- m
-
-
-
- A
-
-
-
- Alaska
-
-
- Gulf of
-
-
-
-
- e
-
-
-
- c
-
-
-
- a
-
-
-
- e
-
-
-
- P
-
-
-
-
- e
-
-
-
- r
-
-
-
- v
-
-
-
- R
-
-
-
- i
-
-
-
-
- h
-
-
-
- k
-
-
-
- u
-
-
-
- S
-
-
-
-
-
- a
-
-
-
- n
-
-
-
- o
-
-
-
- Dvina
-
-
-
-
- g
-
-
-
- e
-
-
-
- h
-
-
-
- c
-
-
-
- y
-
-
-
- V
-
-
-
-
-
- a
-
-
-
- d
-
-
-
-
- S
-
-
-
- e
-
-
-
- v
-
-
-
- e
-
-
-
- r
-
-
- n
-
-
-
- a
-
-
-
- y
-
-
- a
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- R U S S I A
-
-
- C A N A D A
-
-
- U.K.
-
-
- IRE.
-
-
- ICELAND
-
-
- NORWAY
-
-
- SWEDEN
-
-
- FINLAND
-
-
- LATVIA
-
-
- LITH.
-
-
- BELARUS
-
-
- UKRAINE
-
-
- POLAND
-
-
- DENMARK
-
-
- GERMANY
-
-
- EST.
-
-
- KAZ.
-
-
- JAPAN
-
-
- (DENMARK)
-
-
- Greenland
-
-
- (NORWAY)
-
-
- Svalbard
-
-
- (NORWAY)
-
-
- (NORWAY)
-
-
- CHINA
-
-
- UNITED STATES
-
-
- Faroe
-
-
- Islands
-
-
- Jan Mayen
-
-
- RUS.
-
-
- (DENMARK)
-
-
-
- 10˚C (50˚F) isotherm,
-
-
- July
-
-
- Belfast
-
-
- Dublin
-
-
- Juneau
-
-
- Anchorage
-
-
- Dawson
-
-
- Inuvik
-
-
- Barrow
-
-
- Provideniya
-
-
- Anadyr'
-
-
- Cherskiy
-
-
- Arkhangel'sk
-
-
- St. Petersburg
-
-
- Magadan
-
-
- Khabarovsk
-
-
- Nizhniy
-
-
- Novgorod
-
-
- Kazan'
-
-
- Perm'
-
-
- Whitehorse
-
-
- Yellowknife
-
-
- Echo Bay
-
-
- Nome
-
-
- Bay
-
-
- Prudhoe
-
-
- Fairbanks
-
-
- Alert
-
-
- Nord
-
-
- Tasiilaq
-
-
- Kangerlussuaq
-
-
- (Ammassalik)
-
-
- Okhotsk
-
-
- Oymyakon
-
-
- Verkhoyansk
-
-
- Bjørnøya
-
-
- Tiksi
-
-
- Moscow
-
-
- Tallinn
-
-
- Vilnius
-
-
- Qaanaaq
-
-
- (Thule)
-
-
- Kaujuitoq
-
-
- (Resolute)
-
-
- Cambridge
-
-
- Bay
-
-
- (Frobisher Bay)
-
-
- Iqaluit
-
-
- Kangiqcliniq
-
-
- (Rankin Inlet)
-
-
- Narsarsuaq
-
-
- (Frederikshåb)
-
-
- Itseqqortoormiit
-
-
- (Scoresbysund)
-
-
- Noril'sk
-
-
- Dikson
-
-
- Lake
-
-
- Watson
-
-
- Hay
-
-
- River
-
-
- Rostov
-
-
- Volgograd
-
-
- Saratov
-
-
- Samara
-
-
- Yakutsk
-
-
- Helsinki
-
-
- Oslo
-
-
- Riga
-
-
- Kharkiv
-
-
- Kiev
-
-
- Minsk
-
-
- Warsaw
-
-
- Berlin
-
-
- Copenhagen
-
-
- Kodiak
-
-
- Bethel
-
-
- Valdez
-
-
- Pevek
-
-
- Repulse Bay
-
-
- Tromsø
-
-
- (Søndre Strømfjord)
-
-
- Reykjavík
-
-
- Nuuk
-
-
- (Godthåb)
-
-
- Stockholm
-
-
- Tórshavn
-
-
- Paamiut
-
-
- Longyearbyen
-
-
- Murmansk
-
-
- Sakhalin
-
-
- administered by Russia, claimed by Japan.
-
-
- K
-
-
- U
-
-
- R
-
-
- I
-
-
- L
-
-
- I
-
-
- S
-
-
- L
-
-
- A
-
-
- N
-
-
- D
-
-
- S
-
-
- A
-
-
- L
-
-
- E
-
-
- U
-
-
- T
-
-
- I
-
-
- A
-
-
- N
-
-
- I
-
-
- S
-
-
- L
-
-
- A
-
-
- N
-
-
- D
-
-
- S
-
-
- occupied by the Soviet Union in 1945,
-
-
- Kamchatskiy
-
-
- Petropavlovsk-
-
-
- Island
-
-
- Wrangel
-
-
- NOVAYA
-
-
- ZEMLYA
-
-
- FRANZ
-
-
- JOSEF
-
-
- LAND
-
-
- SEVERNAYA
-
-
- ZEMLYA
-
-
- NEW
-
-
- SIBERIAN
-
-
- ISLANDS
-
-
- Ellesmere
-
-
- Island
-
-
- ISLANDS
-
-
- QUEEN
-
-
- ELIZABETH
-
-
- Banks
-
-
- Island
-
-
- Victoria
-
-
- Island
-
-
- SHETLAND
-
-
- ISLANDS
-
-
- Baffin
-
-
- Island
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- e
-
-
-
- l
-
-
-
- c
-
-
-
- r
-
-
-
- i
-
-
-
- C
-
-
-
-
-
- c
-
-
-
- i
-
-
-
- t
-
-
-
- c
-
-
-
- r
-
-
-
- A
-
-
-
-
- 30
-
-
-
- 30
-
-
-
-
- 0
-
-
-
- 6
-
-
-
-
-
- 0
-
-
-
- 7
-
-
-
-
- 60
-
-
-
-
- 0
-
-
-
- 5
-
-
-
-
-
- e
-
-
-
- l
-
-
-
- c
-
-
-
- r
-
-
-
- i
-
-
-
- C
-
-
-
-
-
- c
-
-
-
- i
-
-
-
- t
-
-
-
- c
-
-
-
- r
-
-
-
- A
-
-
-
-
- 150
-
-
-
- 120
-
-
-
- 180
-
-
-
- 150
-
-
-
- 120
-
-
-
- 60
-
-
- North
-
-
- Pole
-
-
-
-
- 0
-
-
-
- 8
-
-
-
-
- 90 E
-
-
-
- 90 W
-
-
-
- 0
-
-
-
-
- 0
-
-
-
- 8
-
-
-
-
-
- 0
-
-
-
- 7
-
-
-
-
-
- 0
-
-
-
- 6
-
-
-
-
- 0
-
-
- 5
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0
-
-
- 0
-
-
- 500 Kilometers
-
-
- Azimuthal Equal-Area Projection
-
-
- 500 Miles
-
-
- average temperature for the warmest month is below 10ºC.
-
-
- The Arctic region is often defined as that area where the
-
-
- ARCTIC REGION
-
-
- Scale 1:39,000,000
-
-
- 802916AI (R02112) 6-02
-
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_bbc.html b/vendor/github.com/tdewolff/minify/benchmarks/sample_bbc.html
deleted file mode 100644
index c8fd2d93..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_bbc.html
+++ /dev/null
@@ -1,513 +0,0 @@
-
- BBC - Homepage
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
For a better experience on your device, try our mobile site .
-
-
BBC Homepage
-
Tunisians vote in the country's first presidential election since the 2011 "Arab Spring" revolution that triggered uprisings across the region.
A law forcing communications firms to keep details that could help identify criminals using the internet is being planned by the home secretary.
All the latest action, the best from social media and top images as Crystal Palace host Liverpool in the Premier League.
-
-
-
-
-
-
-
-
Watch/Listen A fire on a train at Charing Cross station in Central London sparked an emergency evacuation on Sunday morning
-
-
-
-
-
-
-
-
There's more to lemmings than suicide
Procrastination: why we push things off until the last hour
The British carmaker unveils the Citysurfer Concept in LA
The new blockbuster reviewed
…and how can it treat blindness?
Where 'the vibe edges on the weird side’
-
-
-
-
Many think texts and tweets are crimes against proper grammar, but linguist Ben Zimmer argues that this misses the point.
Fancy a break from the busy streets of Central London? Take in the city wildlife while cruising down charming, cafe-lined Regent's Canal, a historic waterway that was built by hand.
From preferential treatment at the dealership to special consideration on the highway, BBC Autos set out to learn the intangible benefits of buying a big-ticket vehicle.
-
-
-
-
TV & Radio On air now: 14:05 - 15:00 GMT The Science Hour Monica Grady from the Open University discusses the latest news from the comet mission. Next on air: 15:00 - 15:05 GMT BBC News The latest five minute news bulletin from BBC World Service. Today's Schedule London Sun Max Temperature : 12°C 54°F
Min Temperature : 3°C 37°F
Mon Max Temperature : 8°C 46°F
Min Temperature : 4°C 39°F
Tue Max Temperature : 9°C 48°F
Min Temperature : 7°C 45°F
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_blogpost.html b/vendor/github.com/tdewolff/minify/benchmarks/sample_blogpost.html
deleted file mode 100644
index f0b977fb..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_blogpost.html
+++ /dev/null
@@ -1,580 +0,0 @@
-
-
-
-
- research!rsc: My Go Resolutions for 2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
My Go Resolutions for 2017
-
-
-
- Posted on Wednesday, January 18, 2017.
-
-
-
-
-
-
’Tis the season for resolutions,
-and I thought it would make sense to write a little
-about what I hope to work on this year as far as Go is concerned.
-
-
My goal every year is to help Go developers .
-I want to make sure that the work we do on the Go team
-has a significant, positive impact on Go developers.
-That may sound obvious, but there are a variety of common ways to fail to achieve that:
-for example, spending too much time cleaning up or optimizing code that doesn’t need it;
-responding only to the most common or recent complaints or requests;
-or focusing too much on short-term improvements.
-It’s important to step back and make sure we’re focusing
-our development work where it does the most good.
-
-
This post outlines a few of my own major focuses for this year.
-This is only my personal list, not the Go team’s list.
-
-
One reason for posting this is to gather feedback.
-If these spark any ideas or suggestions of your own,
-please feel free to comment below or on the linked GitHub issues.
-
-
Another reason is to make clear that I’m aware of these issues as important.
-I think too often people interpret lack of action by the Go team
-as a signal that we think everything is perfect, when instead
-there is simply other, higher priority work to do first.
-
-
Type aliases
-
-
There is a recurring problem with moving types
-from one package to another during large codebase refactorings.
-We tried to solve it last year with general aliases ,
-which didn’t work for at least two reasons: we didn’t explain the change well enough,
-and we didn’t deliver it on time, so it wasn’t ready for Go 1.8.
-Learning from that experience,
-I gave a talk
-and wrote an article
-about the underlying problem,
-and that started a productive discussion
-on the Go issue tracker about the solution space.
-It looks like more limited type aliases
-are the right next step.
-I want to make sure those land smoothly in Go 1.9. #18130 .
-
-
Package management
-
-
I designed the Go support for downloading published packages
-(“goinstall”, which became “go get”) in February 2010.
-A lot has happened since then.
-In particular, other language ecosystems have really raised the bar
-for what people expect from package management,
-and the open source world has mostly agreed on
-semantic versioning , which provides a useful base
-for inferring version compatibility.
-Go needs to do better here, and a group of contributors have been
-working on a solution .
-I want to make sure these ideas are integrated well
-into the standard Go toolchain and to make package management
-a reason that people love Go.
-
-
Build improvements
-
-
There are a handful of shortcomings in the design of
-the go command’s build system that are overdue to be fixed.
-Here are three representative examples that I intend to
-address with a bit of a redesign of the internals of the go command.
-
-
Builds can be too slow,
-because the go command doesn’t cache build results as aggressively as it should.
-Many people don’t realize that go
install
saves its work while go
build
does not,
-and then they run repeated go
build
commands that are slow
-because the later builds do more work than they should need to.
-The same for repeated go
test
without go
test
-i
when dependencies are modified.
-All builds should be as incremental as possible.
-#4719 .
-
-
Test results should be cached too:
-if none of the inputs to a test have changed,
-then usually there is no need to rerun the test.
-This will make it very cheap to run “all tests” when little or nothing has changed.
-#11193 .
-
-
Work outside GOPATH should be supported nearly as well
-as work inside GOPATH.
-In particular, it should be possible to git
clone
a repo,
-cd
into it, and run go
commands and have them work fine.
-Package management only makes that more important:
-you’ll need to be able to work on different versions of a package (say, v1 and v2)
-without having entirely separate GOPATHs for them.
-#17271 .
-
-
Code corpus
-
-
I think it helped to have concrete examples from real projects
-in the talk and article I prepared about codebase refactoring (see above ).
-We’ve also defined that additions to vet
-must target problems that happen frequently in real programs.
-I’d like to see that kind of analysis of actual practice—examining
-the effects on and possible improvements to real programs—become a
-standard way we discuss and evaluate changes to Go.
-
-
Right now there’s not an agreed-upon representative corpus of code to use for
-those analyses: everyone must first create their own, which is too much work.
-I’d like to put together a single, self-contained Git repo people can check out that
-contains our official baseline corpus for those analyses.
-A possible starting point could be the top 100 Go language repos
-on GitHub by stars or forks or both.
-
-
Automatic vet
-
-
The Go distribution ships with this powerful tool,
-go
vet
,
-that points out correctness bugs.
-We have a high bar for checks, so that when vet speaks, you should listen.
-But everyone has to remember to run it.
-It would be better if you didn’t have to remember.
-In particular, I think we could probably run vet
-in parallel with the final compile and link of the test binary
-during go
test
without slowing the compile-edit-test cycle at all.
-If we can do that, and if we limit the enabled vet checks to a subset
-that is essentially 100% accurate,
-we can make passing vet a precondition for running a test at all.
-Then developers don’t need to remember to run go
vet
.
-They run go
test
,
-and once in a while vet speaks up with something important
-and avoids a debugging session.
-#18084 ,
-#18085 .
-
-
Errors & best practices
-
-
Part of the intended contract for error reporting in Go is that functions
-include relevant available context, including the operation being attempted
-(such as the function name and its arguments).
-For example, this program:
-
-
err := os.Remove("/tmp/nonexist")
-fmt.Println(err)
-
-
-
prints this output:
-
-
remove /tmp/nonexist: no such file or directory
-
-
-
Not enough Go code adds context like os.Remove
does. Too much code does only
-
-
if err != nil {
- return err
-}
-
-
-
all the way up the call stack,
-discarding useful context that should be reported
-(like remove
/tmp/nonexist:
above).
-I would like to try to understand whether our expectations
-for including context are wrong, or if there is something
-we can do to make it easier to write code that returns better errors.
-
-
There are also various discussions in the community about
-agreed-upon interfaces for stripping error context.
-I would like to try to understand when that makes sense and
-whether we should adopt an official recommendation.
-
-
Context & best practices
-
-
We added the new context package
-in Go 1.7 for holding request-scoped information like
-timeouts, cancellation state, and credentials .
-An individual context is immutable (like an individual string or int):
-it is only possible to derive a new, updated context and
-pass that context explicitly further down the call stack or
-(less commonly) back up to the caller.
-The context is now carried through APIs such as
-database/sql
-and
-net/http ,
-mainly so that those can stop processing a request when the caller
-is no longer interested in the result.
-Timeout information is appropriate to carry in a context,
-but—to use a real example we removed —database options
-are not, because they are unlikely to apply equally well to all possible
-database operations carried out during a request.
-What about the current clock source, or logging sink?
-Is either of those appropriate to store in a context?
-I would like to try to understand and characterize the
-criteria for what is and is not an appropriate use of context.
-
-
Memory model
-
-
Go’s memory model is intentionally low-key,
-making few promises to users, compared to other languages.
-In fact it starts by discouraging people from reading the rest of the document.
-At the same time, it demands more of the compiler than other languages:
-in particular, a race on an integer value is not sufficient license
-for your program to misbehave in arbitrary ways.
-But there are some complete gaps, in particular no mention of
-the sync/atomic package .
-I think the core compiler and runtime developers all agree
-that the behavior of those atomics should be roughly the same as
-C++ seqcst atomics or Java volatiles,
-but we still need to write that down carefully in the memory model,
-and probably also in a long blog post.
-#5045 ,
-#7948 ,
-#9442 .
-
-
Immutability
-
-
The race detector
-is one of Go’s most loved features.
-But not having races would be even better.
-I would love it if there were some reasonable way to integrate
-reference immutability into Go,
-so that programmers can make clear, checked assertions about what can and cannot
-be written and thereby eliminate certain races at compile time.
-Go already has one immutable type, string
; it would
-be nice to retroactively define that
-string
is a named type (or type alias) for immutable
[]byte
.
-I don’t think that will happen this year,
-but I’d like to understand the solution space better.
-Javari, Midori, Pony, and Rust have all staked out interesting points
-in the solution space, and there are plenty of research papers
-beyond those.
-
-
In the long-term, if we could statically eliminate the possibility of races,
-that would eliminate the need for most of the memory model.
-That may well be an impossible dream,
-but again I’d like to understand the solution space better.
-
-
Generics
-
-
Nothing sparks more heated arguments
-among Go and non-Go developers than the question of whether Go should
-have support for generics (or how many years ago that should have happened).
-I don’t believe the Go team has ever said “Go does not need generics.”
-What we have said is that there are higher-priority issues facing Go.
-For example, I believe that better support for package management
-would have a much larger immediate positive impact on most Go developers
-than adding generics.
-But we do certainly understand that for a certain subset of Go use cases,
-the lack of parametric polymorphism is a significant hindrance.
-
-
Personally, I would like to be able to write general channel-processing
-functions like:
-
-
// Join makes all messages received on the input channels
-// available for receiving from the returned channel.
-func Join(inputs ...<-chan T) <-chan T
-
-// Dup duplicates messages received on c to both c1 and c2.
-func Dup(c <-chan T) (c1, c2 <-chan T)
-
-
-
I would also like to be able to write
-Go support for high-level data processing abstractions,
-analogous to
-FlumeJava or
-C#’s LINQ ,
-in a way that catches type errors at compile time instead of at run time.
-There are also any number of data structures or generic algorithms
-that might be written,
-but I personally find these broader applications more compelling.
-
-
We’ve struggled off and on
-for years
-to find the right way to add generics to Go.
-At least a few of the past proposals got hung up on trying to design
-something that provided both general parametric polymorphism
-(like chan
T
) and also a unification of string
and []byte
.
-If the latter is handled by parameterization over immutability,
-as described in the previous section, then maybe that simplifies
-the demands on a design for generics.
-
-
When I first started thinking about generics for Go in 2008,
-the main examples to learn from were C#, Java, Haskell, and ML.
-None of the approaches in those languages seemed like a
-perfect fit for Go.
-Today, there are newer attempts to learn from as well,
-including Dart, Midori, Rust, and Swift.
-
-
It’s been a few years since we ventured out and explored the design space.
-It is probably time to look around again,
-especially in light of the insight about mutability and
-the additional examples set by newer languages.
-I don’t think generics will happen this year,
-but I’d like to be able to say I understand the solution space better.
-
-
-
-
-
-
-
Please enable JavaScript to view the comments powered by Disqus.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_books.xml b/vendor/github.com/tdewolff/minify/benchmarks/sample_books.xml
deleted file mode 100644
index 7c254f12..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_books.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
- Gambardella, Matthew
- XML Developer's Guide
- Computer
- 44.95
- 2000-10-01
- An in-depth look at creating applications
- with XML.
-
-
- Ralls, Kim
- Midnight Rain
- Fantasy
- 5.95
- 2000-12-16
- A former architect battles corporate zombies,
- an evil sorceress, and her own childhood to become queen
- of the world.
-
-
- Corets, Eva
- Maeve Ascendant
- Fantasy
- 5.95
- 2000-11-17
- After the collapse of a nanotechnology
- society in England, the young survivors lay the
- foundation for a new society.
-
-
- Corets, Eva
- Oberon's Legacy
- Fantasy
- 5.95
- 2001-03-10
- In post-apocalypse England, the mysterious
- agent known only as Oberon helps to create a new life
- for the inhabitants of London. Sequel to Maeve
- Ascendant.
-
-
- Corets, Eva
- The Sundered Grail
- Fantasy
- 5.95
- 2001-09-10
- The two daughters of Maeve, half-sisters,
- battle one another for control of England. Sequel to
- Oberon's Legacy.
-
-
- Randall, Cynthia
- Lover Birds
- Romance
- 4.95
- 2000-09-02
- When Carla meets Paul at an ornithology
- conference, tempers fly as feathers get ruffled.
-
-
- Thurman, Paula
- Splish Splash
- Romance
- 4.95
- 2000-11-02
- A deep sea diver finds true love twenty
- thousand leagues beneath the sea.
-
-
- Knorr, Stefan
- Creepy Crawlies
- Horror
- 4.95
- 2000-12-06
- An anthology of horror stories about roaches,
- centipedes, scorpions and other insects.
-
-
- Kress, Peter
- Paradox Lost
- Science Fiction
- 6.95
- 2000-11-02
- After an inadvertant trip through a Heisenberg
- Uncertainty Device, James Salway discovers the problems
- of being quantum.
-
-
- O'Brien, Tim
- Microsoft .NET: The Programming Bible
- Computer
- 36.95
- 2000-12-09
- Microsoft's .NET initiative is explored in
- detail in this deep programmer's reference.
-
-
- O'Brien, Tim
- MSXML3: A Comprehensive Guide
- Computer
- 36.95
- 2000-12-01
- The Microsoft MSXML3 parser is covered in
- detail, with attention to XML DOM interfaces, XSLT processing,
- SAX and more.
-
-
- Galos, Mike
- Visual Studio 7: A Comprehensive Guide
- Computer
- 49.95
- 2001-04-16
- Microsoft Visual Studio 7 is explored in depth,
- looking at how Visual Basic, Visual C++, C#, and ASP+ are
- integrated into a comprehensive development
- environment.
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_bootstrap.css b/vendor/github.com/tdewolff/minify/benchmarks/sample_bootstrap.css
deleted file mode 100644
index c6f3d210..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_bootstrap.css
+++ /dev/null
@@ -1,6332 +0,0 @@
-/*!
- * Bootstrap v3.3.1 (http://getbootstrap.com)
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-
-/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
-html {
- font-family: sans-serif;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-body {
- margin: 0;
-}
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-menu,
-nav,
-section,
-summary {
- display: block;
-}
-audio,
-canvas,
-progress,
-video {
- display: inline-block;
- vertical-align: baseline;
-}
-audio:not([controls]) {
- display: none;
- height: 0;
-}
-[hidden],
-template {
- display: none;
-}
-a {
- background-color: transparent;
-}
-a:active,
-a:hover {
- outline: 0;
-}
-abbr[title] {
- border-bottom: 1px dotted;
-}
-b,
-strong {
- font-weight: bold;
-}
-dfn {
- font-style: italic;
-}
-h1 {
- margin: .67em 0;
- font-size: 2em;
-}
-mark {
- color: #000;
- background: #ff0;
-}
-small {
- font-size: 80%;
-}
-sub,
-sup {
- position: relative;
- font-size: 75%;
- line-height: 0;
- vertical-align: baseline;
-}
-sup {
- top: -.5em;
-}
-sub {
- bottom: -.25em;
-}
-img {
- border: 0;
-}
-svg:not(:root) {
- overflow: hidden;
-}
-figure {
- margin: 1em 40px;
-}
-hr {
- height: 0;
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-pre {
- overflow: auto;
-}
-code,
-kbd,
-pre,
-samp {
- font-family: monospace, monospace;
- font-size: 1em;
-}
-button,
-input,
-optgroup,
-select,
-textarea {
- margin: 0;
- font: inherit;
- color: inherit;
-}
-button {
- overflow: visible;
-}
-button,
-select {
- text-transform: none;
-}
-button,
-html input[type="button"],
-input[type="reset"],
-input[type="submit"] {
- -webkit-appearance: button;
- cursor: pointer;
-}
-button[disabled],
-html input[disabled] {
- cursor: default;
-}
-button::-moz-focus-inner,
-input::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
-input {
- line-height: normal;
-}
-input[type="checkbox"],
-input[type="radio"] {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- padding: 0;
-}
-input[type="number"]::-webkit-inner-spin-button,
-input[type="number"]::-webkit-outer-spin-button {
- height: auto;
-}
-input[type="search"] {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- -webkit-appearance: textfield;
-}
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-fieldset {
- padding: .35em .625em .75em;
- margin: 0 2px;
- border: 1px solid #c0c0c0;
-}
-legend {
- padding: 0;
- border: 0;
-}
-textarea {
- overflow: auto;
-}
-optgroup {
- font-weight: bold;
-}
-table {
- border-spacing: 0;
- border-collapse: collapse;
-}
-td,
-th {
- padding: 0;
-}
-/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
-@media print {
- *,
- *:before,
- *:after {
- color: #000 !important;
- text-shadow: none !important;
- background: transparent !important;
- -webkit-box-shadow: none !important;
- box-shadow: none !important;
- }
- a,
- a:visited {
- text-decoration: underline;
- }
- a[href]:after {
- content: " (" attr(href) ")";
- }
- abbr[title]:after {
- content: " (" attr(title) ")";
- }
- a[href^="#"]:after,
- a[href^="javascript:"]:after {
- content: "";
- }
- pre,
- blockquote {
- border: 1px solid #999;
-
- page-break-inside: avoid;
- }
- thead {
- display: table-header-group;
- }
- tr,
- img {
- page-break-inside: avoid;
- }
- img {
- max-width: 100% !important;
- }
- p,
- h2,
- h3 {
- orphans: 3;
- widows: 3;
- }
- h2,
- h3 {
- page-break-after: avoid;
- }
- select {
- background: #fff !important;
- }
- .navbar {
- display: none;
- }
- .btn > .caret,
- .dropup > .btn > .caret {
- border-top-color: #000 !important;
- }
- .label {
- border: 1px solid #000;
- }
- .table {
- border-collapse: collapse !important;
- }
- .table td,
- .table th {
- background-color: #fff !important;
- }
- .table-bordered th,
- .table-bordered td {
- border: 1px solid #ddd !important;
- }
-}
-@font-face {
- font-family: 'Glyphicons Halflings';
-
- src: url('../fonts/glyphicons-halflings-regular.eot');
- src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-}
-.glyphicon {
- position: relative;
- top: 1px;
- display: inline-block;
- font-family: 'Glyphicons Halflings';
- font-style: normal;
- font-weight: normal;
- line-height: 1;
-
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-.glyphicon-asterisk:before {
- content: "\2a";
-}
-.glyphicon-plus:before {
- content: "\2b";
-}
-.glyphicon-euro:before,
-.glyphicon-eur:before {
- content: "\20ac";
-}
-.glyphicon-minus:before {
- content: "\2212";
-}
-.glyphicon-cloud:before {
- content: "\2601";
-}
-.glyphicon-envelope:before {
- content: "\2709";
-}
-.glyphicon-pencil:before {
- content: "\270f";
-}
-.glyphicon-glass:before {
- content: "\e001";
-}
-.glyphicon-music:before {
- content: "\e002";
-}
-.glyphicon-search:before {
- content: "\e003";
-}
-.glyphicon-heart:before {
- content: "\e005";
-}
-.glyphicon-star:before {
- content: "\e006";
-}
-.glyphicon-star-empty:before {
- content: "\e007";
-}
-.glyphicon-user:before {
- content: "\e008";
-}
-.glyphicon-film:before {
- content: "\e009";
-}
-.glyphicon-th-large:before {
- content: "\e010";
-}
-.glyphicon-th:before {
- content: "\e011";
-}
-.glyphicon-th-list:before {
- content: "\e012";
-}
-.glyphicon-ok:before {
- content: "\e013";
-}
-.glyphicon-remove:before {
- content: "\e014";
-}
-.glyphicon-zoom-in:before {
- content: "\e015";
-}
-.glyphicon-zoom-out:before {
- content: "\e016";
-}
-.glyphicon-off:before {
- content: "\e017";
-}
-.glyphicon-signal:before {
- content: "\e018";
-}
-.glyphicon-cog:before {
- content: "\e019";
-}
-.glyphicon-trash:before {
- content: "\e020";
-}
-.glyphicon-home:before {
- content: "\e021";
-}
-.glyphicon-file:before {
- content: "\e022";
-}
-.glyphicon-time:before {
- content: "\e023";
-}
-.glyphicon-road:before {
- content: "\e024";
-}
-.glyphicon-download-alt:before {
- content: "\e025";
-}
-.glyphicon-download:before {
- content: "\e026";
-}
-.glyphicon-upload:before {
- content: "\e027";
-}
-.glyphicon-inbox:before {
- content: "\e028";
-}
-.glyphicon-play-circle:before {
- content: "\e029";
-}
-.glyphicon-repeat:before {
- content: "\e030";
-}
-.glyphicon-refresh:before {
- content: "\e031";
-}
-.glyphicon-list-alt:before {
- content: "\e032";
-}
-.glyphicon-lock:before {
- content: "\e033";
-}
-.glyphicon-flag:before {
- content: "\e034";
-}
-.glyphicon-headphones:before {
- content: "\e035";
-}
-.glyphicon-volume-off:before {
- content: "\e036";
-}
-.glyphicon-volume-down:before {
- content: "\e037";
-}
-.glyphicon-volume-up:before {
- content: "\e038";
-}
-.glyphicon-qrcode:before {
- content: "\e039";
-}
-.glyphicon-barcode:before {
- content: "\e040";
-}
-.glyphicon-tag:before {
- content: "\e041";
-}
-.glyphicon-tags:before {
- content: "\e042";
-}
-.glyphicon-book:before {
- content: "\e043";
-}
-.glyphicon-bookmark:before {
- content: "\e044";
-}
-.glyphicon-print:before {
- content: "\e045";
-}
-.glyphicon-camera:before {
- content: "\e046";
-}
-.glyphicon-font:before {
- content: "\e047";
-}
-.glyphicon-bold:before {
- content: "\e048";
-}
-.glyphicon-italic:before {
- content: "\e049";
-}
-.glyphicon-text-height:before {
- content: "\e050";
-}
-.glyphicon-text-width:before {
- content: "\e051";
-}
-.glyphicon-align-left:before {
- content: "\e052";
-}
-.glyphicon-align-center:before {
- content: "\e053";
-}
-.glyphicon-align-right:before {
- content: "\e054";
-}
-.glyphicon-align-justify:before {
- content: "\e055";
-}
-.glyphicon-list:before {
- content: "\e056";
-}
-.glyphicon-indent-left:before {
- content: "\e057";
-}
-.glyphicon-indent-right:before {
- content: "\e058";
-}
-.glyphicon-facetime-video:before {
- content: "\e059";
-}
-.glyphicon-picture:before {
- content: "\e060";
-}
-.glyphicon-map-marker:before {
- content: "\e062";
-}
-.glyphicon-adjust:before {
- content: "\e063";
-}
-.glyphicon-tint:before {
- content: "\e064";
-}
-.glyphicon-edit:before {
- content: "\e065";
-}
-.glyphicon-share:before {
- content: "\e066";
-}
-.glyphicon-check:before {
- content: "\e067";
-}
-.glyphicon-move:before {
- content: "\e068";
-}
-.glyphicon-step-backward:before {
- content: "\e069";
-}
-.glyphicon-fast-backward:before {
- content: "\e070";
-}
-.glyphicon-backward:before {
- content: "\e071";
-}
-.glyphicon-play:before {
- content: "\e072";
-}
-.glyphicon-pause:before {
- content: "\e073";
-}
-.glyphicon-stop:before {
- content: "\e074";
-}
-.glyphicon-forward:before {
- content: "\e075";
-}
-.glyphicon-fast-forward:before {
- content: "\e076";
-}
-.glyphicon-step-forward:before {
- content: "\e077";
-}
-.glyphicon-eject:before {
- content: "\e078";
-}
-.glyphicon-chevron-left:before {
- content: "\e079";
-}
-.glyphicon-chevron-right:before {
- content: "\e080";
-}
-.glyphicon-plus-sign:before {
- content: "\e081";
-}
-.glyphicon-minus-sign:before {
- content: "\e082";
-}
-.glyphicon-remove-sign:before {
- content: "\e083";
-}
-.glyphicon-ok-sign:before {
- content: "\e084";
-}
-.glyphicon-question-sign:before {
- content: "\e085";
-}
-.glyphicon-info-sign:before {
- content: "\e086";
-}
-.glyphicon-screenshot:before {
- content: "\e087";
-}
-.glyphicon-remove-circle:before {
- content: "\e088";
-}
-.glyphicon-ok-circle:before {
- content: "\e089";
-}
-.glyphicon-ban-circle:before {
- content: "\e090";
-}
-.glyphicon-arrow-left:before {
- content: "\e091";
-}
-.glyphicon-arrow-right:before {
- content: "\e092";
-}
-.glyphicon-arrow-up:before {
- content: "\e093";
-}
-.glyphicon-arrow-down:before {
- content: "\e094";
-}
-.glyphicon-share-alt:before {
- content: "\e095";
-}
-.glyphicon-resize-full:before {
- content: "\e096";
-}
-.glyphicon-resize-small:before {
- content: "\e097";
-}
-.glyphicon-exclamation-sign:before {
- content: "\e101";
-}
-.glyphicon-gift:before {
- content: "\e102";
-}
-.glyphicon-leaf:before {
- content: "\e103";
-}
-.glyphicon-fire:before {
- content: "\e104";
-}
-.glyphicon-eye-open:before {
- content: "\e105";
-}
-.glyphicon-eye-close:before {
- content: "\e106";
-}
-.glyphicon-warning-sign:before {
- content: "\e107";
-}
-.glyphicon-plane:before {
- content: "\e108";
-}
-.glyphicon-calendar:before {
- content: "\e109";
-}
-.glyphicon-random:before {
- content: "\e110";
-}
-.glyphicon-comment:before {
- content: "\e111";
-}
-.glyphicon-magnet:before {
- content: "\e112";
-}
-.glyphicon-chevron-up:before {
- content: "\e113";
-}
-.glyphicon-chevron-down:before {
- content: "\e114";
-}
-.glyphicon-retweet:before {
- content: "\e115";
-}
-.glyphicon-shopping-cart:before {
- content: "\e116";
-}
-.glyphicon-folder-close:before {
- content: "\e117";
-}
-.glyphicon-folder-open:before {
- content: "\e118";
-}
-.glyphicon-resize-vertical:before {
- content: "\e119";
-}
-.glyphicon-resize-horizontal:before {
- content: "\e120";
-}
-.glyphicon-hdd:before {
- content: "\e121";
-}
-.glyphicon-bullhorn:before {
- content: "\e122";
-}
-.glyphicon-bell:before {
- content: "\e123";
-}
-.glyphicon-certificate:before {
- content: "\e124";
-}
-.glyphicon-thumbs-up:before {
- content: "\e125";
-}
-.glyphicon-thumbs-down:before {
- content: "\e126";
-}
-.glyphicon-hand-right:before {
- content: "\e127";
-}
-.glyphicon-hand-left:before {
- content: "\e128";
-}
-.glyphicon-hand-up:before {
- content: "\e129";
-}
-.glyphicon-hand-down:before {
- content: "\e130";
-}
-.glyphicon-circle-arrow-right:before {
- content: "\e131";
-}
-.glyphicon-circle-arrow-left:before {
- content: "\e132";
-}
-.glyphicon-circle-arrow-up:before {
- content: "\e133";
-}
-.glyphicon-circle-arrow-down:before {
- content: "\e134";
-}
-.glyphicon-globe:before {
- content: "\e135";
-}
-.glyphicon-wrench:before {
- content: "\e136";
-}
-.glyphicon-tasks:before {
- content: "\e137";
-}
-.glyphicon-filter:before {
- content: "\e138";
-}
-.glyphicon-briefcase:before {
- content: "\e139";
-}
-.glyphicon-fullscreen:before {
- content: "\e140";
-}
-.glyphicon-dashboard:before {
- content: "\e141";
-}
-.glyphicon-paperclip:before {
- content: "\e142";
-}
-.glyphicon-heart-empty:before {
- content: "\e143";
-}
-.glyphicon-link:before {
- content: "\e144";
-}
-.glyphicon-phone:before {
- content: "\e145";
-}
-.glyphicon-pushpin:before {
- content: "\e146";
-}
-.glyphicon-usd:before {
- content: "\e148";
-}
-.glyphicon-gbp:before {
- content: "\e149";
-}
-.glyphicon-sort:before {
- content: "\e150";
-}
-.glyphicon-sort-by-alphabet:before {
- content: "\e151";
-}
-.glyphicon-sort-by-alphabet-alt:before {
- content: "\e152";
-}
-.glyphicon-sort-by-order:before {
- content: "\e153";
-}
-.glyphicon-sort-by-order-alt:before {
- content: "\e154";
-}
-.glyphicon-sort-by-attributes:before {
- content: "\e155";
-}
-.glyphicon-sort-by-attributes-alt:before {
- content: "\e156";
-}
-.glyphicon-unchecked:before {
- content: "\e157";
-}
-.glyphicon-expand:before {
- content: "\e158";
-}
-.glyphicon-collapse-down:before {
- content: "\e159";
-}
-.glyphicon-collapse-up:before {
- content: "\e160";
-}
-.glyphicon-log-in:before {
- content: "\e161";
-}
-.glyphicon-flash:before {
- content: "\e162";
-}
-.glyphicon-log-out:before {
- content: "\e163";
-}
-.glyphicon-new-window:before {
- content: "\e164";
-}
-.glyphicon-record:before {
- content: "\e165";
-}
-.glyphicon-save:before {
- content: "\e166";
-}
-.glyphicon-open:before {
- content: "\e167";
-}
-.glyphicon-saved:before {
- content: "\e168";
-}
-.glyphicon-import:before {
- content: "\e169";
-}
-.glyphicon-export:before {
- content: "\e170";
-}
-.glyphicon-send:before {
- content: "\e171";
-}
-.glyphicon-floppy-disk:before {
- content: "\e172";
-}
-.glyphicon-floppy-saved:before {
- content: "\e173";
-}
-.glyphicon-floppy-remove:before {
- content: "\e174";
-}
-.glyphicon-floppy-save:before {
- content: "\e175";
-}
-.glyphicon-floppy-open:before {
- content: "\e176";
-}
-.glyphicon-credit-card:before {
- content: "\e177";
-}
-.glyphicon-transfer:before {
- content: "\e178";
-}
-.glyphicon-cutlery:before {
- content: "\e179";
-}
-.glyphicon-header:before {
- content: "\e180";
-}
-.glyphicon-compressed:before {
- content: "\e181";
-}
-.glyphicon-earphone:before {
- content: "\e182";
-}
-.glyphicon-phone-alt:before {
- content: "\e183";
-}
-.glyphicon-tower:before {
- content: "\e184";
-}
-.glyphicon-stats:before {
- content: "\e185";
-}
-.glyphicon-sd-video:before {
- content: "\e186";
-}
-.glyphicon-hd-video:before {
- content: "\e187";
-}
-.glyphicon-subtitles:before {
- content: "\e188";
-}
-.glyphicon-sound-stereo:before {
- content: "\e189";
-}
-.glyphicon-sound-dolby:before {
- content: "\e190";
-}
-.glyphicon-sound-5-1:before {
- content: "\e191";
-}
-.glyphicon-sound-6-1:before {
- content: "\e192";
-}
-.glyphicon-sound-7-1:before {
- content: "\e193";
-}
-.glyphicon-copyright-mark:before {
- content: "\e194";
-}
-.glyphicon-registration-mark:before {
- content: "\e195";
-}
-.glyphicon-cloud-download:before {
- content: "\e197";
-}
-.glyphicon-cloud-upload:before {
- content: "\e198";
-}
-.glyphicon-tree-conifer:before {
- content: "\e199";
-}
-.glyphicon-tree-deciduous:before {
- content: "\e200";
-}
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-*:before,
-*:after {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-html {
- font-size: 10px;
-
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-body {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 1.42857143;
- color: #333;
- background-color: #fff;
-}
-input,
-button,
-select,
-textarea {
- font-family: inherit;
- font-size: inherit;
- line-height: inherit;
-}
-a {
- color: #337ab7;
- text-decoration: none;
-}
-a:hover,
-a:focus {
- color: #23527c;
- text-decoration: underline;
-}
-a:focus {
- outline: thin dotted;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-figure {
- margin: 0;
-}
-img {
- vertical-align: middle;
-}
-.img-responsive,
-.thumbnail > img,
-.thumbnail a > img,
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
- display: block;
- max-width: 100%;
- height: auto;
-}
-.img-rounded {
- border-radius: 6px;
-}
-.img-thumbnail {
- display: inline-block;
- max-width: 100%;
- height: auto;
- padding: 4px;
- line-height: 1.42857143;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 4px;
- -webkit-transition: all .2s ease-in-out;
- -o-transition: all .2s ease-in-out;
- transition: all .2s ease-in-out;
-}
-.img-circle {
- border-radius: 50%;
-}
-hr {
- margin-top: 20px;
- margin-bottom: 20px;
- border: 0;
- border-top: 1px solid #eee;
-}
-.sr-only {
- position: absolute;
- width: 1px;
- height: 1px;
- padding: 0;
- margin: -1px;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- border: 0;
-}
-.sr-only-focusable:active,
-.sr-only-focusable:focus {
- position: static;
- width: auto;
- height: auto;
- margin: 0;
- overflow: visible;
- clip: auto;
-}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-.h1,
-.h2,
-.h3,
-.h4,
-.h5,
-.h6 {
- font-family: inherit;
- font-weight: 500;
- line-height: 1.1;
- color: inherit;
-}
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.h1 small,
-.h2 small,
-.h3 small,
-.h4 small,
-.h5 small,
-.h6 small,
-h1 .small,
-h2 .small,
-h3 .small,
-h4 .small,
-h5 .small,
-h6 .small,
-.h1 .small,
-.h2 .small,
-.h3 .small,
-.h4 .small,
-.h5 .small,
-.h6 .small {
- font-weight: normal;
- line-height: 1;
- color: #777;
-}
-h1,
-.h1,
-h2,
-.h2,
-h3,
-.h3 {
- margin-top: 20px;
- margin-bottom: 10px;
-}
-h1 small,
-.h1 small,
-h2 small,
-.h2 small,
-h3 small,
-.h3 small,
-h1 .small,
-.h1 .small,
-h2 .small,
-.h2 .small,
-h3 .small,
-.h3 .small {
- font-size: 65%;
-}
-h4,
-.h4,
-h5,
-.h5,
-h6,
-.h6 {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-h4 small,
-.h4 small,
-h5 small,
-.h5 small,
-h6 small,
-.h6 small,
-h4 .small,
-.h4 .small,
-h5 .small,
-.h5 .small,
-h6 .small,
-.h6 .small {
- font-size: 75%;
-}
-h1,
-.h1 {
- font-size: 36px;
-}
-h2,
-.h2 {
- font-size: 30px;
-}
-h3,
-.h3 {
- font-size: 24px;
-}
-h4,
-.h4 {
- font-size: 18px;
-}
-h5,
-.h5 {
- font-size: 14px;
-}
-h6,
-.h6 {
- font-size: 12px;
-}
-p {
- margin: 0 0 10px;
-}
-.lead {
- margin-bottom: 20px;
- font-size: 16px;
- font-weight: 300;
- line-height: 1.4;
-}
-@media (min-width: 768px) {
- .lead {
- font-size: 21px;
- }
-}
-small,
-.small {
- font-size: 85%;
-}
-mark,
-.mark {
- padding: .2em;
- background-color: #fcf8e3;
-}
-.text-left {
- text-align: left;
-}
-.text-right {
- text-align: right;
-}
-.text-center {
- text-align: center;
-}
-.text-justify {
- text-align: justify;
-}
-.text-nowrap {
- white-space: nowrap;
-}
-.text-lowercase {
- text-transform: lowercase;
-}
-.text-uppercase {
- text-transform: uppercase;
-}
-.text-capitalize {
- text-transform: capitalize;
-}
-.text-muted {
- color: #777;
-}
-.text-primary {
- color: #337ab7;
-}
-a.text-primary:hover {
- color: #286090;
-}
-.text-success {
- color: #3c763d;
-}
-a.text-success:hover {
- color: #2b542c;
-}
-.text-info {
- color: #31708f;
-}
-a.text-info:hover {
- color: #245269;
-}
-.text-warning {
- color: #8a6d3b;
-}
-a.text-warning:hover {
- color: #66512c;
-}
-.text-danger {
- color: #a94442;
-}
-a.text-danger:hover {
- color: #843534;
-}
-.bg-primary {
- color: #fff;
- background-color: #337ab7;
-}
-a.bg-primary:hover {
- background-color: #286090;
-}
-.bg-success {
- background-color: #dff0d8;
-}
-a.bg-success:hover {
- background-color: #c1e2b3;
-}
-.bg-info {
- background-color: #d9edf7;
-}
-a.bg-info:hover {
- background-color: #afd9ee;
-}
-.bg-warning {
- background-color: #fcf8e3;
-}
-a.bg-warning:hover {
- background-color: #f7ecb5;
-}
-.bg-danger {
- background-color: #f2dede;
-}
-a.bg-danger:hover {
- background-color: #e4b9b9;
-}
-.page-header {
- padding-bottom: 9px;
- margin: 40px 0 20px;
- border-bottom: 1px solid #eee;
-}
-ul,
-ol {
- margin-top: 0;
- margin-bottom: 10px;
-}
-ul ul,
-ol ul,
-ul ol,
-ol ol {
- margin-bottom: 0;
-}
-.list-unstyled {
- padding-left: 0;
- list-style: none;
-}
-.list-inline {
- padding-left: 0;
- margin-left: -5px;
- list-style: none;
-}
-.list-inline > li {
- display: inline-block;
- padding-right: 5px;
- padding-left: 5px;
-}
-dl {
- margin-top: 0;
- margin-bottom: 20px;
-}
-dt,
-dd {
- line-height: 1.42857143;
-}
-dt {
- font-weight: bold;
-}
-dd {
- margin-left: 0;
-}
-@media (min-width: 768px) {
- .dl-horizontal dt {
- float: left;
- width: 160px;
- overflow: hidden;
- clear: left;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .dl-horizontal dd {
- margin-left: 180px;
- }
-}
-abbr[title],
-abbr[data-original-title] {
- cursor: help;
- border-bottom: 1px dotted #777;
-}
-.initialism {
- font-size: 90%;
- text-transform: uppercase;
-}
-blockquote {
- padding: 10px 20px;
- margin: 0 0 20px;
- font-size: 17.5px;
- border-left: 5px solid #eee;
-}
-blockquote p:last-child,
-blockquote ul:last-child,
-blockquote ol:last-child {
- margin-bottom: 0;
-}
-blockquote footer,
-blockquote small,
-blockquote .small {
- display: block;
- font-size: 80%;
- line-height: 1.42857143;
- color: #777;
-}
-blockquote footer:before,
-blockquote small:before,
-blockquote .small:before {
- content: '\2014 \00A0';
-}
-.blockquote-reverse,
-blockquote.pull-right {
- padding-right: 15px;
- padding-left: 0;
- text-align: right;
- border-right: 5px solid #eee;
- border-left: 0;
-}
-.blockquote-reverse footer:before,
-blockquote.pull-right footer:before,
-.blockquote-reverse small:before,
-blockquote.pull-right small:before,
-.blockquote-reverse .small:before,
-blockquote.pull-right .small:before {
- content: '';
-}
-.blockquote-reverse footer:after,
-blockquote.pull-right footer:after,
-.blockquote-reverse small:after,
-blockquote.pull-right small:after,
-.blockquote-reverse .small:after,
-blockquote.pull-right .small:after {
- content: '\00A0 \2014';
-}
-address {
- margin-bottom: 20px;
- font-style: normal;
- line-height: 1.42857143;
-}
-code,
-kbd,
-pre,
-samp {
- font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
-}
-code {
- padding: 2px 4px;
- font-size: 90%;
- color: #c7254e;
- background-color: #f9f2f4;
- border-radius: 4px;
-}
-kbd {
- padding: 2px 4px;
- font-size: 90%;
- color: #fff;
- background-color: #333;
- border-radius: 3px;
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
-}
-kbd kbd {
- padding: 0;
- font-size: 100%;
- font-weight: bold;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-pre {
- display: block;
- padding: 9.5px;
- margin: 0 0 10px;
- font-size: 13px;
- line-height: 1.42857143;
- color: #333;
- word-break: break-all;
- word-wrap: break-word;
- background-color: #f5f5f5;
- border: 1px solid #ccc;
- border-radius: 4px;
-}
-pre code {
- padding: 0;
- font-size: inherit;
- color: inherit;
- white-space: pre-wrap;
- background-color: transparent;
- border-radius: 0;
-}
-.pre-scrollable {
- max-height: 340px;
- overflow-y: scroll;
-}
-.container {
- padding-right: 15px;
- padding-left: 15px;
- margin-right: auto;
- margin-left: auto;
-}
-@media (min-width: 768px) {
- .container {
- width: 750px;
- }
-}
-@media (min-width: 992px) {
- .container {
- width: 970px;
- }
-}
-@media (min-width: 1200px) {
- .container {
- width: 1170px;
- }
-}
-.container-fluid {
- padding-right: 15px;
- padding-left: 15px;
- margin-right: auto;
- margin-left: auto;
-}
-.row {
- margin-right: -15px;
- margin-left: -15px;
-}
-.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
- position: relative;
- min-height: 1px;
- padding-right: 15px;
- padding-left: 15px;
-}
-.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
- float: left;
-}
-.col-xs-12 {
- width: 100%;
-}
-.col-xs-11 {
- width: 91.66666667%;
-}
-.col-xs-10 {
- width: 83.33333333%;
-}
-.col-xs-9 {
- width: 75%;
-}
-.col-xs-8 {
- width: 66.66666667%;
-}
-.col-xs-7 {
- width: 58.33333333%;
-}
-.col-xs-6 {
- width: 50%;
-}
-.col-xs-5 {
- width: 41.66666667%;
-}
-.col-xs-4 {
- width: 33.33333333%;
-}
-.col-xs-3 {
- width: 25%;
-}
-.col-xs-2 {
- width: 16.66666667%;
-}
-.col-xs-1 {
- width: 8.33333333%;
-}
-.col-xs-pull-12 {
- right: 100%;
-}
-.col-xs-pull-11 {
- right: 91.66666667%;
-}
-.col-xs-pull-10 {
- right: 83.33333333%;
-}
-.col-xs-pull-9 {
- right: 75%;
-}
-.col-xs-pull-8 {
- right: 66.66666667%;
-}
-.col-xs-pull-7 {
- right: 58.33333333%;
-}
-.col-xs-pull-6 {
- right: 50%;
-}
-.col-xs-pull-5 {
- right: 41.66666667%;
-}
-.col-xs-pull-4 {
- right: 33.33333333%;
-}
-.col-xs-pull-3 {
- right: 25%;
-}
-.col-xs-pull-2 {
- right: 16.66666667%;
-}
-.col-xs-pull-1 {
- right: 8.33333333%;
-}
-.col-xs-pull-0 {
- right: auto;
-}
-.col-xs-push-12 {
- left: 100%;
-}
-.col-xs-push-11 {
- left: 91.66666667%;
-}
-.col-xs-push-10 {
- left: 83.33333333%;
-}
-.col-xs-push-9 {
- left: 75%;
-}
-.col-xs-push-8 {
- left: 66.66666667%;
-}
-.col-xs-push-7 {
- left: 58.33333333%;
-}
-.col-xs-push-6 {
- left: 50%;
-}
-.col-xs-push-5 {
- left: 41.66666667%;
-}
-.col-xs-push-4 {
- left: 33.33333333%;
-}
-.col-xs-push-3 {
- left: 25%;
-}
-.col-xs-push-2 {
- left: 16.66666667%;
-}
-.col-xs-push-1 {
- left: 8.33333333%;
-}
-.col-xs-push-0 {
- left: auto;
-}
-.col-xs-offset-12 {
- margin-left: 100%;
-}
-.col-xs-offset-11 {
- margin-left: 91.66666667%;
-}
-.col-xs-offset-10 {
- margin-left: 83.33333333%;
-}
-.col-xs-offset-9 {
- margin-left: 75%;
-}
-.col-xs-offset-8 {
- margin-left: 66.66666667%;
-}
-.col-xs-offset-7 {
- margin-left: 58.33333333%;
-}
-.col-xs-offset-6 {
- margin-left: 50%;
-}
-.col-xs-offset-5 {
- margin-left: 41.66666667%;
-}
-.col-xs-offset-4 {
- margin-left: 33.33333333%;
-}
-.col-xs-offset-3 {
- margin-left: 25%;
-}
-.col-xs-offset-2 {
- margin-left: 16.66666667%;
-}
-.col-xs-offset-1 {
- margin-left: 8.33333333%;
-}
-.col-xs-offset-0 {
- margin-left: 0;
-}
-@media (min-width: 768px) {
- .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
- float: left;
- }
- .col-sm-12 {
- width: 100%;
- }
- .col-sm-11 {
- width: 91.66666667%;
- }
- .col-sm-10 {
- width: 83.33333333%;
- }
- .col-sm-9 {
- width: 75%;
- }
- .col-sm-8 {
- width: 66.66666667%;
- }
- .col-sm-7 {
- width: 58.33333333%;
- }
- .col-sm-6 {
- width: 50%;
- }
- .col-sm-5 {
- width: 41.66666667%;
- }
- .col-sm-4 {
- width: 33.33333333%;
- }
- .col-sm-3 {
- width: 25%;
- }
- .col-sm-2 {
- width: 16.66666667%;
- }
- .col-sm-1 {
- width: 8.33333333%;
- }
- .col-sm-pull-12 {
- right: 100%;
- }
- .col-sm-pull-11 {
- right: 91.66666667%;
- }
- .col-sm-pull-10 {
- right: 83.33333333%;
- }
- .col-sm-pull-9 {
- right: 75%;
- }
- .col-sm-pull-8 {
- right: 66.66666667%;
- }
- .col-sm-pull-7 {
- right: 58.33333333%;
- }
- .col-sm-pull-6 {
- right: 50%;
- }
- .col-sm-pull-5 {
- right: 41.66666667%;
- }
- .col-sm-pull-4 {
- right: 33.33333333%;
- }
- .col-sm-pull-3 {
- right: 25%;
- }
- .col-sm-pull-2 {
- right: 16.66666667%;
- }
- .col-sm-pull-1 {
- right: 8.33333333%;
- }
- .col-sm-pull-0 {
- right: auto;
- }
- .col-sm-push-12 {
- left: 100%;
- }
- .col-sm-push-11 {
- left: 91.66666667%;
- }
- .col-sm-push-10 {
- left: 83.33333333%;
- }
- .col-sm-push-9 {
- left: 75%;
- }
- .col-sm-push-8 {
- left: 66.66666667%;
- }
- .col-sm-push-7 {
- left: 58.33333333%;
- }
- .col-sm-push-6 {
- left: 50%;
- }
- .col-sm-push-5 {
- left: 41.66666667%;
- }
- .col-sm-push-4 {
- left: 33.33333333%;
- }
- .col-sm-push-3 {
- left: 25%;
- }
- .col-sm-push-2 {
- left: 16.66666667%;
- }
- .col-sm-push-1 {
- left: 8.33333333%;
- }
- .col-sm-push-0 {
- left: auto;
- }
- .col-sm-offset-12 {
- margin-left: 100%;
- }
- .col-sm-offset-11 {
- margin-left: 91.66666667%;
- }
- .col-sm-offset-10 {
- margin-left: 83.33333333%;
- }
- .col-sm-offset-9 {
- margin-left: 75%;
- }
- .col-sm-offset-8 {
- margin-left: 66.66666667%;
- }
- .col-sm-offset-7 {
- margin-left: 58.33333333%;
- }
- .col-sm-offset-6 {
- margin-left: 50%;
- }
- .col-sm-offset-5 {
- margin-left: 41.66666667%;
- }
- .col-sm-offset-4 {
- margin-left: 33.33333333%;
- }
- .col-sm-offset-3 {
- margin-left: 25%;
- }
- .col-sm-offset-2 {
- margin-left: 16.66666667%;
- }
- .col-sm-offset-1 {
- margin-left: 8.33333333%;
- }
- .col-sm-offset-0 {
- margin-left: 0;
- }
-}
-@media (min-width: 992px) {
- .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
- float: left;
- }
- .col-md-12 {
- width: 100%;
- }
- .col-md-11 {
- width: 91.66666667%;
- }
- .col-md-10 {
- width: 83.33333333%;
- }
- .col-md-9 {
- width: 75%;
- }
- .col-md-8 {
- width: 66.66666667%;
- }
- .col-md-7 {
- width: 58.33333333%;
- }
- .col-md-6 {
- width: 50%;
- }
- .col-md-5 {
- width: 41.66666667%;
- }
- .col-md-4 {
- width: 33.33333333%;
- }
- .col-md-3 {
- width: 25%;
- }
- .col-md-2 {
- width: 16.66666667%;
- }
- .col-md-1 {
- width: 8.33333333%;
- }
- .col-md-pull-12 {
- right: 100%;
- }
- .col-md-pull-11 {
- right: 91.66666667%;
- }
- .col-md-pull-10 {
- right: 83.33333333%;
- }
- .col-md-pull-9 {
- right: 75%;
- }
- .col-md-pull-8 {
- right: 66.66666667%;
- }
- .col-md-pull-7 {
- right: 58.33333333%;
- }
- .col-md-pull-6 {
- right: 50%;
- }
- .col-md-pull-5 {
- right: 41.66666667%;
- }
- .col-md-pull-4 {
- right: 33.33333333%;
- }
- .col-md-pull-3 {
- right: 25%;
- }
- .col-md-pull-2 {
- right: 16.66666667%;
- }
- .col-md-pull-1 {
- right: 8.33333333%;
- }
- .col-md-pull-0 {
- right: auto;
- }
- .col-md-push-12 {
- left: 100%;
- }
- .col-md-push-11 {
- left: 91.66666667%;
- }
- .col-md-push-10 {
- left: 83.33333333%;
- }
- .col-md-push-9 {
- left: 75%;
- }
- .col-md-push-8 {
- left: 66.66666667%;
- }
- .col-md-push-7 {
- left: 58.33333333%;
- }
- .col-md-push-6 {
- left: 50%;
- }
- .col-md-push-5 {
- left: 41.66666667%;
- }
- .col-md-push-4 {
- left: 33.33333333%;
- }
- .col-md-push-3 {
- left: 25%;
- }
- .col-md-push-2 {
- left: 16.66666667%;
- }
- .col-md-push-1 {
- left: 8.33333333%;
- }
- .col-md-push-0 {
- left: auto;
- }
- .col-md-offset-12 {
- margin-left: 100%;
- }
- .col-md-offset-11 {
- margin-left: 91.66666667%;
- }
- .col-md-offset-10 {
- margin-left: 83.33333333%;
- }
- .col-md-offset-9 {
- margin-left: 75%;
- }
- .col-md-offset-8 {
- margin-left: 66.66666667%;
- }
- .col-md-offset-7 {
- margin-left: 58.33333333%;
- }
- .col-md-offset-6 {
- margin-left: 50%;
- }
- .col-md-offset-5 {
- margin-left: 41.66666667%;
- }
- .col-md-offset-4 {
- margin-left: 33.33333333%;
- }
- .col-md-offset-3 {
- margin-left: 25%;
- }
- .col-md-offset-2 {
- margin-left: 16.66666667%;
- }
- .col-md-offset-1 {
- margin-left: 8.33333333%;
- }
- .col-md-offset-0 {
- margin-left: 0;
- }
-}
-@media (min-width: 1200px) {
- .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
- float: left;
- }
- .col-lg-12 {
- width: 100%;
- }
- .col-lg-11 {
- width: 91.66666667%;
- }
- .col-lg-10 {
- width: 83.33333333%;
- }
- .col-lg-9 {
- width: 75%;
- }
- .col-lg-8 {
- width: 66.66666667%;
- }
- .col-lg-7 {
- width: 58.33333333%;
- }
- .col-lg-6 {
- width: 50%;
- }
- .col-lg-5 {
- width: 41.66666667%;
- }
- .col-lg-4 {
- width: 33.33333333%;
- }
- .col-lg-3 {
- width: 25%;
- }
- .col-lg-2 {
- width: 16.66666667%;
- }
- .col-lg-1 {
- width: 8.33333333%;
- }
- .col-lg-pull-12 {
- right: 100%;
- }
- .col-lg-pull-11 {
- right: 91.66666667%;
- }
- .col-lg-pull-10 {
- right: 83.33333333%;
- }
- .col-lg-pull-9 {
- right: 75%;
- }
- .col-lg-pull-8 {
- right: 66.66666667%;
- }
- .col-lg-pull-7 {
- right: 58.33333333%;
- }
- .col-lg-pull-6 {
- right: 50%;
- }
- .col-lg-pull-5 {
- right: 41.66666667%;
- }
- .col-lg-pull-4 {
- right: 33.33333333%;
- }
- .col-lg-pull-3 {
- right: 25%;
- }
- .col-lg-pull-2 {
- right: 16.66666667%;
- }
- .col-lg-pull-1 {
- right: 8.33333333%;
- }
- .col-lg-pull-0 {
- right: auto;
- }
- .col-lg-push-12 {
- left: 100%;
- }
- .col-lg-push-11 {
- left: 91.66666667%;
- }
- .col-lg-push-10 {
- left: 83.33333333%;
- }
- .col-lg-push-9 {
- left: 75%;
- }
- .col-lg-push-8 {
- left: 66.66666667%;
- }
- .col-lg-push-7 {
- left: 58.33333333%;
- }
- .col-lg-push-6 {
- left: 50%;
- }
- .col-lg-push-5 {
- left: 41.66666667%;
- }
- .col-lg-push-4 {
- left: 33.33333333%;
- }
- .col-lg-push-3 {
- left: 25%;
- }
- .col-lg-push-2 {
- left: 16.66666667%;
- }
- .col-lg-push-1 {
- left: 8.33333333%;
- }
- .col-lg-push-0 {
- left: auto;
- }
- .col-lg-offset-12 {
- margin-left: 100%;
- }
- .col-lg-offset-11 {
- margin-left: 91.66666667%;
- }
- .col-lg-offset-10 {
- margin-left: 83.33333333%;
- }
- .col-lg-offset-9 {
- margin-left: 75%;
- }
- .col-lg-offset-8 {
- margin-left: 66.66666667%;
- }
- .col-lg-offset-7 {
- margin-left: 58.33333333%;
- }
- .col-lg-offset-6 {
- margin-left: 50%;
- }
- .col-lg-offset-5 {
- margin-left: 41.66666667%;
- }
- .col-lg-offset-4 {
- margin-left: 33.33333333%;
- }
- .col-lg-offset-3 {
- margin-left: 25%;
- }
- .col-lg-offset-2 {
- margin-left: 16.66666667%;
- }
- .col-lg-offset-1 {
- margin-left: 8.33333333%;
- }
- .col-lg-offset-0 {
- margin-left: 0;
- }
-}
-table {
- background-color: transparent;
-}
-caption {
- padding-top: 8px;
- padding-bottom: 8px;
- color: #777;
- text-align: left;
-}
-th {
- text-align: left;
-}
-.table {
- width: 100%;
- max-width: 100%;
- margin-bottom: 20px;
-}
-.table > thead > tr > th,
-.table > tbody > tr > th,
-.table > tfoot > tr > th,
-.table > thead > tr > td,
-.table > tbody > tr > td,
-.table > tfoot > tr > td {
- padding: 8px;
- line-height: 1.42857143;
- vertical-align: top;
- border-top: 1px solid #ddd;
-}
-.table > thead > tr > th {
- vertical-align: bottom;
- border-bottom: 2px solid #ddd;
-}
-.table > caption + thead > tr:first-child > th,
-.table > colgroup + thead > tr:first-child > th,
-.table > thead:first-child > tr:first-child > th,
-.table > caption + thead > tr:first-child > td,
-.table > colgroup + thead > tr:first-child > td,
-.table > thead:first-child > tr:first-child > td {
- border-top: 0;
-}
-.table > tbody + tbody {
- border-top: 2px solid #ddd;
-}
-.table .table {
- background-color: #fff;
-}
-.table-condensed > thead > tr > th,
-.table-condensed > tbody > tr > th,
-.table-condensed > tfoot > tr > th,
-.table-condensed > thead > tr > td,
-.table-condensed > tbody > tr > td,
-.table-condensed > tfoot > tr > td {
- padding: 5px;
-}
-.table-bordered {
- border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > tbody > tr > th,
-.table-bordered > tfoot > tr > th,
-.table-bordered > thead > tr > td,
-.table-bordered > tbody > tr > td,
-.table-bordered > tfoot > tr > td {
- border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > thead > tr > td {
- border-bottom-width: 2px;
-}
-.table-striped > tbody > tr:nth-child(odd) {
- background-color: #f9f9f9;
-}
-.table-hover > tbody > tr:hover {
- background-color: #f5f5f5;
-}
-table col[class*="col-"] {
- position: static;
- display: table-column;
- float: none;
-}
-table td[class*="col-"],
-table th[class*="col-"] {
- position: static;
- display: table-cell;
- float: none;
-}
-.table > thead > tr > td.active,
-.table > tbody > tr > td.active,
-.table > tfoot > tr > td.active,
-.table > thead > tr > th.active,
-.table > tbody > tr > th.active,
-.table > tfoot > tr > th.active,
-.table > thead > tr.active > td,
-.table > tbody > tr.active > td,
-.table > tfoot > tr.active > td,
-.table > thead > tr.active > th,
-.table > tbody > tr.active > th,
-.table > tfoot > tr.active > th {
- background-color: #f5f5f5;
-}
-.table-hover > tbody > tr > td.active:hover,
-.table-hover > tbody > tr > th.active:hover,
-.table-hover > tbody > tr.active:hover > td,
-.table-hover > tbody > tr:hover > .active,
-.table-hover > tbody > tr.active:hover > th {
- background-color: #e8e8e8;
-}
-.table > thead > tr > td.success,
-.table > tbody > tr > td.success,
-.table > tfoot > tr > td.success,
-.table > thead > tr > th.success,
-.table > tbody > tr > th.success,
-.table > tfoot > tr > th.success,
-.table > thead > tr.success > td,
-.table > tbody > tr.success > td,
-.table > tfoot > tr.success > td,
-.table > thead > tr.success > th,
-.table > tbody > tr.success > th,
-.table > tfoot > tr.success > th {
- background-color: #dff0d8;
-}
-.table-hover > tbody > tr > td.success:hover,
-.table-hover > tbody > tr > th.success:hover,
-.table-hover > tbody > tr.success:hover > td,
-.table-hover > tbody > tr:hover > .success,
-.table-hover > tbody > tr.success:hover > th {
- background-color: #d0e9c6;
-}
-.table > thead > tr > td.info,
-.table > tbody > tr > td.info,
-.table > tfoot > tr > td.info,
-.table > thead > tr > th.info,
-.table > tbody > tr > th.info,
-.table > tfoot > tr > th.info,
-.table > thead > tr.info > td,
-.table > tbody > tr.info > td,
-.table > tfoot > tr.info > td,
-.table > thead > tr.info > th,
-.table > tbody > tr.info > th,
-.table > tfoot > tr.info > th {
- background-color: #d9edf7;
-}
-.table-hover > tbody > tr > td.info:hover,
-.table-hover > tbody > tr > th.info:hover,
-.table-hover > tbody > tr.info:hover > td,
-.table-hover > tbody > tr:hover > .info,
-.table-hover > tbody > tr.info:hover > th {
- background-color: #c4e3f3;
-}
-.table > thead > tr > td.warning,
-.table > tbody > tr > td.warning,
-.table > tfoot > tr > td.warning,
-.table > thead > tr > th.warning,
-.table > tbody > tr > th.warning,
-.table > tfoot > tr > th.warning,
-.table > thead > tr.warning > td,
-.table > tbody > tr.warning > td,
-.table > tfoot > tr.warning > td,
-.table > thead > tr.warning > th,
-.table > tbody > tr.warning > th,
-.table > tfoot > tr.warning > th {
- background-color: #fcf8e3;
-}
-.table-hover > tbody > tr > td.warning:hover,
-.table-hover > tbody > tr > th.warning:hover,
-.table-hover > tbody > tr.warning:hover > td,
-.table-hover > tbody > tr:hover > .warning,
-.table-hover > tbody > tr.warning:hover > th {
- background-color: #faf2cc;
-}
-.table > thead > tr > td.danger,
-.table > tbody > tr > td.danger,
-.table > tfoot > tr > td.danger,
-.table > thead > tr > th.danger,
-.table > tbody > tr > th.danger,
-.table > tfoot > tr > th.danger,
-.table > thead > tr.danger > td,
-.table > tbody > tr.danger > td,
-.table > tfoot > tr.danger > td,
-.table > thead > tr.danger > th,
-.table > tbody > tr.danger > th,
-.table > tfoot > tr.danger > th {
- background-color: #f2dede;
-}
-.table-hover > tbody > tr > td.danger:hover,
-.table-hover > tbody > tr > th.danger:hover,
-.table-hover > tbody > tr.danger:hover > td,
-.table-hover > tbody > tr:hover > .danger,
-.table-hover > tbody > tr.danger:hover > th {
- background-color: #ebcccc;
-}
-.table-responsive {
- min-height: .01%;
- overflow-x: auto;
-}
-@media screen and (max-width: 767px) {
- .table-responsive {
- width: 100%;
- margin-bottom: 15px;
- overflow-y: hidden;
- -ms-overflow-style: -ms-autohiding-scrollbar;
- border: 1px solid #ddd;
- }
- .table-responsive > .table {
- margin-bottom: 0;
- }
- .table-responsive > .table > thead > tr > th,
- .table-responsive > .table > tbody > tr > th,
- .table-responsive > .table > tfoot > tr > th,
- .table-responsive > .table > thead > tr > td,
- .table-responsive > .table > tbody > tr > td,
- .table-responsive > .table > tfoot > tr > td {
- white-space: nowrap;
- }
- .table-responsive > .table-bordered {
- border: 0;
- }
- .table-responsive > .table-bordered > thead > tr > th:first-child,
- .table-responsive > .table-bordered > tbody > tr > th:first-child,
- .table-responsive > .table-bordered > tfoot > tr > th:first-child,
- .table-responsive > .table-bordered > thead > tr > td:first-child,
- .table-responsive > .table-bordered > tbody > tr > td:first-child,
- .table-responsive > .table-bordered > tfoot > tr > td:first-child {
- border-left: 0;
- }
- .table-responsive > .table-bordered > thead > tr > th:last-child,
- .table-responsive > .table-bordered > tbody > tr > th:last-child,
- .table-responsive > .table-bordered > tfoot > tr > th:last-child,
- .table-responsive > .table-bordered > thead > tr > td:last-child,
- .table-responsive > .table-bordered > tbody > tr > td:last-child,
- .table-responsive > .table-bordered > tfoot > tr > td:last-child {
- border-right: 0;
- }
- .table-responsive > .table-bordered > tbody > tr:last-child > th,
- .table-responsive > .table-bordered > tfoot > tr:last-child > th,
- .table-responsive > .table-bordered > tbody > tr:last-child > td,
- .table-responsive > .table-bordered > tfoot > tr:last-child > td {
- border-bottom: 0;
- }
-}
-fieldset {
- min-width: 0;
- padding: 0;
- margin: 0;
- border: 0;
-}
-legend {
- display: block;
- width: 100%;
- padding: 0;
- margin-bottom: 20px;
- font-size: 21px;
- line-height: inherit;
- color: #333;
- border: 0;
- border-bottom: 1px solid #e5e5e5;
-}
-label {
- display: inline-block;
- max-width: 100%;
- margin-bottom: 5px;
- font-weight: bold;
-}
-input[type="search"] {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-input[type="radio"],
-input[type="checkbox"] {
- margin: 4px 0 0;
- margin-top: 1px \9;
- line-height: normal;
-}
-input[type="file"] {
- display: block;
-}
-input[type="range"] {
- display: block;
- width: 100%;
-}
-select[multiple],
-select[size] {
- height: auto;
-}
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
- outline: thin dotted;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-output {
- display: block;
- padding-top: 7px;
- font-size: 14px;
- line-height: 1.42857143;
- color: #555;
-}
-.form-control {
- display: block;
- width: 100%;
- height: 34px;
- padding: 6px 12px;
- font-size: 14px;
- line-height: 1.42857143;
- color: #555;
- background-color: #fff;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
- -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
- -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
- transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.form-control:focus {
- border-color: #66afe9;
- outline: 0;
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
-}
-.form-control::-moz-placeholder {
- color: #999;
- opacity: 1;
-}
-.form-control:-ms-input-placeholder {
- color: #999;
-}
-.form-control::-webkit-input-placeholder {
- color: #999;
-}
-.form-control[disabled],
-.form-control[readonly],
-fieldset[disabled] .form-control {
- cursor: not-allowed;
- background-color: #eee;
- opacity: 1;
-}
-textarea.form-control {
- height: auto;
-}
-input[type="search"] {
- -webkit-appearance: none;
-}
-@media screen and (-webkit-min-device-pixel-ratio: 0) {
- input[type="date"],
- input[type="time"],
- input[type="datetime-local"],
- input[type="month"] {
- line-height: 34px;
- }
- input[type="date"].input-sm,
- input[type="time"].input-sm,
- input[type="datetime-local"].input-sm,
- input[type="month"].input-sm {
- line-height: 30px;
- }
- input[type="date"].input-lg,
- input[type="time"].input-lg,
- input[type="datetime-local"].input-lg,
- input[type="month"].input-lg {
- line-height: 46px;
- }
-}
-.form-group {
- margin-bottom: 15px;
-}
-.radio,
-.checkbox {
- position: relative;
- display: block;
- margin-top: 10px;
- margin-bottom: 10px;
-}
-.radio label,
-.checkbox label {
- min-height: 20px;
- padding-left: 20px;
- margin-bottom: 0;
- font-weight: normal;
- cursor: pointer;
-}
-.radio input[type="radio"],
-.radio-inline input[type="radio"],
-.checkbox input[type="checkbox"],
-.checkbox-inline input[type="checkbox"] {
- position: absolute;
- margin-top: 4px \9;
- margin-left: -20px;
-}
-.radio + .radio,
-.checkbox + .checkbox {
- margin-top: -5px;
-}
-.radio-inline,
-.checkbox-inline {
- display: inline-block;
- padding-left: 20px;
- margin-bottom: 0;
- font-weight: normal;
- vertical-align: middle;
- cursor: pointer;
-}
-.radio-inline + .radio-inline,
-.checkbox-inline + .checkbox-inline {
- margin-top: 0;
- margin-left: 10px;
-}
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"].disabled,
-input[type="checkbox"].disabled,
-fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"] {
- cursor: not-allowed;
-}
-.radio-inline.disabled,
-.checkbox-inline.disabled,
-fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox-inline {
- cursor: not-allowed;
-}
-.radio.disabled label,
-.checkbox.disabled label,
-fieldset[disabled] .radio label,
-fieldset[disabled] .checkbox label {
- cursor: not-allowed;
-}
-.form-control-static {
- padding-top: 7px;
- padding-bottom: 7px;
- margin-bottom: 0;
-}
-.form-control-static.input-lg,
-.form-control-static.input-sm {
- padding-right: 0;
- padding-left: 0;
-}
-.input-sm,
-.form-group-sm .form-control {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-select.input-sm,
-select.form-group-sm .form-control {
- height: 30px;
- line-height: 30px;
-}
-textarea.input-sm,
-textarea.form-group-sm .form-control,
-select[multiple].input-sm,
-select[multiple].form-group-sm .form-control {
- height: auto;
-}
-.input-lg,
-.form-group-lg .form-control {
- height: 46px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-select.input-lg,
-select.form-group-lg .form-control {
- height: 46px;
- line-height: 46px;
-}
-textarea.input-lg,
-textarea.form-group-lg .form-control,
-select[multiple].input-lg,
-select[multiple].form-group-lg .form-control {
- height: auto;
-}
-.has-feedback {
- position: relative;
-}
-.has-feedback .form-control {
- padding-right: 42.5px;
-}
-.form-control-feedback {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 2;
- display: block;
- width: 34px;
- height: 34px;
- line-height: 34px;
- text-align: center;
- pointer-events: none;
-}
-.input-lg + .form-control-feedback {
- width: 46px;
- height: 46px;
- line-height: 46px;
-}
-.input-sm + .form-control-feedback {
- width: 30px;
- height: 30px;
- line-height: 30px;
-}
-.has-success .help-block,
-.has-success .control-label,
-.has-success .radio,
-.has-success .checkbox,
-.has-success .radio-inline,
-.has-success .checkbox-inline,
-.has-success.radio label,
-.has-success.checkbox label,
-.has-success.radio-inline label,
-.has-success.checkbox-inline label {
- color: #3c763d;
-}
-.has-success .form-control {
- border-color: #3c763d;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-success .form-control:focus {
- border-color: #2b542c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
-}
-.has-success .input-group-addon {
- color: #3c763d;
- background-color: #dff0d8;
- border-color: #3c763d;
-}
-.has-success .form-control-feedback {
- color: #3c763d;
-}
-.has-warning .help-block,
-.has-warning .control-label,
-.has-warning .radio,
-.has-warning .checkbox,
-.has-warning .radio-inline,
-.has-warning .checkbox-inline,
-.has-warning.radio label,
-.has-warning.checkbox label,
-.has-warning.radio-inline label,
-.has-warning.checkbox-inline label {
- color: #8a6d3b;
-}
-.has-warning .form-control {
- border-color: #8a6d3b;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-warning .form-control:focus {
- border-color: #66512c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
-}
-.has-warning .input-group-addon {
- color: #8a6d3b;
- background-color: #fcf8e3;
- border-color: #8a6d3b;
-}
-.has-warning .form-control-feedback {
- color: #8a6d3b;
-}
-.has-error .help-block,
-.has-error .control-label,
-.has-error .radio,
-.has-error .checkbox,
-.has-error .radio-inline,
-.has-error .checkbox-inline,
-.has-error.radio label,
-.has-error.checkbox label,
-.has-error.radio-inline label,
-.has-error.checkbox-inline label {
- color: #a94442;
-}
-.has-error .form-control {
- border-color: #a94442;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-error .form-control:focus {
- border-color: #843534;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
-}
-.has-error .input-group-addon {
- color: #a94442;
- background-color: #f2dede;
- border-color: #a94442;
-}
-.has-error .form-control-feedback {
- color: #a94442;
-}
-.has-feedback label ~ .form-control-feedback {
- top: 25px;
-}
-.has-feedback label.sr-only ~ .form-control-feedback {
- top: 0;
-}
-.help-block {
- display: block;
- margin-top: 5px;
- margin-bottom: 10px;
- color: #737373;
-}
-@media (min-width: 768px) {
- .form-inline .form-group {
- display: inline-block;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .form-control {
- display: inline-block;
- width: auto;
- vertical-align: middle;
- }
- .form-inline .form-control-static {
- display: inline-block;
- }
- .form-inline .input-group {
- display: inline-table;
- vertical-align: middle;
- }
- .form-inline .input-group .input-group-addon,
- .form-inline .input-group .input-group-btn,
- .form-inline .input-group .form-control {
- width: auto;
- }
- .form-inline .input-group > .form-control {
- width: 100%;
- }
- .form-inline .control-label {
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .radio,
- .form-inline .checkbox {
- display: inline-block;
- margin-top: 0;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .radio label,
- .form-inline .checkbox label {
- padding-left: 0;
- }
- .form-inline .radio input[type="radio"],
- .form-inline .checkbox input[type="checkbox"] {
- position: relative;
- margin-left: 0;
- }
- .form-inline .has-feedback .form-control-feedback {
- top: 0;
- }
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox,
-.form-horizontal .radio-inline,
-.form-horizontal .checkbox-inline {
- padding-top: 7px;
- margin-top: 0;
- margin-bottom: 0;
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox {
- min-height: 27px;
-}
-.form-horizontal .form-group {
- margin-right: -15px;
- margin-left: -15px;
-}
-@media (min-width: 768px) {
- .form-horizontal .control-label {
- padding-top: 7px;
- margin-bottom: 0;
- text-align: right;
- }
-}
-.form-horizontal .has-feedback .form-control-feedback {
- right: 15px;
-}
-@media (min-width: 768px) {
- .form-horizontal .form-group-lg .control-label {
- padding-top: 14.3px;
- }
-}
-@media (min-width: 768px) {
- .form-horizontal .form-group-sm .control-label {
- padding-top: 6px;
- }
-}
-.btn {
- display: inline-block;
- padding: 6px 12px;
- margin-bottom: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-.btn:focus,
-.btn:active:focus,
-.btn.active:focus,
-.btn.focus,
-.btn:active.focus,
-.btn.active.focus {
- outline: thin dotted;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-.btn:hover,
-.btn:focus,
-.btn.focus {
- color: #333;
- text-decoration: none;
-}
-.btn:active,
-.btn.active {
- background-image: none;
- outline: 0;
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn.disabled,
-.btn[disabled],
-fieldset[disabled] .btn {
- pointer-events: none;
- cursor: not-allowed;
- filter: alpha(opacity=65);
- -webkit-box-shadow: none;
- box-shadow: none;
- opacity: .65;
-}
-.btn-default {
- color: #333;
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default:hover,
-.btn-default:focus,
-.btn-default.focus,
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
- color: #333;
- background-color: #e6e6e6;
- border-color: #adadad;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
- background-image: none;
-}
-.btn-default.disabled,
-.btn-default[disabled],
-fieldset[disabled] .btn-default,
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled.focus,
-.btn-default[disabled].focus,
-fieldset[disabled] .btn-default.focus,
-.btn-default.disabled:active,
-.btn-default[disabled]:active,
-fieldset[disabled] .btn-default:active,
-.btn-default.disabled.active,
-.btn-default[disabled].active,
-fieldset[disabled] .btn-default.active {
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default .badge {
- color: #fff;
- background-color: #333;
-}
-.btn-primary {
- color: #fff;
- background-color: #337ab7;
- border-color: #2e6da4;
-}
-.btn-primary:hover,
-.btn-primary:focus,
-.btn-primary.focus,
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
- color: #fff;
- background-color: #286090;
- border-color: #204d74;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
- background-image: none;
-}
-.btn-primary.disabled,
-.btn-primary[disabled],
-fieldset[disabled] .btn-primary,
-.btn-primary.disabled:hover,
-.btn-primary[disabled]:hover,
-fieldset[disabled] .btn-primary:hover,
-.btn-primary.disabled:focus,
-.btn-primary[disabled]:focus,
-fieldset[disabled] .btn-primary:focus,
-.btn-primary.disabled.focus,
-.btn-primary[disabled].focus,
-fieldset[disabled] .btn-primary.focus,
-.btn-primary.disabled:active,
-.btn-primary[disabled]:active,
-fieldset[disabled] .btn-primary:active,
-.btn-primary.disabled.active,
-.btn-primary[disabled].active,
-fieldset[disabled] .btn-primary.active {
- background-color: #337ab7;
- border-color: #2e6da4;
-}
-.btn-primary .badge {
- color: #337ab7;
- background-color: #fff;
-}
-.btn-success {
- color: #fff;
- background-color: #5cb85c;
- border-color: #4cae4c;
-}
-.btn-success:hover,
-.btn-success:focus,
-.btn-success.focus,
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
- color: #fff;
- background-color: #449d44;
- border-color: #398439;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
- background-image: none;
-}
-.btn-success.disabled,
-.btn-success[disabled],
-fieldset[disabled] .btn-success,
-.btn-success.disabled:hover,
-.btn-success[disabled]:hover,
-fieldset[disabled] .btn-success:hover,
-.btn-success.disabled:focus,
-.btn-success[disabled]:focus,
-fieldset[disabled] .btn-success:focus,
-.btn-success.disabled.focus,
-.btn-success[disabled].focus,
-fieldset[disabled] .btn-success.focus,
-.btn-success.disabled:active,
-.btn-success[disabled]:active,
-fieldset[disabled] .btn-success:active,
-.btn-success.disabled.active,
-.btn-success[disabled].active,
-fieldset[disabled] .btn-success.active {
- background-color: #5cb85c;
- border-color: #4cae4c;
-}
-.btn-success .badge {
- color: #5cb85c;
- background-color: #fff;
-}
-.btn-info {
- color: #fff;
- background-color: #5bc0de;
- border-color: #46b8da;
-}
-.btn-info:hover,
-.btn-info:focus,
-.btn-info.focus,
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
- color: #fff;
- background-color: #31b0d5;
- border-color: #269abc;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
- background-image: none;
-}
-.btn-info.disabled,
-.btn-info[disabled],
-fieldset[disabled] .btn-info,
-.btn-info.disabled:hover,
-.btn-info[disabled]:hover,
-fieldset[disabled] .btn-info:hover,
-.btn-info.disabled:focus,
-.btn-info[disabled]:focus,
-fieldset[disabled] .btn-info:focus,
-.btn-info.disabled.focus,
-.btn-info[disabled].focus,
-fieldset[disabled] .btn-info.focus,
-.btn-info.disabled:active,
-.btn-info[disabled]:active,
-fieldset[disabled] .btn-info:active,
-.btn-info.disabled.active,
-.btn-info[disabled].active,
-fieldset[disabled] .btn-info.active {
- background-color: #5bc0de;
- border-color: #46b8da;
-}
-.btn-info .badge {
- color: #5bc0de;
- background-color: #fff;
-}
-.btn-warning {
- color: #fff;
- background-color: #f0ad4e;
- border-color: #eea236;
-}
-.btn-warning:hover,
-.btn-warning:focus,
-.btn-warning.focus,
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
- color: #fff;
- background-color: #ec971f;
- border-color: #d58512;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
- background-image: none;
-}
-.btn-warning.disabled,
-.btn-warning[disabled],
-fieldset[disabled] .btn-warning,
-.btn-warning.disabled:hover,
-.btn-warning[disabled]:hover,
-fieldset[disabled] .btn-warning:hover,
-.btn-warning.disabled:focus,
-.btn-warning[disabled]:focus,
-fieldset[disabled] .btn-warning:focus,
-.btn-warning.disabled.focus,
-.btn-warning[disabled].focus,
-fieldset[disabled] .btn-warning.focus,
-.btn-warning.disabled:active,
-.btn-warning[disabled]:active,
-fieldset[disabled] .btn-warning:active,
-.btn-warning.disabled.active,
-.btn-warning[disabled].active,
-fieldset[disabled] .btn-warning.active {
- background-color: #f0ad4e;
- border-color: #eea236;
-}
-.btn-warning .badge {
- color: #f0ad4e;
- background-color: #fff;
-}
-.btn-danger {
- color: #fff;
- background-color: #d9534f;
- border-color: #d43f3a;
-}
-.btn-danger:hover,
-.btn-danger:focus,
-.btn-danger.focus,
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
- color: #fff;
- background-color: #c9302c;
- border-color: #ac2925;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
- background-image: none;
-}
-.btn-danger.disabled,
-.btn-danger[disabled],
-fieldset[disabled] .btn-danger,
-.btn-danger.disabled:hover,
-.btn-danger[disabled]:hover,
-fieldset[disabled] .btn-danger:hover,
-.btn-danger.disabled:focus,
-.btn-danger[disabled]:focus,
-fieldset[disabled] .btn-danger:focus,
-.btn-danger.disabled.focus,
-.btn-danger[disabled].focus,
-fieldset[disabled] .btn-danger.focus,
-.btn-danger.disabled:active,
-.btn-danger[disabled]:active,
-fieldset[disabled] .btn-danger:active,
-.btn-danger.disabled.active,
-.btn-danger[disabled].active,
-fieldset[disabled] .btn-danger.active {
- background-color: #d9534f;
- border-color: #d43f3a;
-}
-.btn-danger .badge {
- color: #d9534f;
- background-color: #fff;
-}
-.btn-link {
- font-weight: normal;
- color: #337ab7;
- border-radius: 0;
-}
-.btn-link,
-.btn-link:active,
-.btn-link.active,
-.btn-link[disabled],
-fieldset[disabled] .btn-link {
- background-color: transparent;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.btn-link,
-.btn-link:hover,
-.btn-link:focus,
-.btn-link:active {
- border-color: transparent;
-}
-.btn-link:hover,
-.btn-link:focus {
- color: #23527c;
- text-decoration: underline;
- background-color: transparent;
-}
-.btn-link[disabled]:hover,
-fieldset[disabled] .btn-link:hover,
-.btn-link[disabled]:focus,
-fieldset[disabled] .btn-link:focus {
- color: #777;
- text-decoration: none;
-}
-.btn-lg,
-.btn-group-lg > .btn {
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-.btn-sm,
-.btn-group-sm > .btn {
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-.btn-xs,
-.btn-group-xs > .btn {
- padding: 1px 5px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-.btn-block {
- display: block;
- width: 100%;
-}
-.btn-block + .btn-block {
- margin-top: 5px;
-}
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
- width: 100%;
-}
-.fade {
- opacity: 0;
- -webkit-transition: opacity .15s linear;
- -o-transition: opacity .15s linear;
- transition: opacity .15s linear;
-}
-.fade.in {
- opacity: 1;
-}
-.collapse {
- display: none;
- visibility: hidden;
-}
-.collapse.in {
- display: block;
- visibility: visible;
-}
-tr.collapse.in {
- display: table-row;
-}
-tbody.collapse.in {
- display: table-row-group;
-}
-.collapsing {
- position: relative;
- height: 0;
- overflow: hidden;
- -webkit-transition-timing-function: ease;
- -o-transition-timing-function: ease;
- transition-timing-function: ease;
- -webkit-transition-duration: .35s;
- -o-transition-duration: .35s;
- transition-duration: .35s;
- -webkit-transition-property: height, visibility;
- -o-transition-property: height, visibility;
- transition-property: height, visibility;
-}
-.caret {
- display: inline-block;
- width: 0;
- height: 0;
- margin-left: 2px;
- vertical-align: middle;
- border-top: 4px solid;
- border-right: 4px solid transparent;
- border-left: 4px solid transparent;
-}
-.dropdown {
- position: relative;
-}
-.dropdown-toggle:focus {
- outline: 0;
-}
-.dropdown-menu {
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 1000;
- display: none;
- float: left;
- min-width: 160px;
- padding: 5px 0;
- margin: 2px 0 0;
- font-size: 14px;
- text-align: left;
- list-style: none;
- background-color: #fff;
- -webkit-background-clip: padding-box;
- background-clip: padding-box;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, .15);
- border-radius: 4px;
- -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
- box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
-}
-.dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-.dropdown-menu .divider {
- height: 1px;
- margin: 9px 0;
- overflow: hidden;
- background-color: #e5e5e5;
-}
-.dropdown-menu > li > a {
- display: block;
- padding: 3px 20px;
- clear: both;
- font-weight: normal;
- line-height: 1.42857143;
- color: #333;
- white-space: nowrap;
-}
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
- color: #262626;
- text-decoration: none;
- background-color: #f5f5f5;
-}
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
- color: #fff;
- text-decoration: none;
- background-color: #337ab7;
- outline: 0;
-}
-.dropdown-menu > .disabled > a,
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
- color: #777;
-}
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
- text-decoration: none;
- cursor: not-allowed;
- background-color: transparent;
- background-image: none;
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-}
-.open > .dropdown-menu {
- display: block;
-}
-.open > a {
- outline: 0;
-}
-.dropdown-menu-right {
- right: 0;
- left: auto;
-}
-.dropdown-menu-left {
- right: auto;
- left: 0;
-}
-.dropdown-header {
- display: block;
- padding: 3px 20px;
- font-size: 12px;
- line-height: 1.42857143;
- color: #777;
- white-space: nowrap;
-}
-.dropdown-backdrop {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 990;
-}
-.pull-right > .dropdown-menu {
- right: 0;
- left: auto;
-}
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
- content: "";
- border-top: 0;
- border-bottom: 4px solid;
-}
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
- top: auto;
- bottom: 100%;
- margin-bottom: 1px;
-}
-@media (min-width: 768px) {
- .navbar-right .dropdown-menu {
- right: 0;
- left: auto;
- }
- .navbar-right .dropdown-menu-left {
- right: auto;
- left: 0;
- }
-}
-.btn-group,
-.btn-group-vertical {
- position: relative;
- display: inline-block;
- vertical-align: middle;
-}
-.btn-group > .btn,
-.btn-group-vertical > .btn {
- position: relative;
- float: left;
-}
-.btn-group > .btn:hover,
-.btn-group-vertical > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group-vertical > .btn:focus,
-.btn-group > .btn:active,
-.btn-group-vertical > .btn:active,
-.btn-group > .btn.active,
-.btn-group-vertical > .btn.active {
- z-index: 2;
-}
-.btn-group .btn + .btn,
-.btn-group .btn + .btn-group,
-.btn-group .btn-group + .btn,
-.btn-group .btn-group + .btn-group {
- margin-left: -1px;
-}
-.btn-toolbar {
- margin-left: -5px;
-}
-.btn-toolbar .btn-group,
-.btn-toolbar .input-group {
- float: left;
-}
-.btn-toolbar > .btn,
-.btn-toolbar > .btn-group,
-.btn-toolbar > .input-group {
- margin-left: 5px;
-}
-.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
- border-radius: 0;
-}
-.btn-group > .btn:first-child {
- margin-left: 0;
-}
-.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-.btn-group > .btn:last-child:not(:first-child),
-.btn-group > .dropdown-toggle:not(:first-child) {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-.btn-group > .btn-group {
- float: left;
-}
-.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-.btn-group > .btn-group:first-child > .btn:last-child,
-.btn-group > .btn-group:first-child > .dropdown-toggle {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-.btn-group > .btn-group:last-child > .btn:first-child {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
- outline: 0;
-}
-.btn-group > .btn + .dropdown-toggle {
- padding-right: 8px;
- padding-left: 8px;
-}
-.btn-group > .btn-lg + .dropdown-toggle {
- padding-right: 12px;
- padding-left: 12px;
-}
-.btn-group.open .dropdown-toggle {
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn-group.open .dropdown-toggle.btn-link {
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.btn .caret {
- margin-left: 0;
-}
-.btn-lg .caret {
- border-width: 5px 5px 0;
- border-bottom-width: 0;
-}
-.dropup .btn-lg .caret {
- border-width: 0 5px 5px;
-}
-.btn-group-vertical > .btn,
-.btn-group-vertical > .btn-group,
-.btn-group-vertical > .btn-group > .btn {
- display: block;
- float: none;
- width: 100%;
- max-width: 100%;
-}
-.btn-group-vertical > .btn-group > .btn {
- float: none;
-}
-.btn-group-vertical > .btn + .btn,
-.btn-group-vertical > .btn + .btn-group,
-.btn-group-vertical > .btn-group + .btn,
-.btn-group-vertical > .btn-group + .btn-group {
- margin-top: -1px;
- margin-left: 0;
-}
-.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
- border-radius: 0;
-}
-.btn-group-vertical > .btn:first-child:not(:last-child) {
- border-top-right-radius: 4px;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn:last-child:not(:first-child) {
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- border-bottom-left-radius: 4px;
-}
-.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
- border-top-left-radius: 0;
- border-top-right-radius: 0;
-}
-.btn-group-justified {
- display: table;
- width: 100%;
- table-layout: fixed;
- border-collapse: separate;
-}
-.btn-group-justified > .btn,
-.btn-group-justified > .btn-group {
- display: table-cell;
- float: none;
- width: 1%;
-}
-.btn-group-justified > .btn-group .btn {
- width: 100%;
-}
-.btn-group-justified > .btn-group .dropdown-menu {
- left: auto;
-}
-[data-toggle="buttons"] > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn input[type="checkbox"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
- position: absolute;
- clip: rect(0, 0, 0, 0);
- pointer-events: none;
-}
-.input-group {
- position: relative;
- display: table;
- border-collapse: separate;
-}
-.input-group[class*="col-"] {
- float: none;
- padding-right: 0;
- padding-left: 0;
-}
-.input-group .form-control {
- position: relative;
- z-index: 2;
- float: left;
- width: 100%;
- margin-bottom: 0;
-}
-.input-group-lg > .form-control,
-.input-group-lg > .input-group-addon,
-.input-group-lg > .input-group-btn > .btn {
- height: 46px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-select.input-group-lg > .form-control,
-select.input-group-lg > .input-group-addon,
-select.input-group-lg > .input-group-btn > .btn {
- height: 46px;
- line-height: 46px;
-}
-textarea.input-group-lg > .form-control,
-textarea.input-group-lg > .input-group-addon,
-textarea.input-group-lg > .input-group-btn > .btn,
-select[multiple].input-group-lg > .form-control,
-select[multiple].input-group-lg > .input-group-addon,
-select[multiple].input-group-lg > .input-group-btn > .btn {
- height: auto;
-}
-.input-group-sm > .form-control,
-.input-group-sm > .input-group-addon,
-.input-group-sm > .input-group-btn > .btn {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-select.input-group-sm > .form-control,
-select.input-group-sm > .input-group-addon,
-select.input-group-sm > .input-group-btn > .btn {
- height: 30px;
- line-height: 30px;
-}
-textarea.input-group-sm > .form-control,
-textarea.input-group-sm > .input-group-addon,
-textarea.input-group-sm > .input-group-btn > .btn,
-select[multiple].input-group-sm > .form-control,
-select[multiple].input-group-sm > .input-group-addon,
-select[multiple].input-group-sm > .input-group-btn > .btn {
- height: auto;
-}
-.input-group-addon,
-.input-group-btn,
-.input-group .form-control {
- display: table-cell;
-}
-.input-group-addon:not(:first-child):not(:last-child),
-.input-group-btn:not(:first-child):not(:last-child),
-.input-group .form-control:not(:first-child):not(:last-child) {
- border-radius: 0;
-}
-.input-group-addon,
-.input-group-btn {
- width: 1%;
- white-space: nowrap;
- vertical-align: middle;
-}
-.input-group-addon {
- padding: 6px 12px;
- font-size: 14px;
- font-weight: normal;
- line-height: 1;
- color: #555;
- text-align: center;
- background-color: #eee;
- border: 1px solid #ccc;
- border-radius: 4px;
-}
-.input-group-addon.input-sm {
- padding: 5px 10px;
- font-size: 12px;
- border-radius: 3px;
-}
-.input-group-addon.input-lg {
- padding: 10px 16px;
- font-size: 18px;
- border-radius: 6px;
-}
-.input-group-addon input[type="radio"],
-.input-group-addon input[type="checkbox"] {
- margin-top: 0;
-}
-.input-group .form-control:first-child,
-.input-group-addon:first-child,
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group > .btn,
-.input-group-btn:first-child > .dropdown-toggle,
-.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
-.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-.input-group-addon:first-child {
- border-right: 0;
-}
-.input-group .form-control:last-child,
-.input-group-addon:last-child,
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group > .btn,
-.input-group-btn:last-child > .dropdown-toggle,
-.input-group-btn:first-child > .btn:not(:first-child),
-.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-.input-group-addon:last-child {
- border-left: 0;
-}
-.input-group-btn {
- position: relative;
- font-size: 0;
- white-space: nowrap;
-}
-.input-group-btn > .btn {
- position: relative;
-}
-.input-group-btn > .btn + .btn {
- margin-left: -1px;
-}
-.input-group-btn > .btn:hover,
-.input-group-btn > .btn:focus,
-.input-group-btn > .btn:active {
- z-index: 2;
-}
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group {
- margin-right: -1px;
-}
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group {
- margin-left: -1px;
-}
-.nav {
- padding-left: 0;
- margin-bottom: 0;
- list-style: none;
-}
-.nav > li {
- position: relative;
- display: block;
-}
-.nav > li > a {
- position: relative;
- display: block;
- padding: 10px 15px;
-}
-.nav > li > a:hover,
-.nav > li > a:focus {
- text-decoration: none;
- background-color: #eee;
-}
-.nav > li.disabled > a {
- color: #777;
-}
-.nav > li.disabled > a:hover,
-.nav > li.disabled > a:focus {
- color: #777;
- text-decoration: none;
- cursor: not-allowed;
- background-color: transparent;
-}
-.nav .open > a,
-.nav .open > a:hover,
-.nav .open > a:focus {
- background-color: #eee;
- border-color: #337ab7;
-}
-.nav .nav-divider {
- height: 1px;
- margin: 9px 0;
- overflow: hidden;
- background-color: #e5e5e5;
-}
-.nav > li > a > img {
- max-width: none;
-}
-.nav-tabs {
- border-bottom: 1px solid #ddd;
-}
-.nav-tabs > li {
- float: left;
- margin-bottom: -1px;
-}
-.nav-tabs > li > a {
- margin-right: 2px;
- line-height: 1.42857143;
- border: 1px solid transparent;
- border-radius: 4px 4px 0 0;
-}
-.nav-tabs > li > a:hover {
- border-color: #eee #eee #ddd;
-}
-.nav-tabs > li.active > a,
-.nav-tabs > li.active > a:hover,
-.nav-tabs > li.active > a:focus {
- color: #555;
- cursor: default;
- background-color: #fff;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
-}
-.nav-tabs.nav-justified {
- width: 100%;
- border-bottom: 0;
-}
-.nav-tabs.nav-justified > li {
- float: none;
-}
-.nav-tabs.nav-justified > li > a {
- margin-bottom: 5px;
- text-align: center;
-}
-.nav-tabs.nav-justified > .dropdown .dropdown-menu {
- top: auto;
- left: auto;
-}
-@media (min-width: 768px) {
- .nav-tabs.nav-justified > li {
- display: table-cell;
- width: 1%;
- }
- .nav-tabs.nav-justified > li > a {
- margin-bottom: 0;
- }
-}
-.nav-tabs.nav-justified > li > a {
- margin-right: 0;
- border-radius: 4px;
-}
-.nav-tabs.nav-justified > .active > a,
-.nav-tabs.nav-justified > .active > a:hover,
-.nav-tabs.nav-justified > .active > a:focus {
- border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
- .nav-tabs.nav-justified > li > a {
- border-bottom: 1px solid #ddd;
- border-radius: 4px 4px 0 0;
- }
- .nav-tabs.nav-justified > .active > a,
- .nav-tabs.nav-justified > .active > a:hover,
- .nav-tabs.nav-justified > .active > a:focus {
- border-bottom-color: #fff;
- }
-}
-.nav-pills > li {
- float: left;
-}
-.nav-pills > li > a {
- border-radius: 4px;
-}
-.nav-pills > li + li {
- margin-left: 2px;
-}
-.nav-pills > li.active > a,
-.nav-pills > li.active > a:hover,
-.nav-pills > li.active > a:focus {
- color: #fff;
- background-color: #337ab7;
-}
-.nav-stacked > li {
- float: none;
-}
-.nav-stacked > li + li {
- margin-top: 2px;
- margin-left: 0;
-}
-.nav-justified {
- width: 100%;
-}
-.nav-justified > li {
- float: none;
-}
-.nav-justified > li > a {
- margin-bottom: 5px;
- text-align: center;
-}
-.nav-justified > .dropdown .dropdown-menu {
- top: auto;
- left: auto;
-}
-@media (min-width: 768px) {
- .nav-justified > li {
- display: table-cell;
- width: 1%;
- }
- .nav-justified > li > a {
- margin-bottom: 0;
- }
-}
-.nav-tabs-justified {
- border-bottom: 0;
-}
-.nav-tabs-justified > li > a {
- margin-right: 0;
- border-radius: 4px;
-}
-.nav-tabs-justified > .active > a,
-.nav-tabs-justified > .active > a:hover,
-.nav-tabs-justified > .active > a:focus {
- border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
- .nav-tabs-justified > li > a {
- border-bottom: 1px solid #ddd;
- border-radius: 4px 4px 0 0;
- }
- .nav-tabs-justified > .active > a,
- .nav-tabs-justified > .active > a:hover,
- .nav-tabs-justified > .active > a:focus {
- border-bottom-color: #fff;
- }
-}
-.tab-content > .tab-pane {
- display: none;
- visibility: hidden;
-}
-.tab-content > .active {
- display: block;
- visibility: visible;
-}
-.nav-tabs .dropdown-menu {
- margin-top: -1px;
- border-top-left-radius: 0;
- border-top-right-radius: 0;
-}
-.navbar {
- position: relative;
- min-height: 50px;
- margin-bottom: 20px;
- border: 1px solid transparent;
-}
-@media (min-width: 768px) {
- .navbar {
- border-radius: 4px;
- }
-}
-@media (min-width: 768px) {
- .navbar-header {
- float: left;
- }
-}
-.navbar-collapse {
- padding-right: 15px;
- padding-left: 15px;
- overflow-x: visible;
- -webkit-overflow-scrolling: touch;
- border-top: 1px solid transparent;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
-}
-.navbar-collapse.in {
- overflow-y: auto;
-}
-@media (min-width: 768px) {
- .navbar-collapse {
- width: auto;
- border-top: 0;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
- .navbar-collapse.collapse {
- display: block !important;
- height: auto !important;
- padding-bottom: 0;
- overflow: visible !important;
- visibility: visible !important;
- }
- .navbar-collapse.in {
- overflow-y: visible;
- }
- .navbar-fixed-top .navbar-collapse,
- .navbar-static-top .navbar-collapse,
- .navbar-fixed-bottom .navbar-collapse {
- padding-right: 0;
- padding-left: 0;
- }
-}
-.navbar-fixed-top .navbar-collapse,
-.navbar-fixed-bottom .navbar-collapse {
- max-height: 340px;
-}
-@media (max-device-width: 480px) and (orientation: landscape) {
- .navbar-fixed-top .navbar-collapse,
- .navbar-fixed-bottom .navbar-collapse {
- max-height: 200px;
- }
-}
-.container > .navbar-header,
-.container-fluid > .navbar-header,
-.container > .navbar-collapse,
-.container-fluid > .navbar-collapse {
- margin-right: -15px;
- margin-left: -15px;
-}
-@media (min-width: 768px) {
- .container > .navbar-header,
- .container-fluid > .navbar-header,
- .container > .navbar-collapse,
- .container-fluid > .navbar-collapse {
- margin-right: 0;
- margin-left: 0;
- }
-}
-.navbar-static-top {
- z-index: 1000;
- border-width: 0 0 1px;
-}
-@media (min-width: 768px) {
- .navbar-static-top {
- border-radius: 0;
- }
-}
-.navbar-fixed-top,
-.navbar-fixed-bottom {
- position: fixed;
- right: 0;
- left: 0;
- z-index: 1030;
-}
-@media (min-width: 768px) {
- .navbar-fixed-top,
- .navbar-fixed-bottom {
- border-radius: 0;
- }
-}
-.navbar-fixed-top {
- top: 0;
- border-width: 0 0 1px;
-}
-.navbar-fixed-bottom {
- bottom: 0;
- margin-bottom: 0;
- border-width: 1px 0 0;
-}
-.navbar-brand {
- float: left;
- height: 50px;
- padding: 15px 15px;
- font-size: 18px;
- line-height: 20px;
-}
-.navbar-brand:hover,
-.navbar-brand:focus {
- text-decoration: none;
-}
-.navbar-brand > img {
- display: block;
-}
-@media (min-width: 768px) {
- .navbar > .container .navbar-brand,
- .navbar > .container-fluid .navbar-brand {
- margin-left: -15px;
- }
-}
-.navbar-toggle {
- position: relative;
- float: right;
- padding: 9px 10px;
- margin-top: 8px;
- margin-right: 15px;
- margin-bottom: 8px;
- background-color: transparent;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-.navbar-toggle:focus {
- outline: 0;
-}
-.navbar-toggle .icon-bar {
- display: block;
- width: 22px;
- height: 2px;
- border-radius: 1px;
-}
-.navbar-toggle .icon-bar + .icon-bar {
- margin-top: 4px;
-}
-@media (min-width: 768px) {
- .navbar-toggle {
- display: none;
- }
-}
-.navbar-nav {
- margin: 7.5px -15px;
-}
-.navbar-nav > li > a {
- padding-top: 10px;
- padding-bottom: 10px;
- line-height: 20px;
-}
-@media (max-width: 767px) {
- .navbar-nav .open .dropdown-menu {
- position: static;
- float: none;
- width: auto;
- margin-top: 0;
- background-color: transparent;
- border: 0;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
- .navbar-nav .open .dropdown-menu > li > a,
- .navbar-nav .open .dropdown-menu .dropdown-header {
- padding: 5px 15px 5px 25px;
- }
- .navbar-nav .open .dropdown-menu > li > a {
- line-height: 20px;
- }
- .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-nav .open .dropdown-menu > li > a:focus {
- background-image: none;
- }
-}
-@media (min-width: 768px) {
- .navbar-nav {
- float: left;
- margin: 0;
- }
- .navbar-nav > li {
- float: left;
- }
- .navbar-nav > li > a {
- padding-top: 15px;
- padding-bottom: 15px;
- }
-}
-.navbar-form {
- padding: 10px 15px;
- margin-top: 8px;
- margin-right: -15px;
- margin-bottom: 8px;
- margin-left: -15px;
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
-}
-@media (min-width: 768px) {
- .navbar-form .form-group {
- display: inline-block;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .form-control {
- display: inline-block;
- width: auto;
- vertical-align: middle;
- }
- .navbar-form .form-control-static {
- display: inline-block;
- }
- .navbar-form .input-group {
- display: inline-table;
- vertical-align: middle;
- }
- .navbar-form .input-group .input-group-addon,
- .navbar-form .input-group .input-group-btn,
- .navbar-form .input-group .form-control {
- width: auto;
- }
- .navbar-form .input-group > .form-control {
- width: 100%;
- }
- .navbar-form .control-label {
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .radio,
- .navbar-form .checkbox {
- display: inline-block;
- margin-top: 0;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .radio label,
- .navbar-form .checkbox label {
- padding-left: 0;
- }
- .navbar-form .radio input[type="radio"],
- .navbar-form .checkbox input[type="checkbox"] {
- position: relative;
- margin-left: 0;
- }
- .navbar-form .has-feedback .form-control-feedback {
- top: 0;
- }
-}
-@media (max-width: 767px) {
- .navbar-form .form-group {
- margin-bottom: 5px;
- }
- .navbar-form .form-group:last-child {
- margin-bottom: 0;
- }
-}
-@media (min-width: 768px) {
- .navbar-form {
- width: auto;
- padding-top: 0;
- padding-bottom: 0;
- margin-right: 0;
- margin-left: 0;
- border: 0;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
-}
-.navbar-nav > li > .dropdown-menu {
- margin-top: 0;
- border-top-left-radius: 0;
- border-top-right-radius: 0;
-}
-.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-.navbar-btn {
- margin-top: 8px;
- margin-bottom: 8px;
-}
-.navbar-btn.btn-sm {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-.navbar-btn.btn-xs {
- margin-top: 14px;
- margin-bottom: 14px;
-}
-.navbar-text {
- margin-top: 15px;
- margin-bottom: 15px;
-}
-@media (min-width: 768px) {
- .navbar-text {
- float: left;
- margin-right: 15px;
- margin-left: 15px;
- }
-}
-@media (min-width: 768px) {
- .navbar-left {
- float: left !important;
- }
- .navbar-right {
- float: right !important;
- margin-right: -15px;
- }
- .navbar-right ~ .navbar-right {
- margin-right: 0;
- }
-}
-.navbar-default {
- background-color: #f8f8f8;
- border-color: #e7e7e7;
-}
-.navbar-default .navbar-brand {
- color: #777;
-}
-.navbar-default .navbar-brand:hover,
-.navbar-default .navbar-brand:focus {
- color: #5e5e5e;
- background-color: transparent;
-}
-.navbar-default .navbar-text {
- color: #777;
-}
-.navbar-default .navbar-nav > li > a {
- color: #777;
-}
-.navbar-default .navbar-nav > li > a:hover,
-.navbar-default .navbar-nav > li > a:focus {
- color: #333;
- background-color: transparent;
-}
-.navbar-default .navbar-nav > .active > a,
-.navbar-default .navbar-nav > .active > a:hover,
-.navbar-default .navbar-nav > .active > a:focus {
- color: #555;
- background-color: #e7e7e7;
-}
-.navbar-default .navbar-nav > .disabled > a,
-.navbar-default .navbar-nav > .disabled > a:hover,
-.navbar-default .navbar-nav > .disabled > a:focus {
- color: #ccc;
- background-color: transparent;
-}
-.navbar-default .navbar-toggle {
- border-color: #ddd;
-}
-.navbar-default .navbar-toggle:hover,
-.navbar-default .navbar-toggle:focus {
- background-color: #ddd;
-}
-.navbar-default .navbar-toggle .icon-bar {
- background-color: #888;
-}
-.navbar-default .navbar-collapse,
-.navbar-default .navbar-form {
- border-color: #e7e7e7;
-}
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .open > a:hover,
-.navbar-default .navbar-nav > .open > a:focus {
- color: #555;
- background-color: #e7e7e7;
-}
-@media (max-width: 767px) {
- .navbar-default .navbar-nav .open .dropdown-menu > li > a {
- color: #777;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
- color: #333;
- background-color: transparent;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
- color: #555;
- background-color: #e7e7e7;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
- color: #ccc;
- background-color: transparent;
- }
-}
-.navbar-default .navbar-link {
- color: #777;
-}
-.navbar-default .navbar-link:hover {
- color: #333;
-}
-.navbar-default .btn-link {
- color: #777;
-}
-.navbar-default .btn-link:hover,
-.navbar-default .btn-link:focus {
- color: #333;
-}
-.navbar-default .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-default .btn-link:hover,
-.navbar-default .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-default .btn-link:focus {
- color: #ccc;
-}
-.navbar-inverse {
- background-color: #222;
- border-color: #080808;
-}
-.navbar-inverse .navbar-brand {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-brand:hover,
-.navbar-inverse .navbar-brand:focus {
- color: #fff;
- background-color: transparent;
-}
-.navbar-inverse .navbar-text {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a:hover,
-.navbar-inverse .navbar-nav > li > a:focus {
- color: #fff;
- background-color: transparent;
-}
-.navbar-inverse .navbar-nav > .active > a,
-.navbar-inverse .navbar-nav > .active > a:hover,
-.navbar-inverse .navbar-nav > .active > a:focus {
- color: #fff;
- background-color: #080808;
-}
-.navbar-inverse .navbar-nav > .disabled > a,
-.navbar-inverse .navbar-nav > .disabled > a:hover,
-.navbar-inverse .navbar-nav > .disabled > a:focus {
- color: #444;
- background-color: transparent;
-}
-.navbar-inverse .navbar-toggle {
- border-color: #333;
-}
-.navbar-inverse .navbar-toggle:hover,
-.navbar-inverse .navbar-toggle:focus {
- background-color: #333;
-}
-.navbar-inverse .navbar-toggle .icon-bar {
- background-color: #fff;
-}
-.navbar-inverse .navbar-collapse,
-.navbar-inverse .navbar-form {
- border-color: #101010;
-}
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .open > a:hover,
-.navbar-inverse .navbar-nav > .open > a:focus {
- color: #fff;
- background-color: #080808;
-}
-@media (max-width: 767px) {
- .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
- border-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
- background-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
- color: #9d9d9d;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
- color: #fff;
- background-color: transparent;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
- color: #fff;
- background-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
- color: #444;
- background-color: transparent;
- }
-}
-.navbar-inverse .navbar-link {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-link:hover {
- color: #fff;
-}
-.navbar-inverse .btn-link {
- color: #9d9d9d;
-}
-.navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link:focus {
- color: #fff;
-}
-.navbar-inverse .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-inverse .btn-link:focus {
- color: #444;
-}
-.breadcrumb {
- padding: 8px 15px;
- margin-bottom: 20px;
- list-style: none;
- background-color: #f5f5f5;
- border-radius: 4px;
-}
-.breadcrumb > li {
- display: inline-block;
-}
-.breadcrumb > li + li:before {
- padding: 0 5px;
- color: #ccc;
- content: "/\00a0";
-}
-.breadcrumb > .active {
- color: #777;
-}
-.pagination {
- display: inline-block;
- padding-left: 0;
- margin: 20px 0;
- border-radius: 4px;
-}
-.pagination > li {
- display: inline;
-}
-.pagination > li > a,
-.pagination > li > span {
- position: relative;
- float: left;
- padding: 6px 12px;
- margin-left: -1px;
- line-height: 1.42857143;
- color: #337ab7;
- text-decoration: none;
- background-color: #fff;
- border: 1px solid #ddd;
-}
-.pagination > li:first-child > a,
-.pagination > li:first-child > span {
- margin-left: 0;
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-.pagination > li:last-child > a,
-.pagination > li:last-child > span {
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-.pagination > li > a:hover,
-.pagination > li > span:hover,
-.pagination > li > a:focus,
-.pagination > li > span:focus {
- color: #23527c;
- background-color: #eee;
- border-color: #ddd;
-}
-.pagination > .active > a,
-.pagination > .active > span,
-.pagination > .active > a:hover,
-.pagination > .active > span:hover,
-.pagination > .active > a:focus,
-.pagination > .active > span:focus {
- z-index: 2;
- color: #fff;
- cursor: default;
- background-color: #337ab7;
- border-color: #337ab7;
-}
-.pagination > .disabled > span,
-.pagination > .disabled > span:hover,
-.pagination > .disabled > span:focus,
-.pagination > .disabled > a,
-.pagination > .disabled > a:hover,
-.pagination > .disabled > a:focus {
- color: #777;
- cursor: not-allowed;
- background-color: #fff;
- border-color: #ddd;
-}
-.pagination-lg > li > a,
-.pagination-lg > li > span {
- padding: 10px 16px;
- font-size: 18px;
-}
-.pagination-lg > li:first-child > a,
-.pagination-lg > li:first-child > span {
- border-top-left-radius: 6px;
- border-bottom-left-radius: 6px;
-}
-.pagination-lg > li:last-child > a,
-.pagination-lg > li:last-child > span {
- border-top-right-radius: 6px;
- border-bottom-right-radius: 6px;
-}
-.pagination-sm > li > a,
-.pagination-sm > li > span {
- padding: 5px 10px;
- font-size: 12px;
-}
-.pagination-sm > li:first-child > a,
-.pagination-sm > li:first-child > span {
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.pagination-sm > li:last-child > a,
-.pagination-sm > li:last-child > span {
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-.pager {
- padding-left: 0;
- margin: 20px 0;
- text-align: center;
- list-style: none;
-}
-.pager li {
- display: inline;
-}
-.pager li > a,
-.pager li > span {
- display: inline-block;
- padding: 5px 14px;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 15px;
-}
-.pager li > a:hover,
-.pager li > a:focus {
- text-decoration: none;
- background-color: #eee;
-}
-.pager .next > a,
-.pager .next > span {
- float: right;
-}
-.pager .previous > a,
-.pager .previous > span {
- float: left;
-}
-.pager .disabled > a,
-.pager .disabled > a:hover,
-.pager .disabled > a:focus,
-.pager .disabled > span {
- color: #777;
- cursor: not-allowed;
- background-color: #fff;
-}
-.label {
- display: inline;
- padding: .2em .6em .3em;
- font-size: 75%;
- font-weight: bold;
- line-height: 1;
- color: #fff;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
- border-radius: .25em;
-}
-a.label:hover,
-a.label:focus {
- color: #fff;
- text-decoration: none;
- cursor: pointer;
-}
-.label:empty {
- display: none;
-}
-.btn .label {
- position: relative;
- top: -1px;
-}
-.label-default {
- background-color: #777;
-}
-.label-default[href]:hover,
-.label-default[href]:focus {
- background-color: #5e5e5e;
-}
-.label-primary {
- background-color: #337ab7;
-}
-.label-primary[href]:hover,
-.label-primary[href]:focus {
- background-color: #286090;
-}
-.label-success {
- background-color: #5cb85c;
-}
-.label-success[href]:hover,
-.label-success[href]:focus {
- background-color: #449d44;
-}
-.label-info {
- background-color: #5bc0de;
-}
-.label-info[href]:hover,
-.label-info[href]:focus {
- background-color: #31b0d5;
-}
-.label-warning {
- background-color: #f0ad4e;
-}
-.label-warning[href]:hover,
-.label-warning[href]:focus {
- background-color: #ec971f;
-}
-.label-danger {
- background-color: #d9534f;
-}
-.label-danger[href]:hover,
-.label-danger[href]:focus {
- background-color: #c9302c;
-}
-.badge {
- display: inline-block;
- min-width: 10px;
- padding: 3px 7px;
- font-size: 12px;
- font-weight: bold;
- line-height: 1;
- color: #fff;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
- background-color: #777;
- border-radius: 10px;
-}
-.badge:empty {
- display: none;
-}
-.btn .badge {
- position: relative;
- top: -1px;
-}
-.btn-xs .badge {
- top: 0;
- padding: 1px 5px;
-}
-a.badge:hover,
-a.badge:focus {
- color: #fff;
- text-decoration: none;
- cursor: pointer;
-}
-.list-group-item.active > .badge,
-.nav-pills > .active > a > .badge {
- color: #337ab7;
- background-color: #fff;
-}
-.list-group-item > .badge {
- float: right;
-}
-.list-group-item > .badge + .badge {
- margin-right: 5px;
-}
-.nav-pills > li > a > .badge {
- margin-left: 3px;
-}
-.jumbotron {
- padding: 30px 15px;
- margin-bottom: 30px;
- color: inherit;
- background-color: #eee;
-}
-.jumbotron h1,
-.jumbotron .h1 {
- color: inherit;
-}
-.jumbotron p {
- margin-bottom: 15px;
- font-size: 21px;
- font-weight: 200;
-}
-.jumbotron > hr {
- border-top-color: #d5d5d5;
-}
-.container .jumbotron,
-.container-fluid .jumbotron {
- border-radius: 6px;
-}
-.jumbotron .container {
- max-width: 100%;
-}
-@media screen and (min-width: 768px) {
- .jumbotron {
- padding: 48px 0;
- }
- .container .jumbotron,
- .container-fluid .jumbotron {
- padding-right: 60px;
- padding-left: 60px;
- }
- .jumbotron h1,
- .jumbotron .h1 {
- font-size: 63px;
- }
-}
-.thumbnail {
- display: block;
- padding: 4px;
- margin-bottom: 20px;
- line-height: 1.42857143;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 4px;
- -webkit-transition: border .2s ease-in-out;
- -o-transition: border .2s ease-in-out;
- transition: border .2s ease-in-out;
-}
-.thumbnail > img,
-.thumbnail a > img {
- margin-right: auto;
- margin-left: auto;
-}
-a.thumbnail:hover,
-a.thumbnail:focus,
-a.thumbnail.active {
- border-color: #337ab7;
-}
-.thumbnail .caption {
- padding: 9px;
- color: #333;
-}
-.alert {
- padding: 15px;
- margin-bottom: 20px;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-.alert h4 {
- margin-top: 0;
- color: inherit;
-}
-.alert .alert-link {
- font-weight: bold;
-}
-.alert > p,
-.alert > ul {
- margin-bottom: 0;
-}
-.alert > p + p {
- margin-top: 5px;
-}
-.alert-dismissable,
-.alert-dismissible {
- padding-right: 35px;
-}
-.alert-dismissable .close,
-.alert-dismissible .close {
- position: relative;
- top: -2px;
- right: -21px;
- color: inherit;
-}
-.alert-success {
- color: #3c763d;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-.alert-success hr {
- border-top-color: #c9e2b3;
-}
-.alert-success .alert-link {
- color: #2b542c;
-}
-.alert-info {
- color: #31708f;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-.alert-info hr {
- border-top-color: #a6e1ec;
-}
-.alert-info .alert-link {
- color: #245269;
-}
-.alert-warning {
- color: #8a6d3b;
- background-color: #fcf8e3;
- border-color: #faebcc;
-}
-.alert-warning hr {
- border-top-color: #f7e1b5;
-}
-.alert-warning .alert-link {
- color: #66512c;
-}
-.alert-danger {
- color: #a94442;
- background-color: #f2dede;
- border-color: #ebccd1;
-}
-.alert-danger hr {
- border-top-color: #e4b9c0;
-}
-.alert-danger .alert-link {
- color: #843534;
-}
-@-webkit-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-@-o-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-@keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-.progress {
- height: 20px;
- margin-bottom: 20px;
- overflow: hidden;
- background-color: #f5f5f5;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
-}
-.progress-bar {
- float: left;
- width: 0;
- height: 100%;
- font-size: 12px;
- line-height: 20px;
- color: #fff;
- text-align: center;
- background-color: #337ab7;
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
- -webkit-transition: width .6s ease;
- -o-transition: width .6s ease;
- transition: width .6s ease;
-}
-.progress-striped .progress-bar,
-.progress-bar-striped {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- -webkit-background-size: 40px 40px;
- background-size: 40px 40px;
-}
-.progress.active .progress-bar,
-.progress-bar.active {
- -webkit-animation: progress-bar-stripes 2s linear infinite;
- -o-animation: progress-bar-stripes 2s linear infinite;
- animation: progress-bar-stripes 2s linear infinite;
-}
-.progress-bar-success {
- background-color: #5cb85c;
-}
-.progress-striped .progress-bar-success {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-info {
- background-color: #5bc0de;
-}
-.progress-striped .progress-bar-info {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-warning {
- background-color: #f0ad4e;
-}
-.progress-striped .progress-bar-warning {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-danger {
- background-color: #d9534f;
-}
-.progress-striped .progress-bar-danger {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.media {
- margin-top: 15px;
-}
-.media:first-child {
- margin-top: 0;
-}
-.media-right,
-.media > .pull-right {
- padding-left: 10px;
-}
-.media-left,
-.media > .pull-left {
- padding-right: 10px;
-}
-.media-left,
-.media-right,
-.media-body {
- display: table-cell;
- vertical-align: top;
-}
-.media-middle {
- vertical-align: middle;
-}
-.media-bottom {
- vertical-align: bottom;
-}
-.media-heading {
- margin-top: 0;
- margin-bottom: 5px;
-}
-.media-list {
- padding-left: 0;
- list-style: none;
-}
-.list-group {
- padding-left: 0;
- margin-bottom: 20px;
-}
-.list-group-item {
- position: relative;
- display: block;
- padding: 10px 15px;
- margin-bottom: -1px;
- background-color: #fff;
- border: 1px solid #ddd;
-}
-.list-group-item:first-child {
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
-}
-.list-group-item:last-child {
- margin-bottom: 0;
- border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-a.list-group-item {
- color: #555;
-}
-a.list-group-item .list-group-item-heading {
- color: #333;
-}
-a.list-group-item:hover,
-a.list-group-item:focus {
- color: #555;
- text-decoration: none;
- background-color: #f5f5f5;
-}
-.list-group-item.disabled,
-.list-group-item.disabled:hover,
-.list-group-item.disabled:focus {
- color: #777;
- cursor: not-allowed;
- background-color: #eee;
-}
-.list-group-item.disabled .list-group-item-heading,
-.list-group-item.disabled:hover .list-group-item-heading,
-.list-group-item.disabled:focus .list-group-item-heading {
- color: inherit;
-}
-.list-group-item.disabled .list-group-item-text,
-.list-group-item.disabled:hover .list-group-item-text,
-.list-group-item.disabled:focus .list-group-item-text {
- color: #777;
-}
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
- z-index: 2;
- color: #fff;
- background-color: #337ab7;
- border-color: #337ab7;
-}
-.list-group-item.active .list-group-item-heading,
-.list-group-item.active:hover .list-group-item-heading,
-.list-group-item.active:focus .list-group-item-heading,
-.list-group-item.active .list-group-item-heading > small,
-.list-group-item.active:hover .list-group-item-heading > small,
-.list-group-item.active:focus .list-group-item-heading > small,
-.list-group-item.active .list-group-item-heading > .small,
-.list-group-item.active:hover .list-group-item-heading > .small,
-.list-group-item.active:focus .list-group-item-heading > .small {
- color: inherit;
-}
-.list-group-item.active .list-group-item-text,
-.list-group-item.active:hover .list-group-item-text,
-.list-group-item.active:focus .list-group-item-text {
- color: #c7ddef;
-}
-.list-group-item-success {
- color: #3c763d;
- background-color: #dff0d8;
-}
-a.list-group-item-success {
- color: #3c763d;
-}
-a.list-group-item-success .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-success:hover,
-a.list-group-item-success:focus {
- color: #3c763d;
- background-color: #d0e9c6;
-}
-a.list-group-item-success.active,
-a.list-group-item-success.active:hover,
-a.list-group-item-success.active:focus {
- color: #fff;
- background-color: #3c763d;
- border-color: #3c763d;
-}
-.list-group-item-info {
- color: #31708f;
- background-color: #d9edf7;
-}
-a.list-group-item-info {
- color: #31708f;
-}
-a.list-group-item-info .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-info:hover,
-a.list-group-item-info:focus {
- color: #31708f;
- background-color: #c4e3f3;
-}
-a.list-group-item-info.active,
-a.list-group-item-info.active:hover,
-a.list-group-item-info.active:focus {
- color: #fff;
- background-color: #31708f;
- border-color: #31708f;
-}
-.list-group-item-warning {
- color: #8a6d3b;
- background-color: #fcf8e3;
-}
-a.list-group-item-warning {
- color: #8a6d3b;
-}
-a.list-group-item-warning .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-warning:hover,
-a.list-group-item-warning:focus {
- color: #8a6d3b;
- background-color: #faf2cc;
-}
-a.list-group-item-warning.active,
-a.list-group-item-warning.active:hover,
-a.list-group-item-warning.active:focus {
- color: #fff;
- background-color: #8a6d3b;
- border-color: #8a6d3b;
-}
-.list-group-item-danger {
- color: #a94442;
- background-color: #f2dede;
-}
-a.list-group-item-danger {
- color: #a94442;
-}
-a.list-group-item-danger .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-danger:hover,
-a.list-group-item-danger:focus {
- color: #a94442;
- background-color: #ebcccc;
-}
-a.list-group-item-danger.active,
-a.list-group-item-danger.active:hover,
-a.list-group-item-danger.active:focus {
- color: #fff;
- background-color: #a94442;
- border-color: #a94442;
-}
-.list-group-item-heading {
- margin-top: 0;
- margin-bottom: 5px;
-}
-.list-group-item-text {
- margin-bottom: 0;
- line-height: 1.3;
-}
-.panel {
- margin-bottom: 20px;
- background-color: #fff;
- border: 1px solid transparent;
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
- box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
-}
-.panel-body {
- padding: 15px;
-}
-.panel-heading {
- padding: 10px 15px;
- border-bottom: 1px solid transparent;
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-.panel-heading > .dropdown .dropdown-toggle {
- color: inherit;
-}
-.panel-title {
- margin-top: 0;
- margin-bottom: 0;
- font-size: 16px;
- color: inherit;
-}
-.panel-title > a {
- color: inherit;
-}
-.panel-footer {
- padding: 10px 15px;
- background-color: #f5f5f5;
- border-top: 1px solid #ddd;
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel > .list-group,
-.panel > .panel-collapse > .list-group {
- margin-bottom: 0;
-}
-.panel > .list-group .list-group-item,
-.panel > .panel-collapse > .list-group .list-group-item {
- border-width: 1px 0;
- border-radius: 0;
-}
-.panel > .list-group:first-child .list-group-item:first-child,
-.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
- border-top: 0;
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-.panel > .list-group:last-child .list-group-item:last-child,
-.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
- border-bottom: 0;
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel-heading + .list-group .list-group-item:first-child {
- border-top-width: 0;
-}
-.list-group + .panel-footer {
- border-top-width: 0;
-}
-.panel > .table,
-.panel > .table-responsive > .table,
-.panel > .panel-collapse > .table {
- margin-bottom: 0;
-}
-.panel > .table caption,
-.panel > .table-responsive > .table caption,
-.panel > .panel-collapse > .table caption {
- padding-right: 15px;
- padding-left: 15px;
-}
-.panel > .table:first-child,
-.panel > .table-responsive:first-child > .table:first-child {
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
- border-top-left-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
- border-top-right-radius: 3px;
-}
-.panel > .table:last-child,
-.panel > .table-responsive:last-child > .table:last-child {
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
- border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
- border-bottom-right-radius: 3px;
-}
-.panel > .panel-body + .table,
-.panel > .panel-body + .table-responsive,
-.panel > .table + .panel-body,
-.panel > .table-responsive + .panel-body {
- border-top: 1px solid #ddd;
-}
-.panel > .table > tbody:first-child > tr:first-child th,
-.panel > .table > tbody:first-child > tr:first-child td {
- border-top: 0;
-}
-.panel > .table-bordered,
-.panel > .table-responsive > .table-bordered {
- border: 0;
-}
-.panel > .table-bordered > thead > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
-.panel > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-bordered > thead > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
-.panel > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-bordered > tfoot > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
- border-left: 0;
-}
-.panel > .table-bordered > thead > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
-.panel > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-bordered > thead > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
-.panel > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-bordered > tfoot > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
- border-right: 0;
-}
-.panel > .table-bordered > thead > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
-.panel > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-bordered > thead > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
-.panel > .table-bordered > tbody > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
- border-bottom: 0;
-}
-.panel > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-bordered > tfoot > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
- border-bottom: 0;
-}
-.panel > .table-responsive {
- margin-bottom: 0;
- border: 0;
-}
-.panel-group {
- margin-bottom: 20px;
-}
-.panel-group .panel {
- margin-bottom: 0;
- border-radius: 4px;
-}
-.panel-group .panel + .panel {
- margin-top: 5px;
-}
-.panel-group .panel-heading {
- border-bottom: 0;
-}
-.panel-group .panel-heading + .panel-collapse > .panel-body,
-.panel-group .panel-heading + .panel-collapse > .list-group {
- border-top: 1px solid #ddd;
-}
-.panel-group .panel-footer {
- border-top: 0;
-}
-.panel-group .panel-footer + .panel-collapse .panel-body {
- border-bottom: 1px solid #ddd;
-}
-.panel-default {
- border-color: #ddd;
-}
-.panel-default > .panel-heading {
- color: #333;
- background-color: #f5f5f5;
- border-color: #ddd;
-}
-.panel-default > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #ddd;
-}
-.panel-default > .panel-heading .badge {
- color: #f5f5f5;
- background-color: #333;
-}
-.panel-default > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #ddd;
-}
-.panel-primary {
- border-color: #337ab7;
-}
-.panel-primary > .panel-heading {
- color: #fff;
- background-color: #337ab7;
- border-color: #337ab7;
-}
-.panel-primary > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #337ab7;
-}
-.panel-primary > .panel-heading .badge {
- color: #337ab7;
- background-color: #fff;
-}
-.panel-primary > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #337ab7;
-}
-.panel-success {
- border-color: #d6e9c6;
-}
-.panel-success > .panel-heading {
- color: #3c763d;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-.panel-success > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #d6e9c6;
-}
-.panel-success > .panel-heading .badge {
- color: #dff0d8;
- background-color: #3c763d;
-}
-.panel-success > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #d6e9c6;
-}
-.panel-info {
- border-color: #bce8f1;
-}
-.panel-info > .panel-heading {
- color: #31708f;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-.panel-info > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #bce8f1;
-}
-.panel-info > .panel-heading .badge {
- color: #d9edf7;
- background-color: #31708f;
-}
-.panel-info > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #bce8f1;
-}
-.panel-warning {
- border-color: #faebcc;
-}
-.panel-warning > .panel-heading {
- color: #8a6d3b;
- background-color: #fcf8e3;
- border-color: #faebcc;
-}
-.panel-warning > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #faebcc;
-}
-.panel-warning > .panel-heading .badge {
- color: #fcf8e3;
- background-color: #8a6d3b;
-}
-.panel-warning > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #faebcc;
-}
-.panel-danger {
- border-color: #ebccd1;
-}
-.panel-danger > .panel-heading {
- color: #a94442;
- background-color: #f2dede;
- border-color: #ebccd1;
-}
-.panel-danger > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #ebccd1;
-}
-.panel-danger > .panel-heading .badge {
- color: #f2dede;
- background-color: #a94442;
-}
-.panel-danger > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #ebccd1;
-}
-.embed-responsive {
- position: relative;
- display: block;
- height: 0;
- padding: 0;
- overflow: hidden;
-}
-.embed-responsive .embed-responsive-item,
-.embed-responsive iframe,
-.embed-responsive embed,
-.embed-responsive object,
-.embed-responsive video {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 100%;
- border: 0;
-}
-.embed-responsive.embed-responsive-16by9 {
- padding-bottom: 56.25%;
-}
-.embed-responsive.embed-responsive-4by3 {
- padding-bottom: 75%;
-}
-.well {
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border: 1px solid #e3e3e3;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
-}
-.well blockquote {
- border-color: #ddd;
- border-color: rgba(0, 0, 0, .15);
-}
-.well-lg {
- padding: 24px;
- border-radius: 6px;
-}
-.well-sm {
- padding: 9px;
- border-radius: 3px;
-}
-.close {
- float: right;
- font-size: 21px;
- font-weight: bold;
- line-height: 1;
- color: #000;
- text-shadow: 0 1px 0 #fff;
- filter: alpha(opacity=20);
- opacity: .2;
-}
-.close:hover,
-.close:focus {
- color: #000;
- text-decoration: none;
- cursor: pointer;
- filter: alpha(opacity=50);
- opacity: .5;
-}
-button.close {
- -webkit-appearance: none;
- padding: 0;
- cursor: pointer;
- background: transparent;
- border: 0;
-}
-.modal-open {
- overflow: hidden;
-}
-.modal {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1040;
- display: none;
- overflow: hidden;
- -webkit-overflow-scrolling: touch;
- outline: 0;
-}
-.modal.fade .modal-dialog {
- -webkit-transition: -webkit-transform .3s ease-out;
- -o-transition: -o-transform .3s ease-out;
- transition: transform .3s ease-out;
- -webkit-transform: translate(0, -25%);
- -ms-transform: translate(0, -25%);
- -o-transform: translate(0, -25%);
- transform: translate(0, -25%);
-}
-.modal.in .modal-dialog {
- -webkit-transform: translate(0, 0);
- -ms-transform: translate(0, 0);
- -o-transform: translate(0, 0);
- transform: translate(0, 0);
-}
-.modal-open .modal {
- overflow-x: hidden;
- overflow-y: auto;
-}
-.modal-dialog {
- position: relative;
- width: auto;
- margin: 10px;
-}
-.modal-content {
- position: relative;
- background-color: #fff;
- -webkit-background-clip: padding-box;
- background-clip: padding-box;
- border: 1px solid #999;
- border: 1px solid rgba(0, 0, 0, .2);
- border-radius: 6px;
- outline: 0;
- -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
- box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
-}
-.modal-backdrop {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- background-color: #000;
-}
-.modal-backdrop.fade {
- filter: alpha(opacity=0);
- opacity: 0;
-}
-.modal-backdrop.in {
- filter: alpha(opacity=50);
- opacity: .5;
-}
-.modal-header {
- min-height: 16.42857143px;
- padding: 15px;
- border-bottom: 1px solid #e5e5e5;
-}
-.modal-header .close {
- margin-top: -2px;
-}
-.modal-title {
- margin: 0;
- line-height: 1.42857143;
-}
-.modal-body {
- position: relative;
- padding: 15px;
-}
-.modal-footer {
- padding: 15px;
- text-align: right;
- border-top: 1px solid #e5e5e5;
-}
-.modal-footer .btn + .btn {
- margin-bottom: 0;
- margin-left: 5px;
-}
-.modal-footer .btn-group .btn + .btn {
- margin-left: -1px;
-}
-.modal-footer .btn-block + .btn-block {
- margin-left: 0;
-}
-.modal-scrollbar-measure {
- position: absolute;
- top: -9999px;
- width: 50px;
- height: 50px;
- overflow: scroll;
-}
-@media (min-width: 768px) {
- .modal-dialog {
- width: 600px;
- margin: 30px auto;
- }
- .modal-content {
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
- box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
- }
- .modal-sm {
- width: 300px;
- }
-}
-@media (min-width: 992px) {
- .modal-lg {
- width: 900px;
- }
-}
-.tooltip {
- position: absolute;
- z-index: 1070;
- display: block;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 12px;
- font-weight: normal;
- line-height: 1.4;
- visibility: visible;
- filter: alpha(opacity=0);
- opacity: 0;
-}
-.tooltip.in {
- filter: alpha(opacity=90);
- opacity: .9;
-}
-.tooltip.top {
- padding: 5px 0;
- margin-top: -3px;
-}
-.tooltip.right {
- padding: 0 5px;
- margin-left: 3px;
-}
-.tooltip.bottom {
- padding: 5px 0;
- margin-top: 3px;
-}
-.tooltip.left {
- padding: 0 5px;
- margin-left: -3px;
-}
-.tooltip-inner {
- max-width: 200px;
- padding: 3px 8px;
- color: #fff;
- text-align: center;
- text-decoration: none;
- background-color: #000;
- border-radius: 4px;
-}
-.tooltip-arrow {
- position: absolute;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-.tooltip.top .tooltip-arrow {
- bottom: 0;
- left: 50%;
- margin-left: -5px;
- border-width: 5px 5px 0;
- border-top-color: #000;
-}
-.tooltip.top-left .tooltip-arrow {
- right: 5px;
- bottom: 0;
- margin-bottom: -5px;
- border-width: 5px 5px 0;
- border-top-color: #000;
-}
-.tooltip.top-right .tooltip-arrow {
- bottom: 0;
- left: 5px;
- margin-bottom: -5px;
- border-width: 5px 5px 0;
- border-top-color: #000;
-}
-.tooltip.right .tooltip-arrow {
- top: 50%;
- left: 0;
- margin-top: -5px;
- border-width: 5px 5px 5px 0;
- border-right-color: #000;
-}
-.tooltip.left .tooltip-arrow {
- top: 50%;
- right: 0;
- margin-top: -5px;
- border-width: 5px 0 5px 5px;
- border-left-color: #000;
-}
-.tooltip.bottom .tooltip-arrow {
- top: 0;
- left: 50%;
- margin-left: -5px;
- border-width: 0 5px 5px;
- border-bottom-color: #000;
-}
-.tooltip.bottom-left .tooltip-arrow {
- top: 0;
- right: 5px;
- margin-top: -5px;
- border-width: 0 5px 5px;
- border-bottom-color: #000;
-}
-.tooltip.bottom-right .tooltip-arrow {
- top: 0;
- left: 5px;
- margin-top: -5px;
- border-width: 0 5px 5px;
- border-bottom-color: #000;
-}
-.popover {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1060;
- display: none;
- max-width: 276px;
- padding: 1px;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: left;
- white-space: normal;
- background-color: #fff;
- -webkit-background-clip: padding-box;
- background-clip: padding-box;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, .2);
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
-}
-.popover.top {
- margin-top: -10px;
-}
-.popover.right {
- margin-left: 10px;
-}
-.popover.bottom {
- margin-top: 10px;
-}
-.popover.left {
- margin-left: -10px;
-}
-.popover-title {
- padding: 8px 14px;
- margin: 0;
- font-size: 14px;
- background-color: #f7f7f7;
- border-bottom: 1px solid #ebebeb;
- border-radius: 5px 5px 0 0;
-}
-.popover-content {
- padding: 9px 14px;
-}
-.popover > .arrow,
-.popover > .arrow:after {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-.popover > .arrow {
- border-width: 11px;
-}
-.popover > .arrow:after {
- content: "";
- border-width: 10px;
-}
-.popover.top > .arrow {
- bottom: -11px;
- left: 50%;
- margin-left: -11px;
- border-top-color: #999;
- border-top-color: rgba(0, 0, 0, .25);
- border-bottom-width: 0;
-}
-.popover.top > .arrow:after {
- bottom: 1px;
- margin-left: -10px;
- content: " ";
- border-top-color: #fff;
- border-bottom-width: 0;
-}
-.popover.right > .arrow {
- top: 50%;
- left: -11px;
- margin-top: -11px;
- border-right-color: #999;
- border-right-color: rgba(0, 0, 0, .25);
- border-left-width: 0;
-}
-.popover.right > .arrow:after {
- bottom: -10px;
- left: 1px;
- content: " ";
- border-right-color: #fff;
- border-left-width: 0;
-}
-.popover.bottom > .arrow {
- top: -11px;
- left: 50%;
- margin-left: -11px;
- border-top-width: 0;
- border-bottom-color: #999;
- border-bottom-color: rgba(0, 0, 0, .25);
-}
-.popover.bottom > .arrow:after {
- top: 1px;
- margin-left: -10px;
- content: " ";
- border-top-width: 0;
- border-bottom-color: #fff;
-}
-.popover.left > .arrow {
- top: 50%;
- right: -11px;
- margin-top: -11px;
- border-right-width: 0;
- border-left-color: #999;
- border-left-color: rgba(0, 0, 0, .25);
-}
-.popover.left > .arrow:after {
- right: 1px;
- bottom: -10px;
- content: " ";
- border-right-width: 0;
- border-left-color: #fff;
-}
-.carousel {
- position: relative;
-}
-.carousel-inner {
- position: relative;
- width: 100%;
- overflow: hidden;
-}
-.carousel-inner > .item {
- position: relative;
- display: none;
- -webkit-transition: .6s ease-in-out left;
- -o-transition: .6s ease-in-out left;
- transition: .6s ease-in-out left;
-}
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
- line-height: 1;
-}
-@media all and (transform-3d), (-webkit-transform-3d) {
- .carousel-inner > .item {
- -webkit-transition: -webkit-transform .6s ease-in-out;
- -o-transition: -o-transform .6s ease-in-out;
- transition: transform .6s ease-in-out;
-
- -webkit-backface-visibility: hidden;
- backface-visibility: hidden;
- -webkit-perspective: 1000;
- perspective: 1000;
- }
- .carousel-inner > .item.next,
- .carousel-inner > .item.active.right {
- left: 0;
- -webkit-transform: translate3d(100%, 0, 0);
- transform: translate3d(100%, 0, 0);
- }
- .carousel-inner > .item.prev,
- .carousel-inner > .item.active.left {
- left: 0;
- -webkit-transform: translate3d(-100%, 0, 0);
- transform: translate3d(-100%, 0, 0);
- }
- .carousel-inner > .item.next.left,
- .carousel-inner > .item.prev.right,
- .carousel-inner > .item.active {
- left: 0;
- -webkit-transform: translate3d(0, 0, 0);
- transform: translate3d(0, 0, 0);
- }
-}
-.carousel-inner > .active,
-.carousel-inner > .next,
-.carousel-inner > .prev {
- display: block;
-}
-.carousel-inner > .active {
- left: 0;
-}
-.carousel-inner > .next,
-.carousel-inner > .prev {
- position: absolute;
- top: 0;
- width: 100%;
-}
-.carousel-inner > .next {
- left: 100%;
-}
-.carousel-inner > .prev {
- left: -100%;
-}
-.carousel-inner > .next.left,
-.carousel-inner > .prev.right {
- left: 0;
-}
-.carousel-inner > .active.left {
- left: -100%;
-}
-.carousel-inner > .active.right {
- left: 100%;
-}
-.carousel-control {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- width: 15%;
- font-size: 20px;
- color: #fff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
- filter: alpha(opacity=50);
- opacity: .5;
-}
-.carousel-control.left {
- background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
- background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
- background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
- background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
- background-repeat: repeat-x;
-}
-.carousel-control.right {
- right: 0;
- left: auto;
- background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
- background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
- background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
- background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
- background-repeat: repeat-x;
-}
-.carousel-control:hover,
-.carousel-control:focus {
- color: #fff;
- text-decoration: none;
- filter: alpha(opacity=90);
- outline: 0;
- opacity: .9;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-left,
-.carousel-control .glyphicon-chevron-right {
- position: absolute;
- top: 50%;
- z-index: 5;
- display: inline-block;
-}
-.carousel-control .icon-prev,
-.carousel-control .glyphicon-chevron-left {
- left: 50%;
- margin-left: -10px;
-}
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-right {
- right: 50%;
- margin-right: -10px;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next {
- width: 20px;
- height: 20px;
- margin-top: -10px;
- font-family: serif;
-}
-.carousel-control .icon-prev:before {
- content: '\2039';
-}
-.carousel-control .icon-next:before {
- content: '\203a';
-}
-.carousel-indicators {
- position: absolute;
- bottom: 10px;
- left: 50%;
- z-index: 15;
- width: 60%;
- padding-left: 0;
- margin-left: -30%;
- text-align: center;
- list-style: none;
-}
-.carousel-indicators li {
- display: inline-block;
- width: 10px;
- height: 10px;
- margin: 1px;
- text-indent: -999px;
- cursor: pointer;
- background-color: #000 \9;
- background-color: rgba(0, 0, 0, 0);
- border: 1px solid #fff;
- border-radius: 10px;
-}
-.carousel-indicators .active {
- width: 12px;
- height: 12px;
- margin: 0;
- background-color: #fff;
-}
-.carousel-caption {
- position: absolute;
- right: 15%;
- bottom: 20px;
- left: 15%;
- z-index: 10;
- padding-top: 20px;
- padding-bottom: 20px;
- color: #fff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
-}
-.carousel-caption .btn {
- text-shadow: none;
-}
-@media screen and (min-width: 768px) {
- .carousel-control .glyphicon-chevron-left,
- .carousel-control .glyphicon-chevron-right,
- .carousel-control .icon-prev,
- .carousel-control .icon-next {
- width: 30px;
- height: 30px;
- margin-top: -15px;
- font-size: 30px;
- }
- .carousel-control .glyphicon-chevron-left,
- .carousel-control .icon-prev {
- margin-left: -15px;
- }
- .carousel-control .glyphicon-chevron-right,
- .carousel-control .icon-next {
- margin-right: -15px;
- }
- .carousel-caption {
- right: 20%;
- left: 20%;
- padding-bottom: 30px;
- }
- .carousel-indicators {
- bottom: 20px;
- }
-}
-.clearfix:before,
-.clearfix:after,
-.dl-horizontal dd:before,
-.dl-horizontal dd:after,
-.container:before,
-.container:after,
-.container-fluid:before,
-.container-fluid:after,
-.row:before,
-.row:after,
-.form-horizontal .form-group:before,
-.form-horizontal .form-group:after,
-.btn-toolbar:before,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:before,
-.btn-group-vertical > .btn-group:after,
-.nav:before,
-.nav:after,
-.navbar:before,
-.navbar:after,
-.navbar-header:before,
-.navbar-header:after,
-.navbar-collapse:before,
-.navbar-collapse:after,
-.pager:before,
-.pager:after,
-.panel-body:before,
-.panel-body:after,
-.modal-footer:before,
-.modal-footer:after {
- display: table;
- content: " ";
-}
-.clearfix:after,
-.dl-horizontal dd:after,
-.container:after,
-.container-fluid:after,
-.row:after,
-.form-horizontal .form-group:after,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:after,
-.nav:after,
-.navbar:after,
-.navbar-header:after,
-.navbar-collapse:after,
-.pager:after,
-.panel-body:after,
-.modal-footer:after {
- clear: both;
-}
-.center-block {
- display: block;
- margin-right: auto;
- margin-left: auto;
-}
-.pull-right {
- float: right !important;
-}
-.pull-left {
- float: left !important;
-}
-.hide {
- display: none !important;
-}
-.show {
- display: block !important;
-}
-.invisible {
- visibility: hidden;
-}
-.text-hide {
- font: 0/0 a;
- color: transparent;
- text-shadow: none;
- background-color: transparent;
- border: 0;
-}
-.hidden {
- display: none !important;
- visibility: hidden !important;
-}
-.affix {
- position: fixed;
-}
-@-ms-viewport {
- width: device-width;
-}
-.visible-xs,
-.visible-sm,
-.visible-md,
-.visible-lg {
- display: none !important;
-}
-.visible-xs-block,
-.visible-xs-inline,
-.visible-xs-inline-block,
-.visible-sm-block,
-.visible-sm-inline,
-.visible-sm-inline-block,
-.visible-md-block,
-.visible-md-inline,
-.visible-md-inline-block,
-.visible-lg-block,
-.visible-lg-inline,
-.visible-lg-inline-block {
- display: none !important;
-}
-@media (max-width: 767px) {
- .visible-xs {
- display: block !important;
- }
- table.visible-xs {
- display: table;
- }
- tr.visible-xs {
- display: table-row !important;
- }
- th.visible-xs,
- td.visible-xs {
- display: table-cell !important;
- }
-}
-@media (max-width: 767px) {
- .visible-xs-block {
- display: block !important;
- }
-}
-@media (max-width: 767px) {
- .visible-xs-inline {
- display: inline !important;
- }
-}
-@media (max-width: 767px) {
- .visible-xs-inline-block {
- display: inline-block !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm {
- display: block !important;
- }
- table.visible-sm {
- display: table;
- }
- tr.visible-sm {
- display: table-row !important;
- }
- th.visible-sm,
- td.visible-sm {
- display: table-cell !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm-block {
- display: block !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm-inline {
- display: inline !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm-inline-block {
- display: inline-block !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md {
- display: block !important;
- }
- table.visible-md {
- display: table;
- }
- tr.visible-md {
- display: table-row !important;
- }
- th.visible-md,
- td.visible-md {
- display: table-cell !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md-block {
- display: block !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md-inline {
- display: inline !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md-inline-block {
- display: inline-block !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg {
- display: block !important;
- }
- table.visible-lg {
- display: table;
- }
- tr.visible-lg {
- display: table-row !important;
- }
- th.visible-lg,
- td.visible-lg {
- display: table-cell !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg-block {
- display: block !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg-inline {
- display: inline !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg-inline-block {
- display: inline-block !important;
- }
-}
-@media (max-width: 767px) {
- .hidden-xs {
- display: none !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .hidden-sm {
- display: none !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .hidden-md {
- display: none !important;
- }
-}
-@media (min-width: 1200px) {
- .hidden-lg {
- display: none !important;
- }
-}
-.visible-print {
- display: none !important;
-}
-@media print {
- .visible-print {
- display: block !important;
- }
- table.visible-print {
- display: table;
- }
- tr.visible-print {
- display: table-row !important;
- }
- th.visible-print,
- td.visible-print {
- display: table-cell !important;
- }
-}
-.visible-print-block {
- display: none !important;
-}
-@media print {
- .visible-print-block {
- display: block !important;
- }
-}
-.visible-print-inline {
- display: none !important;
-}
-@media print {
- .visible-print-inline {
- display: inline !important;
- }
-}
-.visible-print-inline-block {
- display: none !important;
-}
-@media print {
- .visible-print-inline-block {
- display: inline-block !important;
- }
-}
-@media print {
- .hidden-print {
- display: none !important;
- }
-}
-/*# sourceMappingURL=bootstrap.css.map */
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_catalog.xml b/vendor/github.com/tdewolff/minify/benchmarks/sample_catalog.xml
deleted file mode 100644
index fceb4f49..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_catalog.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
- QWZ5671
- 39.95
-
- Red
- Burgundy
-
-
- Red
- Burgundy
-
-
-
- RRX9856
- 42.50
-
- Red
- Navy
- Burgundy
-
-
- Red
- Navy
- Burgundy
- Black
-
-
- Navy
- Black
-
-
- Burgundy
- Black
-
-
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_dot.js b/vendor/github.com/tdewolff/minify/benchmarks/sample_dot.js
deleted file mode 100644
index 32fd841b..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_dot.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// doT.js
-// 2011-2014, Laura Doktorova, https://github.com/olado/doT
-// Licensed under the MIT license.
-
-(function() {
- "use strict";
-
- var doT = {
- version: "1.0.3",
- templateSettings: {
- evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
- interpolate: /\{\{=([\s\S]+?)\}\}/g,
- encode: /\{\{!([\s\S]+?)\}\}/g,
- use: /\{\{#([\s\S]+?)\}\}/g,
- useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
- define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
- defineParams:/^\s*([\w$]+):([\s\S]+)/,
- conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
- iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
- varname: "it",
- strip: true,
- append: true,
- selfcontained: false,
- doNotSkipEncoded: false
- },
- template: undefined, //fn, compile template
- compile: undefined //fn, for express
- }, _globals;
-
- doT.encodeHTMLSource = function(doNotSkipEncoded) {
- var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" },
- matchHTML = doNotSkipEncoded ? /[&<>\/]/g : /&(?!#?\w+;)|<|>|\//g;
- return function(code) {
- return code ? code.toString().replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : "";
- };
- };
-
- _globals = (function(){ return this || (0,eval)("this"); }());
-
- if (typeof module !== "undefined" && module.exports) {
- module.exports = doT;
- } else if (typeof define === "function" && define.amd) {
- define(function(){return doT;});
- } else {
- _globals.doT = doT;
- }
-
- var startend = {
- append: { start: "'+(", end: ")+'", startencode: "'+encodeHTML(" },
- split: { start: "';out+=(", end: ");out+='", startencode: "';out+=encodeHTML(" }
- }, skip = /$^/;
-
- function resolveDefs(c, block, def) {
- return ((typeof block === "string") ? block : block.toString())
- .replace(c.define || skip, function(m, code, assign, value) {
- if (code.indexOf("def.") === 0) {
- code = code.substring(4);
- }
- if (!(code in def)) {
- if (assign === ":") {
- if (c.defineParams) value.replace(c.defineParams, function(m, param, v) {
- def[code] = {arg: param, text: v};
- });
- if (!(code in def)) def[code]= value;
- } else {
- new Function("def", "def['"+code+"']=" + value)(def);
- }
- }
- return "";
- })
- .replace(c.use || skip, function(m, code) {
- if (c.useParams) code = code.replace(c.useParams, function(m, s, d, param) {
- if (def[d] && def[d].arg && param) {
- var rw = (d+":"+param).replace(/'|\\/g, "_");
- def.__exp = def.__exp || {};
- def.__exp[rw] = def[d].text.replace(new RegExp("(^|[^\\w$])" + def[d].arg + "([^\\w$])", "g"), "$1" + param + "$2");
- return s + "def.__exp['"+rw+"']";
- }
- });
- var v = new Function("def", "return " + code)(def);
- return v ? resolveDefs(c, v, def) : v;
- });
- }
-
- function unescape(code) {
- return code.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, " ");
- }
-
- doT.template = function(tmpl, c, def) {
- c = c || doT.templateSettings;
- var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv,
- str = (c.use || c.define) ? resolveDefs(c, tmpl, def || {}) : tmpl;
-
- str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ")
- .replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""): str)
- .replace(/'|\\/g, "\\$&")
- .replace(c.interpolate || skip, function(m, code) {
- return cse.start + unescape(code) + cse.end;
- })
- .replace(c.encode || skip, function(m, code) {
- needhtmlencode = true;
- return cse.startencode + unescape(code) + cse.end;
- })
- .replace(c.conditional || skip, function(m, elsecase, code) {
- return elsecase ?
- (code ? "';}else if(" + unescape(code) + "){out+='" : "';}else{out+='") :
- (code ? "';if(" + unescape(code) + "){out+='" : "';}out+='");
- })
- .replace(c.iterate || skip, function(m, iterate, vname, iname) {
- if (!iterate) return "';} } out+='";
- sid+=1; indv=iname || "i"+sid; iterate=unescape(iterate);
- return "';var arr"+sid+"="+iterate+";if(arr"+sid+"){var "+vname+","+indv+"=-1,l"+sid+"=arr"+sid+".length-1;while("+indv+"
-
-
-
- ECMAScript Language Specification ECMA-262 6th Edition – DRAFT
-
-
-
-
-
-
This is not the official ECMAScript Language Specification.
-
-
This is a draft of the next edition of the standard. See also:
-
-
-
-
For copyright information, see Ecma International’s legal disclaimer in the document itself.
-
-
-
- Draft
- ECMA-262
- 6th Edition / Draft March 17, 2015
- Ecma/TC39/2015/0XX
-
-
- ECMAScript 2015
- Language Specification
-
- Draft Release Candidate #3
-
- Report Errors and Issues at: https://bugs.ecmascript.org
-
- Product: Draft for 6th Edition
-
- Component: choose an appropriate one
-
- Version: Rev 36, March 17, 2015 Draft
-
-
-
-
-
- Introduction
-
- This is the sixth edition of ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript
- has grown to be one of the world’s most widely used general purpose programming languages. It is best known as the
- language embedded in web browsers but has also been widely adopted for server and embedded applications. The sixth edition is
- the most extensive update to ECMAScript since the publication of the first edition in 1997.
-
- Goals for the sixth edition include providing better support for large applications, library creation, and for use of
- ECMAScript as a compilation target for other languages. Some of its major enhancements include modules, class declarations,
- lexical block scoping, iterators and generators, promises for asynchronous programming, destructuring patterns, and proper tail
- calls. The ECMAScript library of built-ins has been expanded to support additional data abstractions including maps, sets, and
- arrays of binary numeric values as well as additional support for Unicode supplemental characters in strings and regular
- expressions. The built-ins are now extensible via subclassing.
-
- Focused development of the sixth edition started in 2009, as the fifth edition was being prepared for publication. However,
- this was preceded by significant experimentation and language enhancement design efforts dating to the publication of the third
- edition in 1999. In a very real sense, the completion of the sixth edition is the culmination of a fifteen year effort. Dozens
- of individuals representing many organizations have made very significant contributions within TC39 to the development of this
- edition and to the prior editions. In addition, a vibrant informal community has emerged supporting TC39’s ECMAScript
- efforts. This community has reviewed numerous drafts, filed thousands of bug reports, performed implementation experiments,
- contributed test suites, and educated the world-wide developer community about ECMAScript. Unfortunately, it is impossible to
- identify and acknowledge every person and organization who has contributed to this effort.
-
- New uses and requirements for ECMAScript continue to emerge. The sixth edition provides the foundation for regular,
- incremental language and library enhancements.
-
- Allen Wirfs-Brock ECMA-262, 6th Edition Project Editor
-
- This Ecma Standard has been adopted by the General Assembly of <month> <year>.
-
- ECMA-262 Edition History
-
- This Ecma Standard is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript
- (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in that company’s Navigator 2.0
- browser. It has appeared in all subsequent browsers from Netscape and in all browsers from Microsoft starting with Internet
- Explorer 3.0.
-
- The development of this Standard started in November 1996. The first edition of this Ecma Standard was adopted by the Ecma
- General Assembly of June 1997.
-
- That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international
- standard ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 approved the second edition of ECMA-262 to keep it
- fully aligned with ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.
-
- The third edition of the Standard introduced powerful regular expressions, better string handling, new control statements,
- try/catch exception handling, tighter definition of errors, formatting for numeric output and minor changes in anticipation
- future language growth. The third edition of the ECMAScript standard was adopted by the Ecma General Assembly of December 1999
- and published as ISO/IEC 16262:2002 in June 2002.
-
- After publication of the third edition, ECMAScript achieved massive adoption in conjunction with the World Wide Web where it
- has become the programming language that is supported by essentially all web browsers. Significant work was done to develop a
- fourth edition of ECMAScript. However, that work was not completed and not published as the fourth edition of ECMAScript but
- some of it was incorporated into the development of the sixth edition.
-
- The fifth edition of ECMAScript (published as ECMA-262 5th edition) codified de facto interpretations of the
- language specification that have become common among browser implementations and added support for new features that had emerged
- since the publication of the third edition. Such features include accessor properties, reflective creation and inspection of
- objects, program control of property attributes, additional array manipulation functions, support for the JSON object encoding
- format, and a strict mode that provides enhanced error checking and program security. The Fifth Edition was adopted by the Ecma
- General Assembly of December 2009.
-
- The Fifth Edition was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international
- standard ISO/IEC 16262:2011. Edition 5.1 of the ECMAScript Standard incorporated minor corrections and is the same text as
- ISO/IEC 16262:2011. The 5.1 Edition was adopted by the Ecma General Assembly of June 2011.
-
- "DISCLAIMER
-
- This draft document may be copied and furnished to others, and derivative works that comment on or otherwise explain it or
- assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of
- any kind, provided that the above copyright notice and this section are included on all such copies and derivative works.
- However, this document itself may not be modified in any way, including by removing the copyright notice or references to Ecma
- International, except as needed for the purpose of developing any document or deliverable produced by Ecma
- International.
-
- This disclaimer is valid only prior to final version of this document. After approval all rights on the standard are
- reserved by Ecma International.
-
- The limited permissions are granted through the standardization phase and will not be revoked by Ecma International or its
- successors or assigns during this time.
-
- This document and the information contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL DISCLAIMS ALL
- WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
- INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."
-
-
-ECMAScript 2015 Language Specification
-
-
- 1 Scope
-
- This Standard defines the ECMAScript 2015 general purpose programming language.
-
-
-
-
-
- 3 Normative
- references
-
- The following referenced documents are indispensable for the application of this document. For dated references, only the
- edition cited applies. For undated references, the latest edition of the referenced document (including any amendments)
- applies.
-
- IEEE Std 754-2008: IEEE Standard for Floating-Point Arithmetic . Institute of Electrical and
- Electronic Engineers, New York (2008)
-
- ISO/IEC 10646:2003: Information Technology – Universal Multiple-Octet Coded Character Set
- (UCS) plus Amendment 1:2005, Amendment 2:2006, Amendment 3:2008, and Amendment 4:2008 , plus additional amendments and
- corrigenda, or successor
-
- The Unicode Standard, Version 5.0 , as amended by Unicode 5.1.0, or successor.http://www.unicode.org/versions/latest
-
- Unicode Standard Annex #15, Unicode Normalization Forms, version Unicode 5.1.0 , or
- successor.http://www.unicode.org/reports/tr15/
-
- Unicode Standard Annex #31, Unicode Identifiers and Pattern Syntax, version Unicode 5.1.0 , or
- successor. http://www.unicode.org/reports/tr31/
-
- ECMA-402, ECMAScript 2015 Internationalization API Specification .http://www.ecma-international.org/publications/standards/Ecma-402.htm
-
- ECMA-404, The JSON Data Interchange Format .http://www.ecma-international.org/publications/standards/Ecma-404.htm
-
-
-
-
-
4 Overview
-
-
This section contains a non-normative overview of the ECMAScript language.
-
-
ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects
- within a host environment. ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are
- no provisions in this specification for input of external data or output of computed results. Instead, it is expected that the
- computational environment of an ECMAScript program will provide not only the objects and other facilities described in this
- specification but also certain environment-specific objects, whose description and behaviour are beyond the scope of this
- specification except to indicate that they may provide certain properties that can be accessed and certain functions that can
- be called from an ECMAScript program.
-
-
ECMAScript was originally designed to be used as a scripting language, but has become widely used as a general purpose
- programming language. A scripting language is a programming language that is used to manipulate, customize, and
- automate the facilities of an existing system. In such systems, useful functionality is already available through a user
- interface, and the scripting language is a mechanism for exposing that functionality to program control. In this way, the
- existing system is said to provide a host environment of objects and facilities, which completes the capabilities of the
- scripting language. A scripting language is intended for use by both professional and non-professional programmers.
-
-
ECMAScript was originally designed to be a Web scripting language , providing a mechanism to enliven Web pages
- in browsers and to perform server computation as part of a Web-based client-server architecture. ECMAScript is now used to
- provide core scripting capabilities for a variety of host environments. Therefore the core language is specified in this
- document apart from any particular host environment.
-
-
ECMAScript usage has moved beyond simple scripting and it is now used for the full spectrum of programming tasks in many
- different environments and scales. As the usage of ECMAScript has expanded, so has the features and facilities it provides.
- ECMAScript is now a fully featured general propose programming language.
-
-
Some of the facilities of ECMAScript are similar to those used in other programming languages; in particular C,
- Java™, Self, and Scheme as described in:
-
-
ISO/IEC 9899:1996, Programming Languages – C.
-
-
Gosling, James, Bill Joy and Guy Steele. The Java™ Language
- Specification . Addison Wesley Publishing Co., 1996.
-
-
Ungar, David, and Smith, Randall B. Self: The Power of Simplicity .
- OOPSLA '87 Conference Proceedings, pp. 227–241, Orlando, FL, October 1987.
-
-
IEEE Standard for the Scheme Programming Language . IEEE Std
- 1178-1990.
-
-
-
- 4.1 Web
- Scripting
-
- A web browser provides an ECMAScript host environment for client-side computation including, for instance, objects that
- represent windows, menus, pop-ups, dialog boxes, text areas, anchors, frames, history, cookies, and input/output. Further, the
- host environment provides a means to attach scripting code to events such as change of focus, page and image loading,
- unloading, error and abort, selection, form submission, and mouse actions. Scripting code appears within the HTML and the
- displayed page is a combination of user interface elements and fixed and computed text and images. The scripting code is
- reactive to user interaction and there is no need for a main program.
-
- A web server provides a different host environment for server-side computation including objects representing requests,
- clients, and files; and mechanisms to lock and share data. By using browser-side and server-side scripting together, it is
- possible to distribute computation between the client and server while providing a customized user interface for a Web-based
- application.
-
- Each Web browser and server that supports ECMAScript supplies its own host environment, completing the ECMAScript execution
- environment.
-
-
-
-
-
4.2
- ECMAScript Overview
-
-
The following is an informal overview of ECMAScript—not all parts of the language are described. This overview is
- not part of the standard proper.
-
-
ECMAScript is object-based: basic language and host facilities are provided by objects, and an ECMAScript program is a
- cluster of communicating objects. In ECMAScript, an object is a collection of zero or more
- properties each with attributes that determine how each property can be used—for example,
- when the Writable attribute for a property is set to false , any attempt by executed ECMAScript code to assign a
- different value to the property fails. Properties are containers that hold other objects, primitive values , or
- functions . A primitive value is a member of one of the following built-in types: Undefined ,
- Null , Boolean , Number , String, and Symbol; an object is a member of the built-in type
- Object ; and a function is a callable object. A function that is associated with an object via a property is called a
- method .
-
-
ECMAScript defines a collection of built-in objects that round out the definition of ECMAScript entities.
- These built-in objects include the global object; objects that are fundamental to the runtime semantics of the language
- including Object , Function , Boolean , Symbol , and various Error objects; objects that
- represent and manipulate numeric values including Math , Number , and Date ; the text processing objects
- String and RegExp ; objects that are indexed collections of values including Array and nine different
- kinds of Typed Arrays whose elements all have a specific numeric data representation; keyed collections including Map
- and Set objects; objects supporting structured data including the JSON object, ArrayBuffer , and
- DataView ; objects supporting control abstractions including generator functions and Promise objects;
- and, reflection objects including Proxy and Reflect .
-
-
ECMAScript also defines a set of built-in operators . ECMAScript operators include various unary operations,
- multiplicative operators, additive operators, bitwise shift operators, relational operators, equality operators, binary
- bitwise operators, binary logical operators, assignment operators, and the comma operator.
-
-
Large ECMAScript programs are supported by modules which allow a program to be divided into multiple
- sequences of statements and declarations. Each module explicitly identifies declarations it uses that need to be provided by
- other modules and which of its declarations are available for use by other modules.
-
-
ECMAScript syntax intentionally resembles Java syntax. ECMAScript syntax is relaxed to enable it to serve as an
- easy-to-use scripting language. For example, a variable is not required to have its type declared nor are types associated
- with properties, and defined functions are not required to have their declarations appear textually before calls to
- them.
-
-
-
-
-
- Even though ECMAScript includes syntax for class definitions, ECMAScript objects are not fundamentally class-based such
- as those in C++, Smalltalk, or Java. Instead objects may be created in various ways including via a literal notation or via
- constructors which create objects and then execute code that initializes all or part of them by assigning
- initial values to their properties. Each constructor is a function that has a property named "prototype"
that
- is used to implement prototype-based inheritance and shared properties . Objects are created by
- using constructors in new expressions; for example, new Date(2009,11)
creates a new Date object.
- Invoking a constructor without using new has consequences that depend on the constructor. For example,
- Date()
produces a string representation of the current date and time rather than an object.
-
- Every object created by a constructor has an implicit reference (called the object’s prototype ) to the value
- of its constructor’s "prototype"
property. Furthermore, a prototype may have a non-null implicit
- reference to its prototype, and so on; this is called the prototype chain . When a reference is made to a property in
- an object, that reference is to the property of that name in the first object in the prototype chain that contains a
- property of that name. In other words, first the object mentioned directly is examined for such a property; if that object
- contains the named property, that is the property to which the reference refers; if that object does not contain the named
- property, the prototype for that object is examined next; and so on.
-
-
-
-
-
- Figure 1 — Object/Prototype Relationships
-
-
- In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and
- inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while
- structure, behaviour, and state are all inherited.
-
- All objects that do not directly contain a particular property that their prototype contains share that property and its
- value. Figure 1 illustrates this:
-
- CF is a constructor (and also an object). Five objects have been created by using new
expressions:
- cf1 , cf2 , cf3 , cf4 , and cf5 . Each
- of these objects contains properties named q1
and q2
. The dashed lines represent the implicit
- prototype relationship; so, for example, cf3 ’s prototype is CFp . The constructor,
- CF , has two properties itself, named P1
and P2
, which are not visible to
- CFp , cf1 , cf2 , cf3 , cf4 , or
- cf5 . The property named CFP1
in CFp is shared by cf1 ,
- cf2 , cf3 , cf4 , and cf5 (but not by CF ), as
- are any properties found in CFp ’s implicit prototype chain that are not named q1
,
- q2
, or CFP1
. Notice that there is no implicit prototype link between CF and
- CFp .
-
- Unlike most class-based object languages, properties can be added to objects dynamically by assigning values to them.
- That is, constructors are not required to name or assign values to all or any of the constructed object’s properties.
- In the above diagram, one could add a new shared property for cf1 , cf2 ,
- cf3 , cf4 , and cf5 by assigning a new value to the property in
- CFp .
-
- Although ECMAScript objects are not inherently class-based, it is often convenient to define class-like abstractions
- based upon a common pattern of constructor functions, prototype objects, and methods. The ECMAScript built-in objects
- themselves follow such a class-like pattern. Beginning with the sixth edition, the ECMAScript language includes syntactic
- class definitions that permit programmers to concisely define objects that conform to the same class-like abstraction
- pattern used by the built-in objects.
-
-
-
- 4.2.2 The Strict Variant of ECMAScript
-
- The ECMAScript Language recognizes the possibility that some users of the language may wish to restrict their usage of
- some features available in the language. They might do so in the interests of security, to avoid what they consider to be
- error-prone features, to get enhanced error checking, or for other reasons of their choosing. In support of this
- possibility, ECMAScript defines a strict variant of the language. The strict variant of the language excludes some specific
- syntactic and semantic features of the regular ECMAScript language and modifies the detailed semantics of some features. The
- strict variant also specifies additional error conditions that must be reported by throwing error exceptions in situations
- that are not specified as errors by the non-strict form of the language.
-
- The strict variant of ECMAScript is commonly referred to as the strict mode of the language. Strict mode selection
- and use of the strict mode syntax and semantics of ECMAScript is explicitly made at the level of individual ECMAScript
- source text units. Because strict mode is selected at the level of a syntactic source text unit, strict mode only imposes
- restrictions that have local effect within such a source text unit. Strict mode does not restrict or modify any aspect of
- the ECMAScript semantics that must operate consistently across multiple source text units. A complete ECMAScript program may
- be composed of both strict mode and non-strict mode ECMAScript source text units. In this case, strict mode only applies
- when actually executing code that is defined within a strict mode source text unit.
-
- In order to conform to this specification, an ECMAScript implementation must implement both the full unrestricted
- ECMAScript language and the strict variant of the ECMAScript language as defined by this specification. In addition, an
- implementation must support the combination of unrestricted and strict mode source text units into a single composite
- program.
-
-
-
-
-
-
4.3 Terms
- and definitions
-
-
For the purposes of this document, the following terms and definitions apply.
-
-
-
-
-
- set of data values as defined in clause 6 of this specification
-
-
-
- 4.3.2
- primitive value
-
- member of one of the types Undefined, Null, Boolean, Number, Symbol, or String as defined in clause 6
-
-
-
NOTE A primitive value is a datum that is represented directly at the lowest level of the
- language implementation.
-
-
-
-
-
-
- member of the type Object
-
-
-
NOTE An object is a collection of properties and has a single prototype object. The prototype
- may be the null value.
-
-
-
-
- 4.3.4
- constructor
-
- function object that creates and initializes objects
-
-
-
NOTE The value of a constructor’s prototype
property is a prototype object
- that is used to implement inheritance and shared properties.
-
-
-
-
-
-
- object that provides shared properties for other objects
-
-
-
NOTE When a constructor creates an object, that object implicitly references the
- constructor’s prototype
property for the purpose of resolving property references. The
- constructor’s prototype
property can be referenced by the program expression
- constructor .prototype
, and properties added to an object’s prototype are shared, through
- inheritance, by all objects sharing the prototype. Alternatively, a new object may be created with an explicitly specified
- prototype by using the Object.create
built-in function.
-
-
-
-
- 4.3.6
- ordinary object
-
- object that has the default behaviour for the essential internal methods that must be supported by all objects.
-
-
-
- 4.3.7 exotic
- object
-
- object that does not have the default behaviour for one or more of the essential internal methods that must be supported
- by all objects.
-
-
-
NOTE Any object that is not an ordinary object is an exotic object.
-
-
-
-
- 4.3.8
- standard object
-
- object whose semantics are defined by this specification
-
-
-
- 4.3.9
- built-in object
-
- object specified and supplied by an ECMAScript implementation
-
-
-
NOTE Standard built-in objects are defined in this specification. An ECMAScript implementation
- may specify and supply additional kinds of built-in objects. A built-in constructor is a built-in object that is
- also a constructor.
-
-
-
-
- 4.3.10
- undefined value
-
- primitive value used when a variable has not been assigned a value
-
-
-
- 4.3.11 Undefined type
-
- type whose sole value is the undefined value
-
-
-
- 4.3.12 null
- value
-
- primitive value that represents the intentional absence of any object value
-
-
-
-
-
- type whose sole value is the null value
-
-
-
- 4.3.14 Boolean value
-
- member of the Boolean type
-
-
-
NOTE There are only two Boolean values, true and false
-
-
-
-
- 4.3.15 Boolean type
-
- type consisting of the primitive values true and false
-
-
-
- 4.3.16
- Boolean object
-
- member of the Object type that is an instance of the standard built-in Boolean
constructor
-
-
-
NOTE A Boolean object is created by using the Boolean
constructor in a
- new
expression, supplying a Boolean value as an argument. The resulting object has an internal slot whose value is the Boolean value. A Boolean
- object can be coerced to a Boolean value.
-
-
-
-
- 4.3.17 String value
-
- primitive value that is a finite ordered sequence of zero or more 16-bit unsigned integer
-
-
-
NOTE A String value is a member of the String type. Each integer value in the sequence usually
- represents a single 16-bit unit of UTF-16 text. However, ECMAScript does not place any restrictions or requirements on the
- values except that they must be 16-bit unsigned integers.
-
-
-
-
-
-
- set of all possible String values
-
-
-
- 4.3.19 String
- object
-
- member of the Object type that is an instance of the standard built-in String
constructor
-
-
-
NOTE A String object is created by using the String
constructor in a
- new
expression, supplying a String value as an argument. The resulting object has an internal slot whose value is the String value. A String object
- can be coerced to a String value by calling the String
constructor as a function (21.1.1.1 ).
-
-
-
-
- 4.3.20 Number value
-
- primitive value corresponding to a double-precision 64-bit binary format IEEE 754 value
-
-
-
NOTE A Number value is a member of the Number type and is a direct representation of a
- number.
-
-
-
-
-
-
- set of all possible Number values including the special “Not-a-Number” (NaN) value, positive infinity, and
- negative infinity
-
-
-
- 4.3.22 Number
- object
-
- member of the Object type that is an instance of the standard built-in Number
constructor
-
-
-
NOTE A Number object is created by using the Number
constructor in a
- new
expression, supplying a Number value as an argument. The resulting object has an internal slot whose value is the Number value. A Number object
- can be coerced to a Number value by calling the Number
constructor as a function (20.1.1.1 ).
-
-
-
-
-
-
- number value that is the positive infinite Number value
-
-
-
-
-
- number value that is an IEEE 754 “Not-a-Number” value
-
-
-
- 4.3.25 Symbol
- value
-
- primitive value that represents a unique, non-String Object property key
-
-
-
-
-
- set of all possible Symbol values
-
-
-
- 4.3.27 Symbol
- object
-
- member of the Object type that is an instance of the standard built-in Symbol
constructor
-
-
-
-
-
- member of the Object type that may be invoked as a subroutine
-
-
-
NOTE In addition to its properties, a function contains executable code and state that
- determine how it behaves when invoked. A function’s code may or may not be written in ECMAScript.
-
-
-
-
- 4.3.29
- built-in function
-
- built-in object that is a function
-
-
-
NOTE Examples of built-in functions include parseInt
and Math.exp
. An implementation may provide implementation-dependent built-in functions that
- are not described in this specification.
-
-
-
-
-
-
- part of an object that associates a key (either a String value or a Symbol value) and a value.
-
-
-
NOTE Depending upon the form of the property the value may be represented either directly as a
- data value (a primitive value, an object, or a function object) or indirectly by a pair of accessor functions.
-
-
-
-
-
-
- function that is the value of a property
-
-
-
NOTE When a function is called as a method of an object, the object is passed to the function
- as its this value.
-
-
-
-
- 4.3.32
- built-in method
-
- method that is a built-in function
-
-
-
NOTE Standard built-in methods are defined in this specification, and an ECMAScript
- implementation may specify and provide other additional built-in methods.
-
-
-
-
-
-
- internal value that defines some characteristic of a property
-
-
-
- 4.3.34 own
- property
-
- property that is directly contained by its object
-
-
-
- 4.3.35
- inherited property
-
- property of an object that is not an own property but is a property (either own or inherited) of the object’s
- prototype
-
-
-
-
- 4.4 Organization of This Specification
-
- The remainder of this specification is organized as follows:
-
- Clause 5 defines the notational conventions used throughout the specification.
-
- Clauses 6−9 define the execution environment within which ECMAScript programs operate.
-
- Clauses 10−16 define the actual ECMAScript programming language including its syntactic encoding and the execution
- semantics of all language features.
-
- Clauses 17−26 define the ECMAScript standard library. It includes the definitions of all of the standard objects that
- are available for use by ECMAScript programs as they execute.
-
-
-
-
-
-
5 Notational
- Conventions
-
-
-
-
-
5.1 Syntactic and Lexical Grammars
-
-
-
- 5.1.1
- Context-Free Grammars
-
- A context-free grammar consists of a number of productions . Each production has an abstract symbol called a
- nonterminal as its left-hand side , and a sequence of zero or more nonterminal and terminal symbols as
- its right-hand side . For each grammar, the terminal symbols are drawn from a specified alphabet.
-
- A chain production is a production that has exactly one nonterminal symbol on its right-hand side along with zero
- or more terminal symbols.
-
- Starting from a sentence consisting of a single distinguished nonterminal, called the goal symbol , a given
- context-free grammar specifies a language , namely, the (perhaps infinite) set of possible sequences of terminal
- symbols that can result from repeatedly replacing any nonterminal in the sequence with a right-hand side of a production for
- which the nonterminal is the left-hand side.
-
-
-
- 5.1.2 The Lexical and RegExp Grammars
-
- A lexical grammar for ECMAScript is given in clause 11 .
- This grammar has as its terminal symbols Unicode code points that conform to the rules for SourceCharacter defined in 10.1 . It defines a set of productions, starting
- from the goal symbol InputElementDiv, InputElementTemplateTail, or InputElementRegExp , or InputElementRegExpOrTemplateTail, that describe how sequences of such
- code points are translated into a sequence of input elements.
-
- Input elements other than white space and comments form the terminal symbols for the syntactic grammar for ECMAScript and
- are called ECMAScript tokens . These tokens are the reserved words, identifiers, literals, and punctuators of the
- ECMAScript language. Moreover, line terminators, although not considered to be tokens, also become part of the stream of
- input elements and guide the process of automatic semicolon insertion (11.9 ). Simple white space and single-line comments are discarded and do not
- appear in the stream of input elements for the syntactic grammar. A MultiLineComment (that is, a
- comment of the form /*
…*/
regardless of whether it spans more than one line) is likewise
- simply discarded if it contains no line terminator; but if a MultiLineComment contains one or more
- line terminators, then it is replaced by a single line terminator, which becomes part of the stream of input elements for
- the syntactic grammar.
-
- A RegExp grammar for ECMAScript is given in 21.2.1 . This grammar also has as its
- terminal symbols the code points as defined by SourceCharacter . It defines a set of productions,
- starting from the goal symbol Pattern , that describe how sequences of code points are translated
- into regular expression patterns.
-
- Productions of the lexical and RegExp grammars are distinguished by having two colons “:: ” as
- separating punctuation. The lexical and RegExp grammars share some productions.
-
-
-
- 5.1.3
- The Numeric String Grammar
-
- Another grammar is used for translating Strings into numeric values. This grammar is similar to the part of the lexical
- grammar having to do with numeric literals and has as its terminal symbols SourceCharacter . This
- grammar appears in 7.1.3.1 .
-
- Productions of the numeric string grammar are distinguished by having three colons “::: ” as
- punctuation.
-
-
-
- 5.1.4 The
- Syntactic Grammar
-
- The syntactic grammar for ECMAScript is given in clauses 11, 12, 13, 14, and 15. This grammar has ECMAScript
- tokens defined by the lexical grammar as its terminal symbols (5.1.2 ). It
- defines a set of productions, starting from two alternative goal symbols Script and Module , that describe how sequences of tokens form syntactically correct independent components of
- ECMAScript programs.
-
- When a stream of code points is to be parsed as an ECMAScript Script or Module , it is first converted to a stream of input elements by repeated application of the lexical
- grammar; this stream of input elements is then parsed by a single application of the syntactic grammar. The input stream is
- syntactically in error if the tokens in the stream of input elements cannot be parsed as a single instance of the goal
- nonterminal (Script or Module ), with no tokens left over.
-
- Productions of the syntactic grammar are distinguished by having just one colon “: ” as
- punctuation.
-
- The syntactic grammar as presented in clauses 12, 13, 14 and 15 is not a complete account of which token sequences are
- accepted as a correct ECMAScript Script or Module . Certain additional token
- sequences are also accepted, namely, those that would be described by the grammar if only semicolons were added to the
- sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences that are
- described by the grammar are not considered acceptable if a line terminator character appears in certain
- “awkward” places.
-
- In certain cases in order to avoid ambiguities the syntactic grammar uses generalized productions that permit token
- sequences that do not form a valid ECMAScript Script or Module . For example,
- this technique is used for object literals and object destructuring patterns. In such cases a more restrictive
- supplemental grammar is provided that further restricts the acceptable token sequences. In certain contexts, when
- explicitly specified, the input elements corresponding to such a production are parsed again using a goal symbol of a
- supplemental grammar. The input stream is syntactically in error if the tokens in the stream of input elements parsed by a
- cover grammar cannot be parsed as a single instance of the corresponding supplemental goal symbol, with no tokens left
- over.
-
-
-
- 5.1.5
- Grammar Notation
-
- Terminal symbols of the lexical, RegExp, and numeric string grammars are shown in fixed width
font, both in
- the productions of the grammars and throughout this specification whenever the text directly refers to such a terminal
- symbol. These are to appear in a script exactly as written. All terminal symbol code points specified in this way are to be
- understood as the appropriate Unicode code points from the Basic Latin range, as opposed to any similar-looking code points
- from other Unicode ranges.
-
- Nonterminal symbols are shown in italic type. The definition of a nonterminal (also called a
- “production”) is introduced by the name of the nonterminal being defined followed by one or more colons. (The
- number of colons indicates to which grammar the production belongs.) One or more alternative right-hand sides for the
- nonterminal then follow on succeeding lines. For example, the syntactic definition:
-
-
-
WhileStatement :
-
while
(
Expression )
Statement
-
-
- states that the nonterminal WhileStatement represents the token while
, followed by a
- left parenthesis token, followed by an Expression , followed by a right parenthesis token, followed
- by a Statement . The occurrences of Expression and Statement are themselves nonterminals. As another example, the syntactic definition:
-
-
-
ArgumentList :
-
AssignmentExpression
-
ArgumentList ,
AssignmentExpression
-
-
- states that an ArgumentList may represent either a single AssignmentExpression or an ArgumentList , followed by a comma, followed by an AssignmentExpression . This definition of ArgumentList is recursive, that is, it is
- defined in terms of itself. The result is that an ArgumentList may contain any positive number of
- arguments, separated by commas, where each argument expression is an AssignmentExpression . Such
- recursive definitions of nonterminals are common.
-
- The subscripted suffix “opt ”, which may appear after a terminal or nonterminal, indicates an
- optional symbol. The alternative containing the optional symbol actually specifies two right-hand sides, one that omits the
- optional element and one that includes it. This means that:
-
-
-
VariableDeclaration :
-
BindingIdentifier Initializer opt
-
-
- is a convenient abbreviation for:
-
-
-
VariableDeclaration :
-
BindingIdentifier
-
BindingIdentifier Initializer
-
-
- and that:
-
-
-
IterationStatement :
-
for
(
LexicalDeclaration Expression opt ;
Expression opt )
Statement
-
-
- is a convenient abbreviation for:
-
-
-
IterationStatement :
-
for
(
LexicalDeclaration ;
Expression opt )
Statement
-
for
(
LexicalDeclaration Expression ;
Expression opt )
Statement
-
-
- which in turn is an abbreviation for:
-
-
-
IterationStatement :
-
for
(
LexicalDeclaration ;
)
Statement
-
for
(
LexicalDeclaration ;
Expression )
Statement
-
for
(
LexicalDeclaration Expression ;
)
Statement
-
for
(
LexicalDeclaration Expression ;
Expression )
Statement
-
-
- so, in this example, the nonterminal IterationStatement actually has four alternative right-hand
- sides.
-
- A production may be parameterized by a subscripted annotation of the form “[parameters] ”, which
- may appear as a suffix to the nonterminal symbol defined by the production. “parameters ” may be
- either a single name or a comma separated list of names. A parameterized production is shorthand for a set of productions
- defining all combinations of the parameter names, preceded by an underscore, appended to the parameterized nonterminal
- symbol. This means that:
-
-
-
StatementList [Return] :
-
ReturnStatement
-
ExpressionStatement
-
-
- is a convenient abbreviation for:
-
-
-
StatementList :
-
ReturnStatement
-
ExpressionStatement
-
-
-
-
StatementList_Return :
-
ReturnStatement
-
ExpressionStatement
-
-
- and that:
-
-
-
StatementList [Return, In] :
-
ReturnStatement
-
ExpressionStatement
-
-
- is an abbreviation for:
-
-
-
StatementList :
-
ReturnStatement
-
ExpressionStatement
-
-
-
-
StatementList_Return :
-
ReturnStatement
-
ExpressionStatement
-
-
-
-
StatementList_In :
-
ReturnStatement
-
ExpressionStatement
-
-
-
-
StatementList_Return_In :
-
ReturnStatement
-
ExpressionStatement
-
-
- Multiple parameters produce a combinatory number of productions, not all of which are necessarily referenced in a
- complete grammar.
-
- References to nonterminals on the right-hand side of a production can also be parameterized. For example:
-
-
-
StatementList :
-
ReturnStatement
-
ExpressionStatement [In]
-
-
- is equivalent to saying:
-
-
-
StatementList :
-
ReturnStatement
-
ExpressionStatement_In
-
-
- A nonterminal reference may have both a parameter list and an “opt ” suffix. For example:
-
-
-
VariableDeclaration :
-
BindingIdentifier Initializer [In] opt
-
-
- is an abbreviation for:
-
-
-
VariableDeclaration :
-
BindingIdentifier
-
BindingIdentifier Initializer_In
-
-
- Prefixing a parameter name with “? ” on a right-hand side nonterminal reference makes that
- parameter value dependent upon the occurrence of the parameter name on the reference to the current production’s
- left-hand side symbol. For example:
-
-
-
VariableDeclaration [In] :
-
BindingIdentifier Initializer [?In]
-
-
- is an abbreviation for:
-
-
-
VariableDeclaration :
-
BindingIdentifier Initializer
-
-
-
-
VariableDeclaration_In :
-
BindingIdentifier Initializer_In
-
-
- If a right-hand side alternative is prefixed with “[+parameter]” that alternative is only available if the
- named parameter was used in referencing the production’s nonterminal symbol. If a right-hand side alternative is
- prefixed with “[~parameter]” that alternative is only available if the named parameter was not used in
- referencing the production’s nonterminal symbol. This means that:
-
-
-
StatementList [Return] :
-
[+Return] ReturnStatement
-
ExpressionStatement
-
-
- is an abbreviation for:
-
-
-
StatementList :
-
ExpressionStatement
-
-
-
-
StatementList_Return :
-
ReturnStatement
-
ExpressionStatement
-
-
- and that
-
-
-
StatementList [Return] :
-
[~Return] ReturnStatement
-
ExpressionStatement
-
-
- is an abbreviation for:
-
-
-
StatementList :
-
ReturnStatement
-
ExpressionStatement
-
-
-
-
StatementList_Return :
-
ExpressionStatement
-
-
- When the words “one of ” follow the colon(s) in a grammar definition, they signify that each of the
- terminal symbols on the following line or lines is an alternative definition. For example, the lexical grammar for
- ECMAScript contains the production:
-
-
-
NonZeroDigit :: one of
-
1
2
3
4
5
6
7
8
9
-
-
- which is merely a convenient abbreviation for:
-
-
-
NonZeroDigit ::
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
-
- If the phrase “[empty]” appears as the right-hand side of a production, it indicates that the production's
- right-hand side contains no terminals or nonterminals.
-
- If the phrase “[lookahead ∉ set ]” appears in the right-hand side of a production, it
- indicates that the production may not be used if the immediately following input token is a member of the given
- set . The set can be written as a list of terminals enclosed in curly brackets. For convenience, the
- set can also be written as a nonterminal, in which case it represents the set of all terminals to which that nonterminal
- could expand. If the set consists of a single terminal the phrase “[lookahead ≠
- terminal ]” may be used.
-
- For example, given the definitions
-
-
-
DecimalDigit :: one of
-
0
1
2
3
4
5
6
7
8
9
-
-
-
-
DecimalDigits ::
-
DecimalDigit
-
DecimalDigits DecimalDigit
-
-
- the definition
-
-
-
LookaheadExample ::
-
n
[lookahead ∉ {1
, 3
, 5
, 7
, 9
}] DecimalDigits
-
DecimalDigit [lookahead ∉ DecimalDigit ]
-
-
- matches either the letter n
followed by one or more decimal digits the first of which is even, or a decimal
- digit not followed by another decimal digit.
-
- If the phrase “[no LineTerminator here]” appears in the right-hand side of a
- production of the syntactic grammar, it indicates that the production is a restricted production : it may not be used
- if a LineTerminator occurs in the input stream at the indicated position. For example, the
- production:
-
-
-
ThrowStatement :
-
throw
[no LineTerminator here] Expression ;
-
-
- indicates that the production may not be used if a LineTerminator occurs in the script between
- the throw
token and the Expression .
-
- Unless the presence of a LineTerminator is forbidden by a restricted production, any number of
- occurrences of LineTerminator may appear between any two consecutive tokens in the stream of input
- elements without affecting the syntactic acceptability of the script.
-
- When an alternative in a production of the lexical grammar or the numeric string grammar appears to be a multi-code point
- token, it represents the sequence of code points that would make up such a token.
-
- The right-hand side of a production may specify that certain expansions are not permitted by using the phrase
- “but not ” and then indicating the expansions to be excluded. For example, the production:
-
-
-
Identifier ::
-
IdentifierName but not ReservedWord
-
-
- means that the nonterminal Identifier may be replaced by any sequence of code points that could
- replace IdentifierName provided that the same sequence of code points could not replace ReservedWord .
-
- Finally, a few nonterminal symbols are described by a descriptive phrase in sans-serif type in cases where it would be
- impractical to list all the alternatives:
-
-
-
SourceCharacter ::
-
any Unicode code point
-
-
-
-
-
- 5.2
- Algorithm Conventions
-
- The specification often uses a numbered list to specify steps in an algorithm. These algorithms are used to precisely
- specify the required semantics of ECMAScript language constructs. The algorithms are not intended to imply the use of any
- specific implementation technique. In practice, there may be more efficient algorithms available to implement a given
- feature.
-
- Algorithms may be explicitly parameterized, in which case the names and usage of the parameters must be provided as part of
- the algorithm’s definition. In order to facilitate their use in multiple parts of this specification, some algorithms,
- called abstract operations , are named and written in parameterized functional form so that they may be
- referenced by name from within other algorithms. Abstract operations are typically referenced using a functional application
- style such as operationName(arg1 , arg2 ) . Some abstract
- operations are treated as polymorphically dispatched methods of class-like specification abstractions. Such method-like
- abstract operations are typically referenced using a method application style such as someValue .operationName(arg1 , arg2 ) .
-
- Algorithms may be associated with productions of one of the ECMAScript grammars. A production that has multiple alternative
- definitions will typically have a distinct algorithm for each alternative. When an algorithm is associated with a grammar
- production, it may reference the terminal and nonterminal symbols of the production alternative as if they were parameters of
- the algorithm. When used in this manner, nonterminal symbols refer to the actual alternative definition that is matched when
- parsing the source text.
-
- When an algorithm is associated with a production alternative, the alternative is typically shown without any “[
- ]” grammar annotations. Such annotations should only affect the syntactic recognition of the alternative and have no
- effect on the associated semantics for the alternative.
-
- Unless explicitly specified otherwise, all chain productions have an implicit
- definition for every algorithm that might be applied to that production’s left-hand side nonterminal. The implicit
- definition simply reapplies the same algorithm name with the same parameters, if any, to the chain production ’s sole right-hand side nonterminal and then returns the result.
- For example, assume there is a production:
-
-
-
Block :
-
{
StatementList }
-
-
- but there is no corresponding Evaluation algorithm that is explicitly specified for that production. If in some algorithm
- there is a statement of the form: “Return the result of evaluating
- Block ” it is implicit that an Evaluation algorithm exists of the form:
-
- Runtime Semantics: Evaluation
-
- Block : {
StatementList }
-
- Return the result of evaluating StatementList .
-
-
- For clarity of expression, algorithm steps may be subdivided into sequential substeps. Substeps are indented and may
- themselves be further divided into indented substeps. Outline numbering conventions are used to identify substeps with the
- first level of substeps labelled with lower case alphabetic characters and the second level of substeps labelled with lower
- case roman numerals. If more than three levels are required these rules repeat with the fourth level using numeric labels. For
- example:
-
-
- Top-level step
-
- Substep.
- Substep.
-
- Subsubstep.
-
- Subsubsubstep
-
- Subsubsubsubstep
-
- Subsubsubsubsubstep
-
-
-
-
-
-
-
-
-
-
-
-
- A step or substep may be written as an “if” predicate that conditions its substeps. In this case, the substeps
- are only applied if the predicate is true. If a step or substep begins with the word “else”, it is a predicate
- that is the negation of the preceding “if” predicate step at the same level.
-
- A step may specify the iterative application of its substeps.
-
- A step that begins with “Assert:” asserts an invariant condition of its algorithm. Such assertions are used to
- make explicit algorithmic invariants that would otherwise be implicit. Such assertions add no additional semantic requirements
- and hence need not be checked by an implementation. They are used simply to clarify algorithms.
-
- Mathematical operations such as addition, subtraction, negation, multiplication, division, and the mathematical functions
- defined later in this clause should always be understood as computing exact mathematical results on mathematical real numbers,
- which unless otherwise noted do not include infinities and do not include a negative zero that is distinguished from positive
- zero. Algorithms in this standard that model floating-point arithmetic include explicit steps, where necessary, to handle
- infinities and signed zero and to perform rounding. If a mathematical operation or function is applied to a floating-point
- number, it should be understood as being applied to the exact mathematical value represented by that floating-point number;
- such a floating-point number must be finite, and if it is +0 or −0
- then the corresponding mathematical value is simply 0 .
-
- The mathematical function abs(x ) produces the absolute value of
- x , which is −x if x is negative (less
- than zero) and otherwise is x itself.
-
- The mathematical function sign(x ) produces 1 if x is positive and −1 if x is negative. The sign function is not used in this standard for cases when x
- is zero.
-
- The mathematical function min(x 1 , x 2 , ..., x n ) produces the mathematically
- smallest of x 1 through x n . The mathematical function max(x 1 , x 2 , ...,
- x n ) produces the mathematically largest of x 1 through x n . The domain
- and range of these mathematical functions include +∞ and −∞ .
-
- The notation “x modulo y ” (y must be
- finite and nonzero) computes a value k of the same sign as y (or zero) such that abs(k ) < abs(y ) and x −k = q × y for some integer q .
-
- The mathematical function floor(x ) produces the largest integer
- (closest to positive infinity) that is not larger than x .
-
-
-
NOTE floor(x ) = x −(x modulo 1).
-
-
-
-
- 5.3 Static
- Semantic Rules
-
- Context-free grammars are not sufficiently powerful to express all the rules that define whether a stream of input elements
- form a valid ECMAScript Script or Module that may be evaluated. In some
- situations additional rules are needed that may be expressed using either ECMAScript algorithm conventions or prose
- requirements. Such rules are always associated with a production of a grammar and are called the static semantics of
- the production.
-
- Static Semantic Rules have names and typically are defined using an algorithm. Named Static Semantic Rules are associated
- with grammar productions and a production that has multiple alternative definitions will typically have for each alternative a
- distinct algorithm for each applicable named static semantic rule.
-
- Unless otherwise specified every grammar production alternative in this specification implicitly has a definition for a
- static semantic rule named Contains which takes an argument named
- symbol whose value is a terminal or nonterminal of the grammar that includes the associated production. The default
- definition of Contains is:
-
-
- For each terminal and nonterminal grammar symbol, sym , in the definition of this production do
-
- If sym is the same grammar symbol as symbol , return true .
- If sym is a nonterminal, then
-
- Let contained be the result of sym Contains symbol .
- If contained is true , return true .
-
-
-
-
- Return false .
-
-
- The above definition is explicitly over-ridden for specific productions.
-
- A special kind of static semantic rule is an Early Error Rule. Early error rules define early error conditions (see clause 16 ) that are associated with specific grammar productions.
- Evaluation of most early error rules are not explicitly invoked within the algorithms of this specification. A conforming
- implementation must, prior to the first evaluation of a Script , validate all of the early error rules
- of the productions used to parse that Script . If any of the early error rules are violated the Script is invalid and cannot be evaluated.
-
-
-
-
-
-
6
- ECMAScript Data Types and Values
-
-
Algorithms within this specification manipulate values each of which has an associated type. The possible value types are
- exactly those defined in this clause. Types are further subclassified into ECMAScript language types and specification
- types.
-
-
Within this specification, the notation “Type(x ) ” is
- used as shorthand for “the type of x ” where “type ” refers to the ECMAScript language and specification types defined in
- this clause. When the term “empty” is used as if it was naming a value, it is equivalent to saying “no value
- of any type”.
-
-
-
-
-
6.1
- ECMAScript Language Types
-
-
An ECMAScript language type corresponds to values that are directly manipulated by an ECMAScript programmer using the
- ECMAScript language. The ECMAScript language types are Undefined, Null, Boolean, String, Symbol, Number, and Object. An
- ECMAScript language value is a value that is characterized by an ECMAScript language type.
-
-
-
- 6.1.1 The Undefined Type
-
- The Undefined type has exactly one value, called undefined . Any variable that has not been assigned a value has
- the value undefined .
-
-
-
- 6.1.2 The Null Type
-
- The Null type has exactly one value, called null .
-
-
-
- 6.1.3 The Boolean Type
-
- The Boolean type represents a logical entity having two values, called true and false .
-
-
-
- 6.1.4 The String Type
-
- The String type is the set of all finite ordered sequences of zero or more 16-bit unsigned integer values
- (“elements”). The String type is generally used to represent textual data in a running ECMAScript program, in
- which case each element in the String is treated as a UTF-16 code unit value. Each element is regarded as occupying a
- position within the sequence. These positions are indexed with nonnegative integers. The first element (if any) is at index
- 0, the next element (if any) at index 1, and so on. The length of a String is the number of elements (i.e., 16-bit values)
- within it. The empty String has length zero and therefore contains no elements.
-
- Where ECMAScript operations interpret String values, each element is interpreted as a single UTF-16 code unit. However,
- ECMAScript does not place any restrictions or requirements on the sequence of code units in a String value, so they may be
- ill-formed when interpreted as UTF-16 code unit sequences. Operations that do not interpret String contents treat them as
- sequences of undifferentiated 16-bit unsigned integers. The function String.prototype.normalize
(see
- 21.1.3.12 ) can be used to explicitly normalize a string value. String.prototype.localeCompare
(see 21.1.3.10 ) internally normalizes strings values, but no other operations
- implicitly normalize the strings upon which they operate. Only operations that are explicitly specified to be language or
- locale sensitive produce language-sensitive results.
-
-
-
NOTE The rationale behind this design was to keep the implementation of Strings as simple and
- high-performing as possible. If ECMAScript source text is in Normalized Form C, string literals are guaranteed to also be
- normalized, as long as they do not contain any Unicode escape sequences.
-
-
- Some operations interpret String contents as UTF-16 encoded Unicode code points. In that case the interpretation is:
-
-
-
- A code unit in the range 0 to 0xD7FF or in the range 0xE000 to 0xFFFF is interpreted as a code point with the same value.
-
-
-
- A sequence of two code units, where the first code unit c1 is in the range 0xD800 to 0xDBFF and the second code unit
- c2 is in the range 0xDC00 to 0xDFFF , is a surrogate pair and is interpreted as a code point with the value (c1 -
- 0xD800 ) × 0x400 + (c2 – 0xDC00 ) + 0x10000 . (See 10.1.2 )
-
-
-
- A code unit that is in the range 0xD800 to 0xDFFF , but is not part of a surrogate pair, is interpreted as a code point
- with the same value.
-
-
-
-
-
-
-
6.1.5 The Symbol Type
-
-
The Symbol type is the set of all non-String values that may be used as the key of an Object property (6.1.7 ).
-
-
Each possible Symbol value is unique and immutable.
-
-
Each Symbol value immutably holds an associated value called [[Description]] that is either undefined or a String value.
-
-
-
- 6.1.5.1 Well-Known Symbols
-
- Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They
- are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless
- otherwise specified, well-known symbols values are shared by all Code Realms (8.2 ).
-
- Within this specification a well-known symbol is referred to by using a notation of the form @@name, where
- “name” is one of the values listed in Table 1 .
-
-
- Table 1 — Well-known Symbols
-
-
- Specification Name
- [[Description]]
- Value and Purpose
-
-
- @@hasInstance
- "Symbol.hasInstance"
- A method that determines if a constructor object recognizes an object as one of the constructor’s instances. Called by the semantics of the instanceof
operator.
-
-
- @@isConcatSpreadable
- "Symbol.isConcatSpreadable"
- A Boolean valued property that if true indicates that an object should be flattened to its array elements by Array.prototype.concat
.
-
-
- @@iterator
- "Symbol.iterator"
- A method that returns the default Iterator for an object. Called by the semantics of the for-of statement.
-
-
- @@match
- "Symbol.match"
- A regular expression method that matches the regular expression against a string. Called by the String.prototype.match
method.
-
-
- @@replace
- "Symbol.replace"
- A regular expression method that replaces matched substrings of a string. Called by the String.prototype.replace
method.
-
-
- @@search
- "Symbol.search"
- A regular expression method that returns the index within a string that matches the regular expression. Called by the String.prototype.search
method.
-
-
- @@species
- "Symbol.species"
- A function valued property that is the constructor function that is used to create derived objects.
-
-
- @@split
- "Symbol.split"
- A regular expression method that splits a string at the indices that match the regular expression. Called by the String.prototype.split
method.
-
-
- @@toPrimitive
- "Symbol.toPrimitive"
- A method that converts an object to a corresponding primitive value. Called by the ToPrimitive abstract operation.
-
-
- @@toStringTag
- "Symbol.toStringTag"
- A String valued property that is used in the creation of the default string description of an object. Accessed by the built-in method Object.prototype.toString
.
-
-
- @@unscopables
- "Symbol.unscopables"
- An object valued property whose own property names are property names that are excluded from the with
environment bindings of the associated object.
-
-
-
-
-
-
-
- 6.1.6 The Number Type
-
- The Number type has exactly 18437736874454810627 (that is, 264 −253 +3 ) values, representing the double-precision
- 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9007199254740990 (that is, 253 −2 ) distinct “Not-a-Number” values of the IEEE Standard are represented in
- ECMAScript as a single special NaN value. (Note that the NaN value is produced by the program expression
- NaN
.) In some implementations, external code might be able to detect a difference between various Not-a-Number
- values, but such behaviour is implementation-dependent; to ECMAScript code, all NaN values are indistinguishable from each
- other.
-
-
-
NOTE The bit pattern that might be observed in an ArrayBuffer (see 24.1 ) after a Number value has been stored into it is not necessarily the same as
- the internal representation of that Number value used by the ECMAScript implementation.
-
-
- There are two other special values, called positive Infinity and negative Infinity . For brevity, these
- values are also referred to for expository purposes by the symbols +∞ and −∞ , respectively. (Note that these two infinite Number values are produced by the program
- expressions +Infinity
(or simply Infinity
) and -Infinity
.)
-
- The other 18437736874454810624 (that is, 264 −253 ) values are called the finite numbers. Half of these are
- positive numbers and half are negative numbers; for every finite positive Number value there is a corresponding negative
- value having the same magnitude.
-
- Note that there is both a positive zero and a negative zero . For brevity, these values are also referred to
- for expository purposes by the symbols +0 and −0 , respectively.
- (Note that these two different zero Number values are produced by the program expressions +0
(or simply
- 0
) and -0
.)
-
- The 18437736874454810622 (that is, 264 −253 −2 ) finite nonzero values are of two kinds:
-
- 18428729675200069632 (that is, 264 −254 ) of them are normalized, having the form
-
- s × m × 2e
-
- where s is +1 or −1 , m is a positive integer less than 253 but not less than 252 , and
- e is an integer ranging from −1074 to 971 , inclusive.
-
- The remaining 9007199254740990 (that is, 253 −2 ) values are denormalized, having the form
-
- s × m × 2e
-
- where s is +1 or −1 , m is a positive integer less than 252 , and e is −1074 .
-
- Note that all the positive and negative integers whose magnitude is no greater than 253 are representable in the Number type (indeed, the integer 0 has two representations, +0
and -0
).
-
- A finite number has an odd significand if it is nonzero and the integer m used to express it (in one of
- the two forms shown above) is odd. Otherwise, it has an even significand .
-
- In this specification, the phrase “the Number value for
- x ” where x represents an exact nonzero real mathematical quantity (which might even be an
- irrational number such as π ) means a Number value chosen in the
- following manner. Consider the set of all finite values of the Number type, with −0 removed
- and with two additional values added to it that are not representable in the Number type, namely 21024 (which is +1 ×
- 253 × 2971 ) and −21024 (which is −1 × 253 × 2971 ).
- Choose the member of this set that is closest in value to x . If two values of the set are equally close, then the
- one with an even significand is chosen; for this purpose, the two extra values 21024 and −21024 are considered
- to have even significands. Finally, if 21024 was chosen,
- replace it with +∞ ; if −21024 was chosen, replace it with −∞ ; if +0 was chosen, replace it with −0 if and only if x is less
- than zero; any other chosen value is used unchanged. The result is the Number value for x . (This procedure
- corresponds exactly to the behaviour of the IEEE 754 “round to nearest, ties to even” mode.)
-
- Some ECMAScript operators deal only with integers in specific ranges such as −231 through 231 −1 ,
- inclusive, or in the range 0 through 216 −1 , inclusive. These operators accept any value of the Number type but first convert each
- such value to an integer value in the expected range. See the descriptions of the numeric conversion operations in 7.1 .
-
-
-
-
-
6.1.7 The
- Object Type
-
-
An Object is logically a collection of properties. Each property is either a data property, or an accessor
- property:
-
-
-
- A data property associates a key value with an ECMAScript language
- value and a set of Boolean attributes.
-
-
-
- An accessor property associates a key value with one or two accessor functions, and a set of Boolean
- attributes. The accessor functions are used to store or retrieve an ECMAScript language value that is associated with the property.
-
-
-
-
Properties are identified using key values. A property key value is either an ECMAScript String value or a Symbol
- value. All String and Symbol values, including the empty string, are valid as property keys. A property name is a
- property key that is a String value.
-
-
An integer index is a String-valued property key that is a canonical numeric String (see 7.1.16 ) and whose numeric value is either +0 or a positive integer ≤ 253 −1. An array index is an integer index whose
- numeric value i is in the range +0 ≤ i < 232 −1.
-
-
Property keys are used to access properties and their values. There are two kinds of access for properties: get
- and set , corresponding to value retrieval and assignment, respectively. The properties accessible via get and set
- access includes both own properties that are a direct part of an object and inherited properties which are
- provided by another associated object via a property inheritance relationship. Inherited properties may be either own or
- inherited properties of the associated object. Each own property of an object must each have a key value that is distinct
- from the key values of the other own properties of that object.
-
-
All objects are logically collections of properties, but there are multiple forms of objects that differ in their
- semantics for accessing and manipulating their properties. Ordinary objects are the most common form of objects and
- have the default object semantics. An exotic object is any form of object whose property semantics differ in any
- way from the default semantics.
-
-
-
- 6.1.7.1 Property Attributes
-
- Attributes are used in this specification to define and explain the state of Object properties. A data property
- associates a key value with the attributes listed in Table 2 .
-
-
- Table 2 — Attributes of a Data Property
-
-
- Attribute Name
- Value Domain
- Description
-
-
- [[Value]]
- Any ECMAScript language type
- The value retrieved by a get access of the property.
-
-
- [[Writable]]
- Boolean
- If false , attempts by ECMAScript code to change the property’s [[Value]] attribute using [[Set]] will not succeed.
-
-
- [[Enumerable]]
- Boolean
- If true , the property will be enumerated by a for-in enumeration (see 13.6.4 ). Otherwise, the property is said to be non-enumerable.
-
-
- [[Configurable]]
- Boolean
- If false , attempts to delete the property, change the property to be an accessor property, or change its attributes (other than [[Value]], or changing [[Writable]] to false ) will fail.
-
-
-
-
- An accessor property associates a key value with the attributes listed in Table 3 .
-
-
- Table 3 — Attributes of an Accessor Property
-
-
- Attribute Name
- Value Domain
- Description
-
-
- [[Get]]
- Object or Undefined
- If the value is an Object it must be a function Object. The function’s [[Call]] internal method (Table 6 ) is called with an empty arguments list to retrieve the property value each time a get access of the property is performed.
-
-
- [[Set]]
- Object or Undefined
- If the value is an Object it must be a function Object. The function’s [[Call]] internal method (Table 6 ) is called with an arguments list containing the assigned value as its sole argument each time a set access of the property is performed. The effect of a property's [[Set]] internal method may, but is not required to, have an effect on the value returned by subsequent calls to the property's [[Get]] internal method.
-
-
- [[Enumerable]]
- Boolean
- If true , the property is to be enumerated by a for-in enumeration (see 13.6.4 ). Otherwise, the property is said to be non-enumerable.
-
-
- [[Configurable]]
- Boolean
- If false , attempts to delete the property, change the property to be a data property, or change its attributes will fail.
-
-
-
-
- If the initial values of a property’s attributes are not explicitly specified by this specification, the default
- value defined in Table 4 is used.
-
-
- Table 4 — Default Attribute Values
-
-
- Attribute Name
- Default Value
-
-
- [[Value]]
- undefined
-
-
- [[Get]]
- undefined
-
-
- [[Set]]
- undefined
-
-
- [[Writable]]
- false
-
-
- [[Enumerable]]
- false
-
-
- [[Configurable]]
- false
-
-
-
-
-
-
- 6.1.7.2 Object Internal Methods and Internal Slots
-
- The actual semantics of objects, in ECMAScript, are specified via algorithms called internal methods . Each
- object in an ECMAScript engine is associated with a set of internal methods that defines its runtime behaviour. These
- internal methods are not part of the ECMAScript language. They are defined by this specification purely for expository
- purposes. However, each object within an implementation of ECMAScript must behave as specified by the internal methods
- associated with it. The exact manner in which this is accomplished is determined by the implementation.
-
- Internal method names are polymorphic. This means that different object values may perform different algorithms when a
- common internal method name is invoked upon them. That actual object upon which an internal method is invoked is the
- “target” of the invocation. If, at runtime, the implementation of an algorithm attempts to use an internal
- method of an object that the object does not support, a TypeError exception is thrown.
-
- Internal slots correspond to internal state that is associated with objects and used by various ECMAScript
- specification algorithms. Internal slots are not object properties and they are not inherited. Depending upon the specific
- internal slot specification, such state may consist of values of any ECMAScript
- language type or of specific ECMAScript specification type values. Unless explicitly specified otherwise, internal
- slots are allocated as part of the process of creating an object and may not be dynamically added to an object. Unless
- specified otherwise, the initial value of an internal slot is the value undefined . Various
- algorithms within this specification create objects that have internal slots. However, the ECMAScript language provides no
- direct way to associate internal slots with an object.
-
- Internal methods and internal slots are identified within this specification using names enclosed in double square
- brackets [[ ]].
-
- Table 5 summarizes the essential internal methods used by this specification that are
- applicable to all objects created or manipulated by ECMAScript code. Every object must have algorithms for all of the
- essential internal methods. However, all objects do not necessarily use the same algorithms for those methods.
-
- The “Signature” column of Table 5 and other similar tables describes the invocation
- pattern for each internal method. The invocation pattern always includes a parenthesized list of descriptive parameter
- names. If a parameter name is the same as an ECMAScript type name then the name describes the required type of the
- parameter value. If an internal method explicitly returns a value, its parameter list is followed by the symbol
- “→” and the type name of the returned value. The type names used in signatures refer to the types defined
- in clause 6 augmented by the following additional names.
- “any ” means the value may be any ECMAScript language type .
- An internal method implicitly returns a Completion Record as
- described in 6.2.2 . In addition to its parameters, an internal
- method always has access to the object that is the target of the method invocation.
-
-
- Table 5 — Essential Internal Methods
-
-
- Internal Method
- Signature
- Description
-
-
- [[GetPrototypeOf]]
- () → Object or Null
- Determine the object that provides inherited properties for this object. A null value indicates that there are no inherited properties.
-
-
- [[SetPrototypeOf]]
- (Object or Null) → Boolean
- Associate with this object another object that provides inherited properties. Passing null indicates that there are no inherited properties. Returns true indicating that the operation was completed successfully or false indicating that the operation was not successful.
-
-
- [[IsExtensible]]
- ( ) → Boolean
- Determine whether it is permitted to add additional properties to this object.
-
-
- [[PreventExtensions]]
- ( ) → Boolean
- Control whether new properties may be added to this object. Returns true if the operation was successful or false if the operation was unsuccessful.
-
-
- [[GetOwnProperty]]
- (propertyKey ) → Undefined or Property Descriptor
- Return a Property Descriptor for the own property of this object whose key is propertyKey , or undefined if no such property exists.
-
-
- [[HasProperty]]
- (propertyKey ) → Boolean
- Return a Boolean value indicating whether this object already has either an own or inherited property whose key is propertyKey .
-
-
- [[Get]]
- (propertyKey , Receiver ) → any
- Return the value of the property whose key is propertyKey from this object. If any ECMAScript code must be executed to retrieve the property value, Receiver is used as the this value when evaluating the code.
-
-
- [[Set]]
- (propertyKey ,value , Receiver ) → Boolean
- Set the value of this object property whose key is propertyKey to value . If any ECMAScript code must be executed to set the property value, Receiver is used as the this value when evaluating the code. Returns true if that the property value was set or false if that it could not be set.
-
-
- [[Delete]]
- (propertyKey ) → Boolean
- Remove the own property whose key is propertyKey from this object . Return false if the property was not deleted and is still present. Return true if the property was deleted or is not present.
-
-
- [[DefineOwnProperty]]
- (propertyKey,PropertyDescriptor ) → Boolean
- Create or alter the own property, whose key is propertyKey , to have the state described by PropertyDescriptor . Return true if that the property was successfully created/updated or false if the property could not be created or updated.
-
-
- [[Enumerate]]
- ()→ Object
- Return an iterator object that produces the keys of the string-keyed enumerable properties of the object.
-
-
- [[OwnPropertyKeys]]
- ()→ List of propertyKey
- Return a List whose elements are all of the own property keys for the object.
-
-
-
-
- Table 6 summarizes additional essential internal methods that are supported by objects that may
- be called as functions. A function object is an object that supports the [[Call]] internal methods. A
- constructor (also referred to as a constructor function ) is a function object that supports the
- [[Construct]] internal method.
-
-
- Table 6 — Additional Essential Internal Methods of Function Objects
-
-
- Internal Method
- Signature
- Description
-
-
- [[Call]]
- (any , a List of any )→ any
- Executes code associated with this object. Invoked via a function call expression. The arguments to the internal method are a this value and a list containing the arguments passed to the function by a call expression. Objects that implement this internal method are callable .
-
-
- [[Construct]]
- (a List of any , Object)→ Object
- Creates an object. Invoked via the new
or super
operators. The first arguments to the internal method is a list containing the arguments of the operator. The second argument is the object to which the new
operator was initially applied. Objects that implement this internal method are called constructors . A Function object is not necessarily a constructor and such non-constructor Function objects do not have a [[Construct]] internal method.
-
-
-
-
- The semantics of the essential internal methods for ordinary objects and standard exotic objects are specified in clause 9 . If any specified use of an internal method of an exotic
- object is not supported by an implementation, that usage must throw a TypeError exception when attempted.
-
-
-
- 6.1.7.3 Invariants of the Essential Internal Methods
-
- The Internal Methods of Objects of an ECMAScript engine must conform to the list of invariants specified below.
- Ordinary ECMAScript Objects as well as all standard exotic objects in this specification maintain these invariants.
- ECMAScript Proxy objects maintain these invariants by means of runtime checks on the result of traps invoked on the
- [[ProxyHandler]] object.
-
- Any implementation provided exotic objects must also maintain these invariants for those objects. Violation of these
- invariants may cause ECMAScript code to have unpredictable behaviour and create security issues. However, violation of
- these invariants must never compromise the memory safety of an implementation.
-
- An implementation must not allow these invariants to be circumvented in any manner such as by providing alternative
- interfaces that implement the functionality of the essential internal methods without enforcing their invariants.
-
- Definitions:
-
- ● The target of an internal method is the object upon which the internal method is called.
-
- ● A target is non-extensible if it has been observed to return false from its [[IsExtensible]]
- internal method, or true from its [[PreventExtensions]] internal method.
-
- ● A non-existent property is a property that does not exist as an own property on a non-extensible
- target.
-
- ● All references to SameValue are according to the definition of SameValue algorithm specified in 7.2.9 .
-
- [[GetPrototypeOf]] ( )
-
- ● The Type of the return value must be either Object or Null.
-
- ● If target is non-extensible, and [[GetPrototypeOf]] returns a value v, then any future calls to
- [[GetPrototypeOf]] should return the SameValue as v.
-
-
-
NOTE An object’s prototype chain should have finite length (that is, starting from any
- object, recursively applying the [[GetPrototypeOf]] internal method to its result should eventually lead to the value
- null). However, this requirement is not enforceable as an object level invariant if the prototype chain includes any
- exotic objects that do not use the ordinary object definition of [[GetPrototypeOf]]. Such a circular prototype chain may
- result in infinite loops when accessing object properties.
-
-
- [[SetPrototypeOf]] (V)
-
- ● The Type of the return value must be Boolean.
-
- ● If target is non-extensible, [[SetPrototypeOf]] must return false, unless V is the SameValue as the target’s observed [[GetPrototypeOf]] value.
-
- [[PreventExtensions]] ( )
-
- ● The Type of the return value must be Boolean.
-
- ● If [[PreventExtensions]] returns true, all future calls to [[IsExtensible]] on the target must return
- false and the target is now considered non-extensible.
-
- [[GetOwnProperty]] (P)
-
- ● The Type of the return value must be either Property Descriptor or Undefined.
-
- ● If the Type of the return value is Property
- Descriptor , the return value must be a complete property descriptor (see
- 6.2.4.6 ).
-
- ● If a property P is described as a data property with Desc.[[Value]] equal to v and Desc.[[Writable]] and
- Desc.[[Configurable]] are both false, then the SameValue must be returned for the
- Desc.[[Value]] attribute of the property on all future calls to [[GetOwnProperty]] ( P ).
-
- ● If P’s attributes other than [[Writable]] may change over time or if the property might disappear,
- then P’s [[Configurable]] attribute must be true.
-
- ● If the [[Writable]] attribute may change from false to true, then the [[Configurable]] attribute must be
- true.
-
- ● If the target is non-extensible and P is non-existent, then all future calls to [[GetOwnProperty]] (P)
- on the target must describe P as non-existent (i.e. [[GetOwnProperty]] (P) must return undefined).
-
-
-
NOTE As a consequence of the third invariant, if a property is described as a data property
- and it may return different values over time, then either or both of the Desc.[[Writable]] and Desc.[[Configurable]]
- attributes must be true even if no mechanism to change the value is exposed via the other internal methods.
-
-
- [[DefineOwnProperty]] (P, Desc)
-
- ● The Type of the return value must be Boolean.
-
- ● [[DefineOwnProperty]] must return false if P has previously been observed as a non-configurable own
- property of the target, unless either:
-
- 1. P is a non-configurable writable own data property. A non-configurable writable data property can be changed
- into a non-configurable non-writable data property.
-
- 2. All attributes in Desc are the SameValue as P’s attributes.
-
- ● [[DefineOwnProperty]] (P, Desc) must return false if target is non-extensible and P is a non-existent own
- property. That is, a non-extensible target object cannot be extended with new properties.
-
- [[HasProperty]] ( P )
-
- ● The Type of the return value must be Boolean.
-
- ● If P was previously observed as a non-configurable data or accessor own property of the target,
- [[HasProperty]] must return true.
-
- [[Get]] (P, Receiver)
-
- ● If P was previously observed as a non-configurable, non-writable own data property of the target with
- value v, then [[Get]] must return the SameValue .
-
- ● If P was previously observed as a non-configurable own accessor property of the target whose [[Get]]
- attribute is undefined, the [[Get]] operation must return undefined.
-
- [[Set]] ( P, V, Receiver)
-
- ● The Type of the return value must be Boolean.
-
- ● If P was previously observed as a non-configurable, non-writable own data property of the target, then
- [[Set]] must return false unless V is the SameValue as P’s [[Value]] attribute.
-
- ● If P was previously observed as a non-configurable own accessor property of the target whose [[Set]]
- attribute is undefined, the [[Set]] operation must return false.
-
- [[Delete]] ( P )
-
- ● The Type of the return value must be Boolean.
-
- ● If P was previously observed to be a non-configurable own data or accessor property of the target,
- [[Delete]] must return false.
-
- [[Enumerate]] ( )
-
- ● The Type of the return value must be Object.
-
- [[OwnPropertyKeys]] ( )
-
- ● The return value must be a List .
-
- ● The Type of each element of the returned List is
- either String or Symbol.
-
- ● The returned List must contain at least the keys of
- all non-configurable own properties that have previously been observed.
-
- ● If the object is non-extensible, the returned List
- must contain only the keys of all own properties of the object that are observable using [[GetOwnProperty]].
-
- [[Construct]] ( )
-
- ● The Type of the return value must be Object.
-
-
-
- 6.1.7.4 Well-Known Intrinsic Objects
-
- Well-known intrinsics are built-in objects that are explicitly referenced by the algorithms of this specification and
- which usually have Realm specific identities. Unless otherwise specified each intrinsic
- object actually corresponds to a set of similar objects, one per Realm .
-
- Within this specification a reference such as %name% means the intrinsic object, associated with the current Realm , corresponding to the name. Determination of the current Realm and its intrinsics is described in 8.1.2.5 . The well-known intrinsics are listed in Table 7 .
-
-
- Table 7 — Well-known Intrinsic Objects
-
-
- Intrinsic Name
- Global Name
- ECMAScript Language Association
-
-
- %Array%
- Array
- The Array
constructor (22.1.1 )
-
-
- %ArrayBuffer%
- ArrayBuffer
- The ArrayBuffer
constructor (24.1.2 )
-
-
- %ArrayBufferPrototype%
- ArrayBuffer.prototype
- The initial value of the prototype
data property of %ArrayBuffer%.
-
-
- %ArrayIteratorPrototype%
-
- The prototype of Array iterator objects (22.1.5 )
-
-
- %ArrayPrototype%
- Array.prototype
- The initial value of the prototype
data property of %Array% (22.1.3 )
-
-
- %ArrayProto_values%
- Array.prototype.values
- The initial value of the values
data property of %ArrayPrototype% (22.1.3.29 )
-
-
- %Boolean%
- Boolean
- The Boolean
constructor (19.3.1 )
-
-
- %BooleanPrototype%
- Boolean.prototype
- The initial value of the prototype
data property of %Boolean% (19.3.3 )
-
-
- %DataView%
- DataView
- The DataView
constructor (24.2.2 )
-
-
- %DataViewPrototype%
- DataView.prototype
- The initial value of the prototype
data property of %DataView%
-
-
- %Date%
- Date
- The Date
constructor (20.3.2 )
-
-
- %DatePrototype%
- Date.prototype
- The initial value of the prototype
data property of %Date%.
-
-
- %decodeURI%
- decodeURI
- The decodeURI
function (18.2.6.2 )
-
-
- %decodeURIComponent%
- decodeURIComponent
- The decodeURIComponent
function (18.2.6.3 )
-
-
- %encodeURI%
- encodeURI
- The encodeURI
function (18.2.6.4 )
-
-
- %encodeURIComponent%
- encodeURIComponent
- The encodeURIComponent
function (18.2.6.5 )
-
-
- %Error%
- Error
- The Error
constructor (19.5.1 )
-
-
- %ErrorPrototype%
- Error.prototype
- The initial value of the prototype
data property of %Error%
-
-
- %eval%
- eval
- The eval
function (18.2.1 )
-
-
- %EvalError%
- EvalError
- The EvalError
constructor (19.5.5.1 )
-
-
- %EvalErrorPrototype%
- EvalError.prototype
- The initial value of the prototype
property of %EvalError%
-
-
- %Float32Array%
- Float32Array
- The Float32Array
constructor (22.2 )
-
-
- %Float32ArrayPrototype%
- Float32Array.prototype
- The initial value of the prototype
data property of %Float32Array%.
-
-
- %Float64Array%
- Float64Array
- The Float64Array
constructor (22.2 )
-
-
- %Float64ArrayPrototype%
- Float64Array.prototype
- The initial value of the prototype
data property of %Float64Array%
-
-
- %Function%
- Function
- The Function
constructor (19.2.1 )
-
-
- %FunctionPrototype%
- Function.prototype
- The initial value of the prototype
data property of %Function%
-
-
- %Generator%
-
- The initial value of the prototype
property of %GeneratorFunction%
-
-
- %GeneratorFunction%
-
- The constructor of generator objects (25.2.1 )
-
-
- %GeneratorPrototype%
-
- The initial value of the prototype
property of %Generator%
-
-
- %Int8Array%
- Int8Array
- The Int8Array
constructor (22.2 )
-
-
- %Int8ArrayPrototype%
- Int8Array.prototype
- The initial value of the prototype
data property of %Int8Array%
-
-
- %Int16Array%
- Int16Array
- The Int16Array
constructor (22.2 )
-
-
- %Int16ArrayPrototype%
- Int16Array.prototype
- The initial value of the prototype
data property of %Int16Array%
-
-
- %Int32Array%
- Int32Array
- The Int32Array
constructor (22.2 )
-
-
- %Int32ArrayPrototype%
- Int32Array.prototype
- The initial value of the prototype
data property of %Int32Array%
-
-
- %isFinite%
- isFinite
- The isFinite
function (18.2.2 )
-
-
- %isNaN%
- isNaN
- The isNaN
function (18.2.3 )
-
-
- %IteratorPrototype%
-
- An object that all standard built-in iterator objects indirectly inherit from
-
-
- %JSON%
- JSON
- The JSON
object (24.3 )
-
-
- %Map%
- Map
- The Map
constructor (23.1.1 )
-
-
- %MapIteratorPrototype%
-
- The prototype of Map iterator objects (23.1.5 )
-
-
- %MapPrototype%
- Map.prototype
- The initial value of the prototype
data property of %Map%
-
-
- %Math%
- Math
- The Math
object (20.2 )
-
-
- %Number%
- Number
- The Number
constructor (20.1.1 )
-
-
- %NumberPrototype%
- Number.prototype
- The initial value of the prototype
property of %Number%
-
-
- %Object%
- Object
- The Object
constructor (19.1.1 )
-
-
- %ObjectPrototype%
- Object.prototype
- The initial value of the prototype
data property of %Object%. (19.1.3 )
-
-
- %ObjProto_toString%
- Object.prototype. toString
- The initial value of the toString
data property of %ObjectPrototype% (19.1.3.6 )
-
-
- %parseFloat%
- parseFloat
- The parseFloat
function (18.2.4 )
-
-
- %parseInt%
- parseInt
- The parseInt
function (18.2.5 )
-
-
- %Promise%
- Promise
- The Promise
constructor (25.4.3 )
-
-
- %PromisePrototype%
- Promise.prototype
- The initial value of the prototype
data property of %Promise%
-
-
- %Proxy%
- Proxy
- The Proxy
constructor (26.2.1 )
-
-
- %RangeError%
- RangeError
- The RangeError
constructor (19.5.5.2 )
-
-
- %RangeErrorPrototype%
- RangeError.prototype
- The initial value of the prototype
property of %RangeError%
-
-
- %ReferenceError%
- ReferenceError
- The ReferenceError
constructor (19.5.5.3 )
-
-
- %ReferenceErrorPrototype%
- ReferenceError. prototype
- The initial value of the prototype
property of %ReferenceError%
-
-
- %Reflect%
- Reflect
- The Reflect
object (26.1 )
-
-
- %RegExp%
- RegExp
- The RegExp
constructor (21.2.3 )
-
-
- %RegExpPrototype%
- RegExp.prototype
- The initial value of the prototype
data property of %RegExp%
-
-
- %Set%
- Set
- The Set
constructor (23.2.1 )
-
-
- %SetIteratorPrototype%
-
- The prototype of Set iterator objects (23.2.5 )
-
-
- %SetPrototype%
- Set.prototype
- The initial value of the prototype
data property of %Set%
-
-
- %String%
- String
- The String
constructor (21.1.1 )
-
-
- %StringIteratorPrototype%
-
- The prototype of String iterator objects (21.1.5 )
-
-
- %StringPrototype%
- String.prototype
- The initial value of the prototype
data property of %String%
-
-
- %Symbol%
- Symbol
- The Symbol
constructor (19.4.1 )
-
-
- %SymbolPrototype%
- Symbol.prototype
- The initial value of the prototype
data property of %Symbol%. (19.4.3 )
-
-
- %SyntaxError%
- SyntaxError
- The SyntaxError
constructor (19.5.5.4 )
-
-
- %SyntaxErrorPrototype%
- SyntaxError.prototype
- The initial value of the prototype
property of %SyntaxError%
-
-
- %ThrowTypeError%
-
- A function object that unconditionally throws a new instance of %TypeError%
-
-
- %TypedArray%
-
- The super class of all typed Array constructors (22.2.1 )
-
-
- %TypedArrayPrototype%
-
- The initial value of the prototype
property of %TypedArray%
-
-
- %TypeError%
- TypeError
- The TypeError
constructor (19.5.5.5 )
-
-
- %TypeErrorPrototype%
- TypeError.prototype
- The initial value of the prototype
property of %TypeError%
-
-
- %Uint8Array%
- Uint8Array
- The Uint8Array
constructor (22.2 )
-
-
- %Uint8ArrayPrototype%
- Uint8Array.prototype
- The initial value of the prototype
data property of %Uint8Array%
-
-
- %Uint8ClampedArray%
- Uint8ClampedArray
- The Uint8ClampedArray
constructor (22.2 )
-
-
- %Uint8ClampedArrayPrototype%
- Uint8ClampedArray . prototype
- The initial value of the prototype
data property of %Uint8ClampedArray%
-
-
- %Uint16Array%
- Uint16Array
- The Uint16Array
constructor (22.2 )
-
-
- %Uint16ArrayPrototype%
- Uint16Array.prototype
- The initial value of the prototype
data property of %Uint16Array%
-
-
- %Uint32Array%
- Uint32Array
- The Uint32Array
constructor (22.2 )
-
-
- %Uint32ArrayPrototype%
- Uint32Array.prototype
- The initial value of the prototype
data property of %Uint32Array%
-
-
- %URIError%
- URIError
- The URIError
constructor (19.5.5.6 )
-
-
- %URIErrorPrototype%
- URIError.prototype
- The initial value of the prototype
property of %URIError%
-
-
- %WeakMap%
- WeakMap
- The WeakMap
constructor (23.3.1 )
-
-
- %WeakMapPrototype%
- WeakMap.prototype
- The initial value of the prototype
data property of %WeakMap%
-
-
- %WeakSet%
- WeakSet
- The WeakSet
constructor (23.4.1 )
-
-
- %WeakSetPrototype%
- WeakSet.prototype
- The initial value of the prototype
data property of %WeakSet%
-
-
-
-
-
-
-
-
-
-
6.2 ECMAScript Specification Types
-
-
A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript
- language constructs and ECMAScript language types. The specification types are Reference , List , Completion , Property Descriptor , Lexical
- Environment , Environment Record , and Data Block .
- Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an
- ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression
- evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.
-
-
-
- 6.2.1 The List and Record Specification Type
-
- The List type is used to explain the evaluation of argument lists (see 12.3.6 ) in
- new
expressions, in function calls, and in other algorithms where a simple ordered list of values is needed.
- Values of the List type are simply ordered sequences of list elements containing the individual values. These sequences may
- be of any length. The elements of a list may be randomly accessed using 0-origin indices. For notational convenience an
- array-like syntax can be used to access List elements. For example, arguments [2] is shorthand for saying the
- 3rd element of the List arguments .
-
- For notational convenience within this specification, a literal syntax can be used to express a new List value. For
- example, «1, 2» defines a List value that has two elements each of which is initialized to a specific value. A
- new empty List can be expressed as «».
-
- The Record type is used to describe data aggregations within the algorithms of this specification. A Record type value
- consists of one or more named fields. The value of each field is either an ECMAScript value or an abstract value represented
- by a name associated with the Record type. Field names are always enclosed in double brackets, for example [[value]].
-
- For notational convenience within this specification, an object literal-like syntax can be used to express a Record
- value. For example, {[[field1]]: 42, [[field2]]: false , [[field3]]: empty } defines a Record value that has
- three fields, each of which is initialized to a specific value. Field name order is not significant. Any fields that are not
- explicitly listed are considered to be absent.
-
- In specification text and algorithms, dot notation may be used to refer to a specific field of a Record value. For
- example, if R is the record shown in the previous paragraph then R.[[field2]] is shorthand for “the field of R named
- [[field2]]”.
-
- Schema for commonly used Record field combinations may be named, and that name may be used as a prefix to a literal
- Record value to identify the specific kind of aggregations that is being described. For example:
- PropertyDescriptor{[[Value]]: 42, [[Writable]]: false , [[Configurable]]: true }.
-
-
-
-
-
6.2.2 The Completion Record Specification Type
-
-
The Completion type is a Record used to explain the runtime propagation of values and control flow such as the
- behaviour of statements (break
, continue
, return
and throw
) that
- perform nonlocal transfers of control.
-
-
Values of the Completion type are Record values whose fields are defined as by Table 8 .
-
-
- Table 8 — Completion Record Fields
-
-
- Field
- Value
- Meaning
-
-
- [[type]]
- One of normal , break , continue , return , or throw
- The type of completion that occurred.
-
-
- [[value]]
- any ECMAScript language value or empty
- The value that was produced.
-
-
- [[target]]
- any ECMAScript string or empty
- The target label for directed control transfers.
-
-
-
-
-
The term “abrupt completion” refers to any completion with a [[type]] value other than normal .
-
-
-
- 6.2.2.1
- NormalCompletion
-
- The abstract operation NormalCompletion with a single argument , such as:
-
-
- Return NormalCompletion(argument ).
-
-
- Is a shorthand that is defined as follows:
-
-
- Return Completion {[[type]]: normal , [[value]]: argument , [[target]]:empty }.
-
-
-
-
- 6.2.2.2 Implicit Completion Values
-
- The algorithms of this specification often implicitly return Completion Records whose [[type]] is normal . Unless it is
- otherwise obvious from the context, an algorithm statement that returns a value that is not a Completion Record , such as:
-
-
- Return "Infinity"
.
-
-
- means the same thing as:
-
-
- Return NormalCompletion ("Infinity"
).
-
-
- However, if the value expression of a “return ” statement
- is a Completion Record construction literal, the resulting Completion Record is returned. If the value expression is a call to
- an abstract operation, the “return ” statement simply returns
- the Completion Record produced by the abstract operation.
-
- The abstract operation Completion (completionRecord ) is used to emphasize that
- a previously computed Completion Record is being returned. The Completion abstract operation takes a single argument,
- completionRecord , and performs the following steps: such as
-
-
- Assert : completionRecord is a Completion Record .
- Return completionRecord as the Completion Record of
- this abstract operation.
-
-
- A “return ” statement without a value in an algorithm step
- means the same thing as:
-
-
- Return NormalCompletion (undefined ).
-
-
- Any reference to a Completion Record value that is in a context
- that does not explicitly require a complete Completion Record
- value is equivalent to an explicit reference to the [[value]] field of the Completion Record value unless the Completion Record is an abrupt completion .
-
-
-
- 6.2.2.3 Throw an Exception
-
- Algorithms steps that say to throw an exception, such as
-
-
- Throw a TypeError exception.
-
-
- mean the same things as:
-
-
- Return Completion {[[type]]: throw , [[value]]: a newly created TypeError object, [[target]]:empty }.
-
-
-
-
- 6.2.2.4
- ReturnIfAbrupt
-
- Algorithms steps that say
-
-
- ReturnIfAbrupt(argument ).
-
-
- mean the same thing as:
-
-
- If argument is an abrupt completion , return
- argument .
- Else if argument is a Completion Record , let
- argument be argument .[[value]].
-
-
-
-
-
-
-
6.2.3 The Reference Specification Type
-
-
-
NOTE The Reference type is used to explain the behaviour of such operators as
- delete
, typeof
, the assignment operators, the super
keyword and other language
- features. For example, the left-hand operand of an assignment is expected to produce a reference.
-
-
-
A Reference is a resolved name or property binding. A Reference consists of three components, the
- base value, the referenced name and the Boolean valued strict reference flag. The
- base value is either undefined , an Object, a Boolean, a String, a Symbol, a Number, or an Environment Record (8.1.1 ). A base
- value of undefined indicates that the Reference could not be resolved to a binding. The referenced name
- is a String or Symbol value.
-
-
A Super Reference is a Reference that is used to represents a name binding that was expressed using the super keyword.
- A Super Reference has an additional thisValue component and its base value will never be an Environment Record .
-
-
The following abstract operations are used in this specification to access the components of references:
-
-
-
- GetBase(V). Returns the base value component of the reference V.
-
-
-
- GetReferencedName(V). Returns the referenced name component of the reference V.
-
-
-
- IsStrictReference(V). Returns the strict reference flag component of the reference V.
-
-
-
- HasPrimitiveBase(V). Returns true if Type (base )
- is Boolean, String, Symbol, or Number.
-
-
-
- IsPropertyReference(V). Returns true if either the base value is an object or HasPrimitiveBase(V) is
- true ; otherwise returns false .
-
-
-
- IsUnresolvableReference(V). Returns true if the base value is undefined and false
- otherwise.
-
-
-
- IsSuperReference(V). Returns true if this reference has a thisValue component.
-
-
-
-
The following abstract operations are used in this specification to operate on references:
-
-
-
-
-
- 6.2.3.2 PutValue
- (V, W)
-
- ReturnIfAbrupt (V ).
- ReturnIfAbrupt (W ).
- If Type (V ) is not Reference , throw a ReferenceError exception.
- Let base be GetBase (V ).
- If IsUnresolvableReference (V ), then
-
- If IsStrictReference (V ) is true , then
-
- Throw ReferenceError exception.
-
-
- Let globalObj be GetGlobalObject ().
- Return Set (globalObj ,GetReferencedName (V ), W , false ).
-
-
- Else if IsPropertyReference (V ), then
-
- If HasPrimitiveBase (V ) is true , then
-
- Assert : In this case, base will never be null or
- undefined .
- Set base to ToObject (base ).
-
-
- Let succeeded be base. [[Set]](GetReferencedName (V ), W , GetThisValue (V )).
- ReturnIfAbrupt (succeeded ).
- If succeeded is false and IsStrictReference (V ) is true , throw a
- TypeError exception.
- Return.
-
-
- Else base must be an Environment Record .
-
- Return base. SetMutableBinding(GetReferencedName (V ), W , IsStrictReference (V )) (see 8.1.1 ).
-
-
-
-
-
-
NOTE The object that may be created in step 6.a.ii is not accessible outside of the above
- algorithm and the ordinary object [[Set]] internal method. An implementation might choose to avoid the actual creation
- of that object.
-
-
-
-
-
-
-
-
-
-
-
6.2.4 The Property Descriptor Specification Type
-
-
The Property Descriptor type is used to explain the manipulation and reification of Object property attributes. Values
- of the Property Descriptor type are Records. Each field’s name is an attribute name and its value is a corresponding
- attribute value as specified in 6.1.7.1 . In addition, any field may be present or
- absent. The schema name used within this specification to tag literal descriptions of Property Descriptor records is
- “PropertyDescriptor”.
-
-
Property Descriptor values may be further classified as data Property Descriptors and accessor Property Descriptors
- based upon the existence or use of certain fields. A data Property Descriptor is one that includes any fields named either
- [[Value]] or [[Writable]]. An accessor Property Descriptor is one that includes any fields named either [[Get]] or
- [[Set]]. Any Property Descriptor may have fields named [[Enumerable]] and [[Configurable]]. A Property Descriptor value
- may not be both a data Property Descriptor and an accessor Property Descriptor; however, it may be neither. A generic
- Property Descriptor is a Property Descriptor value that is neither a data Property Descriptor nor an accessor Property
- Descriptor. A fully populated Property Descriptor is one that is either an accessor Property Descriptor or a data Property
- Descriptor and that has all of the fields that correspond to the property attributes defined in either Table 2 or Table 3 .
-
-
The following abstract operations are used in this specification to operate upon Property Descriptor values:
-
-
-
- 6.2.4.1 IsAccessorDescriptor ( Desc )
-
- When the abstract operation IsAccessorDescriptor is called with Property Descriptor Desc , the following
- steps are taken:
-
-
- If Desc is undefined , return false .
- If both Desc .[[Get]] and Desc .[[Set]] are absent, return false .
- Return true .
-
-
-
-
- 6.2.4.2
- IsDataDescriptor ( Desc )
-
- When the abstract operation IsDataDescriptor is called with Property Descriptor Desc , the following
- steps are taken:
-
-
- If Desc is undefined , return false .
- If both Desc .[[Value]] and Desc .[[Writable]] are absent, return false .
- Return true .
-
-
-
-
- 6.2.4.3 IsGenericDescriptor ( Desc )
-
- When the abstract operation IsGenericDescriptor is called with Property Descriptor Desc , the following
- steps are taken:
-
-
- If Desc is undefined , return false .
- If IsAccessorDescriptor (Desc ) and IsDataDescriptor (Desc ) are both false , return true .
- Return false .
-
-
-
-
- 6.2.4.4 FromPropertyDescriptor ( Desc )
-
- When the abstract operation FromPropertyDescriptor is called with Property Descriptor Desc , the following
- steps are taken:
-
-
- If Desc is undefined , return undefined .
- Let obj be ObjectCreate (%ObjectPrototype% ).
- Assert : obj is an extensible ordinary object with no own
- properties.
- If Desc has a [[Value]] field, then
-
- Call CreateDataProperty (obj ,
- "value"
, Desc .[[Value]]).
-
-
- If Desc has a [[Writable]] field, then
-
- Call CreateDataProperty (obj ,
- "writable"
, Desc .[[Writable]]).
-
-
- If Desc has a [[Get]] field, then
-
- Call CreateDataProperty (obj ,
- "get",
Desc .[[Get]]).
-
-
- If Desc has a [[Set]] field, then
-
- Call CreateDataProperty (obj ,
- "set"
, Desc .[[Set]])
-
-
- If Desc has an [[Enumerable]] field, then
-
- Call CreateDataProperty (obj ,
- "enumerable"
, Desc .[[Enumerable]]).
-
-
- If Desc has a [[Configurable]] field, then
-
- Call CreateDataProperty (obj ,
- "configurable"
, Desc .[[Configurable]]).
-
-
- Assert : all of the above CreateDataProperty operations return true .
- Return obj .
-
-
-
-
- 6.2.4.5 ToPropertyDescriptor ( Obj )
-
- When the abstract operation ToPropertyDescriptor is called with object Obj , the following steps
- are taken:
-
-
- ReturnIfAbrupt (Obj ).
- If Type (Obj ) is not Object throw a TypeError
- exception.
- Let desc be a new Property Descriptor that
- initially has no fields.
- If HasProperty (Obj , "enumerable"
) is true , then
-
- Let enum be ToBoolean (Get (Obj ,
- "enumerable"
)).
- ReturnIfAbrupt (enum ).
- Set the [[Enumerable]] field of desc to enum .
-
-
- If HasProperty (Obj , "configurable"
) is true , then
-
- Let conf be ToBoolean (Get (Obj ,
- "configurable"
)).
- ReturnIfAbrupt (conf ).
- Set the [[Configurable]] field of desc to conf .
-
-
- If HasProperty (Obj , "value"
) is true , then
-
- Let value be Get (Obj , "value"
).
- ReturnIfAbrupt (value ).
- Set the [[Value]] field of desc to value .
-
-
- If HasProperty (Obj , "writable"
) is true , then
-
- Let writable be ToBoolean (Get (Obj ,
- "writable"
)).
- ReturnIfAbrupt (writable ).
- Set the [[Writable]] field of desc to writable .
-
-
- If HasProperty (Obj , "get"
) is true , then
-
- Let getter be Get (Obj , "get"
).
- ReturnIfAbrupt (getter ).
- If IsCallable (getter ) is false and getter is not
- undefined , throw a TypeError exception.
- Set the [[Get]] field of desc to getter .
-
-
- If HasProperty (Obj , "set"
) is true , then
-
- Let setter be Get (Obj , "set"
).
- ReturnIfAbrupt (setter ).
- If IsCallable (setter ) is false and setter is not
- undefined , throw a TypeError exception.
- Set the [[Set]] field of desc to setter .
-
-
- If either desc .[[Get]] or desc .[[Set]] are present, then
-
- If either desc .[[Value]] or desc .[[Writable]] are present, throw a TypeError
- exception.
-
-
- Return desc .
-
-
-
-
- 6.2.4.6 CompletePropertyDescriptor ( Desc )
-
- When the abstract operation CompletePropertyDescriptor is called with Property Descriptor Desc the following
- steps are taken:
-
-
- ReturnIfAbrupt (Desc ).
- Assert : Desc is a Property Descriptor
- Let like be Record{[[Value]]: undefined , [[Writable]]: false , [[Get]]: undefined ,
- [[Set]]: undefined , [[Enumerable]]: false , [[Configurable]]: false }.
- If either IsGenericDescriptor (Desc ) or IsDataDescriptor (Desc ) is true , then
-
- If Desc does not have a [[Value]] field, set Desc .[[Value]] to like .[[Value]].
- If Desc does not have a [[Writable]] field, set Desc .[[Writable]] to
- like .[[Writable]].
-
-
- Else,
-
- If Desc does not have a [[Get]] field, set Desc .[[Get]] to like .[[Get]].
- If Desc does not have a [[Set]] field, set Desc .[[Set]] to like .[[Set]].
-
-
- If Desc does not have an [[Enumerable]] field, set Desc .[[Enumerable]] to
- like .[[Enumerable]].
- If Desc does not have a [[Configurable]] field, set Desc .[[Configurable]] to
- like .[[Configurable]].
- Return Desc .
-
-
-
-
-
- 6.2.5 The Lexical Environment and Environment Record Specification Types
-
- The Lexical Environment and Environment
- Record types are used to explain the behaviour of name resolution in nested functions and blocks. These types and the
- operations upon them are defined in 8.1 .
-
-
-
-
-
6.2.6 Data
- Blocks
-
-
The Data Block specification type is used to describe a distinct and mutable sequence of byte-sized (8 bit) numeric
- values. A Data Block value is created with a fixed number of bytes that each have the initial value 0.
-
-
For notational convenience within this specification, an array-like syntax can be used to express to the individual
- bytes of a Data Block value. This notation presents a Data Block value as a 0-origined integer indexed sequence of bytes.
- For example, if db is a 5 byte Data Block value then db [2] can be used to express access to its
- 3rd byte.
-
-
The following abstract operations are used in this specification to operate upon Data Block values:
-
-
-
- 6.2.6.1 CreateByteDataBlock(size)
-
- When the abstract operation CreateByteDataBlock is called with integer argument size , the following steps
- are taken:
-
-
- Assert : size ≥0.
- Let db be a new Data Block value consisting of size bytes. If it is
- impossible to create such a Data Block , throw a RangeError exception.
- Set all of the bytes of db to 0.
- Return db .
-
-
-
-
- 6.2.6.2 CopyDataBlockBytes(toBlock, toIndex, fromBlock, fromIndex, count)
-
- When the abstract operation CopyDataBlockBytes is called the following steps are taken:
-
-
- Assert : fromBlock and toBlock are distinct Data Block values.
- Assert : fromIndex , toIndex , and count are positive
- integer values.
- Let fromSize be the number of bytes in fromBlock .
- Assert : fromIndex +count ≤ fromSize .
- Let toSize be the number of bytes in toBlock .
- Assert : toIndex +count ≤ toSize .
- Repeat, while count >0
-
- Set toBlock [toIndex ] to the value of fromBlock [fromIndex ].
- Increment toIndex and fromIndex each by 1.
- Decrement count by 1.
-
-
- Return NormalCompletion (empty )
-
-
-
-
-
-
-
-
-
7 Abstract
- Operations
-
-
These operations are not a part of the ECMAScript language; they are defined here to solely to aid the specification of the
- semantics of the ECMAScript language. Other, more specialized abstract operations are defined throughout this
- specification.
-
-
-
-
-
7.1 Type
- Conversion
-
-
The ECMAScript language implicitly performs automatic type conversion as needed. To clarify the semantics of certain
- constructs it is useful to define a set of conversion abstract operations. The conversion abstract operations are
- polymorphic; they can accept a value of any ECMAScript language type or of a Completion Record value. But no other specification types are used with
- these operations.
-
-
-
- 7.1.1 ToPrimitive
- ( input [, PreferredType] )
-
- The abstract operation ToPrimitive takes an input argument and an optional argument PreferredType . The abstract operation ToPrimitive converts its input argument to a non-Object
- type. If an object is capable of converting to more than one primitive type, it may use the optional hint PreferredType to favour that type. Conversion occurs according to Table 9 :
-
-
- Table 9 — ToPrimitive Conversions
-
-
- Input Type
- Result
-
-
- Completion Record
- If input is an abrupt completion , return input . Otherwise return ToPrimitive(input .[[value]]) also passing the optional hint PreferredType .
-
-
- Undefined
- Return input .
-
-
- Null
- Return input .
-
-
- Boolean
- Return input .
-
-
- Number
- Return input .
-
-
- String
- Return input .
-
-
- Symbol
- Return input .
-
-
- Object
- Perform the steps following this table.
-
-
-
-
- When Type (input ) is Object, the following steps are taken:
-
-
- If PreferredType was not passed, let hint be "default"
.
- Else if PreferredType is hint String, let hint be "string"
.
- Else PreferredType is hint Number, let hint be "number"
.
- Let exoticToPrim be GetMethod (input , @@toPrimitive).
- ReturnIfAbrupt (exoticToPrim ).
- If exoticToPrim is not undefined , then
-
- Let result be Call (exoticToPrim , input,
- «hint »).
- ReturnIfAbrupt (result ).
- If Type (result ) is not Object, return
- result .
- Throw a TypeError exception.
-
-
- If hint is "default"
, let hint be "number"
.
- Return OrdinaryToPrimitive(input,hint ).
-
-
- When the abstract operation OrdinaryToPrimitive is called with arguments O and hint , the following
- steps are taken:
-
-
- Assert : Type (O ) is
- Object
- Assert : Type (hint )
- is String and its value is either "string"
or "number"
.
- If hint is "string"
, then
-
- Let methodNames be «"toString"
, "valueOf"
».
-
-
- Else,
-
- Let methodNames be «"valueOf"
, "toString"
».
-
-
- For each name in methodNames in List order, do
-
- Let method be Get (O , name ).
- ReturnIfAbrupt (method ).
- If IsCallable (method ) is true , then
-
- Let result be Call (method , O ).
- ReturnIfAbrupt (result ).
- If Type (result ) is not Object, return
- result .
-
-
-
-
- Throw a TypeError exception.
-
-
-
-
NOTE When ToPrimitive is called with no hint, then it generally behaves as if the hint were
- Number. However, objects may over-ride this behaviour by defining a @@toPrimitive method. Of the objects defined in this
- specification only Date objects (see 20.3.4.45 ) and Symbol objects (see 19.4.3.4 ) over-ride the default ToPrimitive behaviour. Date objects
- treat no hint as if the hint were String.
-
-
-
-
- 7.1.2 ToBoolean (
- argument )
-
- The abstract operation ToBoolean converts argument to a value of type Boolean according to Table 10 :
-
-
- Table 10 — ToBoolean Conversions
-
-
- Argument Type
- Result
-
-
- Completion Record
- If argument is an abrupt completion , return argument . Otherwise return ToBoolean(argument .[[value]]).
-
-
- Undefined
- Return false .
-
-
- Null
- Return false .
-
-
- Boolean
- Return argument .
-
-
- Number
- Return false if argument is +0 , −0 , or NaN ; otherwise return true .
-
-
- String
- Return false if argument is the empty String (its length is zero); otherwise return true .
-
-
- Symbol
- Return true .
-
-
- Object
- Return true .
-
-
-
-
-
-
-
-
7.1.3 ToNumber (
- argument )
-
-
The abstract operation ToNumber converts argument to a value of type Number according to Table 11 :
-
-
- Table 11 — ToNumber Conversions
-
-
- Argument Type
- Result
-
-
- Completion Record
- If argument is an abrupt completion , return argument . Otherwise return ToNumber(argument .[[value]]).
-
-
- Undefined
- Return NaN .
-
-
- Null
- Return +0 .
-
-
- Boolean
- Return 1 if argument is true . Return +0 if argument is false .
-
-
- Number
- Return argument (no conversion).
-
-
- String
- See grammar and conversion algorithm below.
-
-
- Symbol
- Throw a TypeError exception.
-
-
- Object
-
-
- Apply the following steps:
-
-
- Let primValue be ToPrimitive (argument , hint Number).
- Return ToNumber(primValue ).
-
-
-
-
-
-
-
-
-
-
7.1.3.1 ToNumber Applied to the String Type
-
-
ToNumber applied to Strings applies the following grammar to the input String interpreted
- as a sequence of UTF-16 encoded code points (6.1.4 ). If the
- grammar cannot interpret the String as an expansion of StringNumericLiteral , then the result of
- ToNumber is NaN .
-
-
-
NOTE The terminal symbols of this grammar are all composed of Unicode BMP code points so
- the result will be NaN if the string contains the UTF-16 encoding of any supplementary code points or any
- unpaired surrogate code points
-
-
-
Syntax
-
-
-
StringNumericLiteral :::
-
StrWhiteSpace opt
-
StrWhiteSpace opt StrNumericLiteral StrWhiteSpace opt
-
-
-
-
StrWhiteSpace :::
-
StrWhiteSpaceChar StrWhiteSpace opt
-
-
-
-
StrWhiteSpaceChar :::
-
WhiteSpace
-
LineTerminator
-
-
-
-
StrNumericLiteral :::
-
StrDecimalLiteral
-
BinaryIntegerLiteral
-
OctalIntegerLiteral
-
HexIntegerLiteral
-
-
-
-
StrDecimalLiteral :::
-
StrUnsignedDecimalLiteral
-
+
StrUnsignedDecimalLiteral
-
-
StrUnsignedDecimalLiteral
-
-
-
-
StrUnsignedDecimalLiteral :::
-
Infinity
-
DecimalDigits .
DecimalDigits opt ExponentPart opt
-
.
DecimalDigits ExponentPart opt
-
DecimalDigits ExponentPart opt
-
-
-
-
DecimalDigits :::
-
DecimalDigit
-
DecimalDigits DecimalDigit
-
-
-
-
DecimalDigit ::: one of
-
0
1
2
3
4
5
6
7
8
9
-
-
-
-
ExponentPart :::
-
ExponentIndicator SignedInteger
-
-
-
-
ExponentIndicator ::: one of
-
e
E
-
-
-
-
SignedInteger :::
-
DecimalDigits
-
+
DecimalDigits
-
-
DecimalDigits
-
-
-
All grammar symbols not explicitly defined above have the definitions used in the Lexical Grammar for numeric
- literals (11.8.3 )
-
-
-
NOTE Some differences should be noted between the syntax of a StringNumericLiteral
- and a NumericLiteral (see 11.8.3 ):
-
-
-
- A StringNumericLiteral may include leading and/or trailing white space and/or line terminators.
-
-
-
- A StringNumericLiteral that is decimal may have any number of leading 0
digits.
-
-
-
- A StringNumericLiteral that is decimal may include a +
or -
to indicate its
- sign.
-
-
-
- A StringNumericLiteral that is empty or contains only white space is converted to +0 .
-
-
-
- Infinity
and –Infinity
are recognized as a StringNumericLiteral but not
- as a NumericLiteral .
-
-
-
-
-
-
- 7.1.3.1.1 Runtime Semantics: MV’s
-
- The conversion of a String to a Number value is similar overall to the determination of the Number value for a
- numeric literal (see 11.8.3 ), but some of the details are different, so the
- process for converting a String numeric literal to a value of Number type is given here. This value is determined in two
- steps: first, a mathematical value (MV) is derived from the String numeric literal; second, this mathematical value is
- rounded as described below. The MV on any grammar symbol, not provided below, is the MV for that symbol defined in 11.8.3.1 .
-
-
-
- The MV of StringNumericLiteral ::: [empty] is 0.
-
-
-
- The MV of StringNumericLiteral ::: StrWhiteSpace is 0.
-
-
-
- The MV of StringNumericLiteral ::: StrWhiteSpace opt StrNumericLiteral StrWhiteSpace opt is the MV of StrNumericLiteral , no matter whether white space is present or not.
-
-
-
- The MV of StrNumericLiteral ::: StrDecimalLiteral is the MV of StrDecimalLiteral .
-
-
-
- The MV of StrNumericLiteral ::: BinaryIntegerLiteral is the MV of BinaryIntegerLiteral .
-
-
-
- The MV of StrNumericLiteral ::: OctalIntegerLiteral is the MV of OctalIntegerLiteral .
-
-
-
- The MV of StrNumericLiteral ::: HexIntegerLiteral is the MV of HexIntegerLiteral .
-
-
-
- The MV of StrDecimalLiteral ::: StrUnsignedDecimalLiteral is the MV of StrUnsignedDecimalLiteral .
-
-
-
- The MV of StrDecimalLiteral ::: +
StrUnsignedDecimalLiteral is the MV of StrUnsignedDecimalLiteral .
-
-
-
- The MV of StrDecimalLiteral ::: -
StrUnsignedDecimalLiteral is the negative of the MV of StrUnsignedDecimalLiteral . (Note that if the MV of StrUnsignedDecimalLiteral is 0, the negative of this MV is also 0. The rounding rule described
- below handles the conversion of this signless mathematical zero to a floating-point +0 or −0 as
- appropriate.)
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: Infinity is 1010000 (a value
- so large that it will round to +∞ ).
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: DecimalDigits .
is the MV of DecimalDigits .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: DecimalDigits .
DecimalDigits is the MV of
- the first DecimalDigits plus (the MV of the second DecimalDigits
- times 10−n ), where n is the
- number of code points in the second DecimalDigits .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: DecimalDigits .
ExponentPart is the MV of
- DecimalDigits times 10e , where e is the MV of ExponentPart .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: DecimalDigits .
DecimalDigits ExponentPart is (the MV of the first DecimalDigits plus (the MV of the second
- DecimalDigits times 10−n )) times 10e , where n is the number
- of code points in the second DecimalDigits and e is the MV of ExponentPart .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: .
DecimalDigits is the MV of DecimalDigits times
- 10−n , where n is the number of code points in DecimalDigits .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: .
DecimalDigits ExponentPart is the MV of
- DecimalDigits times 10e −n , where n is the number of code points in
- DecimalDigits and e is the MV of ExponentPart .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: DecimalDigits is the MV of DecimalDigits .
-
-
-
- The MV of StrUnsignedDecimalLiteral ::: DecimalDigits ExponentPart is the MV of DecimalDigits times
- 10e , where e is the MV of ExponentPart .
-
-
-
- Once the exact MV for a String numeric literal has been determined, it is then rounded to a value of the Number type.
- If the MV is 0, then the rounded value is +0 unless the first non white space code point in the String numeric literal
- is ‘-
’, in which case the rounded value is −0. Otherwise, the rounded value must be the
- Number value for the MV (in the sense defined in 6.1.6 ), unless
- the literal includes a StrUnsignedDecimalLiteral and the literal has more than 20 significant
- digits, in which case the Number value may be either the Number value for the MV of a literal produced by replacing each
- significant digit after the 20th with a 0 digit or the Number value for the MV of a literal produced by replacing each
- significant digit after the 20th with a 0 digit and then incrementing the literal at the 20th digit position. A digit is
- significant if it is not part of an ExponentPart and
-
-
- it is not 0
; or
- there is a nonzero digit to its left and there is a nonzero digit, not in the ExponentPart , to its right.
-
-
-
-
-
-
- 7.1.4 ToInteger (
- argument )
-
- The abstract operation ToInteger converts argument to an integral numeric value. This abstract operation
- functions as follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , return +0 .
- If number is +0 , −0 , +∞, or −∞ , return number .
- Return the number value that is the same sign as number and whose magnitude is floor (abs (number )).
-
-
-
-
- 7.1.5 ToInt32 (
- argument )
-
- The abstract operation ToInt32 converts argument to one of 232 integer values in the range −231 through 231 −1 ,
- inclusive. This abstract operation functions as follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , +0 , −0 , +∞ , or −∞ , return
- +0 .
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor (abs (number )).
- Let int32bit be int modulo 232 .
- If int32bit ≥ 231 , return int32bit − 232 , otherwise return
- int32bit .
-
-
-
-
NOTE Given the above definition of ToInt32:
-
-
-
- The ToInt32 abstract operation is idempotent: if applied to a result that it produced, the second application
- leaves that value unchanged.
-
-
-
- ToInt32(ToUint32 (x)) is equal to ToInt32(x ) for all values of x .
- (It is to preserve this latter property that +∞ and −∞ are mapped to +0 .)
-
-
-
- ToInt32 maps −0 to +0 .
-
-
-
-
-
-
- 7.1.6 ToUint32 (
- argument )
-
- The abstract operation ToUint32 converts argument to one of 232 integer values in the range 0 through 232 −1 , inclusive. This abstract operation functions as
- follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , +0 , −0 , +∞ , or −∞ , return
- +0 .
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor (abs (number )).
- Let int32bit be int modulo 232 .
- Return int32bit .
-
-
-
-
NOTE Given the above definition of ToUint32:
-
-
-
- Step 6 is the only difference between ToUint32 and ToInt32 .
-
-
-
- The ToUint32 abstract operation is idempotent: if applied to a result that it produced, the second application
- leaves that value unchanged.
-
-
-
- ToUint32(ToInt32 (x )) is equal to ToUint32(x ) for all values of x .
- (It is to preserve this latter property that +∞ and −∞ are mapped to +0 .)
-
-
-
- ToUint32 maps −0 to +0 .
-
-
-
-
-
-
- 7.1.7 ToInt16 (
- argument )
-
- The abstract operation ToInt16 converts argument to one of 216 integer values in the range −32768
- through 32767 , inclusive. This abstract operation functions as
- follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , +0 , −0 , +∞ , or −∞ , return
- +0 .
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor (abs (number )).
- Let int16bit be int modulo 216 .
- If int16bit ≥ 215 , return int16bit − 216 , otherwise return
- int16bit .
-
-
-
-
- 7.1.8 ToUint16 (
- argument )
-
- The abstract operation ToUint16 converts argument to one of 216 integer values in the range 0 through 216 −1 , inclusive. This abstract operation functions as
- follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , +0 , −0 , +∞ , or −∞ , return
- +0 .
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor (abs (number )).
- Let int16bit be int modulo 216 .
- Return int16bit .
-
-
-
-
NOTE Given the above definition of ToUint16:
-
-
- The substitution of 216 for 232 in step 5 is the only difference between ToUint32 and ToUint16.
- ToUint16 maps −0 to +0 .
-
-
-
-
-
- 7.1.9 ToInt8 (
- argument )
-
- The abstract operation ToInt8 converts argument to one of 28 integer values in the range −128 through
- 127 , inclusive. This abstract operation functions as follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , +0 , −0 , +∞ , or −∞ , return
- +0 .
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor (abs (number )).
- Let int8bit be int modulo 28 .
- If int8bit ≥ 27 , return int8bit − 28 , otherwise return
- int8bit .
-
-
-
-
- 7.1.10 ToUint8 (
- argument )
-
- The abstract operation ToUint8 converts argument to one of 28 integer values in the range 0 through 255 , inclusive. This abstract operation functions as follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , +0 , −0 , +&ininfin; , or −∞ , return
- +0 .
- Let int be the mathematical value that is the same sign as number and whose magnitude is floor (abs (number )).
- Let int8bit be int modulo 28 .
- Return int8bit .
-
-
-
-
- 7.1.11
- ToUint8Clamp ( argument )
-
- The abstract operation ToUint8Clamp converts argument to one of 28 integer values in the range 0 through 255 , inclusive. This abstract operation functions as follows:
-
-
- Let number be ToNumber (argument ).
- ReturnIfAbrupt (number ).
- If number is NaN , return +0 .
- If number ≤ 0, return +0 .
- If number ≥ 255, return 255.
- Let f be floor (number ).
- If f + 0.5 < number , return f + 1.
- If number < f + 0.5, return f .
- If f is odd, return f + 1.
- Return f .
-
-
-
-
NOTE Note that unlike the other ECMAScript integer conversion abstract operation, ToUint8Clamp
- rounds rather than truncates non-integer values and does not convert +∞ to 0. ToUint8Clamp does “round
- half to even” tie-breaking. This differs from Math.round
which does
- “round half up” tie-breaking.
-
-
-
-
-
-
7.1.12 ToString (
- argument )
-
-
The abstract operation ToString converts argument to a value of type String according to Table 12 :
-
-
- Table 12 — ToString Conversions
-
-
- Argument Type
- Result
-
-
- Completion Record
- If argument is an abrupt completion , return argument . Otherwise return ToString(argument .[[value]]).
-
-
- Undefined
- Return "undefined"
.
-
-
- Null
- Return "null"
.
-
-
- Boolean
-
-
- If argument is true , return "true"
.
-
- If argument is false , return "false"
.
-
-
-
- Number
- See 7.1.12.1 .
-
-
- String
- Return argument .
-
-
- Symbol
- Throw a TypeError exception.
-
-
- Object
-
-
- Apply the following steps:
-
- 1. Let primValue be ToPrimitive (argument , hint String).
-
- 2. Return ToString(primValue ).
-
-
-
-
-
-
-
- 7.1.12.1 ToString Applied to the Number Type
-
- The abstract operation ToString converts a Number m to String format as
- follows:
-
-
- If m is NaN , return the String "NaN"
.
- If m is +0 or −0 , return the String "0"
.
- If m is less than zero, return the String concatenation of the String "-"
and ToString (−m ).
- If m is +∞, return the String "Infinity"
.
- Otherwise, let n , k , and s be integers such that k ≥ 1, 10k −1
- ≤ s < 10k , the Number value for s × 10n−k is
- m , and k is as small as possible. Note that k is the number of digits in the decimal
- representation of s , that s is not divisible by 10, and that the least significant digit of s
- is not necessarily uniquely determined by these criteria.
- If k ≤ n ≤ 21, return the String consisting of the code units of the k digits of the
- decimal representation of s (in order, with no leading zeroes), followed by n−k occurrences of
- the code unit 0x0030 (DIGIT ZERO).
- If 0 < n ≤ 21, return the String consisting of the code units of the most significant n digits
- of the decimal representation of s , followed by the code unit 0x002E (FULL STOP), followed by the code units
- of the remaining k−n digits of the decimal representation of s .
- If −6 < n ≤ 0, return the String consisting of the code unit 0x0030 (DIGIT ZERO), followed by the
- code unit 0x002E (FULL STOP), followed by −n occurrences of the code unit 0x0030 (DIGIT ZERO), followed
- by the code units of the k digits of the decimal representation of s .
- Otherwise, if k = 1, return the String consisting of the code unit of the single digit of s , followed
- by code unit 0x0065 (LATIN SMALL LETTER E), followed by the code unit 0x002B (PLUS SIGN) or the code unit 0x002D
- (HYPHEN-MINUS) according to whether n −1 is positive or negative, followed by the code units of the
- decimal representation of the integer abs (n −1) (with no
- leading zeroes).
- Return the String consisting of the code units of the most significant digit of the decimal representation of
- s , followed by code unit 0x002E (FULL STOP), followed by the code units of the remaining k −1
- digits of the decimal representation of s , followed by code unit 0x0065 (LATIN SMALL LETTER E), followed by
- code unit 0x002B (PLUS SIGN) or the code unit 0x002D (HYPHEN-MINUS) according to whether n −1 is
- positive or negative, followed by the code units of the decimal representation of the integer abs (n −1) (with no leading zeroes).
-
-
-
-
NOTE 1 The following observations may be useful as guidelines for implementations, but are
- not part of the normative requirements of this Standard:
-
-
-
- If x is any Number value other than −0 , then ToNumber (ToString (x)) is exactly the same Number value as x.
-
-
-
- The least significant digit of s is not always uniquely determined by the requirements listed in step 5.
-
-
-
-
-
-
NOTE 2 For implementations that provide more accurate conversions than required by the rules
- above, it is recommended that the following alternative version of step 5 be used as a guideline:
-
-
Otherwise, let n , k , and s be integers such that k ≥ 1, 10k −1
- ≤ s < 10k , the Number value for s × 10n −k is
- m , and k is as small as possible. If there are multiple possibilities for s , choose the value of
- s for which s × 10n −k is closest in value to m . If there are
- two such possible values of s , choose the one that is even. Note that k is the number of digits in the
- decimal representation of s and that s is not divisible by 10.
-
-
-
-
-
-
-
- 7.1.13 ToObject (
- argument )
-
- The abstract operation ToObject converts argument to a value of type Object according to Table 13 :
-
-
- Table 13 — ToObject Conversions
-
-
- Argument Type
- Result
-
-
- Completion Record
- If argument is an abrupt completion , return argument . Otherwise return ToObject(argument .[[value]]).
-
-
- Undefined
- Throw a TypeError exception.
-
-
- Null
- Throw a TypeError exception.
-
-
- Boolean
- Return a new Boolean object whose [[BooleanData]] internal slot is set to the value of argument . See 19.3 for a description of Boolean objects.
-
-
- Number
- Return a new Number object whose [[NumberData]] internal slot is set to the value of argument . See 20.1 for a description of Number objects.
-
-
- String
- Return a new String object whose [[StringData]] internal slot is set to the value of argument . See 21.1 for a description of String objects.
-
-
- Symbol
- Return a new Symbol object whose [[SymbolData]] internal slot is set to the value of argument . See 19.4 for a description of Symbol objects.
-
-
- Object
- Return argument .
-
-
-
-
-
-
- 7.1.14
- ToPropertyKey ( argument )
-
- The abstract operation ToPropertyKey converts argument to a value that can be used as a property key by performing the following steps:
-
-
- Let key be ToPrimitive (argument , hint String).
- ReturnIfAbrupt (key ).
- If Type (key ) is Symbol, then
-
- Return key .
-
-
- Return ToString (key ).
-
-
-
-
- 7.1.15 ToLength (
- argument )
-
- The abstract operation ToLength converts argument to an integer suitable for use as the length of an
- array-like object. It performs the following steps:
-
-
- ReturnIfAbrupt (argument ).
- Let len be ToInteger (argument ).
- ReturnIfAbrupt (len ).
- If len ≤ +0, return +0.
- If len is +∞ , return 253 -1.
- Return min(len , 253 -1).
-
-
-
-
- 7.1.16 CanonicalNumericIndexString ( argument )
-
- The abstract operation CanonicalNumericIndexString returns argument converted to a numeric value if it is a
- String representation of a Number that would be produced by ToString , or the string
- "-0"
. Otherwise, it returns undefined. This abstract operation functions as
- follows:
-
-
- Assert : Type (argument ) is String.
- If argument is "-0"
, return −0.
- Let n be ToNumber (argument ).
- If SameValue (ToString (n ), argument ) is
- false , return undefined .
- Return n .
-
-
- A canonical numeric string is any String value for which the CanonicalNumericIndexString abstract operation does
- not return undefined .
-
-
-
-
-
-
7.2 Testing and Comparison Operations
-
-
-
- 7.2.1
- RequireObjectCoercible ( argument )
-
- The abstract operation RequireObjectCoercible throws an error if argument is a value that cannot be converted
- to an Object using ToObject . It is defined by Table 14 :
-
-
- Table 14 — RequireObjectCoercible Results
-
-
- Argument Type
- Result
-
-
- Completion Record
- If argument is an abrupt completion , return argument . Otherwise return RequireObjectCoercible(argument .[[value]]).
-
-
- Undefined
- Throw a TypeError exception.
-
-
- Null
- Throw a TypeError exception.
-
-
- Boolean
- Return argument .
-
-
- Number
- Return argument .
-
-
- String
- Return argument .
-
-
- Symbol
- Return argument .
-
-
- Object
- Return argument .
-
-
-
-
-
-
- 7.2.2 IsArray (
- argument )
-
- The abstract operation IsArray takes one argument argument , and performs the following steps:
-
-
- If Type (argument ) is not Object, return false .
- If argument is an Array exotic object , return true .
- If argument is a Proxy exotic object, then
-
- If the value of the [[ProxyHandler]] internal slot
- of argument is null , throw a TypeError exception.
- Let target be the value of the [[ProxyTarget]] internal slot of argument .
- Return IsArray(target ).
-
-
- Return false .
-
-
-
-
- 7.2.3 IsCallable (
- argument )
-
- The abstract operation IsCallable determines if argument , which must be an ECMAScript language value or a Completion Record , is a callable function with a [[Call]] internal
- method.
-
-
- ReturnIfAbrupt (argument ).
- If Type (argument ) is not Object, return false .
- If argument has a [[Call]] internal method, return true .
- Return false .
-
-
-
-
- 7.2.4
- IsConstructor ( argument )
-
- The abstract operation IsConstructor determines if argument , which must be an ECMAScript language value or a Completion Record , is a function object with a [[Construct]] internal
- method.
-
-
- ReturnIfAbrupt (argument ).
- If Type (argument ) is not Object, return false .
- If argument has a [[Construct]] internal method, return true .
- Return false .
-
-
-
-
- 7.2.5
- IsExtensible (O)
-
- The abstract operation IsExtensible is used to determine whether
- additional properties can be added to the object that is O . A Boolean value is returned. This abstract operation
- performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Return O .[[IsExtensible]]().
-
-
-
-
- 7.2.6 IsInteger (
- argument )
-
- The abstract operation IsInteger determines if argument is a finite integer numeric value.
-
-
- ReturnIfAbrupt (argument ).
- If Type (argument ) is not Number, return false .
- If argument is NaN , +∞ , or −∞ , return false .
- If floor (abs (argument )) ≠
- abs (argument ), return false .
- Return true .
-
-
-
-
-
-
- 7.2.8 IsRegExp (
- argument )
-
- The abstract operation IsRegExp with argument argument performs the following steps:
-
-
- If Type (argument ) is not Object, return false .
- Let isRegExp be Get (argument , @@match).
- ReturnIfAbrupt (isRegExp ).
- If isRegExp is not undefined , return ToBoolean (isRegExp ).
- If argument has a [[RegExpMatcher]] internal
- slot , return true .
- Return false .
-
-
-
-
- 7.2.9 SameValue(x,
- y)
-
- The internal comparison abstract operation SameValue(x , y ), where x and y are
- ECMAScript language values , produces true or false . Such a
- comparison is performed as follows:
-
-
- ReturnIfAbrupt (x ).
- ReturnIfAbrupt (y ).
- If Type (x ) is different from Type (y ), return false .
- If Type (x ) is Undefined, return true .
- If Type (x ) is Null, return true .
- If Type (x ) is Number, then
-
- If x is NaN and y is NaN, return true .
- If x is +0 and y is -0, return false .
- If x is -0 and y is +0, return false .
- If x is the same Number value as y , return true .
- Return false .
-
-
- If Type (x ) is String, then
-
- If x and y are exactly the same sequence of code units (same length and same code units at
- corresponding indices) return true ; otherwise, return false .
-
-
- If Type (x ) is Boolean, then
-
- If x and y are both true or both false , return true ; otherwise, return
- false .
-
-
- If Type (x ) is Symbol, then
-
- If x and y are both the same Symbol value, return true ; otherwise, return false .
-
-
- Return true if x and y are the same Object value. Otherwise, return false .
-
-
-
-
- 7.2.10
- SameValueZero(x, y)
-
- The internal comparison abstract operation SameValueZero(x , y ), where x and y
- are ECMAScript language values , produces true or false . Such a
- comparison is performed as follows:
-
-
- ReturnIfAbrupt (x ).
- ReturnIfAbrupt (y ).
- If Type (x ) is different from Type (y ), return false .
- If Type (x ) is Undefined, return true .
- If Type (x ) is Null, return true .
- If Type (x ) is Number, then
-
- If x is NaN and y is NaN, return true .
- If x is +0 and y is -0, return true .
- If x is -0 and y is +0, return true .
- If x is the same Number value as y , return true .
- Return false .
-
-
- If Type (x ) is String, then
-
- If x and y are exactly the same sequence of code units (same length and same code units at
- corresponding indices) return true ; otherwise, return false .
-
-
- If Type (x ) is Boolean, then
-
- If x and y are both true or both false , return true ; otherwise, return
- false .
-
-
- If Type (x ) is Symbol, then
-
- If x and y are both the same Symbol value, return true ; otherwise, return false .
-
-
- Return true if x and y are the same Object value. Otherwise, return false .
-
-
-
-
NOTE SameValueZero differs from SameValue only in its treatment of +0 and -0.
-
-
-
-
- 7.2.11 Abstract Relational Comparison
-
- The comparison x < y , where x and y are values, produces true ,
- false , or undefined (which indicates that at least one operand is NaN ). In addition to x and
- y the algorithm takes a Boolean flag named LeftFirst as a parameter. The flag is used to
- control the order in which operations with potentially visible side-effects are performed upon x and
- y . It is necessary because ECMAScript specifies left to right evaluation of expressions. The default value of
- LeftFirst is true and indicates that the x parameter corresponds to an expression
- that occurs to the left of the y parameter’s corresponding expression. If LeftFirst
- is false , the reverse is the case and operations must be performed upon y before x . Such a
- comparison is performed as follows:
-
-
- ReturnIfAbrupt (x ).
- ReturnIfAbrupt (y ).
- If the LeftFirst flag is true , then
-
- Let px be ToPrimitive (x , hint Number).
- ReturnIfAbrupt (px ).
- Let py be ToPrimitive (y , hint Number).
- ReturnIfAbrupt (py ).
-
-
- Else the order of evaluation needs to be reversed to preserve left to right evaluation
-
- Let py be ToPrimitive (y , hint Number).
- ReturnIfAbrupt (py ).
- Let px be ToPrimitive (x , hint Number).
- ReturnIfAbrupt (px ).
-
-
- If both px and py are Strings, then
-
- If py is a prefix of px , return false . (A String value p is a prefix of String value
- q if q can be the result of concatenating p and some other String r . Note that any
- String is a prefix of itself, because r may be the empty String.)
- If px is a prefix of py , return true .
- Let k be the smallest nonnegative integer such that the code unit at index k within px is
- different from the code unit at index k within py . (There must be such a k , for neither
- String is a prefix of the other.)
- Let m be the integer that is the code unit value at index k within px .
- Let n be the integer that is the code unit value at index k within py .
- If m < n , return true . Otherwise, return false .
-
-
- Else,
-
- Let nx be ToNumber (px ). Because px and py are primitive
- values evaluation order is not important.
- ReturnIfAbrupt (nx ).
- Let ny be ToNumber (py ).
- ReturnIfAbrupt (ny ).
- If nx is NaN , return undefined .
- If ny is NaN , return undefined .
- If nx and ny are the same Number value, return false .
- If nx is +0 and ny is −0 , return false .
- If nx is −0 and ny is +0 , return false .
- If nx is +∞ , return false .
- If ny is +∞ , return true .
- If ny is −∞ , return false .
- If nx is −∞ , return true .
- If the mathematical value of nx is less than the mathematical value of ny —note that these
- mathematical values are both finite and not both zero—return true . Otherwise, return
- false .
-
-
-
-
-
-
NOTE 1 Step 5 differs from step 11 in the algorithm for the addition operator +
- (12.7.3 ) in using “and” instead of “or”.
-
-
-
-
NOTE 2 The comparison of Strings uses a simple lexicographic ordering on sequences of code unit
- values. There is no attempt to use the more complex, semantically oriented definitions of character or string equality and
- collating order defined in the Unicode specification. Therefore String values that are canonically equal according to the
- Unicode standard could test as unequal. In effect this algorithm assumes that both Strings are already in normalized form.
- Also, note that for strings containing supplementary characters, lexicographic ordering on sequences of UTF-16 code unit
- values differs from that on sequences of code point values.
-
-
-
-
- 7.2.12 Abstract Equality Comparison
-
- The comparison x == y , where x and y are values, produces true or
- false . Such a comparison is performed as follows:
-
-
- ReturnIfAbrupt (x ).
- ReturnIfAbrupt (y ).
- If Type (x ) is the same as Type (y ), then
-
- Return the result of performing Strict Equality Comparison x === y .
-
-
- If x is null and y is undefined , return true .
- If x is undefined and y is null , return true .
- If Type (x ) is Number and Type (y ) is String, return the result of the comparison
- x == ToNumber (y ).
- If Type (x ) is String and Type (y ) is Number, return the result of the comparison ToNumber (x ) == y .
- If Type (x ) is Boolean, return the result of the comparison
- ToNumber (x ) == y .
- If Type (y ) is Boolean, return the result of the comparison
- x == ToNumber (y ).
- If Type (x ) is either String, Number, or Symbol and Type (y ) is Object, then return the result of the comparison
- x == ToPrimitive (y ).
- If Type (x ) is Object and Type (y ) is either String, Number, or Symbol, then return
- the result of the comparison ToPrimitive (x ) == y .
- Return false .
-
-
-
-
- 7.2.13 Strict Equality Comparison
-
- The comparison x === y , where x and y are values, produces true or
- false . Such a comparison is performed as follows:
-
-
- If Type (x ) is different from Type (y ), return false .
- If Type (x ) is Undefined, return true .
- If Type (x ) is Null, return true .
- If Type (x ) is Number, then
-
- If x is NaN , return false .
- If y is NaN , return false .
- If x is the same Number value as y , return true .
- If x is +0 and y is −0 , return true .
- If x is −0 and y is +0 , return true .
- Return false .
-
-
- If Type (x ) is String, then
-
- If x and y are exactly the same sequence of code units (same length and same code units at
- corresponding indices), return true .
- Else, return false .
-
-
- If Type (x ) is Boolean, then
-
- If x and y are both true or both false , return true .
- Else, return false .
-
-
- If x and y are the same Symbol value, return true .
- If x and y are the same Object value, return true .
- Return false .
-
-
-
-
-
-
-
-
-
7.3
- Operations on Objects
-
-
-
- 7.3.1 Get (O, P)
-
- The abstract operation Get is used to retrieve the value of a specific
- property of an object. The operation is called with arguments O and P where O is the
- object and P is the property key . This abstract operation performs the following
- steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Return O .[[Get]](P , O ).
-
-
-
-
- 7.3.2 GetV (V, P)
-
- The abstract operation GetV is used to retrieve the value of a specific property of an ECMAScript language value . If the value is not an object, the property lookup is
- performed using a wrapper object appropriate for the type of the value. The operation is called with arguments V
- and P where V is the value and P is the property key . This
- abstract operation performs the following steps:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let O be ToObject (V ).
- ReturnIfAbrupt (O ).
- Return O .[[Get]](P , V ).
-
-
-
-
- 7.3.3 Set (O,
- P, V, Throw)
-
- The abstract operation Set is used to set the value of a specific
- property of an object. The operation is called with arguments O , P , V , and Throw where O is the object, P is the property key ,
- V is the new value for the property and Throw is a Boolean flag. This abstract operation
- performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Assert : Type (Throw ) is Boolean.
- Let success be O .[[Set]](P , V , O ).
- ReturnIfAbrupt (success ).
- If success is false and Throw is true , throw a TypeError exception.
- Return success .
-
-
-
-
- 7.3.4
- CreateDataProperty (O, P, V)
-
- The abstract operation CreateDataProperty is used to create a new own
- property of an object. The operation is called with arguments O , P , and V where
- O is the object, P is the property key , and V is the value
- for the property. This abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Let newDesc be the PropertyDescriptor{[[Value]]: V , [[Writable]]: true , [[Enumerable]]:
- true , [[Configurable]]: true }.
- Return O .[[DefineOwnProperty]](P , newDesc ).
-
-
-
-
NOTE This abstract operation creates a property whose attributes are set to the same defaults
- used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist.
- If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return
- false .
-
-
-
-
- 7.3.5
- CreateMethodProperty (O, P, V)
-
- The abstract operation CreateMethodProperty is used to create a new own
- property of an object. The operation is called with arguments O , P , and V where
- O is the object, P is the property key , and V is the value
- for the property. This abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Let newDesc be the PropertyDescriptor{[[Value]]: V , [[Writable]]: true , [[Enumerable]]:
- false , [[Configurable]]: true }.
- Return O .[[DefineOwnProperty]](P , newDesc ).
-
-
-
-
NOTE This abstract operation creates a property whose attributes are set to the same defaults
- used for built-in methods and methods defined using class declaration syntax. Normally, the property will not already
- exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return
- false .
-
-
-
-
- 7.3.6 CreateDataPropertyOrThrow (O, P, V)
-
- The abstract operation CreateDataPropertyOrThrow is used to create a
- new own property of an object. It throws a TypeError exception if the requested property update
- cannot be performed. The operation is called with arguments O , P , and V where O
- is the object, P is the property key , and V is the value for the
- property. This abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Let success be CreateDataProperty (O , P , V ).
- ReturnIfAbrupt (success ).
- If success is false , throw a TypeError exception.
- Return success .
-
-
-
-
NOTE This abstract operation creates a property whose attributes are set to the same defaults
- used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist.
- If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return false
- causing this operation to throw a TypeError exception .
-
-
-
-
- 7.3.7
- DefinePropertyOrThrow (O, P, desc)
-
- The abstract operation DefinePropertyOrThrow is used to call the
- [[DefineOwnProperty]] internal method of an object in a manner that will throw a TypeError exception if the requested
- property update cannot be performed. The operation is called with arguments O , P , and desc
- where O is the object, P is the property key , and desc is
- the Property Descriptor for the property. This abstract operation
- performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Let success be O .[[DefineOwnProperty]](P , desc ).
- ReturnIfAbrupt (success ).
- If success is false , throw a TypeError exception.
- Return success .
-
-
-
-
- 7.3.8
- DeletePropertyOrThrow (O, P)
-
- The abstract operation DeletePropertyOrThrow is used to remove a specific own property of an object. It throws an
- exception if the property is not configurable. The operation is called with arguments O and P where
- O is the object and P is the property key . This abstract operation
- performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Let success be O .[[Delete]](P ).
- ReturnIfAbrupt (success ).
- If success is false , throw a TypeError exception.
- Return success .
-
-
-
-
- 7.3.9 GetMethod (O,
- P)
-
- The abstract operation GetMethod is used to get the value of a specific property of an object when the value of the
- property is expected to be a function. The operation is called with arguments O and P where
- O is the object, P is the property key . This abstract operation
- performs the following steps:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let func be GetV (O , P ).
- ReturnIfAbrupt (func ).
- If func is either undefined or null , return undefined .
- If IsCallable (func ) is false , throw a TypeError exception.
- Return func .
-
-
-
-
- 7.3.10
- HasProperty (O, P)
-
- The abstract operation HasProperty is used to determine whether an object has a property with the specified property key . The property may be either an own or inherited. A Boolean value is returned. The
- operation is called with arguments O and P where O is the object and P is the
- property key . This abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Return O .[[HasProperty]](P ).
-
-
-
-
- 7.3.11
- HasOwnProperty (O, P)
-
- The abstract operation HasOwnProperty is used to determine whether an object has an own property with the specified property key . A Boolean value is returned. The operation is called with arguments O
- and P where O is the object and P is the property key . This
- abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : IsPropertyKey (P ) is
- true .
- Let desc be O .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (desc ).
- If desc is undefined , return false .
- Return true .
-
-
-
-
- 7.3.12 Call(F, V,
- [argumentsList])
-
- The abstract operation Call is used to call the [[Call]] internal method of a function object. The operation is called
- with arguments F , V , and optionally argumentsList where F is the function
- object, V is an ECMAScript language value that is the this
- value of the [[Call]], and argumentsList is the value passed to the corresponding argument of the internal
- method. If argumentsList is not present, an empty List is
- used as its value. This abstract operation performs the following steps:
-
-
- ReturnIfAbrupt (F ).
- If argumentsList was not passed, let argumentsList be a new empty List .
- If IsCallable (F ) is false , throw a TypeError exception.
- Return F .[[Call]](V , argumentsList ).
-
-
-
-
- 7.3.13 Invoke(O,P,
- [argumentsList])
-
- The abstract operation Invoke is used to call a method property of an
- object. The operation is called with arguments O , P , and optionally argumentsList where
- O serves as both the lookup point for the property and the this value of the call, P is the property key , and argumentsList is the list of arguments values passed to the method.
- If argumentsList is not present, an empty List is used as
- its value. This abstract operation performs the following steps:
-
-
- Assert : P is a valid property key .
- If argumentsList was not passed, let argumentsList be a new empty List .
- Let func be GetV (O , P ).
- Return Call (func , O , argumentsList ).
-
-
-
-
- 7.3.14 Construct
- (F, [argumentsList], [newTarget])
-
- The abstract operation Construct is used to call the [[Construct]] internal method of a function object. The operation is
- called with arguments F , and optionally argumentsList , and
- newTarget where F is the function object. argumentsList and newTarget are the
- values to be passed as the corresponding arguments of the internal method. If argumentsList is not present, an
- empty List is used as its value. If newTarget is not
- present, F is used as its value. This abstract operation performs the following steps:
-
-
- If newTarget was not passed, let newTarget be F .
- If argumentsList was not passed, let argumentsList be a new empty List .
- Assert : IsConstructor (F ) is
- true .
- Assert : IsConstructor (newTarget ) is
- true .
- Return F .[[Construct]](argumentsList , newTarget ).
-
-
-
-
NOTE If newTarget is not passed, this operation is equivalent to: new
- F(...argumentsList)
-
-
-
-
- 7.3.15
- SetIntegrityLevel (O, level)
-
- The abstract operation SetIntegrityLevel is used to fix the set of own
- properties of an object. This abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : level is either "sealed"
or
- "frozen"
.
- Let status be O .[[PreventExtensions]]().
- ReturnIfAbrupt (status ).
- If status is false , return false .
- Let keys be O .[[OwnPropertyKeys]]().
- ReturnIfAbrupt (keys ).
- If level is "sealed"
, then
-
- Repeat for each element k of keys ,
-
- Let status be DefinePropertyOrThrow (O , k ,
- PropertyDescriptor{ [[Configurable]]: false }).
- ReturnIfAbrupt (status ).
-
-
-
-
- Else level is "frozen"
,
-
- Repeat for each element k of keys ,
-
- Let currentDesc be O .[[GetOwnProperty]](k ).
- ReturnIfAbrupt (currentDesc ).
- If currentDesc is not undefined , then
-
- If IsAccessorDescriptor (currentDesc ) is true , then
-
- Let desc be the PropertyDescriptor{[[Configurable]]: false }.
-
-
- Else,
-
- Let desc be the PropertyDescriptor { [[Configurable]]: false , [[Writable]]: false
- }.
-
-
- Let status be DefinePropertyOrThrow (O , k ,
- desc ).
- ReturnIfAbrupt (status ).
-
-
-
-
-
-
- Return true .
-
-
-
-
- 7.3.16
- TestIntegrityLevel (O, level)
-
- The abstract operation TestIntegrityLevel is used to determine if the
- set of own properties of an object are fixed. This abstract operation performs the following steps:
-
-
- Assert : Type (O ) is
- Object.
- Assert : level is either "sealed"
or
- "frozen"
.
- Let status be IsExtensible (O ).
- ReturnIfAbrupt (status ).
- If status is true , return false
- NOTE If the object is extensible, none of its properties are examined.
- Let keys be O .[[OwnPropertyKeys]]().
- ReturnIfAbrupt (keys ).
- Repeat for each element k of keys ,
-
- Let currentDesc be O .[[GetOwnProperty]](k ).
- ReturnIfAbrupt (currentDesc ).
- If currentDesc is not undefined , then
-
- If currentDesc .[[Configurable]] is true , return false .
- If level is "frozen"
and IsDataDescriptor (currentDesc ) is true , then
-
- If currentDesc .[[Writable]] is true , return false .
-
-
-
-
-
-
- Return true .
-
-
-
-
- 7.3.17
- CreateArrayFromList (elements)
-
- The abstract operation CreateArrayFromList is used to create an Array
- object whose elements are provided by a List . This abstract operation
- performs the following steps:
-
-
- Assert : elements is a List whose elements are all ECMAScript language values .
- Let array be ArrayCreate (0) (see 9.4.2.2 ).
- Let n be 0.
- For each element e of elements
-
- Let status be CreateDataProperty (array , ToString (n ), e ).
- Assert : status is true .
- Increment n by 1.
-
-
- Return array .
-
-
-
-
- 7.3.18 CreateListFromArrayLike (obj [, elementTypes] )
-
- The abstract operation CreateListFromArrayLike is used to create a List value whose elements are provided by the indexed
- properties of an array-like object, obj . The optional argument elementTypes is a List containing the names of ECMAScript Language Types that are allowed
- for element values of the List that is created. This abstract
- operation performs the following steps:
-
-
- ReturnIfAbrupt (obj ).
- If elementTypes was not passed, let elementTypes be (Undefined, Null, Boolean, String, Symbol, Number,
- Object).
- If Type (obj ) is not Object, throw a TypeError
- exception.
- Let len be ToLength (Get (obj ,
- "length"
)).
- ReturnIfAbrupt (len ).
- Let list be an empty List .
- Let index be 0.
- Repeat while index < len
-
- Let indexName be ToString (index ).
- Let next be Get (obj , indexName ).
- ReturnIfAbrupt (next ).
- If Type (next ) is not an element of elementTypes ,
- throw a TypeError exception.
- Append next as the last element of list .
- Set index to index + 1.
-
-
- Return list .
-
-
-
-
- 7.3.19
- OrdinaryHasInstance (C, O)
-
- The abstract operation OrdinaryHasInstance implements the default
- algorithm for determining if an object O inherits from the instance object inheritance path provided by
- constructor C . This abstract operation performs the following steps:
-
-
- If IsCallable (C ) is false , return false .
- If C has a [[BoundTargetFunction]] internal slot , then
-
- Let BC be the value of C’s [[BoundTargetFunction]] internal slot .
- Return InstanceofOperator (O ,BC ) (see 12.9.4 ).
-
-
- If Type (O ) is not Object, return false .
- Let P be Get (C , "prototype"
).
- ReturnIfAbrupt (P ).
- If Type (P ) is not Object, throw a TypeError
- exception.
- Repeat
-
- Let O be O .[[GetPrototypeOf]]().
- ReturnIfAbrupt (O ).
- If O is null
, return false .
- If SameValue (P , O ) is true , return true .
-
-
-
-
-
-
- 7.3.20
- SpeciesConstructor ( O, defaultConstructor )
-
- The abstract operation SpeciesConstructor is used to retrieve the constructor that should be used to create new objects
- that are derived from the argument object O . The defaultConstructor argument is the constructor to use
- if a constructor @@species property cannot be found starting from O . This abstract operation performs the
- following steps:
-
-
- Assert : Type (O ) is
- Object.
- Let C be Get (O , "constructor"
).
- ReturnIfAbrupt (C ).
- If C is undefined , return defaultConstructor .
- If Type (C ) is not Object, throw a TypeError
- exception.
- Let S be Get (C , @@species).
- ReturnIfAbrupt (S ).
- If S is either undefined or null , return defaultConstructor .
- If IsConstructor (S ) is true , return S.
- Throw a TypeError exception.
-
-
-
-
- 7.3.21
- EnumerableOwnNames (O)
-
- When the abstract operation EnumerableOwnNames is called with Object O the following steps are taken:
-
-
- Assert : Type (O )
- is Object.
- Let ownKeys be O .[[OwnPropertyKeys]]().
- ReturnIfAbrupt (ownKeys ).
- Let names be a new empty List .
- Repeat, for each element key of ownKeys in List
- order
-
- If Type (key ) is String, then
-
- Let desc be O .[[GetOwnProperty]](key ).
- ReturnIfAbrupt (desc ).
- If desc is not undefined , then
-
- If desc. [[Enumerable]] is true , append key to names .
-
-
-
-
-
-
- Order the elements of names so they are in the same relative order as would be produced by the Iterator that
- would be returned if the [[Enumerate]] internal method was invoked on O .
- Return names .
-
-
-
-
NOTE The order of elements is returned list is the same as the enumeration order that used by a
- for-in statement.
-
-
-
-
- 7.3.22
- GetFunctionRealm ( obj )
-
- The abstract operation GetFunctionRealm with argument obj performs the following steps:
-
-
- Assert : obj is a callable object.
- If obj has a [[Realm]] internal slot , then
-
- Return obj ’s [[Realm]] internal
- slot .
-
-
- If obj is a Bound Function exotic object, then
-
- Let target be obj ’s [[BoundTargetFunction]]
- internal slot .
- Return GetFunctionRealm(target ).
-
-
- If obj is a Proxy exotic object, then
-
- If the value of the [[ProxyHandler]] internal slot
- of obj is null , throw a TypeError exception.
- Let proxyTarget be the value of obj ’s [[ProxyTarget]] internal slot .
- Return GetFunctionRealm(proxyTarget ).
-
-
- Return the running execution context ’s Realm .
-
-
-
-
NOTE Step 5 will only be reached if target is a non-standard exotic function object that
- does not have a [[Realm]] internal slot .
-
-
-
-
-
-
-
7.4 Operations on Iterator Objects
-
-
See Common Iteration Interfaces (25.1 ).
-
-
-
- 7.4.1 GetIterator
- ( obj, method )
-
- The abstract operation GetIterator with argument obj and
- optional argument method performs the following steps:
-
-
- ReturnIfAbrupt (obj ).
- If method was not passed, then
-
- Let method be GetMethod (obj , @@iterator).
- ReturnIfAbrupt (method ).
-
-
- Let iterator be Call (method ,obj ).
- ReturnIfAbrupt (iterator ).
- If Type (iterator ) is not Object, throw a TypeError
- exception.
- Return iterator .
-
-
-
-
- 7.4.2
- IteratorNext ( iterator, value )
-
- The abstract operation IteratorNext with argument iterator and optional argument value performs the
- following steps:
-
-
- If value was not passed, then
-
- Let result be Invoke (iterator , "next"
, «
- »).
-
-
- Else,
-
- Let result be Invoke (iterator , "next"
,
- «value »).
-
-
- ReturnIfAbrupt (result ).
- If Type (result ) is not Object, throw a TypeError
- exception.
- Return result .
-
-
-
-
- 7.4.3
- IteratorComplete ( iterResult )
-
- The abstract operation IteratorComplete with argument iterResult performs the following steps:
-
-
- Assert : Type (iterResult ) is Object.
- Return ToBoolean (Get (iterResult ,
- "done"
)).
-
-
-
-
- 7.4.4
- IteratorValue ( iterResult )
-
- The abstract operation IteratorValue with argument iterResult performs the following steps:
-
-
- Assert : Type (iterResult ) is Object.
- Return Get (iterResult , "value"
).
-
-
-
-
- 7.4.5
- IteratorStep ( iterator )
-
- The abstract operation IteratorStep with argument iterator requests the next value from iterator
- and returns either false indicating that the iterator has reached its end or the IteratorResult
- object if a next value is available. IteratorStep performs the following steps:
-
-
- Let result be IteratorNext (iterator ).
- ReturnIfAbrupt (result ).
- Let done be IteratorComplete (result ).
- ReturnIfAbrupt (done ).
- If done is true , return false .
- Return result .
-
-
-
-
- 7.4.6
- IteratorClose( iterator, completion )
-
- The abstract operation IteratorClose with arguments iterator and completion is used to notify an
- iterator that it should perform any actions it would normally perform when it has reached its completed state:
-
-
- Assert : Type (iterator ) is Object.
- Assert : completion is a Completion Record .
- Let return be GetMethod (iterator , "return"
).
- ReturnIfAbrupt (return ).
- If return is undefined , return Completion (completion ).
- Let innerResult be Call (return , iterator , « »).
- If completion .[[type]] is throw , return Completion (completion ).
- If innerResult .[[type]] is throw , return Completion (innerResult ).
- If Type (innerResult .[[value]]) is not Object, throw
- a TypeError exception.
- Return Completion (completion ).
-
-
-
-
- 7.4.7
- CreateIterResultObject ( value, done )
-
- The abstract operation CreateIterResultObject with arguments value and done creates an object that
- supports the IteratorResult interface by performing the following steps:
-
-
- Assert : Type (done )
- is Boolean.
- Let obj be ObjectCreate (%ObjectPrototype% ).
- Perform CreateDataProperty (obj , "value"
, value ).
- Perform CreateDataProperty (obj , "done"
, done ).
- Return obj .
-
-
-
-
-
-
7.4.8
- CreateListIterator ( list )
-
-
The abstract operation CreateListIterator with argument list creates an Iterator (25.1.1.2 ) object whose next method returns the successive elements of list .
- It performs the following steps:
-
-
- Let iterator be ObjectCreate (%IteratorPrototype%, «[[IteratorNext]],
- [[IteratedList]], [[ListIteratorNextIndex]]»).
- Set iterator’s [[IteratedList]] internal
- slot to list .
- Set iterator’s [[ListIteratorNextIndex]] internal slot to 0.
- Let next be a new built-in function object as defined in ListIterator next
(7.4.8.1 ).
- Set iterator’s [[IteratorNext]] internal
- slot to next .
- Perform CreateMethodProperty (iterator , "next"
,
- next ).
- Return iterator .
-
-
-
-
- 7.4.8.1
- ListIterator next( )
-
- The ListIterator next
method is a standard built-in function object (clause 17 ) that performs the following steps:
-
-
- Let O be the this value.
- Let f be the active function object.
- If O does not have a [[IteratorNext]] internal
- slot , throw a TypeError exception.
- Let next be the value of the [[IteratorNext]] internal slot of O .
- If SameValue (f , next ) is false , throw a TypeError
- exception.
- If O does not have a [[IteratedList]] internal
- slot , throw a TypeError exception.
- Let list be the value of the [[IteratedList]] internal slot of O .
- Let index be the value of the [[ListIteratorNextIndex]] internal slot of O .
- Let len be the number of elements of list .
- If index ≥ len , then
-
- Return CreateIterResultObject (undefined , true ).
-
-
- Set the value of the [[ListIteratorNextIndex]] internal
- slot of O to index +1.
- Return CreateIterResultObject (list [index ],
- false ).
-
-
-
-
NOTE A ListIterator next
method will throw an exception if applied to any object
- other than the one with which it was originally associated.
-
-
-
-
-
-
-
-
-
8 Executable Code and Execution Contexts
-
-
-
-
-
8.1
- Lexical Environments
-
-
A Lexical Environment is a specification type used to define the association of Identifiers to specific variables and functions based upon the lexical nesting structure of ECMAScript
- code. A Lexical Environment consists of an Environment Record and a possibly null
- reference to an outer Lexical Environment. Usually a Lexical Environment is associated with some specific syntactic
- structure of ECMAScript code such as a FunctionDeclaration , a BlockStatement , or a Catch clause of a TryStatement and a
- new Lexical Environment is created each time such code is evaluated.
-
-
An Environment Record records the identifier bindings that are created within the
- scope of its associated Lexical Environment. It is referred to as the Lexical Environment’s EnvironmentRecord
-
-
The outer environment reference is used to model the logical nesting of Lexical Environment values. The outer reference
- of a (inner) Lexical Environment is a reference to the Lexical Environment that logically surrounds the inner Lexical
- Environment. An outer Lexical Environment may, of course, have its own outer Lexical Environment. A Lexical Environment may
- serve as the outer environment for multiple inner Lexical Environments. For example, if a FunctionDeclaration contains two nested FunctionDeclarations then the Lexical
- Environments of each of the nested functions will have as their outer Lexical Environment the Lexical Environment of the
- current evaluation of the surrounding function.
-
-
A global environment is a Lexical Environment which does not have an outer environment. The global
- environment’s outer environment reference is null . A global environment’s Environment Record may be prepopulated with identifier bindings and includes an
- associated global object whose properties provide some of the global
- environment ’s identifier bindings. This global object is the value of a global environment’s
- this
binding. As ECMAScript code is executed, additional properties may be added to the global object and the
- initial properties may be modified.
-
-
A module environment is a Lexical Environment that contains the bindings for the top level declarations of a Module . It also contains the bindings that are explicitly imported by the Module .
- The outer environment of a module environment is a global environment.
-
-
A function environment is a Lexical Environment that corresponds to the invocation of an ECMAScript function object . A function environment may establish a new
- this
binding. A function environment also captures the state necessary to support super
method
- invocations.
-
-
Lexical Environments and Environment Record values are purely specification
- mechanisms and need not correspond to any specific artefact of an ECMAScript implementation. It is impossible for an
- ECMAScript program to directly access or manipulate such values.
-
-
-
-
-
8.1.1
- Environment Records
-
-
There are two primary kinds of Environment Record values used in this specification: declarative Environment
- Records and object Environment Records . Declarative Environment Records are used to define the effect of
- ECMAScript language syntactic elements such as FunctionDeclarations , VariableDeclarations , and Catch clauses that directly associate identifier
- bindings with ECMAScript language values . Object Environment Records are used
- to define the effect of ECMAScript elements such as WithStatement that associate identifier
- bindings with the properties of some object. Global Environment Records and
- function Environment Records are specializations that are used for specifically for Script global
- declarations and for top-level declarations within functions.
-
-
For specification purposes Environment Record values are values of the Record specification type and can be thought of
- as existing in a simple object-oriented hierarchy where Environment Record is an abstract class with three concrete
- subclasses, declarative Environment Record, object Environment Record, and global Environment Record. Function Environment Records and module Environment Records are subclasses of
- declarative Environment Record. The abstract class includes the abstract specification methods defined in Table 15 . These abstract methods have distinct concrete algorithms for each of the concrete
- subclasses.
-
-
- Table 15 — Abstract Methods of Environment Records
-
-
- Method
- Purpose
-
-
- HasBinding(N)
- Determine if an Environment Record has a binding for the String value N . Return true if it does and false if it does not
-
-
- CreateMutableBinding(N, D)
- Create a new but uninitialized mutable binding in an Environment Record. The String value N is the text of the bound name. If the optional Boolean argument D is true the binding is may be subsequently deleted.
-
-
- CreateImmutableBinding(N, S)
- Create a new but uninitialized immutable binding in an Environment Record. The String value N is the text of the bound name. If S is true then attempts to access the value of the binding before it is initialized or set it after it has been initialized will always throw an exception, regardless of the strict mode setting of operations that reference that binding. S is an optional parameter that defaults to false .
-
-
- InitializeBinding(N,V)
- Set the value of an already existing but uninitialized binding in an Environment Record. The String value N is the text of the bound name. V is the value for the binding and is a value of any ECMAScript language type .
-
-
- SetMutableBinding(N,V, S)
- Set the value of an already existing mutable binding in an Environment Record. The String value N is the text of the bound name. V is the value for the binding and may be a value of any ECMAScript language type . S is a Boolean flag. If S is true and the binding cannot be set throw a TypeError exception.
-
-
- GetBindingValue(N,S)
- Returns the value of an already existing binding from an Environment Record. The String value N is the text of the bound name. S is used to identify references originating in strict mode code or that otherwise require strict mode reference semantics. If S is true and the binding does not exist throw a ReferenceError exception. If the binding exists but is uninitialized a ReferenceError is thrown, regardless of the value of S .
-
-
- DeleteBinding(N)
- Delete a binding from an Environment Record. The String value N is the text of the bound name. If a binding for N exists, remove the binding and return true . If the binding exists but cannot be removed return false . If the binding does not exist return true .
-
-
- HasThisBinding()
- Determine if an Environment Record establishes a this
binding. Return true if it does and false if it does not.
-
-
- HasSuperBinding()
- Determine if an Environment Record establishes a super
method binding. Return true if it does and false if it does not.
-
-
- WithBaseObject ()
- If this Environment Record is associated with a with
statement, return the with object. Otherwise, return undefined .
-
-
-
-
-
-
-
-
8.1.1.1 Declarative Environment Records
-
-
Each declarative Environment Record is associated with an ECMAScript program
- scope containing variable, constant, let, class, module, import, and/or function declarations. A declarative Environment Record binds the set of identifiers defined by the declarations
- contained within its scope.
-
-
The behaviour of the concrete specification methods for declarative environment records is defined by the following
- algorithms.
-
-
-
-
-
- The concrete Environment Record method HasBinding for declarative Environment
- Records simply determines if the argument identifier is one of the identifiers bound by the record:
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- If envRec has a binding for the name that is the value of N , return true .
- Return false .
-
-
-
-
- 8.1.1.1.2 CreateMutableBinding (N, D)
-
- The concrete Environment Record method CreateMutableBinding for declarative
- Environment Records creates a new mutable binding for the name N that is uninitialized. A binding must not
- already exist in this Environment Record for N . If Boolean argument
- D is provided and has the value true the new binding is marked as being subject to deletion.
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- Assert : envRec does not already have a binding for N .
- Create a mutable binding in envRec for N and record that it is uninitialized. If D is
- true record that the newly created binding may be deleted by a subsequent DeleteBinding call.
- Return NormalCompletion (empty ).
-
-
-
-
- 8.1.1.1.3 CreateImmutableBinding (N, S)
-
- The concrete Environment Record method CreateImmutableBinding for declarative
- Environment Records creates a new immutable binding for the name N that is uninitialized. A binding must not
- already exist in this Environment Record for N . If Boolean argument
- S is provided and has the value true the new binding is marked as a strict binding.
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- Assert : envRec does not already have a binding for N .
- Create an immutable binding in envRec for N and record that it is uninitialized. If S is
- true record that the newly created binding is a strict binding.
- Return NormalCompletion (empty ).
-
-
-
-
- 8.1.1.1.4 InitializeBinding (N,V)
-
- The concrete Environment Record method InitializeBinding for declarative
- Environment Records is used to set the bound value of the current binding of the identifier whose name is the value of
- the argument N to the value of argument V . An uninitialized binding for N must already
- exist.
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- Assert : envRec must have an uninitialized binding for
- N .
- Set the bound value for N in envRec to V .
- Record that the binding for N in envRec has been initialized.
- Return NormalCompletion (empty ).
-
-
-
-
- 8.1.1.1.5 SetMutableBinding (N,V,S)
-
- The concrete Environment Record method SetMutableBinding for declarative
- Environment Records attempts to change the bound value of the current binding of the identifier whose name is the value
- of the argument N to the value of argument V . A binding for N normally already exist,
- but in rare cases it may not. If the binding is an immutable binding, a TypeError is thrown if S is true .
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- If envRec does not have a binding for N , then
-
- If S is true throw a ReferenceError exception.
- Perform envRec .CreateMutableBinding(N , true ).
- Perform envRec .InitializeBinding(N , V ).
- Return NormalCompletion (empty ).
-
-
- If the binding for N in envRec is a strict binding, let S be true .
- If the binding for N in envRec has not yet been initialized throw a ReferenceError
- exception.
- Else if the binding for N in envRec is a mutable binding, change its bound value to V .
- Else this must be an attempt to change the value of an immutable binding so if S is true throw a
- TypeError exception.
- Return NormalCompletion (empty ).
-
-
-
-
NOTE An example of ECMAScript code that results in a missing binding at step 2 is:
-
-
function f(){eval("var x; x = (delete x, 0);")}
-
-
-
-
- 8.1.1.1.6 GetBindingValue(N,S)
-
- The concrete Environment Record method GetBindingValue for declarative
- Environment Records simply returns the value of its bound identifier whose name is the value of the argument
- N . If the binding exists but is uninitialized a ReferenceError is thrown, regardless of the value of
- S .
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- Assert : envRec has a binding for N .
- If the binding for N in envRec is an uninitialized binding, throw a ReferenceError
- exception.
- Return the value currently bound to N in envRec .
-
-
-
-
-
-
- The concrete Environment Record method DeleteBinding for declarative
- Environment Records can only delete bindings that have been explicitly designated as being subject to deletion.
-
-
- Let envRec be the declarative Environment Record for which the
- method was invoked.
- Assert : envRec has a binding for the name that is the value of
- N .
- If the binding for N in envRec cannot be deleted, return false .
- Remove the binding for N from envRec .
- Return true .
-
-
-
-
-
-
- Regular declarative Environment Records do not provide a this
binding.
-
-
- Return false .
-
-
-
-
- 8.1.1.1.9 HasSuperBinding ()
-
- Regular declarative Environment Records do not provide a super
binding.
-
-
- Return false .
-
-
-
-
-
-
- Declarative Environment Records always return undefined as their WithBaseObject.
-
-
- Return undefined .
-
-
-
-
-
-
-
8.1.1.2 Object Environment Records
-
-
Each object Environment Record is associated with an object called its
- binding object . An object Environment Record binds the set of string
- identifier names that directly correspond to the property names of its binding object. Property keys that are not
- strings in the form of an IdentifierName are not included in the set of bound identifiers. Both
- own and inherited properties are included in the set regardless of the setting of their [[Enumerable]] attribute.
- Because properties can be dynamically added and deleted from objects, the set of identifiers bound by an object Environment Record may potentially change as a side-effect of any operation that
- adds or deletes properties. Any bindings that are created as a result of such a side-effect are considered to be a
- mutable binding even if the Writable attribute of the corresponding property has the value false . Immutable
- bindings do not exist for object Environment Records.
-
-
Object Environment Records created for with
statements (13.10 ) can
- provide their binding object as an implicit this value for use in function calls. The capability is controlled by
- a withEnvironment Boolean value that is associated with each object Environment Record . By default, the value of withEnvironment is
- false for any object Environment Record .
-
-
The behaviour of the concrete specification methods for object environment records is defined by the following
- algorithms.
-
-
-
-
-
- The concrete Environment Record method HasBinding for object Environment
- Records determines if its associated binding object has a property whose name is the value of the argument
- N :
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- Let bindings be the binding object for envRec .
- Let foundBinding be HasProperty (bindings , N )
- ReturnIfAbrupt (foundBinding ).
- If foundBinding is false , return false .
- If the withEnvironment flag of envRec is false , return true .
- Let unscopables be Get (bindings , @@unscopables).
- ReturnIfAbrupt (unscopables ).
- If Type (unscopables ) is Object, then
-
- Let blocked be ToBoolean (Get (unscopables , N )).
- ReturnIfAbrupt (blocked ).
- If blocked is true , return false .
-
-
- Return true .
-
-
-
-
- 8.1.1.2.2 CreateMutableBinding (N, D)
-
- The concrete Environment Record method CreateMutableBinding for object
- Environment Records creates in an Environment Record’s associated binding object a property whose name is the
- String value and initializes it to the value undefined . If Boolean argument D is provided and has the
- value true the new property’s [[Configurable]] attribute is set to true , otherwise it is set to
- false .
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- Let bindings be the binding object for envRec .
- If D is true then let configValue be true otherwise let configValue be
- false .
- Return DefinePropertyOrThrow (bindings , N ,
- PropertyDescriptor{[[Value]]:undefined , [[Writable]]: true , [[Enumerable]]: true ,
- [[Configurable]]: configValue }).
-
-
-
-
NOTE Normally envRec will not have a binding for N but if it does, the
- semantics of DefinePropertyOrThrow may result in an existing binding being
- replaced or shadowed or cause an abrupt completion to be
- returned.
-
-
-
-
- 8.1.1.2.3 CreateImmutableBinding (N, S)
-
- The concrete Environment Record method CreateImmutableBinding is never used
- within this specification in association with Object Environment Records.
-
-
-
- 8.1.1.2.4 InitializeBinding (N,V)
-
- The concrete Environment Record method InitializeBinding for object
- Environment Records is used to set the bound value of the current binding of the identifier whose name is the value of
- the argument N to the value of argument V . An uninitialized binding for N must already
- exist.
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- Assert : envRec must have an uninitialized binding for
- N .
- Record that the binding for N in envRec has been initialized.
- Return envRec .SetMutableBinding(N , V , false ).
-
-
-
-
NOTE In this specification, all uses of CreateMutableBinding for object Environment Records
- are immediately followed by a call to InitializeBinding for the same name. Hence, implementations do not need to
- explicitly track the initialization state of individual object Environment Record bindings.
-
-
-
-
- 8.1.1.2.5 SetMutableBinding (N,V,S)
-
- The concrete Environment Record method SetMutableBinding for object
- Environment Records attempts to set the value of the Environment Record’s associated binding object’s
- property whose name is the value of the argument N to the value of argument V . A property named
- N normally already exists but if it does not or is not currently writable, error handling is determined by
- the value of the Boolean argument S .
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- Let bindings be the binding object for envRec .
- Return Set (bindings , N , V , S ).
-
-
-
-
- 8.1.1.2.6 GetBindingValue(N,S)
-
- The concrete Environment Record method GetBindingValue for object Environment
- Records returns the value of its associated binding object’s property whose name is the String value of the
- argument identifier N . The property should already exist but if it does not the result depends upon the value
- of the S argument:
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- Let bindings be the binding object for envRec .
- Let value be HasProperty (bindings , N ).
- ReturnIfAbrupt (value ).
- If value is false , then
-
- If S is false , return the value undefined , otherwise throw a ReferenceError
- exception.
-
-
- Return Get (bindings , N ).
-
-
-
-
-
-
- The concrete Environment Record method DeleteBinding for object Environment
- Records can only delete bindings that correspond to properties of the environment object whose [[Configurable]]
- attribute have the value true .
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- Let bindings be the binding object for envRec .
- Return bindings .[[Delete]](N ).
-
-
-
-
-
-
- Regular object environment records do not provide a this
binding.
-
-
- Return false .
-
-
-
-
- 8.1.1.2.9 HasSuperBinding ()
-
- Regular object environment records do not provide a super
binding.
-
-
- Return false .
-
-
-
-
-
-
- Object environment records return undefined as their WithBaseObject unless their withEnvironment
- flag is true .
-
-
- Let envRec be the object Environment Record for which the method was
- invoked.
- If the withEnvironment flag of envRec is true , return the binding object for
- envRec .
- Otherwise, return undefined .
-
-
-
-
-
-
-
8.1.1.3 Function Environment Records
-
-
A function Environment Record is a declarative Environment Record that is used to represent the top-level scope of a function and,
- if the function is not an ArrowFunction , provides a this
binding. If a function is
- not an ArrowFunction function and references super
, its function Environment Record also contains the state that is used to perform
- super
method invocations from within the function.
-
-
Function Environment Records have the additional state fields listed in Table 16 .
-
-
- Table 16 — Additional Fields of Function Environment Records
-
-
- Field Name
- Value
- Meaning
-
-
- [[thisValue]]
- Any
- This is the this value used for this invocation of the function.
-
-
- [[thisBindingStatus]]
- "lexical"
| "initialized"
| "uninitialized"
- If the value is "lexical"
, this is an ArrowFunction and does not have a local this value.
-
-
- [[FunctionObject]]
- Object
- The function Object whose invocation caused this Environment Record to be created.
-
-
- [[HomeObject]]
- Object | undefined
- If the associated function has super
property accesses and is not an ArrowFunction , [[HomeObject]] is the object that the function is bound to as a method. The default value for [[HomeObject]] is undefined .
-
-
- [[NewTarget]]
- Object | undefined
- If this Environment Record was created by the [[Construct]] internal method, [[NewTarget]] is the value of the [[Construct]] newTarget parameter. Otherwise, its value is undefined .
-
-
-
-
-
Function Environment Records support all of the declarative Environment Record methods listed in Table 15 and share the same specifications for all of those methods except for HasThisBinding and
- HasSuperBinding. In addition, function Environment Records support the methods listed in Table
- 17 :
-
-
- Table 17 — Additional Methods of Function Environment Records
-
-
- Method
- Purpose
-
-
- BindThisValue (V)
- Set the [[thisValue]] and record that it has been initialized.
-
-
- GetThisBinding()
- Return the value of this Environment Record ’s this
binding. Throws a ReferenceError if the this
binding has not been initialized.
-
-
- GetSuperBase ()
- Return the object that is the base for super
property accesses bound in this Environment Record . The object is derived from this Environment Record ’s [[HomeObject]] field. The value undefined indicates that super
property accesses will produce runtime errors.
-
-
-
-
-
The behaviour of the additional concrete specification methods for function Environment Records is defined by the
- following algorithms:
-
-
-
-
-
- Let envRec be the function Environment Record for which the method
- was invoked.
- Assert : envRec .[[thisBindingStatus]] is not
- "lexical"
.
- If envRec .[[thisBindingStatus]] is "initialized"
, throw a ReferenceError
- exception.
- Set envRec .[[thisValue]] to V .
- Set envRec .[[thisBindingStatus]] to "initialized"
.
- Return V .
-
-
-
-
-
-
- Let envRec be the function Environment Record for which the method
- was invoked.
- If envRec .[[thisBindingStatus]] is "lexical"
, return false ; otherwise, return
- true .
-
-
-
-
- 8.1.1.3.3 HasSuperBinding ()
-
- Let envRec be the function Environment Record for which the method
- was invoked.
- If envRec .[[thisBindingStatus]] is "lexical"
, return false .
- If envRec .[[HomeObject]] has the value undefined , return false , otherwise, return
- true .
-
-
-
-
-
-
- Let envRec be the function Environment Record for which the method
- was invoked.
- Assert : envRec .[[thisBindingStatus]] is not
- "lexical"
.
- If envRec .[[thisBindingStatus]] is "uninitialized"
, throw a ReferenceError
- exception.
- Return envRec .[[thisValue]].
-
-
-
-
-
-
- Let envRec be the function Environment Record for which the method
- was invoked.
- Let home be the value of envRec .[[HomeObject]].
- If home has the value undefined , return undefined .
- Assert : Type (home ) is Object.
- Return home. [[GetPrototypeOf]]().
-
-
-
-
-
-
-
8.1.1.4 Global Environment Records
-
-
A global Environment Record is used to represent the outer most scope that is
- shared by all of the ECMAScript Script elements that are processed in a common Realm (8.2 ). A global Environment Record provides the bindings for built-in globals (clause 18 ), properties of the global object, and for all top-level declarations (13.1.8 , 13.1.10 ) that occur within a Script .
-
-
A global Environment Record is logically a single record but it is specified
- as a composite encapsulating an object Environment Record and a declarative Environment Record . The object Environment
- Record has as its base object the global object of the associated Realm . This global
- object is the value returned by the global Environment Record ’s
- GetThisBinding concrete method. The object Environment Record component of a
- global Environment Record contains the bindings for all built-in globals (clause 18 ) and all bindings introduced by a FunctionDeclaration , GeneratorDeclaration , or VariableStatement
- contained in global code. The bindings for all other ECMAScript declarations in global code are contained in the
- declarative Environment Record component of the global Environment Record .
-
-
Properties may be created directly on a global object. Hence, the object Environment Record component of a global Environment Record may contain both bindings created explicitly by FunctionDeclaration , GeneratorDeclaration , or VariableDeclaration declarations and binding created implicitly as properties of the global object. In
- order to identify which bindings were explicitly created using declarations, a global Environment Record maintains a list of the names bound using its
- CreateGlobalVarBindings and CreateGlobalFunctionBindings concrete methods.
-
-
Global Environment Records have the additional fields listed in Table 18 and the additional
- methods listed in Table 19 .
-
-
- Table 18 — Additional Fields of Global Environment Records
-
-
- Field Name
- Value
- Meaning
-
-
- [[ObjectRecord]]
- Object Environment Record
- Binding object is the global object. It contains global built-in bindings as well as FunctionDeclaration , GeneratorDeclaration , and VariableDeclaration bindings in global code for the associated Realm .
-
-
- [[DeclarativeRecord]]
- Declarative Environment Record
- Contains bindings for all declarations in global code for the associated Realm code except for FunctionDeclaration , GeneratorDeclaration , and VariableDeclaration bindings .
-
-
- [[VarNames]]
- List of String
- The string names bound by FunctionDeclaration , GeneratorDeclaration , and VariableDeclaration declarations in global code for the associated Realm .
-
-
-
-
-
- Table 19 — Additional Methods of Global Environment Records
-
-
- Method
- Purpose
-
-
- GetThisBinding()
- Return the value of this Environment Record ’s this
binding.
-
-
- HasVarDeclaration (N)
- Determines if the argument identifier has a binding in this Environment Record that was created using a VariableDeclaration , FunctionDeclaration , or GeneratorDeclaration .
-
-
- HasLexicalDeclaration (N)
- Determines if the argument identifier has a binding in this Environment Record that was created using a lexical declaration such as a LexicalDeclaration or a ClassDeclaration .
-
-
- HasRestrictedGlobalProperty (N)
- Determines if the argument is the name of a global object property that may not be shadowed by a global lexically binding.
-
-
- CanDeclareGlobalVar (N)
- Determines if a corresponding CreateGlobalVarBinding call would succeed if called for the same argument N .
-
-
- CanDeclareGlobalFunction (N)
- Determines if a corresponding CreateGlobalFunctionBinding call would succeed if called for the same argument N .
-
-
- CreateGlobalVarBinding (N, D)
- Used to create and initialize to undefined a global var
binding in the [[ObjectRecord]] component of a global Environment Record . The binding will be a mutable binding. The corresponding global object property will have attribute values appropriate for a var
. The String value N is the bound name. If D is true the binding may be deleted. Logically equivalent to CreateMutableBinding followed by a SetMutableBinding but it allows var declarations to receive special treatment.
-
-
- CreateGlobalFunctionBinding (N, V, D)
- Create and initialize a global function
binding in the [[ObjectRecord]] component of a global Environment Record . The binding will be a mutable binding. The corresponding global object property will have attribute values appropriate for a function
. The String value N is the bound name. V is the initialization value. If the optional Boolean argument D is true the binding is may be deleted. Logically equivalent to CreateMutableBinding followed by a SetMutableBinding but it allows function declarations to receive special treatment.
-
-
-
-
-
The behaviour of the concrete specification methods for global Environment Records is defined by the following
- algorithms.
-
-
-
-
-
- The concrete Environment Record method HasBinding for global Environment
- Records simply determines if the argument identifier is one of the identifiers bound by the record:
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec. HasBinding(N ) is true , return true .
- Let ObjRec be envRec .[[ObjectRecord]].
- Return ObjRec. HasBinding(N ).
-
-
-
-
- 8.1.1.4.2 CreateMutableBinding (N, D)
-
- The concrete Environment Record method CreateMutableBinding for global
- Environment Records creates a new mutable binding for the name N that is uninitialized. The binding is
- created in the associated DeclarativeRecord. A binding for N must not already exist in the DeclarativeRecord.
- If Boolean argument D is provided and has the value true the new binding is marked as being subject to
- deletion.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec .HasBinding(N ) is true , throw a TypeError exception.
- Return DclRec .CreateMutableBinding(N , D ).
-
-
-
-
- 8.1.1.4.3 CreateImmutableBinding (N, S)
-
- The concrete Environment Record method CreateImmutableBinding for global
- Environment Records creates a new immutable binding for the name N that is uninitialized. A binding must not
- already exist in this Environment Record for N . If Boolean argument
- S is provided and has the value true the new binding is marked as a strict binding.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec .HasBinding(N ) is true , throw a TypeError exception.
- Return DclRec .CreateImmutableBinding(N , S ).
-
-
-
-
- 8.1.1.4.4 InitializeBinding (N,V)
-
- The concrete Environment Record method InitializeBinding for global
- Environment Records is used to set the bound value of the current binding of the identifier whose name is the value of
- the argument N to the value of argument V . An uninitialized binding for N must already
- exist.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec. HasBinding(N ) is true , then
-
- Return DclRec .InitializeBinding(N , V ).
-
-
- Assert : If the binding exists it must be in the object Environment Record .
- Let ObjRec be envRec .[[ObjectRecord]].
- Return ObjRec. InitializeBinding(N , V ).
-
-
-
-
- 8.1.1.4.5 SetMutableBinding (N,V,S)
-
- The concrete Environment Record method SetMutableBinding for global
- Environment Records attempts to change the bound value of the current binding of the identifier whose name is the value
- of the argument N to the value of argument V . If the binding is an immutable binding, a
- TypeError is thrown if S is true . A
- property named N normally already exists but if it does not or is not currently writable, error handling is
- determined by the value of the Boolean argument S .
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec. HasBinding(N ) is true , then
-
- Return DclRec. SetMutableBinding(N , V , S ).
-
-
- Let ObjRec be envRec .[[ObjectRecord]].
- Return ObjRec .SetMutableBinding(N , V , S ).
-
-
-
-
- 8.1.1.4.6 GetBindingValue(N,S)
-
- The concrete Environment Record method GetBindingValue for global Environment
- Records returns the value of its bound identifier whose name is the value of the argument N . If the binding
- is an uninitialized binding throw a ReferenceError exception. A property named N normally already
- exists but if it does not or is not currently writable, error handling is determined by the value of the Boolean
- argument S .
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec. HasBinding(N ) is true , then
-
- Return DclRec. GetBindingValue(N , S ).
-
-
- Let ObjRec be envRec .[[ObjectRecord]].
- Return ObjRec .GetBindingValue(N , S ).
-
-
-
-
-
-
- The concrete Environment Record method DeleteBinding for global Environment
- Records can only delete bindings that have been explicitly designated as being subject to deletion.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- If DclRec. HasBinding(N ) is true , then
-
- Return DclRec. DeleteBinding(N ).
-
-
- Let ObjRec be envRec .[[ObjectRecord]].
- Let globalObject be the binding object for ObjRec .
- Let existingProp be HasOwnProperty (globalObject , N ).
- ReturnIfAbrupt (existingProp ).
- If existingProp is true , then
-
- Let status be ObjRec. DeleteBinding(N ).
- ReturnIfAbrupt (status ).
- If status is true , then
-
- Let varNames be envRec .[[VarNames]].
- If N is an element of varNames , remove that element from the varNames .
-
-
- Return status .
-
-
- Return true .
-
-
-
-
-
-
- Global Environment Records always provide a this
binding
- whose value is the associated global object.
-
-
- Return true .
-
-
-
-
- 8.1.1.4.9 HasSuperBinding ()
-
- Return false .
-
-
-
-
-
-
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let ObjRec be envRec .[[ObjectRecord]].
- Let bindings be the binding object for ObjRec .
- Return bindings .
-
-
-
-
- 8.1.1.4.12 HasVarDeclaration (N)
-
- The concrete Environment Record method HasVarDeclaration for global
- Environment Records determines if the argument identifier has a binding in this record that was created using a VariableStatement or a FunctionDeclaration :
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let varDeclaredNames be envRec .[[VarNames]].
- If varDeclaredNames contains the value of N , return true .
- Return false .
-
-
-
-
- 8.1.1.4.13 HasLexicalDeclaration (N)
-
- The concrete Environment Record method HasLexicalDeclaration for global
- Environment Records determines if the argument identifier has a binding in this record that was created using a lexical
- declaration such as a LexicalDeclaration or a ClassDeclaration :
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let DclRec be envRec .[[DeclarativeRecord]].
- Return DclRec. HasBinding(N ).
-
-
-
-
- 8.1.1.4.14 HasRestrictedGlobalProperty (N)
-
- The concrete Environment Record method HasRestrictedGlobalProperty for global
- Environment Records determines if the argument identifier is the name of a property of the global object that must not
- be shadowed by a global lexically binding:
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let ObjRec be envRec .[[ObjectRecord]].
- Let globalObject be the binding object for ObjRec .
- Let existingProp be globalObject .[[GetOwnProperty]](N ).
- ReturnIfAbrupt (existingProp ).
- If existingProp is undefined , return false .
- If existingProp .[[Configurable]] is true , return false .
- Return true .
-
-
-
-
NOTE Properties may exist upon a global object that were directly created rather than being
- declared using a var or function declaration. A global lexical binding may not be created that has the same name as a
- non-configurable property of the global object. The global property undefined
is an example of such a
- property.
-
-
-
-
- 8.1.1.4.15 CanDeclareGlobalVar (N)
-
- The concrete Environment Record method CanDeclareGlobalVar for global
- Environment Records determines if a corresponding CreateGlobalVarBinding call
- would succeed if called for the same argument N . Redundant var declarations and var declarations for
- pre-existing global object properties are allowed.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let ObjRec be envRec .[[ObjectRecord]].
- Let globalObject be the binding object for ObjRec .
- Let hasProperty be HasOwnProperty (globalObject, N ).
- ReturnIfAbrupt (hasProperty ).
- If hasProperty is true , return true .
- Return IsExtensible (globalObject ).
-
-
-
-
- 8.1.1.4.16 CanDeclareGlobalFunction (N)
-
- The concrete Environment Record method CanDeclareGlobalFunction for global
- Environment Records determines if a corresponding CreateGlobalFunctionBinding call would succeed if called for the same
- argument N .
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let ObjRec be envRec .[[ObjectRecord]].
- Let globalObject be the binding object for ObjRec .
- Let existingProp be globalObject .[[GetOwnProperty]](N ).
- ReturnIfAbrupt (existingProp ).
- If existingProp is undefined , return IsExtensible (globalObject ).
- If existingProp .[[Configurable]] is true , return true .
- If IsDataDescriptor (existingProp ) is true and
- existingProp has attribute values {[[Writable]]: true , [[Enumerable]]: true }, return
- true .
- Return false .
-
-
-
-
- 8.1.1.4.17 CreateGlobalVarBinding (N, D)
-
- The concrete Environment Record method CreateGlobalVarBinding for global
- Environment Records creates and initializes a mutable binding in the associated object Environment Record and records
- the bound name in the associated [[VarNames]] List . If a binding
- already exists, it is reused and assumed to be initialized.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let ObjRec be envRec .[[ObjectRecord]].
- Let globalObject be the binding object for ObjRec .
- Let hasProperty be HasOwnProperty (globalObject, N ).
- ReturnIfAbrupt (hasProperty ).
- Let extensible be IsExtensible (globalObject ).
- ReturnIfAbrupt (extensible ).
- If hasProperty is false and extensible is true , then
-
- Let status be ObjRec. CreateMutableBinding(N , D ).
- ReturnIfAbrupt (status ).
- Let status be ObjRec. InitializeBinding(N , undefined ).
- ReturnIfAbrupt (status ).
-
-
- Let varDeclaredNames be envRec .[[VarNames]].
- If varDeclaredNames does not contain the value of N , then
-
- Append N to varDeclaredNames .
-
-
- Return NormalCompletion (empty ).
-
-
-
-
- 8.1.1.4.18 CreateGlobalFunctionBinding (N, V, D)
-
- The concrete Environment Record method CreateGlobalFunctionBinding for global
- Environment Records creates and initializes a mutable binding in the associated object Environment Record and records
- the bound name in the associated [[VarNames]] List . If a binding
- already exists, it is replaced.
-
-
- Let envRec be the global Environment Record for which the method was
- invoked.
- Let ObjRec be envRec .[[ObjectRecord]].
- Let globalObject be the binding object for ObjRec .
- Let existingProp be globalObject .[[GetOwnProperty]](N ).
- ReturnIfAbrupt (existingProp ).
- If existingProp is undefined or existingProp .[[Configurable]] is true , then
-
- Let desc be the PropertyDescriptor{[[Value]]:V , [[Writable]]: true , [[Enumerable]]:
- true , [[Configurable]]: D }.
-
-
- Else,
-
- Let desc be the PropertyDescriptor{[[Value]]:V }.
-
-
- Let status be DefinePropertyOrThrow (globalObject , N ,
- desc ).
- ReturnIfAbrupt (status ).
- Let status be Set (globalObject , N , V ,
- false ).
- Record that the binding for N in ObjRec has been initialized.
- ReturnIfAbrupt (status ).
- Let varDeclaredNames be envRec .[[VarNames]].
- If varDeclaredNames does not contain the value of N , then
-
- Append N to varDeclaredNames .
-
-
- Return NormalCompletion (empty ).
-
-
-
-
NOTE Global function declarations are always represented as own properties of the global
- object. If possible, an existing own property is reconfigured to have a standard set of attribute values. Steps 10-12
- are equivalent to what calling the InitializeBinding concrete method would do and if globalObject is a Proxy
- will produce the same sequence of Proxy trap calls.
-
-
-
-
-
-
-
8.1.1.5 Module Environment Records
-
-
A module Environment Record is a declarative Environment Record that is used to represent the outer scope of an ECMAScript Module . In additional to normal mutable and immutable bindings, module Environment Records also
- provide immutable import bindings which are bindings that provide indirect access to a target binding that exists in
- another Environment Record.
-
-
Module Environment Records support all of the declarative Environment Record methods listed in Table 15 and share the same specifications for all of those methods except for GetBindingValue,
- DeleteBinding, HasThisBinding and GetThisBinding. In addition, module Environment Records support the methods listed in
- Table 20 :
-
-
- Table 20 — Additional Methods of Module Environment Records
-
-
-
-
The behaviour of the additional concrete specification methods for module Environment Records are defined by the
- following algorithms:
-
-
-
- 8.1.1.5.1 GetBindingValue(N,S)
-
- The concrete Environment Record method GetBindingValue for module Environment
- Records returns the value of its bound identifier whose name is the value of the argument N . However, if the
- binding is an indirect binding the value of the target binding is returned. If the binding exists but is uninitialized a
- ReferenceError is thrown, regardless of the value of S .
-
-
- Let envRec be the module Environment Record for which the method was
- invoked.
- Assert : envRec has a binding for N .
- If the binding for N is an indirect binding, then
-
- Let M and N2 be the indirection values provided when this binding for N was created.
- If M is undefined , throw a ReferenceError exception.
- Let targetEnv be M .[[Environment]].
- If targetEnv is undefined , throw a ReferenceError exception.
- Let targetER be targetEnv ’s EnvironmentRecord.
- Return targetER .GetBindingValue(N2 , S ).
-
-
- If the binding for N in envRec is an uninitialized binding, throw a ReferenceError
- exception.
- Return the value currently bound to N in envRec .
-
-
-
-
NOTE Because a Module is always strict mode
- code , calls to GetBindingValue should always pass true as
- the value of S .
-
-
-
-
-
-
- The concrete Environment Record method DeleteBinding for module Environment
- Records refuses to delete bindings.
-
-
- Let envRec be the module Environment Record for which the method was
- invoked.
- If envRec does not have a binding for the name that is the value of N , return true .
- Return false .
-
-
-
-
-
-
-
-
- Module Environment Records provide a this
binding.
-
-
- Return true .
-
-
-
-
-
-
- Return undefined .
-
-
-
-
- 8.1.1.5.5 CreateImportBinding (N, M, N2)
-
- The concrete Environment Record method CreateImportBinding for module
- Environment Records creates a new initialized immutable indirect binding for the name N . A binding must not
- already exist in this Environment Record for N . M is a
- Module Record (see 15.2.1.14 ), and N2 is the name of a binding
- that exists in M’s module Environment Record . Accesses to the value of the
- new binding will indirectly access the bound value of value of the target binding.
-
-
- Let envRec be the module Environment Record for which the method was
- invoked.
- Assert : envRec does not already have a binding for N .
- Assert : M is a Module Record.
- Assert : When M .[[Environment]] is instantiated it will have a
- direct binding for N2 .
- Create an immutable indirect binding in envRec for N that references M and N2 as its
- target binding and record that the binding is initialized.
- Return NormalCompletion (empty ).
-
-
-
-
-
-
-
-
8.1.2 Lexical Environment Operations
-
-
The following abstract operations are used in this specification to operate upon lexical environments:
-
-
-
- 8.1.2.1 GetIdentifierReference (lex, name, strict)
-
- The abstract operation GetIdentifierReference is called with a Lexical
- Environment lex , a String name , and a Boolean flag strict. The value of
- lex may be null . When called, the following steps are performed:
-
-
- If lex is the value null , then
-
- Return a value of type Reference whose base value is
- undefined , whose referenced name is name , and whose strict reference flag is strict .
-
-
- Let envRec be lex ’s EnvironmentRecord.
- Let exists be envRec .HasBinding(name ).
- ReturnIfAbrupt (exists ).
- If exists is true , then
-
- Return a value of type Reference whose base value is
- envRec , whose referenced name is name , and whose strict reference flag is strict.
-
-
- Else
-
- Let outer be the value of lex’s outer environment
- reference .
- Return GetIdentifierReference(outer , name , strict ).
-
-
-
-
-
-
-
-
-
-
- 8.1.2.4 NewFunctionEnvironment ( F, newTarget )
-
- When the abstract operation NewFunctionEnvironment is called with arguments F and newTarget the
- following steps are performed:
-
-
- Assert : F is an ECMAScript function.
- Assert : Type (newTarget ) is Undefined or Object.
- Let env be a new Lexical Environment .
- Let envRec be a new function Environment Record containing no
- bindings.
- Set envRec .[[FunctionObject]] to F .
- If F’s [[ThisMode]] internal slot is
- lexical , set envRec .[[thisBindingStatus]] to
- "lexical"
.
- Else, Set envRec .[[thisBindingStatus]] to "uninitialized"
.
- Let home be the value of F’s [[HomeObject]] internal slot .
- Set envRec .[[HomeObject]] to home .
- Set envRec .[[NewTarget]] to newTarget .
- Set env’s EnvironmentRecord to be envRec .
- Set the outer lexical environment reference of env to the value of
- F’s [[Environment]] internal slot .
- Return env .
-
-
-
-
- 8.1.2.5 NewGlobalEnvironment ( G )
-
- When the abstract operation NewGlobalEnvironment is called with an ECMAScript Object G as its argument, the
- following steps are performed:
-
-
- Let env be a new Lexical Environment .
- Let objRec be a new object Environment Record containing G as
- the binding object.
- Let dclRec be a new declarative Environment Record containing no
- bindings.
- Let globalRec be a new global Environment Record .
- Set globalRec .[[ObjectRecord]] to objRec .
- Set globalRec .[[DeclarativeRecord]] to dclRec .
- Set globalRec .[[VarNames]] to a new empty List .
- Set env’s EnvironmentRecord to globalRec .
- Set the outer lexical environment reference of env to
- null
- Return env .
-
-
-
-
-
-
-
-
-
-
8.2 Code
- Realms
-
-
Before it is evaluated, all ECMAScript code must be associated with a Realm . Conceptually, a realm consists of a
- set of intrinsic objects, an ECMAScript global environment, all of the ECMAScript code that is loaded within the scope of
- that global environment, and other associated state and resources.
-
-
A Realm is specified as a Record with the fields specified in Table 21 :
-
-
- Table 21 — Realm Record Fields
-
-
- Field Name
- Value
- Meaning
-
-
- [[intrinsics]]
- Record whose field names are intrinsic keys and whose values are objects
- These are the intrinsic values used by code associated with this Realm
-
-
- [[globalThis]]
- Object
- The global object for this Realm
-
-
- [[globalEnv]]
- Lexical Environment
- The global environment for this Realm
-
-
- [[templateMap]]
- A List of Record { [[strings]]: List , [[array]]: Object}.
- Template objects are canonicalized separately for each Realm using its [[templateMap]]. Each [[strings]] value is a List containing, in source text order, the raw string values of a TemplateLiteral that has been evaluated. The associated [[array]] value is the corresponding template object that is passed to a tag function.
-
-
-
-
-
An implementation may define other, implementation specific fields.
-
-
-
- 8.2.1 CreateRealm
- ( )
-
- The abstract operation CreateRealm with no arguments performs the following steps:
-
-
- Let realmRec be a new Record.
- Perform CreateIntrinsics (realmRec ).
- Set realmRec .[[globalThis]] to undefined .
- Set realmRec .[[globalEnv]] to undefined .
- Set realmRec .[[templateMap]] to a new empty List .
- Return realmRec .
-
-
-
-
- 8.2.2
- CreateIntrinsics ( realmRec )
-
- When the abstract operation CreateIntrinsics with argument realmRec performs the following steps:
-
-
- Let intrinsics be a new Record.
- Set realmRec .[[intrinsics]] to intrinsics .
- Let objProto be ObjectCreate (null ).
- Set intrinsics .[[%ObjectPrototype%]] to objProto .
- Let throwerSteps be the algorithm steps specified in 9.2.7.1 for the %ThrowTypeError% function.
- Let thrower be CreateBuiltinFunction (realmRec ,
- throwerSteps , null ).
- Set intrinsics .[[%ThrowTypeError% ]] to thrower .
- Let noSteps be an empty sequence of algorithm steps.
- Let funcProto be CreateBuiltinFunction (realmRec ,
- noSteps , objProto ).
- Set intrinsics .[[%FunctionPrototype%]] to funcProto .
- Call thrower .[[SetPrototypeOf]](funcProto ).
- Perform AddRestrictedFunctionProperties (funcProto ,
- realmRec ).
- Set fields of intrinsics with the values listed in Table 7 that have not already been
- handled above. The field names are the names listed in column one of the table. The value of each field is a new
- object value fully and recursively populated with property values as defined by the specification of each object in
- clauses 18-26. All object property values are newly created object values. All values that are built-in function
- objects are created by performing CreateBuiltinFunction (realmRec ,
- <steps>, <prototype>, <slots>) where <steps> is the definition of that function provided by
- this specification, <prototype> is the specified value of the function’s [[Prototype]] internal slot and <slots> is a list of the names, if
- any, of the functions specified internal slots. The creation of the intrinsics and their properties must be ordered to
- avoid any dependencies upon objects that have not yet been created.
- Return intrinsics .
-
-
-
-
- 8.2.3
- SetRealmGlobalObject ( realmRec, globalObj )
-
- The abstract operation SetRealmGlobalObject with arguments realmRec and globalObj performs the
- following steps:
-
-
- If globalObj is undefined , then
-
- Let intrinsics be realmRec .[[intrinsics]].
- Let globalObj be ObjectCreate (intrinsics .[[%ObjectPrototype%]]).
-
-
- Assert : Type (globalObj ) is Object.
- Set realmRec .[[globalThis]] to globalObj .
- Let newGlobalEnv be NewGlobalEnvironment (globalObj ).
- Set realmRec .[[globalEnv]] to newGlobalEnv .
- Return realmRec .
-
-
-
-
- 8.2.4 SetDefaultGlobalBindings ( realmRec )
-
- The abstract operation SetDefaultGlobalBindings with argument realmRec performs the following steps:
-
-
- Let global be realmRec .[[globalThis]].
- For each property of the Global Object specified in clause 18 , do
-
- Let name be the string value of the property name.
- Let desc be the fully populated data property descriptor for the property containing the specified
- attributes for the property. For properties listed in 18.2 , 18.3 , or 18.4 the value of the [[Value]] attribute is the
- corresponding intrinsic object from realmRec .
- Let status be DefinePropertyOrThrow (global , name ,
- desc ).
- ReturnIfAbrupt (status ).
-
-
- Return global .
-
-
-
-
-
-
-
8.3
- Execution Contexts
-
-
An execution context is a specification device that is used to track the runtime evaluation of code by an
- ECMAScript implementation. At any point in time, there is at most one execution context that is actually executing code.
- This is known as the running execution context. A stack is used to track execution contexts. The running execution
- context is always the top element of this stack. A new execution context is created whenever control is transferred from the
- executable code associated with the currently running execution context to executable code that is not associated with that
- execution context. The newly created execution context is pushed onto the stack and becomes the running execution
- context.
-
-
An execution context contains whatever implementation specific state is necessary to track the execution progress of its
- associated code. Each execution context has at least the state components listed in Table 22 .
-
-
- Table 22 —State Components for All Execution Contexts
-
-
- Component
- Purpose
-
-
- code evaluation state
- Any state needed to perform, suspend, and resume evaluation of the code associated with this execution context.
-
-
- Function
- If this execution context is evaluating the code of a function object, then the value of this component is that function object. If the context is evaluating the code of a Script or Module , the value is null .
-
-
- Realm
- The Realm from which associated code accesses ECMAScript resources.
-
-
-
-
-
Evaluation of code by the running execution context may be suspended at various points defined within this specification.
- Once the running execution context has been suspended a different execution context may become the running execution context
- and commence evaluating its code. At some later time a suspended execution context may again become the running execution
- context and continue evaluating its code at the point where it had previously been suspended. Transition of the running
- execution context status among execution contexts usually occurs in stack-like last-in/first-out manner. However, some
- ECMAScript features require non-LIFO transitions of the running execution context.
-
-
The value of the Realm component of the running execution context is also called the
- current Realm . The value of the Function component of the running execution context is
- also called the active function object.
-
-
Execution contexts for ECMAScript code have the additional state components listed in Table
- 23 .
-
-
- Table 23 — Additional State Components for ECMAScript Code Execution Contexts
-
-
- Component
- Purpose
-
-
- LexicalEnvironment
- Identifies the Lexical Environment used to resolve identifier references made by code within this execution context.
-
-
- VariableEnvironment
- Identifies the Lexical Environment whose EnvironmentRecord holds bindings created by VariableStatements within this execution context.
-
-
-
-
-
The LexicalEnvironment and VariableEnvironment components of an execution context are always Lexical Environments. When
- an execution context is created its LexicalEnvironment and VariableEnvironment components initially have the same value.
-
-
Execution contexts representing the evaluation of generator objects have the additional state components listed in Table 24 .
-
-
- Table 24 — Additional State Components for Generator Execution Contexts
-
-
- Component
- Purpose
-
-
- Generator
- The GeneratorObject that this execution context is evaluating.
-
-
-
-
-
In most situations only the running execution context (the top of the execution context stack) is directly manipulated by
- algorithms within this specification. Hence when the terms “LexicalEnvironment”, and
- “VariableEnvironment” are used without qualification they are in reference to those components of the running
- execution context.
-
-
An execution context is purely a specification mechanism and need not correspond to any particular artefact of an
- ECMAScript implementation. It is impossible for ECMAScript code to directly access or observe an execution context.
-
-
-
- 8.3.1
- ResolveBinding ( name, [env] )
-
- The ResolveBinding abstract operation is used to determine the binding of name passed as a string value. The
- optional argument env can be used to explicitly provide the Lexical
- Environment that is to be searched for the binding. During execution of ECMAScript code, ResolveBinding is performed
- using the following algorithm:
-
-
- If env was not passed or if env is undefined , then
-
- Let env be the running execution context ’s LexicalEnvironment .
-
-
- Assert : env is a Lexical
- Environment .
- If the code matching the syntactic production that is being evaluated is contained in strict mode code , let strict be true , else let strict be
- false .
- Return GetIdentifierReference (env , name , strict ).
-
-
-
-
NOTE The result of ResolveBinding is always a Reference value with its referenced name component equal to the name
- argument.
-
-
-
-
- 8.3.2
- GetThisEnvironment ( )
-
- The abstract operation GetThisEnvironment finds the Environment Record that currently supplies the binding of the keyword this
.
- GetThisEnvironment performs the following steps:
-
-
- Let lex be the running execution context ’s LexicalEnvironment .
- Repeat
-
- Let envRec be lex ’s EnvironmentRecord.
- Let exists be envRec .HasThisBinding().
- If exists is true , return envRec .
- Let outer be the value of lex’s outer environment
- reference .
- Let lex be outer .
-
-
-
-
-
-
NOTE The loop in step 2 will always terminate because the list of environments always ends with
- the global environment which has a this
binding.
-
-
-
-
-
-
-
-
-
-
-
-
-
8.4 Jobs
- and Job Queues
-
-
A Job is an abstract operation that initiates an ECMAScript computation when no other ECMAScript computation is currently
- in progress. A Job abstract operation may be defined to accept an arbitrary set of job parameters.
-
-
Execution of a Job can be initiated only when there is no running execution context
- and the execution context stack is empty. A PendingJob is a request for the future
- execution of a Job. A PendingJob is an internal Record whose fields are specified in Table 25 . Once
- execution of a Job is initiated, the Job always executes to completion. No other Job may be initiated until the currently
- running Job completes. However, the currently running Job or external events may cause the enqueuing of additional
- PendingJobs that may be initiated sometime after completion of the currently running Job.
-
-
- Table 25 — PendingJob Record Fields
-
-
- Field Name
- Value
- Meaning
-
-
- [[Job]]
- The name of a Job abstract operation
- This is the abstract operation that is performed when execution of this PendingJob is initiated. Jobs are abstract operations that use NextJob rather than Return to indicate that they have completed.
-
-
- [[Arguments]]
- A List
- The List of argument values that are to be passed to [[Job]] when it is activated.
-
-
- [[Realm]]
- A Realm Record
- The Realm for the initial execution context when this Pending Job is initiated.
-
-
- [[HostDefined]]
- Any, default value is undefined .
- Field reserved for use by host environments that need to associate additional information with a pending Job.
-
-
-
-
-
A Job Queue is a FIFO queue of PendingJob records. Each Job Queue has a name and the full set of available Job Queues are
- defined by an ECMAScript implementation. Every ECMAScript implementation has at least the Job Queues defined in Table 26 .
-
-
- Table 26 — Required Job Queues
-
-
- Name
- Purpose
-
-
- ScriptJobs
- Jobs that validate and evaluate ECMAScript Script and Module source text. See clauses 10 and 15.
-
-
- PromiseJobs
- Jobs that are responses to the settlement of a Promise (see 25.4 ).
-
-
-
-
-
A request for the future execution of a Job is made by enqueueing, on a Job Queue, a PendingJob record that includes a
- Job abstract operation name and any necessary argument values. When there is no running execution context and the execution context stack
- is empty, the ECMAScript implementation removes the first PendingJob from a Job Queue and uses the information contained in
- it to create an execution context and starts execution of the associated Job abstract
- operation.
-
-
The PendingJob records from a single Job Queue are always initiated in FIFO order. This specification does not define the
- order in which multiple Job Queues are serviced. An ECMAScript implementation may interweave the FIFO evaluation of the
- PendingJob records of a Job Queue with the evaluation of the PendingJob records of one or more other Job Queues. An
- implementation must define what occurs when there are no running execution context and
- all Job Queues are empty.
-
-
-
NOTE Typically an ECMAScript implementation will have its Job Queues pre-initialized with at
- least one PendingJob and one of those Jobs will be the first to be executed. An implementation might choose to free all
- resources and terminate if the current Job completes and all Job Queues are empty. Alternatively, it might choose to wait
- for a some implementation specific agent or mechanism to enqueue new PendingJob requests.
-
-
-
The following abstract operations are used to create and manage Jobs and Job Queues:
-
-
-
- 8.4.1 EnqueueJob (
- queueName, job, arguments)
-
- The EnqueueJob abstract operation requires three arguments: queueName , job , and
- arguments . It performs the following steps:
-
-
- Assert : Type (queueName ) is String and its value is the name of a Job
- Queue recognized by this implementation.
- Assert : job is the name of a Job.
- Assert : arguments is a List that has the same number of elements as the number of
- parameters required by job .
- Let callerContext be the running execution context .
- Let callerRealm be callerContext’s Realm .
- Let pending be PendingJob{ [[Job]]: job , [[Arguments]]: arguments , [[Realm]]: callerRealm ,
- [[HostDefined]]: undefined }.
- Perform any implementation or host environment defined processing of pending . This may include modifying the
- [[HostDefined]] field or any other field of pending .
- Add pending at the back of the Job Queue named by queueName .
- Return NormalCompletion (empty ).
-
-
-
-
- 8.4.2 NextJob
- result
-
- An algorithm step such as:
-
-
- NextJob result .
-
-
- is used in Job abstract operations in place of:
-
-
- Return result .
-
-
- Job abstract operations must not contain a Return step or a ReturnIfAbrupt step. The
- NextJob result operation is equivalent to the following steps:
-
-
- If result is an abrupt completion , perform
- implementation defined unhandled exception processing.
- Suspend the running execution context and
- remove it from the execution context stack .
- Assert : The execution context stack is
- now empty.
- Let nextQueue be a non-empty Job Queue chosen in an implementation defined manner. If all Job Queues are empty,
- the result is implementation defined.
- Let nextPending be the PendingJob record at the front of nextQueue . Remove that record from
- nextQueue .
- Let newContext be a new execution context .
- Set newContext ’s Realm to nextPending .[[Realm]].
- Push newContext onto the execution context stack ; newContext is
- now the running execution context .
- Perform any implementation or host environment defined job initialization using nextPending .
- Perform the abstract operation named by nextPending .[[Job]] using the elements of
- nextPending .[[Arguments]] as its arguments.
-
-
-
-
-
-
-
-
- 8.5.1 InitializeHostDefinedRealm ( realm )
-
- The abstract operation InitializeHostDefinedRealm with parameter realm performs the following steps:
-
-
- If this implementation requires use of an exotic object to serve as realm ’s global object, let
- global be such an object created in an implementation defined manner. Otherwise, let global be
- undefined indicating that an ordinary object should be created as the global object.
- Perform SetRealmGlobalObject (realm , global ).
- Let globalObj be SetDefaultGlobalBindings (realm ).
- ReturnIfAbrupt (globalObj ).
- Create any implementation defined global object properties on globalObj .
- Return NormalCompletion (undefined ).
-
-
-
-
-
-
-
-
9 Ordinary and Exotic Objects Behaviours
-
-
-
-
-
9.1 Ordinary Object Internal Methods and Internal Slots
-
-
All ordinary objects have an internal slot called
- [[Prototype]]. The value of this internal slot is either
- null or an object and is used for implementing inheritance. Data properties of the [[Prototype]] object are inherited
- (are visible as properties of the child object) for the purposes of get access, but not for set access. Accessor properties
- are inherited for both get access and set access.
-
-
Every ordinary object has a Boolean-valued [[Extensible]] internal slot that controls whether or not properties may be
- added to the object. If the value of the [[Extensible]] internal
- slot is false then additional properties may not be added to the object. In addition, if [[Extensible]] is
- false the value of the [[Prototype]] internal slot of
- the object may not be modified. Once the value of an object’s [[Extensible]] internal slot has been set to false it may not be
- subsequently changed to true .
-
-
In the following algorithm descriptions, assume O is an ordinary object, P is a property key value , V is any ECMAScript
- language value , and Desc is a Property
- Descriptor record.
-
-
-
- 9.1.1 [[GetPrototypeOf]] ( )
-
- When the [[GetPrototypeOf]] internal method of O is called the following steps are taken:
-
-
- Return the value of the [[Prototype]] internal slot of
- O .
-
-
-
-
- 9.1.2 [[SetPrototypeOf]] (V)
-
- When the [[SetPrototypeOf]] internal method of O is called with argument V the following steps are
- taken:
-
-
- Assert : Either Type (V ) is Object or Type (V ) is Null.
- Let extensible be the value of the [[Extensible]] internal slot of O .
- Let current be the value of the [[Prototype]] internal slot of O .
- If SameValue (V , current ), return true.
- If extensible is false , return false .
- Let p be V .
- Let done be false .
- Repeat while done is false ,
-
- If p is null , let done be true .
- Else, if SameValue (p , O ) is true , return false .
- Else,
-
- If the [[GetPrototypeOf]] internal method of p is not the ordinary object internal method defined in 9.1.1 , let done be
- true .
- Else, let p be the value of p ’s [[Prototype]] internal slot .
-
-
-
-
- Set the value of the [[Prototype]] internal slot of
- O to V .
- Return true .
-
-
-
-
NOTE The loop in step 8 guarantees that there will be no circularities in any prototype chain
- that only includes objects that use the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]].
-
-
-
-
- 9.1.3 [[IsExtensible]] ( )
-
- When the [[IsExtensible]] internal method of O is called the following steps are taken:
-
-
- Return the value of the [[Extensible]] internal slot of
- O .
-
-
-
-
- 9.1.4 [[PreventExtensions]] ( )
-
- When the [[PreventExtensions]] internal method of O is called the following steps are taken:
-
-
- Set the value of the [[Extensible]] internal slot of
- O to false .
- Return true.
-
-
-
-
-
-
-
- 9.1.5.1 OrdinaryGetOwnProperty (O, P)
-
- When the abstract operation OrdinaryGetOwnProperty is called with Object O and with property key P , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- If O does not have an own property with key P , return undefined .
- Let D be a newly created Property Descriptor with
- no fields.
- Let X be O ’s own property whose key is P .
- If X is a data property, then
-
- Set D .[[Value]] to the value of X ’s [[Value]] attribute.
- Set D .[[Writable]] to the value of X ’s [[Writable]] attribute
-
-
- Else X is an accessor property, so
-
- Set D .[[Get]] to the value of X ’s [[Get]] attribute.
- Set D .[[Set]] to the value of X ’s [[Set]] attribute.
-
-
- Set D .[[Enumerable]] to the value of X ’s [[Enumerable]] attribute.
- Set D .[[Configurable]] to the value of X ’s [[Configurable]] attribute.
- Return D .
-
-
-
-
-
-
-
-
-
-
- 9.1.6.2 IsCompatiblePropertyDescriptor (Extensible, Desc, Current)
-
- When the abstract operation IsCompatiblePropertyDescriptor is called
- with Boolean value Extensible , and Property Descriptors Desc , and Current the following steps are taken:
-
-
- Return ValidateAndApplyPropertyDescriptor (undefined ,
- undefined , Extensible , Desc , Current ).
-
-
-
-
- 9.1.6.3 ValidateAndApplyPropertyDescriptor (O, P, extensible, Desc,
- current)
-
- When the abstract operation ValidateAndApplyPropertyDescriptor is
- called with Object O , property key P , Boolean value extensible , and Property Descriptors Desc , and
- current the following steps are taken:
-
- This algorithm contains steps that test various fields of the Property Descriptor Desc for specific
- values. The fields that are tested in this manner need not actually exist in Desc . If a field is
- absent then its value is considered to be false .
-
-
-
NOTE If undefined is passed as the O argument only validation is performed and
- no object updates are performed.
-
-
-
- Assert : If O is not undefined then P is a valid property key .
- If current is undefined , then
-
- If extensible is false , return false .
- Assert : extensible is true .
- If IsGenericDescriptor (Desc ) or IsDataDescriptor (Desc ) is true , then
-
- If O is not undefined , create an own data property named P of object O whose
- [[Value]], [[Writable]], [[Enumerable]] and [[Configurable]] attribute values are described by Desc .
- If the value of an attribute field of Desc is absent, the attribute of the newly created property is
- set to its default value.
-
-
- Else Desc must be an accessor Property
- Descriptor ,
-
- If O is not undefined , create an own accessor property named P of object O whose
- [[Get]], [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by Desc . If the
- value of an attribute field of Desc is absent, the attribute of the newly created property is set to
- its default value.
-
-
- Return true .
-
-
- Return true , if every field in Desc is absent.
- Return true , if every field in Desc also occurs in current and the value of every field in
- Desc is the same value as the corresponding field in current when compared using the SameValue algorithm .
- If the [[Configurable]] field of current is false , then
-
- Return false , if the [[Configurable]] field of Desc is true .
- Return false , if the [[Enumerable]] field of Desc is present and the [[Enumerable]] fields of
- current and Desc are the Boolean negation of each other.
-
-
- If IsGenericDescriptor (Desc ) is true , no further validation is
- required.
- Else if IsDataDescriptor (current ) and IsDataDescriptor (Desc ) have different results, then
-
- Return false , if the [[Configurable]] field of current is false .
- If IsDataDescriptor (current ) is true , then
-
- If O is not undefined , convert the property named P of object O from a data
- property to an accessor property. Preserve the existing values of the converted property’s
- [[Configurable]] and [[Enumerable]] attributes and set the rest of the property’s attributes to their
- default values.
-
-
- Else,
-
- If O is not undefined , convert the property named P of object O from an accessor
- property to a data property. Preserve the existing values of the converted property’s [[Configurable]]
- and [[Enumerable]] attributes and set the rest of the property’s attributes to their default
- values.
-
-
-
-
- Else if IsDataDescriptor (current ) and IsDataDescriptor (Desc ) are both true , then
-
- If the [[Configurable]] field of current is false , then
-
- Return false , if the [[Writable]] field of current is false and the [[Writable]] field
- of Desc is true .
- If the [[Writable]] field of current is false , then
-
- Return false , if the [[Value]] field of Desc is present and SameValue (Desc .[[Value]], current .[[Value]]) is
- false .
-
-
-
-
- Else the [[Configurable]] field of current is true , so any change is acceptable.
-
-
- Else IsAccessorDescriptor (current ) and IsAccessorDescriptor (Desc ) are both true ,
-
- If the [[Configurable]] field of current is false , then
-
- Return false , if the [[Set]] field of Desc is present and SameValue (Desc .[[Set]], current .[[Set]]) is false .
- Return false , if the [[Get]] field of Desc is present and SameValue (Desc .[[Get]], current .[[Get]]) is false .
-
-
-
-
- If O is not undefined , then
-
- For each field of Desc that is present, set the corresponding attribute of the property named P of
- object O to the value of the field.
-
-
- Return true .
-
-
-
-
NOTE Step 8.b allows any field of Desc to be different from the corresponding field of
- current if current’s [[Configurable]] field is true . This even permits changing the [[Value]] of a property
- whose [[Writable]] attribute is false . This is allowed because a true [[Configurable]] attribute would
- permit an equivalent sequence of calls where [[Writable]] is first set to true , a new [[Value]] is set, and then
- [[Writable]] is set to false .
-
-
-
-
-
-
-
9.1.7 [[HasProperty]](P)
-
-
When the [[HasProperty]] internal method of O is called with property key
- P , the following steps are taken:
-
-
- Return OrdinaryHasProperty (O , P ).
-
-
-
-
- 9.1.7.1 OrdinaryHasProperty (O, P)
-
- When the abstract operation OrdinaryHasProperty is called with Object O and with property key P , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let hasOwn be OrdinaryGetOwnProperty (O , P ).
- If hasOwn is not undefined , return true .
- Let parent be O .[[GetPrototypeOf]]().
- ReturnIfAbrupt (parent ).
- If parent is not null , then
-
- Return parent .[[HasProperty]](P ).
-
-
- Return false .
-
-
-
-
-
- 9.1.8 [[Get]] (P, Receiver)
-
- When the [[Get]] internal method of O is called with property key P
- and ECMAScript language value Receiver the following
- steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let desc be O .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (desc ).
- If desc is undefined , then
-
- Let parent be O .[[GetPrototypeOf]]().
- ReturnIfAbrupt (parent ).
- If parent is null , return undefined.
- Return parent .[[Get]](P , Receiver ).
-
-
- If IsDataDescriptor (desc ) is true , return
- desc .[[Value]].
- Otherwise, IsAccessorDescriptor (desc ) must be true so, let
- getter be desc .[[Get]].
- If getter is undefined , return undefined .
- Return Call (getter, Receiver ).
-
-
-
-
- 9.1.9 [[Set]] ( P, V, Receiver)
-
- When the [[Set]] internal method of O is called with property key P ,
- value V , and ECMAScript language value Receiver , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let ownDesc be O .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (ownDesc ).
- If ownDesc is undefined , then
-
- Let parent be O .[[GetPrototypeOf]]().
- ReturnIfAbrupt (parent ).
- If parent is not null , then
-
- Return parent .[[Set]](P , V , Receiver ).
-
-
- Else,
-
- Let ownDesc be the PropertyDescriptor{[[Value]]: undefined , [[Writable]]: true ,
- [[Enumerable]]: true , [[Configurable]]: true }.
-
-
-
-
- If IsDataDescriptor (ownDesc ) is true , then
-
- If ownDesc .[[Writable]] is false , return false .
- If Type (Receiver ) is not Object, return
- false .
- Let existingDescriptor be Receiver .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (existingDescriptor ).
- If existingDescriptor is not undefined , then
-
- Let valueDesc be the PropertyDescriptor{[[Value]]: V }.
- Return Receiver .[[DefineOwnProperty]](P , valueDesc ).
-
-
- Else Receiver does not currently have a property P ,
-
- Return CreateDataProperty (Receiver , P , V ).
-
-
-
-
- Assert : IsAccessorDescriptor (ownDesc ) is true .
- Let setter be ownDesc .[[Set]].
- If setter is undefined , return false .
- Let setterResult be Call (setter , Receiver , «V »).
- ReturnIfAbrupt (setterResult ).
- Return true .
-
-
-
-
- 9.1.10 [[Delete]] (P)
-
- When the [[Delete]] internal method of O is called with property key
- P the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let desc be O .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (desc ).
- If desc is undefined , return true .
- If desc .[[Configurable]] is true , then
-
- Remove the own property with name P from O .
- Return true .
-
-
- Return false .
-
-
-
-
- 9.1.11 [[Enumerate]] ()
-
- When the [[Enumerate]] internal method of O is called the following steps are taken:
-
-
- Return an Iterator object (25.1.1.2 ) whose next
method iterates
- over all the String-valued keys of enumerable properties of O . The Iterator object must inherit from
- %IteratorPrototype% (25.1.2 ). The mechanics and order of enumerating the
- properties is not specified but must conform to the rules specified below.
-
-
- The iterator’s next
method processes object properties to determine whether the property key should be returned as an iterator value. Returned property keys do not include keys
- that are Symbols. Properties of the target object may be deleted during enumeration. A property that is deleted before it is
- processed by the iterator’s next
method is ignored. If new properties are added to the target object
- during enumeration, the newly added properties are not guaranteed to be processed in the active enumeration. A property name
- will be returned by the iterator’s next
method at most once in any enumeration.
-
- Enumerating the properties of the target object includes enumerating properties of its prototype, and the prototype of
- the prototype, and so on, recursively; but a property of a prototype is not processed if it has the same name as a property
- that has already been processed by the iterator’s next
method. The values of [[Enumerable]] attributes
- are not considered when determining if a property of a prototype object has already been processed. The enumerable property
- names of prototype objects must be obtained as if by invoking the prototype object’s [[Enumerate]] internal method.
- [[Enumerate]] must obtain the own property keys of the target object as if by calling its [[OwnPropertyKeys]] internal
- method. Property attributes of the target object must be obtained as if by calling its [[GetOwnProperty]] internal
- method.
-
- NOTE The following is an informative definition of an ECMAScript generator function that conforms to these
- rules:
-
- function* enumerate(obj) {
- let visited=new Set;
- for (let key of Reflect.ownKeys (obj)) {
- if (typeof key === "string") {
- let desc = Reflect.getOwnPropertyDescriptor (obj,key);
- if (desc) {
- visited.add(key);
- if (desc.enumerable) yield key;
- }
- }
- }
- let proto = Reflect.getPrototypeOf (obj)
- if (proto === null) return;
- for (let protoName of Reflect.enumerate (proto)) {
- if (!visited.has(protoName)) yield protoName;
- }
- }
-
-
-
- 9.1.12 [[OwnPropertyKeys]] ( )
-
- When the [[OwnPropertyKeys]] internal method of O is called the following steps are taken:
-
-
- Let keys be a new empty List .
- For each own property key P of O that is an integer index, in ascending
- numeric index order
-
- Add P as the last element of keys .
-
-
- For each own property key P of O that is a String but is not an integer
- index, in property creation order
-
- Add P as the last element of keys .
-
-
- For each own property key P of O that is a Symbol, in property creation
- order
-
- Add P as the last element of keys .
-
-
- Return keys .
-
-
-
-
- 9.1.13
- ObjectCreate(proto, internalSlotsList)
-
- The abstract operation ObjectCreate with argument proto (an object or null) is used to specify the runtime
- creation of new ordinary objects. The optional argument internalSlotsList is a List of the names of additional internal slots that must be defined as
- part of the object. If the list is not provided, an empty List is
- used. This abstract operation performs the following steps:
-
-
- If internalSlotsList was not provided, let internalSlotsList be an empty List .
- Let obj be a newly created object with an internal
- slot for each name in internalSlotsList .
- Set obj ’s essential internal methods to the default ordinary object definitions specified in 9.1 .
- Set the [[Prototype]] internal slot of obj to
- proto .
- Set the [[Extensible]] internal slot of obj to
- true .
- Return obj .
-
-
-
-
- 9.1.14 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto,
- internalSlotsList )
-
- The abstract operation OrdinaryCreateFromConstructor creates an ordinary object whose [[Prototype]] value is retrieved
- from a constructor’s prototype
property, if it exists. Otherwise the intrinsic named by
- intrinsicDefaultProto is used for [[Prototype]]. The optional internalSlotsList is a List of the names of additional internal slots that must be defined as
- part of the object. If the list is not provided, an empty List is
- used. This abstract operation performs the following steps:
-
-
- Assert : intrinsicDefaultProto is a string value that is this
- specification’s name of an intrinsic object. The corresponding object must be an intrinsic that is intended to
- be used as the [[Prototype]] value of an object.
- Let proto be GetPrototypeFromConstructor (constructor ,
- intrinsicDefaultProto ).
- ReturnIfAbrupt (proto ).
- Return ObjectCreate (proto , internalSlotsList ).
-
-
-
-
- 9.1.15 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
-
- The abstract operation GetPrototypeFromConstructor determines the [[Prototype]] value that should be used to create an
- object corresponding to a specific constructor. The value is retrieved from the constructor’s prototype
- property, if it exists. Otherwise the intrinsic named by intrinsicDefaultProto is used for [[Prototype]]. This
- abstract operation performs the following steps:
-
-
- Assert : intrinsicDefaultProto is a string value that is this
- specification’s name of an intrinsic object. The corresponding object must be an intrinsic that is intended to
- be used as the [[Prototype]] value of an object.
- Assert : IsConstructor (constructor )
- is true .
- Let proto be Get (constructor , "prototype"
).
- ReturnIfAbrupt (proto ).
- If Type (proto ) is not Object, then
-
- Let realm be GetFunctionRealm (constructor ).
- ReturnIfAbrupt (realm ).
- Let proto be realm’s intrinsic object named intrinsicDefaultProto .
-
-
- Return proto .
-
-
-
-
NOTE If constructor does not supply a [[Prototype]] value, the default value that is
- used is obtained from the Code Realm of the constructor function rather than from the running execution context .
-
-
-
-
-
-
-
9.2
- ECMAScript Function Objects
-
-
ECMAScript function objects encapsulate parameterized ECMAScript code closed over a lexical environment and support the dynamic evaluation of that code. An ECMAScript
- function object is an ordinary object and has the same internal slots and the same internal methods as other ordinary
- objects. The code of an ECMAScript function object may be either strict mode code (10.2.1 ) or non-strict mode code . An ECMAScript function
- object whose code is strict mode code is called a strict function . One whose code
- is not strict mode code is called a non-strict function .
-
-
ECMAScript function objects have the additional internal slots listed in Table 27 .
-
-
- Table 27 — Internal Slots of ECMAScript Function Objects
-
-
- Internal Slot
- Type
- Description
-
-
- [[Environment]]
- Lexical Environment
- The Lexical Environment that the function was closed over. Used as the outer environment when evaluating the code of the function.
-
-
- [[FormalParameters]]
- Parse Node
- The root parse node of the source text that defines the function’s formal parameter list.
-
-
- [[FunctionKind]]
- String
- Either "normal"
, "classConstructor"
or "generator"
.
-
-
- [[ECMAScriptCode]]
- Parse Node
- The root parse node of the source text that defines the function’s body.
-
-
- [[ConstructorKind]]
- String
- Either "base"
or "derived"
.
-
-
- [[Realm]]
- Realm Record
- The Code Realm in which the function was created and which provides any intrinsic objects that are accessed when evaluating the function.
-
-
- [[ThisMode]]
- (lexical, strict, global)
- Defines how this
references are interpreted within the formal parameters and code body of the function. lexical means that this
refers to the this value of a lexically enclosing function. strict means that the this value is used exactly as provided by an invocation of the function. global means that a this value of undefined is interpreted as a reference to the global object.
-
-
- [[Strict]]
- Boolean
- true if this is a strict mode function, false if this is not a strict mode function.
-
-
- [[HomeObject]]
- Object
- If the function uses super
, this is the object whose [[GetPrototypeOf]] provides the object where super
property lookups begin.
-
-
-
-
-
All ECMAScript function objects have the [[Call]] internal method defined here. ECMAScript functions that are also
- constructors in addition have the [[Construct]] internal method. ECMAScript function objects whose code is not strict mode code have the [[GetOwnProperty]] internal method defined here.
-
-
-
-
-
-
-
-
- 9.2.1.2 OrdinaryCallBindThis ( F, calleeContext, thisArgument )
-
- When the abstract operation OrdinaryCallBindThis is called with function object F , execution context calleeContext , and ECMAScript value
- thisArgument the following steps are taken:
-
-
- Let thisMode be the value of F ’s [[ThisMode]] internal slot .
- If thisMode is lexical , return NormalCompletion (undefined ).
- Let calleeRealm be the value of F’s [[Realm]] internal slot .
- Let localEnv be the LexicalEnvironment of calleeContext .
- If thisMode is strict , let thisValue be
- thisArgument .
- Else
-
- if thisArgument is null or undefined , then
-
- Let thisValue be calleeRealm .[[globalThis]].
-
-
- Else
-
- Let thisValue be ToObject (thisArgument ).
- Assert : thisValue is not an abrupt completion .
- NOTE ToObject produces wrapper objects using calleeRealm .
-
-
-
-
- Let envRec be localEnv ’s EnvironmentRecord.
- Assert : The next step never returns an abrupt completion because envRec .[[thisBindingStatus]]
- is "uninitialized"
.
- Return envRec .BindThisValue (thisValue ).
-
-
-
-
- 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
-
- When the abstract operation OrdinaryCallEvaluateBody is called with function object F and List argumentsList the following steps are taken:
-
-
- Let status be FunctionDeclarationInstantiation (F ,
- argumentsList ).
- ReturnIfAbrupt (status )
- Return the result of EvaluateBody of the parsed code that is the value of F 's [[ECMAScriptCode]] internal slot passing F as the argument.
-
-
-
-
-
- 9.2.2 [[Construct]] ( argumentsList, newTarget)
-
- The [[Construct]] internal method for an ECMAScript Function object
- F is called with parameters argumentsList and newTarget . argumentsList is a possibly empty List of ECMAScript language
- values . The following steps are taken:
-
-
- Assert : F is an ECMAScript
- function object .
- Assert : Type (newTarget ) is Object.
- Let callerContext be the running execution context .
- Let kind be F ’s [[ConstructorKind]] internal slot .
- If kind is "base"
, then
-
- Let thisArgument be OrdinaryCreateFromConstructor (newTarget ,
- "%ObjectPrototype%"
).
- ReturnIfAbrupt (thisArgument ).
-
-
- Let calleeContext be PrepareForOrdinaryCall (F ,
- newTarget ).
- Assert : calleeContext is now the
- running execution context .
- If kind is "base"
, perform OrdinaryCallBindThis (F ,
- calleeContext , thisArgument ).
- Let constructorEnv be the LexicalEnvironment of
- calleeContext .
- Let envRec be constructorEnv ’s EnvironmentRecord.
- Let result be OrdinaryCallEvaluateBody (F ,
- argumentsList ).
- Remove calleeContext from the execution context stack and restore
- callerContext as the running execution context .
- If result .[[type]] is return , then
-
- If Type (result .[[value]]) is Object, return NormalCompletion (result .[[value]]).
- If kind is "base"
, return NormalCompletion (thisArgument ).
- If result .[[value]] is not undefined , throw a TypeError exception.
-
-
- Else, ReturnIfAbrupt (result ).
- Return envRec .GetThisBinding().
-
-
-
-
- 9.2.3
- FunctionAllocate (functionPrototype, strict [,functionKind] )
-
- The abstract operation FunctionAllocate requires the two arguments functionPrototype and strict . It also accepts one optional argument, functionKind .
- FunctionAllocate performs the following steps:
-
-
- Assert : Type (functionPrototype ) is Object.
- Assert : If functionKind is present, its value is either
- "normal"
, "non-constructor"
or "generator"
.
- If functionKind is not present, let functionKind be "normal"
.
- If functionKind is "non-constructor"
, then
-
- Let functionKind be "normal"
.
- Let needsConstruct be false .
-
-
- Else let needsConstruct be true .
- Let F be a newly created ECMAScript function object with the
- internal slots listed in Table 27 . All of those internal slots are initialized to
- undefined .
- Set F ’s essential internal methods to the default ordinary object definitions specified in 9.1 .
- Set F ’s [[Call]] internal method to the definition specified in 9.2.1 .
- If needsConstruct is true , then
-
- Set F ’s [[Construct]] internal method to the definition specified in 9.2.2 .
- If functionKind is "generator"
, set the [[ConstructorKind]] internal slot of F to
- "derived"
.
- Else, set the [[ConstructorKind]] internal slot of
- F to "base"
.
- NOTE Generator functions are tagged as "derived"
constructors to prevent [[Construct]] from
- preallocating a generator instance. Generator instance objects are allocated when EvaluateBody is applied to the
- GeneratorBody of a generator function.
-
-
- Set the [[Strict]] internal slot of F to
- strict .
- Set the [[FunctionKind]] internal slot of F to
- functionKind .
- Set the [[Prototype]] internal slot of F to
- functionPrototype .
- Set the [[Extensible]] internal slot of F to
- true .
- Set the [[Realm]] internal slot of F to the running execution context ’s Realm .
- Return F .
-
-
-
-
- 9.2.4
- FunctionInitialize (F, kind, ParameterList, Body, Scope)
-
- The abstract operation FunctionInitialize requires the arguments: a function object F , kind which
- is one of (Normal, Method, Arrow), a parameter list production specified by ParameterList , a body
- production specified by Body , a Lexical Environment
- specified by Scope . FunctionInitialize performs the following
- steps:
-
-
- Assert : F is an extensible object that does not have a
- length
own property.
- Let len be the ExpectedArgumentCount of ParameterList .
- Let status be DefinePropertyOrThrow (F , "length"
,
- PropertyDescriptor{[[Value]]: len , [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]:
- true }).
- Assert : status is not an abrupt completion .
- Let Strict be the value of the [[Strict]] internal
- slot of F .
- Set the [[Environment]] internal slot of F to the
- value of Scope .
- Set the [[FormalParameters]] internal slot of F
- to ParameterList .
- Set the [[ECMAScriptCode]] internal slot of F to
- Body .
- If kind is Arrow , set the [[ThisMode]] internal slot of F to lexical .
- Else if Strict is true , set the [[ThisMode]] internal slot of F to strict .
- Else set the [[ThisMode]] internal slot of F to
- global .
- Return F .
-
-
-
-
- 9.2.5
- FunctionCreate (kind, ParameterList, Body, Scope, Strict, prototype)
-
- The abstract operation FunctionCreate requires the arguments: kind which is one of (Normal, Method, Arrow), a
- parameter list production specified by ParameterList , a body production specified by Body , a Lexical Environment specified by Scope , a Boolean flag Strict , and optionally, an object prototype . FunctionCreate performs the following steps:
-
-
- If the prototype argument was not passed, then
-
- Let prototype be the intrinsic object %FunctionPrototype%.
-
-
- If kind is not Normal , let allocKind be
- "non-constructor"
.
- Else let allocKind be "normal"
.
- Let F be FunctionAllocate (prototype , Strict ,
- allocKind ).
- Return FunctionInitialize (F , kind , ParameterList ,
- Body , Scope ).
-
-
-
-
- 9.2.6
- GeneratorFunctionCreate (kind, ParameterList, Body, Scope, Strict)
-
- The abstract operation GeneratorFunctionCreate requires the arguments: kind which is one of (Normal, Method),
- a parameter list production specified by ParameterList , a body production specified by Body , a Lexical Environment specified by Scope , and a Boolean flag Strict . GeneratorFunctionCreate performs the following
- steps:
-
-
- Let functionPrototype be the intrinsic object %Generator%.
- Let F be FunctionAllocate (functionPrototype , Strict ,
- "generator"
).
- Return FunctionInitialize (F , kind , ParameterList ,
- Body , Scope ).
-
-
-
-
-
-
9.2.7 AddRestrictedFunctionProperties ( F, realm )
-
-
The abstract operation AddRestrictedFunctionProperties is called with a function object F and Realm Record realm as its argument. It performs the following steps:
-
-
- Assert : realm .[[intrinsics]].[[%ThrowTypeError%]] exists and has been initialized.
- Let thrower be realm .[[intrinsics]].[[%ThrowTypeError%]].
- Let status be DefinePropertyOrThrow (F , "caller"
,
- PropertyDescriptor {[[Get]]: thrower , [[Set]]: thrower , [[Enumerable]]: false ,
- [[Configurable]]: true }).
- Assert : status is not an abrupt completion .
- Return DefinePropertyOrThrow (F , "arguments"
,
- PropertyDescriptor {[[Get]]: thrower , [[Set]]: thrower , [[Enumerable]]: false ,
- [[Configurable]]: true }).
- Assert : The above returned value is not an abrupt completion .
-
-
-
-
- 9.2.7.1
- %ThrowTypeError% ( )
-
- The %ThrowTypeError% intrinsic is an anonymous built-in function object that is defined once for each Realm . When %ThrowTypeError% is called it performs the following steps:
-
-
- Throw a TypeError exception.
-
-
- The value of the [[Extensible]] internal slot of a
- %ThrowTypeError% function is false .
-
- The length
property of a %ThrowTypeError% function has the attributes { [[Writable]]: false ,
- [[Enumerable]]: false , [[Configurable]]: false }.
-
-
-
-
- 9.2.8
- MakeConstructor (F, writablePrototype, prototype)
-
- The abstract operation MakeConstructor requires a Function argument F and optionally, a Boolean
- writablePrototype and an object prototype . If prototype is provided it is assumed to
- already contain, if needed, a "constructor"
property whose value is F . This operation converts
- F into a constructor by performing the following steps:
-
-
- Assert : F is an ECMAScript
- function object .
- Assert : F has a [[Construct]] internal method.
- Assert : F is an extensible object that does not have a
- prototype
own property.
- Let installNeeded be false .
- If the prototype argument was not provided, then
-
- Let installNeeded be true .
- Let prototype be ObjectCreate (%ObjectPrototype% ).
-
-
- If the writablePrototype argument was not provided, then
-
- Let writablePrototype be true .
-
-
- If installNeeded , then
-
- Let status be DefinePropertyOrThrow (prototype ,
- "constructor"
, PropertyDescriptor{[[Value]]: F , [[Writable]]: writablePrototype ,
- [[Enumerable]]: false , [[Configurable]]: writablePrototype }).
- Assert : status is not an abrupt completion .
-
-
- Let status be DefinePropertyOrThrow (F ,
- "prototype"
, PropertyDescriptor{[[Value]]: prototype , [[Writable]]: writablePrototype ,
- [[Enumerable]]: false , [[Configurable]]: false }).
- Assert : status is not an abrupt completion .
- Return NormalCompletion (undefined ).
-
-
-
-
-
-
-
-
- 9.2.11
- SetFunctionName (F, name, prefix)
-
- The abstract operation SetFunctionName requires a Function argument F , a String or Symbol argument
- name and optionally a String argument prefix . This operation adds a name
property to
- F by performing the following steps:
-
-
- Assert : F is an extensible object that does not have a
- name
own property.
- Assert : Type (name )
- is either Symbol or String.
- Assert : If prefix was passed then Type (prefix ) is String.
- If Type (name ) is Symbol, then
-
- Let description be name ’s [[Description]] value.
- If description is undefined , let name be the empty String.
- Else, let name be the concatenation of "["
, description , and "]"
.
-
-
- If prefix was passed, then
-
- Let name be the concatenation of prefix , code unit 0x0020 (SPACE), and name .
-
-
- Return DefinePropertyOrThrow (F , "name"
,
- PropertyDescriptor{[[Value]]: name , [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]:
- true }).
- Assert : the result is never an abrupt completion .
-
-
-
-
- 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
-
-
-
NOTE When an execution context is established for
- evaluating an ECMAScript function a new function Environment Record is created and
- bindings for each formal parameter are instantiated in that Environment Record .
- Each declaration in the function body is also instantiated. If the function’s formal parameters do not include any
- default value initializers then the body declarations are instantiated in the same Environment Record as the parameters. If default value parameter initializers exist, a
- second Environment Record is created for the body declarations. Formal parameters
- and functions are initialized as part of FunctionDeclarationInstantiation. All other bindings are initialized during
- evaluation of the function body.
-
-
- FunctionDeclarationInstantiation is performed as follows using arguments func and argumentsList .
- func is the function object for which the execution context is being
- established.
-
-
- Let calleeContext be the running execution context .
- Let env be the LexicalEnvironment of calleeContext .
- Let envRec be env ’s Environment Record .
- Let code be the value of the [[ECMAScriptCode]] internal slot of func .
- Let strict be the value of the [[Strict]] internal
- slot of func .
- Let formals be the value of the [[FormalParameters]] internal slot of func .
- Let parameterNames be the BoundNames of formals .
- If parameterNames has any duplicate entries, let hasDuplicates be true . Otherwise, let
- hasDuplicates be false .
- Let simpleParameterList be IsSimpleParameterList of formals .
- Let hasParameterExpressions be ContainsExpression of formals.
- Let varNames be the VarDeclaredNames of code .
- Let varDeclarations be the VarScopedDeclarations of code .
- Let lexicalNames be the LexicallyDeclaredNames of code .
- Let functionNames be an empty List .
- Let functionsToInitialize be an empty List .
- For each d in varDeclarations , in reverse list order do
-
- If d is neither a VariableDeclaration or a ForBinding , then
-
- Assert : d is either a FunctionDeclaration or a
- GeneratorDeclaration .
- Let fn be the sole element of the BoundNames of d.
- If fn is not an element of functionNames , then
-
- Insert fn as the first element of functionNames .
- NOTE If there are multiple FunctionDeclarations or
- GeneratorDeclarations for the same name, the last declaration is used.
- Insert d as the first element of functionsToInitialize .
-
-
-
-
-
-
- Let argumentsObjectNeeded be true .
- If the value of the [[ThisMode]] internal slot of
- func is lexical , then
-
- NOTE Arrow functions never have an arguments objects.
- Let argumentsObjectNeeded be false .
-
-
- Else if "arguments"
is an element of parameterNames , then
-
- Let argumentsObjectNeeded be false .
-
-
- Else if hasParameterExpressions is false , then
-
- If "arguments"
is an element of functionNames or if "arguments"
is an element of
- lexicalNames , then
-
- Let argumentsObjectNeeded be false .
-
-
-
-
- For each String paramName in parameterNames , do
-
- Let alreadyDeclared be envRec .HasBinding(paramName ).
- NOTE Early errors ensure that duplicate parameter names can only occur in non-strict functions that do not have
- parameter default values or rest parameters.
- If alreadyDeclared is false , then
-
- Let status be envRec .CreateMutableBinding(paramName ).
- If hasDuplicates is true , then
-
- Let status be envRec .InitializeBinding(paramName , undefined ).
-
-
- Assert : status is never an abrupt completion for either of the above
- operations.
-
-
-
-
- If argumentsObjectNeeded is true , then
-
- If strict is true or if simpleParameterList is false , then
-
- Let ao be CreateUnmappedArgumentsObject (argumentsList ).
-
-
- Else,
-
- NOTE mapped argument object is only provided for non-strict functions that don’t have a rest parameter,
- any parameter default value initializers, or any destructured parameters .
- Let ao be CreateMappedArgumentsObject (func ,
- formals , argumentsList , env ).
-
-
- ReturnIfAbrupt (ao ).
- If strict is true , then
-
- Let status be envRec .CreateImmutableBinding("arguments"
).
-
-
- Else,
-
- Let status be envRec .CreateMutableBinding("arguments"
).
-
-
- Assert : status is never an abrupt completion .
- Call envRec .InitializeBinding("arguments"
, ao ).
- Append "arguments"
to parameterNames .
-
-
- Let iteratorRecord be Record {[[iterator]]: CreateListIterator (argumentsList ), [[done]]: false }.
- If hasDuplicates is true , then
-
- Let formalStatus be IteratorBindingInitialization for formals with iteratorRecord and
- undefined as arguments.
-
-
- Else,
-
- Let formalStatus be IteratorBindingInitialization for formals with iteratorRecord and
- envRec as arguments.
-
-
- ReturnIfAbrupt (formalStatus ).
- If hasParameterExpressions is false , then
-
- NOTE Only a single lexical environment is needed for the parameters and
- top-level vars.
- Let instantiatedVarNames be a copy of the List
- parameterNames .
- For each n in varNames , do
-
- If n is not an element of instantiatedVarNames , then
-
- Append n to instantiatedVarNames .
- Let status be envRec .CreateMutableBinding(n ).
- Assert : status is never an abrupt completion .
- Call envRec .InitializeBinding(n , undefined ).
-
-
-
-
- Let varEnv be env .
- Let varEnvRec be envRec .
-
-
- Else,
-
- NOTE A separate Environment Record is needed to ensure that closures
- created by expressions in the formal parameter list do not have visibility of declarations in the function
- body.
- Let varEnv be NewDeclarativeEnvironment (env ).
- Let varEnvRec be varEnv ’s EnvironmentRecord.
- Set the VariableEnvironment of calleeContext to varEnv .
- Let instantiatedVarNames be a new empty List .
- For each n in varNames , do
-
- If n is not an element of instantiatedVarNames , then
-
- Append n to instantiatedVarNames .
- Let status be varEnvRec .CreateMutableBinding(n ).
- Assert : status is never an abrupt completion .
- If n is not an element of parameterNames or if n is an element of
- functionNames , let initialValue be undefined .
- else,
-
- Let initialValue be envRec. GetBindingValue(n , false ).
- ReturnIfAbrupt (initialValue ).
-
-
- Call varEnvRec .InitializeBinding(n , initialValue ).
- NOTE vars whose names are the same as a formal parameter, initially have the same value as the
- corresponding initialized parameter.
-
-
-
-
-
-
- NOTE: Annex B.3.3 adds
- additional steps at this point.
- If strict is false , then
-
- Let lexEnv be NewDeclarativeEnvironment (varEnv ).
- NOTE: Non-strict functions use a separate lexical Environment Record for
- top-level lexical declarations so that a direct eval
(see 12.3.4.1 ) can determine whether any var scoped
- declarations introduced by the eval code conflict with pre-existing top-level lexically scoped declarations. This
- is not needed for strict functions because a strict direct eval
always places all declarations into a
- new Environment Record .
-
-
- Else, let lexEnv be varEnv .
- Let lexEnvRec be lexEnv ’s EnvironmentRecord.
- Set the LexicalEnvironment of calleeContext to lexEnv .
- Let lexDeclarations be the LexicallyScopedDeclarations of code .
- For each element d in lexDeclarations do
-
- NOTE A lexically declared name cannot be the same as a function/generator declaration, formal parameter, or a var
- name. Lexically declared names are only instantiated here but not initialized.
- For each element dn of the BoundNames of d do
-
- If IsConstantDeclaration of d is true , then
-
- Let status be lexEnvRec .CreateImmutableBinding(dn , true ).
-
-
- Else,
-
- Let status be lexEnvRec .CreateMutableBinding(dn , false ).
-
-
-
-
- Assert : status is never an abrupt completion .
-
-
- For each parsed grammar phrase f in functionsToInitialize , do
-
- Let fn be the sole element of the BoundNames of f.
- Let fo be the result of performing InstantiateFunctionObject for f with argument lexEnv .
- Let status be varEnvRec .SetMutableBinding(fn , fo , false ).
- Assert : status is never an abrupt completion .
-
-
- Return NormalCompletion (empty ).
-
-
-
-
NOTE 1 B.3.3 provides an extension to the
- above algorithm that is necessary for backwards compatibility with web browser implementations of ECMAScript that predate
- the sixth edition of ECMA-262.
-
-
-
-
NOTE 2 Parameter Initializers may contain direct eval expressions (12.3.4.1 ). Any top level declarations of such evals are only
- visible to the eval code (10.2 ). The creation of the environment for such
- declarations is described in 14.1.18 .
-
-
-
-
-
-
-
9.3
- Built-in Function Objects
-
-
The built-in function objects defined in this specification may be implemented as either ECMAScript function objects (9.2 ) whose behaviour is provided using ECMAScript code or as implementation
- provided exotic function objects whose behaviour is provided in some other manner. In either case, the effect of calling
- such functions must conform to their specifications. An implementation may also provide additional built-in function objects
- that are not defined in this specification.
-
-
If a built-in function object is implemented as an exotic object it must have the ordinary object behaviour specified in
- 9.1 . All such exotic function objects also have
- [[Prototype]], [[Extensible]], and [[Realm]] internal slots.
-
-
Unless otherwise specified every built-in function object has the %FunctionPrototype% object (19.2.3 ) as the initial value of its [[Prototype]] internal slot .
-
-
The behaviour specified for each built-in function via algorithm steps or other means is the specification of the
- function body behaviour for both [[Call]] and [[Construct]] invocations of the function. However, [[Construct]] invocation
- is not supported by all built-in functions. For each built-in function, when invoked with [[Call]], the [[Call]]
- thisArgument provides the this value, the [[Call]] argumentsList provides
- the named parameters, and the NewTarget value is undefined . When invoked with [[Construct]], the
- this value is uninitialized, the [[Construct]] argumentsList provides the named
- parameters, and the [[Construct]] newTarget parameter provides the NewTarget value. If the built-in function is
- implemented as an ECMAScript function object then this specified behaviour
- must be implemented by the ECMAScript code that is the body of the function. Built-in functions that are ECMAScript function
- objects must be strict mode functions. If a built-in constructor has any [[Call]] behaviour other than throwing a TypeError exception, an ECMAScript implementation of the function must be done in a manner that does
- not cause the function’s [[FunctionKind]] internal slot
- to have the value "classConstructor"
.
-
-
Built-in function objects that are not identified as constructors do not implement the [[Construct]] internal method
- unless otherwise specified in the description of a particular function. When a built-in constructor is called as part of a
- new
expression the argumentsList parameter of the invoked [[Construct]] internal method provides the
- values for the built-in constructor’s named parameters.
-
-
Built-in functions that are not constructors do not have a prototype
property unless otherwise specified in
- the description of a particular function.
-
-
If a built-in function object is not implemented as an ECMAScript function it must provide [[Call]] and [[Construct]]
- internal methods that conform to the following definitions:
-
-
-
-
-
- 9.3.2 [[Construct]] (argumentsList, newTarget)
-
- The [[Construct]] internal method for built-in function object F is called with parameters
- argumentsList and newTarget . The steps performed are the same as [[Call]] (see 9.3.1 ) except that step 9 is replaced by:
-
-
- Let result be the Completion Record that is the result
- of evaluating F in an implementation defined manner that conforms to the specification of F . The
- this value is uninitialized, argumentsList provides the named parameters, and newTarget provides
- the NewTarget value.
-
-
-
-
- 9.3.3
- CreateBuiltinFunction(realm, steps, prototype, internalSlotsList)
-
- The abstract operation CreateBuiltinFunction takes arguments realm ,
- prototype , and steps . The optional argument internalSlotsList is a List of the names of additional internal slots that must be defined as
- part of the object. If the list is not provided, an empty List is
- used. CreateBuiltinFunction returns a built-in function object created by the following steps:
-
-
- Assert : realm is a Realm Record.
- Assert : steps is either a set of algorithm steps or other definition
- of a functions behaviour provided in this specification.
- Let func be a new built-in function object that when called performs the action described by steps . The
- new function object has internal slots whose names are the elements of internalSlotsList . The initial value of
- each of those internal slots is undefined.
- Set the [[Realm]] internal slot of func to
- realm .
- Set the [[Prototype]] internal slot of func to
- prototype .
- Return func .
-
-
- Each built-in function defined in this specification is created as if by calling the CreateBuiltinFunction abstract
- operation, unless otherwise specified.
-
-
-
-
-
-
9.4 Built-in Exotic Object Internal Methods and Slots
-
-
This specification defines several kinds of built-in exotic objects. These objects generally behave similar to ordinary
- objects except for a few specific situations. The following exotic objects use the ordinary object internal methods except
- where it is explicitly specified otherwise below:
-
-
-
-
-
9.4.1 Bound Function Exotic Objects
-
-
A bound function is an exotic object that wraps another function object. A bound function is callable (it has a
- [[Call]] internal method and may have a [[Construct]] internal method). Calling a bound function generally results in a
- call of its wrapped function.
-
-
Bound function objects do not have the internal slots of ECMAScript function objects defined in Table 27 . Instead they have the internal slots defined in Table 28 .
-
-
- Table 28 — Internal Slots of Exotic Bound Function Objects
-
-
- Internal Slot
- Type
- Description
-
-
- [[BoundTargetFunction]]
- Callable Object
- The wrapped function object.
-
-
- [[BoundThis]]
- Any
- The value that is always passed as the this value when calling the wrapped function.
-
-
- [[BoundArguments]]
- List of Any
- A list of values whose elements are used as the first arguments to any call to the wrapped function.
-
-
-
-
-
Unlike ECMAScript function objects, bound function objects do not use an alternative definition of the
- [[GetOwnProperty]] internal methods. Bound function objects provide all of the essential internal methods as specified in
- 9.1 . However, they use the following definitions
- for the essential internal methods of function objects.
-
-
-
-
-
- 9.4.1.2 [[Construct]] (argumentsList, newTarget)
-
- When the [[Construct]] internal method of an exotic bound function
- object, F that was created using the bind function is called with a list of arguments argumentsList and newTarget , the following steps are taken:
-
-
- Let target be the value of F’s [[BoundTargetFunction]] internal slot .
- Assert : target has a [[Construct]] internal method.
- Let boundArgs be the value of F’s [[BoundArguments]] internal slot .
- Let args be a new list containing the same values as the list boundArgs in the same order followed by
- the same values as the list argumentsList in the same order.
- If SameValue (F , newTarget ) is true , let newTarget be
- target .
- Return Construct (target , args , newTarget ).
-
-
-
-
- 9.4.1.3 BoundFunctionCreate (targetFunction, boundThis, boundArgs)
-
- The abstract operation BoundFunctionCreate with arguments targetFunction , boundThis and
- boundArgs is used to specify the creation of new Bound
- Function exotic objects. It performs the following steps:
-
-
- Assert : Type (targetFunction ) is Object.
- Let proto be targetFunction .[[GetPrototypeOf]]().
- ReturnIfAbrupt (proto ).
- Let obj be a newly created object.
- Set obj ’s essential internal methods to the default ordinary object definitions specified in 9.1 .
- Set the [[Call]] internal method of obj as described in 9.4.1.1 .
- If targetFunction has a [[Construct]] internal method, then
-
- Set the [[Construct]] internal method of obj as described in 9.4.1.2 .
-
-
- Set the [[Prototype]] internal slot of obj to
- proto .
- Set the [[Extensible]] internal slot of obj to
- true .
- Set the [[BoundTargetFunction]] internal slot of obj to
- targetFunction .
- Set the [[BoundThis]] internal slot of obj to the value of
- boundThis .
- Set the [[BoundArguments]] internal slot of obj to boundArgs .
- Return obj .
-
-
-
-
-
-
-
9.4.2
- Array Exotic Objects
-
-
An Array object is an exotic object that gives special treatment to array index property keys (see 6.1.7 ). A property whose property name is an array index is also called an element .
- Every Array object has a length
property whose value is always a nonnegative integer less than 232 . The value of the length
property is numerically
- greater than the name of every own property whose name is an array index; whenever an own property of an Array object is
- created or changed, other properties are adjusted as necessary to maintain this invariant. Specifically, whenever an own
- property is added whose name is an array index, the value of the length
property is changed, if necessary, to
- be one more than the numeric value of that array index; and whenever the value of the length
property is
- changed, every own property whose name is an array index whose value is not smaller than the new length is deleted. This
- constraint applies only to own properties of an Array object and is unaffected by length
or array index
- properties that may be inherited from its prototypes.
-
-
-
NOTE A String property name P is an array index if and only if ToString (ToUint32 (P )) is equal to P and ToUint32 (P ) is not equal to 232 −1.
-
-
-
Array exotic objects always have a non-configurable property named "length"
.
-
-
Array exotic objects provide an alternative definition for the [[DefineOwnProperty]] internal method. Except for that
- internal method, Array exotic objects provide all of the other essential internal methods as specified in 9.1 .
-
-
-
- 9.4.2.1 [[DefineOwnProperty]] ( P, Desc)
-
- When the [[DefineOwnProperty]] internal method of an Array exotic object
- A is called with property key P , and Property Descriptor Desc the following
- steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- If P is "length"
, then
-
- Return ArraySetLength (A , Desc ).
-
-
- Else if P is an array index, then
-
- Let oldLenDesc be OrdinaryGetOwnProperty (A ,
- "length"
).
- Assert : oldLenDesc will never be undefined or an accessor
- descriptor because Array objects are created with a length data property that cannot be deleted or
- reconfigured.
- Let oldLen be oldLenDesc .[[Value]].
- Let index be ToUint32 (P ).
- Assert : index will never be an abrupt completion .
- If index ≥ oldLen and oldLenDesc .[[Writable]] is false , return false .
- Let succeeded be OrdinaryDefineOwnProperty (A ,
- P , Desc ).
- Assert : succeeded is not an abrupt completion .
- If succeeded is false , return false .
- If index ≥ oldLen
-
- Set oldLenDesc .[[Value]] to index + 1.
- Let succeeded be OrdinaryDefineOwnProperty (A ,
- "length"
, oldLenDesc ).
- Assert : succeeded is true .
-
-
- Return true .
-
-
- Return OrdinaryDefineOwnProperty (A , P , Desc ).
-
-
-
-
- 9.4.2.2
- ArrayCreate(length, proto)
-
- The abstract operation ArrayCreate with argument length (a positive integer) and optional argument
- proto is used to specify the creation of new Array exotic objects. It performs the following steps:
-
-
- Assert : length is an integer Number ≥ 0.
- If length is −0, let length be +0.
- If length >232 -1, throw a RangeError exception.
- If the proto argument was not passed, let proto be the intrinsic object %ArrayPrototype% .
- Let A be a newly created Array exotic object .
- Set A ’s essential internal methods except for [[DefineOwnProperty]] to the default ordinary object
- definitions specified in 9.1 .
- Set the [[DefineOwnProperty]] internal method of A as specified in 9.4.2.1 .
- Set the [[Prototype]] internal slot of A to
- proto .
- Set the [[Extensible]] internal slot of A to
- true .
- Perform OrdinaryDefineOwnProperty (A , "length"
,
- PropertyDescriptor{[[Value]]: length , [[Writable]]: true , [[Enumerable]]: false ,
- [[Configurable]]: false }).
- Assert : the preceding step never produces an abrupt completion .
- Return A .
-
-
-
-
- 9.4.2.3 ArraySpeciesCreate(originalArray, length)
-
- The abstract operation ArraySpeciesCreate with arguments originalArray and length is used to
- specify the creation of a new Array object using a constructor function that is derived from originalArray . It
- performs the following steps:
-
-
- Assert : length is an integer Number ≥ 0.
- If length is −0, let length be +0.
- Let C be undefined .
- Let isArray be IsArray (originalArray ).
- ReturnIfAbrupt (isArray ).
- If isArray is true , then
-
- Let C be Get (originalArray , "constructor"
).
- ReturnIfAbrupt (C ).
- If IsConstructor (C ) is true , then
-
- Let thisRealm be the running execution context ’s Realm .
- Let realmC be GetFunctionRealm (C ).
- ReturnIfAbrupt (realmC ).
- If thisRealm and realmC are not the same Realm Record, then
-
- If SameValue (C , realmC .[[intrinsics]].[[%Array%]]) is
- true , let C be undefined .
-
-
-
-
- If Type (C ) is Object, then
-
- Let C be Get (C , @@species).
- ReturnIfAbrupt (C ).
- If C is null , let C be undefined .
-
-
-
-
- If C is undefined , return ArrayCreate (length ).
- If IsConstructor (C ) is false , throw a TypeError
- exception.
- Return Construct (C , «length »).
-
-
-
-
NOTE If originalArray was created using the standard built-in Array constructor for a
- Realm that is not the Realm of the running execution context , then a new Array is created using the Realm of the running execution context . This maintains
- compatibility with Web browsers that have historically had that behaviour for the Array.prototype methods that now are
- defined using ArraySpeciesCreate.
-
-
-
-
- 9.4.2.4
- ArraySetLength(A, Desc)
-
- When the abstract operation ArraySetLength is called with an Array exotic
- object A , and Property Descriptor Desc the following
- steps are taken:
-
-
- If the [[Value]] field of Desc is absent, then
-
- Return OrdinaryDefineOwnProperty (A , "length"
,
- Desc ).
-
-
- Let newLenDesc be a copy of Desc .
- Let newLen be ToUint32 (Desc .[[Value]]).
- ReturnIfAbrupt (newLen ).
- Let numberLen be ToNumber (Desc .[[Value]]).
- ReturnIfAbrupt (newLen ).
- If newLen ≠ numberLen , throw a RangeError exception.
- Set newLenDesc .[[Value]] to newLen .
- Let oldLenDesc be OrdinaryGetOwnProperty (A ,
- "length"
).
- Assert : oldLenDesc will never be undefined or an accessor
- descriptor because Array objects are created with a length data property that cannot be deleted or
- reconfigured.
- Let oldLen be oldLenDesc .[[Value]].
- If newLen ≥oldLen , then
-
- Return OrdinaryDefineOwnProperty (A , "length"
,
- newLenDesc ).
-
-
- If oldLenDesc .[[Writable]] is false , return false .
- If newLenDesc .[[Writable]] is absent or has the value true , let newWritable be
- true .
- Else,
-
- Need to defer setting the [[Writable]] attribute to false in case any elements cannot be deleted.
- Let newWritable be false .
- Set newLenDesc .[[Writable]] to true .
-
-
- Let succeeded be OrdinaryDefineOwnProperty (A ,
- "length"
, newLenDesc ).
- Assert : succeeded is not an abrupt completion .
- If succeeded is false , return false .
- While newLen < oldLen repeat,
-
- Set oldLen to oldLen – 1.
- Let deleteSucceeded be A .[[Delete]](ToString (oldLen )).
- Assert : deleteSucceeded is not an abrupt completion .
- If deleteSucceeded is false , then
-
- Set newLenDesc .[[Value]] to oldLen + 1.
- If newWritable is false , set newLenDesc .[[Writable]] to false .
- Let succeeded be OrdinaryDefineOwnProperty (A ,
- "length"
, newLenDesc ).
- Assert : succeeded is not an abrupt completion .
- Return false .
-
-
-
-
- If newWritable is false , then
-
- Return OrdinaryDefineOwnProperty (A , "length"
,
- PropertyDescriptor{[[Writable]]: false }). This call will always return true .
-
-
- Return true .
-
-
-
-
NOTE In steps 3 and 4, if Desc .[[Value]] is an object then its valueOf
- method is called twice. This is legacy behaviour that was specified with this effect starting with the 2nd
- Edition of this specification.
-
-
-
-
-
-
-
9.4.3
- String Exotic Objects
-
-
A String object is an exotic object that encapsulates a String value and exposes virtual integer indexed data
- properties corresponding to the individual code unit elements of the string value. Exotic String objects always have a
- data property named "length"
whose value is the number of code unit elements in the encapsulated String
- value. Both the code unit data properties and the "length"
property are non-writable and
- non-configurable.
-
-
Exotic String objects have the same internal slots as ordinary objects. They also have a [[StringData]] internal
- slot.
-
-
Exotic String objects provide alternative definitions for the following internal methods. All of the other exotic
- String object essential internal methods that are not defined below are as specified in 9.1 .
-
-
-
-
-
-
- 9.4.3.1.1 StringGetIndexProperty (S, P)
-
- When the abstract operation StringGetIndexProperty is called with an exotic String object S and with property key P , the following steps are taken:
-
-
- If Type (P ) is not String, return undefined .
- Let index be CanonicalNumericIndexString (P ).
- Assert : index is not an abrupt completion .
- If index is undefined , return undefined .
- If IsInteger (index ) is false , return undefined .
- If index = −0, return undefined .
- Let str be the String value of the [[StringData]] internal slot of S .
- Let len be the number of elements in str .
- If index < 0 or len ≤ index , return undefined .
- Let resultStr be a String value of length 1, containing one code unit from str , specifically the
- code unit at index index .
- Return a PropertyDescriptor{ [[Value]]: resultStr , [[Enumerable]]: true , [[Writable]]: false ,
- [[Configurable]]: false }.
-
-
-
-
-
- 9.4.3.2 [[HasProperty]](P)
-
- When the [[HasProperty]] internal method of an exotic String object S is called with property key P , the following steps are taken:
-
-
- Let elementDesc be StringGetIndexProperty (S , P ).
- If elementDesc is not undefined , return true .
- Return OrdinaryHasProperty (S , P )..
-
-
-
-
- 9.4.3.3 [[OwnPropertyKeys]] ( )
-
- When the [[OwnPropertyKeys]] internal method of a String exotic object
- O is called the following steps are taken:
-
-
- Let keys be a new empty List .
- Let str be the String value of the [[StringData]] internal slot of O .
- Let len be the number of elements in str .
- For each integer i starting with 0 such that i < len , in ascending order,
-
- Add ToString (i ) as the last element of keys
-
-
- For each own property key P of O such that P is an integer index
- and ToInteger (P ) ≥ len , in ascending numeric index order,
-
- Add P as the last element of keys .
-
-
- For each own property key P of O such that Type (P ) is String and P is not an integer index, in
- property creation order,
-
- Add P as the last element of keys .
-
-
- For each own property key P of O such that Type (P ) is Symbol, in property creation order,
-
- Add P as the last element of keys .
-
-
- Return keys .
-
-
-
-
- 9.4.3.4
- StringCreate( value, prototype)
-
- The abstract operation StringCreate with arguments value and prototype is used to specify the
- creation of new exotic String objects. It performs the following steps:
-
-
- ReturnIfAbrupt (prototype ).
- Assert : Type (value ) is String.
- Let S be a newly created String exotic object .
- Set the [[StringData]] internal slot of S to
- value .
- Set S ’s essential internal methods to the default ordinary object definitions specified in 9.1 .
- Set the [[GetOwnProperty]] internal method of S as specified in 9.4.3.1 .
- Set the [[HasProperty]] internal method of S as specified in 9.4.3.2 .
- Set the [[OwnPropertyKeys]] internal method of S as specified in 9.4.3.3 .
- Set the [[Prototype]] internal slot of S to
- prototype .
- Set the [[Extensible]] internal slot of S to
- true .
- Let length be the number of code unit elements in value.
- Let status be DefinePropertyOrThrow (S , "length"
,
- PropertyDescriptor{[[Value]]: length , [[Writable]]: false , [[Enumerable]]: false ,
- [[Configurable]]: false }).
- Assert : status is not an abrupt completion .
- Return S .
-
-
-
-
-
-
-
9.4.4 Arguments Exotic Objects
-
-
Most ECMAScript functions make an arguments objects available to their code. Depending upon the characteristics of the
- function definition, its argument object is either an ordinary object or an arguments exotic object . An arguments
- exotic object is an exotic object whose array index properties map to the formal parameters bindings of an invocation of
- its associated ECMAScript function.
-
-
Arguments exotic objects have the same internal slots as ordinary objects. They also have a [[ParameterMap]] internal
- slot. Ordinary arguments objects also have a [[ParameterMap]] internal slot whose value is always undefined. For ordinary
- argument objects the [[ParameterMap]] internal slot is only used by Object.prototype.toString
(19.1.3.6 ) to identify them as such.
-
-
Arguments exotic objects provide alternative definitions for the following internal methods. All of the other exotic
- arguments object essential internal methods that are not defined below are as specified in 9.1
-
-
-
NOTE 1 For non-strict functions the integer indexed data properties of an arguments object
- whose numeric name values are less than the number of formal parameters of the corresponding function object initially
- share their values with the corresponding argument bindings in the function’s execution context . This means that changing the property changes the corresponding
- value of the argument binding and vice-versa. This correspondence is broken if such a property is deleted and then
- redefined or if the property is changed into an accessor property. For strict mode functions, the values of the
- arguments object’s properties are simply a copy of the arguments passed to the function and there is no dynamic
- linkage between the property values and the formal parameter values.
-
-
-
-
NOTE 2 The ParameterMap object and its property values are used as a device for specifying
- the arguments object correspondence to argument bindings. The ParameterMap object and the objects that are the values of
- its properties are not directly observable from ECMAScript code. An ECMAScript implementation does not need to actually
- create or use such objects to implement the specified semantics.
-
-
-
-
NOTE 3 Arguments objects for strict mode functions define non-configurable accessor
- properties named "caller"
and "callee"
which throw a TypeError exception on access. The
- "callee"
property has a more specific meaning for non-strict functions and a "caller"
property
- has historically been provided as an implementation-defined extension by some ECMAScript implementations. The strict
- mode definition of these properties exists to ensure that neither of them is defined in any other manner by conforming
- ECMAScript implementations.
-
-
-
-
- 9.4.4.1 [[GetOwnProperty]] (P)
-
- The [[GetOwnProperty]] internal method of an arguments exotic object when called with a property key P performs the following steps:
-
-
- Let args be the arguments object.
- Let desc be OrdinaryGetOwnProperty (args , P ).
- If desc is undefined , return desc .
- Let map be the value of the [[ParameterMap]] internal slot of the arguments object.
- Let isMapped be HasOwnProperty (map , P ).
- Assert : isMapped is never an abrupt completion .
- If the value of isMapped is true , then
-
- Set desc .[[Value]] to Get (map , P ).
-
-
- If IsDataDescriptor (desc ) is true and P is
- "caller"
and desc .[[Value]] is a strict mode Function object, throw a TypeError
- exception.
- Return desc .
-
-
- If an implementation does not provide a built-in caller
property for argument exotic objects then step 8
- of this algorithm is must be skipped.
-
-
-
- 9.4.4.2 [[DefineOwnProperty]] (P, Desc)
-
- The [[DefineOwnProperty]] internal method of an arguments exotic object when called with a property key P and Property
- Descriptor Desc performs the following steps:
-
-
- Let args be the arguments object.
- Let map be the value of the [[ParameterMap]] internal slot of the arguments object.
- Let isMapped be HasOwnProperty (map , P ).
- Let allowed be OrdinaryDefineOwnProperty (args , P ,
- Desc ).
- ReturnIfAbrupt (allowed ).
- If allowed is false , return false .
- If the value of isMapped is true , then
-
- If IsAccessorDescriptor (Desc ) is true , then
-
- Call map .[[Delete]](P ).
-
-
- Else
-
- If Desc .[[Value]] is present, then
-
- Let setStatus be Set (map , P ,
- Desc .[[Value]], false ).
- Assert : setStatus is true because formal
- parameters mapped by argument objects are always writable.
-
-
- If Desc .[[Writable]] is present and its value is false , then
-
- Call map .[[Delete]](P ).
-
-
-
-
-
-
- Return true .
-
-
-
-
- 9.4.4.3 [[Get]] (P, Receiver)
-
- The [[Get]] internal method of an arguments exotic object when called with a property
- key P and ECMAScript language value Receiver performs the following steps:
-
-
- Let args be the arguments object.
- Let map be the value of the [[ParameterMap]] internal slot of the arguments object.
- Let isMapped be HasOwnProperty (map , P ).
- Assert : isMapped is not an abrupt completion .
- If the value of isMapped is false , then
-
- Let v be the result of calling the default ordinary object [[Get]] internal method (9.1.8 ) on args passing
- P and Receiver as the arguments.
-
-
- Else map contains a formal parameter mapping for P ,
-
- Let v be Get (map , P ).
-
-
- ReturnIfAbrupt (v ).
- Return v .
-
-
-
-
- 9.4.4.4 [[Set]] ( P, V, Receiver)
-
- The [[Set]] internal method of an arguments exotic object when called with property key
- P , value V , and ECMAScript language value Receiver performs the following steps:
-
-
- Let args be the arguments object.
- If SameValue (args , Receiver ) is false , then
-
- Let isMapped be false .
-
-
- Else,
-
- Let map be the value of the [[ParameterMap]] internal slot of the arguments object.
- Let isMapped be HasOwnProperty (map , P ).
- Assert : isMapped is not an abrupt completion .
-
-
- If the value of isMapped is false , then
-
- Return the result of calling the default ordinary object [[Set]] internal method (9.1.9 ) on args
- passing P , V and Receiver as the arguments.
-
-
- Else map contains a formal parameter mapping for P ,
-
- Return Set (map , P , V , false ).
-
-
-
-
-
-
- 9.4.4.5 [[Delete]] (P)
-
- The [[Delete]] internal method of an arguments exotic object when called with a property
- key P performs the following steps:
-
-
- Let map be the value of the [[ParameterMap]] internal slot of the arguments object.
- Let isMapped be HasOwnProperty (map , P ).
- Assert : isMapped is not an abrupt completion .
- Let result be the result of calling the default [[Delete]] internal method for ordinary objects (9.1.10 ) on the arguments object passing
- P as the argument.
- ReturnIfAbrupt (result ).
- If result is true and the value of isMapped is true , then
-
- Call map .[[Delete]](P ).
-
-
- Return result .
-
-
-
-
- 9.4.4.6 CreateUnmappedArgumentsObject(argumentsList)
-
- The abstract operation CreateUnmappedArgumentsObject called with an
- argument argumentsList performs the following steps:
-
-
- Let len be the number of elements in argumentsList .
- Let obj be ObjectCreate (%ObjectPrototype%,
- «[[ParameterMap]]»).
- Set obj ’s [[ParameterMap]] internal slot
- to undefined .
- Perform DefinePropertyOrThrow (obj , "length"
,
- PropertyDescriptor{[[Value]]: len , [[Writable]]: true , [[Enumerable]]: false , [[Configurable]]:
- true }).
- Let index be 0.
- Repeat while index < len ,
-
- Let val be argumentsList [index ].
- Perform CreateDataProperty (obj , ToString (index ), val ).
- Let index be index + 1
-
-
- Perform DefinePropertyOrThrow (obj , @@iterator, PropertyDescriptor
- {[[Value]]:%ArrayProto_values%, [[Writable]]: true , [[Enumerable]]: false , [[Configurable]]:
- true }).
- Perform DefinePropertyOrThrow (obj , "caller"
,
- PropertyDescriptor {[[Get]]: %ThrowTypeError% , [[Set]]: %ThrowTypeError% , [[Enumerable]]: false , [[Configurable]]:
- false }).
- Perform DefinePropertyOrThrow (obj , "callee"
,
- PropertyDescriptor {[[Get]]: %ThrowTypeError% , [[Set]]: %ThrowTypeError% , [[Enumerable]]: false , [[Configurable]]:
- false }).
- Assert : the above property definitions will not produce an abrupt completion .
- Return obj
-
-
-
-
-
-
9.4.4.7 CreateMappedArgumentsObject ( func, formals, argumentsList, env
- )
-
-
The abstract operation CreateMappedArgumentsObject is called with
- object func , parsed grammar phrase formals , List argumentsList , and Environment Record env . The
- following steps are performed:
-
-
- Assert : formals does not contain a rest parameter, any binding
- patterns, or any initializers. It may contain duplicate identifiers.
- Let len be the number of elements in argumentsList .
- Let obj be a newly created arguments exotic object with a [[ParameterMap]] internal slot .
- Set the [[GetOwnProperty]] internal method of obj as specified in 9.4.4.1 .
- Set the [[DefineOwnProperty]] internal method of obj as specified in 9.4.4.2 .
- Set the [[Get]] internal method of obj as specified in 9.4.4.3 .
- Set the [[Set]] internal method of obj as specified in 9.4.4.4 .
- Set the [[Delete]] internal method of obj as specified in 9.4.4.5 .
- Set the remainder of obj ’s essential internal methods to the default ordinary object definitions
- specified in 9.1 .
- Set the [[Prototype]] internal slot of obj to
- %ObjectPrototype%.
- Set the [[Extensible]] internal slot of obj
- to true .
- Let parameterNames be the BoundNames of formals .
- Let numberOfParameters be the number of elements in parameterNames
- Let index be 0.
- Repeat while index < len ,
-
- Let val be argumentsList [index ].
- Perform CreateDataProperty (obj , ToString (index ), val ).
- Let index be index + 1
-
-
- Perform DefinePropertyOrThrow (obj , "length"
,
- PropertyDescriptor{[[Value]]: len , [[Writable]]: true , [[Enumerable]]: false ,
- [[Configurable]]: true }).
- Let map be ObjectCreate (null ).
- Let mappedNames be an empty List .
- Let index be numberOfParameters − 1.
- Repeat while index ≥ 0 ,
-
- Let name be parameterNames [index ].
- If name is not an element of mappedNames , then
-
- Add name as an element of the list mappedNames .
- If index < len , then
-
- Let g be MakeArgGetter (name , env ).
- Let p be MakeArgSetter (name , env ).
- Call map .[[DefineOwnProperty]](ToString (index ), PropertyDescriptor{[[Set]]: p , [[Get]]:
- g, [[Enumerable]]: false , [[Configurable]]: true }).
-
-
-
-
- Let index be index − 1
-
-
- Set the [[ParameterMap]] internal slot of obj
- to map .
- Perform DefinePropertyOrThrow (obj , @@iterator, PropertyDescriptor
- {[[Value]]:%ArrayProto_values%, [[Writable]]: true , [[Enumerable]]: false , [[Configurable]]:
- true }).
- Perform DefinePropertyOrThrow (obj , "callee"
,
- PropertyDescriptor {[[Value]]: func , [[Writable]]: true , [[Enumerable]]: false ,
- [[Configurable]]: true }).
- Assert : the above property definitions will not produce an abrupt completion .
- Return obj
-
-
-
-
- 9.4.4.7.1 MakeArgGetter ( name, env)
-
- The abstract operation MakeArgGetter called with String
- name and Environment Record env creates a built-in function
- object that when executed returns the value bound for name in env . It performs the following
- steps:
-
-
- Let realm be the current Realm .
- Let steps be the steps of an ArgGetter function as specified below.
- Let getter be CreateBuiltinFunction (realm , steps ,
- %FunctionPrototype%, «[[name]], [[env]]» ).
- Set getter’s [[name]] internal slot to
- name .
- Set getter’s [[env]] internal slot to
- env .
- Return getter .
-
-
- An ArgGetter function is an anonymous built-in function with [[name]] and [[env]] internal slots. When an ArgGetter
- function f that expects no arguments is called it performs the following steps:
-
-
- Let name be the value of f’s [[name]] internal slot .
- Let env be the value of f’s [[env]] internal slot
- Return env .GetBindingValue(name , false ).
-
-
-
-
NOTE ArgGetter functions are never directly accessible to ECMAScript code.
-
-
-
-
- 9.4.4.7.2 MakeArgSetter ( name, env)
-
- The abstract operation MakeArgSetter called with String
- name and Environment Record env creates a built-in function
- object that when executed sets the value bound for name in env . It performs the following
- steps:
-
-
- Let realm be the current Realm .
- Let steps be the steps of an ArgSetter function as specified below.
- Let setter be CreateBuiltinFunction (realm , steps ,
- %FunctionPrototype%, «[[name]], [[env]]» ).
- Set setter’s [[name]] internal slot to
- name .
- Set setter’s [[env]] internal slot to
- env .
- Return setter .
-
-
- An ArgSetter function is an anonymous built-in function with [[name]] and [[env]] internal slots. When an ArgSetter
- function f is called with argument value it performs the following steps:
-
-
- Let name be the value of f’s [[name]] internal slot .
- Let env be the value of f’s [[env]] internal slot
- Return env .SetMutableBinding(name , value , false ).
-
-
-
-
NOTE ArgSetter functions are never directly accessible to ECMAScript code.
-
-
-
-
-
-
-
-
9.4.5 Integer Indexed Exotic Objects
-
-
An Integer Indexed object is an exotic object that performs special handling of integer index property keys.
-
-
Integer Indexed exotic objects have the same internal slots as ordinary objects additionally [[ViewedArrayBuffer]],
- [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.
-
-
Integer Indexed Exotic objects provide alternative definitions for the following internal methods. All of the other
- Integer Indexed exotic object essential internal methods that are not defined below are as specified in 9.1 .
-
-
-
-
-
-
-
- 9.4.5.3 [[DefineOwnProperty]] ( P, Desc)
-
- When the [[DefineOwnProperty]] internal method of an Integer Indexed exotic object O is called with property key P , and Property
- Descriptor Desc the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Assert : O is an Object that has a [[ViewedArrayBuffer]] internal slot .
- If Type (P ) is String, then
-
- Let numericIndex be CanonicalNumericIndexString
- (P ).
- Assert : numericIndex is not an abrupt completion .
- If numericIndex is not undefined , then
-
- If IsInteger (numericIndex ) is false , return false
- Let intIndex be numericIndex .
- If intIndex = −0, return false .
- If intIndex < 0, return false .
- Let length be the value of O ’s [[ArrayLength]] internal slot .
- If intIndex ≥ length , return false .
- If IsAccessorDescriptor (Desc ) is true , return
- false.
- If Desc has a [[Configurable]] field and if Desc .[[Configurable]] is true , return
- false.
- If Desc has an [[Enumerable]] field and if Desc .[[Enumerable]] is false , return
- false.
- If Desc has a [[Writable]] field and if Desc .[[Writable]] is false , return
- false .
- If Desc has a [[Value]] field, then
-
- Let value be Desc .[[Value]].
- Return IntegerIndexedElementSet (O , intIndex ,
- value ).
-
-
- Return true .
-
-
-
-
- Return OrdinaryDefineOwnProperty (O , P , Desc ).
-
-
-
-
-
-
- 9.4.5.5 [[Set]] ( P, V, Receiver)
-
- When the [[Set]] internal method of an Integer Indexed exotic object O is called with property key P , value V , and ECMAScript language value Receiver , the following steps
- are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- If Type (P ) is String and if SameValue (O , Receiver ) is true , then
-
- Let numericIndex be CanonicalNumericIndexString
- (P ).
- Assert : numericIndex is not an abrupt completion .
- If numericIndex is not undefined , then
-
- Return IntegerIndexedElementSet (O , numericIndex ,
- V ).
-
-
-
-
- Return the result of calling the default ordinary object [[Set]] internal method (9.1.8 ) on O passing
- P , V , and Receiver as arguments.
-
-
-
-
- 9.4.5.6 [[OwnPropertyKeys]] ()
-
- When the [[OwnPropertyKeys]] internal method of an Integer Indexed exotic object O is called the following
- steps are taken:
-
-
- Let keys be a new empty List .
- Assert : O is an Object that has [[ViewedArrayBuffer]],
- [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.
- Let len be the value of O ’s [[ArrayLength]] internal slot .
- For each integer i starting with 0 such that i < len , in ascending order,
-
- Add ToString (i ) as the last element of keys .
-
-
- For each own property key P of O such that Type (P ) is String and P is not an integer index, in
- property creation order
-
- Add P as the last element of keys .
-
-
- For each own property key P of O such that Type (P ) is Symbol, in property creation order
-
- Add P as the last element of keys .
-
-
- Return keys .
-
-
-
-
- 9.4.5.7 IntegerIndexedObjectCreate (prototype, internalSlotsList)
-
- The abstract operation IntegerIndexedObjectCreate with arguments prototype and internalSlotsList
- is used to specify the creation of new Integer Indexed exotic objects. The argument internalSlotsList is a List of the names of additional internal slots that must be defined as
- part of the object. IntegerIndexedObjectCreate performs the following steps:
-
-
- Let A be a newly created object with an internal
- slot for each name in internalSlotsList .
- Set A ’s essential internal methods to the default ordinary object definitions specified in 9.1 .
- Set the [[GetOwnProperty]] internal method of A as specified in 9.4.5.1 .
- Set the [[HasProperty]] internal method of A as specified in 9.4.5.2 .
- Set the [[DefineOwnProperty]] internal method of A as specified in 9.4.5.3 .
- Set the [[Get]] internal method of A as specified in 9.4.5.4 .
- Set the [[Set]] internal method of A as specified in 9.4.5.5 .
- Set the [[OwnPropertyKeys]] internal method of A as specified in 9.4.5.6 .
- Set the [[Prototype]] internal slot of A to
- prototype .
- Set the [[Extensible]] internal slot of A to
- true .
- Return A .
-
-
-
-
- 9.4.5.8 IntegerIndexedElementGet ( O, index )
-
- The abstract operation IntegerIndexedElementGet with arguments O and index performs the following
- steps:
-
-
- Assert : Type (index ) is Number.
- Assert : O is an Object that has [[ViewedArrayBuffer]],
- [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.
- Let buffer be the value of O ’s [[ViewedArrayBuffer]] internal slot .
- If IsDetachedBuffer (buffer ) is true , throw a TypeError
- exception.
- If IsInteger (index ) is false , return undefined
- If index = −0, return undefined .
- Let length be the value of O ’s [[ArrayLength]] internal slot .
- If index < 0 or index ≥ length , return undefined .
- Let offset be the value of O ’s [[ByteOffset]] internal slot .
- Let arrayTypeName be the string value of O ’s [[TypedArrayName]] internal slot .
- Let elementSize be the Number value of the Element Size value specified in Table 49
- for arrayTypeName .
- Let indexedPosition = (index × elementSize ) + offset .
- Let elementType be the string value of the Element Type value in Table 49 for
- arrayTypeName .
- Return GetValueFromBuffer (buffer , indexedPosition ,
- elementType ).
-
-
-
-
- 9.4.5.9 IntegerIndexedElementSet ( O, index, value )
-
- The abstract operation IntegerIndexedElementSet with arguments O , index , and value
- performs the following steps:
-
-
- Assert : Type (index ) is Number.
- Assert : O is an Object that has [[ViewedArrayBuffer]],
- [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.
- Let numValue be ToNumber (value ).
- ReturnIfAbrupt (numValue ).
- Let buffer be the value of O ’s [[ViewedArrayBuffer]] internal slot .
- If IsDetachedBuffer (buffer ) is true , throw a TypeError
- exception.
- If IsInteger (index ) is false , return false
- If index = −0, return false .
- Let length be the value of O ’s [[ArrayLength]] internal slot .
- If index < 0 or index ≥ length , return false .
- Let offset be the value of O ’s [[ByteOffset]] internal slot .
- Let arrayTypeName be the string value of O ’s [[TypedArrayName]] internal slot .
- Let elementSize be the Number value of the Element Size value specified in Table 49
- for arrayTypeName .
- Let indexedPosition = (index × elementSize ) + offset .
- Let elementType be the string value of the Element Type value in Table 49 for
- arrayTypeName .
- Let status be SetValueInBuffer (buffer , indexedPosition ,
- elementType , numValue ).
- ReturnIfAbrupt (status ).
- Return true .
-
-
-
-
-
-
-
9.4.6 Module Namespace Exotic Objects
-
-
A module namespace object is an exotic object that exposes the bindings exported from an ECMAScript Module (See 15.2.3 ) . There is a one-to-one correspondence between
- the String-keyed own properties of a module namespace exotic object and the binding names exported by the Module . The exported bindings include any bindings that are indirectly exported using export
- *
export items. Each String-valued own property key is the StringValue of the
- corresponding exported binding name. These are the only String-keyed properties of a module namespace exotic object. Each
- such property has the attributes {[[Configurable]]: false , [[Enumerable]]: true }. Module namespace objects are not extensible.
-
-
Module namespace objects have the internal slots defined in Table 29 .
-
-
- Table 29 — Internal Slots of Module Namespace Exotic Objects
-
-
- Internal Slot
- Type
- Description
-
-
- [[Module]]
- Module Record
- The Module Record whose exports this namespace exposes.
-
-
- [[Exports]]
- List of String
- A List containing the String values of the exported names exposed as own properties of this object. The list is ordered as if an Array of those string values had been sorted using Array.prototype.sort
using SortCompare as comparefn .
-
-
-
-
-
Module namespace exotic objects provide alternative definitions for all of the internal methods.
-
-
-
- 9.4.6.1 [[GetPrototypeOf]] ( )
-
- When the [[GetPrototypeOf]] internal method of a module namespace exotic object O is called the following
- steps are taken:
-
-
- Return null .
-
-
-
-
- 9.4.6.2 [[SetPrototypeOf]] (V)
-
- When the [[SetPrototypeOf]] internal method of a module namespace exotic object O is called with argument
- V the following steps are taken:
-
-
- Assert : Either Type (V ) is Object or Type (V ) is Null.
- Return false .
-
-
-
-
- 9.4.6.3 [[IsExtensible]] ( )
-
- When the [[IsExtensible]] internal method of a module namespace exotic object O is called the following
- steps are taken:
-
-
- Return false .
-
-
-
-
- 9.4.6.4 [[PreventExtensions]] ( )
-
- When the [[PreventExtensions]] internal method of a module namespace exotic object O is called the following
- steps are taken:
-
-
- Return true .
-
-
-
-
- 9.4.6.5 [[GetOwnProperty]] (P)
-
- When the [[GetOwnProperty]] internal method of a module namespace exotic object O is called with property key P , the following steps are taken:
-
-
- If Type (P ) is Symbol, return OrdinaryGetOwnProperty (O , P ).
- Throw a TypeError exception.
-
-
-
-
- 9.4.6.6 [[DefineOwnProperty]] (P, Desc)
-
- When the [[DefineOwnProperty]] internal method of a module namespace exotic object O is called with property key P and Property
- Descriptor Desc , the following steps are taken:
-
-
- Return false .
-
-
-
-
- 9.4.6.7 [[HasProperty]] (P)
-
- When the [[HasProperty]] internal method of a module namespace exotic object O is called with property key P , the following steps are taken:
-
-
- If Type (P ) is Symbol, return OrdinaryHasProperty (O , P ).
- Let exports be the value of O ’s [[Exports]] internal slot .
- If P is an element of exports , return true .
- Return false .
-
-
-
-
- 9.4.6.8 [[Get]] (P, Receiver)
-
- When the [[Get]] internal method of a module namespace exotic object O is called with property key P and ECMAScript language
- value Receiver the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- If Type (P ) is Symbol, then
-
- Return the result of calling the default ordinary object [[Get]] internal method (9.1.8 ) on O passing
- P and Receiver as arguments.
-
-
- Let exports be the value of O ’s [[Exports]] internal slot .
- If P is not an element of exports , return undefined .
- Let m be the value of O ’s [[Module]] internal slot .
- Let binding be m .ResolveExport (P , «»,
- «»).
- ReturnIfAbrupt (binding ).
- Assert : binding is neither null nor
- "ambiguous"
.
- Let targetModule be binding .[[module]],
- Assert : targetModule is not undefined .
- Let targetEnv be targetModule .[[Environment]].
- If targetEnv is undefined , throw a ReferenceError exception.
- Let targetEnvRec be targetEnv ’s EnvironmentRecord.
- Return targetEnvRec .GetBindingValue(binding. [[bindingName]], true ).
-
-
-
-
NOTE ResolveExport is idempotent and side-effect free. An
- implementation might choose to pre-compute or cache the ResolveExport results for the
- [[Exports]] of each module namespace exotic object.
-
-
-
-
- 9.4.6.9 [[Set]] ( P, V, Receiver)
-
- When the [[Set]] internal method of a module namespace exotic object
- O is called with property key P , value V , and ECMAScript language value Receiver , the following steps
- are taken:
-
-
- Return false .
-
-
-
-
-
-
- When the [[Delete]] internal method of a module namespace exotic object O is called with property key P the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let exports be the value of O ’s [[Exports]] internal slot .
- If P is an element of exports , return false .
- Return true .
-
-
-
-
- 9.4.6.11 [[Enumerate]] ()
-
- When the [[Enumerate]] internal method of a module namespace exotic object O is called the following steps
- are taken:
-
-
- Let exports be the value of O ’s [[Exports]] internal slot .
- Return CreateListIterator (exports ).
-
-
-
-
- 9.4.6.12 [[OwnPropertyKeys]] ( )
-
- When the [[OwnPropertyKeys]] internal method of a module namespace exotic object O is called the following
- steps are taken:
-
-
- Let exports be a copy of the value of O ’s [[Exports]] internal slot .
- Let symbolKeys be the result of calling the default ordinary object [[OwnPropertyKeys]] internal method (9.1.12 ) on O passing no
- arguments.
- Append all the entries of symbolKeys to the end of exports .
- Return exports .
-
-
-
-
- 9.4.6.13 ModuleNamespaceCreate (module, exports)
-
- The abstract operation ModuleNamespaceCreate with arguments module , and exports is used to
- specify the creation of new module namespace exotic objects. It performs the following steps:
-
-
- Assert : module is a Module Record (see 15.2.1.14 ).
- Assert : module .[[Namespace]] is undefined .
- Assert : exports is a List of string values.
- Let M be a newly created object.
- Set M ’s essential internal methods to the definitions specified in 9.4.6 .
- Set M ’s [[Module]] internal slot to
- module .
- Set M ’s [[Exports]] internal slot to
- exports .
- Create own properties of M corresponding to the definitions in 26.3 .
- Set module .[[Namespace]] to M .
- Return M .
-
-
-
-
-
-
-
-
9.5 Proxy Object Internal Methods and Internal Slots
-
-
A proxy object is an exotic object whose essential internal methods are partially implemented using ECMAScript code.
- Every proxy objects has an internal slot called
- [[ProxyHandler]]. The value of [[ProxyHandler]] is an object, called the proxy’s handler object , or null . Methods (see Table 30 ) of a handler object may be used to augment the
- implementation for one or more of the proxy object’s internal methods. Every proxy object also has an internal slot called [[ProxyTarget]] whose value is either an
- object or the null value. This object is called the proxy’s target object .
-
-
- Table 30 — Proxy Handler Methods
-
-
- Internal Method
- Handler Method
-
-
- [[GetPrototypeOf]]
- getPrototypeOf
-
-
- [[SetPrototypeOf]]
- setPrototypeOf
-
-
- [[IsExtensible]]
- isExtensible
-
-
- [[PreventExtensions]]
- preventExtensions
-
-
- [[GetOwnProperty]]
- getOwnPropertyDescriptor
-
-
- [[HasProperty]]
- has
-
-
- [[Get]]
- get
-
-
- [[Set]]
- set
-
-
- [[Delete]]
- deleteProperty
-
-
- [[DefineOwnProperty]]
- defineProperty
-
-
- [[Enumerate]]
- enumerate
-
-
- [[OwnPropertyKeys]]
- ownKeys
-
-
- [[Call]]
- apply
-
-
- [[Construct]]
- construct
-
-
-
-
-
When a handler method is called to provide the implementation of a proxy object internal method, the handler method is
- passed the proxy’s target object as a parameter. A proxy’s handler object does not necessarily have a method
- corresponding to every essential internal method. Invoking an internal method on the proxy results in the invocation of the
- corresponding internal method on the proxy’s target object if the handler object does not have a method corresponding
- to the internal trap.
-
-
The [[ProxyHandler]] and [[ProxyTarget]] internal slots of a proxy object are always initialized when the object is
- created and typically may not be modified. Some proxy objects are created in a manner that permits them to be subsequently
- revoked . When a proxy is revoked, its [[ProxyHander]] and [[ProxyTarget]] internal slots are set to null
- causing subsequent invocations of internal methods on that proxy object to throw a TypeError
- exception.
-
-
Because proxy objects permit the implementation of internal methods to be provided by arbitrary ECMAScript code, it is
- possible to define a proxy object whose handler methods violates the invariants defined in 6.1.7.3 . Some of the internal method invariants defined in 6.1.7.3 are essential integrity invariants. These invariants
- are explicitly enforced by the proxy object internal methods specified in this section. An ECMAScript implementation must be
- robust in the presence of all possible invariant violations.
-
-
In the following algorithm descriptions, assume O is an ECMAScript proxy object, P is a property key value , V is any ECMAScript
- language value and Desc is a Property Descriptor record.
-
-
-
- 9.5.1 [[GetPrototypeOf]] ( )
-
- When the [[GetPrototypeOf]] internal method of a Proxy exotic object O is called the following steps are
- taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "getPrototypeOf"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[GetPrototypeOf]]().
-
-
- Let handlerProto be Call (trap , handler ,
- «target »).
- ReturnIfAbrupt (handlerProto ).
- If Type (handlerProto ) is neither Object nor Null, throw a
- TypeError exception.
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- If extensibleTarget is true , return handlerProto .
- Let targetProto be target .[[GetPrototypeOf]]().
- ReturnIfAbrupt (targetProto ).
- If SameValue (handlerProto , targetProto ) is false , throw a
- TypeError exception.
- Return handlerProto .
-
-
-
-
NOTE [[GetPrototypeOf]] for proxy objects enforces the following invariant:
-
-
-
- The result of [[GetPrototypeOf]] must be either an Object or null .
-
-
-
- If the target object is not extensible, [[GetPrototypeOf]] applied to the proxy object must return the same value
- as [[GetPrototypeOf]] applied to the proxy object’s target object.
-
-
-
-
-
-
- 9.5.2 [[SetPrototypeOf]] (V)
-
- When the [[SetPrototypeOf]] internal method of a Proxy exotic object O is called with argument V
- the following steps are taken:
-
-
- Assert : Either Type (V ) is Object or Type (V ) is Null.
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "setPrototypeOf"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[SetPrototypeOf]](V ).
-
-
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target , V »)).
- ReturnIfAbrupt (booleanTrapResult ).
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- If extensibleTarget is true , return booleanTrapResult .
- Let targetProto be target .[[GetPrototypeOf]]().
- ReturnIfAbrupt (targetProto ).
- If booleanTrapResult is true and SameValue (V , targetProto ) is
- false , throw a TypeError exception.
- Return booleanTrapResult .
-
-
-
-
NOTE [[SetPrototypeOf]] for proxy objects enforces the following invariant:
-
-
-
- The result of [[SetPrototypeOf]] is a Boolean value.
-
-
-
- If the target object is not extensible, the argument value must be the same as the result of [[GetPrototypeOf]]
- applied to target object.
-
-
-
-
-
-
- 9.5.3 [[IsExtensible]] ( )
-
- When the [[IsExtensible]] internal method of a Proxy exotic object O is called the following steps are
- taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "isExtensible"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[IsExtensible]]().
-
-
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target »)).
- ReturnIfAbrupt (booleanTrapResult ).
- Let targetResult be target .[[IsExtensible]]().
- ReturnIfAbrupt (targetResult ).
- If SameValue (booleanTrapResult , targetResult ) is false , throw a
- TypeError exception.
- Return booleanTrapResult .
-
-
-
-
NOTE [[IsExtensible]] for proxy objects enforces the following invariant:
-
-
-
- The result of [[IsExtensible]] is a Boolean value.
-
-
-
- [[IsExtensible]] applied to the proxy object must return the same value as [[IsExtensible]] applied to the proxy
- object’s target object with the same argument.
-
-
-
-
-
-
- 9.5.4 [[PreventExtensions]] ( )
-
- When the [[PreventExtensions]] internal method of a Proxy exotic object O is called the following steps are
- taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "preventExtensions"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[PreventExtensions]]().
-
-
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target »)).
- ReturnIfAbrupt (booleanTrapResult ).
- If booleanTrapResult is true , then
-
- Let targetIsExtensible be target .[[IsExtensible]]().
- ReturnIfAbrupt (targetIsExtensible ).
- If targetIsExtensible is true , throw a TypeError exception.
-
-
- Return booleanTrapResult .
-
-
-
-
NOTE [[PreventExtensions]] for proxy objects enforces the following invariant:
-
-
-
-
-
-
- 9.5.5 [[GetOwnProperty]] (P)
-
- When the [[GetOwnProperty]] internal method of a Proxy exotic object O is called with property key P , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler ,
- "getOwnPropertyDescriptor"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[GetOwnProperty]](P ).
-
-
- Let trapResultObj be Call (trap , handler , «target ,
- P »).
- ReturnIfAbrupt (trapResultObj ).
- If Type (trapResultObj ) is neither Object nor Undefined,
- throw a TypeError exception.
- Let targetDesc be target .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (targetDesc ).
- If trapResultObj is undefined , then
-
- If targetDesc is undefined , return undefined .
- If targetDesc .[[Configurable]] is false , throw a TypeError exception.
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- If ToBoolean (extensibleTarget ) is false , throw a TypeError
- exception.
- Return undefined .
-
-
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- Let resultDesc be ToPropertyDescriptor (trapResultObj ).
- ReturnIfAbrupt (resultDesc ).
- Call CompletePropertyDescriptor (resultDesc ).
- Let valid be IsCompatiblePropertyDescriptor
- (extensibleTarget , resultDesc , targetDesc ).
- If valid is false , throw a TypeError exception.
- If resultDesc .[[Configurable]] is false , then
-
- If targetDesc is undefined or targetDesc .[[Configurable]] is true , then
-
- Throw a TypeError exception.
-
-
-
-
- Return resultDesc .
-
-
-
-
NOTE [[GetOwnProperty]] for proxy objects enforces the following invariants:
-
-
-
- The result of [[GetOwnProperty]] must be either an Object or undefined .
-
-
-
- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target
- object.
-
-
-
- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target
- object is not extensible.
-
-
-
- A property cannot be reported as existent, if it does not exists as an own property of the target object and the
- target object is not extensible.
-
-
-
- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or
- if it exists as a configurable own property of the target object.
-
-
-
-
-
-
- 9.5.6 [[DefineOwnProperty]] (P, Desc)
-
- When the [[DefineOwnProperty]] internal method of a Proxy exotic object O is called with property key P and Property
- Descriptor Desc , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "defineProperty"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[DefineOwnProperty]](P , Desc ).
-
-
- Let descObj be FromPropertyDescriptor (Desc ).
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target , P , descObj »)).
- ReturnIfAbrupt (booleanTrapResult ).
- If booleanTrapResult is false , return false .
- Let targetDesc be target .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (targetDesc ).
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- If Desc has a [[Configurable]] field and if Desc .[[Configurable]] is false, then
-
- Let settingConfigFalse be true .
-
-
- Else let settingConfigFalse be false .
- If targetDesc is undefined , then
-
- If extensibleTarget is false , throw a TypeError exception.
- If settingConfigFalse is true , throw a TypeError exception.
-
-
- Else targetDesc is not undefined,
-
- If IsCompatiblePropertyDescriptor (extensibleTarget ,
- Desc , targetDesc ) is false , throw a TypeError exception.
- If settingConfigFalse is true and targetDesc .[[Configurable]] is true , throw a
- TypeError exception.
-
-
- Return true .
-
-
-
-
NOTE [[DefineOwnProperty]] for proxy objects enforces the following invariants:
-
-
-
- The result of [[DefineOwnProperty]] is a Boolean value.
-
-
-
- A property cannot be added, if the target object is not extensible.
-
-
-
- A property cannot be non-configurable, unless there exists a corresponding non-configurable own property of the
- target object.
-
-
-
- If a property has a corresponding target object property then applying the Property Descriptor of the property to the target object using
- [[DefineOwnProperty]] will not throw an exception.
-
-
-
-
-
-
- 9.5.7 [[HasProperty]] (P)
-
- When the [[HasProperty]] internal method of a Proxy exotic object O is called with property key P , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "has"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[HasProperty]](P ).
-
-
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target , P »)).
- ReturnIfAbrupt (booleanTrapResult ).
- If booleanTrapResult is false , then
-
- Let targetDesc be target .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (targetDesc ).
- If targetDesc is not undefined , then
-
- If targetDesc .[[Configurable]] is false , throw a TypeError exception.
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- If extensibleTarget is false , throw a TypeError exception.
-
-
-
-
- Return booleanTrapResult .
-
-
-
-
NOTE [[HasProperty]] for proxy objects enforces the following invariants:
-
-
-
- The result of [[HasProperty]] is a Boolean value.
-
-
-
- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target
- object.
-
-
-
- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target
- object is not extensible.
-
-
-
-
-
-
- 9.5.8 [[Get]] (P, Receiver)
-
- When the [[Get]] internal method of a Proxy exotic object O is called with property
- key P and ECMAScript language value Receiver the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "get"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[Get]](P , Receiver ).
-
-
- Let trapResult be Call (trap , handler , «target , P ,
- Receiver »).
- ReturnIfAbrupt (trapResult ).
- Let targetDesc be target .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (targetDesc ).
- If targetDesc is not undefined , then
-
- If IsDataDescriptor (targetDesc ) and targetDesc .[[Configurable]]
- is false and targetDesc .[[Writable]] is false , then
-
- If SameValue (trapResult , targetDesc .[[Value]]) is false ,
- throw a TypeError exception.
-
-
- If IsAccessorDescriptor (targetDesc ) and
- targetDesc .[[Configurable]] is false and targetDesc .[[Get]] is undefined , then
-
- If trapResult is not undefined , throw a TypeError exception.
-
-
-
-
- Return trapResult .
-
-
-
-
NOTE [[Get]] for proxy objects enforces the following invariants:
-
-
-
- The value reported for a property must be the same as the value of the corresponding target object property if the
- target object property is a non-writable, non-configurable own data property.
-
-
-
- The value reported for a property must be undefined if the corresponding target object property is a
- non-configurable own accessor property that has undefined as its [[Get]] attribute.
-
-
-
-
-
-
- 9.5.9 [[Set]] ( P, V, Receiver)
-
- When the [[Set]] internal method of a Proxy exotic object O is called with property
- key P , value V , and ECMAScript language value Receiver , the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "set"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[Set]](P , V , Receiver ).
-
-
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target , P , V , Receiver »)).
- ReturnIfAbrupt (booleanTrapResult ).
- If booleanTrapResult is false , return false .
- Let targetDesc be target .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (targetDesc ).
- If targetDesc is not undefined , then
-
- If IsDataDescriptor (targetDesc ) and targetDesc .[[Configurable]]
- is false and targetDesc .[[Writable]] is false , then
-
- If SameValue (V , targetDesc .[[Value]]) is false , throw a
- TypeError exception.
-
-
- If IsAccessorDescriptor (targetDesc ) and
- targetDesc .[[Configurable]] is false , then
-
- If targetDesc .[[Set]] is undefined , throw a TypeError exception.
-
-
-
-
- Return true .
-
-
-
-
NOTE [[Set]] for proxy objects enforces the following invariants:
-
-
-
- The result of [[Set]] is a Boolean value.
-
-
-
- Cannot change the value of a property to be different from the value of the corresponding target object property if
- the corresponding target object property is a non-writable, non-configurable own data property.
-
-
-
- Cannot set the value of a property if the corresponding target object property is a non-configurable own accessor
- property that has undefined as its [[Set]] attribute.
-
-
-
-
-
-
- 9.5.10 [[Delete]] (P)
-
- When the [[Delete]] internal method of a Proxy exotic object O is called with property key P the following steps are taken:
-
-
- Assert : IsPropertyKey (P ) is
- true .
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "deleteProperty"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[Delete]](P ).
-
-
- Let booleanTrapResult be ToBoolean (Call (trap ,
- handler , «target , P »)).
- ReturnIfAbrupt (booleanTrapResult ).
- If booleanTrapResult is false , return false .
- Let targetDesc be target .[[GetOwnProperty]](P ).
- ReturnIfAbrupt (targetDesc ).
- If targetDesc is undefined , return true .
- If targetDesc .[[Configurable]] is false , throw a TypeError exception.
- Return true .
-
-
-
-
NOTE [[Delete]] for proxy objects enforces the following invariant:
-
-
- The result of [[Delete]] is a Boolean value.
- A property cannot be reported as deleted, if it exists as a non-configurable own property of the target object.
-
-
-
-
-
- 9.5.11 [[Enumerate]] ()
-
- When the [[Enumerate]] internal method of a Proxy exotic object O is called the following steps are taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "enumerate"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[Enumerate]]().
-
-
- Let trapResult be Call (trap , handler , «target »).
- ReturnIfAbrupt (trapResult ).
- If Type (trapResult ) is not Object, throw a TypeError
- exception.
- Return trapResult .
-
-
-
-
NOTE [[Enumerate]] for proxy objects enforces the following invariants:
-
-
- The result of [[Enumerate]] must be an Object.
-
-
-
-
-
- 9.5.12 [[OwnPropertyKeys]] ( )
-
- When the [[OwnPropertyKeys]] internal method of a Proxy exotic object O is called the following steps are
- taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "ownKeys"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return target .[[OwnPropertyKeys]]().
-
-
- Let trapResultArray be Call (trap , handler ,
- «target »).
- Let trapResult be CreateListFromArrayLike (trapResultArray ,
- «String, Symbol»).
- ReturnIfAbrupt (trapResult ).
- Let extensibleTarget be IsExtensible (target ).
- ReturnIfAbrupt (extensibleTarget ).
- Let targetKeys be target .[[OwnPropertyKeys]]().
- ReturnIfAbrupt (targetKeys ).
- Assert : targetKeys is a List containing only String and Symbol values.
- Let targetConfigurableKeys be an empty List .
- Let targetNonconfigurableKeys be an empty List .
- Repeat, for each element key of targetKeys ,
-
- Let desc be target .[[GetOwnProperty]](key ).
- ReturnIfAbrupt (desc ).
- If desc is not undefined and desc. [[Configurable]] is false , then
-
- Append key as an element of targetNonconfigurableKeys .
-
-
- Else,
-
- Append key as an element of targetConfigurableKeys .
-
-
-
-
- If extensibleTarget is true and targetNonconfigurableKeys is empty, then
-
- Return trapResult .
-
-
- Let uncheckedResultKeys be a new List which is a copy of
- trapResult .
- Repeat, for each key that is an element of targetNonconfigurableKeys ,
-
- If key is not an element of uncheckedResultKeys , throw a TypeError exception.
- Remove key from uncheckedResultKeys
-
-
- If extensibleTarget is true , return trapResult .
- Repeat, for each key that is an element of targetConfigurableKeys ,
-
- If key is not an element of uncheckedResultKeys , throw a TypeError exception.
- Remove key from uncheckedResultKeys
-
-
- If uncheckedResultKeys is not empty, throw a TypeError exception.
- Return trapResult .
-
-
-
-
NOTE [[OwnPropertyKeys]] for proxy objects enforces the following invariants:
-
-
-
- The result of [[OwnPropertyKeys]] is a List .
-
-
-
- The Type of each result List element is either String or
- Symbol.
-
-
-
- The result List must contain the keys of all non-configurable
- own properties of the target object.
-
-
-
- If the target object is not extensible, then the result List
- must contain all the keys of the own properties of the target object and no other values.
-
-
-
-
-
-
- 9.5.13 [[Call]] (thisArgument, argumentsList)
-
- The [[Call]] internal method of a Proxy exotic object O is called with parameters thisArgument and
- argumentsList , a List of ECMAScript language values . The following steps are taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "apply"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Return Call (target , thisArgument , argumentsList ).
-
-
- Let argArray be CreateArrayFromList (argumentsList ).
- Return Call (trap , handler , «target , thisArgument ,
- argArray »).
-
-
-
-
NOTE A Proxy exotic object only has a [[Call]] internal method if the initial value of its
- [[ProxyTarget]] internal slot is an object that has a
- [[Call]] internal method.
-
-
-
-
- 9.5.14 [[Construct]] ( argumentsList, newTarget)
-
- The [[Construct]] internal method of a Proxy exotic object O is called with parameters
- argumentsList which is a possibly empty List of ECMAScript language values and newTarget . The following steps are
- taken:
-
-
- Let handler be the value of the [[ProxyHandler]] internal slot of O .
- If handler is null , throw a TypeError exception.
- Assert : Type (handler ) is Object.
- Let target be the value of the [[ProxyTarget]] internal slot of O .
- Let trap be GetMethod (handler , "construct"
).
- ReturnIfAbrupt (trap ).
- If trap is undefined , then
-
- Assert : target has a [[Construct]] internal method.
- Return Construct (target , argumentsList , newTarget ).
-
-
- Let argArray be CreateArrayFromList (argumentsList ).
- Let newObj be Call (trap , handler , «target , argArray ,
- newTarget »).
- ReturnIfAbrupt (newObj ).
- If Type (newObj ) is not Object, throw a TypeError
- exception.
- Return newObj .
-
-
-
-
NOTE 1 A Proxy exotic object only has a [[Construct]] internal method if the initial value of
- its [[ProxyTarget]] internal slot is an object that has a
- [[Construct]] internal method.
-
-
-
-
NOTE 2 [[Construct]] for proxy objects enforces the following invariants:
-
-
- The result of [[Construct]] must be an Object.
-
-
-
-
-
- 9.5.15
- ProxyCreate(target, handler)
-
- The abstract operation ProxyCreate with arguments target and handler is used to specify the
- creation of new Proxy exotic objects. It performs the following steps:
-
-
- If Type (target ) is not Object, throw a TypeError
- Exception.
- If target is a Proxy exotic object and the value of the [[ProxyHandler]] internal slot of target is null , throw a
- TypeError exception.
- If Type (handler ) is not Object, throw a TypeError
- Exception.
- If handler is a Proxy exotic object and the value of the [[ProxyHandler]] internal slot of handler is null , throw a
- TypeError exception.
- Let P be a newly created object.
- Set P ’s essential internal methods (except for [[Call]] and [[Construct]]) to the definitions specified
- in 9.5 .
- If IsCallable (target ) is true , then
-
- Set the [[Call]] internal method of P as specified in 9.5.13 .
- If target has a [[Construct]] internal method, then
-
- Set the [[Construct]] internal method of P as specified in 9.5.14 .
-
-
-
-
- Set the [[ProxyTarget]] internal slot of P to
- target .
- Set the [[ProxyHandler]] internal slot of P to
- handler .
- Return P .
-
-
-
-
-
-
-
-
10
- ECMAScript Language: Source Code
-
-
-
-
-
10.1 Source
- Text
-
Syntax
-
-
-
SourceCharacter ::
-
any Unicode code point
-
-
-
ECMAScript code is expressed using Unicode, version 5.1 or later. ECMAScript source text is a sequence of code points.
- All Unicode code point values from U+0000 to U+10FFFF, including surrogate code points, may occur in source text where
- permitted by the ECMAScript grammars. The actual encodings used to store and interchange ECMAScript source text is not
- relevant to this specification. Regardless of the external source text encoding, a conforming ECMAScript implementation
- processes the source text as if it was an equivalent sequence of SourceCharacter values. Each SourceCharacter being a Unicode code point. Conforming ECMAScript implementations are not required to
- perform any normalization of source text, or behave as though they were performing normalization of source text.
-
-
The components of a combining character sequence are treated as individual Unicode code points even though a user might
- think of the whole sequence as a single character.
-
-
-
NOTE In string literals, regular expression literals, template literals and identifiers, any
- Unicode code point may also be expressed using Unicode escape sequences that explicitly express a code point’s
- numeric value. Within a comment, such an escape sequence is effectively ignored as part of the comment.
-
-
ECMAScript differs from the Java programming language in the behaviour of Unicode escape sequences. In a Java program,
- if the Unicode escape sequence \u000A
, for example, occurs within a single-line comment, it is interpreted as
- a line terminator (Unicode code point U+000A is line feed (lf)) and therefore the next code point is not part of the
- comment. Similarly, if the Unicode escape sequence \u000A
occurs within a string literal in a Java program,
- it is likewise interpreted as a line terminator, which is not allowed within a string literal—one must write
- \n
instead of \u000A
to cause a line feed (lf) to be part of the string value of a string
- literal. In an ECMAScript program, a Unicode escape sequence occurring within a comment is never interpreted and therefore
- cannot contribute to termination of the comment. Similarly, a Unicode escape sequence occurring within a string literal in
- an ECMAScript program always contributes to the literal and is never interpreted as a line terminator or as a code point
- that might terminate the string literal.
-
-
-
-
- 10.1.1 Static
- Semantics: UTF16Encoding ( cp )
-
- The UTF16Encoding of a numeric code point value, cp , is determined as follows:
-
-
- Assert : 0 ≤ cp ≤ 0x10FFFF.
- If cp ≤ 65535, return cp .
- Let cu1 be floor ((cp – 65536) / 1024) + 0xD800.
- Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00.
- Return the code unit sequence consisting of cu1 followed by cu2 .
-
-
-
-
- 10.1.2 Static
- Semantics: UTF16Decode( lead, trail )
-
- Two code units, lead and trail , that form a UTF-16 surrogate pair are converted to a code point by
- performing the following steps:
-
-
- Assert : 0xD800 ≤ lead ≤ 0xDBFF and 0xDC00 ≤ trail ≤
- 0xDFFF.
- Let cp be (lead – 0xD800) × 1024 + (trail – 0xDC00) + 0x10000.
- Return the code point cp .
-
-
-
-
-
-
-
10.2
- Types of Source Code
-
-
There are four types of ECMAScript code:
-
-
-
- Global code is source text that is treated as an ECMAScript Script . The global code of a particular
- Script does not include any source text that is parsed as part of a FunctionDeclaration ,
- FunctionExpression , GeneratorDeclaration , GeneratorExpression , MethodDefinition ,
- ArrowFunction, ClassDeclaration , or ClassExpression .
-
-
-
- Eval code is the source text supplied to the built-in eval
function. More precisely, if the
- parameter to the built-in eval
function is a String, it is treated as an ECMAScript Script . The eval
- code for a particular invocation of eval
is the global code portion of that Script .
-
-
-
- Function code is source text that is parsed to supply the value of the [[ECMAScriptCode]] and
- [[FormalParameters]] internal slots (see 9.2 ) of an ECMAScript function object . The function code of a particular ECMAScript
- function does not include any source text that is parsed as the function code of a nested FunctionDeclaration ,
- FunctionExpression , GeneratorDeclaration , GeneratorExpression , MethodDefinition ,
- ArrowFunction, ClassDeclaration , or ClassExpression .
-
-
-
- Module code is source text that is code that is provided as a ModuleBody . It is the code that is
- directly evaluated when a module is initialized. The module code of a particular module does not include any source text
- that is parsed as part of a nested FunctionDeclaration , FunctionExpression , GeneratorDeclaration ,
- GeneratorExpression , MethodDefinition , ArrowFunction, ClassDeclaration , or
- ClassExpression .
-
-
-
-
-
NOTE Function code is generally provided as the bodies of Function Definitions (14.1 ), Arrow Function Definitions (14.2 ), Method Definitions (14.3 ) and
- Generator Definitions (14.4 ). Function code is also derived from the
- arguments to the Function
constructor (19.2.1.1 ) and the
- GeneratorFunction constructor (25.2.1.1 ).
-
-
-
-
- 10.2.1
- Strict Mode Code
-
- An ECMAScript Script syntactic unit may be processed using either unrestricted or strict mode
- syntax and semantics. Code is interpreted as strict mode code in the following situations:
-
-
-
- Global code is strict mode code if it begins with a Directive Prologue that contains a Use Strict Directive (see 14.1.1 ).
-
-
-
- Module code is always strict mode code.
-
-
-
- All parts of a ClassDeclaration or a ClassExpression are strict mode
- code.
-
-
-
- Eval code is strict mode code if it begins with a Directive Prologue that contains a Use Strict Directive or if the call to eval is a direct
- eval (see 12.3.4.1 ) that is contained in strict mode
- code.
-
-
-
- Function code is strict mode code if the associated FunctionDeclaration , FunctionExpression , GeneratorDeclaration , GeneratorExpression , MethodDefinition , or ArrowFunction is contained in strict mode code or if the code that produces the value of the
- function’s [[ECMAScriptCode]] internal slot begins
- with a Directive Prologue that contains a Use Strict Directive .
-
-
-
- Function code that is supplied as the arguments to the built-in Function
and Generator
- constructors is strict mode code if the last argument is a String that when processed has a FunctionBody begins with a Directive
- Prologue that contains a Use Strict
- Directive .
-
-
-
- ECMAScript code that is not strict mode code is called non-strict code .
-
-
-
- 10.2.2 Non-ECMAScript Functions
-
- An ECMAScript implementation may support the evaluation of exotic function objects whose evaluative behaviour is
- expressed in some implementation defined form of executable code other than via ECMAScript code. Whether a function object
- is an ECMAScript code function or a non-ECMAScript function is not semantically observable from the perspective of an
- ECMAScript code function that calls or is called by such a non-ECMAScript function.
-
-
-
-
-
-
-
11 ECMAScript Language: Lexical Grammar
-
-
The source text of an ECMAScript Script or Module is first converted into a
- sequence of input elements, which are tokens, line terminators, comments, or white space. The source text is scanned from left
- to right, repeatedly taking the longest possible sequence of code points as the next input element.
-
-
There are several situations where the identification of lexical input elements is sensitive to the syntactic grammar
- context that is consuming the input elements. This requires multiple goal symbols for the lexical grammar. The InputElementRegExpOrTemplateTail goal is used in syntactic grammar contexts where a
- RegularExpressionLiteral, a TemplateMiddle, or a TemplateTail is permitted. The
- InputElementRegExp goal symbol is used in all syntactic grammar contexts where a RegularExpressionLiteral is permitted but neither a TemplateMiddle, nor a TemplateTail is permitted. The InputElementTemplateTail goal is used in all
- syntactic grammar contexts where a TemplateMiddle or a TemplateTail is
- permitted but a RegularExpressionLiteral is not permitted. In all other contexts, InputElementDiv is used as the lexical goal symbol.
-
-
-
NOTE The use of multiple lexical goals ensures that there are no lexical ambiguities that would
- affect automatic semicolon insertion . For example, there are no syntactic
- grammar contexts where both a leading division or division-assignment, and a leading RegularExpressionLiteral are
- permitted. This is not affected by semicolon insertion (see 11.9 ); in
- examples such as the following:
-
-
a = b /hi/g.exec(c).map(d);
-
-
where the first non-whitespace, non-comment code point after a LineTerminator is U+002F (SOLIDUS) and the
- syntactic context allows division or division-assignment, no semicolon is inserted at the LineTerminator . That is,
- the above example is interpreted in the same way as:
-
-
a = b / hi / g.exec(c).map(d);
-
-
-
Syntax
-
-
-
InputElementDiv ::
-
WhiteSpace
-
LineTerminator
-
Comment
-
CommonToken
-
DivPunctuator
-
RightBracePunctuator
-
-
-
-
InputElementRegExp ::
-
WhiteSpace
-
LineTerminator
-
Comment
-
CommonToken
-
RightBracePunctuator
-
RegularExpressionLiteral
-
-
-
-
InputElementRegExpOrTemplateTail ::
-
WhiteSpace
-
LineTerminator
-
Comment
-
CommonToken
-
RegularExpressionLiteral
-
TemplateSubstitutionTail
-
-
-
-
InputElementTemplateTail ::
-
WhiteSpace
-
LineTerminator
-
Comment
-
CommonToken
-
DivPunctuator
-
TemplateSubstitutionTail
-
-
-
-
-
-
- 11.2 White
- Space
-
- White space code points are used to improve source text readability and to separate tokens (indivisible lexical units) from
- each other, but are otherwise insignificant. White space code points may occur between any two tokens and at the start or end
- of input. White space code points may occur within a StringLiteral , a RegularExpressionLiteral , a Template , or a TemplateSubstitutionTail where they are considered significant code points forming part of a literal value.
- They may also occur within a Comment , but cannot appear within any other kind of token.
-
- The ECMAScript white space code points are listed in Table 32 .
-
-
- Table 32 — White Space Code Points
-
-
- Code Point
- Name
- Abbreviation
-
-
- U+0009
- Character Tabulation
- <TAB>
-
-
- U+000B
- LINE TABULATION
- <VT>
-
-
- U+000C
- Form Feed (ff)
- <FF>
-
-
- U+0020
- Space
- <SP>
-
-
- U+00A0
- No-break space
- <NBSP>
-
-
- U+FEFF
- ZERO wIDTH nO-bREAK SPACE
- <ZWNBSP>
-
-
- Other category “Zs”
- Any other Unicode “Separator, space” code point
- <USP>
-
-
-
-
- ECMAScript implementations must recognize as WhiteSpace code points listed in the “Separator,
- space” (Zs) category by Unicode 5.1. ECMAScript implementations may also recognize as WhiteSpace
- additional category Zs code points from subsequent editions of the Unicode Standard.
-
-
-
NOTE Other than for the code points listed in Table 32 , ECMAScript
- WhiteSpace intentionally excludes all code points that have the Unicode “White_Space” property but which
- are not classified in category “Zs”.
-
-
- Syntax
-
-
-
WhiteSpace ::
-
<TAB>
-
<VT>
-
<FF>
-
<SP>
-
<NBSP>
-
<zwnbsp>
-
<USP>
-
-
-
-
- 11.3 Line
- Terminators
-
- Like white space code points, line terminator code points are used to improve source text readability and to separate
- tokens (indivisible lexical units) from each other. However, unlike white space code points, line terminators have some
- influence over the behaviour of the syntactic grammar. In general, line terminators may occur between any two tokens, but
- there are a few places where they are forbidden by the syntactic grammar. Line terminators also affect the process of automatic semicolon insertion (11.9 ). A line terminator cannot occur within any token except a StringLiteral , Template , or TemplateSubstitutionTail . Line
- terminators may only occur within a StringLiteral token as part of a LineContinuation .
-
- A line terminator can occur within a MultiLineComment (11.4 ) but cannot
- occur within a SingleLineComment .
-
- Line terminators are included in the set of white space code points that are matched by the \s
class in
- regular expressions.
-
- The ECMAScript line terminator code points are listed in Table 33 .
-
-
- Table 33 — Line Terminator Code Points
-
-
- Code Point
- Unicode Name
- Abbreviation
-
-
- U+000A
- Line Feed (LF)
- <LF>
-
-
- U+000D
- Carriage Return (CR)
- <CR>
-
-
- U+2028
- Line separator
- <LS>
-
-
- U+2029
- Paragraph separator
- <PS>
-
-
-
-
- Only the Unicode code points in Table 33 are treated as line terminators. Other new line or line
- breaking Unicode code points are not treated as line terminators but are treated as white space if they meet the requirements
- listed in Table 32 . The sequence <CR><LF> is commonly used as a line terminator. It should
- be considered a single SourceCharacter for the purpose of reporting line numbers.
-
- Syntax
-
-
-
LineTerminator ::
-
<LF>
-
<CR>
-
<LS>
-
<PS>
-
-
-
-
LineTerminatorSequence ::
-
<LF>
-
<CR> [lookahead ≠ <LF> ]
-
<LS>
-
<PS>
-
<CR> <LF>
-
-
-
-
-
-
-
- Syntax
-
-
-
CommonToken ::
-
IdentifierName
-
Punctuator
-
NumericLiteral
-
StringLiteral
-
Template
-
-
-
-
NOTE The DivPunctuator , RegularExpressionLiteral , RightBracePunctuator, and
- TemplateSubstitutionTail productions derive additional tokens that are not included in the CommonToken
- production.
-
-
-
-
-
-
11.6 Names
- and Keywords
-
-
IdentifierName and ReservedWord are tokens that are interpreted according
- to the Default Identifier Syntax given in Unicode Standard Annex #31, Identifier and Pattern Syntax, with some small
- modifications. ReservedWord is an enumerated subset of IdentifierName . The syntactic grammar defines Identifier as an IdentifierName that is not a ReservedWord (see
- 11.6.2 ). The Unicode identifier grammar is based on character properties specified by the Unicode Standard. The Unicode
- code points in the specified categories in version 5.1.0 of the Unicode standard must be treated as in those categories by
- all conforming ECMAScript implementations. ECMAScript implementations may recognize identifier code points defined in later
- editions of the Unicode Standard.
-
-
-
NOTE This standard specifies specific code point additions: U+0024 (dollar sign) and U+005F (LOW LINE ) are permitted anywhere in an IdentifierName , and
- the code points U+200C (zero-width non-joiner) and U+200D (zero-width joiner)
- are permitted anywhere after the first code point of an
- IdentifierName .
-
-
-
Unicode escape sequences are permitted in an IdentifierName , where they contribute a single
- Unicode code point to the IdentifierName . The code point is expressed by the HexDigits of the UnicodeEscapeSequence (see 11.8.4 ). The \
preceding the UnicodeEscapeSequence and the u
and { }
code units, if they appear, do not
- contribute code points to the IdentifierName . A UnicodeEscapeSequence cannot
- be used to put a code point into an IdentifierName that would otherwise be illegal. In other words,
- if a \
UnicodeEscapeSequence sequence were replaced by the SourceCharacter it contributes, the result must still be a valid IdentifierName
- that has the exact same sequence of SourceCharacter elements as the original IdentifierName . All interpretations of IdentifierName within this specification
- are based upon their actual code points regardless of whether or not an escape sequence was used to contribute any
- particular code point.
-
-
Two IdentifierName that are canonically equivalent according to the Unicode standard are
- not equal unless, after replacement of each UnicodeEscapeSequence , they are represented by
- the exact same sequence of code points.
-
-
Syntax
-
-
-
IdentifierName ::
-
IdentifierStart
-
IdentifierName IdentifierPart
-
-
-
-
IdentifierStart ::
-
UnicodeIDStart
-
$
-
_
-
\
UnicodeEscapeSequence
-
-
-
-
IdentifierPart ::
-
UnicodeIDContinue
-
$
-
_
-
\
UnicodeEscapeSequence
-
<ZWNJ>
-
<ZWJ>
-
-
-
-
UnicodeIDStart ::
-
any Unicode code point with the Unicode property “ID_Start”
-
-
-
-
UnicodeIDContinue ::
-
any Unicode code point with the Unicode property “ID_Continue”
-
-
-
The definitions of the nonterminal UnicodeEscapeSequence is given in 11.8.4 .
-
-
-
NOTE The sets of code points with Unicode properties “ID_Start” and
- “ID_Continue” include, respectively, the code points with Unicode properties “Other_ID_Start” and
- “Other_ID_Continue”.
-
-
-
-
-
-
-
- 11.6.1.1 Static Semantics: Early Errors
- IdentifierStart :: \
UnicodeEscapeSequence
-
- IdentifierPart :: \
UnicodeEscapeSequence
-
-
- It is a Syntax Error if SV(UnicodeEscapeSequence ) is none
- of "$"
, or "_"
, or the UTF16Encoding (10.1.1 ) of either <ZWNJ> or <ZWJ>, or the UTF16Encoding of a Unicode code point that would be matched by the UnicodeIDContinue lexical grammar production.
-
-
-
-
-
- 11.6.1.2 Static Semantics:
- StringValue
-
- See also: 11.8.4.2 , 12.1.4 .
-
-
-
IdentifierName ::
-
IdentifierStart
-
IdentifierName IdentifierPart
-
-
-
- Return the String value consisting of the sequence of code units corresponding to IdentifierName . In
- determining the sequence any occurrences of \
UnicodeEscapeSequence are first replaced with the
- code point represented by the UnicodeEscapeSequence and then the code points of the entire
- IdentifierName are converted to code units by UTF16Encoding (10.1.1 ) each code point.
-
-
-
-
-
-
-
11.6.2
- Reserved Words
-
-
A reserved word is an IdentifierName that cannot be used as an Identifier .
-
-
Syntax
-
-
-
ReservedWord ::
-
Keyword
-
FutureReservedWord
-
NullLiteral
-
BooleanLiteral
-
-
-
-
NOTE The ReservedWord definitions are specified as literal sequences of specific
- SourceCharacter elements. A code point in a ReservedWord cannot be expressed by a \
- UnicodeEscapeSequence .
-
-
-
-
-
-
- The following tokens are ECMAScript keywords and may not be used as Identifiers in ECMAScript
- programs.
-
- Syntax
- Keyword :: one of
-
-
-
-
- break
- do
- in
- typeof
-
-
- case
- else
- instanceof
- var
-
-
- catch
- export
- new
- void
-
-
- class
- extends
- return
- while
-
-
- const
- finally
- super
- with
-
-
- continue
- for
- switch
- yield
-
-
- debugger
- function
- this
-
-
-
- default
- if
- throw
-
-
-
- delete
- import
- try
-
-
-
-
-
-
-
NOTE In some contexts yield
is given the semantics of an Identifier . See
- 12.1.1 . In strict mode
- code , let
and static
are treated as reserved keywords through static semantic restrictions
- (see 12.1.1 , 13.2.1.1 , 13.6.4.1 , and 14.5.1 ) rather than the lexical grammar.
-
-
-
-
- 11.6.2.2 Future Reserved Words
-
- The following tokens are reserved for used as keywords in future language extensions.
-
- Syntax
- FutureReservedWord ::
-
-
-
-
-
- await
is only treated as a FutureReservedWord when Module
- is the goal symbol of the syntactic grammar.
-
-
-
NOTE Use of the following tokens within strict mode code
- (see 10.2.1 ) is also reserved. That usage is restricted using static semantic
- restrictions (see 12.1.1 ) rather than the lexical
- grammar:
-
-
-
-
-
- implements
- package
- protected
-
-
-
- interface
- private
- public
-
-
-
-
-
-
-
-
-
- 11.7
- Punctuators
- Syntax
- Punctuator :: one of
-
-
-
-
- {
- (
- )
- [
- ]
- .
-
-
- ...
- ;
- ,
- <
- >
- <=
-
-
- >=
- ==
- !=
- ===
- !==
-
-
-
- +
- -
- *
- %
- ++
- --
-
-
- <<
- >>
- >>>
- &
- |
- ^
-
-
- !
- ~
- &&
- ||
- ?
- :
-
-
- =
- +=
- -=
- *=
- %=
- <<=
-
-
- >>=
- >>>=
- &=
- |=
- ^=
- =>
-
-
-
-
- DivPunctuator :: one of
-
-
-
-
-
- RightBracePunctuator ::
-
-
-
-
-
-
-
-
-
-
- 11.8.1 Null
- Literals
- Syntax
-
-
-
NullLiteral ::
-
null
-
-
-
-
- 11.8.2
- Boolean Literals
- Syntax
-
-
-
BooleanLiteral ::
-
true
-
false
-
-
-
-
-
-
11.8.3 Numeric Literals
-
Syntax
-
-
-
NumericLiteral ::
-
DecimalLiteral
-
BinaryIntegerLiteral
-
OctalIntegerLiteral
-
HexIntegerLiteral
-
-
-
-
DecimalLiteral ::
-
DecimalIntegerLiteral .
DecimalDigits opt ExponentPart opt
-
.
DecimalDigits ExponentPart opt
-
DecimalIntegerLiteral ExponentPart opt
-
-
-
-
DecimalIntegerLiteral ::
-
0
-
NonZeroDigit DecimalDigits opt
-
-
-
-
DecimalDigits ::
-
DecimalDigit
-
DecimalDigits DecimalDigit
-
-
-
-
DecimalDigit :: one of
-
0
1
2
3
4
5
6
7
8
9
-
-
-
-
NonZeroDigit :: one of
-
1
2
3
4
5
6
7
8
9
-
-
-
-
ExponentPart ::
-
ExponentIndicator SignedInteger
-
-
-
-
ExponentIndicator :: one of
-
e
E
-
-
-
-
SignedInteger ::
-
DecimalDigits
-
+
DecimalDigits
-
-
DecimalDigits
-
-
-
-
BinaryIntegerLiteral ::
-
0b
BinaryDigits
-
0B
BinaryDigits
-
-
-
-
BinaryDigits ::
-
BinaryDigit
-
BinaryDigits BinaryDigit
-
-
-
-
BinaryDigit :: one of
-
0
1
-
-
-
-
OctalIntegerLiteral ::
-
0o
OctalDigits
-
0O
OctalDigits
-
-
-
-
OctalDigits ::
-
OctalDigit
-
OctalDigits OctalDigit
-
-
-
-
OctalDigit :: one of
-
0
1
2
3
4
5
6
7
-
-
-
-
HexIntegerLiteral ::
-
0x
HexDigits
-
0X
HexDigits
-
-
-
-
HexDigits ::
-
HexDigit
-
HexDigits HexDigit
-
-
-
-
HexDigit :: one of
-
0
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
A
B
C
D
E
F
-
-
-
The SourceCharacter immediately following a NumericLiteral must not be
- an IdentifierStart or DecimalDigit .
-
-
-
NOTE For example:
-
-
3in
-
-
is an error and not the two input elements 3
and in
.
-
-
-
A conforming implementation, when processing strict mode code (see 10.2.1 ), must not extend, as described in B.1.1 , the syntax of NumericLiteral to include
- LegacyOctalIntegerLiteral , nor extend the syntax of DecimalIntegerLiteral to include NonOctalDecimalIntegerLiteral .
-
-
-
- 11.8.3.1 Static Semantics: MV’s
-
- A numeric literal stands for a value of the Number type. This value is determined in two steps: first, a mathematical
- value (MV) is derived from the literal; second, this mathematical value is rounded as described below.
-
-
-
- The MV of NumericLiteral :: DecimalLiteral is the MV of DecimalLiteral .
-
-
-
- The MV of NumericLiteral :: BinaryIntegerLiteral is the MV of BinaryIntegerLiteral .
-
-
-
- The MV of NumericLiteral :: OctalIntegerLiteral is the MV of OctalIntegerLiteral .
-
-
-
- The MV of NumericLiteral :: HexIntegerLiteral is the MV of HexIntegerLiteral .
-
-
-
- The MV of DecimalLiteral :: DecimalIntegerLiteral .
is the MV of DecimalIntegerLiteral .
-
-
-
- The MV of DecimalLiteral :: DecimalIntegerLiteral .
DecimalDigits is the
- MV of DecimalIntegerLiteral plus (the MV of DecimalDigits × 10–n ), where
- n is the number of code points in DecimalDigits .
-
-
-
- The MV of DecimalLiteral :: DecimalIntegerLiteral .
ExponentPart is the MV
- of DecimalIntegerLiteral × 10e , where e is the MV of ExponentPart .
-
-
-
- The MV of DecimalLiteral :: DecimalIntegerLiteral .
DecimalDigits ExponentPart is (the MV of DecimalIntegerLiteral plus (the MV of DecimalDigits
- × 10–n )) × 10e , where n is the number of code points in
- DecimalDigits and e is the MV of ExponentPart .
-
-
-
- The MV of DecimalLiteral :: .
DecimalDigits is the MV of DecimalDigits ×
- 10–n , where n is the number of code points in DecimalDigits .
-
-
-
- The MV of DecimalLiteral :: .
DecimalDigits ExponentPart is the MV of
- DecimalDigits × 10e –n , where n is the number of code points in
- DecimalDigits and e is the MV of ExponentPart .
-
-
-
- The MV of DecimalLiteral :: DecimalIntegerLiteral is the MV of DecimalIntegerLiteral .
-
-
-
- The MV of DecimalLiteral :: DecimalIntegerLiteral ExponentPart is the MV of
- DecimalIntegerLiteral × 10e , where e is the MV of ExponentPart .
-
-
-
- The MV of DecimalIntegerLiteral :: 0
is 0.
-
-
-
- The MV of DecimalIntegerLiteral :: NonZeroDigit is the MV of NonZeroDigit.
-
-
-
- The MV of DecimalIntegerLiteral :: NonZeroDigit DecimalDigits is (the MV of NonZeroDigit ×
- 10n ) plus the MV of DecimalDigits , where n is the number of code points in
- DecimalDigits .
-
-
-
- The MV of DecimalDigits :: DecimalDigit is the MV of DecimalDigit .
-
-
-
- The MV of DecimalDigits :: DecimalDigits DecimalDigit is (the MV of DecimalDigits ×
- 10) plus the MV of DecimalDigit .
-
-
-
- The MV of ExponentPart :: ExponentIndicator SignedInteger is the MV of
- SignedInteger .
-
-
-
- The MV of SignedInteger :: DecimalDigits is the MV of DecimalDigits .
-
-
-
- The MV of SignedInteger :: +
DecimalDigits is the MV of DecimalDigits .
-
-
-
- The MV of SignedInteger :: -
DecimalDigits is the negative of the MV of DecimalDigits .
-
-
-
- The MV of DecimalDigit :: 0
or of HexDigit :: 0
or of OctalDigit ::
- 0
or of BinaryDigit :: 0
is 0.
-
-
-
- The MV of DecimalDigit :: 1
or of NonZeroDigit ::
- 1
or of HexDigit ::
- 1
or of OctalDigit :: 1
or of BinaryDigit
- :: 1
is 1.
-
-
-
- The MV of DecimalDigit :: 2
or of NonZeroDigit ::
- 2
or of HexDigit ::
- 2
or of OctalDigit :: 2
is 2.
-
-
-
- The MV of DecimalDigit :: 3
or of NonZeroDigit ::
- 3
or of HexDigit ::
- 3
or of OctalDigit :: 3
is 3.
-
-
-
- The MV of DecimalDigit :: 4
or of NonZeroDigit ::
- 4
or of HexDigit ::
- 4
or of OctalDigit :: 4
is 4.
-
-
-
- The MV of DecimalDigit :: 5
or of NonZeroDigit ::
- 5
or of HexDigit ::
- 5
or of OctalDigit :: 5
is 5.
-
-
-
- The MV of DecimalDigit :: 6
or of NonZeroDigit ::
- 6
or of HexDigit ::
- 6
or of OctalDigit :: 6
is 6.
-
-
-
- The MV of DecimalDigit :: 7
or of NonZeroDigit ::
- 7
or of HexDigit ::
- 7
or of OctalDigit :: 7
is 7.
-
-
-
- The MV of DecimalDigit :: 8
or of NonZeroDigit ::
- 8
or of HexDigit ::
- 8
is 8.
-
-
-
- The MV of DecimalDigit :: 9
or of NonZeroDigit ::
- 9
or of HexDigit ::
- 9
is 9.
-
-
-
- The MV of HexDigit :: a
or of HexDigit :: A
is 10.
-
-
-
- The MV of HexDigit :: b
or of HexDigit :: B
is 11.
-
-
-
- The MV of HexDigit :: c
or of HexDigit :: C
is 12.
-
-
-
- The MV of HexDigit :: d
or of HexDigit :: D
is 13.
-
-
-
- The MV of HexDigit :: e
or of HexDigit :: E
is 14.
-
-
-
- The MV of HexDigit :: f
or of HexDigit :: F
is 15.
-
-
-
- The MV of BinaryIntegerLiteral :: 0b
BinaryDigits is the MV of BinaryDigits .
-
-
-
- The MV of BinaryIntegerLiteral :: 0B
BinaryDigits is the MV of BinaryDigits .
-
-
-
- The MV of BinaryDigits :: BinaryDigit is the MV of BinaryDigit .
-
-
-
- The MV of BinaryDigits :: BinaryDigits BinaryDigit is (the MV of BinaryDigits × 2)
- plus the MV of BinaryDigit .
-
-
-
- The MV of OctalIntegerLiteral :: 0o
OctalDigits is the MV of OctalDigits .
-
-
-
- The MV of OctalIntegerLiteral :: 0O
OctalDigits is the MV of OctalDigits .
-
-
-
- The MV of OctalDigits :: OctalDigit is the MV of OctalDigit .
-
-
-
- The MV of OctalDigits :: OctalDigits OctalDigit is (the MV of OctalDigits × 8)
- plus the MV of OctalDigit .
-
-
-
- The MV of HexIntegerLiteral :: 0x
HexDigits is the MV of HexDigits .
-
-
-
- The MV of HexIntegerLiteral :: 0X
HexDigits is the MV of HexDigits .
-
-
-
- The MV of HexDigits :: HexDigit is the MV of HexDigit .
-
-
-
- The MV of HexDigits :: HexDigits HexDigit is (the MV of HexDigits × 16) plus
- the MV of HexDigit .
-
-
-
- Once the exact MV for a numeric literal has been determined, it is then rounded to a value of the Number type. If the
- MV is 0, then the rounded value is +0 ; otherwise, the rounded value must be the Number value
- for the MV (as specified in 6.1.6 ), unless the literal is a DecimalLiteral and the literal has more than 20 significant digits, in which case the Number value may
- be either the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a
- 0
digit or the Number value for the MV of a literal produced by replacing each significant digit after the
- 20th with a 0
digit and then incrementing the literal at the 20th significant digit position. A digit is
- significant if it is not part of an ExponentPart and
-
-
- it is not 0
; or
- there is a nonzero digit to its left and there is a nonzero digit, not in the ExponentPart , to its
- right.
-
-
-
-
-
-
-
11.8.4 String Literals
-
-
-
NOTE A string literal is zero or more Unicode code points enclosed in single or double
- quotes. Unicode code points may also be represented by an escape sequence. All code points may appear literally in a string literal except for the closing quote code points , U+005C (REVERSE SOLIDUS), U+000D (carriage return), U+2028 (line
- separator), U+2029 (paragraph separator), and U+000A (line feed). Any code
- points may appear in the form of an escape sequence. String literals evaluate to ECMAScript String values. When
- generating these string values Unicode code points are UTF-16 encoded as defined in 10.1.1 . Code points belonging to the Basic Multilingual Plane are encoded as a single code
- unit element of the string. All other code points are encoded as two code unit elements of the string.
-
-
-
Syntax
-
-
-
StringLiteral ::
-
"
DoubleStringCharacters opt "
-
'
SingleStringCharacters opt '
-
-
-
-
DoubleStringCharacters ::
-
DoubleStringCharacter DoubleStringCharacters opt
-
-
-
-
SingleStringCharacters ::
-
SingleStringCharacter SingleStringCharacters opt
-
-
-
-
DoubleStringCharacter ::
-
SourceCharacter but not one of "
or \
or LineTerminator
-
\
EscapeSequence
-
LineContinuation
-
-
-
-
SingleStringCharacter ::
-
SourceCharacter but not one of '
or \
or LineTerminator
-
\
EscapeSequence
-
LineContinuation
-
-
-
-
LineContinuation ::
-
\
LineTerminatorSequence
-
-
-
-
EscapeSequence ::
-
CharacterEscapeSequence
-
0
[lookahead ∉ DecimalDigit ]
-
HexEscapeSequence
-
UnicodeEscapeSequence
-
-
-
A conforming implementation, when processing strict mode code (see 10.2.1 ), must not extend the syntax of EscapeSequence to
- include LegacyOctalEscapeSequence as described in B.1.2 .
-
-
-
CharacterEscapeSequence ::
-
SingleEscapeCharacter
-
NonEscapeCharacter
-
-
-
-
SingleEscapeCharacter :: one of
-
'
"
\
b
f
n
r
t
v
-
-
-
-
NonEscapeCharacter ::
-
SourceCharacter but not one of EscapeCharacter or LineTerminator
-
-
-
-
EscapeCharacter ::
-
SingleEscapeCharacter
-
DecimalDigit
-
x
-
u
-
-
-
-
HexEscapeSequence ::
-
x
HexDigit HexDigit
-
-
-
-
UnicodeEscapeSequence ::
-
u
Hex4Digits
-
u{
HexDigits }
-
-
-
-
Hex4Digits ::
-
HexDigit HexDigit HexDigit HexDigit
-
-
-
The definition of the nonterminal HexDigit is given in 11.8.3 . SourceCharacter is defined in 10.1 .
-
-
-
NOTE A line terminator code point cannot appear
- in a string literal, except as part of a LineContinuation to produce the empty code points sequence. The proper way to cause a line terminator code point to be part of the String value of a string literal is to use an escape sequence such as
- \n
or \u000A
.
-
-
-
-
- 11.8.4.1 Static Semantics: Early Errors
- UnicodeEscapeSequence :: u{
HexDigits }
-
- It is a Syntax Error if the MV of HexDigits > 1114111.
-
-
-
-
- 11.8.4.2 Static Semantics:
- StringValue
-
- See also: 11.6.1.2 , 12.1.4 .
-
-
-
StringLiteral ::
-
"
DoubleStringCharacters opt "
-
'
SingleStringCharacters opt '
-
-
-
- Return the String value whose elements are the SV of this StringLiteral .
-
-
-
-
- 11.8.4.3 Static Semantics: SV’s
-
- A string literal stands for a value of the String type. The String value (SV) of the literal is described in terms of
- code unit values contributed by the various parts of the string literal. As part of this process, some Unicode code points
- within the string literal are interpreted as having a mathematical value (MV), as described below or in 11.8.3 .
-
-
-
- The SV of StringLiteral :: ""
is the empty code unit sequence.
-
-
-
- The SV of StringLiteral :: ''
is the empty code unit sequence.
-
-
-
- The SV of StringLiteral :: "
DoubleStringCharacters "
is the SV of
- DoubleStringCharacters .
-
-
-
- The SV of StringLiteral :: '
SingleStringCharacters '
is the SV of
- SingleStringCharacters .
-
-
-
- The SV of DoubleStringCharacters :: DoubleStringCharacter is a sequence of one or two code units that is the SV of
- DoubleStringCharacter .
-
-
-
- The SV of DoubleStringCharacters :: DoubleStringCharacter DoubleStringCharacters is a sequence of one or
- two code units that is the SV of DoubleStringCharacter followed by all the code units in the SV of
- DoubleStringCharacters in order.
-
-
-
- The SV of SingleStringCharacters :: SingleStringCharacter is a sequence of one or two code units that is the SV of
- SingleStringCharacter .
-
-
-
- The SV of SingleStringCharacters :: SingleStringCharacter SingleStringCharacters is a sequence of one or
- two code units that is the SV of SingleStringCharacter followed by all the code units in the SV of
- SingleStringCharacters in order.
-
-
-
- The SV of DoubleStringCharacter :: SourceCharacter but not one of "
or \
or LineTerminator is the UTF16Encoding (10.1.1 ) of the code point value of SourceCharacter .
-
-
-
- The SV of DoubleStringCharacter :: \
EscapeSequence is the SV of the EscapeSequence .
-
-
-
- The SV of DoubleStringCharacter :: LineContinuation is the empty code unit sequence.
-
-
-
- The SV of SingleStringCharacter :: SourceCharacter but not one of '
or \
or LineTerminator is the UTF16Encoding (10.1.1 ) of the code point value of SourceCharacter .
-
-
-
- The SV of SingleStringCharacter :: \
EscapeSequence is the SV of the EscapeSequence .
-
-
-
- The SV of SingleStringCharacter :: LineContinuation is the empty code unit sequence.
-
-
-
- The SV of EscapeSequence :: CharacterEscapeSequence is the SV of the CharacterEscapeSequence .
-
-
-
- The SV of EscapeSequence :: 0
is the code unit value 0.
-
-
-
- The SV of EscapeSequence :: HexEscapeSequence is the SV of the HexEscapeSequence .
-
-
-
- The SV of EscapeSequence :: UnicodeEscapeSequence is the SV of the UnicodeEscapeSequence .
-
-
-
- The SV of CharacterEscapeSequence :: SingleEscapeCharacter is the code unit whose value is determined by the
- SingleEscapeCharacter according to { REF _Ref365803173 \h }Table 34 .
-
-
-
-
- Table 34 — String Single Character Escape Sequences
-
-
- Escape Sequence
- Code Unit Value
- Unicode Character Name
- Symbol
-
-
- \b
- 0x0008
- BACKSPACE
- <BS>
-
-
- \t
- 0x0009
- CHARACTER TABULATION
- <HT>
-
-
- \n
- 0x000A
- line feed (lf)
- <LF>
-
-
- \v
- 0x000B
- LINE TABULATION
- <VT>
-
-
- \f
- 0x000C
- form feed (ff)
- <FF>
-
-
- \r
- 0x000D
- carriage return (cr)
- <CR>
-
-
- \"
- 0x0022
- quotation Mark
- "
-
-
- \'
- 0x0027
- apostrophe
- '
-
-
- \\
- 0x005C
- REverse Solidus
- \
-
-
-
-
-
-
- The SV of CharacterEscapeSequence :: NonEscapeCharacter is the SV of the NonEscapeCharacter .
-
-
-
- The SV of NonEscapeCharacter :: SourceCharacter but not one of EscapeCharacter
- or LineTerminator is the UTF16Encoding (10.1.1 ) of the code point value of
- SourceCharacter .
-
-
-
- The SV of HexEscapeSequence :: x
HexDigit HexDigit is the code unit value
- that is (16 times the MV of the first HexDigit ) plus the MV of the second HexDigit .
-
-
-
- The SV of UnicodeEscapeSequence :: u
Hex4Digits is the SV of Hex4Digits.
-
-
-
- The SV of Hex4Digits :: HexDigit HexDigit HexDigit HexDigit is the code unit value that is (4096 times the MV of the first HexDigit ) plus
- (256 times the MV of the second HexDigit ) plus (16 times the MV of the third HexDigit ) plus the MV of
- the fourth HexDigit .
-
-
-
- The SV of UnicodeEscapeSequence :: u{
HexDigits }
is the UTF16Encoding (10.1.1 ) of the MV of
- HexDigits .
-
-
-
-
-
-
-
-
11.8.5 Regular Expression Literals
-
-
-
NOTE A regular expression literal is an input element that is converted to a RegExp object
- (see 21.2 ) each time the literal is evaluated. Two regular
- expression literals in a program evaluate to regular expression objects that never compare as ===
to each
- other even if the two literals' contents are identical. A RegExp object may also be created at runtime by new
- RegExp
or calling the RegExp
constructor as a function (see
- 21.2.3 ).
-
-
-
The productions below describe the syntax for a regular expression literal and are used by the input element scanner to
- find the end of the regular expression literal. The source text comprising the RegularExpressionBody and the RegularExpressionFlags are subsequently parsed
- again using the more stringent ECMAScript Regular Expression grammar (21.2.1 ).
-
-
An implementation may extend the ECMAScript Regular Expression grammar defined in 21.2.1 ,
- but it must not extend the RegularExpressionBody and RegularExpressionFlags productions defined below or the productions used by these productions.
-
-
Syntax
-
-
-
RegularExpressionLiteral ::
-
/
RegularExpressionBody /
RegularExpressionFlags
-
-
-
-
RegularExpressionBody ::
-
RegularExpressionFirstChar RegularExpressionChars
-
-
-
-
RegularExpressionChars ::
-
[empty]
-
RegularExpressionChars RegularExpressionChar
-
-
-
-
RegularExpressionFirstChar ::
-
RegularExpressionNonTerminator but not one of *
or \
or /
or [
-
RegularExpressionBackslashSequence
-
RegularExpressionClass
-
-
-
-
RegularExpressionChar ::
-
RegularExpressionNonTerminator but not one of \
or /
or [
-
RegularExpressionBackslashSequence
-
RegularExpressionClass
-
-
-
-
RegularExpressionBackslashSequence ::
-
\
RegularExpressionNonTerminator
-
-
-
-
RegularExpressionNonTerminator ::
-
SourceCharacter but not LineTerminator
-
-
-
-
RegularExpressionClass ::
-
[
RegularExpressionClassChars ]
-
-
-
-
RegularExpressionClassChars ::
-
[empty]
-
RegularExpressionClassChars RegularExpressionClassChar
-
-
-
-
RegularExpressionClassChar ::
-
RegularExpressionNonTerminator but not one of ]
or \
-
RegularExpressionBackslashSequence
-
-
-
-
RegularExpressionFlags ::
-
[empty]
-
RegularExpressionFlags IdentifierPart
-
-
-
-
NOTE Regular expression literals may not be empty; instead of representing an empty regular
- expression literal, the code unit sequence //
starts a single-line comment. To specify an empty regular
- expression, use: /(?:)/
.
-
-
-
-
- 11.8.5.1 Static Semantics: Early Errors
- RegularExpressionFlags :: RegularExpressionFlags IdentifierPart
-
- It is a Syntax Error if IdentifierPart contains a Unicode escape sequence.
-
-
-
-
- 11.8.5.2 Static Semantics: BodyText
- RegularExpressionLiteral :: /
RegularExpressionBody /
RegularExpressionFlags
-
- Return the source text that was recognized as RegularExpressionBody .
-
-
-
-
- 11.8.5.3 Static Semantics: FlagText
- RegularExpressionLiteral :: /
RegularExpressionBody /
RegularExpressionFlags
-
- Return the source text that was recognized as RegularExpressionFlags .
-
-
-
-
-
-
-
11.8.6 Template Literal Lexical Components
-
Syntax
-
-
-
Template ::
-
NoSubstitutionTemplate
-
TemplateHead
-
-
-
-
NoSubstitutionTemplate ::
-
`
TemplateCharacters opt `
-
-
-
-
TemplateHead ::
-
`
TemplateCharacters opt ${
-
-
-
-
TemplateSubstitutionTail ::
-
TemplateMiddle
-
TemplateTail
-
-
-
-
TemplateMiddle ::
-
}
TemplateCharacters opt ${
-
-
-
-
TemplateTail ::
-
}
TemplateCharacters opt `
-
-
-
-
TemplateCharacters ::
-
TemplateCharacter TemplateCharacters opt
-
-
-
-
TemplateCharacter ::
-
$
[lookahead ≠ { ]
-
\
EscapeSequence
-
LineContinuation
-
LineTerminatorSequence
-
SourceCharacter but not one of `
or \
or $
or LineTerminator
-
-
-
A conforming implementation must not use the extended definition of EscapeSequence described in
- B.1.2 when parsing a TemplateCharacter .
-
-
-
NOTE TemplateSubstitutionTail is used by the InputElementTemplateTail
- alternative lexical goal.
-
-
-
-
- 11.8.6.1 Static Semantics: TV’s and TRV’s
-
- A template literal component is interpreted as a sequence of Unicode code points. The Template Value (TV) of a literal
- component is described in terms of code unit values (SV, 11.8.4 ) contributed
- by the various parts of the template literal component. As part of this process, some Unicode code points within the
- template component are interpreted as having a mathematical value (MV, 11.8.3 ). In determining a TV, escape sequences are replaced by the UTF-16 code
- unit(s) of the Unicode code point represented by the escape sequence. The Template Raw Value (TRV) is similar to a
- Template Value with the difference that in TRVs escape sequences are interpreted literally.
-
-
-
- The TV and TRV of NoSubstitutionTemplate ::
- ``
is the empty code unit sequence.
-
-
-
- The TV and TRV of TemplateHead :: `${
is the empty code unit sequence.
-
-
-
- The TV and TRV of TemplateMiddle :: }${
is the empty code unit sequence.
-
-
-
- The TV and TRV of TemplateTail :: }`
is the empty code unit sequence.
-
-
-
- The TV of NoSubstitutionTemplate :: `
TemplateCharacters `
is the TV of
- TemplateCharacters .
-
-
-
- The TV of TemplateHead :: `
TemplateCharacters ${
is the TV of
- TemplateCharacters .
-
-
-
- The TV of TemplateMiddle :: }
TemplateCharacters ${
is the TV of
- TemplateCharacters .
-
-
-
- The TV of TemplateTail :: }
TemplateCharacters `
is the TV of
- TemplateCharacters .
-
-
-
- The TV of TemplateCharacters :: TemplateCharacter is the TV of TemplateCharacter .
-
-
-
- The TV of TemplateCharacters :: TemplateCharacter TemplateCharacters is a sequence consisting of the
- code units in the TV of TemplateCharacter followed by all the code units in the TV of TemplateCharacters
- in order.
-
-
-
- The TV of TemplateCharacter :: SourceCharacter but not one of `
or \
or $
or LineTerminator is the UTF16Encoding (10.1.1 ) of the code point value of
- SourceCharacter .
-
-
-
- The TV of TemplateCharacter :: $
is the code unit value 0x0024.
-
-
-
- The TV of TemplateCharacter :: \
EscapeSequence is the SV of EscapeSequence .
-
-
-
- The TV of TemplateCharacter :: LineContinuation is the TV of LineContinuation .
-
-
-
- The TV of TemplateCharacter :: LineTerminatorSequence is the TRV of LineTerminatorSequence .
-
-
-
- The TV of LineContinuation :: \
LineTerminatorSequence is the empty code unit sequence.
-
-
-
- The TRV of NoSubstitutionTemplate :: `
TemplateCharacters `
is the TRV of
- TemplateCharacters .
-
-
-
- The TRV of TemplateHead :: `
TemplateCharacters ${
is the TRV of
- TemplateCharacters .
-
-
-
- The TRV of TemplateMiddle :: }
TemplateCharacters ${
is the TRV of
- TemplateCharacters .
-
-
-
- The TRV of TemplateTail :: }
TemplateCharacters `
is the TRV of
- TemplateCharacters .
-
-
-
- The TRV of TemplateCharacters :: TemplateCharacter is the TRV of TemplateCharacter .
-
-
-
- The TRV of TemplateCharacters :: TemplateCharacter TemplateCharacters is a sequence consisting of the
- code units in the TRV of TemplateCharacter followed by all the code units in the TRV of
- TemplateCharacters, in order.
-
-
-
- The TRV of TemplateCharacter :: SourceCharacter but not one of `
or \
or $
or LineTerminator is the UTF16Encoding (10.1.1 ) of the code point value of
- SourceCharacter .
-
-
-
- The TRV of TemplateCharacter :: $
is the code unit value 0x0024.
-
-
-
- The TRV of TemplateCharacter :: \
EscapeSequence is the sequence consisting of the code unit value
- 0x005C followed by the code units of TRV of EscapeSequence .
-
-
-
- The TRV of TemplateCharacter :: LineContinuation is the TRV of LineContinuation .
-
-
-
- The TRV of TemplateCharacter :: LineTerminatorSequence is the TRV of LineTerminatorSequence .
-
-
-
- The TRV of EscapeSequence :: CharacterEscapeSequence is the TRV of the CharacterEscapeSequence .
-
-
-
- The TRV of EscapeSequence :: 0
is the code unit value 0x0030.
-
-
-
- The TRV of EscapeSequence :: HexEscapeSequence is the TRV of the HexEscapeSequence .
-
-
-
- The TRV of EscapeSequence :: UnicodeEscapeSequence is the TRV of the UnicodeEscapeSequence .
-
-
-
- The TRV of CharacterEscapeSequence :: SingleEscapeCharacter is the TRV of the SingleEscapeCharacter .
-
-
-
- The TRV of CharacterEscapeSequence :: NonEscapeCharacter is the SV of the NonEscapeCharacter .
-
-
-
- The TRV of SingleEscapeCharacter :: one of '
"
\
b
f
n
r
t
- v
is the SV of the SourceCharacter that is that single code point.
-
-
-
- The TRV of HexEscapeSequence :: x
HexDigit HexDigit is the sequence
- consisting of code unit value 0x0078 followed by TRV of the first HexDigit followed by the TRV of the second
- HexDigit .
-
-
-
- The TRV of UnicodeEscapeSequence :: u
Hex4Digits is the sequence consisting of code unit value 0x0075
- followed by TRV of Hex4Digits .
-
-
-
- The TRV of UnicodeEscapeSequence :: u{
HexDigits }
is the sequence consisting of
- code unit value 0x0075 followed by code unit value 0x007B followed by TRV of HexDigits followed by code unit
- value 0x007D.
-
-
-
- The TRV of Hex4Digits :: HexDigit HexDigit HexDigit HexDigit is the sequence consisting of the TRV of the first HexDigit followed by the
- TRV of the second HexDigit followed by the TRV of the third HexDigit followed by the TRV of the fourth
- HexDigit .
-
-
-
- The TRV of HexDigits :: HexDigit is the TRV of HexDigit .
-
-
-
- The TRV of HexDigits :: HexDigits HexDigit is the sequence consisting of TRV of
- HexDigits followed by TRV of HexDigit .
-
-
-
- The TRV of a HexDigit is the SV of the SourceCharacter that is that HexDigit .
-
-
-
- The TRV of LineContinuation :: \
LineTerminatorSequence is the sequence consisting of the code unit
- value 0x005C followed by the code units of TRV of LineTerminatorSequence .
-
-
-
- The TRV of LineTerminatorSequence ::
- <LF> is the code unit value 0x000A.
-
-
-
- The TRV of LineTerminatorSequence ::
- <CR> is the code unit value 0x000A.
-
-
-
- The TRV of LineTerminatorSequence ::
- <LS> is the code unit value 0x2028.
-
-
-
- The TRV of LineTerminatorSequence ::
- <PS> is the code unit value 0x2029.
-
-
-
- The TRV of LineTerminatorSequence ::
- <CR><LF> is the sequence consisting of the code unit value 0x000A.
-
-
-
-
-
NOTE TV excludes the code units of LineContinuation while TRV includes them.
- <CR><LF> and <CR> LineTerminatorSequences are normalized to <LF> for both TV and TRV. An
- explicit EscapeSequence is needed to include a <CR> or <CR><LF> sequence.
-
-
-
-
-
-
-
-
11.9 Automatic Semicolon Insertion
-
-
Certain ECMAScript statements (empty statement, let
, const
, import
, and
- export
declarations, variable statement, expression statement, debugger
statement,
- continue
statement, break
statement, return
statement, and throw
- statement) must be terminated with semicolons. Such semicolons may always appear explicitly in the source text. For
- convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are
- described by saying that semicolons are automatically inserted into the source code token stream in those situations.
-
-
-
- 11.9.1 Rules of Automatic Semicolon Insertion
-
- In the following rules, “token” means the actual recognized lexical token determined using the current
- lexical goal symbol as described in clause 11 .
-
- There are three basic rules of semicolon insertion:
-
-
- When, as a Script or Module is parsed from left to
- right, a token (called the offending token ) is encountered that is not allowed by any production of the
- grammar, then a semicolon is automatically inserted before the offending token if one or more of the following
- conditions is true:
-
-
- The offending token is separated from the previous token by at least one LineTerminator .
-
-
-
- The offending token is }
.
-
-
-
- The previous token is )
and the inserted semicolon would then be parsed as the terminating semicolon
- of a do-while statement (13.6.1 ).
-
-
-
- When, as the Script or Module is parsed from left to
- right, the end of the input stream of tokens is encountered and the parser is unable to parse the input token stream
- as a single complete ECMAScript Script or Module , then
- a semicolon is automatically inserted at the end of the input stream.
- When, as the Script or Module is parsed from left to
- right, a token is encountered that is allowed by some production of the grammar, but the production is a restricted
- production and the token would be the first token for a terminal or nonterminal immediately following the
- annotation “ [no LineTerminator here]” within the restricted production (and therefore such a token is
- called a restricted token), and the restricted token is separated from the previous token by at least one LineTerminator , then a semicolon is automatically inserted before the restricted token.
-
-
- However, there is an additional overriding condition on the preceding rules: a semicolon is never inserted automatically
- if the semicolon would then be parsed as an empty statement or if that semicolon would become one of the two semicolons in
- the header of a for
statement (see 13.6.3 ).
-
-
-
NOTE The following are the only restricted productions in the grammar:
-
-
-
-
PostfixExpression [Yield] :
-
LeftHandSideExpression [?Yield] [no LineTerminator here] ++
-
LeftHandSideExpression [?Yield] [no LineTerminator here] --
-
-
-
-
ContinueStatement [Yield] :
-
continue;
-
continue
[no LineTerminator here] LabelIdentifier [?Yield] ;
-
-
-
-
BreakStatement [Yield] :
-
break
;
-
break
[no LineTerminator here] LabelIdentifier [?Yield] ;
-
-
-
-
ReturnStatement [Yield] :
-
return
[no LineTerminator here] Expression ;
-
return
[no LineTerminator here] Expression [In, ?Yield] ;
-
-
-
-
ThrowStatement [Yield] :
-
throw
[no LineTerminator here] Expression [In, ?Yield] ;
-
-
-
-
ArrowFunction [In, Yield] :
-
ArrowParameters [?Yield] [no LineTerminator here] =>
ConciseBody [?In]
-
-
-
-
YieldExpression [In] :
-
yield
[no LineTerminator here] *
AssignmentExpression [?In, Yield]
-
yield
[no LineTerminator here] AssignmentExpression [?In, Yield]
-
-
- The practical effect of these restricted productions is as follows:
-
- When a ++
or --
token is encountered where the parser would treat it as a postfix operator, and
- at least one LineTerminator occurred between the preceding token and the ++
or
- --
token, then a semicolon is automatically inserted before the ++
or --
token.
-
- When a continue
, break
, return
, throw
, or yield
token is
- encountered and a LineTerminator is encountered before the next token, a semicolon is automatically
- inserted after the continue
, break
, return
, throw
, or yield
- token.
-
- The resulting practical advice to ECMAScript programmers is:
-
- A postfix ++
or --
operator should appear on the same line as its operand.
-
- An Expression in a return
or throw
statement or an AssignmentExpression in a yield
expression should start on the same line as the
- return
, throw
, or yield
token.
-
- An IdentifierReference in a break
or continue
statement should be on
- the same line as the break
or continue
token.
-
-
-
- 11.9.2 Examples of Automatic Semicolon Insertion
-
- The source
-
- { 1 2 } 3
-
- is not a valid sentence in the ECMAScript grammar, even with the automatic
- semicolon insertion rules. In contrast, the source
-
- { 1 2 } 3
-
- is also not a valid ECMAScript sentence, but is transformed by automatic
- semicolon insertion into the following:
-
- { 1 ;2 ;} 3;
-
- which is a valid ECMAScript sentence.
-
- The source
-
- for (a; b )
-
- is not a valid ECMAScript sentence and is not altered by automatic semicolon
- insertion because the semicolon is needed for the header of a for
statement. Automatic semicolon insertion
- never inserts one of the two semicolons in the header of a for
statement.
-
- The source
-
- return a + b
-
- is transformed by automatic semicolon insertion into the following:
-
- return; a + b;
-
-
-
NOTE The expression a + b
is not treated as a value to be returned by the
- return
statement, because a LineTerminator separates it from the token return
.
-
-
- The source
-
- a = b ++c
-
- is transformed by automatic semicolon insertion into the following:
-
- a = b; ++c;
-
-
-
NOTE The token ++
is not treated as a postfix operator applying to the variable
- b
, because a LineTerminator occurs between b
and ++
.
-
-
- The source
-
- if (a > b) else c = d
-
- is not a valid ECMAScript sentence and is not altered by automatic semicolon
- insertion before the else
token, even though no production of the grammar applies at that point, because an
- automatically inserted semicolon would then be parsed as an empty statement.
-
- The source
-
- a = b + c (d + e).print()
-
- is not transformed by automatic semicolon insertion , because the
- parenthesized expression that begins the second line can be interpreted as an argument list for a function call:
-
- a = b + c(d + e).print()
-
- In the circumstance that an assignment statement must begin with a left parenthesis, it is a good idea for the programmer
- to provide an explicit semicolon at the end of the preceding statement rather than to rely on automatic semicolon insertion .
-
-
-
-
-
-
-
12
- ECMAScript Language: Expressions
-
-
-
-
-
12.1
- Identifiers
-
-
Syntax
-
-
-
IdentifierReference [Yield] :
-
Identifier
-
[~Yield] yield
-
-
-
BindingIdentifier [Yield] :
-
-
Identifier [~Yield] yield
-
-
-
LabelIdentifier [Yield] :
-
Identifier
-
[~Yield] yield
-
-
-
-
Identifier :
-
IdentifierName but not ReservedWord
-
-
-
-
- 12.1.1 Static Semantics: Early Errors
- BindingIdentifier : Identifier
-
-
- IdentifierReference : yield
-
- BindingIdentifier : yield
-
- LabelIdentifier : yield
-
-
- IdentifierReference [Yield] : Identifier
-
- BindingIdentifier [Yield] : Identifier
-
- LabelIdentifier [Yield] : Identifier
-
-
- Identifier : IdentifierName but not ReservedWord
-
-
- It is a Syntax Error if this phrase is contained in strict mode code and the
- StringValue of IdentifierName is: "implements"
, "interface"
,
- "let"
, "package"
, "private"
, "protected"
, "public"
,
- "static"
, or "yield"
.
-
-
-
- It is a Syntax Error if StringValue of IdentifierName is the same string value as the
- StringValue of any ReservedWord except for yield
.
-
-
-
-
-
NOTE StringValue of IdentifierName
- normalizes any Unicode escape sequences in IdentifierName hence such escapes cannot be used to write an
- Identifier whose code point sequence is the same as a ReservedWord .
-
-
-
-
-
-
- 12.1.3 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.2.0.4 , 12.2.9.3 , 12.3.1.5 , 12.4.3 , 12.5.3 , 12.6.2 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
- IdentifierReference : Identifier
-
- If this IdentifierReference is contained in strict mode code and
- StringValue of Identifier is "eval"
or "arguments"
, return false .
- Return true .
-
- IdentifierReference : yield
-
- Return true .
-
-
-
-
- 12.1.4 Static Semantics:
- StringValue
-
- See also: 11.6.1.2 , 11.8.4.2 .
-
- IdentifierReference : yield
-
- BindingIdentifier : yield
-
- LabelIdentifier : yield
-
- Return "yield"
.
-
- Identifier : IdentifierName but not ReservedWord
-
- Return the StringValue of IdentifierName .
-
-
-
-
-
-
12.1.5 Runtime Semantics: BindingInitialization
-
-
With arguments value and environment .
-
-
See also: 13.2.3.5 , 13.6.4.9 .
-
-
-
NOTE undefined is passed for environment to indicate that a PutValue operation should be used to assign the initialization value. This is the case for
- var
statements and formal parameter lists of some non-strict functions (See 9.2.12 ). In those cases a lexical binding is hoisted and preinitialized
- prior to evaluation of its initializer.
-
-
-
BindingIdentifier : Identifier
-
- Let name be StringValue of Identifier .
- Return InitializeBoundName ( name , value ,
- environment ).
-
-
BindingIdentifier : yield
-
- Return InitializeBoundName ("yield"
, value ,
- environment ).
-
-
-
-
- 12.1.5.1 Runtime Semantics: InitializeBoundName(name, value, environment)
-
- Assert : Type (name ) is String.
- If environment is not undefined , then
-
- Let env be the EnvironmentRecord component of environment .
- Perform env .InitializeBinding(name , value ).
- Return NormalCompletion (undefined ).
-
-
- Else
-
- Let lhs be ResolveBinding (name ).
- Return PutValue (lhs , value ).
-
-
-
-
-
-
-
- 12.1.6 Runtime Semantics: Evaluation
- IdentifierReference : Identifier
-
- Return ResolveBinding (StringValue of Identifier ).
-
- IdentifierReference : yield
-
- Return ResolveBinding ("yield"
).
-
-
-
-
NOTE 1: The result of evaluating an IdentifierReference is always a value of type Reference .
-
-
-
-
NOTE 2: In non-strict code , the keyword yield
- may be used as an identifier. Evaluating the IdentifierReference production resolves the binding of
- yield
as if it was an Identifier . Early Error restriction ensures that such an evaluation only can
- occur for non-strict code . See 13.2.1
- for the handling of yield
in binding creation contexts.
-
-
-
-
-
-
-
12.2
- Primary Expression
-
Syntax
-
-
-
PrimaryExpression [Yield] :
-
this
-
IdentifierReference [?Yield]
-
Literal
-
ArrayLiteral [?Yield]
-
ObjectLiteral [?Yield]
-
FunctionExpression
-
ClassExpression
-
GeneratorExpression
-
RegularExpressionLiteral
-
TemplateLiteral [?Yield]
-
CoverParenthesizedExpressionAndArrowParameterList [?Yield]
-
-
-
-
CoverParenthesizedExpressionAndArrowParameterList [Yield] :
-
(
Expression [In, ?Yield] )
-
(
)
-
(
...
BindingIdentifier [?Yield] )
-
(
Expression [In, ?Yield] ,
...
BindingIdentifier [?Yield] )
-
-
-
Supplemental Syntax
-
-
When processing the production
-
-
PrimaryExpression [Yield] : CoverParenthesizedExpressionAndArrowParameterList [?Yield] the interpretation of CoverParenthesizedExpressionAndArrowParameterList is
- refined using the following grammar:
-
-
-
ParenthesizedExpression [Yield] :
-
(
Expression [In, ?Yield] )
-
-
-
-
-
-
-
- 12.2.0.1 Static Semantics: CoveredParenthesizedExpression
- CoverParenthesizedExpressionAndArrowParameterList [Yield] : (
Expression [In, ?Yield] )
-
- Return the result of parsing the lexical token stream matched by
- CoverParenthesizedExpressionAndArrowParameterList [Yield] using either
- ParenthesizedExpression or ParenthesizedExpression [Yield] as the goal symbol depending upon
- whether the [Yield] grammar parameter was present when
- CoverParenthesizedExpressionAndArrowParameterList was matched.
-
-
-
-
- 12.2.0.2 Static Semantics: IsFunctionDefinition
-
- See also: 12.2.9.2 , 12.3.1.2 , 12.4.2 , 12.5.2 , 12.6.1 , 12.7.1 , 12.8.1 , 12.9.1 , 12.10.1 , 12.11.1 , 12.12.1 , 12.13.1 , 12.14.2 , 12.15.1 , 14.1.11 , 14.4.9 , 14.5.8 .
-
-
-
PrimaryExpression :
-
this
-
IdentifierReference
-
Literal
-
ArrayLiteral
-
ObjectLiteral
-
RegularExpressionLiteral
-
TemplateLiteral
-
-
-
- Return false .
-
- PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
-
- Let expr be CoveredParenthesizedExpression of CoverParenthesizedExpressionAndArrowParameterList .
- Return IsFunctionDefinition of expr .
-
-
-
-
- 12.2.0.3 Static Semantics: IsIdentifierRef
-
- See also: 12.3.1.4 .
-
-
-
PrimaryExpression :
-
IdentifierReference
-
-
-
- Return true .
-
-
-
-
PrimaryExpression :
-
this
-
Literal
-
ArrayLiteral
-
ObjectLiteral
-
FunctionExpression
-
ClassExpression
-
GeneratorExpression
-
RegularExpressionLiteral
-
TemplateLiteral
-
CoverParenthesizedExpressionAndArrowParameterList
-
-
-
- Return false .
-
-
-
-
- 12.2.0.4 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.1.3 , 12.2.9.3 , 12.3.1.5 , 12.4.3 , 12.5.3 , 12.6.2 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
-
-
PrimaryExpression :
-
this
-
Literal
-
ArrayLiteral
-
ObjectLiteral
-
FunctionExpression
-
ClassExpression
-
GeneratorExpression
-
RegularExpressionLiteral
-
TemplateLiteral
-
-
-
- Return false .
-
- PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
-
- Let expr be CoveredParenthesizedExpression of CoverParenthesizedExpressionAndArrowParameterList .
- Return IsValidSimpleAssignmentTarget of expr .
-
-
-
-
-
-
-
- 12.2.2
- Identifier Reference
-
- See 12.1 for IdentifierReference .
-
-
-
-
-
-
Syntax
-
-
-
Literal :
-
NullLiteral
-
BooleanLiteral
-
NumericLiteral
-
StringLiteral
-
-
-
-
- 12.2.3.1 Runtime Semantics: Evaluation
- Literal : NullLiteral
-
- Return null .
-
- Literal : BooleanLiteral
-
- Return false if BooleanLiteral is the token false
.
- Return true if BooleanLiteral is the token true
.
-
- Literal : NumericLiteral
-
- Return the number whose value is MV of NumericLiteral as defined in 11.8.3 .
-
- Literal : StringLiteral
-
- Return the StringValue of StringLiteral as defined in 11.8.4.2 .
-
-
-
-
-
-
-
12.2.4
- Array Initializer
-
-
-
NOTE An ArrayLiteral is an expression describing the initialization of an Array
- object, using a list, of zero or more expressions each of which represents an array element, enclosed in square
- brackets. The elements need not be literals; they are evaluated each time the array initializer is evaluated.
-
-
-
Array elements may be elided at the beginning, middle or end of the element list. Whenever a comma in the element list
- is not preceded by an AssignmentExpression (i.e., a comma at the beginning or after another
- comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements.
- Elided array elements are not defined. If an element is elided at the end of an array, that element does not contribute to
- the length of the Array.
-
-
Syntax
-
-
-
ArrayLiteral [Yield] :
-
[
Elision opt ]
-
[
ElementList [?Yield] ]
-
[
ElementList [?Yield] ,
Elision opt ]
-
-
-
-
ElementList [Yield] :
-
Elision opt AssignmentExpression [In, ?Yield]
-
Elision opt SpreadElement [?Yield]
-
ElementList [?Yield] ,
Elision opt AssignmentExpression [In, ?Yield]
-
ElementList [?Yield] ,
Elision opt SpreadElement [?Yield]
-
-
-
-
Elision :
-
,
-
Elision ,
-
-
-
-
SpreadElement [Yield] :
-
...
AssignmentExpression [In, ?Yield]
-
-
-
-
- 12.2.4.1 Static Semantics: ElisionWidth
- Elision : ,
-
- Return the numeric value 1.
-
- Elision : Elision ,
-
- Let preceding be the ElisionWidth of Elision .
- Return preceding +1.
-
-
-
-
- 12.2.4.2 Runtime Semantics: ArrayAccumulation
-
- With parameters array and nextIndex .
-
- ElementList : Elision opt AssignmentExpression
-
- Let padding be the ElisionWidth of Elision ; if Elision is not present, use the numeric value
- zero.
- Let initResult be the result of evaluating AssignmentExpression .
- Let initValue be GetValue (initResult ).
- ReturnIfAbrupt (initValue ).
- Let created be CreateDataProperty (array , ToString (ToUint32 (nextIndex+padding )),
- initValue ).
- Assert : created is true .
- Return nextIndex+padding+ 1.
-
- ElementList : Elision opt SpreadElement
-
- Let padding be the ElisionWidth of Elision ; if Elision is not present, use the numeric value
- zero.
- Return the result of performing ArrayAccumulation for SpreadElement with arguments array and
- nextIndex +padding .
-
- ElementList : ElementList ,
Elision opt AssignmentExpression
-
- Let postIndex be the result of performing ArrayAccumulation for ElementList with arguments
- array and nextIndex .
- ReturnIfAbrupt (postIndex ).
- Let padding be the ElisionWidth of Elision ; if Elision is not present, use the numeric value
- zero.
- Let initResult be the result of evaluating AssignmentExpression .
- Let initValue be GetValue (initResult ).
- ReturnIfAbrupt (initValue ).
- Let created be CreateDataProperty (array , ToString (ToUint32 (postIndex +padding )),
- initValue ).
- Assert : created is true .
- Return postIndex +padding+ 1.
-
- ElementList : ElementList ,
Elision opt SpreadElement
-
- Let postIndex be the result of performing ArrayAccumulation for ElementList with arguments
- array and nextIndex .
- ReturnIfAbrupt (postIndex ).
- Let padding be the ElisionWidth of Elision ; if Elision is not present, use the numeric value
- zero.
- Return the result of performing ArrayAccumulation for SpreadElement with arguments array and
- postIndex +padding .
-
- SpreadElement : ...
AssignmentExpression
-
- Let spreadRef be the result of evaluating AssignmentExpression .
- Let spreadObj be GetValue (spreadRef ).
- Let iterator be GetIterator (spreadObj ).
- ReturnIfAbrupt (iterator ).
- Repeat
-
- Let next be IteratorStep (iterator ).
- ReturnIfAbrupt (next ).
- If next is false , return nextIndex .
- Let nextValue be IteratorValue (next ).
- ReturnIfAbrupt (nextValue ).
- Let status be CreateDataProperty (array , ToString (nextIndex ), nextValue ).
- Assert : status is true .
- Let nextIndex be nextIndex + 1.
-
-
-
-
-
-
NOTE CreateDataProperty is used to ensure that own
- properties are defined for the array even if the standard built-in Array prototype object has been modified in a manner
- that would preclude the creation of new own properties using [[Set]].
-
-
-
-
- 12.2.4.3 Runtime Semantics: Evaluation
- ArrayLiteral : [
Elision opt ]
-
- Let array be ArrayCreate (0).
- Let pad be the ElisionWidth of Elision ; if Elision is not present, use the numeric value
- zero.
- Perform Set (array , "length"
, pad , false ).
- NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate .
- Return array .
-
- ArrayLiteral : [
ElementList ]
-
- Let array be ArrayCreate (0).
- Let len be the result of performing ArrayAccumulation for ElementList with arguments array and
- 0.
- ReturnIfAbrupt (len ).
- Perform Set (array , "length"
, len , false ).
- NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate .
- Return array .
-
- ArrayLiteral : [
ElementList ,
Elision opt ]
-
- Let array be ArrayCreate (0).
- Let len be the result of performing ArrayAccumulation for ElementList with arguments array and
- 0.
- ReturnIfAbrupt (len ).
- Let padding be the ElisionWidth of Elision ; if Elision is not present, use the numeric value
- zero.
- Perform Set (array , "length"
, ToUint32 (padding +len ), false ).
- NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate .
- Return array .
-
-
-
-
-
-
-
12.2.5
- Object Initializer
-
-
-
NOTE 1 An object initializer is an expression describing the initialization of an Object,
- written in a form resembling a literal. It is a list of zero or more pairs of property keys and associated values,
- enclosed in curly brackets. The values need not be literals; they are evaluated each time the object initializer is
- evaluated.
-
-
-
Syntax
-
-
-
ObjectLiteral [Yield] :
-
{
}
-
{
PropertyDefinitionList [?Yield] }
-
{
PropertyDefinitionList [?Yield] ,
}
-
-
-
-
PropertyDefinitionList [Yield] :
-
PropertyDefinition [?Yield]
-
PropertyDefinitionList [?Yield] ,
PropertyDefinition [?Yield]
-
-
-
-
PropertyDefinition [Yield] :
-
IdentifierReference [?Yield]
-
CoverInitializedName [?Yield]
-
PropertyName [?Yield] :
AssignmentExpression [In, ?Yield]
-
MethodDefinition [?Yield]
-
-
-
-
PropertyName [Yield,GeneratorParameter] :
-
LiteralPropertyName
-
[+GeneratorParameter] ComputedPropertyName
-
[~GeneratorParameter] ComputedPropertyName [?Yield]
-
-
-
-
LiteralPropertyName :
-
IdentifierName
-
StringLiteral
-
NumericLiteral
-
-
-
-
ComputedPropertyName [Yield] :
-
[
AssignmentExpression [In, ?Yield] ]
-
-
-
-
CoverInitializedName [Yield] :
-
IdentifierReference [?Yield] Initializer [In, ?Yield]
-
-
-
-
Initializer [In, Yield] :
-
=
AssignmentExpression [?In, ?Yield]
-
-
-
-
NOTE 2 MethodDefinition is defined in 14.3 .
-
-
-
-
NOTE 3 In certain contexts, ObjectLiteral is used as a cover grammar for a more
- restricted secondary grammar. The CoverInitializedName production is necessary to fully cover these secondary
- grammars. However, use of this production results in an early Syntax Error in normal contexts where an actual
- ObjectLiteral is expected.
-
-
-
-
- 12.2.5.1 Static Semantics: Early Errors
- PropertyDefinition : MethodDefinition
-
- It is a Syntax Error if HasDirectSuper of MethodDefinition is true .
-
-
- In addition to describing an actual object initializer the ObjectLiteral productions are also
- used as a cover grammar for ObjectAssignmentPattern (12.14.5 ). and may be recognized as part of a CoverParenthesizedExpressionAndArrowParameterList . When ObjectLiteral appears in
- a context where ObjectAssignmentPattern is required the following Early Error rules are not
- applied. In addition, they are not applied when initially parsing a
- CoverParenthesizedExpressionAndArrowParameterList.
-
- PropertyDefinition : CoverInitializedName
-
- Always throw a Syntax Error if code matches this production.
-
-
-
-
NOTE This production exists so that ObjectLiteral can serve as a cover grammar for
- ObjectAssignmentPattern (12.14.5 ). It cannot occur in an actual
- object initializer.
-
-
-
-
- 12.2.5.2 Static Semantics: ComputedPropertyContains
-
- With parameter symbol .
-
- See also: 14.3.2 , 14.4.3 , 14.5.5 .
-
- PropertyName : LiteralPropertyName
-
- Return false .
-
- PropertyName : ComputedPropertyName
-
- Return the result of ComputedPropertyName Contains symbol .
-
-
-
-
- 12.2.5.3 Static Semantics: Contains
-
- With parameter symbol .
-
- See also: 5.3 , 12.3.1.1 , 14.1.4 , 14.2.3 , 14.4.4 , 14.5.4 .
-
- PropertyDefinition : MethodDefinition
-
- If symbol is MethodDefinition , return true .
- Return the result of ComputedPropertyContains for MethodDefinition with argument symbol .
-
-
-
-
NOTE Static semantic rules that depend upon substructure generally do not look into function
- definitions.
-
-
- LiteralPropertyName : IdentifierName
-
- If symbol is a ReservedWord , return false .
- If symbol is an Identifier and StringValue of symbol is the same value as the StringValue of
- IdentifierName , return true ;
- Return false .
-
-
-
-
- 12.2.5.4 Static Semantics: HasComputedPropertyKey
-
- See also: 14.3.4 , 14.4.5
-
- PropertyDefinitionList : PropertyDefinitionList ,
PropertyDefinition
-
- If HasComputedPropertyKey of PropertyDefinitionList is true , return true .
- Return HasComputedPropertyKey of PropertyDefinition .
-
- PropertyDefinition : IdentifierReference
-
- Return false .
-
- PropertyDefinition : PropertyName :
AssignmentExpression
-
- Return IsComputedPropertyKey of PropertyName .
-
-
-
-
- 12.2.5.5 Static Semantics: IsComputedPropertyKey
- PropertyName : LiteralPropertyName
-
- Return false .
-
- PropertyName : ComputedPropertyName
-
- Return true .
-
-
-
-
- 12.2.5.6 Static Semantics: PropName
-
- See also: 14.3.6 , 14.4.10 , 14.5.12
-
- PropertyDefinition : IdentifierReference
-
- Return StringValue of IdentifierReference .
-
- PropertyDefinition : PropertyName :
AssignmentExpression
-
- Return PropName of PropertyName .
-
- LiteralPropertyName : IdentifierName
-
- Return StringValue of IdentifierName .
-
- LiteralPropertyName : StringLiteral
-
- Return a String value whose code units are the SV of the StringLiteral .
-
- LiteralPropertyName : NumericLiteral
-
- Let nbr be the result of forming the value of the NumericLiteral .
- Return ToString (nbr ).
-
- ComputedPropertyName : [
AssignmentExpression ]
-
- Return empty .
-
-
-
-
- 12.2.5.7 Static Semantics: PropertyNameList
- PropertyDefinitionList : PropertyDefinition
-
- If PropName of PropertyDefinition is empty , return a new empty
- List .
- Return a new List containing PropName of
- PropertyDefinition .
-
- PropertyDefinitionList : PropertyDefinitionList ,
PropertyDefinition
-
- Let list be PropertyNameList of PropertyDefinitionList.
- If PropName of PropertyDefinition is empty , return
- list .
- Append PropName of PropertyDefinition to the end of list .
- Return list .
-
-
-
-
- 12.2.5.8 Runtime Semantics: Evaluation
- ObjectLiteral : {
}
-
- Return ObjectCreate (%ObjectPrototype% ).
-
-
- ObjectLiteral : {
PropertyDefinitionList }
{
PropertyDefinitionList ,
- }
-
-
- Let obj be ObjectCreate (%ObjectPrototype%).
- Let status be the result of performing PropertyDefinitionEvaluation of PropertyDefinitionList with
- arguments obj and true .
- ReturnIfAbrupt (status ).
- Return obj .
-
- LiteralPropertyName : IdentifierName
-
- Return StringValue of IdentifierName .
-
- LiteralPropertyName : StringLiteral
-
- Return a String value whose code units are the SV of the StringLiteral .
-
- LiteralPropertyName : NumericLiteral
-
- Let nbr be the result of forming the value of the NumericLiteral .
- Return ToString (nbr ).
-
- ComputedPropertyName : [
AssignmentExpression ]
-
- Let exprValue be the result of evaluating AssignmentExpression .
- Let propName be GetValue (exprValue ).
- ReturnIfAbrupt (propName ).
- Return ToPropertyKey (propName ).
-
-
-
-
- 12.2.5.9 Runtime Semantics: PropertyDefinitionEvaluation
-
- With parameter object and enumerable .
-
- See also: 14.3.9 , 14.4.13 , B.3.1
-
- PropertyDefinitionList : PropertyDefinitionList ,
PropertyDefinition
-
- Let status be the result of performing PropertyDefinitionEvaluation of PropertyDefinitionList with
- arguments object and enumerable .
- ReturnIfAbrupt (status ).
- Return the result of performing PropertyDefinitionEvaluation of PropertyDefinition with arguments
- object and enumerable .
-
- PropertyDefinition : IdentifierReference
-
- Let propName be StringValue of IdentifierReference .
- Let exprValue be the result of evaluating IdentifierReference .
- ReturnIfAbrupt (exprValue ).
- Let propValue be GetValue (exprValue ).
- ReturnIfAbrupt (propValue ).
- Assert : enumerable is true .
- Return CreateDataPropertyOrThrow (object , propName ,
- propValue ).
-
- PropertyDefinition : PropertyName :
AssignmentExpression
-
- Let propKey be the result of evaluating PropertyName .
- ReturnIfAbrupt (propKey ).
- Let exprValueRef be the result of evaluating AssignmentExpression .
- Let propValue be GetValue (exprValueRef ).
- ReturnIfAbrupt (propValue ).
- If IsAnonymousFunctionDefinition (AssignmentExpression) is
- true , then
-
- Let hasNameProperty be HasOwnProperty (propValue ,
- "name"
).
- ReturnIfAbrupt (hasNameProperty ).
- If hasNameProperty is false , perform SetFunctionName (propValue , propKey ).
-
-
- Assert : enumerable is true .
- Return CreateDataPropertyOrThrow (object , propKey ,
- propValue ).
-
-
- NOTE An alternative semantics for this production is given in B.3.1 .
-
-
-
-
- 12.2.6 Function Defining Expressions
-
- See 14.1 for PrimaryExpression : FunctionExpression .
-
- See 14.4 for PrimaryExpression : GeneratorExpression .
-
- See 14.5 for PrimaryExpression : ClassExpression .
-
-
-
-
-
12.2.7 Regular Expression Literals
-
Syntax
-
-
See 11.8.4 .
-
-
-
- 12.2.7.1 Static Semantics: Early Errors
- PrimaryExpression : RegularExpressionLiteral
-
-
- It is a Syntax Error if BodyText of RegularExpressionLiteral cannot be recognized using the goal symbol Pattern
- of the ECMAScript RegExp grammar specified in 21.2.1 .
-
-
-
- It is a Syntax Error if FlagText of RegularExpressionLiteral contains any code points other than "g"
, "i"
,
- "m"
, "u"
, or "y"
, or if it contains the same code point more than once.
-
-
-
-
-
- 12.2.7.2 Runtime Semantics: Evaluation
- PrimaryExpression : RegularExpressionLiteral
-
- Let pattern be the string value consisting of the UTF16Encoding of each code
- point of BodyText of RegularExpressionLiteral .
- Let flags be the string value consisting of the UTF16Encoding of each code
- point of FlagText of RegularExpressionLiteral .
- Return RegExpCreate (pattern , flags ).
-
-
-
-
-
-
-
12.2.8
- Template Literals
-
Syntax
-
-
-
TemplateLiteral [Yield] :
-
NoSubstitutionTemplate
-
TemplateHead Expression [In, ?Yield] TemplateSpans [?Yield]
-
-
-
-
TemplateSpans [Yield] :
-
TemplateTail
-
TemplateMiddleList [?Yield] TemplateTail
-
-
-
-
TemplateMiddleList [Yield] :
-
TemplateMiddle Expression [In, ?Yield]
-
TemplateMiddleList [?Yield] TemplateMiddle Expression [In, ?Yield]
-
-
-
-
- 12.2.8.1 Static Semantics: TemplateStrings
-
- With parameter raw .
-
- TemplateLiteral : NoSubstitutionTemplate
-
- If raw is false , then
-
- Let string be the TV of NoSubstitutionTemplate .
-
-
- Else,
-
- Let string be the TRV of NoSubstitutionTemplate .
-
-
- Return a List containing the single element,
- string .
-
- TemplateLiteral : TemplateHead Expression TemplateSpans
-
- If raw is false , then
-
- Let head be the TV of TemplateHead .
-
-
- Else,
-
- Let head be the TRV of TemplateHead .
-
-
- Let tail be TemplateStrings of TemplateSpans with argument raw .
- Return a List containing head followed by the element,
- in order of tail .
-
- TemplateSpans : TemplateTail
-
- If raw is false , then
-
- Let tail be the TV of TemplateTail .
-
-
- Else,
-
- Let tail be the TRV of TemplateTail .
-
-
- Return a List containing the single element, tail .
-
- TemplateSpans : TemplateMiddleList TemplateTail
-
- Let middle be TemplateStrings of TemplateMiddleList with argument raw .
- If raw is false , then
-
- Let tail be the TV of TemplateTail .
-
-
- Else,
-
- Let tail be the TRV of TemplateTail .
-
-
- Return a List containing the elements, in order, of
- middle followed by tail .
-
- TemplateMiddleList : TemplateMiddle Expression
-
- If raw is false , then
-
- Let string be the TV of TemplateMiddle .
-
-
- Else,
-
- Let string be the TRV of TemplateMiddle .
-
-
- Return a List containing the single element,
- string .
-
- TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression
-
- Let front be TemplateStrings of TemplateMiddleList with argument raw .
- If raw is false , then
-
- Let last be the TV of TemplateMiddle .
-
-
- Else,
-
- Let last be the TRV of TemplateMiddle .
-
-
- Append last as the last element of the List
- front .
- Return front .
-
-
-
-
- 12.2.8.2 Runtime Semantics:
- ArgumentListEvaluation
-
- See also: 12.3.6.1
-
- TemplateLiteral : NoSubstitutionTemplate
-
- Let templateLiteral be this TemplateLiteral.
- Let siteObj be GetTemplateObject (templateLiteral ).
- Return a List containing the one element which is
- siteObj .
-
- TemplateLiteral : TemplateHead Expression TemplateSpans
-
- Let templateLiteral be this TemplateLiteral.
- Let siteObj be GetTemplateObject (templateLiteral ).
- Let firstSub be the result of evaluating Expression .
- ReturnIfAbrupt (firstSub ).
- Let restSub be SubstitutionEvaluation of TemplateSpans .
- ReturnIfAbrupt (restSub ).
- Assert : restSub is a List .
- Return a List whose first element is siteObj , whose
- second elements is firstSub , and whose subsequent elements are the elements of restSub , in order.
- restSub may contain no elements.
-
-
-
-
- 12.2.8.3 Runtime Semantics: GetTemplateObject ( templateLiteral )
-
- The abstract operation GetTemplateObject is called with a grammar
- production, templateLiteral , as an argument. It performs the following steps:
-
-
- Let rawStrings be TemplateStrings of templateLiteral with argument true .
- Let ctx be the running execution context .
- Let realm be the ctx ’s Realm .
- Let templateRegistry be realm .[[templateMap]].
- For each element e of templateRegistry , do
-
- If e .[[strings]] and rawStrings contain the same values in the same order, then
-
- Return e. [[array]].
-
-
-
-
- Let cookedStrings be TemplateStrings of templateLiteral with argument false .
- Let count be the number of elements in the List
- cookedStrings .
- Let template be ArrayCreate (count ).
- Let rawObj be ArrayCreate (count ).
- Let index be 0.
- Repeat while index < count
-
- Let prop be ToString (index ).
- Let cookedValue be the string value cookedStrings [index ].
- Call template .[[DefineOwnProperty]](prop , PropertyDescriptor{[[Value]]:
- cookedValue , [[Enumerable]]: true , [[Writable]]: false , [[Configurable]]:
- false }).
- Let rawValue be the string value rawStrings [index ].
- Call rawObj .[[DefineOwnProperty]](prop , PropertyDescriptor{[[Value]]:
- rawValue , [[Enumerable]]: true , [[Writable]]: false , [[Configurable]]:
- false }).
- Let index be index +1.
-
-
- Perform SetIntegrityLevel (rawObj , "frozen"
).
- Call template .[[DefineOwnProperty]]("raw"
, PropertyDescriptor{[[Value]]:
- rawObj , [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]:
- false }).
- Perform SetIntegrityLevel (template , "frozen"
).
- Append the Record{[[strings]]: rawStrings , [[array]]: template } to templateRegistry .
- Return template .
-
-
-
-
-
-
NOTE 2 Each TemplateLiteral in the program code of a Realm is associated with a unique template object that is used in the evaluation of tagged
- Templates (12.2.8.5 ). The template objects are frozen
- and the same template object is used each time a specific tagged Template is evaluated. Whether template objects are
- created lazily upon first evaluation of the TemplateLiteral or eagerly prior to first evaluation is an
- implementation choice that is not observable to ECMAScript code.
-
-
-
-
NOTE 3 Future editions of this specification may define additional non-enumerable properties
- of template objects.
-
-
-
-
- 12.2.8.4 Runtime Semantics: SubstitutionEvaluation
- TemplateSpans : TemplateTail
-
- Return an empty List .
-
- TemplateSpans : TemplateMiddleList TemplateTail
-
- Return the result of SubstitutionEvaluation of TemplateMiddleList .
-
- TemplateMiddleList : TemplateMiddle Expression
-
- Let sub be the result of evaluating Expression .
- ReturnIfAbrupt (sub ).
- Return a List containing only sub .
-
- TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression
-
- Let preceding be the result of SubstitutionEvaluation of TemplateMiddleList .
- ReturnIfAbrupt (preceding ).
- Let next be the result of evaluating Expression .
- ReturnIfAbrupt (next ).
- Append next as the last element of the List
- preceding .
- Return preceding .
-
-
-
-
- 12.2.8.5 Runtime Semantics: Evaluation
- TemplateLiteral : NoSubstitutionTemplate
-
- Return the string value whose code units are the elements of the TV of NoSubstitutionTemplate as defined in
- 11.8.6 .
-
- TemplateLiteral : TemplateHead Expression TemplateSpans
-
- Let head be the TV of TemplateHead as defined in 11.8.6 .
- Let sub be the result of evaluating Expression .
- Let middle be ToString (sub ).
- ReturnIfAbrupt (middle ).
- Let tail be the result of evaluating TemplateSpans .
- ReturnIfAbrupt (tail ).
- Return the string value whose code units are the elements of head followed by the elements of middle
- followed by the elements of tail .
-
-
-
-
NOTE The string conversion semantics applied to the Expression value are like String.prototype.concat
rather than the +
operator.
-
-
- TemplateSpans : TemplateTail
-
- Let tail be the TV of TemplateTail as defined in 11.8.6 .
- Return the string consisting of the code units of tail .
-
- TemplateSpans : TemplateMiddleList TemplateTail
-
- Let head be the result of evaluating TemplateMiddleList .
- ReturnIfAbrupt (head ).
- Let tail be the TV of TemplateTail as defined in 11.8.6 .
- Return the string whose code units are the elements of head followed by the elements of tail .
-
- TemplateMiddleList : TemplateMiddle Expression
-
- Let head be the TV of TemplateMiddle as defined in 11.8.6 .
- Let sub be the result of evaluating Expression .
- Let middle be ToString (sub ).
- ReturnIfAbrupt (middle ).
- Return the sequence of code units consisting of the code units of head followed by the elements of
- middle .
-
-
-
-
NOTE The string conversion semantics applied to the Expression value are like String.prototype.concat
rather than the +
operator.
-
-
- TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression
-
- Let rest be the result of evaluating TemplateMiddleList .
- ReturnIfAbrupt (rest ).
- Let middle be the TV of TemplateMiddle as defined in 11.8.6 .
- Let sub be the result of evaluating Expression .
- Let last be ToString (sub ).
- ReturnIfAbrupt (last ).
- Return the sequence of code units consisting of the elements of rest followed by the code units of
- middle followed by the elements of last .
-
-
-
-
NOTE The string conversion semantics applied to the Expression value are like String.prototype.concat
rather than the +
operator.
-
-
-
-
-
-
-
12.2.9
- The Grouping Operator
-
-
-
- 12.2.9.1 Static Semantics: Early Errors
- PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
-
-
- It is a Syntax Error if the lexical token sequence matched by CoverParenthesizedExpressionAndArrowParameterList cannot be parsed with no tokens left over using
- ParenthesizedExpression as the goal symbol.
-
-
-
- All Early Errors rules for ParenthesizedExpression and its derived productions also apply
- to CoveredParenthesizedExpression of CoverParenthesizedExpressionAndArrowParameterList .
-
-
-
-
-
- 12.2.9.2 Static Semantics: IsFunctionDefinition
-
- See also: 12.2.0.2 , 12.3.1.2 , 12.4.2 , 12.5.2 , 12.6.1 , 12.7.1 , 12.8.1 , 12.9.1 , 12.10.1 , 12.11.1 , 12.12.1 , 12.13.1 , 12.14.2 , 12.15.1 , 14.1.11 , 14.4.9 , 14.5.8 .
-
- ParenthesizedExpression : (
Expression )
-
- Return IsFunctionDefinition of Expression .
-
-
-
-
- 12.2.9.3 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.1.3 , 12.2.0.4 , 12.3.1.5 , 12.4.3 , 12.5.3 , 12.6.2 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
- ParenthesizedExpression : (
Expression )
-
- Return IsValidSimpleAssignmentTarget of Expression .
-
-
-
-
- 12.2.9.4 Runtime Semantics: Evaluation
- PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
-
- Let expr be CoveredParenthesizedExpression of CoverParenthesizedExpressionAndArrowParameterList .
- Return the result of evaluating expr .
-
- ParenthesizedExpression : (
Expression )
-
- Return the result of evaluating Expression . This may be of type Reference .
-
-
-
-
NOTE This algorithm does not apply GetValue to the result of
- evaluating Expression . The principal motivation for this is so that operators such as delete
and
- typeof
may be applied to parenthesized expressions.
-
-
-
-
-
-
-
-
12.3 Left-Hand-Side Expressions
-
Syntax
-
-
-
MemberExpression [Yield] :
-
PrimaryExpression [?Yield]
-
MemberExpression [?Yield] [
Expression [In, ?Yield] ]
-
MemberExpression [?Yield] .
IdentifierName
-
MemberExpression [?Yield] TemplateLiteral [?Yield]
-
SuperProperty [?Yield]
-
MetaProperty
-
new
MemberExpression [?Yield] Arguments [?Yield]
-
-
-
-
SuperProperty [Yield] :
-
super
[
Expression [In, ?Yield] ]
-
super
.
IdentifierName
-
-
-
-
MetaProperty :
-
NewTarget
-
-
-
-
NewTarget :
-
new
.
target
-
-
-
-
NewExpression [Yield] :
-
MemberExpression [?Yield]
-
new
NewExpression [?Yield]
-
-
-
-
CallExpression [Yield] :
-
MemberExpression [?Yield] Arguments [?Yield]
-
SuperCall [?Yield]
-
CallExpression [?Yield] Arguments [?Yield]
-
CallExpression [?Yield] [
Expression [In, ?Yield] ]
-
CallExpression [?Yield] .
IdentifierName
-
CallExpression [?Yield] TemplateLiteral [?Yield]
-
-
-
-
SuperCall [Yield] :
-
super
Arguments [?Yield]
-
-
-
-
Arguments [Yield] :
-
(
)
-
(
ArgumentList [?Yield] )
-
-
-
-
ArgumentList [Yield] :
-
AssignmentExpression [In, ?Yield]
-
...
AssignmentExpression [In, ?Yield]
-
ArgumentList [?Yield] ,
AssignmentExpression [In, ?Yield]
-
ArgumentList [?Yield] ,
...
AssignmentExpression [In, ?Yield]
-
-
-
-
LeftHandSideExpression [Yield] :
-
NewExpression [?Yield]
-
CallExpression [?Yield]
-
-
-
-
-
-
-
- 12.3.1.1 Static Semantics: Contains
-
- With parameter symbol .
-
- See also: 5.3 , 12.2.5.3 , 14.1.4 , 14.2.3 , 14.4.4 , 14.5.4
-
- MemberExpression : MemberExpression .
IdentifierName
-
- If MemberExpression Contains symbol is true , return true .
- If symbol is a ReservedWord , return false .
- If symbol is an Identifier and StringValue of symbol is the same value as the StringValue of
- IdentifierName , return true ;
- Return false .
-
- SuperProperty : super
.
IdentifierName
-
- If symbol is the ReservedWord super
, return true .
- If symbol is a ReservedWord , return false .
- If symbol is an Identifier and StringValue of symbol is the same value as the StringValue of
- IdentifierName , return true ;
- Return false .
-
- CallExpression : CallExpression .
IdentifierName
-
- If CallExpression Contains symbol is true , return true .
- If symbol is a ReservedWord , return false .
- If symbol is an Identifier and StringValue of symbol is the same value as the StringValue of
- IdentifierName , return true ;
- Return false .
-
-
-
-
- 12.3.1.2 Static Semantics: IsFunctionDefinition
-
- See also: 12.2.0.2 , 12.2.9.2 , 12.4.2 , 12.5.2 , 12.6.1 , 12.7.1 , 12.8.1 , 12.9.1 , 12.10.1 , 12.11.1 , 12.12.1 , 12.13.1 , 12.14.2 , 12.15.1 , 14.1.11 , 14.4.9 , 14.5.8 .
-
-
-
MemberExpression :
-
MemberExpression [
Expression ]
-
MemberExpression .
IdentifierName
-
MemberExpression TemplateLiteral
-
SuperProperty
-
MetaProperty
-
new
MemberExpression Arguments
-
-
-
-
NewExpression :
-
new
NewExpression
-
-
-
-
CallExpression :
-
MemberExpression Arguments
-
SuperCall
-
CallExpression Arguments
-
CallExpression [
Expression ]
-
CallExpression .
IdentifierName
-
CallExpression TemplateLiteral
-
-
-
- Return false .
-
-
-
-
- 12.3.1.3 Static Semantics: IsDestructuring
-
- See also: 13.6.4.6 .
-
- MemberExpression : PrimaryExpression
-
- If PrimaryExpression is either an ObjectLiteral or an ArrayLiteral , return true.
- Return false .
-
-
-
-
MemberExpression :
-
MemberExpression [
Expression ]
-
MemberExpression .
IdentifierName
-
MemberExpression TemplateLiteral
-
SuperProperty
-
MetaProperty
-
new
MemberExpression Arguments
-
-
-
-
NewExpression :
-
new
NewExpression
-
-
-
-
CallExpression :
-
MemberExpression Arguments
-
SuperCall
-
CallExpression Arguments
-
CallExpression [
Expression ]
-
CallExpression .
IdentifierName
-
CallExpression TemplateLiteral
-
-
-
- Return false .
-
-
-
-
- 12.3.1.4 Static Semantics: IsIdentifierRef
-
- See also: 12.2.0.3 .
-
-
-
LeftHandSideExpression :
-
CallExpression
-
-
-
-
MemberExpression :
-
MemberExpression [
Expression ]
-
MemberExpression .
IdentifierName
-
MemberExpression TemplateLiteral
-
SuperProperty
-
MetaProperty
-
new
MemberExpression Arguments
-
-
-
-
NewExpression :
-
new
NewExpression
-
-
-
- Return false .
-
-
-
-
- 12.3.1.5 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.1.3 , 12.2.0.4 , 12.2.9.3 , 12.4.3 , 12.5.3 , 12.6.2 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
-
-
CallExpression :
-
CallExpression [
Expression ]
-
CallExpression .
IdentifierName
-
-
-
-
MemberExpression :
-
MemberExpression [
Expression ]
-
MemberExpression .
IdentifierName
-
SuperProperty
-
-
-
- Return true .
-
-
-
-
CallExpression :
-
MemberExpression Arguments
-
SuperCall
-
CallExpression Arguments
-
CallExpression TemplateLiteral
-
-
-
-
NewExpression :
-
new
NewExpression
-
-
-
-
MemberExpression :
-
MemberExpression TemplateLiteral
-
new
MemberExpression Arguments
-
-
-
-
NewTarget :
-
new
.
target
-
-
-
- Return false .
-
-
-
-
-
-
-
12.3.2
- Property Accessors
-
-
-
NOTE Properties are accessed by name, using either the dot notation:
-
-
-
MemberExpression .
IdentifierName CallExpression .
IdentifierName
-
-
or the bracket notation:
-
-
MemberExpression [
Expression ]
CallExpression [
Expression ]
-
-
The dot notation is explained by the following syntactic conversion:
-
-
MemberExpression .
IdentifierName
-
-
is identical in its behaviour to
-
-
MemberExpression [
<identifier-name-string> ]
-
-
and similarly
-
-
CallExpression .
IdentifierName
-
-
is identical in its behaviour to
-
-
CallExpression [
<identifier-name-string> ]
-
-
where <identifier-name-string> is the result of evaluating StringValue of IdentifierName .
-
-
-
- 12.3.2.1 Runtime Semantics: Evaluation
- MemberExpression : MemberExpression [
Expression ]
-
- Let baseReference be the result of evaluating MemberExpression .
- Let baseValue be GetValue (baseReference ).
- ReturnIfAbrupt (baseValue ).
- Let propertyNameReference be the result of evaluating Expression .
- Let propertyNameValue be GetValue (propertyNameReference ).
- ReturnIfAbrupt (propertyNameValue ).
- Let bv be RequireObjectCoercible (baseValue ).
- ReturnIfAbrupt (bv ).
- Let propertyKey be ToPropertyKey (propertyNameValue ).
- ReturnIfAbrupt (propertyKey ).
- If the code matched by the syntactic production that is being evaluated is strict
- mode code , let strict be true , else let strict be false .
- Return a value of type Reference whose base value is bv and
- whose referenced name is propertyKey , and whose strict reference flag is strict .
-
- MemberExpression : MemberExpression .
IdentifierName
-
- Let baseReference be the result of evaluating MemberExpression .
- Let baseValue be GetValue (baseReference ).
- ReturnIfAbrupt (baseValue ).
- Let bv be RequireObjectCoercible (baseValue ).
- ReturnIfAbrupt (bv ).
- Let propertyNameString be StringValue of IdentifierName
- If the code matched by the syntactic production that is being evaluated is strict
- mode code , let strict be true , else let strict be false .
- Return a value of type Reference whose base value is bv and
- whose referenced name is propertyNameString , and whose strict reference flag is strict .
-
- CallExpression : CallExpression [
Expression ]
-
- Is evaluated in exactly the same manner as MemberExpression : MemberExpression [
Expression
- ]
except that the contained CallExpression is evaluated in step
- 1.
-
- CallExpression : CallExpression .
IdentifierName
-
- Is evaluated in exactly the same manner as MemberExpression : MemberExpression .
IdentifierName except that the contained CallExpression is evaluated in
- step 1.
-
-
-
-
-
-
-
-
-
12.3.3.1 Runtime Semantics: Evaluation
-
NewExpression : new
NewExpression
-
- Return EvaluateNew (NewExpression , empty ).
-
-
MemberExpression : new
MemberExpression Arguments
-
- Return EvaluateNew (MemberExpression , Arguments ).
-
-
-
-
- 12.3.3.1.1 Runtime Semantics: EvaluateNew(constructProduction,
- arguments)
-
- The abstract operation EvaluateNew with arguments constructProduction , and arguments performs the following steps:
-
-
- Assert : constructProduction is either a NewExpression or a
- MemberExpression .
- Assert : arguments is either empty or an Arguments production.
- Let ref be the result of evaluating constructProduction .
- Let constructor be GetValue (ref ).
- ReturnIfAbrupt (constructor ).
- If arguments is empty , let argList be an empty List .
- Else,
-
- Let argList be ArgumentListEvaluation of arguments .
- ReturnIfAbrupt (argList ).
-
-
- If IsConstructor (constructor ) is false , throw a TypeError
- exception.
- Return Construct (constructor , argList ).
-
-
-
-
-
-
-
-
-
- 12.3.4.1 Runtime Semantics: Evaluation
- CallExpression : MemberExpression Arguments
-
- Let ref be the result of evaluating MemberExpression .
- Let func be GetValue (ref ).
- ReturnIfAbrupt (func ).
- If Type (ref ) is Reference and IsPropertyReference (ref ) is false and GetReferencedName (ref ) is "eval"
, then
-
- If SameValue (func , %eval%) is true , then
-
- Let argList be ArgumentListEvaluation(Arguments ).
- ReturnIfAbrupt (argList ).
- If argList has no elements, return undefined.
- Let evalText be the first element of argList .
- If the source code matching this CallExpression is strict code ,
- let strictCaller be true. Otherwise let strictCaller be false.
- Let evalRealm be the running execution context ’s Realm .
- Return PerformEval (evalText , evalRealm , strictCaller ,
- true ). .
-
-
-
-
- If Type (ref ) is Reference , then
-
- If IsPropertyReference (ref ) is true , then
-
- Let thisValue be GetThisValue (ref ).
-
-
- Else, the base of ref is an Environment Record
-
- Let refEnv be GetBase (ref ).
- Let thisValue be refEnv .WithBaseObject().
-
-
-
-
- Else Type (ref ) is not Reference ,
-
- Let thisValue be undefined .
-
-
- Let thisCall be this CallExpression .
- Let tailCall be IsInTailPosition (thisCall ). (See 14.6.1 )
- Return EvaluateDirectCall (func , thisValue , Arguments ,
- tailCall ).
-
-
- A CallExpression whose evaluation executes step 4.a.vii is a direct eval .
-
- CallExpression : CallExpression Arguments
-
- Let ref be the result of evaluating CallExpression .
- Let thisCall be this CallExpression
- Let tailCall be IsInTailPosition (thisCall ). (See 14.6.1 )
- Return EvaluateCall (ref , Arguments , tailCall ).
-
-
-
-
- 12.3.4.2
- Runtime Semantics: EvaluateCall( ref, arguments, tailPosition )
-
- The abstract operation EvaluateCall takes as arguments a value ref , a syntactic grammar production
- arguments , and a Boolean argument tailPosition . It performs the following steps:
-
-
- Let func be GetValue (ref ).
- ReturnIfAbrupt (func ).
- If Type (ref ) is Reference , then
-
- If IsPropertyReference (ref ) is true , then
-
- Let thisValue be GetThisValue (ref ).
-
-
- Else, the base of ref is an Environment Record
-
- Let refEnv be GetBase (ref ).
- Let thisValue be refEnv .WithBaseObject().
-
-
-
-
- Else Type (ref ) is not Reference ,
-
- Let thisValue be undefined .
-
-
- Return EvaluateDirectCall (func , thisValue , arguments ,
- tailPosition ).
-
-
-
-
- 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments,
- tailPosition )
-
- The abstract operation EvaluateDirectCall takes as arguments a value func , a value thisValue , a
- syntactic grammar production arguments , and a Boolean argument tailPosition . It performs the
- following steps:
-
-
- Let argList be ArgumentListEvaluation(arguments ).
- ReturnIfAbrupt (argList ).
- If Type (func ) is not Object, throw a TypeError
- exception.
- If IsCallable (func ) is false , throw a TypeError exception.
- If tailPosition is true , perform PrepareForTailCall ().
- Let result be Call (func , thisValue , argList ).
- Assert : If tailPosition is true , the above call will not
- return here, but instead evaluation will continue as if the following return has already occurred.
- Assert : If result is not an abrupt completion then Type (result ) is an ECMAScript language type .
- Return result .
-
-
-
-
-
-
-
12.3.5 The
- super
Keyword
-
-
-
- 12.3.5.1 Runtime Semantics: Evaluation
- SuperProperty : super
[
Expression ]
-
- Let propertyNameReference be the result of evaluating Expression .
- Let propertyNameValue be GetValue (propertyNameReference ).
- Let propertyKey be ToPropertyKey (propertyNameValue ).
- ReturnIfAbrupt (propertyKey ).
- If the code matched by the syntactic production that is being evaluated is strict
- mode code , let strict be true , else let strict be false .
- Return MakeSuperPropertyReference (propertyKey ,
- strict ).
-
- SuperProperty : super
.
IdentifierName
-
- Let propertyKey be StringValue of IdentifierName .
- If the code matched by the syntactic production that is being evaluated is strict
- mode code , let strict be true , else let strict be false .
- Return MakeSuperPropertyReference (propertyKey ,
- strict ).
-
- SuperCall : super
Arguments
-
- Let newTarget be GetNewTarget ().
- If newTarget is undefined , throw a ReferenceError exception.
- Let func be GetSuperConstructor ().
- ReturnIfAbrupt (func ).
- Let argList be ArgumentListEvaluation of Arguments .
- ReturnIfAbrupt (argList ).
- Let result be Construct (func , argList , newTarget ).
- ReturnIfAbrupt (result ).
- Let thisER be GetThisEnvironment ( ).
- Return thisER .BindThisValue (result ).
-
-
-
-
- 12.3.5.2 Runtime Semantics: GetSuperConstructor ( )
-
- The abstract operation GetSuperConstructor performs the following steps:
-
-
- Let envRec be GetThisEnvironment ( ).
- Assert : envRec is a function Environment Record .
- Let activeFunction be envRec .[[FunctionObject]].
- Let superConstructor be activeFunction .[[GetPrototypeOf]]().
- ReturnIfAbrupt (superConstructor ).
- If IsConstructor (superConstructor ) is false , throw a TypeError
- exception.
- Return superConstructor .
-
-
-
-
- 12.3.5.3 Runtime Semantics: MakeSuperPropertyReference(propertyKey,
- strict)
-
- The abstract operation MakeSuperPropertyReference with arguments propertyKey and strict performs
- the following steps:
-
-
- Let env be GetThisEnvironment ( ).
- If env .HasSuperBinding() is false , throw a ReferenceError exception.
- Let actualThis be env .GetThisBinding().
- ReturnIfAbrupt (actualThis ).
- Let baseValue be env .GetSuperBase ().
- Let bv be RequireObjectCoercible (baseValue ).
- ReturnIfAbrupt (bv ).
- Return a value of type Reference that is a Super Reference whose base value is bv , whose referenced name is
- propertyKey , whose thisValue is actualThis , and whose strict reference flag is strict .
-
-
-
-
-
-
-
12.3.6
- Argument Lists
-
-
-
NOTE The evaluation of an argument list produces a List of values (see
- 6.2.1 ).
-
-
-
-
- 12.3.6.1 Runtime Semantics:
- ArgumentListEvaluation
-
- See also: 12.2.8.2
-
- Arguments : (
)
-
- Return an empty List .
-
- ArgumentList : AssignmentExpression
-
- Let ref be the result of evaluating AssignmentExpression .
- Let arg be GetValue (ref ).
- ReturnIfAbrupt (arg ).
- Return a List whose sole item is arg .
-
- ArgumentList : ...
AssignmentExpression
-
- Let list be an empty List .
- Let spreadRef be the result of evaluating AssignmentExpression .
- Let spreadObj be GetValue (spreadRef ).
- Let iterator be GetIterator (spreadObj ).
- ReturnIfAbrupt (iterator ).
- Repeat
-
- Let next be IteratorStep (iterator ).
- ReturnIfAbrupt (next ).
- If next is false , return list .
- Let nextArg be IteratorValue (next ).
- ReturnIfAbrupt (nextArg ).
- Append nextArg as the last element of list .
-
-
-
- ArgumentList : ArgumentList ,
AssignmentExpression
-
- Let precedingArgs be the result of evaluating ArgumentList .
- ReturnIfAbrupt (precedingArgs ).
- Let ref be the result of evaluating AssignmentExpression .
- Let arg be GetValue (ref ).
- ReturnIfAbrupt (arg ).
- Append arg to the end of precedingArgs .
- Return precedingArgs .
-
- ArgumentList : ArgumentList ,
...
AssignmentExpression
-
- Let precedingArgs be the result of evaluating ArgumentList .
- Let spreadRef be the result of evaluating AssignmentExpression .
- Let iterator be GetIterator (GetValue (spreadRef ) ).
- ReturnIfAbrupt (iterator ).
- Repeat
-
- Let next be IteratorStep (iterator ).
- ReturnIfAbrupt (next ).
- If next is false , return precedingArgs .
- Let nextArg be IteratorValue (next ).
- ReturnIfAbrupt (nextArg ).
- Append nextArg as the last element of precedingArgs .
-
-
-
-
-
-
-
-
-
12.3.7
- Tagged Templates
-
-
-
NOTE A tagged template is a function call where the arguments of the call are derived from a
- TemplateLiteral (12.2.8 ). The actual arguments include a template object (12.2.8.3 ) and the values produced by evaluating the expressions embedded within the
- TemplateLiteral .
-
-
-
-
- 12.3.7.1 Runtime Semantics: Evaluation
- MemberExpression : MemberExpression TemplateLiteral
-
- Let tagRef be the result of evaluating MemberExpression .
- Let thisCall be this MemberExpression .
- Let tailCall be IsInTailPosition (thisCall ). (See 14.6.1 )
- Return EvaluateCall (tagRef , TemplateLiteral , tailCall ).
-
- CallExpression : CallExpression TemplateLiteral
-
- Let tagRef be the result of evaluating CallExpression .
- Let thisCall be this CallExpression .
- Let tailCall be IsInTailPosition (thisCall ). (See 14.6.1 )
- Return EvaluateCall (tagRef , TemplateLiteral , tailCall ).
-
-
-
-
-
-
-
-
-
-
12.4
- Postfix Expressions
-
Syntax
-
-
-
PostfixExpression [Yield] :
-
LeftHandSideExpression [?Yield]
-
LeftHandSideExpression [?Yield] [no LineTerminator here] ++
-
LeftHandSideExpression [?Yield] [no LineTerminator here] --
-
-
-
-
- 12.4.1 Static Semantics: Early Errors
-
-
-
PostfixExpression :
-
LeftHandSideExpression ++
-
LeftHandSideExpression --
-
-
-
-
-
-
- 12.4.2 Static Semantics: IsFunctionDefinition
-
- See also: 12.2.0.2 , 12.2.9.2 , 12.3.1.2 , 12.5.2 , 12.6.1 , 12.7.1 , 12.8.1 , 12.9.1 , 12.10.1 , 12.11.1 , 12.12.1 , 12.13.1 , 12.14.2 , 12.15.1 , 14.1.11 , 14.4.9 , 14.5.8
-
-
-
PostfixExpression :
-
LeftHandSideExpression ++
-
LeftHandSideExpression --
-
-
-
- Return false .
-
-
-
-
- 12.4.3 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.1.3 , 12.2.0.4 , 12.2.9.3 , 12.3.1.5 , 12.5.3 , 12.6.2 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
-
-
PostfixExpression :
-
LeftHandSideExpression ++
-
LeftHandSideExpression --
-
-
-
- Return false .
-
-
-
-
-
-
12.4.4 Postfix Increment Operator
-
-
-
- 12.4.4.1 Runtime Semantics: Evaluation
- PostfixExpression : LeftHandSideExpression ++
-
- Let lhs be the result of evaluating LeftHandSideExpression .
- Let oldValue be ToNumber (GetValue (lhs )).
- ReturnIfAbrupt (oldValue ).
- Let newValue be the result of adding the value 1
to oldValue , using the same rules as for
- the +
operator (see 12.7.5 ).
- Let status be PutValue (lhs , newValue ).
- ReturnIfAbrupt (status ).
- Return oldValue .
-
-
-
-
-
-
-
12.4.5 Postfix Decrement Operator
-
-
-
- 12.4.5.1 Runtime Semantics: Evaluation
- PostfixExpression : LeftHandSideExpression --
-
- Let lhs be the result of evaluating LeftHandSideExpression .
- Let oldValue be ToNumber (GetValue (lhs )).
- ReturnIfAbrupt (oldValue ).
- Let newValue be the result of subtracting the value 1
from oldValue , using the same rules
- as for the -
operator (12.7.5 ).
- Let status be PutValue (lhs , newValue ).
- ReturnIfAbrupt (status ).
- Return oldValue .
-
-
-
-
-
-
-
-
12.5 Unary
- Operators
-
Syntax
-
-
-
UnaryExpression [Yield] :
-
PostfixExpression [?Yield]
-
delete
UnaryExpression [?Yield]
-
void
UnaryExpression [?Yield]
-
typeof
UnaryExpression [?Yield]
-
++
UnaryExpression [?Yield]
-
--
UnaryExpression [?Yield]
-
+
UnaryExpression [?Yield]
-
-
UnaryExpression [?Yield]
-
~
UnaryExpression [?Yield]
-
!
UnaryExpression [?Yield]
-
-
-
-
- 12.5.1 Static Semantics: Early Errors
-
-
-
UnaryExpression :
-
++
UnaryExpression
-
--
UnaryExpression
-
-
-
-
-
-
- 12.5.2 Static Semantics: IsFunctionDefinition
-
- See also: 12.2.0.2 , 12.2.9.2 , 12.3.1.2 , 12.4.2 , 12.6.1 , 12.7.1 , 12.8.1 , 12.9.1 , 12.10.1 , 12.11.1 , 12.12.1 , 12.13.1 , 12.14.2 , 12.15.1 , 14.1.11 , 14.4.9 , 14.5.8 .
-
-
-
UnaryExpression :
-
delete
UnaryExpression
-
void
UnaryExpression
-
typeof
UnaryExpression
-
++
UnaryExpression
-
--
UnaryExpression
-
+
UnaryExpression
-
-
UnaryExpression
-
~
UnaryExpression
-
!
UnaryExpression
-
-
-
- Return false .
-
-
-
-
- 12.5.3 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.1.3 , 12.2.0.4 , 12.2.9.3 , 12.3.1.5 , 12.4.3 , 12.6.2 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
-
-
UnaryExpression :
-
delete
UnaryExpression
-
void
UnaryExpression
-
typeof
UnaryExpression
-
++
UnaryExpression
-
--
UnaryExpression
-
+
UnaryExpression
-
-
UnaryExpression
-
~
UnaryExpression
-
!
UnaryExpression
-
-
-
- Return false .
-
-
-
-
-
-
12.5.4 The
- delete
Operator
-
-
-
- 12.5.4.1 Static Semantics: Early Errors
- UnaryExpression : delete
UnaryExpression
-
-
- It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression :
- IdentifierReference.
-
-
-
- It is a Syntax Error if the derived UnaryExpression is PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and CoverParenthesizedExpressionAndArrowParameterList ultimately derives a phrase that, if used in place
- of UnaryExpression, would produce a Syntax Error according to these rules. This rule is recursively
- applied.
-
-
-
-
-
NOTE The last rule means that expressions such as delete
- (((foo)))
produce early errors because of recursive application of the first rule.
-
-
-
-
- 12.5.4.2 Runtime Semantics: Evaluation
- UnaryExpression : delete
UnaryExpression
-
- Let ref be the result of evaluating UnaryExpression .
- ReturnIfAbrupt (ref ).
- If Type (ref ) is not Reference , return true .
- If IsUnresolvableReference (ref ) is true , then
-
- Assert : IsStrictReference (ref ) is false .
- Return true .
-
-
- If IsPropertyReference (ref ) is true , then
-
- If IsSuperReference (ref ), throw a ReferenceError
- exception.
- Let baseObj be ToObject (GetBase (ref )).
- Let deleteStatus be baseObj .[[Delete]](GetReferencedName (ref )).
- ReturnIfAbrupt (deleteStatus ).
- If deleteStatus is false and IsStrictReference (ref ) is true , throw a
- TypeError exception.
- Return deleteStatus .
-
-
- Else ref is a Reference to an Environment Record binding,
-
- Let bindings be GetBase (ref ).
- Return bindings .DeleteBinding(GetReferencedName (ref )).
-
-
-
-
-
-
NOTE When a delete
operator occurs within strict
- mode code , a SyntaxError exception is thrown if its UnaryExpression is a direct reference to a
- variable, function argument, or function name. In addition, if a delete
operator occurs within strict mode code and the property to be deleted has the attribute { [[Configurable]]:
- false }, a TypeError exception is thrown.
-
-
-
-
-
-
-
12.5.5 The
- void
Operator
-
-
-
- 12.5.5.1 Runtime Semantics: Evaluation
- UnaryExpression : void
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Let status be GetValue (expr ).
- ReturnIfAbrupt (status ).
- Return undefined .
-
-
-
-
NOTE GetValue must be called even though its value is not used
- because it may have observable side-effects.
-
-
-
-
-
-
-
12.5.6 The
- typeof
Operator
-
-
-
- 12.5.6.1 Runtime Semantics: Evaluation
- UnaryExpression : typeof
UnaryExpression
-
- Let val be the result of evaluating UnaryExpression .
- If Type (val ) is Reference , then
-
- If IsUnresolvableReference (val ) is true , return
- "undefined"
.
-
-
- Let val be GetValue (val ).
- ReturnIfAbrupt (val ).
- Return a String according to Table 35 .
-
-
-
- Table 35 — typeof Operator Results
-
-
- Type of val
- Result
-
-
- Undefined
- "undefined"
-
-
- Null
- "object"
-
-
- Boolean
- "boolean"
-
-
- Number
- "number"
-
-
- String
- "string"
-
-
- Symbol
- "symbol"
-
-
- Object (ordinary and does not implement [[Call]])
- "object"
-
-
- Object (standard exotic and does not implement [[Call]])
- "object"
-
-
- Object (implements [[Call]])
- "function"
-
-
- Object (non-standard exotic and does not implement [[Call]])
- Implementation-defined. Must not be "undefined"
, "boolean"
, "function"
, "number"
, "symbol"
, or "string".
-
-
-
-
-
-
NOTE Implementations are discouraged from defining new typeof
result values for
- non-standard exotic objects. If possible "object"
should be used for such objects.
-
-
-
-
-
-
-
12.5.7 Prefix Increment Operator
-
-
-
- 12.5.7.1 Runtime Semantics: Evaluation
- UnaryExpression : ++
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Let oldValue be ToNumber (GetValue (expr )).
- ReturnIfAbrupt (oldValue ).
- Let newValue be the result of adding the value 1
to oldValue , using the same rules as for
- the +
operator (see 12.7.5 ).
- Let status be PutValue (expr , newValue ).
- ReturnIfAbrupt (status ).
- Return newValue .
-
-
-
-
-
-
-
12.5.8 Prefix Decrement Operator
-
-
-
- 12.5.8.1 Runtime Semantics: Evaluation
- UnaryExpression : --
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Let oldValue be ToNumber (GetValue (expr )).
- ReturnIfAbrupt (oldValue ).
- Let newValue be the result of subtracting the value 1
from oldValue , using the same
- rules as for the -
operator (see
- 12.7.5 ).
- Let status be PutValue (expr , newValue ).
- ReturnIfAbrupt (status ).
- Return newValue .
-
-
-
-
-
-
-
12.5.9
- Unary +
Operator
-
-
-
NOTE The unary + operator converts its operand to Number type.
-
-
-
-
- 12.5.9.1 Runtime Semantics: Evaluation
- UnaryExpression : +
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Return ToNumber (GetValue (expr )).
-
-
-
-
-
-
-
12.5.10 Unary -
Operator
-
-
-
NOTE The unary -
operator converts its operand to Number type and then negates
- it. Negating +0 produces −0 , and negating −0 produces +0 .
-
-
-
-
- 12.5.10.1 Runtime Semantics: Evaluation
- UnaryExpression : -
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Let oldValue be ToNumber (GetValue (expr )).
- ReturnIfAbrupt (oldValue ).
- If oldValue is NaN , return NaN .
- Return the result of negating oldValue ; that is, compute a Number with the same magnitude but opposite
- sign.
-
-
-
-
-
-
-
12.5.11 Bitwise NOT Operator ( ~
)
-
-
-
- 12.5.11.1 Runtime Semantics: Evaluation
- UnaryExpression : ~
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Let oldValue be ToInt32 (GetValue (expr )).
- ReturnIfAbrupt (oldValue ).
- Return the result of applying bitwise complement to oldValue . The result is a signed 32-bit integer.
-
-
-
-
-
-
-
12.5.12 Logical NOT Operator ( !
)
-
-
-
- 12.5.12.1 Runtime Semantics: Evaluation
- UnaryExpression : !
UnaryExpression
-
- Let expr be the result of evaluating UnaryExpression .
- Let oldValue be ToBoolean (GetValue (expr )).
- ReturnIfAbrupt (oldValue ).
- If oldValue is true , return false .
- Return true .
-
-
-
-
-
-
-
-
12.6
- Multiplicative Operators
-
Syntax
-
-
-
MultiplicativeExpression [Yield] :
-
UnaryExpression [?Yield]
-
MultiplicativeExpression [?Yield] MultiplicativeOperator UnaryExpression [?Yield]
-
-
-
-
MultiplicativeOperator : one of
-
*
/
%
-
-
-
-
- 12.6.1 Static Semantics: IsFunctionDefinition
-
- See also: 12.2.0.2 , 12.2.9.2 , 12.3.1.2 , 12.4.2 , 12.5.2 , 12.7.1 , 12.8.1 , 12.9.1 , 12.10.1 , 12.11.1 , 12.12.1 , 12.13.1 , 12.14.2 , 12.15.1 , 14.1.11 , 14.4.9 , 14.5.8 .
-
- MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator
- UnaryExpression
-
-
- Return false .
-
-
-
-
- 12.6.2 Static Semantics: IsValidSimpleAssignmentTarget
-
- See also: 12.1.3 , 12.2.0.4 , 12.2.9.3 , 12.3.1.5 , 12.4.3 , 12.5.3 , 12.7.2 , 12.8.2 , 12.9.2 , 12.10.2 , 12.11.2 , 12.12.2 , 12.13.2 , 12.14.3 , 12.15.2 .
-
- MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator
- UnaryExpression
-
-
- Return false .
-
-
-
-
-
-
12.6.3 Runtime Semantics: Evaluation
-
-
MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator
- UnaryExpression
-
-
- Let left be the result of evaluating MultiplicativeExpression .
- Let leftValue be GetValue (left ).
- ReturnIfAbrupt (leftValue ).
- Let right be the result of evaluating UnaryExpression .
- Let rightValue be GetValue (right ).
- Let lnum be ToNumber (leftValue ).
- ReturnIfAbrupt (lnum ).
- Let rnum be ToNumber (rightValue ).
- ReturnIfAbrupt (rnum ).
- Return the result of applying the MultiplicativeOperator (*, /, or %) to lnum and rnum as
- specified in 12.6.3.1 , 12.6.3.2 , or 12.6.3.3 .
-
-
-
-
- 12.6.3.1 Applying the *
Operator
-
- The *
MultiplicativeOperator performs multiplication, producing the product of its
- operands. Multiplication is commutative. Multiplication is not always associative in ECMAScript, because of finite
- precision.
-
- The result of a floating-point multiplication is governed by the rules of IEEE 754 binary double-precision
- arithmetic:
-
-
-
- If either operand is NaN , the result is NaN .
-
-
-
- The sign of the result is positive if both operands have the same sign, negative if the operands have different
- signs.
-
-
-
- Multiplication of an infinity by a zero results in NaN .
-
-
-
- Multiplication of an infinity by an infinity results in an infinity. The sign is determined by the rule already
- stated above.
-
-
-
- Multiplication of an infinity by a finite nonzero value results in a signed infinity. The sign is determined by the
- rule already stated above.
-
-
-
- In the remaining cases, where neither an infinity nor NaN is involved, the product is computed and rounded to the
- nearest representable value using IEEE 754 round-to-nearest mode. If the magnitude is too large to represent, the
- result is then an infinity of appropriate sign. If the magnitude is too small to represent, the result is then a zero
- of appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754.
-
-
-
-
-
- 12.6.3.2 Applying the /
Operator
-
- The /
MultiplicativeOperator performs division, producing the quotient of its
- operands. The left operand is the dividend and the right operand is the divisor. ECMAScript does not perform integer
- division. The operands and result of all division operations are double-precision floating-point numbers. The result of
- division is determined by the specification of IEEE 754 arithmetic:
-
-
-
- If either operand is NaN , the result is NaN .
-
-
-
- The sign of the result is positive if both operands have the same sign, negative if the operands have different
- signs.
-
-
-
- Division of an infinity by an infinity results in NaN .
-
-
-
- Division of an infinity by a zero results in an infinity. The sign is determined by the rule already stated
- above.
-
-
-
- Division of an infinity by a nonzero finite value results in a signed infinity. The sign is determined by the rule
- already stated above.
-
-
-
- Division of a finite value by an infinity results in zero. The sign is determined by the rule already stated
- above.
-
-
-
- Division of a zero by a zero results in NaN ; division of zero by any other finite value results in zero,
- with the sign determined by the rule already stated above.
-
-
-
- Division of a nonzero finite value by a zero results in a signed infinity. The sign is determined by the rule
- already stated above.
-
-
-
- In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the quotient is computed
- and rounded to the nearest representable value using IEEE 754 round-to-nearest mode. If the magnitude is too large to
- represent, the operation overflows; the result is then an infinity of appropriate sign. If the magnitude is too small
- to represent, the operation underflows and the result is a zero of the appropriate sign. The ECMAScript language
- requires support of gradual underflow as defined by IEEE 754.
-
-
-
-
-
- 12.6.3.3 Applying the %
Operator
-
- The %
MultiplicativeOperator yields the remainder of its operands from an implied
- division; the left operand is the dividend and the right operand is the divisor.
-
-
-
NOTE In C and C++, the remainder operator accepts only integral operands; in ECMAScript, it
- also accepts floating-point operands.
-
-
- The result of a floating-point remainder operation as computed by the %
operator is not the same as the
- “remainder” operation defined by IEEE 754. The IEEE 754 “remainder” operation computes the
- remainder from a rounding division, not a truncating division, and so its behaviour is not analogous to that of the usual
- integer remainder operator. Instead the ECMAScript language defines %
on floating-point operations to behave
- in a manner analogous to that of the Java integer remainder operator; this may be compared with the C library function
- fmod.
-
- The result of an ECMAScript floating-point remainder operation is determined by the rules of IEEE arithmetic:
-
-
-
- If either operand is NaN , the result is NaN .
-
-
-
- The sign of the result equals the sign of the dividend.
-
-
-
- If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN .
-
-
-
- If the dividend is finite and the divisor is an infinity, the result equals the dividend.
-
-
-
- If the dividend is a zero and the divisor is nonzero and finite, the result is the same as the dividend.
-
-
-
- In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point
- remainder r from a dividend n and a divisor d is defined by the mathematical relation r = n − (d × q)
- where q is an integer that is negative only if n/d is negative and positive only if n/d is positive, and whose
- magnitude is as large as possible without exceeding the magnitude of the true mathematical quotient of n and d. r is
- computed and rounded to the nearest representable value using IEEE 754 round-to-nearest mode.
-
-
-
-
-
-
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_gopher.svg b/vendor/github.com/tdewolff/minify/benchmarks/sample_gopher.svg
deleted file mode 100644
index 658154b4..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_gopher.svg
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_gumby.css b/vendor/github.com/tdewolff/minify/benchmarks/sample_gumby.css
deleted file mode 100644
index 8c56d2ea..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_gumby.css
+++ /dev/null
@@ -1,1683 +0,0 @@
-@charset "UTF-8";
-/**
-* Gumby Framework
-* ---------------
-*
-* Follow @gumbycss on twitter and spread the love.
-* We worked super hard on making this awesome and released it to the web.
-* All we ask is you leave this intact. #gumbyisawesome
-*
-* Gumby Framework
-* http://gumbyframework.com
-*
-* Built with love by your friends @digitalsurgeons
-* http://www.digitalsurgeons.com
-*
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-*/
-@import url(//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700);
-html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; font-size: 100%; vertical-align: baseline; }
-
-html { line-height: 1; }
-
-ol, ul { list-style: none; }
-
-table { border-collapse: collapse; border-spacing: 0; }
-
-caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; }
-
-q, blockquote { quotes: none; }
-q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none; }
-
-a img { border: none; }
-
-article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; }
-
-.pull_right { float: right; }
-
-.pull_left { float: left; }
-
-/* Base Styles */
-html { font-size: 100%; line-height: 1.5em; }
-
-* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
-
-body { background: #fff; font-family: "Open Sans"; font-weight: 400; color: #555555; position: relative; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
-@media only screen and (max-width: 767px) { body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; width: 100%; min-width: 0; } }
-
-html, body { height: 100%; }
-
-.hide { display: none; }
-
-.hide.active, .show { display: block; }
-
-.icon-note.icon-left a:before, .icon-note.icon-right a:after, i.icon-note:before { content: "\\266a"; height: inherit; }
-
-.icon-note-beamed.icon-left a:before, .icon-note-beamed.icon-right a:after, i.icon-note-beamed:before { content: "\\266b"; height: inherit; }
-
-.icon-music.icon-left a:before, .icon-music.icon-right a:after, i.icon-music:before { content: "\\1f3b5"; height: inherit; }
-
-.icon-search.icon-left a:before, .icon-search.icon-right a:after, i.icon-search:before { content: "\\1f50d"; height: inherit; }
-
-.icon-flashlight.icon-left a:before, .icon-flashlight.icon-right a:after, i.icon-flashlight:before { content: "\\1f526"; height: inherit; }
-
-.icon-mail.icon-left a:before, .icon-mail.icon-right a:after, i.icon-mail:before { content: "\\2709"; height: inherit; }
-
-.icon-heart.icon-left a:before, .icon-heart.icon-right a:after, i.icon-heart:before { content: "\\2665"; height: inherit; }
-
-.icon-heart-empty.icon-left a:before, .icon-heart-empty.icon-right a:after, i.icon-heart-empty:before { content: "\\2661"; height: inherit; }
-
-.icon-star.icon-left a:before, .icon-star.icon-right a:after, i.icon-star:before { content: "\\2605"; height: inherit; }
-
-.icon-star-empty.icon-left a:before, .icon-star-empty.icon-right a:after, i.icon-star-empty:before { content: "\\2606"; height: inherit; }
-
-.icon-user.icon-left a:before, .icon-user.icon-right a:after, i.icon-user:before { content: "\\1f464"; height: inherit; }
-
-.icon-users.icon-left a:before, .icon-users.icon-right a:after, i.icon-users:before { content: "\\1f465"; height: inherit; }
-
-.icon-user-add.icon-left a:before, .icon-user-add.icon-right a:after, i.icon-user-add:before { content: "\\e700"; height: inherit; }
-
-.icon-video.icon-left a:before, .icon-video.icon-right a:after, i.icon-video:before { content: "\\1f3ac"; height: inherit; }
-
-.icon-picture.icon-left a:before, .icon-picture.icon-right a:after, i.icon-picture:before { content: "\\1f304"; height: inherit; }
-
-.icon-camera.icon-left a:before, .icon-camera.icon-right a:after, i.icon-camera:before { content: "\\1f4f7"; height: inherit; }
-
-.icon-layout.icon-left a:before, .icon-layout.icon-right a:after, i.icon-layout:before { content: "\\268f"; height: inherit; }
-
-.icon-menu.icon-left a:before, .icon-menu.icon-right a:after, i.icon-menu:before { content: "\\2630"; height: inherit; }
-
-.icon-check.icon-left a:before, .icon-check.icon-right a:after, i.icon-check:before { content: "\\2713"; height: inherit; }
-
-.icon-cancel.icon-left a:before, .icon-cancel.icon-right a:after, i.icon-cancel:before { content: "\\2715"; height: inherit; }
-
-.icon-cancel-circled.icon-left a:before, .icon-cancel-circled.icon-right a:after, i.icon-cancel-circled:before { content: "\\2716"; height: inherit; }
-
-.icon-cancel-squared.icon-left a:before, .icon-cancel-squared.icon-right a:after, i.icon-cancel-squared:before { content: "\\274e"; height: inherit; }
-
-.icon-plus.icon-left a:before, .icon-plus.icon-right a:after, i.icon-plus:before { content: "\\2b"; height: inherit; }
-
-.icon-plus-circled.icon-left a:before, .icon-plus-circled.icon-right a:after, i.icon-plus-circled:before { content: "\\2795"; height: inherit; }
-
-.icon-plus-squared.icon-left a:before, .icon-plus-squared.icon-right a:after, i.icon-plus-squared:before { content: "\\229e"; height: inherit; }
-
-.icon-minus.icon-left a:before, .icon-minus.icon-right a:after, i.icon-minus:before { content: "\\2d"; height: inherit; }
-
-.icon-minus-circled.icon-left a:before, .icon-minus-circled.icon-right a:after, i.icon-minus-circled:before { content: "\\2796"; height: inherit; }
-
-.icon-minus-squared.icon-left a:before, .icon-minus-squared.icon-right a:after, i.icon-minus-squared:before { content: "\\229f"; height: inherit; }
-
-.icon-help.icon-left a:before, .icon-help.icon-right a:after, i.icon-help:before { content: "\\2753"; height: inherit; }
-
-.icon-help-circled.icon-left a:before, .icon-help-circled.icon-right a:after, i.icon-help-circled:before { content: "\\e704"; height: inherit; }
-
-.icon-info.icon-left a:before, .icon-info.icon-right a:after, i.icon-info:before { content: "\\2139"; height: inherit; }
-
-.icon-info-circled.icon-left a:before, .icon-info-circled.icon-right a:after, i.icon-info-circled:before { content: "\\e705"; height: inherit; }
-
-.icon-back.icon-left a:before, .icon-back.icon-right a:after, i.icon-back:before { content: "\\1f519"; height: inherit; }
-
-.icon-home.icon-left a:before, .icon-home.icon-right a:after, i.icon-home:before { content: "\\2302"; height: inherit; }
-
-.icon-link.icon-left a:before, .icon-link.icon-right a:after, i.icon-link:before { content: "\\1f517"; height: inherit; }
-
-.icon-attach.icon-left a:before, .icon-attach.icon-right a:after, i.icon-attach:before { content: "\\1f4ce"; height: inherit; }
-
-.icon-lock.icon-left a:before, .icon-lock.icon-right a:after, i.icon-lock:before { content: "\\1f512"; height: inherit; }
-
-.icon-lock-open.icon-left a:before, .icon-lock-open.icon-right a:after, i.icon-lock-open:before { content: "\\1f513"; height: inherit; }
-
-.icon-eye.icon-left a:before, .icon-eye.icon-right a:after, i.icon-eye:before { content: "\\e70a"; height: inherit; }
-
-.icon-tag.icon-left a:before, .icon-tag.icon-right a:after, i.icon-tag:before { content: "\\e70c"; height: inherit; }
-
-.icon-bookmark.icon-left a:before, .icon-bookmark.icon-right a:after, i.icon-bookmark:before { content: "\\1f516"; height: inherit; }
-
-.icon-bookmarks.icon-left a:before, .icon-bookmarks.icon-right a:after, i.icon-bookmarks:before { content: "\\1f4d1"; height: inherit; }
-
-.icon-flag.icon-left a:before, .icon-flag.icon-right a:after, i.icon-flag:before { content: "\\2691"; height: inherit; }
-
-.icon-thumbs-up.icon-left a:before, .icon-thumbs-up.icon-right a:after, i.icon-thumbs-up:before { content: "\\1f44d"; height: inherit; }
-
-.icon-thumbs-down.icon-left a:before, .icon-thumbs-down.icon-right a:after, i.icon-thumbs-down:before { content: "\\1f44e"; height: inherit; }
-
-.icon-download.icon-left a:before, .icon-download.icon-right a:after, i.icon-download:before { content: "\\1f4e5"; height: inherit; }
-
-.icon-upload.icon-left a:before, .icon-upload.icon-right a:after, i.icon-upload:before { content: "\\1f4e4"; height: inherit; }
-
-.icon-upload-cloud.icon-left a:before, .icon-upload-cloud.icon-right a:after, i.icon-upload-cloud:before { content: "\\e711"; height: inherit; }
-
-.icon-reply.icon-left a:before, .icon-reply.icon-right a:after, i.icon-reply:before { content: "\\e712"; height: inherit; }
-
-.icon-reply-all.icon-left a:before, .icon-reply-all.icon-right a:after, i.icon-reply-all:before { content: "\\e713"; height: inherit; }
-
-.icon-forward.icon-left a:before, .icon-forward.icon-right a:after, i.icon-forward:before { content: "\\27a6"; height: inherit; }
-
-.icon-quote.icon-left a:before, .icon-quote.icon-right a:after, i.icon-quote:before { content: "\\275e"; height: inherit; }
-
-.icon-code.icon-left a:before, .icon-code.icon-right a:after, i.icon-code:before { content: "\\e714"; height: inherit; }
-
-.icon-export.icon-left a:before, .icon-export.icon-right a:after, i.icon-export:before { content: "\\e715"; height: inherit; }
-
-.icon-pencil.icon-left a:before, .icon-pencil.icon-right a:after, i.icon-pencil:before { content: "\\270e"; height: inherit; }
-
-.icon-feather.icon-left a:before, .icon-feather.icon-right a:after, i.icon-feather:before { content: "\\2712"; height: inherit; }
-
-.icon-print.icon-left a:before, .icon-print.icon-right a:after, i.icon-print:before { content: "\\e716"; height: inherit; }
-
-.icon-retweet.icon-left a:before, .icon-retweet.icon-right a:after, i.icon-retweet:before { content: "\\e717"; height: inherit; }
-
-.icon-keyboard.icon-left a:before, .icon-keyboard.icon-right a:after, i.icon-keyboard:before { content: "\\2328"; height: inherit; }
-
-.icon-comment.icon-left a:before, .icon-comment.icon-right a:after, i.icon-comment:before { content: "\\e718"; height: inherit; }
-
-.icon-chat.icon-left a:before, .icon-chat.icon-right a:after, i.icon-chat:before { content: "\\e720"; height: inherit; }
-
-.icon-bell.icon-left a:before, .icon-bell.icon-right a:after, i.icon-bell:before { content: "\\1f514"; height: inherit; }
-
-.icon-attention.icon-left a:before, .icon-attention.icon-right a:after, i.icon-attention:before { content: "\\26a0"; height: inherit; }
-
-.icon-alert.icon-left a:before, .icon-alert.icon-right a:after, i.icon-alert:before { content: "\\1f4a5"; height: inherit; }
-
-.icon-vcard.icon-left a:before, .icon-vcard.icon-right a:after, i.icon-vcard:before { content: "\\e722"; height: inherit; }
-
-.icon-address.icon-left a:before, .icon-address.icon-right a:after, i.icon-address:before { content: "\\e723"; height: inherit; }
-
-.icon-location.icon-left a:before, .icon-location.icon-right a:after, i.icon-location:before { content: "\\e724"; height: inherit; }
-
-.icon-map.icon-left a:before, .icon-map.icon-right a:after, i.icon-map:before { content: "\\e727"; height: inherit; }
-
-.icon-direction.icon-left a:before, .icon-direction.icon-right a:after, i.icon-direction:before { content: "\\27a2"; height: inherit; }
-
-.icon-compass.icon-left a:before, .icon-compass.icon-right a:after, i.icon-compass:before { content: "\\e728"; height: inherit; }
-
-.icon-cup.icon-left a:before, .icon-cup.icon-right a:after, i.icon-cup:before { content: "\\2615"; height: inherit; }
-
-.icon-trash.icon-left a:before, .icon-trash.icon-right a:after, i.icon-trash:before { content: "\\e729"; height: inherit; }
-
-.icon-doc.icon-left a:before, .icon-doc.icon-right a:after, i.icon-doc:before { content: "\\e730"; height: inherit; }
-
-.icon-docs.icon-left a:before, .icon-docs.icon-right a:after, i.icon-docs:before { content: "\\e736"; height: inherit; }
-
-.icon-doc-landscape.icon-left a:before, .icon-doc-landscape.icon-right a:after, i.icon-doc-landscape:before { content: "\\e737"; height: inherit; }
-
-.icon-doc-text.icon-left a:before, .icon-doc-text.icon-right a:after, i.icon-doc-text:before { content: "\\1f4c4"; height: inherit; }
-
-.icon-doc-text-inv.icon-left a:before, .icon-doc-text-inv.icon-right a:after, i.icon-doc-text-inv:before { content: "\\e731"; height: inherit; }
-
-.icon-newspaper.icon-left a:before, .icon-newspaper.icon-right a:after, i.icon-newspaper:before { content: "\\1f4f0"; height: inherit; }
-
-.icon-book-open.icon-left a:before, .icon-book-open.icon-right a:after, i.icon-book-open:before { content: "\\1f4d6"; height: inherit; }
-
-.icon-book.icon-left a:before, .icon-book.icon-right a:after, i.icon-book:before { content: "\\1f4d5"; height: inherit; }
-
-.icon-folder.icon-left a:before, .icon-folder.icon-right a:after, i.icon-folder:before { content: "\\1f4c1"; height: inherit; }
-
-.icon-archive.icon-left a:before, .icon-archive.icon-right a:after, i.icon-archive:before { content: "\\e738"; height: inherit; }
-
-.icon-box.icon-left a:before, .icon-box.icon-right a:after, i.icon-box:before { content: "\\1f4e6"; height: inherit; }
-
-.icon-rss.icon-left a:before, .icon-rss.icon-right a:after, i.icon-rss:before { content: "\\e73a"; height: inherit; }
-
-.icon-phone.icon-left a:before, .icon-phone.icon-right a:after, i.icon-phone:before { content: "\\1f4de"; height: inherit; }
-
-.icon-cog.icon-left a:before, .icon-cog.icon-right a:after, i.icon-cog:before { content: "\\2699"; height: inherit; }
-
-.icon-tools.icon-left a:before, .icon-tools.icon-right a:after, i.icon-tools:before { content: "\\2692"; height: inherit; }
-
-.icon-share.icon-left a:before, .icon-share.icon-right a:after, i.icon-share:before { content: "\\e73c"; height: inherit; }
-
-.icon-shareable.icon-left a:before, .icon-shareable.icon-right a:after, i.icon-shareable:before { content: "\\e73e"; height: inherit; }
-
-.icon-basket.icon-left a:before, .icon-basket.icon-right a:after, i.icon-basket:before { content: "\\e73d"; height: inherit; }
-
-.icon-bag.icon-left a:before, .icon-bag.icon-right a:after, i.icon-bag:before { content: "\\1f45c"; height: inherit; }
-
-.icon-calendar.icon-left a:before, .icon-calendar.icon-right a:after, i.icon-calendar:before { content: "\\1f4c5"; height: inherit; }
-
-.icon-login.icon-left a:before, .icon-login.icon-right a:after, i.icon-login:before { content: "\\e740"; height: inherit; }
-
-.icon-logout.icon-left a:before, .icon-logout.icon-right a:after, i.icon-logout:before { content: "\\e741"; height: inherit; }
-
-.icon-mic.icon-left a:before, .icon-mic.icon-right a:after, i.icon-mic:before { content: "\\1f3a4"; height: inherit; }
-
-.icon-mute.icon-left a:before, .icon-mute.icon-right a:after, i.icon-mute:before { content: "\\1f507"; height: inherit; }
-
-.icon-sound.icon-left a:before, .icon-sound.icon-right a:after, i.icon-sound:before { content: "\\1f50a"; height: inherit; }
-
-.icon-volume.icon-left a:before, .icon-volume.icon-right a:after, i.icon-volume:before { content: "\\e742"; height: inherit; }
-
-.icon-clock.icon-left a:before, .icon-clock.icon-right a:after, i.icon-clock:before { content: "\\1f554"; height: inherit; }
-
-.icon-hourglass.icon-left a:before, .icon-hourglass.icon-right a:after, i.icon-hourglass:before { content: "\\23f3"; height: inherit; }
-
-.icon-lamp.icon-left a:before, .icon-lamp.icon-right a:after, i.icon-lamp:before { content: "\\1f4a1"; height: inherit; }
-
-.icon-light-down.icon-left a:before, .icon-light-down.icon-right a:after, i.icon-light-down:before { content: "\\1f505"; height: inherit; }
-
-.icon-light-up.icon-left a:before, .icon-light-up.icon-right a:after, i.icon-light-up:before { content: "\\1f506"; height: inherit; }
-
-.icon-adjust.icon-left a:before, .icon-adjust.icon-right a:after, i.icon-adjust:before { content: "\\25d1"; height: inherit; }
-
-.icon-block.icon-left a:before, .icon-block.icon-right a:after, i.icon-block:before { content: "\\1f6ab"; height: inherit; }
-
-.icon-resize-full.icon-left a:before, .icon-resize-full.icon-right a:after, i.icon-resize-full:before { content: "\\e744"; height: inherit; }
-
-.icon-resize-small.icon-left a:before, .icon-resize-small.icon-right a:after, i.icon-resize-small:before { content: "\\e746"; height: inherit; }
-
-.icon-popup.icon-left a:before, .icon-popup.icon-right a:after, i.icon-popup:before { content: "\\e74c"; height: inherit; }
-
-.icon-publish.icon-left a:before, .icon-publish.icon-right a:after, i.icon-publish:before { content: "\\e74d"; height: inherit; }
-
-.icon-window.icon-left a:before, .icon-window.icon-right a:after, i.icon-window:before { content: "\\e74e"; height: inherit; }
-
-.icon-arrow-combo.icon-left a:before, .icon-arrow-combo.icon-right a:after, i.icon-arrow-combo:before { content: "\\e74f"; height: inherit; }
-
-.icon-down-circled.icon-left a:before, .icon-down-circled.icon-right a:after, i.icon-down-circled:before { content: "\\e758"; height: inherit; }
-
-.icon-left-circled.icon-left a:before, .icon-left-circled.icon-right a:after, i.icon-left-circled:before { content: "\\e759"; height: inherit; }
-
-.icon-right-circled.icon-left a:before, .icon-right-circled.icon-right a:after, i.icon-right-circled:before { content: "\\e75a"; height: inherit; }
-
-.icon-up-circled.icon-left a:before, .icon-up-circled.icon-right a:after, i.icon-up-circled:before { content: "\\e75b"; height: inherit; }
-
-.icon-down-open.icon-left a:before, .icon-down-open.icon-right a:after, i.icon-down-open:before { content: "\\e75c"; height: inherit; }
-
-.icon-left-open.icon-left a:before, .icon-left-open.icon-right a:after, i.icon-left-open:before { content: "\\e75d"; height: inherit; }
-
-.icon-right-open.icon-left a:before, .icon-right-open.icon-right a:after, i.icon-right-open:before { content: "\\e75e"; height: inherit; }
-
-.icon-up-open.icon-left a:before, .icon-up-open.icon-right a:after, i.icon-up-open:before { content: "\\e75f"; height: inherit; }
-
-.icon-down-open-mini.icon-left a:before, .icon-down-open-mini.icon-right a:after, i.icon-down-open-mini:before { content: "\\e760"; height: inherit; }
-
-.icon-left-open-mini.icon-left a:before, .icon-left-open-mini.icon-right a:after, i.icon-left-open-mini:before { content: "\\e761"; height: inherit; }
-
-.icon-right-open-mini.icon-left a:before, .icon-right-open-mini.icon-right a:after, i.icon-right-open-mini:before { content: "\\e762"; height: inherit; }
-
-.icon-up-open-mini.icon-left a:before, .icon-up-open-mini.icon-right a:after, i.icon-up-open-mini:before { content: "\\e763"; height: inherit; }
-
-.icon-down-open-big.icon-left a:before, .icon-down-open-big.icon-right a:after, i.icon-down-open-big:before { content: "\\e764"; height: inherit; }
-
-.icon-left-open-big.icon-left a:before, .icon-left-open-big.icon-right a:after, i.icon-left-open-big:before { content: "\\e765"; height: inherit; }
-
-.icon-right-open-big.icon-left a:before, .icon-right-open-big.icon-right a:after, i.icon-right-open-big:before { content: "\\e766"; height: inherit; }
-
-.icon-up-open-big.icon-left a:before, .icon-up-open-big.icon-right a:after, i.icon-up-open-big:before { content: "\\e767"; height: inherit; }
-
-.icon-down.icon-left a:before, .icon-down.icon-right a:after, i.icon-down:before { content: "\\2b07"; height: inherit; }
-
-.icon-arrow-left.icon-left a:before, .icon-arrow-left.icon-right a:after, i.icon-arrow-left:before { content: "\\2b05"; height: inherit; }
-
-.icon-arrow-right.icon-left a:before, .icon-arrow-right.icon-right a:after, i.icon-arrow-right:before { content: "\\27a1"; height: inherit; }
-
-.icon-up.icon-left a:before, .icon-up.icon-right a:after, i.icon-up:before { content: "\\2b06"; height: inherit; }
-
-.icon-down-dir.icon-left a:before, .icon-down-dir.icon-right a:after, i.icon-down-dir:before { content: "\\25be"; height: inherit; }
-
-.icon-left-dir.icon-left a:before, .icon-left-dir.icon-right a:after, i.icon-left-dir:before { content: "\\25c2"; height: inherit; }
-
-.icon-right-dir.icon-left a:before, .icon-right-dir.icon-right a:after, i.icon-right-dir:before { content: "\\25b8"; height: inherit; }
-
-.icon-up-dir.icon-left a:before, .icon-up-dir.icon-right a:after, i.icon-up-dir:before { content: "\\25b4"; height: inherit; }
-
-.icon-down-bold.icon-left a:before, .icon-down-bold.icon-right a:after, i.icon-down-bold:before { content: "\\e4b0"; height: inherit; }
-
-.icon-left-bold.icon-left a:before, .icon-left-bold.icon-right a:after, i.icon-left-bold:before { content: "\\e4ad"; height: inherit; }
-
-.icon-right-bold.icon-left a:before, .icon-right-bold.icon-right a:after, i.icon-right-bold:before { content: "\\e4ae"; height: inherit; }
-
-.icon-up-bold.icon-left a:before, .icon-up-bold.icon-right a:after, i.icon-up-bold:before { content: "\\e4af"; height: inherit; }
-
-.icon-down-thin.icon-left a:before, .icon-down-thin.icon-right a:after, i.icon-down-thin:before { content: "\\2193"; height: inherit; }
-
-.icon-left-thin.icon-left a:before, .icon-left-thin.icon-right a:after, i.icon-left-thin:before { content: "\\2190"; height: inherit; }
-
-.icon-right-thin.icon-left a:before, .icon-right-thin.icon-right a:after, i.icon-right-thin:before { content: "\\2192"; height: inherit; }
-
-.icon-up-thin.icon-left a:before, .icon-up-thin.icon-right a:after, i.icon-up-thin:before { content: "\\2191"; height: inherit; }
-
-.icon-ccw.icon-left a:before, .icon-ccw.icon-right a:after, i.icon-ccw:before { content: "\\27f2"; height: inherit; }
-
-.icon-cw.icon-left a:before, .icon-cw.icon-right a:after, i.icon-cw:before { content: "\\27f3"; height: inherit; }
-
-.icon-arrows-ccw.icon-left a:before, .icon-arrows-ccw.icon-right a:after, i.icon-arrows-ccw:before { content: "\\1f504"; height: inherit; }
-
-.icon-level-down.icon-left a:before, .icon-level-down.icon-right a:after, i.icon-level-down:before { content: "\\21b3"; height: inherit; }
-
-.icon-level-up.icon-left a:before, .icon-level-up.icon-right a:after, i.icon-level-up:before { content: "\\21b0"; height: inherit; }
-
-.icon-shuffle.icon-left a:before, .icon-shuffle.icon-right a:after, i.icon-shuffle:before { content: "\\1f500"; height: inherit; }
-
-.icon-loop.icon-left a:before, .icon-loop.icon-right a:after, i.icon-loop:before { content: "\\1f501"; height: inherit; }
-
-.icon-switch.icon-left a:before, .icon-switch.icon-right a:after, i.icon-switch:before { content: "\\21c6"; height: inherit; }
-
-.icon-play.icon-left a:before, .icon-play.icon-right a:after, i.icon-play:before { content: "\\25b6"; height: inherit; }
-
-.icon-stop.icon-left a:before, .icon-stop.icon-right a:after, i.icon-stop:before { content: "\\25a0"; height: inherit; }
-
-.icon-pause.icon-left a:before, .icon-pause.icon-right a:after, i.icon-pause:before { content: "\\2389"; height: inherit; }
-
-.icon-record.icon-left a:before, .icon-record.icon-right a:after, i.icon-record:before { content: "\\26ab"; height: inherit; }
-
-.icon-to-end.icon-left a:before, .icon-to-end.icon-right a:after, i.icon-to-end:before { content: "\\23ed"; height: inherit; }
-
-.icon-to-start.icon-left a:before, .icon-to-start.icon-right a:after, i.icon-to-start:before { content: "\\23ee"; height: inherit; }
-
-.icon-fast-forward.icon-left a:before, .icon-fast-forward.icon-right a:after, i.icon-fast-forward:before { content: "\\23e9"; height: inherit; }
-
-.icon-fast-backward.icon-left a:before, .icon-fast-backward.icon-right a:after, i.icon-fast-backward:before { content: "\\23ea"; height: inherit; }
-
-.icon-progress-0.icon-left a:before, .icon-progress-0.icon-right a:after, i.icon-progress-0:before { content: "\\e768"; height: inherit; }
-
-.icon-progress-1.icon-left a:before, .icon-progress-1.icon-right a:after, i.icon-progress-1:before { content: "\\e769"; height: inherit; }
-
-.icon-progress-2.icon-left a:before, .icon-progress-2.icon-right a:after, i.icon-progress-2:before { content: "\\e76a"; height: inherit; }
-
-.icon-progress-3.icon-left a:before, .icon-progress-3.icon-right a:after, i.icon-progress-3:before { content: "\\e76b"; height: inherit; }
-
-.icon-target.icon-left a:before, .icon-target.icon-right a:after, i.icon-target:before { content: "\\1f3af"; height: inherit; }
-
-.icon-palette.icon-left a:before, .icon-palette.icon-right a:after, i.icon-palette:before { content: "\\1f3a8"; height: inherit; }
-
-.icon-list.icon-left a:before, .icon-list.icon-right a:after, i.icon-list:before { content: "\\e005"; height: inherit; }
-
-.icon-list-add.icon-left a:before, .icon-list-add.icon-right a:after, i.icon-list-add:before { content: "\\e003"; height: inherit; }
-
-.icon-signal.icon-left a:before, .icon-signal.icon-right a:after, i.icon-signal:before { content: "\\1f4f6"; height: inherit; }
-
-.icon-trophy.icon-left a:before, .icon-trophy.icon-right a:after, i.icon-trophy:before { content: "\\1f3c6"; height: inherit; }
-
-.icon-battery.icon-left a:before, .icon-battery.icon-right a:after, i.icon-battery:before { content: "\\1f50b"; height: inherit; }
-
-.icon-back-in-time.icon-left a:before, .icon-back-in-time.icon-right a:after, i.icon-back-in-time:before { content: "\\e771"; height: inherit; }
-
-.icon-monitor.icon-left a:before, .icon-monitor.icon-right a:after, i.icon-monitor:before { content: "\\1f4bb"; height: inherit; }
-
-.icon-mobile.icon-left a:before, .icon-mobile.icon-right a:after, i.icon-mobile:before { content: "\\1f4f1"; height: inherit; }
-
-.icon-network.icon-left a:before, .icon-network.icon-right a:after, i.icon-network:before { content: "\\e776"; height: inherit; }
-
-.icon-cd.icon-left a:before, .icon-cd.icon-right a:after, i.icon-cd:before { content: "\\1f4bf"; height: inherit; }
-
-.icon-inbox.icon-left a:before, .icon-inbox.icon-right a:after, i.icon-inbox:before { content: "\\e777"; height: inherit; }
-
-.icon-install.icon-left a:before, .icon-install.icon-right a:after, i.icon-install:before { content: "\\e778"; height: inherit; }
-
-.icon-globe.icon-left a:before, .icon-globe.icon-right a:after, i.icon-globe:before { content: "\\1f30e"; height: inherit; }
-
-.icon-cloud.icon-left a:before, .icon-cloud.icon-right a:after, i.icon-cloud:before { content: "\\2601"; height: inherit; }
-
-.icon-cloud-thunder.icon-left a:before, .icon-cloud-thunder.icon-right a:after, i.icon-cloud-thunder:before { content: "\\26c8"; height: inherit; }
-
-.icon-flash.icon-left a:before, .icon-flash.icon-right a:after, i.icon-flash:before { content: "\\26a1"; height: inherit; }
-
-.icon-moon.icon-left a:before, .icon-moon.icon-right a:after, i.icon-moon:before { content: "\\263d"; height: inherit; }
-
-.icon-flight.icon-left a:before, .icon-flight.icon-right a:after, i.icon-flight:before { content: "\\2708"; height: inherit; }
-
-.icon-paper-plane.icon-left a:before, .icon-paper-plane.icon-right a:after, i.icon-paper-plane:before { content: "\\e79b"; height: inherit; }
-
-.icon-leaf.icon-left a:before, .icon-leaf.icon-right a:after, i.icon-leaf:before { content: "\\1f342"; height: inherit; }
-
-.icon-lifebuoy.icon-left a:before, .icon-lifebuoy.icon-right a:after, i.icon-lifebuoy:before { content: "\\e788"; height: inherit; }
-
-.icon-mouse.icon-left a:before, .icon-mouse.icon-right a:after, i.icon-mouse:before { content: "\\e789"; height: inherit; }
-
-.icon-briefcase.icon-left a:before, .icon-briefcase.icon-right a:after, i.icon-briefcase:before { content: "\\1f4bc"; height: inherit; }
-
-.icon-suitcase.icon-left a:before, .icon-suitcase.icon-right a:after, i.icon-suitcase:before { content: "\\e78e"; height: inherit; }
-
-.icon-dot.icon-left a:before, .icon-dot.icon-right a:after, i.icon-dot:before { content: "\\e78b"; height: inherit; }
-
-.icon-dot-2.icon-left a:before, .icon-dot-2.icon-right a:after, i.icon-dot-2:before { content: "\\e78c"; height: inherit; }
-
-.icon-dot-3.icon-left a:before, .icon-dot-3.icon-right a:after, i.icon-dot-3:before { content: "\\e78d"; height: inherit; }
-
-.icon-brush.icon-left a:before, .icon-brush.icon-right a:after, i.icon-brush:before { content: "\\e79a"; height: inherit; }
-
-.icon-magnet.icon-left a:before, .icon-magnet.icon-right a:after, i.icon-magnet:before { content: "\\e7a1"; height: inherit; }
-
-.icon-infinity.icon-left a:before, .icon-infinity.icon-right a:after, i.icon-infinity:before { content: "\\221e"; height: inherit; }
-
-.icon-erase.icon-left a:before, .icon-erase.icon-right a:after, i.icon-erase:before { content: "\\232b"; height: inherit; }
-
-.icon-chart-pie.icon-left a:before, .icon-chart-pie.icon-right a:after, i.icon-chart-pie:before { content: "\\e751"; height: inherit; }
-
-.icon-chart-line.icon-left a:before, .icon-chart-line.icon-right a:after, i.icon-chart-line:before { content: "\\1f4c8"; height: inherit; }
-
-.icon-chart-bar.icon-left a:before, .icon-chart-bar.icon-right a:after, i.icon-chart-bar:before { content: "\\1f4ca"; height: inherit; }
-
-.icon-chart-area.icon-left a:before, .icon-chart-area.icon-right a:after, i.icon-chart-area:before { content: "\\1f53e"; height: inherit; }
-
-.icon-tape.icon-left a:before, .icon-tape.icon-right a:after, i.icon-tape:before { content: "\\2707"; height: inherit; }
-
-.icon-graduation-cap.icon-left a:before, .icon-graduation-cap.icon-right a:after, i.icon-graduation-cap:before { content: "\\1f393"; height: inherit; }
-
-.icon-language.icon-left a:before, .icon-language.icon-right a:after, i.icon-language:before { content: "\\e752"; height: inherit; }
-
-.icon-ticket.icon-left a:before, .icon-ticket.icon-right a:after, i.icon-ticket:before { content: "\\1f3ab"; height: inherit; }
-
-.icon-water.icon-left a:before, .icon-water.icon-right a:after, i.icon-water:before { content: "\\1f4a6"; height: inherit; }
-
-.icon-droplet.icon-left a:before, .icon-droplet.icon-right a:after, i.icon-droplet:before { content: "\\1f4a7"; height: inherit; }
-
-.icon-air.icon-left a:before, .icon-air.icon-right a:after, i.icon-air:before { content: "\\e753"; height: inherit; }
-
-.icon-credit-card.icon-left a:before, .icon-credit-card.icon-right a:after, i.icon-credit-card:before { content: "\\1f4b3"; height: inherit; }
-
-.icon-floppy.icon-left a:before, .icon-floppy.icon-right a:after, i.icon-floppy:before { content: "\\1f4be"; height: inherit; }
-
-.icon-clipboard.icon-left a:before, .icon-clipboard.icon-right a:after, i.icon-clipboard:before { content: "\\1f4cb"; height: inherit; }
-
-.icon-megaphone.icon-left a:before, .icon-megaphone.icon-right a:after, i.icon-megaphone:before { content: "\\1f4e3"; height: inherit; }
-
-.icon-database.icon-left a:before, .icon-database.icon-right a:after, i.icon-database:before { content: "\\e754"; height: inherit; }
-
-.icon-drive.icon-left a:before, .icon-drive.icon-right a:after, i.icon-drive:before { content: "\\e755"; height: inherit; }
-
-.icon-bucket.icon-left a:before, .icon-bucket.icon-right a:after, i.icon-bucket:before { content: "\\e756"; height: inherit; }
-
-.icon-thermometer.icon-left a:before, .icon-thermometer.icon-right a:after, i.icon-thermometer:before { content: "\\e757"; height: inherit; }
-
-.icon-key.icon-left a:before, .icon-key.icon-right a:after, i.icon-key:before { content: "\\1f511"; height: inherit; }
-
-.icon-flow-cascade.icon-left a:before, .icon-flow-cascade.icon-right a:after, i.icon-flow-cascade:before { content: "\\e790"; height: inherit; }
-
-.icon-flow-branch.icon-left a:before, .icon-flow-branch.icon-right a:after, i.icon-flow-branch:before { content: "\\e791"; height: inherit; }
-
-.icon-flow-tree.icon-left a:before, .icon-flow-tree.icon-right a:after, i.icon-flow-tree:before { content: "\\e792"; height: inherit; }
-
-.icon-flow-line.icon-left a:before, .icon-flow-line.icon-right a:after, i.icon-flow-line:before { content: "\\e793"; height: inherit; }
-
-.icon-flow-parallel.icon-left a:before, .icon-flow-parallel.icon-right a:after, i.icon-flow-parallel:before { content: "\\e794"; height: inherit; }
-
-.icon-rocket.icon-left a:before, .icon-rocket.icon-right a:after, i.icon-rocket:before { content: "\\1f680"; height: inherit; }
-
-.icon-gauge.icon-left a:before, .icon-gauge.icon-right a:after, i.icon-gauge:before { content: "\\e7a2"; height: inherit; }
-
-.icon-traffic-cone.icon-left a:before, .icon-traffic-cone.icon-right a:after, i.icon-traffic-cone:before { content: "\\e7a3"; height: inherit; }
-
-.icon-cc.icon-left a:before, .icon-cc.icon-right a:after, i.icon-cc:before { content: "\\e7a5"; height: inherit; }
-
-.icon-cc-by.icon-left a:before, .icon-cc-by.icon-right a:after, i.icon-cc-by:before { content: "\\e7a6"; height: inherit; }
-
-.icon-cc-nc.icon-left a:before, .icon-cc-nc.icon-right a:after, i.icon-cc-nc:before { content: "\\e7a7"; height: inherit; }
-
-.icon-cc-nc-eu.icon-left a:before, .icon-cc-nc-eu.icon-right a:after, i.icon-cc-nc-eu:before { content: "\\e7a8"; height: inherit; }
-
-.icon-cc-nc-jp.icon-left a:before, .icon-cc-nc-jp.icon-right a:after, i.icon-cc-nc-jp:before { content: "\\e7a9"; height: inherit; }
-
-.icon-cc-sa.icon-left a:before, .icon-cc-sa.icon-right a:after, i.icon-cc-sa:before { content: "\\e7aa"; height: inherit; }
-
-.icon-cc-nd.icon-left a:before, .icon-cc-nd.icon-right a:after, i.icon-cc-nd:before { content: "\\e7ab"; height: inherit; }
-
-.icon-cc-pd.icon-left a:before, .icon-cc-pd.icon-right a:after, i.icon-cc-pd:before { content: "\\e7ac"; height: inherit; }
-
-.icon-cc-zero.icon-left a:before, .icon-cc-zero.icon-right a:after, i.icon-cc-zero:before { content: "\\e7ad"; height: inherit; }
-
-.icon-cc-share.icon-left a:before, .icon-cc-share.icon-right a:after, i.icon-cc-share:before { content: "\\e7ae"; height: inherit; }
-
-.icon-cc-remix.icon-left a:before, .icon-cc-remix.icon-right a:after, i.icon-cc-remix:before { content: "\\e7af"; height: inherit; }
-
-.icon-github.icon-left a:before, .icon-github.icon-right a:after, i.icon-github:before { content: "\\f300"; height: inherit; }
-
-.icon-github-circled.icon-left a:before, .icon-github-circled.icon-right a:after, i.icon-github-circled:before { content: "\\f301"; height: inherit; }
-
-.icon-flickr.icon-left a:before, .icon-flickr.icon-right a:after, i.icon-flickr:before { content: "\\f303"; height: inherit; }
-
-.icon-flickr-circled.icon-left a:before, .icon-flickr-circled.icon-right a:after, i.icon-flickr-circled:before { content: "\\f304"; height: inherit; }
-
-.icon-vimeo.icon-left a:before, .icon-vimeo.icon-right a:after, i.icon-vimeo:before { content: "\\f306"; height: inherit; }
-
-.icon-vimeo-circled.icon-left a:before, .icon-vimeo-circled.icon-right a:after, i.icon-vimeo-circled:before { content: "\\f307"; height: inherit; }
-
-.icon-twitter.icon-left a:before, .icon-twitter.icon-right a:after, i.icon-twitter:before { content: "\\f309"; height: inherit; }
-
-.icon-twitter-circled.icon-left a:before, .icon-twitter-circled.icon-right a:after, i.icon-twitter-circled:before { content: "\\f30a"; height: inherit; }
-
-.icon-facebook.icon-left a:before, .icon-facebook.icon-right a:after, i.icon-facebook:before { content: "\\f30c"; height: inherit; }
-
-.icon-facebook-circled.icon-left a:before, .icon-facebook-circled.icon-right a:after, i.icon-facebook-circled:before { content: "\\f30d"; height: inherit; }
-
-.icon-facebook-squared.icon-left a:before, .icon-facebook-squared.icon-right a:after, i.icon-facebook-squared:before { content: "\\f30e"; height: inherit; }
-
-.icon-gplus.icon-left a:before, .icon-gplus.icon-right a:after, i.icon-gplus:before { content: "\\f30f"; height: inherit; }
-
-.icon-gplus-circled.icon-left a:before, .icon-gplus-circled.icon-right a:after, i.icon-gplus-circled:before { content: "\\f310"; height: inherit; }
-
-.icon-pinterest.icon-left a:before, .icon-pinterest.icon-right a:after, i.icon-pinterest:before { content: "\\f312"; height: inherit; }
-
-.icon-pinterest-circled.icon-left a:before, .icon-pinterest-circled.icon-right a:after, i.icon-pinterest-circled:before { content: "\\f313"; height: inherit; }
-
-.icon-tumblr.icon-left a:before, .icon-tumblr.icon-right a:after, i.icon-tumblr:before { content: "\\f315"; height: inherit; }
-
-.icon-tumblr-circled.icon-left a:before, .icon-tumblr-circled.icon-right a:after, i.icon-tumblr-circled:before { content: "\\f316"; height: inherit; }
-
-.icon-linkedin.icon-left a:before, .icon-linkedin.icon-right a:after, i.icon-linkedin:before { content: "\\f318"; height: inherit; }
-
-.icon-linkedin-circled.icon-left a:before, .icon-linkedin-circled.icon-right a:after, i.icon-linkedin-circled:before { content: "\\f319"; height: inherit; }
-
-.icon-dribbble.icon-left a:before, .icon-dribbble.icon-right a:after, i.icon-dribbble:before { content: "\\f31b"; height: inherit; }
-
-.icon-dribbble-circled.icon-left a:before, .icon-dribbble-circled.icon-right a:after, i.icon-dribbble-circled:before { content: "\\f31c"; height: inherit; }
-
-.icon-stumbleupon.icon-left a:before, .icon-stumbleupon.icon-right a:after, i.icon-stumbleupon:before { content: "\\f31e"; height: inherit; }
-
-.icon-stumbleupon-circled.icon-left a:before, .icon-stumbleupon-circled.icon-right a:after, i.icon-stumbleupon-circled:before { content: "\\f31f"; height: inherit; }
-
-.icon-lastfm.icon-left a:before, .icon-lastfm.icon-right a:after, i.icon-lastfm:before { content: "\\f321"; height: inherit; }
-
-.icon-lastfm-circled.icon-left a:before, .icon-lastfm-circled.icon-right a:after, i.icon-lastfm-circled:before { content: "\\f322"; height: inherit; }
-
-.icon-rdio.icon-left a:before, .icon-rdio.icon-right a:after, i.icon-rdio:before { content: "\\f324"; height: inherit; }
-
-.icon-rdio-circled.icon-left a:before, .icon-rdio-circled.icon-right a:after, i.icon-rdio-circled:before { content: "\\f325"; height: inherit; }
-
-.icon-spotify.icon-left a:before, .icon-spotify.icon-right a:after, i.icon-spotify:before { content: "\\f327"; height: inherit; }
-
-.icon-spotify-circled.icon-left a:before, .icon-spotify-circled.icon-right a:after, i.icon-spotify-circled:before { content: "\\f328"; height: inherit; }
-
-.icon-qq.icon-left a:before, .icon-qq.icon-right a:after, i.icon-qq:before { content: "\\f32a"; height: inherit; }
-
-.icon-instagram.icon-left a:before, .icon-instagram.icon-right a:after, i.icon-instagram:before { content: "\\f32d"; height: inherit; }
-
-.icon-dropbox.icon-left a:before, .icon-dropbox.icon-right a:after, i.icon-dropbox:before { content: "\\f330"; height: inherit; }
-
-.icon-evernote.icon-left a:before, .icon-evernote.icon-right a:after, i.icon-evernote:before { content: "\\f333"; height: inherit; }
-
-.icon-flattr.icon-left a:before, .icon-flattr.icon-right a:after, i.icon-flattr:before { content: "\\f336"; height: inherit; }
-
-.icon-skype.icon-left a:before, .icon-skype.icon-right a:after, i.icon-skype:before { content: "\\f339"; height: inherit; }
-
-.icon-skype-circled.icon-left a:before, .icon-skype-circled.icon-right a:after, i.icon-skype-circled:before { content: "\\f33a"; height: inherit; }
-
-.icon-renren.icon-left a:before, .icon-renren.icon-right a:after, i.icon-renren:before { content: "\\f33c"; height: inherit; }
-
-.icon-sina-weibo.icon-left a:before, .icon-sina-weibo.icon-right a:after, i.icon-sina-weibo:before { content: "\\f33f"; height: inherit; }
-
-.icon-paypal.icon-left a:before, .icon-paypal.icon-right a:after, i.icon-paypal:before { content: "\\f342"; height: inherit; }
-
-.icon-picasa.icon-left a:before, .icon-picasa.icon-right a:after, i.icon-picasa:before { content: "\\f345"; height: inherit; }
-
-.icon-soundcloud.icon-left a:before, .icon-soundcloud.icon-right a:after, i.icon-soundcloud:before { content: "\\f348"; height: inherit; }
-
-.icon-mixi.icon-left a:before, .icon-mixi.icon-right a:after, i.icon-mixi:before { content: "\\f34b"; height: inherit; }
-
-.icon-behance.icon-left a:before, .icon-behance.icon-right a:after, i.icon-behance:before { content: "\\f34e"; height: inherit; }
-
-.icon-google-circles.icon-left a:before, .icon-google-circles.icon-right a:after, i.icon-google-circles:before { content: "\\f351"; height: inherit; }
-
-.icon-vkontakte.icon-left a:before, .icon-vkontakte.icon-right a:after, i.icon-vkontakte:before { content: "\\f354"; height: inherit; }
-
-.icon-smashing.icon-left a:before, .icon-smashing.icon-right a:after, i.icon-smashing:before { content: "\\f357"; height: inherit; }
-
-.icon-sweden.icon-left a:before, .icon-sweden.icon-right a:after, i.icon-sweden:before { content: "\\f601"; height: inherit; }
-
-.icon-db-shape.icon-left a:before, .icon-db-shape.icon-right a:after, i.icon-db-shape:before { content: "\\f600"; height: inherit; }
-
-.icon-logo-db.icon-left a:before, .icon-logo-db.icon-right a:after, i.icon-logo-db:before { content: "\\f603"; height: inherit; }
-
-.fixed { position: fixed; }
-.fixed.pinned { position: absolute; }
-@media only screen and (max-width: 768px) { .fixed { position: relative !important; top: auto !important; left: auto !important; } }
-
-.unfixed { position: relative !important; top: auto !important; left: auto !important; }
-
-.text-center { text-align: center; }
-
-.text-left { text-align: left; }
-
-.text-right { text-align: right; }
-
-/* Fonts */
-@font-face { font-family: "entypo"; font-style: normal; font-weight: 400; src: url(../fonts/icons/entypo.eot); src: url("../fonts/icons/entypo.eot?#iefix") format("ie9-skip-eot"), url("../fonts/icons/entypo.woff") format("woff"), url("../fonts/icons/entypo.ttf") format("truetype"); }
-/* Typography */
-h1, h2, h3, h4, h5, h6 { font-family: "Open Sans"; font-weight: 300; color: #444444; text-rendering: optimizeLegibility; padding-top: 0.252em; line-height: 1.0665em; padding-bottom: 0.252em; }
-h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: #d04526; }
-
-@media only screen and (max-width: 767px) { h1, h2, h3, h4, h5, h6 { word-wrap: break-word; } }
-h1 { font-size: 67.77709px; font-size: 4.23607rem; }
-h1.xlarge { font-size: 109.66563px; font-size: 6.8541rem; }
-h1.xxlarge { font-size: 126.20665px; font-size: 7.88792rem; }
-h1.absurd { font-size: 177.44273px; font-size: 11.09017rem; }
-
-h2 { font-size: 41.88854px; font-size: 2.61803rem; }
-
-h3 { font-size: 29.79335px; font-size: 1.86208rem; }
-
-h4 { font-size: 25.88854px; font-size: 1.61803rem; }
-
-h5 { font-size: 18.4133px; font-size: 1.15083rem; }
-
-h6 { font-size: 16px; font-size: 1rem; }
-
-@media only screen and (max-width: 767px) { h1 { font-size: 41.88854px; font-size: 2.61803rem; }
- h2 { font-size: 35.79335px; font-size: 2.23708rem; } }
-.subhead { color: #777; font-weight: normal; margin-bottom: 20px; }
-
-/*=====================================================
- Links & Paragraph styles
- ======================================================*/
-p { font-family: "Open Sans"; font-weight: 400; font-size: 16px; font-size: 1rem; margin-bottom: 12px; line-height: 1.5em; }
-p.lead { font-size: 20px; font-size: 1.25rem; margin-bottom: 18.4133px; }
-@media only screen and (max-width: 768px) { p { font-size: 17.6px; font-size: 1.1rem; line-height: 1.5em; } }
-
-a { color: #d04526; text-decoration: none; outline: 0; line-height: inherit; }
-a:hover { color: #c03d20; }
-
-/*=====================================================
- Lists
- ======================================================*/
-ul, ol { margin-bottom: 0.252em; }
-
-ul { list-style: none outside; }
-
-ol { list-style: decimal; margin-left: 30px; }
-
-ul.square, ul.circle, ul.disc { margin-left: 25px; }
-ul.square { list-style: square outside; }
-ul.circle { list-style: circle outside; }
-ul.disc { list-style: disc outside; }
-ul ul { margin: 4px 0 5px 25px; }
-
-ol ol { margin: 4px 0 5px 30px; }
-
-li { padding-bottom: 0.252em; }
-
-ul.large li { line-height: 21px; }
-
-dl dt { font-weight: bold; font-size: 16px; font-size: 1rem; }
-
-@media only screen and (max-width: 768px) { ul, ol, dl, p { text-align: left; } }
-/* Mobile */
-em { font-style: italic; line-height: inherit; }
-
-strong { font-weight: 700; line-height: inherit; }
-
-small { font-size: 56.4%; line-height: inherit; }
-
-h1 small, h2 small, h3 small, h4 small, h5 small { color: #777; }
-
-/* Blockquotes */
-blockquote { line-height: 20px; color: #777; margin: 0 0 18px; padding: 9px 20px 0 19px; border-left: 5px solid #ccc; }
-blockquote p { line-height: 20px; color: #777; }
-blockquote cite { display: block; font-size: 12px; font-size: 1.2rem; color: #555555; }
-blockquote cite:before { content: "\2014 \0020"; }
-blockquote cite a { color: #555555; }
-blockquote cite a:visited { color: #555555; }
-
-hr { border: 1px solid #ccc; clear: both; margin: 16px 0 18px; height: 0; }
-
-abbr, acronym { text-transform: uppercase; font-size: 90%; color: #222; border-bottom: 1px solid #ccc; cursor: help; }
-
-abbr { text-transform: none; }
-
-/** Print styles. Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/ Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com) */
-@media print { * { background: transparent !important; color: black !important; text-shadow: none !important; filter: none !important; -ms-filter: none !important; }
- /* Black prints faster: sanbeiji.com/archives/953 */
- p a { color: #555555 !important; text-decoration: underline; }
- p a:visited { color: #555555 !important; text-decoration: underline; }
- p a[href]:after { content: " (" attr(href) ")"; }
- abbr[title]:after { content: " (" attr(title) ")"; }
- a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
- /* Don't show links for images, or javascript/internal links */
- pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
- thead { display: table-header-group; }
- /* css-discuss.incutio.com/wiki/Printing_Tables */
- tr, img { page-break-inside: avoid; }
- @page { margin: 0.5cm; }
- p, h2, h3 { orphans: 3; widows: 3; }
- h2, h3 { page-break-after: avoid; } }
-.row .pull_one.one.column:first-child, .row .pull_one.two.columns:first-child, .row .pull_one.three.columns:first-child, .row .pull_one.four.columns:first-child, .row .pull_one.five.columns:first-child, .row .pull_one.six.columns:first-child, .row .pull_one.seven.columns:first-child, .row .pull_one.eight.columns:first-child, .row .pull_one.nine.columns:first-child, .row .pull_one.ten.columns:first-child, .row .pull_two.one.column:first-child, .row .pull_two.two.columns:first-child, .row .pull_two.three.columns:first-child, .row .pull_two.four.columns:first-child, .row .pull_two.five.columns:first-child, .row .pull_two.six.columns:first-child, .row .pull_two.seven.columns:first-child, .row .pull_two.eight.columns:first-child, .row .pull_two.nine.columns:first-child, .row .pull_two.eleven.columns:first-child, .row .pull_three.one.column:first-child, .row .pull_three.two.columns:first-child, .row .pull_three.three.columns:first-child, .row .pull_three.four.columns:first-child, .row .pull_three.five.columns:first-child, .row .pull_three.six.columns:first-child, .row .pull_three.seven.columns:first-child, .row .pull_three.eight.columns:first-child, .row .pull_three.ten.columns:first-child, .row .pull_three.eleven.columns:first-child, .row .pull_four.one.column:first-child, .row .pull_four.two.columns:first-child, .row .pull_four.three.columns:first-child, .row .pull_four.four.columns:first-child, .row .pull_four.five.columns:first-child, .row .pull_four.six.columns:first-child, .row .pull_four.seven.columns:first-child, .row .pull_four.nine.columns:first-child, .row .pull_four.ten.columns:first-child, .row .pull_four.eleven.columns:first-child, .row .pull_five.one.column:first-child, .row .pull_five.two.columns:first-child, .row .pull_five.three.columns:first-child, .row .pull_five.four.columns:first-child, .row .pull_five.five.columns:first-child, .row .pull_five.six.columns:first-child, .row .pull_five.eight.columns:first-child, .row .pull_five.nine.columns:first-child, .row .pull_five.ten.columns:first-child, .row .pull_five.eleven.columns:first-child, .row .pull_six.one.column:first-child, .row .pull_six.two.columns:first-child, .row .pull_six.three.columns:first-child, .row .pull_six.four.columns:first-child, .row .pull_six.five.columns:first-child, .row .pull_six.seven.columns:first-child, .row .pull_six.eight.columns:first-child, .row .pull_six.nine.columns:first-child, .row .pull_six.ten.columns:first-child, .row .pull_six.eleven.columns:first-child, .row .pull_seven.one.column:first-child, .row .pull_seven.two.columns:first-child, .row .pull_seven.three.columns:first-child, .row .pull_seven.four.columns:first-child, .row .pull_seven.six.columns:first-child, .row .pull_seven.seven.columns:first-child, .row .pull_seven.eight.columns:first-child, .row .pull_seven.nine.columns:first-child, .row .pull_seven.ten.columns:first-child, .row .pull_seven.eleven.columns:first-child, .row .pull_eight.one.column:first-child, .row .pull_eight.two.columns:first-child, .row .pull_eight.three.columns:first-child, .row .pull_eight.five.columns:first-child, .row .pull_eight.six.columns:first-child, .row .pull_eight.seven.columns:first-child, .row .pull_eight.eight.columns:first-child, .row .pull_eight.nine.columns:first-child, .row .pull_eight.ten.columns:first-child, .row .pull_eight.eleven.columns:first-child, .row .pull_nine.one.column:first-child, .row .pull_nine.two.columns:first-child, .row .pull_nine.four.columns:first-child, .row .pull_nine.five.columns:first-child, .row .pull_nine.six.columns:first-child, .row .pull_nine.seven.columns:first-child, .row .pull_nine.eight.columns:first-child, .row .pull_nine.nine.columns:first-child, .row .pull_nine.ten.columns:first-child, .row .pull_nine.eleven.columns:first-child, .row .pull_ten.one.column:first-child, .row .pull_ten.three.columns:first-child, .row .pull_ten.four.columns:first-child, .row .pull_ten.five.columns:first-child, .row .pull_ten.six.columns:first-child, .row .pull_ten.seven.columns:first-child, .row .pull_ten.eight.columns:first-child, .row .pull_ten.nine.columns:first-child, .row .pull_ten.ten.columns:first-child, .row .pull_ten.eleven.columns:first-child, .row .pull_eleven.two.columns:first-child, .row .pull_eleven.three.columns:first-child, .row .pull_eleven.four.columns:first-child, .row .pull_eleven.five.columns:first-child, .row .pull_eleven.six.columns:first-child, .row .pull_eleven.seven.columns:first-child, .row .pull_eleven.eight.columns:first-child, .row .pull_eleven.nine.columns:first-child, .row .pull_eleven.ten.columns:first-child, .row .pull_eleven.eleven.columns:first-child, .sixteen.colgrid .row .pull_one.one.column:first-child, .sixteen.colgrid .row .pull_one.two.columns:first-child, .sixteen.colgrid .row .pull_one.three.columns:first-child, .sixteen.colgrid .row .pull_one.four.columns:first-child, .sixteen.colgrid .row .pull_one.five.columns:first-child, .sixteen.colgrid .row .pull_one.six.columns:first-child, .sixteen.colgrid .row .pull_one.seven.columns:first-child, .sixteen.colgrid .row .pull_one.eight.columns:first-child, .sixteen.colgrid .row .pull_one.nine.columns:first-child, .sixteen.colgrid .row .pull_one.ten.columns:first-child, .sixteen.colgrid .row .pull_one.eleven.columns:first-child, .sixteen.colgrid .row .pull_one.twelve.columns:first-child, .sixteen.colgrid .row .pull_one.thirteen.columns:first-child, .sixteen.colgrid .row .pull_one.fourteen.columns:first-child, .sixteen.colgrid .row .pull_two.one.column:first-child, .sixteen.colgrid .row .pull_two.two.columns:first-child, .sixteen.colgrid .row .pull_two.three.columns:first-child, .sixteen.colgrid .row .pull_two.four.columns:first-child, .sixteen.colgrid .row .pull_two.five.columns:first-child, .sixteen.colgrid .row .pull_two.six.columns:first-child, .sixteen.colgrid .row .pull_two.seven.columns:first-child, .sixteen.colgrid .row .pull_two.eight.columns:first-child, .sixteen.colgrid .row .pull_two.nine.columns:first-child, .sixteen.colgrid .row .pull_two.ten.columns:first-child, .sixteen.colgrid .row .pull_two.eleven.columns:first-child, .sixteen.colgrid .row .pull_two.twelve.columns:first-child, .sixteen.colgrid .row .pull_two.thirteen.columns:first-child, .sixteen.colgrid .row .pull_two.fifteen.columns:first-child, .sixteen.colgrid .row .pull_three.one.column:first-child, .sixteen.colgrid .row .pull_three.two.columns:first-child, .sixteen.colgrid .row .pull_three.three.columns:first-child, .sixteen.colgrid .row .pull_three.four.columns:first-child, .sixteen.colgrid .row .pull_three.five.columns:first-child, .sixteen.colgrid .row .pull_three.six.columns:first-child, .sixteen.colgrid .row .pull_three.seven.columns:first-child, .sixteen.colgrid .row .pull_three.eight.columns:first-child, .sixteen.colgrid .row .pull_three.nine.columns:first-child, .sixteen.colgrid .row .pull_three.ten.columns:first-child, .sixteen.colgrid .row .pull_three.eleven.columns:first-child, .sixteen.colgrid .row .pull_three.twelve.columns:first-child, .sixteen.colgrid .row .pull_three.fourteen.columns:first-child, .sixteen.colgrid .row .pull_three.fifteen.columns:first-child, .sixteen.colgrid .row .pull_four.one.column:first-child, .sixteen.colgrid .row .pull_four.two.columns:first-child, .sixteen.colgrid .row .pull_four.three.columns:first-child, .sixteen.colgrid .row .pull_four.four.columns:first-child, .sixteen.colgrid .row .pull_four.five.columns:first-child, .sixteen.colgrid .row .pull_four.six.columns:first-child, .sixteen.colgrid .row .pull_four.seven.columns:first-child, .sixteen.colgrid .row .pull_four.eight.columns:first-child, .sixteen.colgrid .row .pull_four.nine.columns:first-child, .sixteen.colgrid .row .pull_four.ten.columns:first-child, .sixteen.colgrid .row .pull_four.eleven.columns:first-child, .sixteen.colgrid .row .pull_four.thirteen.columns:first-child, .sixteen.colgrid .row .pull_four.fourteen.columns:first-child, .sixteen.colgrid .row .pull_four.fifteen.columns:first-child, .sixteen.colgrid .row .pull_five.one.column:first-child, .sixteen.colgrid .row .pull_five.two.columns:first-child, .sixteen.colgrid .row .pull_five.three.columns:first-child, .sixteen.colgrid .row .pull_five.four.columns:first-child, .sixteen.colgrid .row .pull_five.five.columns:first-child, .sixteen.colgrid .row .pull_five.six.columns:first-child, .sixteen.colgrid .row .pull_five.seven.columns:first-child, .sixteen.colgrid .row .pull_five.eight.columns:first-child, .sixteen.colgrid .row .pull_five.nine.columns:first-child, .sixteen.colgrid .row .pull_five.ten.columns:first-child, .sixteen.colgrid .row .pull_five.twelve.columns:first-child, .sixteen.colgrid .row .pull_five.thirteen.columns:first-child, .sixteen.colgrid .row .pull_five.fourteen.columns:first-child, .sixteen.colgrid .row .pull_five.fifteen.columns:first-child, .sixteen.colgrid .row .pull_six.one.column:first-child, .sixteen.colgrid .row .pull_six.two.columns:first-child, .sixteen.colgrid .row .pull_six.three.columns:first-child, .sixteen.colgrid .row .pull_six.four.columns:first-child, .sixteen.colgrid .row .pull_six.five.columns:first-child, .sixteen.colgrid .row .pull_six.six.columns:first-child, .sixteen.colgrid .row .pull_six.seven.columns:first-child, .sixteen.colgrid .row .pull_six.eight.columns:first-child, .sixteen.colgrid .row .pull_six.nine.columns:first-child, .sixteen.colgrid .row .pull_six.eleven.columns:first-child, .sixteen.colgrid .row .pull_six.twelve.columns:first-child, .sixteen.colgrid .row .pull_six.thirteen.columns:first-child, .sixteen.colgrid .row .pull_six.fourteen.columns:first-child, .sixteen.colgrid .row .pull_six.fifteen.columns:first-child, .sixteen.colgrid .row .pull_seven.one.column:first-child, .sixteen.colgrid .row .pull_seven.two.columns:first-child, .sixteen.colgrid .row .pull_seven.three.columns:first-child, .sixteen.colgrid .row .pull_seven.four.columns:first-child, .sixteen.colgrid .row .pull_seven.five.columns:first-child, .sixteen.colgrid .row .pull_seven.six.columns:first-child, .sixteen.colgrid .row .pull_seven.seven.columns:first-child, .sixteen.colgrid .row .pull_seven.eight.columns:first-child, .sixteen.colgrid .row .pull_seven.ten.columns:first-child, .sixteen.colgrid .row .pull_seven.eleven.columns:first-child, .sixteen.colgrid .row .pull_seven.twelve.columns:first-child, .sixteen.colgrid .row .pull_seven.thirteen.columns:first-child, .sixteen.colgrid .row .pull_seven.fourteen.columns:first-child, .sixteen.colgrid .row .pull_seven.fifteen.columns:first-child, .sixteen.colgrid .row .pull_eight.one.column:first-child, .sixteen.colgrid .row .pull_eight.two.columns:first-child, .sixteen.colgrid .row .pull_eight.three.columns:first-child, .sixteen.colgrid .row .pull_eight.four.columns:first-child, .sixteen.colgrid .row .pull_eight.five.columns:first-child, .sixteen.colgrid .row .pull_eight.six.columns:first-child, .sixteen.colgrid .row .pull_eight.seven.columns:first-child, .sixteen.colgrid .row .pull_eight.nine.columns:first-child, .sixteen.colgrid .row .pull_eight.ten.columns:first-child, .sixteen.colgrid .row .pull_eight.eleven.columns:first-child, .sixteen.colgrid .row .pull_eight.twelve.columns:first-child, .sixteen.colgrid .row .pull_eight.thirteen.columns:first-child, .sixteen.colgrid .row .pull_eight.fourteen.columns:first-child, .sixteen.colgrid .row .pull_eight.fifteen.columns:first-child, .sixteen.colgrid .row .pull_nine.one.column:first-child, .sixteen.colgrid .row .pull_nine.two.columns:first-child, .sixteen.colgrid .row .pull_nine.three.columns:first-child, .sixteen.colgrid .row .pull_nine.four.columns:first-child, .sixteen.colgrid .row .pull_nine.five.columns:first-child, .sixteen.colgrid .row .pull_nine.six.columns:first-child, .sixteen.colgrid .row .pull_nine.eight.columns:first-child, .sixteen.colgrid .row .pull_nine.nine.columns:first-child, .sixteen.colgrid .row .pull_nine.ten.columns:first-child, .sixteen.colgrid .row .pull_nine.eleven.columns:first-child, .sixteen.colgrid .row .pull_nine.twelve.columns:first-child, .sixteen.colgrid .row .pull_nine.thirteen.columns:first-child, .sixteen.colgrid .row .pull_nine.fourteen.columns:first-child, .sixteen.colgrid .row .pull_nine.fifteen.columns:first-child, .sixteen.colgrid .row .pull_ten.one.column:first-child, .sixteen.colgrid .row .pull_ten.two.columns:first-child, .sixteen.colgrid .row .pull_ten.three.columns:first-child, .sixteen.colgrid .row .pull_ten.four.columns:first-child, .sixteen.colgrid .row .pull_ten.five.columns:first-child, .sixteen.colgrid .row .pull_ten.seven.columns:first-child, .sixteen.colgrid .row .pull_ten.eight.columns:first-child, .sixteen.colgrid .row .pull_ten.nine.columns:first-child, .sixteen.colgrid .row .pull_ten.ten.columns:first-child, .sixteen.colgrid .row .pull_ten.eleven.columns:first-child, .sixteen.colgrid .row .pull_ten.twelve.columns:first-child, .sixteen.colgrid .row .pull_ten.thirteen.columns:first-child, .sixteen.colgrid .row .pull_ten.fourteen.columns:first-child, .sixteen.colgrid .row .pull_ten.fifteen.columns:first-child, .sixteen.colgrid .row .pull_eleven.one.column:first-child, .sixteen.colgrid .row .pull_eleven.two.columns:first-child, .sixteen.colgrid .row .pull_eleven.three.columns:first-child, .sixteen.colgrid .row .pull_eleven.four.columns:first-child, .sixteen.colgrid .row .pull_eleven.six.columns:first-child, .sixteen.colgrid .row .pull_eleven.seven.columns:first-child, .sixteen.colgrid .row .pull_eleven.eight.columns:first-child, .sixteen.colgrid .row .pull_eleven.nine.columns:first-child, .sixteen.colgrid .row .pull_eleven.ten.columns:first-child, .sixteen.colgrid .row .pull_eleven.eleven.columns:first-child, .sixteen.colgrid .row .pull_eleven.twelve.columns:first-child, .sixteen.colgrid .row .pull_eleven.thirteen.columns:first-child, .sixteen.colgrid .row .pull_eleven.fourteen.columns:first-child, .sixteen.colgrid .row .pull_eleven.fifteen.columns:first-child, .sixteen.colgrid .row .pull_twelve.one.column:first-child, .sixteen.colgrid .row .pull_twelve.two.columns:first-child, .sixteen.colgrid .row .pull_twelve.three.columns:first-child, .sixteen.colgrid .row .pull_twelve.five.columns:first-child, .sixteen.colgrid .row .pull_twelve.six.columns:first-child, .sixteen.colgrid .row .pull_twelve.seven.columns:first-child, .sixteen.colgrid .row .pull_twelve.eight.columns:first-child, .sixteen.colgrid .row .pull_twelve.nine.columns:first-child, .sixteen.colgrid .row .pull_twelve.ten.columns:first-child, .sixteen.colgrid .row .pull_twelve.eleven.columns:first-child, .sixteen.colgrid .row .pull_twelve.twelve.columns:first-child, .sixteen.colgrid .row .pull_twelve.thirteen.columns:first-child, .sixteen.colgrid .row .pull_twelve.fourteen.columns:first-child, .sixteen.colgrid .row .pull_twelve.fifteen.columns:first-child, .sixteen.colgrid .row .pull_thirteen.one.column:first-child, .sixteen.colgrid .row .pull_thirteen.two.columns:first-child, .sixteen.colgrid .row .pull_thirteen.four.columns:first-child, .sixteen.colgrid .row .pull_thirteen.five.columns:first-child, .sixteen.colgrid .row .pull_thirteen.six.columns:first-child, .sixteen.colgrid .row .pull_thirteen.seven.columns:first-child, .sixteen.colgrid .row .pull_thirteen.eight.columns:first-child, .sixteen.colgrid .row .pull_thirteen.nine.columns:first-child, .sixteen.colgrid .row .pull_thirteen.ten.columns:first-child, .sixteen.colgrid .row .pull_thirteen.eleven.columns:first-child, .sixteen.colgrid .row .pull_thirteen.twelve.columns:first-child, .sixteen.colgrid .row .pull_thirteen.thirteen.columns:first-child, .sixteen.colgrid .row .pull_thirteen.fourteen.columns:first-child, .sixteen.colgrid .row .pull_thirteen.fifteen.columns:first-child, .sixteen.colgrid .row .pull_fourteen.one.column:first-child, .sixteen.colgrid .row .pull_fourteen.three.columns:first-child, .sixteen.colgrid .row .pull_fourteen.four.columns:first-child, .sixteen.colgrid .row .pull_fourteen.five.columns:first-child, .sixteen.colgrid .row .pull_fourteen.six.columns:first-child, .sixteen.colgrid .row .pull_fourteen.seven.columns:first-child, .sixteen.colgrid .row .pull_fourteen.eight.columns:first-child, .sixteen.colgrid .row .pull_fourteen.nine.columns:first-child, .sixteen.colgrid .row .pull_fourteen.ten.columns:first-child, .sixteen.colgrid .row .pull_fourteen.eleven.columns:first-child, .sixteen.colgrid .row .pull_fourteen.twelve.columns:first-child, .sixteen.colgrid .row .pull_fourteen.thirteen.columns:first-child, .sixteen.colgrid .row .pull_fourteen.fourteen.columns:first-child, .sixteen.colgrid .row .pull_fourteen.fifteen.columns:first-child, .sixteen.colgrid .row .pull_fifteen.two.columns:first-child, .sixteen.colgrid .row .pull_fifteen.three.columns:first-child, .sixteen.colgrid .row .pull_fifteen.four.columns:first-child, .sixteen.colgrid .row .pull_fifteen.five.columns:first-child, .sixteen.colgrid .row .pull_fifteen.six.columns:first-child, .sixteen.colgrid .row .pull_fifteen.seven.columns:first-child, .sixteen.colgrid .row .pull_fifteen.eight.columns:first-child, .sixteen.colgrid .row .pull_fifteen.nine.columns:first-child, .sixteen.colgrid .row .pull_fifteen.ten.columns:first-child, .sixteen.colgrid .row .pull_fifteen.eleven.columns:first-child, .sixteen.colgrid .row .pull_fifteen.twelve.columns:first-child, .sixteen.colgrid .row .pull_fifteen.thirteen.columns:first-child, .sixteen.colgrid .row .pull_fifteen.fourteen.columns:first-child, .sixteen.colgrid .row .pull_fifteen.fifteen.columns:first-child { margin-left: 0; }
-
-/*=================================================
-
- +++ LE GRID +++
- A Responsive Grid -- Gumby defaults to a standard 960 grid,
- but you can change it to whatever you'd like.
- ==================================================*/
-/*.container {
- padding: 0 $gutter-in-px;
-}*/
-.row { width: 100%; max-width: 980px; min-width: 320px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
-.row .row { min-width: 0; padding-left: 0; padding-right: 0; }
-
-/* To fix the grid into a different size, set max-width to your desired width */
-.column, .columns { margin-left: 2.12766%; float: left; min-height: 1px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
-
-.column:first-child, .columns:first-child, .alpha { margin-left: 0; }
-
-.column.omega, .columns.omega { float: right; }
-
-/* Column Classes */
-.row .one.column { width: 6.38298%; }
-.row .one.columns { width: 6.38298%; }
-.row .two.columns { width: 14.89362%; }
-.row .three.columns { width: 23.40426%; }
-.row .four.columns { width: 31.91489%; }
-.row .five.columns { width: 40.42553%; }
-.row .six.columns { width: 48.93617%; }
-.row .seven.columns { width: 57.44681%; }
-.row .eight.columns { width: 65.95745%; }
-.row .nine.columns { width: 74.46809%; }
-.row .ten.columns { width: 82.97872%; }
-.row .eleven.columns { width: 91.48936%; }
-.row .twelve.columns { width: 100%; }
-
-/* Push and Pull Classes */
-.row .push_one { margin-left: 10.6383%; }
-.row .push_one:first-child { margin-left: 8.51064%; }
-.row .pull_one.one.column { margin-left: -14.89362%; }
-.row .pull_one.two.columns { margin-left: -23.40426%; }
-.row .pull_one.three.columns { margin-left: -31.91489%; }
-.row .pull_one.four.columns { margin-left: -40.42553%; }
-.row .pull_one.five.columns { margin-left: -48.93617%; }
-.row .pull_one.six.columns { margin-left: -57.44681%; }
-.row .pull_one.seven.columns { margin-left: -65.95745%; }
-.row .pull_one.eight.columns { margin-left: -74.46809%; }
-.row .pull_one.nine.columns { margin-left: -82.97872%; }
-.row .pull_one.ten.columns { margin-left: -91.48936%; }
-.row .push_two { margin-left: 19.14894%; }
-.row .push_two:first-child { margin-left: 17.02128%; }
-.row .pull_two.one.column { margin-left: -23.40426%; }
-.row .pull_two.two.columns { margin-left: -31.91489%; }
-.row .pull_two.three.columns { margin-left: -40.42553%; }
-.row .pull_two.four.columns { margin-left: -48.93617%; }
-.row .pull_two.five.columns { margin-left: -57.44681%; }
-.row .pull_two.six.columns { margin-left: -65.95745%; }
-.row .pull_two.seven.columns { margin-left: -74.46809%; }
-.row .pull_two.eight.columns { margin-left: -82.97872%; }
-.row .pull_two.nine.columns { margin-left: -91.48936%; }
-.row .pull_two.eleven.columns { margin-left: -108.51064%; }
-.row .push_three { margin-left: 27.65957%; }
-.row .push_three:first-child { margin-left: 25.53191%; }
-.row .pull_three.one.column { margin-left: -31.91489%; }
-.row .pull_three.two.columns { margin-left: -40.42553%; }
-.row .pull_three.three.columns { margin-left: -48.93617%; }
-.row .pull_three.four.columns { margin-left: -57.44681%; }
-.row .pull_three.five.columns { margin-left: -65.95745%; }
-.row .pull_three.six.columns { margin-left: -74.46809%; }
-.row .pull_three.seven.columns { margin-left: -82.97872%; }
-.row .pull_three.eight.columns { margin-left: -91.48936%; }
-.row .pull_three.ten.columns { margin-left: -108.51064%; }
-.row .pull_three.eleven.columns { margin-left: -117.02128%; }
-.row .push_four { margin-left: 36.17021%; }
-.row .push_four:first-child { margin-left: 34.04255%; }
-.row .pull_four.one.column { margin-left: -40.42553%; }
-.row .pull_four.two.columns { margin-left: -48.93617%; }
-.row .pull_four.three.columns { margin-left: -57.44681%; }
-.row .pull_four.four.columns { margin-left: -65.95745%; }
-.row .pull_four.five.columns { margin-left: -74.46809%; }
-.row .pull_four.six.columns { margin-left: -82.97872%; }
-.row .pull_four.seven.columns { margin-left: -91.48936%; }
-.row .pull_four.nine.columns { margin-left: -108.51064%; }
-.row .pull_four.ten.columns { margin-left: -117.02128%; }
-.row .pull_four.eleven.columns { margin-left: -125.53191%; }
-.row .push_five { margin-left: 44.68085%; }
-.row .push_five:first-child { margin-left: 42.55319%; }
-.row .pull_five.one.column { margin-left: -48.93617%; }
-.row .pull_five.two.columns { margin-left: -57.44681%; }
-.row .pull_five.three.columns { margin-left: -65.95745%; }
-.row .pull_five.four.columns { margin-left: -74.46809%; }
-.row .pull_five.five.columns { margin-left: -82.97872%; }
-.row .pull_five.six.columns { margin-left: -91.48936%; }
-.row .pull_five.eight.columns { margin-left: -108.51064%; }
-.row .pull_five.nine.columns { margin-left: -117.02128%; }
-.row .pull_five.ten.columns { margin-left: -125.53191%; }
-.row .pull_five.eleven.columns { margin-left: -134.04255%; }
-.row .push_six { margin-left: 53.19149%; }
-.row .push_six:first-child { margin-left: 51.06383%; }
-.row .pull_six.one.column { margin-left: -57.44681%; }
-.row .pull_six.two.columns { margin-left: -65.95745%; }
-.row .pull_six.three.columns { margin-left: -74.46809%; }
-.row .pull_six.four.columns { margin-left: -82.97872%; }
-.row .pull_six.five.columns { margin-left: -91.48936%; }
-.row .pull_six.seven.columns { margin-left: -108.51064%; }
-.row .pull_six.eight.columns { margin-left: -117.02128%; }
-.row .pull_six.nine.columns { margin-left: -125.53191%; }
-.row .pull_six.ten.columns { margin-left: -134.04255%; }
-.row .pull_six.eleven.columns { margin-left: -142.55319%; }
-.row .push_seven { margin-left: 61.70213%; }
-.row .push_seven:first-child { margin-left: 59.57447%; }
-.row .pull_seven.one.column { margin-left: -65.95745%; }
-.row .pull_seven.two.columns { margin-left: -74.46809%; }
-.row .pull_seven.three.columns { margin-left: -82.97872%; }
-.row .pull_seven.four.columns { margin-left: -91.48936%; }
-.row .pull_seven.six.columns { margin-left: -108.51064%; }
-.row .pull_seven.seven.columns { margin-left: -117.02128%; }
-.row .pull_seven.eight.columns { margin-left: -125.53191%; }
-.row .pull_seven.nine.columns { margin-left: -134.04255%; }
-.row .pull_seven.ten.columns { margin-left: -142.55319%; }
-.row .pull_seven.eleven.columns { margin-left: -151.06383%; }
-.row .push_eight { margin-left: 70.21277%; }
-.row .push_eight:first-child { margin-left: 68.08511%; }
-.row .pull_eight.one.column { margin-left: -74.46809%; }
-.row .pull_eight.two.columns { margin-left: -82.97872%; }
-.row .pull_eight.three.columns { margin-left: -91.48936%; }
-.row .pull_eight.five.columns { margin-left: -108.51064%; }
-.row .pull_eight.six.columns { margin-left: -117.02128%; }
-.row .pull_eight.seven.columns { margin-left: -125.53191%; }
-.row .pull_eight.eight.columns { margin-left: -134.04255%; }
-.row .pull_eight.nine.columns { margin-left: -142.55319%; }
-.row .pull_eight.ten.columns { margin-left: -151.06383%; }
-.row .pull_eight.eleven.columns { margin-left: -159.57447%; }
-.row .push_nine { margin-left: 78.7234%; }
-.row .push_nine:first-child { margin-left: 76.59574%; }
-.row .pull_nine.one.column { margin-left: -82.97872%; }
-.row .pull_nine.two.columns { margin-left: -91.48936%; }
-.row .pull_nine.four.columns { margin-left: -108.51064%; }
-.row .pull_nine.five.columns { margin-left: -117.02128%; }
-.row .pull_nine.six.columns { margin-left: -125.53191%; }
-.row .pull_nine.seven.columns { margin-left: -134.04255%; }
-.row .pull_nine.eight.columns { margin-left: -142.55319%; }
-.row .pull_nine.nine.columns { margin-left: -151.06383%; }
-.row .pull_nine.ten.columns { margin-left: -159.57447%; }
-.row .pull_nine.eleven.columns { margin-left: -168.08511%; }
-.row .push_ten { margin-left: 87.23404%; }
-.row .push_ten:first-child { margin-left: 85.10638%; }
-.row .pull_ten.one.column { margin-left: -91.48936%; }
-.row .pull_ten.three.columns { margin-left: -108.51064%; }
-.row .pull_ten.four.columns { margin-left: -117.02128%; }
-.row .pull_ten.five.columns { margin-left: -125.53191%; }
-.row .pull_ten.six.columns { margin-left: -134.04255%; }
-.row .pull_ten.seven.columns { margin-left: -142.55319%; }
-.row .pull_ten.eight.columns { margin-left: -151.06383%; }
-.row .pull_ten.nine.columns { margin-left: -159.57447%; }
-.row .pull_ten.ten.columns { margin-left: -168.08511%; }
-.row .pull_ten.eleven.columns { margin-left: -176.59574%; }
-.row .push_eleven { margin-left: 95.74468%; }
-.row .push_eleven:first-child { margin-left: 93.61702%; }
-.row .pull_eleven.two.columns { margin-left: -108.51064%; }
-.row .pull_eleven.three.columns { margin-left: -117.02128%; }
-.row .pull_eleven.four.columns { margin-left: -125.53191%; }
-.row .pull_eleven.five.columns { margin-left: -134.04255%; }
-.row .pull_eleven.six.columns { margin-left: -142.55319%; }
-.row .pull_eleven.seven.columns { margin-left: -151.06383%; }
-.row .pull_eleven.eight.columns { margin-left: -159.57447%; }
-.row .pull_eleven.nine.columns { margin-left: -168.08511%; }
-.row .pull_eleven.ten.columns { margin-left: -176.59574%; }
-.row .pull_eleven.eleven.columns { margin-left: -185.10638%; }
-
-/* Centered Classes */
-.row .one.centered { margin-left: 46.80851%; }
-.row .two.centered { margin-left: 42.55319%; }
-.row .three.centered { margin-left: 38.29787%; }
-.row .four.centered { margin-left: 34.04255%; }
-.row .five.centered { margin-left: 29.78723%; }
-.row .six.centered { margin-left: 25.53191%; }
-.row .seven.centered { margin-left: 21.2766%; }
-.row .eight.centered { margin-left: 17.02128%; }
-.row .nine.centered { margin-left: 12.76596%; }
-.row .ten.centered { margin-left: 8.51064%; }
-.row .eleven.centered { margin-left: 4.25532%; }
-
-/* Hybrid Grid Columns */
-.sixteen.colgrid .row .one.column { width: 4.25532%; }
-.sixteen.colgrid .row .one.columns { width: 4.25532%; }
-.sixteen.colgrid .row .two.columns { width: 10.6383%; }
-.sixteen.colgrid .row .three.columns { width: 17.02128%; }
-.sixteen.colgrid .row .four.columns { width: 23.40426%; }
-.sixteen.colgrid .row .five.columns { width: 29.78723%; }
-.sixteen.colgrid .row .six.columns { width: 36.17021%; }
-.sixteen.colgrid .row .seven.columns { width: 42.55319%; }
-.sixteen.colgrid .row .eight.columns { width: 48.93617%; }
-.sixteen.colgrid .row .nine.columns { width: 55.31915%; }
-.sixteen.colgrid .row .ten.columns { width: 61.70213%; }
-.sixteen.colgrid .row .eleven.columns { width: 68.08511%; }
-.sixteen.colgrid .row .twelve.columns { width: 74.46809%; }
-.sixteen.colgrid .row .thirteen.columns { width: 80.85106%; }
-.sixteen.colgrid .row .fourteen.columns { width: 87.23404%; }
-.sixteen.colgrid .row .fifteen.columns { width: 93.61702%; }
-.sixteen.colgrid .row .sixteen.columns { width: 100%; }
-
-/* Hybrid Push and Pull Classes */
-.sixteen.colgrid .row .push_one { margin-left: 8.51064%; }
-.sixteen.colgrid .row .push_one:first-child { margin-left: 6.38298%; }
-.sixteen.colgrid .row .pull_one.one.column { margin-left: -10.6383%; }
-.sixteen.colgrid .row .pull_one.two.columns { margin-left: -17.02128%; }
-.sixteen.colgrid .row .pull_one.three.columns { margin-left: -23.40426%; }
-.sixteen.colgrid .row .pull_one.four.columns { margin-left: -29.78723%; }
-.sixteen.colgrid .row .pull_one.five.columns { margin-left: -36.17021%; }
-.sixteen.colgrid .row .pull_one.six.columns { margin-left: -42.55319%; }
-.sixteen.colgrid .row .pull_one.seven.columns { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_one.eight.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_one.nine.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_one.ten.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_one.eleven.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_one.twelve.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_one.thirteen.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_one.fourteen.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .push_two { margin-left: 14.89362%; }
-.sixteen.colgrid .row .push_two:first-child { margin-left: 12.76596%; }
-.sixteen.colgrid .row .pull_two.one.column { margin-left: -17.02128%; }
-.sixteen.colgrid .row .pull_two.two.columns { margin-left: -23.40426%; }
-.sixteen.colgrid .row .pull_two.three.columns { margin-left: -29.78723%; }
-.sixteen.colgrid .row .pull_two.four.columns { margin-left: -36.17021%; }
-.sixteen.colgrid .row .pull_two.five.columns { margin-left: -42.55319%; }
-.sixteen.colgrid .row .pull_two.six.columns { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_two.seven.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_two.eight.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_two.nine.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_two.ten.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_two.eleven.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_two.twelve.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_two.thirteen.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_two.fifteen.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .push_three { margin-left: 21.2766%; }
-.sixteen.colgrid .row .push_three:first-child { margin-left: 19.14894%; }
-.sixteen.colgrid .row .pull_three.one.column { margin-left: -23.40426%; }
-.sixteen.colgrid .row .pull_three.two.columns { margin-left: -29.78723%; }
-.sixteen.colgrid .row .pull_three.three.columns { margin-left: -36.17021%; }
-.sixteen.colgrid .row .pull_three.four.columns { margin-left: -42.55319%; }
-.sixteen.colgrid .row .pull_three.five.columns { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_three.six.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_three.seven.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_three.eight.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_three.nine.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_three.ten.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_three.eleven.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_three.twelve.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_three.fourteen.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_three.fifteen.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .push_four { margin-left: 27.65957%; }
-.sixteen.colgrid .row .push_four:first-child { margin-left: 25.53191%; }
-.sixteen.colgrid .row .pull_four.one.column { margin-left: -29.78723%; }
-.sixteen.colgrid .row .pull_four.two.columns { margin-left: -36.17021%; }
-.sixteen.colgrid .row .pull_four.three.columns { margin-left: -42.55319%; }
-.sixteen.colgrid .row .pull_four.four.columns { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_four.five.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_four.six.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_four.seven.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_four.eight.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_four.nine.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_four.ten.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_four.eleven.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_four.thirteen.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_four.fourteen.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_four.fifteen.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .push_five { margin-left: 34.04255%; }
-.sixteen.colgrid .row .push_five:first-child { margin-left: 31.91489%; }
-.sixteen.colgrid .row .pull_five.one.column { margin-left: -36.17021%; }
-.sixteen.colgrid .row .pull_five.two.columns { margin-left: -42.55319%; }
-.sixteen.colgrid .row .pull_five.three.columns { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_five.four.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_five.five.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_five.six.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_five.seven.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_five.eight.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_five.nine.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_five.ten.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_five.twelve.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_five.thirteen.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_five.fourteen.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_five.fifteen.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .push_six { margin-left: 40.42553%; }
-.sixteen.colgrid .row .push_six:first-child { margin-left: 38.29787%; }
-.sixteen.colgrid .row .pull_six.one.column { margin-left: -42.55319%; }
-.sixteen.colgrid .row .pull_six.two.columns { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_six.three.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_six.four.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_six.five.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_six.six.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_six.seven.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_six.eight.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_six.nine.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_six.eleven.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_six.twelve.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_six.thirteen.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_six.fourteen.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_six.fifteen.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .push_seven { margin-left: 46.80851%; }
-.sixteen.colgrid .row .push_seven:first-child { margin-left: 44.68085%; }
-.sixteen.colgrid .row .pull_seven.one.column { margin-left: -48.93617%; }
-.sixteen.colgrid .row .pull_seven.two.columns { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_seven.three.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_seven.four.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_seven.five.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_seven.six.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_seven.seven.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_seven.eight.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_seven.ten.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_seven.eleven.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_seven.twelve.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_seven.thirteen.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_seven.fourteen.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_seven.fifteen.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .push_eight { margin-left: 53.19149%; }
-.sixteen.colgrid .row .push_eight:first-child { margin-left: 51.06383%; }
-.sixteen.colgrid .row .pull_eight.one.column { margin-left: -55.31915%; }
-.sixteen.colgrid .row .pull_eight.two.columns { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_eight.three.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_eight.four.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_eight.five.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_eight.six.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_eight.seven.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_eight.nine.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_eight.ten.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_eight.eleven.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_eight.twelve.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_eight.thirteen.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_eight.fourteen.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_eight.fifteen.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .push_nine { margin-left: 59.57447%; }
-.sixteen.colgrid .row .push_nine:first-child { margin-left: 57.44681%; }
-.sixteen.colgrid .row .pull_nine.one.column { margin-left: -61.70213%; }
-.sixteen.colgrid .row .pull_nine.two.columns { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_nine.three.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_nine.four.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_nine.five.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_nine.six.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_nine.eight.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_nine.nine.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_nine.ten.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_nine.eleven.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_nine.twelve.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_nine.thirteen.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_nine.fourteen.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_nine.fifteen.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .push_ten { margin-left: 65.95745%; }
-.sixteen.colgrid .row .push_ten:first-child { margin-left: 63.82979%; }
-.sixteen.colgrid .row .pull_ten.one.column { margin-left: -68.08511%; }
-.sixteen.colgrid .row .pull_ten.two.columns { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_ten.three.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_ten.four.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_ten.five.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_ten.seven.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_ten.eight.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_ten.nine.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_ten.ten.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_ten.eleven.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_ten.twelve.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_ten.thirteen.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_ten.fourteen.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .pull_ten.fifteen.columns { margin-left: -157.44681%; }
-.sixteen.colgrid .row .push_eleven { margin-left: 72.34043%; }
-.sixteen.colgrid .row .push_eleven:first-child { margin-left: 70.21277%; }
-.sixteen.colgrid .row .pull_eleven.one.column { margin-left: -74.46809%; }
-.sixteen.colgrid .row .pull_eleven.two.columns { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_eleven.three.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_eleven.four.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_eleven.six.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_eleven.seven.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_eleven.eight.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_eleven.nine.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_eleven.ten.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_eleven.eleven.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_eleven.twelve.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_eleven.thirteen.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .pull_eleven.fourteen.columns { margin-left: -157.44681%; }
-.sixteen.colgrid .row .pull_eleven.fifteen.columns { margin-left: -163.82979%; }
-.sixteen.colgrid .row .push_twelve { margin-left: 78.7234%; }
-.sixteen.colgrid .row .push_twelve:first-child { margin-left: 76.59574%; }
-.sixteen.colgrid .row .pull_twelve.one.column { margin-left: -80.85106%; }
-.sixteen.colgrid .row .pull_twelve.two.columns { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_twelve.three.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_twelve.five.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_twelve.six.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_twelve.seven.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_twelve.eight.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_twelve.nine.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_twelve.ten.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_twelve.eleven.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_twelve.twelve.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .pull_twelve.thirteen.columns { margin-left: -157.44681%; }
-.sixteen.colgrid .row .pull_twelve.fourteen.columns { margin-left: -163.82979%; }
-.sixteen.colgrid .row .pull_twelve.fifteen.columns { margin-left: -170.21277%; }
-.sixteen.colgrid .row .push_thirteen { margin-left: 85.10638%; }
-.sixteen.colgrid .row .push_thirteen:first-child { margin-left: 82.97872%; }
-.sixteen.colgrid .row .pull_thirteen.one.column { margin-left: -87.23404%; }
-.sixteen.colgrid .row .pull_thirteen.two.columns { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_thirteen.four.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_thirteen.five.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_thirteen.six.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_thirteen.seven.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_thirteen.eight.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_thirteen.nine.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_thirteen.ten.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_thirteen.eleven.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .pull_thirteen.twelve.columns { margin-left: -157.44681%; }
-.sixteen.colgrid .row .pull_thirteen.thirteen.columns { margin-left: -163.82979%; }
-.sixteen.colgrid .row .pull_thirteen.fourteen.columns { margin-left: -170.21277%; }
-.sixteen.colgrid .row .pull_thirteen.fifteen.columns { margin-left: -176.59574%; }
-.sixteen.colgrid .row .push_fourteen { margin-left: 91.48936%; }
-.sixteen.colgrid .row .push_fourteen:first-child { margin-left: 89.3617%; }
-.sixteen.colgrid .row .pull_fourteen.one.column { margin-left: -93.61702%; }
-.sixteen.colgrid .row .pull_fourteen.three.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_fourteen.four.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_fourteen.five.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_fourteen.six.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_fourteen.seven.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_fourteen.eight.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_fourteen.nine.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_fourteen.ten.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .pull_fourteen.eleven.columns { margin-left: -157.44681%; }
-.sixteen.colgrid .row .pull_fourteen.twelve.columns { margin-left: -163.82979%; }
-.sixteen.colgrid .row .pull_fourteen.thirteen.columns { margin-left: -170.21277%; }
-.sixteen.colgrid .row .pull_fourteen.fourteen.columns { margin-left: -176.59574%; }
-.sixteen.colgrid .row .pull_fourteen.fifteen.columns { margin-left: -182.97872%; }
-.sixteen.colgrid .row .push_fifteen { margin-left: 97.87234%; }
-.sixteen.colgrid .row .push_fifteen:first-child { margin-left: 95.74468%; }
-.sixteen.colgrid .row .pull_fifteen.two.columns { margin-left: -106.38298%; }
-.sixteen.colgrid .row .pull_fifteen.three.columns { margin-left: -112.76596%; }
-.sixteen.colgrid .row .pull_fifteen.four.columns { margin-left: -119.14894%; }
-.sixteen.colgrid .row .pull_fifteen.five.columns { margin-left: -125.53191%; }
-.sixteen.colgrid .row .pull_fifteen.six.columns { margin-left: -131.91489%; }
-.sixteen.colgrid .row .pull_fifteen.seven.columns { margin-left: -138.29787%; }
-.sixteen.colgrid .row .pull_fifteen.eight.columns { margin-left: -144.68085%; }
-.sixteen.colgrid .row .pull_fifteen.nine.columns { margin-left: -151.06383%; }
-.sixteen.colgrid .row .pull_fifteen.ten.columns { margin-left: -157.44681%; }
-.sixteen.colgrid .row .pull_fifteen.eleven.columns { margin-left: -163.82979%; }
-.sixteen.colgrid .row .pull_fifteen.twelve.columns { margin-left: -170.21277%; }
-.sixteen.colgrid .row .pull_fifteen.thirteen.columns { margin-left: -176.59574%; }
-.sixteen.colgrid .row .pull_fifteen.fourteen.columns { margin-left: -182.97872%; }
-.sixteen.colgrid .row .pull_fifteen.fifteen.columns { margin-left: -189.3617%; }
-
-.row .pull_one.one.column:first-child, .row .pull_one.two.columns:first-child, .row .pull_one.three.columns:first-child, .row .pull_one.four.columns:first-child, .row .pull_one.five.columns:first-child, .row .pull_one.six.columns:first-child, .row .pull_one.seven.columns:first-child, .row .pull_one.eight.columns:first-child, .row .pull_one.nine.columns:first-child, .row .pull_one.ten.columns:first-child, .row .pull_two.one.column:first-child, .row .pull_two.two.columns:first-child, .row .pull_two.three.columns:first-child, .row .pull_two.four.columns:first-child, .row .pull_two.five.columns:first-child, .row .pull_two.six.columns:first-child, .row .pull_two.seven.columns:first-child, .row .pull_two.eight.columns:first-child, .row .pull_two.nine.columns:first-child, .row .pull_two.eleven.columns:first-child, .row .pull_three.one.column:first-child, .row .pull_three.two.columns:first-child, .row .pull_three.three.columns:first-child, .row .pull_three.four.columns:first-child, .row .pull_three.five.columns:first-child, .row .pull_three.six.columns:first-child, .row .pull_three.seven.columns:first-child, .row .pull_three.eight.columns:first-child, .row .pull_three.ten.columns:first-child, .row .pull_three.eleven.columns:first-child, .row .pull_four.one.column:first-child, .row .pull_four.two.columns:first-child, .row .pull_four.three.columns:first-child, .row .pull_four.four.columns:first-child, .row .pull_four.five.columns:first-child, .row .pull_four.six.columns:first-child, .row .pull_four.seven.columns:first-child, .row .pull_four.nine.columns:first-child, .row .pull_four.ten.columns:first-child, .row .pull_four.eleven.columns:first-child, .row .pull_five.one.column:first-child, .row .pull_five.two.columns:first-child, .row .pull_five.three.columns:first-child, .row .pull_five.four.columns:first-child, .row .pull_five.five.columns:first-child, .row .pull_five.six.columns:first-child, .row .pull_five.eight.columns:first-child, .row .pull_five.nine.columns:first-child, .row .pull_five.ten.columns:first-child, .row .pull_five.eleven.columns:first-child, .row .pull_six.one.column:first-child, .row .pull_six.two.columns:first-child, .row .pull_six.three.columns:first-child, .row .pull_six.four.columns:first-child, .row .pull_six.five.columns:first-child, .row .pull_six.seven.columns:first-child, .row .pull_six.eight.columns:first-child, .row .pull_six.nine.columns:first-child, .row .pull_six.ten.columns:first-child, .row .pull_six.eleven.columns:first-child, .row .pull_seven.one.column:first-child, .row .pull_seven.two.columns:first-child, .row .pull_seven.three.columns:first-child, .row .pull_seven.four.columns:first-child, .row .pull_seven.six.columns:first-child, .row .pull_seven.seven.columns:first-child, .row .pull_seven.eight.columns:first-child, .row .pull_seven.nine.columns:first-child, .row .pull_seven.ten.columns:first-child, .row .pull_seven.eleven.columns:first-child, .row .pull_eight.one.column:first-child, .row .pull_eight.two.columns:first-child, .row .pull_eight.three.columns:first-child, .row .pull_eight.five.columns:first-child, .row .pull_eight.six.columns:first-child, .row .pull_eight.seven.columns:first-child, .row .pull_eight.eight.columns:first-child, .row .pull_eight.nine.columns:first-child, .row .pull_eight.ten.columns:first-child, .row .pull_eight.eleven.columns:first-child, .row .pull_nine.one.column:first-child, .row .pull_nine.two.columns:first-child, .row .pull_nine.four.columns:first-child, .row .pull_nine.five.columns:first-child, .row .pull_nine.six.columns:first-child, .row .pull_nine.seven.columns:first-child, .row .pull_nine.eight.columns:first-child, .row .pull_nine.nine.columns:first-child, .row .pull_nine.ten.columns:first-child, .row .pull_nine.eleven.columns:first-child, .row .pull_ten.one.column:first-child, .row .pull_ten.three.columns:first-child, .row .pull_ten.four.columns:first-child, .row .pull_ten.five.columns:first-child, .row .pull_ten.six.columns:first-child, .row .pull_ten.seven.columns:first-child, .row .pull_ten.eight.columns:first-child, .row .pull_ten.nine.columns:first-child, .row .pull_ten.ten.columns:first-child, .row .pull_ten.eleven.columns:first-child, .row .pull_eleven.two.columns:first-child, .row .pull_eleven.three.columns:first-child, .row .pull_eleven.four.columns:first-child, .row .pull_eleven.five.columns:first-child, .row .pull_eleven.six.columns:first-child, .row .pull_eleven.seven.columns:first-child, .row .pull_eleven.eight.columns:first-child, .row .pull_eleven.nine.columns:first-child, .row .pull_eleven.ten.columns:first-child, .row .pull_eleven.eleven.columns:first-child, .sixteen.colgrid .row .pull_one.one.column:first-child, .sixteen.colgrid .row .pull_one.two.columns:first-child, .sixteen.colgrid .row .pull_one.three.columns:first-child, .sixteen.colgrid .row .pull_one.four.columns:first-child, .sixteen.colgrid .row .pull_one.five.columns:first-child, .sixteen.colgrid .row .pull_one.six.columns:first-child, .sixteen.colgrid .row .pull_one.seven.columns:first-child, .sixteen.colgrid .row .pull_one.eight.columns:first-child, .sixteen.colgrid .row .pull_one.nine.columns:first-child, .sixteen.colgrid .row .pull_one.ten.columns:first-child, .sixteen.colgrid .row .pull_one.eleven.columns:first-child, .sixteen.colgrid .row .pull_one.twelve.columns:first-child, .sixteen.colgrid .row .pull_one.thirteen.columns:first-child, .sixteen.colgrid .row .pull_one.fourteen.columns:first-child, .sixteen.colgrid .row .pull_two.one.column:first-child, .sixteen.colgrid .row .pull_two.two.columns:first-child, .sixteen.colgrid .row .pull_two.three.columns:first-child, .sixteen.colgrid .row .pull_two.four.columns:first-child, .sixteen.colgrid .row .pull_two.five.columns:first-child, .sixteen.colgrid .row .pull_two.six.columns:first-child, .sixteen.colgrid .row .pull_two.seven.columns:first-child, .sixteen.colgrid .row .pull_two.eight.columns:first-child, .sixteen.colgrid .row .pull_two.nine.columns:first-child, .sixteen.colgrid .row .pull_two.ten.columns:first-child, .sixteen.colgrid .row .pull_two.eleven.columns:first-child, .sixteen.colgrid .row .pull_two.twelve.columns:first-child, .sixteen.colgrid .row .pull_two.thirteen.columns:first-child, .sixteen.colgrid .row .pull_two.fifteen.columns:first-child, .sixteen.colgrid .row .pull_three.one.column:first-child, .sixteen.colgrid .row .pull_three.two.columns:first-child, .sixteen.colgrid .row .pull_three.three.columns:first-child, .sixteen.colgrid .row .pull_three.four.columns:first-child, .sixteen.colgrid .row .pull_three.five.columns:first-child, .sixteen.colgrid .row .pull_three.six.columns:first-child, .sixteen.colgrid .row .pull_three.seven.columns:first-child, .sixteen.colgrid .row .pull_three.eight.columns:first-child, .sixteen.colgrid .row .pull_three.nine.columns:first-child, .sixteen.colgrid .row .pull_three.ten.columns:first-child, .sixteen.colgrid .row .pull_three.eleven.columns:first-child, .sixteen.colgrid .row .pull_three.twelve.columns:first-child, .sixteen.colgrid .row .pull_three.fourteen.columns:first-child, .sixteen.colgrid .row .pull_three.fifteen.columns:first-child, .sixteen.colgrid .row .pull_four.one.column:first-child, .sixteen.colgrid .row .pull_four.two.columns:first-child, .sixteen.colgrid .row .pull_four.three.columns:first-child, .sixteen.colgrid .row .pull_four.four.columns:first-child, .sixteen.colgrid .row .pull_four.five.columns:first-child, .sixteen.colgrid .row .pull_four.six.columns:first-child, .sixteen.colgrid .row .pull_four.seven.columns:first-child, .sixteen.colgrid .row .pull_four.eight.columns:first-child, .sixteen.colgrid .row .pull_four.nine.columns:first-child, .sixteen.colgrid .row .pull_four.ten.columns:first-child, .sixteen.colgrid .row .pull_four.eleven.columns:first-child, .sixteen.colgrid .row .pull_four.thirteen.columns:first-child, .sixteen.colgrid .row .pull_four.fourteen.columns:first-child, .sixteen.colgrid .row .pull_four.fifteen.columns:first-child, .sixteen.colgrid .row .pull_five.one.column:first-child, .sixteen.colgrid .row .pull_five.two.columns:first-child, .sixteen.colgrid .row .pull_five.three.columns:first-child, .sixteen.colgrid .row .pull_five.four.columns:first-child, .sixteen.colgrid .row .pull_five.five.columns:first-child, .sixteen.colgrid .row .pull_five.six.columns:first-child, .sixteen.colgrid .row .pull_five.seven.columns:first-child, .sixteen.colgrid .row .pull_five.eight.columns:first-child, .sixteen.colgrid .row .pull_five.nine.columns:first-child, .sixteen.colgrid .row .pull_five.ten.columns:first-child, .sixteen.colgrid .row .pull_five.twelve.columns:first-child, .sixteen.colgrid .row .pull_five.thirteen.columns:first-child, .sixteen.colgrid .row .pull_five.fourteen.columns:first-child, .sixteen.colgrid .row .pull_five.fifteen.columns:first-child, .sixteen.colgrid .row .pull_six.one.column:first-child, .sixteen.colgrid .row .pull_six.two.columns:first-child, .sixteen.colgrid .row .pull_six.three.columns:first-child, .sixteen.colgrid .row .pull_six.four.columns:first-child, .sixteen.colgrid .row .pull_six.five.columns:first-child, .sixteen.colgrid .row .pull_six.six.columns:first-child, .sixteen.colgrid .row .pull_six.seven.columns:first-child, .sixteen.colgrid .row .pull_six.eight.columns:first-child, .sixteen.colgrid .row .pull_six.nine.columns:first-child, .sixteen.colgrid .row .pull_six.eleven.columns:first-child, .sixteen.colgrid .row .pull_six.twelve.columns:first-child, .sixteen.colgrid .row .pull_six.thirteen.columns:first-child, .sixteen.colgrid .row .pull_six.fourteen.columns:first-child, .sixteen.colgrid .row .pull_six.fifteen.columns:first-child, .sixteen.colgrid .row .pull_seven.one.column:first-child, .sixteen.colgrid .row .pull_seven.two.columns:first-child, .sixteen.colgrid .row .pull_seven.three.columns:first-child, .sixteen.colgrid .row .pull_seven.four.columns:first-child, .sixteen.colgrid .row .pull_seven.five.columns:first-child, .sixteen.colgrid .row .pull_seven.six.columns:first-child, .sixteen.colgrid .row .pull_seven.seven.columns:first-child, .sixteen.colgrid .row .pull_seven.eight.columns:first-child, .sixteen.colgrid .row .pull_seven.ten.columns:first-child, .sixteen.colgrid .row .pull_seven.eleven.columns:first-child, .sixteen.colgrid .row .pull_seven.twelve.columns:first-child, .sixteen.colgrid .row .pull_seven.thirteen.columns:first-child, .sixteen.colgrid .row .pull_seven.fourteen.columns:first-child, .sixteen.colgrid .row .pull_seven.fifteen.columns:first-child, .sixteen.colgrid .row .pull_eight.one.column:first-child, .sixteen.colgrid .row .pull_eight.two.columns:first-child, .sixteen.colgrid .row .pull_eight.three.columns:first-child, .sixteen.colgrid .row .pull_eight.four.columns:first-child, .sixteen.colgrid .row .pull_eight.five.columns:first-child, .sixteen.colgrid .row .pull_eight.six.columns:first-child, .sixteen.colgrid .row .pull_eight.seven.columns:first-child, .sixteen.colgrid .row .pull_eight.nine.columns:first-child, .sixteen.colgrid .row .pull_eight.ten.columns:first-child, .sixteen.colgrid .row .pull_eight.eleven.columns:first-child, .sixteen.colgrid .row .pull_eight.twelve.columns:first-child, .sixteen.colgrid .row .pull_eight.thirteen.columns:first-child, .sixteen.colgrid .row .pull_eight.fourteen.columns:first-child, .sixteen.colgrid .row .pull_eight.fifteen.columns:first-child, .sixteen.colgrid .row .pull_nine.one.column:first-child, .sixteen.colgrid .row .pull_nine.two.columns:first-child, .sixteen.colgrid .row .pull_nine.three.columns:first-child, .sixteen.colgrid .row .pull_nine.four.columns:first-child, .sixteen.colgrid .row .pull_nine.five.columns:first-child, .sixteen.colgrid .row .pull_nine.six.columns:first-child, .sixteen.colgrid .row .pull_nine.eight.columns:first-child, .sixteen.colgrid .row .pull_nine.nine.columns:first-child, .sixteen.colgrid .row .pull_nine.ten.columns:first-child, .sixteen.colgrid .row .pull_nine.eleven.columns:first-child, .sixteen.colgrid .row .pull_nine.twelve.columns:first-child, .sixteen.colgrid .row .pull_nine.thirteen.columns:first-child, .sixteen.colgrid .row .pull_nine.fourteen.columns:first-child, .sixteen.colgrid .row .pull_nine.fifteen.columns:first-child, .sixteen.colgrid .row .pull_ten.one.column:first-child, .sixteen.colgrid .row .pull_ten.two.columns:first-child, .sixteen.colgrid .row .pull_ten.three.columns:first-child, .sixteen.colgrid .row .pull_ten.four.columns:first-child, .sixteen.colgrid .row .pull_ten.five.columns:first-child, .sixteen.colgrid .row .pull_ten.seven.columns:first-child, .sixteen.colgrid .row .pull_ten.eight.columns:first-child, .sixteen.colgrid .row .pull_ten.nine.columns:first-child, .sixteen.colgrid .row .pull_ten.ten.columns:first-child, .sixteen.colgrid .row .pull_ten.eleven.columns:first-child, .sixteen.colgrid .row .pull_ten.twelve.columns:first-child, .sixteen.colgrid .row .pull_ten.thirteen.columns:first-child, .sixteen.colgrid .row .pull_ten.fourteen.columns:first-child, .sixteen.colgrid .row .pull_ten.fifteen.columns:first-child, .sixteen.colgrid .row .pull_eleven.one.column:first-child, .sixteen.colgrid .row .pull_eleven.two.columns:first-child, .sixteen.colgrid .row .pull_eleven.three.columns:first-child, .sixteen.colgrid .row .pull_eleven.four.columns:first-child, .sixteen.colgrid .row .pull_eleven.six.columns:first-child, .sixteen.colgrid .row .pull_eleven.seven.columns:first-child, .sixteen.colgrid .row .pull_eleven.eight.columns:first-child, .sixteen.colgrid .row .pull_eleven.nine.columns:first-child, .sixteen.colgrid .row .pull_eleven.ten.columns:first-child, .sixteen.colgrid .row .pull_eleven.eleven.columns:first-child, .sixteen.colgrid .row .pull_eleven.twelve.columns:first-child, .sixteen.colgrid .row .pull_eleven.thirteen.columns:first-child, .sixteen.colgrid .row .pull_eleven.fourteen.columns:first-child, .sixteen.colgrid .row .pull_eleven.fifteen.columns:first-child, .sixteen.colgrid .row .pull_twelve.one.column:first-child, .sixteen.colgrid .row .pull_twelve.two.columns:first-child, .sixteen.colgrid .row .pull_twelve.three.columns:first-child, .sixteen.colgrid .row .pull_twelve.five.columns:first-child, .sixteen.colgrid .row .pull_twelve.six.columns:first-child, .sixteen.colgrid .row .pull_twelve.seven.columns:first-child, .sixteen.colgrid .row .pull_twelve.eight.columns:first-child, .sixteen.colgrid .row .pull_twelve.nine.columns:first-child, .sixteen.colgrid .row .pull_twelve.ten.columns:first-child, .sixteen.colgrid .row .pull_twelve.eleven.columns:first-child, .sixteen.colgrid .row .pull_twelve.twelve.columns:first-child, .sixteen.colgrid .row .pull_twelve.thirteen.columns:first-child, .sixteen.colgrid .row .pull_twelve.fourteen.columns:first-child, .sixteen.colgrid .row .pull_twelve.fifteen.columns:first-child, .sixteen.colgrid .row .pull_thirteen.one.column:first-child, .sixteen.colgrid .row .pull_thirteen.two.columns:first-child, .sixteen.colgrid .row .pull_thirteen.four.columns:first-child, .sixteen.colgrid .row .pull_thirteen.five.columns:first-child, .sixteen.colgrid .row .pull_thirteen.six.columns:first-child, .sixteen.colgrid .row .pull_thirteen.seven.columns:first-child, .sixteen.colgrid .row .pull_thirteen.eight.columns:first-child, .sixteen.colgrid .row .pull_thirteen.nine.columns:first-child, .sixteen.colgrid .row .pull_thirteen.ten.columns:first-child, .sixteen.colgrid .row .pull_thirteen.eleven.columns:first-child, .sixteen.colgrid .row .pull_thirteen.twelve.columns:first-child, .sixteen.colgrid .row .pull_thirteen.thirteen.columns:first-child, .sixteen.colgrid .row .pull_thirteen.fourteen.columns:first-child, .sixteen.colgrid .row .pull_thirteen.fifteen.columns:first-child, .sixteen.colgrid .row .pull_fourteen.one.column:first-child, .sixteen.colgrid .row .pull_fourteen.three.columns:first-child, .sixteen.colgrid .row .pull_fourteen.four.columns:first-child, .sixteen.colgrid .row .pull_fourteen.five.columns:first-child, .sixteen.colgrid .row .pull_fourteen.six.columns:first-child, .sixteen.colgrid .row .pull_fourteen.seven.columns:first-child, .sixteen.colgrid .row .pull_fourteen.eight.columns:first-child, .sixteen.colgrid .row .pull_fourteen.nine.columns:first-child, .sixteen.colgrid .row .pull_fourteen.ten.columns:first-child, .sixteen.colgrid .row .pull_fourteen.eleven.columns:first-child, .sixteen.colgrid .row .pull_fourteen.twelve.columns:first-child, .sixteen.colgrid .row .pull_fourteen.thirteen.columns:first-child, .sixteen.colgrid .row .pull_fourteen.fourteen.columns:first-child, .sixteen.colgrid .row .pull_fourteen.fifteen.columns:first-child, .sixteen.colgrid .row .pull_fifteen.two.columns:first-child, .sixteen.colgrid .row .pull_fifteen.three.columns:first-child, .sixteen.colgrid .row .pull_fifteen.four.columns:first-child, .sixteen.colgrid .row .pull_fifteen.five.columns:first-child, .sixteen.colgrid .row .pull_fifteen.six.columns:first-child, .sixteen.colgrid .row .pull_fifteen.seven.columns:first-child, .sixteen.colgrid .row .pull_fifteen.eight.columns:first-child, .sixteen.colgrid .row .pull_fifteen.nine.columns:first-child, .sixteen.colgrid .row .pull_fifteen.ten.columns:first-child, .sixteen.colgrid .row .pull_fifteen.eleven.columns:first-child, .sixteen.colgrid .row .pull_fifteen.twelve.columns:first-child, .sixteen.colgrid .row .pull_fifteen.thirteen.columns:first-child, .sixteen.colgrid .row .pull_fifteen.fourteen.columns:first-child, .sixteen.colgrid .row .pull_fifteen.fifteen.columns:first-child { margin-left: 0; }
-
-.row .pull_one.eleven.columns, .row .pull_two.ten.columns, .row .pull_three.nine.columns, .row .pull_four.eight.columns, .row .pull_five.seven.columns, .row .pull_six.six.columns, .row .pull_seven.five.columns, .row .pull_eight.four.columns, .row .pull_nine.three.columns, .row .pull_ten.two.columns, .row .pull_eleven.one.columns, .sixteen.colgrid .row .pull_one.fifteen.columns, .sixteen.colgrid .row .pull_two.fourteen.columns, .sixteen.colgrid .row .pull_three.thirteen.columns, .sixteen.colgrid .row .pull_four.twelve.columns, .sixteen.colgrid .row .pull_five.eleven.columns, .sixteen.colgrid .row .pull_six.ten.columns, .sixteen.colgrid .row .pull_seven.nine.columns, .sixteen.colgrid .row .pull_eight.eight.columns, .sixteen.colgrid .row .pull_nine.seven.columns, .sixteen.colgrid .row .pull_ten.six.columns, .sixteen.colgrid .row .pull_eleven.five.columns, .sixteen.colgrid .row .pull_twelve.four.columns, .sixteen.colgrid .row .pull_thirteen.three.columns, .sixteen.colgrid .row .pull_fourteen.two.columns, .sixteen.colgrid .row .pull_fifteen.one.columns { margin-left: -100%; }
-
-/* Hybrid Centered Classes */
-.sixteen.colgrid .row .one.centered { margin-left: 47.87234%; }
-.sixteen.colgrid .row .two.centered { margin-left: 44.68085%; }
-.sixteen.colgrid .row .three.centered { margin-left: 41.48936%; }
-.sixteen.colgrid .row .four.centered { margin-left: 38.29787%; }
-.sixteen.colgrid .row .five.centered { margin-left: 35.10638%; }
-.sixteen.colgrid .row .six.centered { margin-left: 31.91489%; }
-.sixteen.colgrid .row .seven.centered { margin-left: 28.7234%; }
-.sixteen.colgrid .row .eight.centered { margin-left: 25.53191%; }
-.sixteen.colgrid .row .nine.centered { margin-left: 22.34043%; }
-.sixteen.colgrid .row .ten.centered { margin-left: 19.14894%; }
-.sixteen.colgrid .row .eleven.centered { margin-left: 15.95745%; }
-.sixteen.colgrid .row .twelve.centered { margin-left: 12.76596%; }
-.sixteen.colgrid .row .thirteen.centered { margin-left: 9.57447%; }
-.sixteen.colgrid .row .fourteen.centered { margin-left: 6.38298%; }
-.sixteen.colgrid .row .fifteen.centered { margin-left: 3.19149%; }
-
-img, object, embed { max-width: 100%; height: auto; }
-
-img { -ms-interpolation-mode: bicubic; }
-
-#map_canvas img, .map_canvas img { max-width: none !important; }
-
-/* Tile Grid */
-.tiles { display: block; overflow: hidden; }
-.tiles > li, .tiles > .tile { display: block; height: auto; float: left; padding-bottom: 0; }
-.tiles.two_up { margin-left: -4%; }
-.tiles.two_up > li, .tiles.two_up > .tile { margin-left: 4%; width: 46%; }
-.tiles.three_up, .tiles.four_up { margin-left: -2%; }
-.tiles.three_up > li, .tiles.three_up > .tile { margin-left: 2%; width: 31.3%; }
-.tiles.four_up > li, .tiles.four_up > .tile { margin-left: 2%; width: 23%; }
-.tiles.five_up { margin-left: -1.5%; }
-.tiles.five_up > li, .tiles.five_up > .tile { margin-left: 1.5%; width: 18.5%; }
-
-/* Nicolas Gallagher's micro clearfix */
-.clearfix { *zoom: 1; }
-.clearfix:before, .clearfix:after { content: ""; display: table; }
-.clearfix:after { clear: both; }
-
-.row { *zoom: 1; }
-.row:before, .row:after { content: ""; display: table; }
-.row:after { clear: both; }
-
-.valign:before { content: ' '; display: inline-block; height: 400px; vertical-align: middle; margin-right: -0.25em; }
-.valign > div, .valign > article, .valign > section, .valign > figure { display: inline-block; vertical-align: middle; }
-
-/* Mobile */
-@media only screen and (max-width: 767px) { body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; width: 100%; min-width: 0; }
- .container { min-width: 0; margin-left: 0; margin-right: 0; }
- .row { width: 100%; min-width: 0; margin-left: 0; margin-right: 0; }
- .row .row .column, .row .row .columns { padding: 0; }
- .row .centered { margin-left: 0 !important; }
- .column, .columns { width: auto !important; float: none; margin-left: 0; margin-right: 0; }
- .column:last-child, .columns:last-child { margin-right: 0; float: none; }
- [class*="column"] + [class*="column"]:last-child { float: none; }
- [class*="column"]:before { display: table; }
- [class*="column"]:after { display: table; clear: both; }
- [class^="push_"], [class*="push_"], [class^="pull_"], [class*="pull_"] { margin-left: 0 !important; } }
-/* Navigation (with dropdowns) */
-.navbar { width: 100%; min-height: 60px; display: block; margin-bottom: 20px; background: #4a4d50; position: relative; }
-@media only screen and (max-width: 767px) { .navbar { border: none; }
- .navbar .column, .navbar .columns { min-height: 0; } }
-.navbar.fixed { position: fixed; z-index: 99999; }
-.navbar.pinned { position: absolute; }
-.navbar a.toggle { display: none; }
-@media only screen and (max-width: 767px) { .navbar a.toggle { top: 18%; right: 4%; width: 46px; position: absolute; text-align: center; display: inline-block; color: #fff; background: #4a4d50; height: 40px; line-height: 38px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; font-size: 29.79335px; font-size: 1.86208rem; }
- .navbar a.toggle:hover { background: #565a5d; }
- .navbar a.toggle:active, .navbar a.toggle.active { background: #3e4043; } }
-
-.navbar .logo { display: inline-block; margin: 0 2.12766% 0 0; padding: 0; height: 59.36817px; line-height: 57.36817px; }
-.navbar .logo a { display: block; padding: 0; overflow: hidden; height: 59.36817px; line-height: 57.36817px; }
-.navbar .logo a img { max-height: 95%; }
-@media only screen and (max-width: 767px) { .navbar .logo { float: left; display: inline; }
- .navbar .logo a { padding: 0; }
- .navbar .logo a img { width: auto; height: auto; max-width: 100%; } }
-
-.navbar ul { display: table; vertical-align: middle; margin: 0; float: none; }
-@media only screen and (max-width: 767px) { .navbar ul { position: absolute; display: block; width: 100% !important; height: 0; max-height: 0; top: 60px; left: 0; overflow: hidden; text-align: center; background: #3e4043; }
- .navbar ul.active { height: auto; max-height: 600px; z-index: 999998; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; -webkit-transition-duration: 0.5s; transition-duration: 0.5s; -moz-box-shadow: 0 2px 2px #252728; -webkit-box-shadow: 0 2px 2px #252728; box-shadow: 0 2px 2px #252728; } }
-.navbar ul li { display: table-cell; text-align: center; padding-bottom: 0; margin: 0; height: 59.36817px; line-height: 57.36817px; }
-@media only screen and (max-width: 767px) { .navbar ul li { display: block; position: relative; min-height: 50px; max-height: 320px; height: auto; width: 100%; border-right: 0 !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; -webkit-transition-duration: 0.5s; transition-duration: 0.5s; } }
-.navbar ul li > a { display: block; padding: 0 16px; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px #191a1b, 0 1px 0 #191a1b; height: 59.36817px; line-height: 57.36817px; font-size: 16px; font-size: 1rem; }
-.navbar ul li > a i.icon-popup { position: absolute; }
-.navbar ul li .btn { border-color: #000101 !important; }
-.navbar ul li.field { margin-bottom: 0 !important; margin-right: 0; }
-@media only screen and (max-width: 767px) { .navbar ul li.field { padding: 0 20px; } }
-.navbar ul li.field input.search { background: #191a1b; border: none; color: #f2f2f2; }
-.navbar ul li .dropdown { width: auto; min-width: 0; max-width: 320px; height: 0; position: absolute; background: #fafafa; overflow: hidden; z-index: 999; }
-@media only screen and (max-width: 767px) { .navbar ul li .dropdown { width: 100%; max-width: 100%; position: relative; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; }
- .navbar ul li.active .dropdown { border-bottom: 1px solid #313436; }
- .navbar ul li.active .dropdown ul { position: relative; top: 0; background: #36393b; min-height: 50px; max-height: 250px; height: auto; overflow: auto; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; }
- .navbar ul li.active .dropdown ul li { min-height: 50px; border-bottom: #3e4043; }
- .navbar ul li.active .dropdown ul li a { color: #fff; border-bottom: 1px solid #313436; }
- .navbar ul li.active .dropdown ul li a:hover { color: #d04526; } }
-
-@media only screen and (min-width: 768px) and (max-width: 939px) { .navbar > ul > li > .btn a { padding: 0 9.88854px 0 9.88854px !important; }
- .navbar ul > li .dropdown ul li.active .dropdown { left: -320px; } }
-
-.navcontain { height: 80px; }
-@media only screen and (max-width: 768px) { .navcontain { height: auto; } }
-
-.pretty.navbar { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzdiODA4NSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMxMzQzNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7b8085), color-stop(100%, #313436)); background-image: -moz-linear-gradient(#7b8085, #313436); background-image: -webkit-linear-gradient(#7b8085, #313436); background-image: linear-gradient(#7b8085, #313436); -moz-box-shadow: inset 0 1px 1px #7b8085, 0 1px 2px rgba(0, 0, 0, 0.8) !important; -webkit-box-shadow: inset 0 1px 1px #7b8085, 0 1px 2px rgba(0, 0, 0, 0.8) !important; box-shadow: inset 0 1px 1px #7b8085, 0 1px 2px rgba(0, 0, 0, 0.8) !important; /* Remove this line if you dont want a dropshadow on your navigation*/ }
-@media only screen and (max-width: 767px) { .pretty.navbar a.toggle { border: 1px solid #3e4043; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzdiODA4NSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzRhNGQ1MCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7b8085), color-stop(100%, #4a4d50)); background-image: -moz-linear-gradient(#7b8085, #4a4d50); background-image: -webkit-linear-gradient(#7b8085, #4a4d50); background-image: linear-gradient(#7b8085, #4a4d50); -moz-box-shadow: inset 0 1px 2px #888d91, inset 0 -1px 1px #565a5d, inset 1px 0 1px #565a5d, inset -1px 0 1px #565a5d, 0 1px 1px #63676a; -webkit-box-shadow: inset 0 1px 2px #888d91, inset 0 -1px 1px #565a5d, inset 1px 0 1px #565a5d, inset -1px 0 1px #565a5d, 0 1px 1px #63676a; box-shadow: inset 0 1px 2px #888d91, inset 0 -1px 1px #565a5d, inset 1px 0 1px #565a5d, inset -1px 0 1px #565a5d, 0 1px 1px #63676a; }
- .pretty.navbar a.toggle i { text-shadow: 0 1px 1px #191a1b; }
- .pretty.navbar a.toggle:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzg4OGQ5MSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU2NWE1ZCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #888d91), color-stop(100%, #565a5d)); background-image: -moz-linear-gradient(#888d91, #565a5d); background-image: -webkit-linear-gradient(#888d91, #565a5d); background-image: linear-gradient(#888d91, #565a5d); }
- .pretty.navbar a.toggle:active, .pretty.navbar a.toggle.active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzNlNDA0MyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzRhNGQ1MCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #3e4043), color-stop(100%, #4a4d50)); background-image: -moz-linear-gradient(#3e4043, #4a4d50); background-image: -webkit-linear-gradient(#3e4043, #4a4d50); background-image: linear-gradient(#3e4043, #4a4d50); -moz-box-shadow: 0 1px 1px #63676a; -webkit-box-shadow: 0 1px 1px #63676a; box-shadow: 0 1px 1px #63676a; } }
-.pretty.navbar.row { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-@media only screen and (max-width: 767px) { .pretty.navbar.row { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; } }
-.pretty.navbar ul li.field input.search { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzE5MWExYiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzRmNTI1NSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #191a1b), color-stop(100%, #4f5255)); background-image: -moz-linear-gradient(#191a1b, #4f5255); background-image: -webkit-linear-gradient(#191a1b, #4f5255); background-image: linear-gradient(#191a1b, #4f5255); border: none; -moz-box-shadow: 0 1px 2px #888d91 !important; -webkit-box-shadow: 0 1px 2px #888d91 !important; box-shadow: 0 1px 2px #888d91 !important; /* Remove this line if you dont want a dropshadow on your navigation*/ }
-.pretty.navbar > ul > li:first-child, .pretty.navbar .pretty.navbar > ul > li:first-child a:hover { -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
-
-.navbar li .dropdown { width: auto; min-width: 0; max-width: 320px; height: 0; position: absolute; background: #fafafa; overflow: hidden; z-index: 999; }
-@media only screen and (max-width: 767px) { .navbar li .dropdown .dropdown { width: 100%; max-width: 100%; position: relative; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; }
- .navbar li .dropdown.active .dropdown { border-bottom: 1px solid #313436; }
- .navbar li .dropdown.active .dropdown ul { position: relative; top: 0; background: #36393b; min-height: 50px; max-height: 250px; height: auto; overflow: auto; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; }
- .navbar li .dropdown.active .dropdown ul li { min-height: 50px; border-bottom: #3e4043; }
- .navbar li .dropdown.active .dropdown ul li a { color: #fff; border-bottom: 1px solid #313436; }
- .navbar li .dropdown.active .dropdown ul li a:hover { color: #d04526; } }
-
-.navbar li .dropdown ul { margin: 0; display: block; }
-.navbar li .dropdown ul > li { position: relative; display: block; width: 100%; float: left; text-align: left; height: auto; -moz-border-radius: none; -webkit-border-radius: none; border-radius: none; }
-@media only screen and (min-width: 768px) and (max-width: 939px) { .navbar li .dropdown ul > li { max-width: 320px; word-wrap: break-word; } }
-.navbar li .dropdown ul > li a { display: block; padding: 0 20px; color: #d04526; border-bottom: 1px solid #ccc; text-shadow: none; height: 50.86172px; line-height: 48.86172px; }
-@media only screen and (max-width: 767px) { .navbar li .dropdown ul > li a { padding: 0 20px; } }
-.navbar li .dropdown ul > li .dropdown { display: none; background: white; }
-.navbar li .dropdown ul li:first-child a { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
-
-.gumby-no-touch .navbar ul li:hover > a, .gumby-touch .navbar ul li.active > a { position: relative; background: #868d92; z-index: 1000; }
-
-.gumby-no-touch .navbar ul li:hover .dropdown, .gumby-touch .navbar ul li.active .dropdown { min-height: 50px; max-height: 561px; overflow: visible; height: auto; width: 100%; padding: 0; border-top: 1px solid #3e4043; -moz-box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.3); box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.3); }
-
-.gumby-no-touch .navbar ul li:hover .dropdown ul { position: relative; top: 0; min-height: 50px; max-height: 250px; height: auto; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; -webkit-transition-duration: 0.5s; transition-duration: 0.5s; }
-@media only screen and (max-width: 767px) { .gumby-no-touch .navbar ul li:hover .dropdown ul { overflow: auto; background: #36393b; }
- .gumby-no-touch .navbar ul li:hover .dropdown ul li { border-bottom: #3e4043; }
- .gumby-no-touch .navbar ul li:hover .dropdown ul li a { color: #fff; border-bottom: 1px solid #313436; }
- .gumby-no-touch .navbar ul li:hover .dropdown ul li a:hover { color: #d04526; } }
-
-.gumby-no-touch .navbar li .dropdown ul > li:hover .dropdown, .gumby-touch .navbar li .dropdown ul > li.active .dropdown { border-top: none; display: block; position: absolute; z-index: 9999; left: 100%; top: 0; margin-top: 0; }
-@media only screen and (max-width: 767px) { .gumby-no-touch .navbar li .dropdown ul > li:hover .dropdown, .gumby-touch .navbar li .dropdown ul > li.active .dropdown { position: relative; left: 0; }
- .gumby-no-touch .navbar li .dropdown ul > li:hover .dropdown ul, .gumby-touch .navbar li .dropdown ul > li.active .dropdown ul { background: #252728 !important; } }
-
-.gumby-no-touch .navbar li .dropdown ul li a:hover { background: #f2f2f2; }
-
-.gumby-touch .navbar a:hover { color: #fff !important; }
-
-.subnav { display: block; width: auto; overflow: hidden; margin: 0 0 18px 0; padding-top: 4px; }
-.subnav li, .subnav dt, .subnav dd { float: left; display: inline; margin-left: 9px; margin-bottom: 4px; }
-.subnav li:first-child, .subnav dt:first-child, .subnav dd:first-child { margin-left: 0; }
-.subnav dt { color: #f2f2f2; font-weight: normal; }
-.subnav li a, .subnav dd a { color: #fff; font-size: 15px; text-decoration: none; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-.subnav li.active a, .subnav dd.active a { background: #4a4d50; padding: 5px 9px; text-shadow: 0 1px 1px #4a4d50; }
-
-/* Buttons */
-.btn, .skiplink { display: inline-block; width: auto; background: #f2f2f2; -webkit-appearance: none; font-family: "Open Sans"; font-weight: 600; padding: 0 !important; text-align: center; }
-.btn > a, .btn input, .btn button, .skiplink > a, .skiplink input, .skiplink button { display: block; padding: 0 18.4133px; color: #fff; height: 100%; }
-.btn input, .btn button, .skiplink input, .skiplink button { background: none; border: none; width: 100%; font-size: 100%; cursor: pointer; font-weight: 400; -moz-appearance: none; -webkit-appearance: none; }
-
-.btn.xlarge, .skiplink.xlarge { font-size: 29.79335px; font-size: 1.86208rem; height: 65.90355px; line-height: 63.90355px; }
-.btn.xlarge a, .skiplink.xlarge a { position: relative; padding: 0 29.79335px; }
-.btn.xlarge.icon-left a, .skiplink.xlarge.icon-left a { padding-left: 65.90355px; }
-.btn.xlarge.icon-left a:before, .skiplink.xlarge.icon-left a:before { left: 19.86223px; }
-.btn.xlarge.icon-right a, .skiplink.xlarge.icon-right a { padding-right: 65.90355px; }
-.btn.xlarge.icon-right a:after, .skiplink.xlarge.icon-right a:after { right: 19.86223px; }
-.btn.large, .skiplink.large { font-size: 25.88854px; font-size: 1.61803rem; height: 57.3971px; line-height: 55.3971px; }
-.btn.large a, .skiplink.large a { position: relative; padding: 0 25.88854px; }
-.btn.large.icon-left a, .skiplink.large.icon-left a { padding-left: 57.3971px; }
-.btn.large.icon-left a:before, .skiplink.large.icon-left a:before { left: 17.25903px; }
-.btn.large.icon-right a, .skiplink.large.icon-right a { padding-right: 57.3971px; }
-.btn.large.icon-right a:after, .skiplink.large.icon-right a:after { right: 17.25903px; }
-.btn.medium, .skiplink.medium { font-size: 16px; font-size: 1rem; height: 35.85532px; line-height: 33.85532px; }
-.btn.medium a, .skiplink.medium a { position: relative; padding: 0 16px; }
-.btn.medium.icon-left a, .skiplink.medium.icon-left a { padding-left: 35.85532px; }
-.btn.medium.icon-left a:before, .skiplink.medium.icon-left a:before { left: 10.66667px; }
-.btn.medium.icon-right a, .skiplink.medium.icon-right a { padding-right: 35.85532px; }
-.btn.medium.icon-right a:after, .skiplink.medium.icon-right a:after { right: 10.66667px; }
-.btn.medium a, .skiplink.medium a { padding: 0 18.4133px; }
-.btn.small, .skiplink.small { font-size: 9.88854px; font-size: 0.61803rem; height: 22.54177px; line-height: 20.54177px; }
-.btn.small a, .skiplink.small a { position: relative; padding: 0 9.88854px; }
-.btn.small.icon-left a, .skiplink.small.icon-left a { padding-left: 22.54177px; }
-.btn.small.icon-left a:before, .skiplink.small.icon-left a:before { left: 6.59236px; }
-.btn.small.icon-right a, .skiplink.small.icon-right a { padding-right: 22.54177px; }
-.btn.small.icon-right a:after, .skiplink.small.icon-right a:after { right: 6.59236px; }
-.btn.small a, .skiplink.small a { padding: 0 9.88854px; }
-.btn.oval, .skiplink.oval { -moz-border-radius: 1000px; -webkit-border-radius: 1000px; border-radius: 1000px; }
-.btn.pill-left, .skiplink.pill-left { -moz-border-radius: 500px 0 0 500px; -webkit-border-radius: 500px; border-radius: 500px 0 0 500px; }
-.btn.pill-right, .skiplink.pill-right { -moz-border-radius: 0 500px 500px 0; -webkit-border-radius: 0; border-radius: 0 500px 500px 0; }
-
-.btn.primary, .skiplink.primary { background: #3085d6; border: 1px solid #3085d6; }
-.btn.primary:hover, .skiplink.primary:hover { background: #5b9ede; }
-.btn.primary:active, .skiplink.primary:active { background: #236bb0; }
-.btn.secondary, .skiplink.secondary { background: #42a35a; border: 1px solid #42a35a; }
-.btn.secondary:hover, .skiplink.secondary:hover { background: #5bbd73; }
-.btn.secondary:active, .skiplink.secondary:active { background: #337f46; }
-.btn.default, .skiplink.default { background: #f2f2f2; border: 1px solid #f2f2f2; color: #555555; border: 1px solid #f2f2f2; }
-.btn.default:hover, .skiplink.default:hover { background: white; }
-.btn.default:active, .skiplink.default:active { background: #d8d8d8; }
-.btn.default:hover, .skiplink.default:hover { border: 1px solid #e5e5e5; }
-.btn.default a, .btn.default input, .btn.default button, .skiplink.default a, .skiplink.default input, .skiplink.default button { color: #555555; }
-.btn.info, .skiplink.info { background: #4a4d50; border: 1px solid #4a4d50; }
-.btn.info:hover, .skiplink.info:hover { background: #63676a; }
-.btn.info:active, .skiplink.info:active { background: #313436; }
-.btn.danger, .skiplink.danger { background: #ca3838; border: 1px solid #ca3838; }
-.btn.danger:hover, .skiplink.danger:hover { background: #d56060; }
-.btn.danger:active, .skiplink.danger:active { background: #a32c2c; }
-.btn.warning, .skiplink.warning { background: #f6b83f; border: 1px solid #f6b83f; color: #644405; }
-.btn.warning:hover, .skiplink.warning:hover { background: #f8ca70; }
-.btn.warning:active, .skiplink.warning:active { background: #f4a60e; }
-.btn.warning a, .btn.warning input, .btn.warning button, .skiplink.warning a, .skiplink.warning input, .skiplink.warning button { color: #644405; }
-.btn.success, .skiplink.success { background: #58c026; border: 1px solid #58c026; }
-.btn.success:hover, .skiplink.success:hover { background: #72d940; }
-.btn.success:active, .skiplink.success:active { background: #44951e; }
-
-.btn.metro, .metro .btn, .metro .skiplink, .skiplink.metro, .btn.pretty.squared, .pretty .squared.btn, .pretty .squared.skiplink, .pretty .btn.squared { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
-
-.btn.pretty, .pretty .btn, .pretty .skiplink, .skiplink.pretty, .btn.metro.rounded, .metro .rounded.btn, .metro .rounded.skiplink, .metro .btn.rounded { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-
-.btn.pretty.primary, .pretty .primary.btn, .pretty .primary.skiplink, .skiplink.pretty.primary { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzg1YjdlNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzJhODVkYyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #85b7e7), color-stop(100%, #2a85dc)); background-image: -moz-linear-gradient(#85b7e7, #2a85dc); background-image: -webkit-linear-gradient(#85b7e7, #2a85dc); background-image: linear-gradient(#85b7e7, #2a85dc); -moz-box-shadow: inset 0 0 3px #f0f6fc; -webkit-box-shadow: inset 0 0 3px #f0f6fc; box-shadow: inset 0 0 3px #f0f6fc; border: 1px solid #1f5e9b; }
-.btn.pretty.primary:hover, .pretty .primary.btn:hover, .pretty .primary.skiplink:hover, .skiplink.pretty.primary:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2EyZDRmYyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU0YjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a2d4fc), color-stop(100%, #54b2fe)); background-image: -moz-linear-gradient(#a2d4fc, #54b2fe); background-image: -webkit-linear-gradient(#a2d4fc, #54b2fe); background-image: linear-gradient(#a2d4fc, #54b2fe); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; border: 1px solid #0e90f8; }
-.btn.pretty.primary:active, .pretty .primary.btn:active, .pretty .primary.skiplink:active, .skiplink.pretty.primary:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJhODVkYyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg1YjdlNyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #2a85dc), color-stop(100%, #85b7e7)); background-image: -moz-linear-gradient(#2a85dc, #85b7e7); background-image: -webkit-linear-gradient(#2a85dc, #85b7e7); background-image: linear-gradient(#2a85dc, #85b7e7); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; }
-.btn.pretty.primary a, .pretty .primary.btn a, .pretty .primary.skiplink a, .btn.pretty.primary input, .pretty .primary.btn input, .pretty .primary.skiplink input, .btn.pretty.primary button, .pretty .primary.btn button, .pretty .primary.skiplink button, .skiplink.pretty.primary a, .skiplink.pretty.primary input, .skiplink.pretty.primary button { text-shadow: 0 1px 1px #1a5186; }
-.btn.pretty.secondary, .pretty .secondary.btn, .pretty .secondary.skiplink, .skiplink.pretty.secondary { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzgwY2I5MiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzNjYTk1NyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #80cb92), color-stop(100%, #3ca957)); background-image: -moz-linear-gradient(#80cb92, #3ca957); background-image: -webkit-linear-gradient(#80cb92, #3ca957); background-image: linear-gradient(#80cb92, #3ca957); -moz-box-shadow: inset 0 0 3px #daf0e0; -webkit-box-shadow: inset 0 0 3px #daf0e0; box-shadow: inset 0 0 3px #daf0e0; border: 1px solid #2c6d3c; }
-.btn.pretty.secondary:hover, .pretty .secondary.btn:hover, .pretty .secondary.skiplink:hover, .skiplink.pretty.secondary:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ExZDNhZCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzY4YzA3ZCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a1d3ad), color-stop(100%, #68c07d)); background-image: -moz-linear-gradient(#a1d3ad, #68c07d); background-image: -webkit-linear-gradient(#a1d3ad, #68c07d); background-image: linear-gradient(#a1d3ad, #68c07d); -moz-box-shadow: inset 0 0 3px #f8fcf9; -webkit-box-shadow: inset 0 0 3px #f8fcf9; box-shadow: inset 0 0 3px #f8fcf9; border: 1px solid #469659; }
-.btn.pretty.secondary:active, .pretty .secondary.btn:active, .pretty .secondary.skiplink:active, .skiplink.pretty.secondary:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzNjYTk1NyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzgwY2I5MiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #3ca957), color-stop(100%, #80cb92)); background-image: -moz-linear-gradient(#3ca957, #80cb92); background-image: -webkit-linear-gradient(#3ca957, #80cb92); background-image: linear-gradient(#3ca957, #80cb92); -moz-box-shadow: inset 0 0 3px #ecf8ef; -webkit-box-shadow: inset 0 0 3px #ecf8ef; box-shadow: inset 0 0 3px #ecf8ef; }
-.btn.pretty.secondary a, .pretty .secondary.btn a, .pretty .secondary.skiplink a, .btn.pretty.secondary input, .pretty .secondary.btn input, .pretty .secondary.skiplink input, .btn.pretty.secondary button, .pretty .secondary.btn button, .pretty .secondary.skiplink button, .skiplink.pretty.secondary a, .skiplink.pretty.secondary input, .skiplink.pretty.secondary button { text-shadow: 0 1px 1px #255a32; }
-.btn.pretty.default, .pretty .default.btn, .pretty .default.skiplink, .skiplink.pretty.default { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2YzZjFmMSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #f3f1f1)); background-image: -moz-linear-gradient(#ffffff, #f3f1f1); background-image: -webkit-linear-gradient(#ffffff, #f3f1f1); background-image: linear-gradient(#ffffff, #f3f1f1); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; border: 1px solid #cccccc; }
-.btn.pretty.default:hover, .pretty .default.btn:hover, .pretty .default.skiplink:hover, .skiplink.pretty.default:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #ffffff)); background-image: -moz-linear-gradient(#ffffff, #ffffff); background-image: -webkit-linear-gradient(#ffffff, #ffffff); background-image: linear-gradient(#ffffff, #ffffff); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; border: 1px solid #d9d9d9; }
-.btn.pretty.default:active, .pretty .default.btn:active, .pretty .default.skiplink:active, .skiplink.pretty.default:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2YzZjFmMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f3f1f1), color-stop(100%, #ffffff)); background-image: -moz-linear-gradient(#f3f1f1, #ffffff); background-image: -webkit-linear-gradient(#f3f1f1, #ffffff); background-image: linear-gradient(#f3f1f1, #ffffff); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; }
-.btn.pretty.default a, .pretty .default.btn a, .pretty .default.skiplink a, .btn.pretty.default input, .pretty .default.btn input, .pretty .default.skiplink input, .btn.pretty.default button, .pretty .default.btn button, .pretty .default.skiplink button, .skiplink.pretty.default a, .skiplink.pretty.default input, .skiplink.pretty.default button { text-shadow: 0 1px 1px white; }
-.btn.pretty.info, .pretty .info.btn, .pretty .info.skiplink, .skiplink.pretty.info { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzdiODA4NSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ2NGQ1NCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7b8085), color-stop(100%, #464d54)); background-image: -moz-linear-gradient(#7b8085, #464d54); background-image: -webkit-linear-gradient(#7b8085, #464d54); background-image: linear-gradient(#7b8085, #464d54); -moz-box-shadow: inset 0 0 3px #bdc0c2; -webkit-box-shadow: inset 0 0 3px #bdc0c2; box-shadow: inset 0 0 3px #bdc0c2; border: 1px solid #252728; }
-.btn.pretty.info:hover, .pretty .info.btn:hover, .pretty .info.skiplink:hover, .skiplink.pretty.info:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2FlYjNiNiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzgwOGU5OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #aeb3b6), color-stop(100%, #808e98)); background-image: -moz-linear-gradient(#aeb3b6, #808e98); background-image: -webkit-linear-gradient(#aeb3b6, #808e98); background-image: linear-gradient(#aeb3b6, #808e98); -moz-box-shadow: inset 0 0 3px #f1f2f3; -webkit-box-shadow: inset 0 0 3px #f1f2f3; box-shadow: inset 0 0 3px #f1f2f3; border: 1px solid #60676b; }
-.btn.pretty.info:active, .pretty .info.btn:active, .pretty .info.skiplink:active, .skiplink.pretty.info:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzQ2NGQ1NCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzdiODA4NSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #464d54), color-stop(100%, #7b8085)); background-image: -moz-linear-gradient(#464d54, #7b8085); background-image: -webkit-linear-gradient(#464d54, #7b8085); background-image: linear-gradient(#464d54, #7b8085); -moz-box-shadow: inset 0 0 3px #cbcdce; -webkit-box-shadow: inset 0 0 3px #cbcdce; box-shadow: inset 0 0 3px #cbcdce; }
-.btn.pretty.info a, .pretty .info.btn a, .pretty .info.skiplink a, .btn.pretty.info input, .pretty .info.btn input, .pretty .info.skiplink input, .btn.pretty.info button, .pretty .info.btn button, .pretty .info.skiplink button, .skiplink.pretty.info a, .skiplink.pretty.info input, .skiplink.pretty.info button { text-shadow: 0 1px 1px #191a1b; }
-.btn.pretty.danger, .pretty .danger.btn, .pretty .danger.skiplink, .skiplink.pretty.danger { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2RmODk4OSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2QwMzIzMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #df8989), color-stop(100%, #d03232)); background-image: -moz-linear-gradient(#df8989, #d03232); background-image: -webkit-linear-gradient(#df8989, #d03232); background-image: linear-gradient(#df8989, #d03232); -moz-box-shadow: inset 0 0 3px #faeded; -webkit-box-shadow: inset 0 0 3px #faeded; box-shadow: inset 0 0 3px #faeded; border: 1px solid #8f2626; }
-.btn.pretty.danger:hover, .pretty .danger.btn:hover, .pretty .danger.skiplink:hover, .skiplink.pretty.danger:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y3OTY5NiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y2NGE0YSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f79696), color-stop(100%, #f64a4a)); background-image: -moz-linear-gradient(#f79696, #f64a4a); background-image: -webkit-linear-gradient(#f79696, #f64a4a); background-image: linear-gradient(#f79696, #f64a4a); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; border: 1px solid #e21212; }
-.btn.pretty.danger:active, .pretty .danger.btn:active, .pretty .danger.skiplink:active, .skiplink.pretty.danger:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2QwMzIzMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2RmODk4OSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d03232), color-stop(100%, #df8989)); background-image: -moz-linear-gradient(#d03232, #df8989); background-image: -webkit-linear-gradient(#d03232, #df8989); background-image: linear-gradient(#d03232, #df8989); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; }
-.btn.pretty.danger a, .pretty .danger.btn a, .pretty .danger.skiplink a, .btn.pretty.danger input, .pretty .danger.btn input, .pretty .danger.skiplink input, .btn.pretty.danger button, .pretty .danger.btn button, .pretty .danger.skiplink button, .skiplink.pretty.danger a, .skiplink.pretty.danger input, .skiplink.pretty.danger button { text-shadow: 0 1px 1px #7b2121; }
-.btn.pretty.warning, .pretty .warning.btn, .pretty .warning.skiplink, .skiplink.pretty.warning { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZiZGNhMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZiYmEzYSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fbdca0), color-stop(100%, #fbba3a)); background-image: -moz-linear-gradient(#fbdca0, #fbba3a); background-image: -webkit-linear-gradient(#fbdca0, #fbba3a); background-image: linear-gradient(#fbdca0, #fbba3a); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; border: 1px solid #de960a; color: #644405; }
-.btn.pretty.warning:hover, .pretty .warning.btn:hover, .pretty .warning.skiplink:hover, .skiplink.pretty.warning:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZlZWNjYSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZDM3ZCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #feecca), color-stop(100%, #ffd37d)); background-image: -moz-linear-gradient(#feecca, #ffd37d); background-image: -webkit-linear-gradient(#feecca, #ffd37d); background-image: linear-gradient(#feecca, #ffd37d); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; border: 1px solid #fcb834; }
-.btn.pretty.warning:active, .pretty .warning.btn:active, .pretty .warning.skiplink:active, .skiplink.pretty.warning:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZiYmEzYSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZiZGNhMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fbba3a), color-stop(100%, #fbdca0)); background-image: -moz-linear-gradient(#fbba3a, #fbdca0); background-image: -webkit-linear-gradient(#fbba3a, #fbdca0); background-image: linear-gradient(#fbba3a, #fbdca0); -moz-box-shadow: inset 0 0 3px white; -webkit-box-shadow: inset 0 0 3px white; box-shadow: inset 0 0 3px white; }
-.btn.pretty.warning a, .pretty .warning.btn a, .pretty .warning.skiplink a, .btn.pretty.warning input, .pretty .warning.btn input, .pretty .warning.skiplink input, .btn.pretty.warning button, .pretty .warning.btn button, .pretty .warning.skiplink button, .skiplink.pretty.warning a, .skiplink.pretty.warning input, .skiplink.pretty.warning button { text-shadow: 0 1px 1px #fbdca0; }
-.btn.pretty.success, .pretty .success.btn, .pretty .success.skiplink, .skiplink.pretty.success { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzkxZTI2YSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzU2YzYyMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #91e26a), color-stop(100%, #56c620)); background-image: -moz-linear-gradient(#91e26a, #56c620); background-image: -webkit-linear-gradient(#91e26a, #56c620); background-image: linear-gradient(#91e26a, #56c620); -moz-box-shadow: inset 0 0 3px #e0f7d5; -webkit-box-shadow: inset 0 0 3px #e0f7d5; box-shadow: inset 0 0 3px #e0f7d5; border: 1px solid #3b8019; }
-.btn.pretty.success:hover, .pretty .success.btn:hover, .pretty .success.skiplink:hover, .skiplink.pretty.success:hover { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzk2ZTU3MCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzY0ZGYyOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #96e570), color-stop(100%, #64df29)); background-image: -moz-linear-gradient(#96e570, #64df29); background-image: -webkit-linear-gradient(#96e570, #64df29); background-image: linear-gradient(#96e570, #64df29); -moz-box-shadow: inset 0 0 3px #e5f9db; -webkit-box-shadow: inset 0 0 3px #e5f9db; box-shadow: inset 0 0 3px #e5f9db; border: 1px solid #479f1d; }
-.btn.pretty.success:active, .pretty .success.btn:active, .pretty .success.skiplink:active, .skiplink.pretty.success:active { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzU2YzYyMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzkxZTI2YSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #56c620), color-stop(100%, #91e26a)); background-image: -moz-linear-gradient(#56c620, #91e26a); background-image: -webkit-linear-gradient(#56c620, #91e26a); background-image: linear-gradient(#56c620, #91e26a); -moz-box-shadow: inset 0 0 3px #f0fbea; -webkit-box-shadow: inset 0 0 3px #f0fbea; box-shadow: inset 0 0 3px #f0fbea; }
-.btn.pretty.success a, .pretty .success.btn a, .pretty .success.skiplink a, .btn.pretty.success input, .pretty .success.btn input, .pretty .success.skiplink input, .btn.pretty.success button, .pretty .success.btn button, .pretty .success.skiplink button, .skiplink.pretty.success a, .skiplink.pretty.success input, .skiplink.pretty.success button { text-shadow: 0 1px 1px #316b15; }
-
-/* Icons */
-[class^="icon-"] a:before, [class*=" icon-"] a:before, [class^="icon-"] a:after, [class*=" icon-"] a:after, i[class^="icon-"], i[class*=" icon-"] { font-family: "entypo"; position: absolute; text-decoration: none; zoom: 1; }
-
-i[class^="icon-"], i[class*=" icon-"] { display: inline-block; position: static; min-width: 20px; margin: 0 5px; text-align: center; }
-
-/* Form Styles */
-form { margin: 0 0 18px; }
-form label { display: block; font-size: 16px; font-size: 1rem; line-height: 1.5em; cursor: pointer; margin-bottom: 9px; }
-form label.inline { display: inline-block; padding-right: 20px; }
-form dt { margin: 0; }
-form textarea { height: 150px; }
-form ul, form ul li { margin-left: 0; list-style-type: none; }
-form fieldset { border-width: 0.0625em; border-style: solid; padding: 1.4375em; border-color: #d8d8d8; margin: 18px 0; }
-form fieldset legend { padding: 5px 10px; }
-
-.field { position: relative; max-width: 100%; margin-bottom: 10px; vertical-align: middle; font-size: 16px; overflow: hidden; }
-.field.metro, .field .metro { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
-.field input, .field input[type="*"], .field textarea { max-width: 100%; width: 100%; padding: 0; margin: 0; border: none; outline: none; resize: none; -webkit-appearance: none; font-family: "Open Sans"; font-weight: 300; font-size: 16px; font-size: 1rem; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
-.field .input { position: relative; padding: 0 10px; background: #fff; border: 1px solid #d8d8d8; height: 35.85532px; line-height: 33.85532px; font-size: 16px; font-size: 1rem; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-.field .input.search { height: 35.85532px; line-height: 33.85532px; -moz-border-radius: 1000px; -webkit-border-radius: 1000px; border-radius: 1000px; padding-right: 0; }
-.field .input.textarea { height: auto; }
-
-input.xnarrow, .input.xnarrow { width: 13.33333%; margin: 0; }
-input.xnarrow:last-child, .input.xnarrow:last-child { margin-left: -4px; }
-input.xnarrow:first-child, .input.xnarrow:first-child { margin-right: 3.94%; margin-left: 0; }
-input.xnarrow:first-child:last-child, .input.xnarrow:first-child:last-child { margin: 0; }
-input.narrow, .input.narrow { width: 30.66667%; margin: 0; }
-input.narrow:last-child, .input.narrow:last-child { margin-left: -4px; }
-input.narrow:first-child, .input.narrow:first-child { margin-right: 3.94%; margin-left: 0; }
-input.narrow:first-child:last-child, .input.narrow:first-child:last-child { margin: 0; }
-input.normal, .input.normal { width: 48%; margin: 0; }
-input.normal:last-child, .input.normal:last-child { margin-left: -4px; }
-input.normal:first-child, .input.normal:first-child { margin-right: 3.94%; margin-left: 0; }
-input.normal:first-child:last-child, .input.normal:first-child:last-child { margin: 0; }
-input.wide, .input.wide { width: 65.33333%; margin: 0; }
-input.wide:last-child, .input.wide:last-child { margin-left: -4px; }
-input.wide:first-child, .input.wide:first-child { margin-right: 3.94%; margin-left: 0; }
-input.wide:first-child:last-child, .input.wide:first-child:last-child { margin: 0; }
-input.xwide, .input.xwide { width: 82.66667%; margin: 0; }
-input.xwide:last-child, .input.xwide:last-child { margin-left: -4px; }
-input.xwide:first-child, .input.xwide:first-child { margin-right: 3.94%; margin-left: 0; }
-input.xwide:first-child:last-child, .input.xwide:first-child:last-child { margin: 0; }
-input.xxwide, .input.xxwide { width: 100%; margin: 0; }
-input.xxwide:last-child, .input.xxwide:last-child { margin-left: -4px; }
-input.xxwide:first-child, .input.xxwide:first-child { margin-right: 3.94%; margin-left: 0; }
-input.xxwide:first-child:last-child, .input.xxwide:first-child:last-child { margin: 0; }
-
-label + .xnarrow:last-child, label + .narrow:last-child, label + .normal:last-child, label + .wide:last-child, label + .xwide:last-child, label + .xxwide:last-child { margin-left: 0; }
-
-@media only screen and (max-width: 960px) { .xxwide:first-child, .xxwide:last-child { margin-right: 0%; } }
-/* remove inline-block white-space — A 0px font-size = 0px of white space */
-.prepend, .append { font-size: 0; white-space: nowrap; padding-bottom: 3.5px; }
-
-.prepend input, .prepend .input, .append input, .append .input { display: inline-block; max-width: 100%; margin-right: 0; margin-left: 0; }
-
-.prepend input, .prepend .input, .prepend.append input:last-child, .append *:last-child { -moz-border-radius: 0px 4px 4px 0; -webkit-border-radius: 0px; border-radius: 0px 4px 4px 0; }
-
-.append input, .append .input, .prepend.append input:first-child, .prepend *:first-child { -moz-border-radius: 4px 0 0 4px; -webkit-border-radius: 4px; border-radius: 4px 0 0 4px; }
-
-.prepend.append input { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
-
-.prepend.append input:last-child { margin-left: -1px; }
-
-.prepend .adjoined, .append .adjoined, .prepend .btn, .append .btn { position: relative; display: inline-block; margin-bottom: 0; z-index: 99; }
-
-.prepend .btn a, .prepend .btn input, .prepend .btn button, .append .btn a, .append .btn input, .append .btn button { padding: 0 12px; }
-
-.prepend .adjoined, .append .adjoined { padding: 0 10px 0 10px; background: #f2f2f2; border: 1px solid #d8d8d8; font-family: "Open Sans"; font-weight: 600; color: #555555; font-size: 16px; font-size: 1rem; height: 35.85532px; line-height: 33.85532px; }
-
-.prepend .adjoined, .prepend .btn { margin-right: -1px; }
-
-.adjoined:first-child { margin-left: 0 !important; }
-
-.append .adjoined, .append .btn { margin-left: -1px; }
-
-.append button, .prepend button { display: inline-block; }
-
-.prepend input:first-child, .append input:first-child, .prepend .input:first-child, .append .input:first-child { margin-right: 0; }
-
-.double input, .double .input { width: 50% !important; }
-.double input:last-child, .double .input:last-child { margin-left: -1px; }
-
-.field input, .field .input, .field textarea, .field .textarea, .field .radio span, .field .checkbox span, .field .picker { -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.field.danger:after { font-family: "entypo"; content: "\\2716"; font-size: 16px; position: absolute; top: 14%; right: 15px; z-index: 999; color: #ca3838; }
-.field.danger.no-icon:after { display: none; }
-.field.danger.append:after, .field.danger.prepend:after { content: ""; }
-.field.danger input, .field.danger .input, .field.danger textarea, .field.danger .textarea, .field.danger .radio span, .field.danger .checkbox span, .field.danger .picker { border-color: #ca3838; background: #f0c5c5; }
-.field.danger input, .field.danger .input, .field.danger textarea, .field.danger .textarea, .field.danger .radio span, .field.danger .checkbox span, .field.danger .picker, .field.danger input::-webkit-input-placeholder, .field.danger textarea::-webkit-input-placeholder, .field.danger input:-moz-placeholder, .field.danger textarea:-moz-placeholder textarea { color: #ca3838; }
-.field.warning:after { font-family: "entypo"; content: "\\26a0"; font-size: 16px; position: absolute; top: 14%; right: 15px; z-index: 999; color: #f6b83f; }
-.field.warning.no-icon:after { display: none; }
-.field.warning.append:after, .field.warning.prepend:after { content: ""; }
-.field.warning input, .field.warning .input, .field.warning textarea, .field.warning .textarea, .field.warning .radio span, .field.warning .checkbox span, .field.warning .picker { border-color: #f6b83f; background: #fef7ea; }
-.field.warning input, .field.warning .input, .field.warning textarea, .field.warning .textarea, .field.warning .radio span, .field.warning .checkbox span, .field.warning .picker, .field.warning input::-webkit-input-placeholder, .field.warning textarea::-webkit-input-placeholder, .field.warning input:-moz-placeholder, .field.warning textarea:-moz-placeholder textarea { color: #f6b83f; }
-.field.success:after { font-family: "entypo"; content: "\\2713"; font-size: 16px; position: absolute; top: 14%; right: 15px; z-index: 999; color: #58c026; }
-.field.success.no-icon:after { display: none; }
-.field.success.append:after, .field.success.prepend:after { content: ""; }
-.field.success input, .field.success .input, .field.success textarea, .field.success .textarea, .field.success .radio span, .field.success .checkbox span, .field.success .picker { border-color: #58c026; background: #c0eeaa; }
-.field.success input, .field.success .input, .field.success textarea, .field.success .textarea, .field.success .radio span, .field.success .checkbox span, .field.success .picker, .field.success input::-webkit-input-placeholder, .field.success textarea::-webkit-input-placeholder, .field.success input:-moz-placeholder, .field.success textarea:-moz-placeholder textarea { color: #58c026; }
-.field .picker.danger { border-color: #ca3838; color: #ca3838; background: #f0c5c5; -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.field .picker.danger select, .field .picker.danger:after { color: #ca3838; }
-.field .picker.warning { border-color: #f6b83f; color: #f6b83f; background: #fef7ea; -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.field .picker.warning select, .field .picker.warning:after { color: #f6b83f; }
-.field .picker.success { border-color: #58c026; color: #58c026; background: #c0eeaa; -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.field .picker.success select, .field .picker.success:after { color: #58c026; }
-
-.field .text input[type="search"] { -webkit-appearance: textfield; }
-
-.no-js .radio input { -webkit-appearance: radio; margin-left: 1px; }
-.no-js .checkbox input { -webkit-appearance: checkbox; }
-.no-js .radio input, .no-js .checkbox input { display: inline-block; width: 16px; }
-
-.js .field .radio, .js .field .checkbox { position: relative; }
-.js .field .radio.danger, .js .field .checkbox.danger { color: #ca3838; }
-.js .field .radio.danger span, .js .field .checkbox.danger span { border-color: #ca3838; color: #ca3838; background: #f0c5c5; -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.js .field .radio.warning, .js .field .checkbox.warning { color: #f6b83f; }
-.js .field .radio.warning span, .js .field .checkbox.warning span { border-color: #f6b83f; color: #f6b83f; background: #fef7ea; -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.js .field .radio.success, .js .field .checkbox.success { color: #58c026; color: #555555; }
-.js .field .radio.success i, .js .field .checkbox.success i { color: #58c026; }
-.js .field .radio.success span, .js .field .checkbox.success span { border-color: #58c026; color: #58c026; background: #c0eeaa; -moz-transition-duration: 0.2s; -o-transition-duration: 0.2s; -webkit-transition-duration: 0.2s; transition-duration: 0.2s; }
-.js .field .radio.checked i, .js .field .checkbox.checked i { position: absolute; top: -1px; left: -8px; line-height: 16px; }
-.js .field .radio span, .js .field .checkbox span { display: inline-block; width: 16px; height: 16px; position: relative; top: 2px; border: solid 1px #ccc; background: #fefefe; }
-.js .field .radio input[type="radio"], .js .field .radio input[type="checkbox"], .js .field .checkbox input[type="radio"], .js .field .checkbox input[type="checkbox"] { display: none; }
-.js .field .radio span { -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
-.js .field .checkbox span { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
-
-.field .text input[type="search"] { -webkit-appearance: textfield; }
-
-/* Form Picker Element () */
-.picker { position: relative; width: auto; display: inline-block; margin: 0 0 2px 1.2%; overflow: hidden; border: 1px solid #e5e5e5; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; font-family: "Open Sans"; font-weight: 600; height: auto; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2YyZjJmMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #f2f2f2)); background-image: -moz-linear-gradient(#ffffff, #f2f2f2); background-image: -webkit-linear-gradient(#ffffff, #f2f2f2); background-image: linear-gradient(#ffffff, #f2f2f2); }
-.picker:after { content: "\25BE"; font-family: entypo; z-index: 0; position: absolute; right: 8%; top: 50%; margin-top: -12px; color: #555555; }
-.picker:first-child { margin-left: 0; }
-.picker select { position: relative; display: block; min-width: 100%; width: 135%; height: 34px; padding: 6px 45px 6px 15px; color: #555555; border: none; background: transparent; outline: none; -webkit-appearance: none; z-index: 99; cursor: pointer; font-size: 16px; font-size: 1rem; }
-.picker select::-ms-expand { display: none; }
-
-/* Labels */
-.badge, .label { height: 20px; display: inline-block; font-family: Helvetica, arial, verdana, sans-serif; font-weight: bold; line-height: 20px; text-align: center; color: #fff; }
-.badge a, .label a { color: #fff; }
-.badge.primary, .label.primary { background: #3085d6; border: 1px solid #3085d6; }
-.badge.secondary, .label.secondary { background: #42a35a; border: 1px solid #42a35a; }
-.badge.default, .label.default { background: #f2f2f2; border: 1px solid #f2f2f2; color: #555555; }
-.badge.default:hover, .label.default:hover { border-color: #e5e5e5; }
-.badge.default a, .label.default a { color: #555555; }
-.badge.info, .label.info { background: #4a4d50; border: 1px solid #4a4d50; }
-.badge.danger, .label.danger { background: #ca3838; border: 1px solid #ca3838; }
-.badge.warning, .label.warning { background: #f6b83f; border: 1px solid #f6b83f; color: #644405; }
-.badge.warning a, .label.warning a { color: #644405; }
-.badge.success, .label.success { background: #58c026; border: 1px solid #58c026; }
-.badge.light, .label.light { background: #fff; color: #555555; border: 1px solid #f2f2f2; }
-.badge.light a, .label.light a { color: #d04526; }
-.badge.dark, .label.dark { background: #212121; border: 1px solid #212121; }
-
-.badge { padding: 0 10px; font-size: 14px; font-size: 0.875rem; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; }
-
-.label { padding: 0 10px; font-size: 12px; font-size: 0.75rem; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; }
-
-.alert { padding: 0 10px; font-family: "Open Sans"; font-weight: 600; list-style-type: none; word-wrap: break-word; margin-bottom: 8px; font-size: 14px; font-size: 0.875rem; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-.alert.primary { background: #85b7e7; border: 1px solid #3085d6; color: #1a5186; }
-.alert.secondary { background: #80cb92; border: 1px solid #42a35a; color: #255a32; }
-.alert.default { background: white; border: 1px solid #f2f2f2; color: #bfbfbf; color: #555555; border: 1px solid #f2f2f2; }
-.alert.info { background: #7b8085; border: 1px solid #4a4d50; color: #191a1b; color: #f2f2f2; }
-.alert.danger { background: #df8989; border: 1px solid #ca3838; color: #7b2121; }
-.alert.warning { background: #fbdca0; border: 1px solid #f6b83f; color: #c68609; color: #644405; }
-.alert.success { background: #91e26a; border: 1px solid #58c026; color: #316b15; }
-
-/* Tabs */
-.tabs { display: block; }
-
-.tab-nav { margin: 0; padding: 0; border-bottom: 1px solid #e5e5e5; }
-.tab-nav > li { display: inline-block; width: auto; padding: 0; margin: 0 2.12766% 0 0; cursor: default; top: 1px; -moz-box-shadow: 0 1px 0 #fff; -webkit-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; }
-.tab-nav > li > li { display: inline-block; width: auto; padding: 0; margin: 0 2.12766% 0 0; cursor: default; top: 1px; -moz-box-shadow: 0 1px 0 #fff; -webkit-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; }
-.tab-nav > li > li > a { display: block; width: auto; padding: 0 16px; margin: 0; color: #555555; font-family: "Open Sans"; font-weight: 600; border: 1px solid #e5e5e5; border-width: 1px 1px 0 1px; text-shadow: 0 1px 1px white; background: #f2f2f2; cursor: pointer; -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px; border-radius: 4px 4px 0 0; height: 42px; line-height: 40px; }
-.tab-nav > li > li > a:hover { text-decoration: none; background: whitesmoke; }
-.tab-nav > li > li > a:active { background: #ededed; }
-.tab-nav > li > li.active > a { height: 43px; line-height: 41px; background: #fff; cursor: default; }
-.tab-nav > li > li:last-child { margin-right: 0; }
-
-.tab-nav > li:last-child { margin-right: 0; }
-
-.tab-nav > li > a { display: block; width: auto; padding: 0 16px; margin: 0; color: #555555; font-family: "Open Sans"; font-weight: 600; border: 1px solid #e5e5e5; border-width: 1px 1px 0 1px; text-shadow: 0 1px 1px white; background: #f2f2f2; cursor: pointer; -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px; border-radius: 4px 4px 0 0; height: 42px; line-height: 40px; }
-.tab-nav > li > a:hover { text-decoration: none; background: whitesmoke; }
-.tab-nav > li > a:active { background: #ededed; }
-
-.tab-nav > li.active > a { height: 43px; line-height: 41px; background: #fff; }
-
-.tabs.pill .tab-nav { width: 100%; /* remove if you dont want the tabs to span the full container width */ display: table; overflow: hidden; border: 1px solid #e5e5e5; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-.tabs.pill .tab-nav > li { display: table-cell; margin: 0; margin-left: -4px; text-align: center; top: 0; }
-.tabs.pill .tab-nav > li:first-child { margin-left: 0; }
-.tabs.pill .tab-nav > li > a { border: none; border-right: 1px solid #e5e5e5; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; height: 42px; line-height: 40px; }
-.tabs.pill .tab-nav > li:last-child > a { border-right: none; }
-
-.tab-content { display: none; padding: 20px 10px; }
-.tab-content.active { display: block; }
-
-.tabs.vertical .tab-nav { border: none; }
-.tabs.vertical .tab-nav > li { display: block; margin: 0; margin-bottom: 5px; }
-.tabs.vertical .tab-nav > li.active { position: relative; z-index: 99; }
-.tabs.vertical .tab-nav > li.active > a { border-right: 1px solid #fff; }
-.tabs.vertical .tab-nav > li > a { border: 1px solid #e5e5e5; -moz-border-radius: 4px 0 0 4px; -webkit-border-radius: 4px; border-radius: 4px 0 0 4px; }
-.tabs.vertical .tab-content { padding: 10px 0 30px 20px; margin-left: -1px; border-left: 1px solid #e5e5e5; }
-
-/* Images */
-.image { line-height: 0; margin-bottom: 20px; }
-.image.circle { -moz-border-radius: 50% !important; -webkit-border-radius: 50%; border-radius: 50% !important; overflow: hidden; width: auto; }
-.image.rounded { overflow: hidden; -moz-border-radius: 4px 4px; -webkit-border-radius: 4px; border-radius: 4px 4px; }
-.image.photo { border: 5px solid #fff; -moz-box-shadow: 0 0 1px #555555; -webkit-box-shadow: 0 0 1px #555555; box-shadow: 0 0 1px #555555; }
-.image.photo.polaroid { padding-bottom: 50px; background: #fff; }
-
-/* Video */
-body .video { width: 100%; position: relative; height: 0; padding-bottom: 56.25%; }
-body .video.twitch, body .video.youtube.show_controls { padding-top: 30px; }
-
-.video > video, .video > iframe, .video > object, .video > embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-/* Toggles */
-.drawer { position: relative; width: 100%; max-height: 0; background: #3e4144; -moz-box-shadow: inset 0 -2px 5px #313436, inset 0 2px 5px #313436; -webkit-box-shadow: inset 0 -2px 5px #313436, inset 0 2px 5px #313436; box-shadow: inset 0 -2px 5px #313436, inset 0 2px 5px #313436; overflow: hidden; -moz-transition-duration: 0.3s; -o-transition-duration: 0.3s; -webkit-transition-duration: 0.3s; transition-duration: 0.3s; }
-.drawer.active { height: auto; max-height: 800px; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; -webkit-transition-duration: 0.5s; transition-duration: 0.5s; }
-
-.modal { width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 999999; background: black; background: rgba(0, 0, 0, 0.8); }
-.modal > .content { width: 50%; min-height: 50%; max-height: 65%; position: relative; top: 25%; margin: 0 auto; padding: 20px; background: #fff; z-index: 2; overflow: auto; }
-@media only screen and (max-width: 768px) { .modal > .content { width: 80%; min-height: 80%; max-height: 80%; top: 10%; } }
-@media only screen and (max-width: 767px) { .modal > .content { width: 92.5%; min-height: 92.5%; max-height: 92.5%; top: 3.75%; } }
-.modal > .content > .close { position: absolute; top: 10px; right: 10px; cursor: pointer; z-index: 3; }
-.modal, .modal > .content { visibility: hidden; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity: 0; }
-.modal.active { -moz-transition-property: opacity; -o-transition-property: opacity; -webkit-transition-property: opacity; transition-property: opacity; -moz-transition-duration: 0.3s; -o-transition-duration: 0.3s; -webkit-transition-duration: 0.3s; transition-duration: 0.3s; }
-.modal.active, .modal.active > .content { visibility: visible; filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false); opacity: 1; }
-
-/* Tables */
-table { display: table; background-color: #fff; border-collapse: collapse; border-spacing: 0; margin-bottom: 20px; width: 100%; border: 1px solid #e5e5e5; }
-table caption { text-align: center; font-size: 29.79335px; padding: .75em; }
-table thead th, table tbody td, table tr td { display: table-cell; padding: 10px; vertical-align: top; text-align: left; border-top: 1px solid #e5e5e5; }
-table tr td, table tbody tr td { font-size: 16px; }
-table tr td:first-child { font-weight: bold; }
-table thead { background-color: #3085d6; color: #fff; }
-table thead tr th { font-size: 16px; font-weight: bold; vertical-align: bottom; }
-table.striped tr:nth-of-type(even), table table tr.stripe, table table tr.striped { background-color: #e5e5e5; }
-table.rounded { border-radius: 4px; border-collapse: separate; }
-table.rounded caption + thead tr:first-child th:first-child, table.rounded caption + tr td:first-child, table.rounded > thead tr:first-child th:first-child, table.rounded > thead tr:first-child td:first-child, table.rounded > tr:first-child td:first-child { border-top-left-radius: 4px; }
-table.rounded caption + thead tr:first-child th:last-child, table.rounded caption + tr td:last-child, table.rounded > thead tr:first-child th:last-child, table.rounded > thead tr:first-child td:last-child, table.rounded > tr:first-child td:last-child { border-top-right-radius: 4px; }
-table.rounded thead ~ tr:last-child td:last-child, table.rounded tbody tr:last-child td:last-child { border-bottom-right-radius: 4px; }
-table.rounded thead ~ tr:last-child td:first-child, table.rounded tbody tr:last-child td:first-child { border-bottom-left-radius: 4px; }
-table.rounded thead th, table.rounded thead td, table.rounded caption + tbody tr:first-child td, table.rounded > tbody:first-child tr:first-child td { border-top: 0; }
-
-/* Tooltips */
-.ttip { position: relative; cursor: pointer; }
-.ttip:after { display: block; background: #3085d6; border: 1px solid #3085d6; border-bottom: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; padding: 0.5em 0.75em; width: auto; min-width: 130px; max-width: 500px; position: absolute; left: 0; bottom: 101%; margin-bottom: 8px; text-align: left; color: #fff; content: attr(data-tooltip); line-height: 1.5; font-size: 16px; font-weight: normal; font-style: normal; -moz-transition: opacity 0.1s ease; -o-transition: opacity 0.1s ease; -webkit-transition: opacity 0.1s ease; transition: opacity 0.1s ease; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity: 0; pointer-events: none; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzY1YTRlMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwODVkNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #65a4e1), color-stop(100%, #3085d6)); background-image: -moz-linear-gradient(top, #65a4e1, #3085d6); background-image: -webkit-linear-gradient(top, #65a4e1, #3085d6); background-image: linear-gradient(to bottom, #65a4e1, #3085d6); -moz-box-shadow: 0 0 5px 0 rgba(48, 133, 214, 0.25); -webkit-box-shadow: 0 0 5px 0 rgba(48, 133, 214, 0.25); box-shadow: 0 0 5px 0 rgba(48, 133, 214, 0.25); }
-.ttip:before { content: " "; width: 0; height: 0; position: absolute; bottom: 101%; left: 8px; border-top: 9px solid #3085d6 !important; border-left: 9px solid transparent; border-right: 9px solid transparent; -moz-transition: opacity 0.1s ease; -o-transition: opacity 0.1s ease; -webkit-transition: opacity 0.1s ease; transition: opacity 0.1s ease; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity: 0; pointer-events: none; }
-.ttip:hover:after, .ttip:hover:before { -moz-transition: opacity 0.1s ease; -o-transition: opacity 0.1s ease; -webkit-transition: opacity 0.1s ease; transition: opacity 0.1s ease; filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false); opacity: 1; }
-
-@media only screen and (max-width: 768px) { .ttip:after, .ttip:before { display: none; } }
-
-/* SHAME */
-.ie8 .xxwide, .ie8 .xwide, .ie8 .wide, .ie8 .normal, .ie8 .narrow, .ie8 .xnarrow { display: inline; }
-.ie8 .xxwide + input, .ie8 .xwide + input, .ie8 .wide + input, .ie8 .normal + input, .ie8 .narrow + input, .ie8 .xnarrow + input { display: inline; margin: 0 0 0 -.25em; }
-.ie8 .ttip:before, .ie8 .ttip:after { display: none; }
-.ie8 .ttip:hover:before, .ie8 .ttip:hover:after { display: block; }
-
-.ie9 .radio.checked i, .ie9 .checkbox.checked i { top: 0; }
diff --git a/vendor/github.com/tdewolff/minify/benchmarks/sample_jquery.js b/vendor/github.com/tdewolff/minify/benchmarks/sample_jquery.js
deleted file mode 100644
index 79d631ff..00000000
--- a/vendor/github.com/tdewolff/minify/benchmarks/sample_jquery.js
+++ /dev/null
@@ -1,9205 +0,0 @@
-/*!
- * jQuery JavaScript Library v2.1.3
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2014-12-18T15:11Z
- */
-
-(function( global, factory ) {
-
- if ( typeof module === "object" && typeof module.exports === "object" ) {
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- } else {
- factory( global );
- }
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//
-
-var arr = [];
-
-var slice = arr.slice;
-
-var concat = arr.concat;
-
-var push = arr.push;
-
-var indexOf = arr.indexOf;
-
-var class2type = {};
-
-var toString = class2type.toString;
-
-var hasOwn = class2type.hasOwnProperty;
-
-var support = {};
-
-
-
-var
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
-
- version = "2.1.3",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- },
-
- // Support: Android<4.1
- // Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([\da-z])/gi,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn = jQuery.prototype = {
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // Start with an empty selector
- selector: "",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num != null ?
-
- // Return just the one element from the set
- ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
- // Return all the elements in a clean array
- slice.call( this );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
- ret.context = this.context;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
-};
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // Skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // Extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend({
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- isFunction: function( obj ) {
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray,
-
- isWindow: function( obj ) {
- return obj != null && obj === obj.window;
- },
-
- isNumeric: function( obj ) {
- // parseFloat NaNs numeric-cast false positives (null|true|false|"")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- // adding 1 corrects loss of precision from parseFloat (#15100)
- return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
- },
-
- isPlainObject: function( obj ) {
- // Not plain objects:
- // - Any object or value whose internal [[Class]] property is not "[object Object]"
- // - DOM nodes
- // - window
- if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- if ( obj.constructor &&
- !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
- return false;
- }
-
- // If the function hasn't returned already, we're confident that
- // |obj| is a plain object, created by {} or constructed with new Object
- return true;
- },
-
- isEmptyObject: function( obj ) {
- var name;
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
- // Support: Android<4.0, iOS<6 (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call(obj) ] || "object" :
- typeof obj;
- },
-
- // Evaluates a script in a global context
- globalEval: function( code ) {
- var script,
- indirect = eval;
-
- code = jQuery.trim( code );
-
- if ( code ) {
- // If the code includes a valid, prologue position
- // strict mode pragma, execute code by injecting a
- // script tag into the document.
- if ( code.indexOf("use strict") === 1 ) {
- script = document.createElement("script");
- script.text = code;
- document.head.appendChild( script ).parentNode.removeChild( script );
- } else {
- // Otherwise, avoid the DOM node creation, insertion
- // and removal by using an indirect global eval
- indirect( code );
- }
- }
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE9-11+
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- // args is for internal usage only
- each: function( obj, callback, args ) {
- var value,
- i = 0,
- length = obj.length,
- isArray = isArraylike( obj );
-
- if ( args ) {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- }
- }
-
- return obj;
- },
-
- // Support: Android<4.1
- trim: function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArraylike( Object(arr) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- return arr == null ? -1 : indexOf.call( arr, elem, i );
- },
-
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- for ( ; j < len; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value,
- i = 0,
- length = elems.length,
- isArray = isArraylike( elems ),
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- now: Date.now,
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-function isArraylike( obj ) {
- var length = obj.length,
- type = jQuery.type( obj );
-
- if ( type === "function" || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- if ( obj.nodeType === 1 && length ) {
- return true;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
-}
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.2.0-pre
- * http://sizzlejs.com/
- *
- * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2014-12-16
- */
-(function( window ) {
-
-var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // General-purpose constants
- MAX_NEGATIVE = 1 << 31,
-
- // Instance methods
- hasOwn = ({}).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- push_native = arr.push,
- push = arr.push,
- slice = arr.slice,
- // Use a stripped-down indexOf as it's faster than native
- // http://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
- // http://www.w3.org/TR/css3-syntax/#characters
- characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
- // Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = characterEncoding.replace( "w", "w#" ),
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
- "*\\]",
-
- pseudos = ":(" + characterEncoding + ")(?:\\((" +
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
- rescape = /'|\\/g,
-
- // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
- funescape = function( _, escaped, escapedWhitespace ) {
- var high = "0x" + escaped - 0x10000;
- // NaN means non-codepoint
- // Support: Firefox<24
- // Workaround erroneous numeric interpretation of +"0x"
- return high !== high || escapedWhitespace ?
- escaped :
- high < 0 ?
- // BMP codepoint
- String.fromCharCode( high + 0x10000 ) :
- // Supplemental Plane codepoint (surrogate pair)
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- };
-
-// Optimize for push.apply( _, NodeList )
-try {
- push.apply(
- (arr = slice.call( preferredDoc.childNodes )),
- preferredDoc.childNodes
- );
- // Support: Android<4.0
- // Detect silently failing push.apply
- arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- push_native.apply( target, slice.call(els) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
- // Can't trust NodeList.length
- while ( (target[j++] = els[i++]) ) {}
- target.length = j - 1;
- }
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- var match, elem, m, nodeType,
- // QSA vars
- i, groups, old, nid, newContext, newSelector;
-
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
-
- context = context || document;
- results = results || [];
- nodeType = context.nodeType;
-
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- if ( !seed && documentIsHTML ) {
-
- // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
- // Speed-up: Sizzle("#ID")
- if ( (m = match[1]) ) {
- if ( nodeType === 9 ) {
- elem = context.getElementById( m );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document (jQuery #6963)
- if ( elem && elem.parentNode ) {
- // Handle the case where IE, Opera, and Webkit return items
- // by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
- } else {
- // Context is not a document
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
- contains( context, elem ) && elem.id === m ) {
- results.push( elem );
- return results;
- }
- }
-
- // Speed-up: Sizzle("TAG")
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && support.getElementsByClassName ) {
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // QSA path
- if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- nid = old = expando;
- newContext = context;
- newSelector = nodeType !== 1 && selector;
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- groups = tokenize( selector );
-
- if ( (old = context.getAttribute("id")) ) {
- nid = old.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", nid );
- }
- nid = "[id='" + nid + "'] ";
-
- i = groups.length;
- while ( i-- ) {
- groups[i] = nid + toSelector( groups[i] );
- }
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
- newSelector = groups.join(",");
- }
-
- if ( newSelector ) {
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch(qsaError) {
- } finally {
- if ( !old ) {
- context.removeAttribute("id");
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
-function createCache() {
- var keys = [];
-
- function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return (cache[ key + " " ] = value);
- }
- return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
- var div = document.createElement("div");
-
- try {
- return !!fn( div );
- } catch (e) {
- return false;
- } finally {
- // Remove from its parent by default
- if ( div.parentNode ) {
- div.parentNode.removeChild( div );
- }
- // release memory in IE
- div = null;
- }
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
- var arr = attrs.split("|"),
- i = attrs.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[i] ] = handler;
- }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- ( ~b.sourceIndex || MAX_NEGATIVE ) -
- ( ~a.sourceIndex || MAX_NEGATIVE );
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( (cur = cur.nextSibling) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
-function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
-}
-
-/**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
-function testContext( context ) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
-}
-
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, parent,
- doc = node ? node.ownerDocument || node : preferredDoc;
-
- // If no document and documentElement is available, return
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
- return document;
- }
-
- // Set our document
- document = doc;
- docElem = doc.documentElement;
- parent = doc.defaultView;
-
- // Support: IE>8
- // If iframe document is assigned to "document" variable and if iframe has been reloaded,
- // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
- // IE6-8 do not support the defaultView property so parent will be undefined
- if ( parent && parent !== parent.top ) {
- // IE11 does not have attachEvent, so all must suffer
- if ( parent.addEventListener ) {
- parent.addEventListener( "unload", unloadHandler, false );
- } else if ( parent.attachEvent ) {
- parent.attachEvent( "onunload", unloadHandler );
- }
- }
-
- /* Support tests
- ---------------------------------------------------------------------- */
- documentIsHTML = !isXML( doc );
-
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert(function( div ) {
- div.className = "i";
- return !div.getAttribute("className");
- });
-
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert(function( div ) {
- div.appendChild( doc.createComment("") );
- return !div.getElementsByTagName("*").length;
- });
-
- // Support: IE<9
- support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert(function( div ) {
- docElem.appendChild( div ).id = expando;
- return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
- });
-
- // ID find and filter
- if ( support.getById ) {
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var m = context.getElementById( id );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [ m ] : [];
- }
- };
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- return elem.getAttribute("id") === attrId;
- };
- };
- } else {
- // Support: IE6/7
- // getElementById is not reliable as a find shortcut
- delete Expr.find["ID"];
-
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- };
- }
-
- // Tag
- Expr.find["TAG"] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
-
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( (elem = results[i++]) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
-
- // Class
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( documentIsHTML ) {
- return context.getElementsByClassName( className );
- }
- };
-
- /* QSA/matchesSelector
- ---------------------------------------------------------------------- */
-
- // QSA and matchesSelector support
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See http://bugs.jquery.com/ticket/13378
- rbuggyQSA = [];
-
- if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( div ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- docElem.appendChild( div ).innerHTML = " " +
- "" +
- " ";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( div.querySelectorAll("[msallowcapture^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !div.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
- if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push("~=");
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !div.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibing-combinator selector` fails
- if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push(".#.+[+~]");
- }
- });
-
- assert(function( div ) {
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = doc.createElement("input");
- input.setAttribute( "type", "hidden" );
- div.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( div.querySelectorAll("[name=d]").length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( !div.querySelectorAll(":enabled").length ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Opera 10-11 does not throw on post-comma invalid pseudos
- div.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- });
- }
-
- if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector) )) ) {
-
- assert(function( div ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( div, "div" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( div, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- });
- }
-
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully does not implement inclusive descendent
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ));
- } :
- function( a, b ) {
- if ( b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
-
- /* Sorting
- ---------------------------------------------------------------------- */
-
- // Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
-
- // Flag for duplicate removal
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- // Sort on method existence if only one input has compareDocumentPosition
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if ( compare ) {
- return compare;
- }
-
- // Calculate position if both inputs belong to the same document
- compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
- a.compareDocumentPosition( b ) :
-
- // Otherwise we know they are disconnected
- 1;
-
- // Disconnected nodes
- if ( compare & 1 ||
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
- // Choose the first element that is related to our preferred document
- if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
- return -1;
- }
- if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
- return 1;
- }
-
- // Maintain original order
- return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
- }
-
- return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
- return a === doc ? -1 :
- b === doc ? 1 :
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( (cur = cur.parentNode) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( (cur = cur.parentNode) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[i] === bp[i] ) {
- i++;
- }
-
- return i ?
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[i], bp[i] ) :
-
- // Otherwise nodes in our document sort first
- ap[i] === preferredDoc ? -1 :
- bp[i] === preferredDoc ? 1 :
- 0;
- };
-
- return doc;
-};
-
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- if ( support.matchesSelector && documentIsHTML &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
-
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || support.disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch (e) {}
- }
-
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
- // Set document vars if needed
- if ( ( context.ownerDocument || context ) !== document ) {
- setDocument( context );
- }
- return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- var fn = Expr.attrHandle[ name.toLowerCase() ],
- // Don't get fooled by Object.prototype properties (jQuery #13807)
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
- fn( elem, name, !documentIsHTML ) :
- undefined;
-
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- (val = elem.getAttributeNode(name)) && val.specified ?
- val.value :
- null;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
-Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- j = 0,
- i = 0;
-
- // Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- while ( (elem = results[i++]) ) {
- if ( elem === results[ i ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- // Clear input after sorting to release objects
- // See https://github.com/jquery/sizzle/pull/225
- sortInput = null;
-
- return results;
-};
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
- // If no nodeType, this is expected to be an array
- while ( (node = elem[i++]) ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
-
- return ret;
-};
-
-Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- attrHandle: {},
-
- find: {},
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( runescape, funescape );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 what (child|of-type)
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 4 xn-component of xn+y argument ([+-]?\d*n|)
- 5 sign of xn-component
- 6 x of xn-component
- 7 sign of y-component
- 8 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1].slice( 0, 3 ) === "nth" ) {
- // nth-* requires argument
- if ( !match[3] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[3] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var excess,
- unquoted = !match[6] && match[2];
-
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- // Accept quoted arguments as-is
- if ( match[3] ) {
- match[2] = match[4] || match[5] || "";
-
- // Strip excess characters from unquoted arguments
- } else if ( unquoted && rpseudo.test( unquoted ) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- match[0] = match[0].slice( 0, excess );
- match[2] = unquoted.slice( 0, excess );
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
-
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
- return nodeNameSelector === "*" ?
- function() { return true; } :
- function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ className + " " ];
-
- return pattern ||
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
- classCache( className, function( elem ) {
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
- });
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, what, argument, first, last ) {
- var simple = type.slice( 0, 3 ) !== "nth",
- forward = type.slice( -4 ) !== "last",
- ofType = what === "of-type";
-
- return first === 1 && last === 0 ?
-
- // Shortcut for :nth-*(n)
- function( elem ) {
- return !!elem.parentNode;
- } :
-
- function( elem, context, xml ) {
- var cache, outerCache, node, diff, nodeIndex, start,
- dir = simple !== forward ? "nextSibling" : "previousSibling",
- parent = elem.parentNode,
- name = ofType && elem.nodeName.toLowerCase(),
- useCache = !xml && !ofType;
-
- if ( parent ) {
-
- // :(first|last|only)-(child|of-type)
- if ( simple ) {
- while ( dir ) {
- node = elem;
- while ( (node = node[ dir ]) ) {
- if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
- return false;
- }
- }
- // Reverse direction for :only-* (if we haven't yet done so)
- start = dir = type === "only" && !start && "nextSibling";
- }
- return true;
- }
-
- start = [ forward ? parent.firstChild : parent.lastChild ];
-
- // non-xml :nth-child(...) stores cache data on `parent`
- if ( forward && useCache ) {
- // Seek `elem` from a previously-cached index
- outerCache = parent[ expando ] || (parent[ expando ] = {});
- cache = outerCache[ type ] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = cache[0] === dirruns && cache[2];
- node = nodeIndex && parent.childNodes[ nodeIndex ];
-
- while ( (node = ++nodeIndex && node && node[ dir ] ||
-
- // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- // When found, cache indexes on `parent` and break
- if ( node.nodeType === 1 && ++diff && node === elem ) {
- outerCache[ type ] = [ dirruns, nodeIndex, diff ];
- break;
- }
- }
-
- // Use previously-cached element index if available
- } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
- diff = cache[1];
-
- // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
- } else {
- // Use the same loop as above to seek `elem` from the start
- while ( (node = ++nodeIndex && node && node[ dir ] ||
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
- // Cache the index of each encountered element
- if ( useCache ) {
- (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
- }
-
- if ( node === elem ) {
- break;
- }
- }
- }
- }
-
- // Incorporate the offset, then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- // Potentially complex pseudos
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- // Don't keep the element (issue #299)
- input[0] = null;
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- text = text.replace( runescape, funescape );
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
- // lang value must be a valid identifier
- if ( !ridentifier.test(lang || "") ) {
- Sizzle.error( "unsupported lang: " + lang );
- }
- lang = lang.replace( runescape, funescape ).toLowerCase();
- return function( elem ) {
- var elemLang;
- do {
- if ( (elemLang = documentIsHTML ?
- elem.lang :
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
- }
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
- return false;
- };
- }),
-
- // Miscellaneous
- "target": function( elem ) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice( 1 ) === elem.id;
- },
-
- "root": function( elem ) {
- return elem === docElem;
- },
-
- "focus": function( elem ) {
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
-
- // Boolean properties
- "enabled": function( elem ) {
- return elem.disabled === false;
- },
-
- "disabled": function( elem ) {
- return elem.disabled === true;
- },
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- // Contents
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
- // but not by others (comment: 8; processing instruction: 7; etc.)
- // nodeType < 6 works because attributes (2) do not appear as children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- if ( elem.nodeType < 6 ) {
- return false;
- }
- }
- return true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- // Element/input types
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "text": function( elem ) {
- var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
-
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
- },
-
- // Position-in-collection
- "first": createPositionalPseudo(function() {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 0;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 1;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
-};
-
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
- Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
- Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-// Easy API for creating new setFilters
-function setFilters() {}
-setFilters.prototype = Expr.filters = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ selector + " " ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- // Don't consume trailing commas as valid
- soFar = soFar.slice( match[0].length ) || soFar;
- }
- groups.push( (tokens = []) );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace( rtrim, " " )
- });
- soFar = soFar.slice( matched.length );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- (match = preFilters[ type ]( match ))) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: type,
- matches: match
- });
- soFar = soFar.slice( matched.length );
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
-};
-
-function toSelector( tokens ) {
- var i = 0,
- len = tokens.length,
- selector = "";
- for ( ; i < len; i++ ) {
- selector += tokens[i].value;
- }
- return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- checkNonElements = base && dir === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- return matcher( elem, context, xml );
- }
- }
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- var oldCache, outerCache,
- newCache = [ dirruns, doneName ];
-
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
- if ( xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- if ( matcher( elem, context, xml ) ) {
- return true;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- outerCache = elem[ expando ] || (elem[ expando ] = {});
- if ( (oldCache = outerCache[ dir ]) &&
- oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
- // Assign to newCache so results back-propagate to previous elements
- return (newCache[ 2 ] = oldCache[ 2 ]);
- } else {
- // Reuse newcache so results back-propagate to previous elements
- outerCache[ dir ] = newCache;
-
- // A match means we're done; a fail means we have to keep checking
- if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
- return true;
- }
- }
- }
- }
- }
- };
-}
-
-function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
-}
-
-function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results );
- }
- return results;
-}
-
-function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- var temp, i, elem,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- temp = condense( matcherOut, postMap );
- postFilter( temp, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = temp.length;
- while ( i-- ) {
- if ( (elem = temp[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- if ( seed ) {
- if ( postFinder || preFilter ) {
- if ( postFinder ) {
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
- temp = [];
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- // Restore matcherIn since elem is not yet a final match
- temp.push( (matcherIn[i] = elem) );
- }
- }
- postFinder( null, (matcherOut = []), temp, xml );
- }
-
- // Move matched elements from seed to results to keep them synchronized
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) &&
- (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
-
- // Add elements to results, through postFinder if defined
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
-}
-
-function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- // Avoid hanging onto element (issue #299)
- checkContext = null;
- return ret;
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
- } else {
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
- ).replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && toSelector( tokens )
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, outermost ) {
- var elem, j, matcher,
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- setMatched = [],
- contextBackup = outermostContext,
- // We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
- // Use integer dirruns iff this is the outermost matcher
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
- len = elems.length;
-
- if ( outermost ) {
- outermostContext = context !== document && context;
- }
-
- // Add elements passing elementMatchers directly to results
- // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
- for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- j = 0;
- while ( (matcher = elementMatchers[j++]) ) {
- if ( matcher( elem, context, xml ) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // Apply set filters to unmatched elements
- matchedCount += i;
- if ( bySet && i !== matchedCount ) {
- j = 0;
- while ( (matcher = setMatchers[j++]) ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ selector + " " ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !match ) {
- match = tokenize( selector );
- }
- i = match.length;
- while ( i-- ) {
- cached = matcherFromTokens( match[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
- // Save selector and tokenization
- cached.selector = selector;
- }
- return cached;
-};
-
-/**
- * A low-level selection function that works with Sizzle's compiled
- * selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
-select = Sizzle.select = function( selector, context, results, seed ) {
- var i, tokens, token, type, find,
- compiled = typeof selector === "function" && selector,
- match = !seed && tokenize( (selector = compiled.selector || selector) );
-
- results = results || [];
-
- // Try to minimize operations if there is no seed and only one group
- if ( match.length === 1 ) {
-
- // Take a shortcut and set the context if the root selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- support.getById && context.nodeType === 9 && documentIsHTML &&
- Expr.relative[ tokens[1].type ] ) {
-
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
- if ( !context ) {
- return results;
-
- // Precompiled matchers will still verify ancestry, so step up a level
- } else if ( compiled ) {
- context = context.parentNode;
- }
-
- selector = selector.slice( tokens.shift().value.length );
- }
-
- // Fetch a seed set for right-to-left matching
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
- while ( i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( runescape, funescape ),
- rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && toSelector( tokens );
- if ( !selector ) {
- push.apply( results, seed );
- return results;
- }
-
- break;
- }
- }
- }
- }
-
- // Compile and execute a filtering function if one is not provided
- // Provide `match` to avoid retokenization if we modified the selector above
- ( compiled || compile( selector, match ) )(
- seed,
- context,
- !documentIsHTML,
- results,
- rsibling.test( selector ) && testContext( context.parentNode ) || context
- );
- return results;
-};
-
-// One-time assignments
-
-// Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
-
-// Initialize against the default document
-setDocument();
-
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
-// Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
- // Should return 1, but returns 4 (following)
- return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
- div.innerHTML = " ";
- return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- });
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
- div.innerHTML = " ";
- div.firstChild.setAttribute( "value", "" );
- return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
- addHandle( "value", function( elem, name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- });
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
- return div.getAttribute("disabled") == null;
-}) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- (val = elem.getAttributeNode( name )) && val.specified ?
- val.value :
- null;
- }
- });
-}
-
-return Sizzle;
-
-})( window );
-
-
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-
-var rneedsContext = jQuery.expr.match.needsContext;
-
-var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
-
-
-
-var risSimple = /^.[^:#\[\.,]*$/;
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep( elements, function( elem, i ) {
- /* jshint -W018 */
- return !!qualifier.call( elem, i, elem ) !== not;
- });
-
- }
-
- if ( qualifier.nodeType ) {
- return jQuery.grep( elements, function( elem ) {
- return ( elem === qualifier ) !== not;
- });
-
- }
-
- if ( typeof qualifier === "string" ) {
- if ( risSimple.test( qualifier ) ) {
- return jQuery.filter( qualifier, elements, not );
- }
-
- qualifier = jQuery.filter( qualifier, elements );
- }
-
- return jQuery.grep( elements, function( elem ) {
- return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
- });
-}
-
-jQuery.filter = function( expr, elems, not ) {
- var elem = elems[ 0 ];
-
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 && elem.nodeType === 1 ?
- jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
- jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- }));
-};
-
-jQuery.fn.extend({
- find: function( selector ) {
- var i,
- len = this.length,
- ret = [],
- self = this;
-
- if ( typeof selector !== "string" ) {
- return this.pushStack( jQuery( selector ).filter(function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- }) );
- }
-
- for ( i = 0; i < len; i++ ) {
- jQuery.find( selector, self[ i ], ret );
- }
-
- // Needed because $( selector, context ) becomes $( context ).find( selector )
- ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
- ret.selector = this.selector ? this.selector + " " + selector : selector;
- return ret;
- },
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector || [], false) );
- },
- not: function( selector ) {
- return this.pushStack( winnow(this, selector || [], true) );
- },
- is: function( selector ) {
- return !!winnow(
- this,
-
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test( selector ) ?
- jQuery( selector ) :
- selector || [],
- false
- ).length;
- }
-});
-
-
-// Initialize a jQuery object
-
-
-// A central reference to the root jQuery(document)
-var rootjQuery,
-
- // A simple way to check for HTML strings
- // Prioritize #id over to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
- init = jQuery.fn.init = function( selector, context ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- context = context instanceof jQuery ? context[0] : context;
-
- // Option to run scripts is true for back-compat
- // Intentionally let the error be thrown if parseHTML is not present
- jQuery.merge( this, jQuery.parseHTML(
- match[1],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
- // Properties of context are called as methods if possible
- if ( jQuery.isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[2] );
-
- // Support: Blackberry 4.6
- // gEBID returns nodes no longer in the document (#6963)
- if ( elem && elem.parentNode ) {
- // Inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return typeof rootjQuery.ready !== "undefined" ?
- rootjQuery.ready( selector ) :
- // Execute immediately if ready is not present
- selector( jQuery );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- };
-
-// Give the init function the jQuery prototype for later instantiation
-init.prototype = jQuery.fn;
-
-// Initialize central reference
-rootjQuery = jQuery( document );
-
-
-var rparentsprev = /^(?:parents|prev(?:Until|All))/,
- // Methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
-jQuery.extend({
- dir: function( elem, dir, until ) {
- var matched = [],
- truncate = until !== undefined;
-
- while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
- if ( elem.nodeType === 1 ) {
- if ( truncate && jQuery( elem ).is( until ) ) {
- break;
- }
- matched.push( elem );
- }
- }
- return matched;
- },
-
- sibling: function( n, elem ) {
- var matched = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- matched.push( n );
- }
- }
-
- return matched;
- }
-});
-
-jQuery.fn.extend({
- has: function( target ) {
- var targets = jQuery( target, this ),
- l = targets.length;
-
- return this.filter(function() {
- var i = 0;
- for ( ; i < l; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- matched = [],
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( ; i < l; i++ ) {
- for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
- // Always skip document fragments
- if ( cur.nodeType < 11 && (pos ?
- pos.index(cur) > -1 :
-
- // Don't pass non-elements to Sizzle
- cur.nodeType === 1 &&
- jQuery.find.matchesSelector(cur, selectors)) ) {
-
- matched.push( cur );
- break;
- }
- }
- }
-
- return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
- },
-
- // Determine the position of an element within the set
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
- }
-
- // Index in selector
- if ( typeof elem === "string" ) {
- return indexOf.call( jQuery( elem ), this[ 0 ] );
- }
-
- // Locate the position of the desired element
- return indexOf.call( this,
-
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[ 0 ] : elem
- );
- },
-
- add: function( selector, context ) {
- return this.pushStack(
- jQuery.unique(
- jQuery.merge( this.get(), jQuery( selector, context ) )
- )
- );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter(selector)
- );
- }
-});
-
-function sibling( cur, dir ) {
- while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
- return cur;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return elem.contentDocument || jQuery.merge( [], elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var matched = jQuery.map( this, fn, until );
-
- if ( name.slice( -5 ) !== "Until" ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- matched = jQuery.filter( selector, matched );
- }
-
- if ( this.length > 1 ) {
- // Remove duplicates
- if ( !guaranteedUnique[ name ] ) {
- jQuery.unique( matched );
- }
-
- // Reverse order for parents* and prev-derivatives
- if ( rparentsprev.test( name ) ) {
- matched.reverse();
- }
- }
-
- return this.pushStack( matched );
- };
-});
-var rnotwhite = (/\S+/g);
-
-
-
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
- var object = optionsCache[ options ] = {};
- jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- });
- return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- ( optionsCache[ options ] || createOptions( options ) ) :
- jQuery.extend( {}, options );
-
- var // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // Flag to know if list is currently firing
- firing,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = !options.once && [],
- // Fire callbacks
- fire = function( data ) {
- memory = options.memory && data;
- fired = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- firing = true;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
- memory = false; // To prevent further calls using add
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( stack ) {
- if ( stack.length ) {
- fire( stack.shift() );
- }
- } else if ( memory ) {
- list = [];
- } else {
- self.disable();
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- // First, we save the current length
- var start = list.length;
- (function add( args ) {
- jQuery.each( args, function( _, arg ) {
- var type = jQuery.type( arg );
- if ( type === "function" ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && type !== "string" ) {
- // Inspect recursively
- add( arg );
- }
- });
- })( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away
- } else if ( memory ) {
- firingStart = start;
- fire( memory );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
- // Handle firing indexes
- if ( firing ) {
- if ( index <= firingLength ) {
- firingLength--;
- }
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- });
- }
- return this;
- },
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- firingLength = 0;
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( list && ( !fired || stack ) ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- if ( firing ) {
- stack.push( args );
- } else {
- fire( args );
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
-};
-
-
-jQuery.extend({
-
- Deferred: function( func ) {
- var tuples = [
- // action, add listener, listener list, final state
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
- [ "notify", "progress", jQuery.Callbacks("memory") ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- then: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
- return jQuery.Deferred(function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
- var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[1] ](function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .done( newDefer.resolve )
- .fail( newDefer.reject )
- .progress( newDefer.notify );
- } else {
- newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
- }
- });
- });
- fns = null;
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Keep pipe for back-compat
- promise.pipe = promise.then;
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 3 ];
-
- // promise[ done | fail | progress ] = list.add
- promise[ tuple[1] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(function() {
- // state = [ resolved | rejected ]
- state = stateString;
-
- // [ reject_list | resolve_list ].disable; progress_list.lock
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
- }
-
- // deferred[ resolve | reject | notify ]
- deferred[ tuple[0] ] = function() {
- deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
- return this;
- };
- deferred[ tuple[0] + "With" ] = list.fireWith;
- });
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( subordinate /* , ..., subordinateN */ ) {
- var i = 0,
- resolveValues = slice.call( arguments ),
- length = resolveValues.length,
-
- // the count of uncompleted subordinates
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
- // Update function for both resolve and progress values
- updateFunc = function( i, contexts, values ) {
- return function( value ) {
- contexts[ i ] = this;
- values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if ( values === progressValues ) {
- deferred.notifyWith( contexts, values );
- } else if ( !( --remaining ) ) {
- deferred.resolveWith( contexts, values );
- }
- };
- },
-
- progressValues, progressContexts, resolveContexts;
-
- // Add listeners to Deferred subordinates; treat others as resolved
- if ( length > 1 ) {
- progressValues = new Array( length );
- progressContexts = new Array( length );
- resolveContexts = new Array( length );
- for ( ; i < length; i++ ) {
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
- resolveValues[ i ].promise()
- .done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject )
- .progress( updateFunc( i, progressContexts, progressValues ) );
- } else {
- --remaining;
- }
- }
- }
-
- // If we're not waiting on anything, resolve the master
- if ( !remaining ) {
- deferred.resolveWith( resolveContexts, resolveValues );
- }
-
- return deferred.promise();
- }
-});
-
-
-// The deferred used on DOM ready
-var readyList;
-
-jQuery.fn.ready = function( fn ) {
- // Add the callback
- jQuery.ready.promise().done( fn );
-
- return this;
-};
-
-jQuery.extend({
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.triggerHandler ) {
- jQuery( document ).triggerHandler( "ready" );
- jQuery( document ).off( "ready" );
- }
- }
-});
-
-/**
- * The ready event handler and self cleanup method
- */
-function completed() {
- document.removeEventListener( "DOMContentLoaded", completed, false );
- window.removeEventListener( "load", completed, false );
- jQuery.ready();
-}
-
-jQuery.ready.promise = function( obj ) {
- if ( !readyList ) {
-
- readyList = jQuery.Deferred();
-
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
- // We once tried to use readyState "interactive" here, but it caused issues like the one
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- setTimeout( jQuery.ready );
-
- } else {
-
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed, false );
- }
- }
- return readyList.promise( obj );
-};
-
-// Kick off the DOM ready check even if the user does not
-jQuery.ready.promise();
-
-
-
-
-// Multifunctional method to get and set values of a collection
-// The value/s can optionally be executed if it's a function
-var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- len = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( jQuery.type( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !jQuery.isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < len; i++ ) {
- fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
- }
- }
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- len ? fn( elems[0], key ) : emptyGet;
-};
-
-
-/**
- * Determines whether an object can have data
- */
-jQuery.acceptData = function( owner ) {
- // Accepts only:
- // - Node
- // - Node.ELEMENT_NODE
- // - Node.DOCUMENT_NODE
- // - Object
- // - Any
- /* jshint -W018 */
- return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
-};
-
-
-function Data() {
- // Support: Android<4,
- // Old WebKit does not have Object.preventExtensions/freeze method,
- // return new empty object instead with no [[set]] accessor
- Object.defineProperty( this.cache = {}, 0, {
- get: function() {
- return {};
- }
- });
-
- this.expando = jQuery.expando + Data.uid++;
-}
-
-Data.uid = 1;
-Data.accepts = jQuery.acceptData;
-
-Data.prototype = {
- key: function( owner ) {
- // We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
- // Always return the key for a frozen object.
- if ( !Data.accepts( owner ) ) {
- return 0;
- }
-
- var descriptor = {},
- // Check if the owner object already has a cache key
- unlock = owner[ this.expando ];
-
- // If not, create one
- if ( !unlock ) {
- unlock = Data.uid++;
-
- // Secure it in a non-enumerable, non-writable property
- try {
- descriptor[ this.expando ] = { value: unlock };
- Object.defineProperties( owner, descriptor );
-
- // Support: Android<4
- // Fallback to a less secure definition
- } catch ( e ) {
- descriptor[ this.expando ] = unlock;
- jQuery.extend( owner, descriptor );
- }
- }
-
- // Ensure the cache object
- if ( !this.cache[ unlock ] ) {
- this.cache[ unlock ] = {};
- }
-
- return unlock;
- },
- set: function( owner, data, value ) {
- var prop,
- // There may be an unlock assigned to this node,
- // if there is no entry for this "owner", create one inline
- // and set the unlock as though an owner entry had always existed
- unlock = this.key( owner ),
- cache = this.cache[ unlock ];
-
- // Handle: [ owner, key, value ] args
- if ( typeof data === "string" ) {
- cache[ data ] = value;
-
- // Handle: [ owner, { properties } ] args
- } else {
- // Fresh assignments by object are shallow copied
- if ( jQuery.isEmptyObject( cache ) ) {
- jQuery.extend( this.cache[ unlock ], data );
- // Otherwise, copy the properties one-by-one to the cache object
- } else {
- for ( prop in data ) {
- cache[ prop ] = data[ prop ];
- }
- }
- }
- return cache;
- },
- get: function( owner, key ) {
- // Either a valid cache is found, or will be created.
- // New caches will be created and the unlock returned,
- // allowing direct access to the newly created
- // empty data object. A valid owner object must be provided.
- var cache = this.cache[ this.key( owner ) ];
-
- return key === undefined ?
- cache : cache[ key ];
- },
- access: function( owner, key, value ) {
- var stored;
- // In cases where either:
- //
- // 1. No key was specified
- // 2. A string key was specified, but no value provided
- //
- // Take the "read" path and allow the get method to determine
- // which value to return, respectively either:
- //
- // 1. The entire cache object
- // 2. The data stored at the key
- //
- if ( key === undefined ||
- ((key && typeof key === "string") && value === undefined) ) {
-
- stored = this.get( owner, key );
-
- return stored !== undefined ?
- stored : this.get( owner, jQuery.camelCase(key) );
- }
-
- // [*]When the key is not a string, or both a key and value
- // are specified, set or extend (existing objects) with either:
- //
- // 1. An object of properties
- // 2. A key and value
- //
- this.set( owner, key, value );
-
- // Since the "set" path can have two possible entry points
- // return the expected data based on which path was taken[*]
- return value !== undefined ? value : key;
- },
- remove: function( owner, key ) {
- var i, name, camel,
- unlock = this.key( owner ),
- cache = this.cache[ unlock ];
-
- if ( key === undefined ) {
- this.cache[ unlock ] = {};
-
- } else {
- // Support array or space separated string of keys
- if ( jQuery.isArray( key ) ) {
- // If "name" is an array of keys...
- // When data is initially created, via ("key", "val") signature,
- // keys will be converted to camelCase.
- // Since there is no way to tell _how_ a key was added, remove
- // both plain key and camelCase key. #12786
- // This will only penalize the array argument path.
- name = key.concat( key.map( jQuery.camelCase ) );
- } else {
- camel = jQuery.camelCase( key );
- // Try the string as a key before any manipulation
- if ( key in cache ) {
- name = [ key, camel ];
- } else {
- // If a key with the spaces exists, use it.
- // Otherwise, create an array by matching non-whitespace
- name = camel;
- name = name in cache ?
- [ name ] : ( name.match( rnotwhite ) || [] );
- }
- }
-
- i = name.length;
- while ( i-- ) {
- delete cache[ name[ i ] ];
- }
- }
- },
- hasData: function( owner ) {
- return !jQuery.isEmptyObject(
- this.cache[ owner[ this.expando ] ] || {}
- );
- },
- discard: function( owner ) {
- if ( owner[ this.expando ] ) {
- delete this.cache[ owner[ this.expando ] ];
- }
- }
-};
-var data_priv = new Data();
-
-var data_user = new Data();
-
-
-
-// Implementation Summary
-//
-// 1. Enforce API surface and semantic compatibility with 1.9.x branch
-// 2. Improve the module's maintainability by reducing the storage
-// paths to a single mechanism.
-// 3. Use the same single mechanism to support "private" and "user" data.
-// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
-// 5. Avoid exposing implementation details on user objects (eg. expando properties)
-// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
-var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- rmultiDash = /([A-Z])/g;
-
-function dataAttr( elem, key, data ) {
- var name;
-
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
- name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- // Only convert to a number if it doesn't change the string
- +data + "" === data ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch( e ) {}
-
- // Make sure we set the data so it isn't changed later
- data_user.set( elem, key, data );
- } else {
- data = undefined;
- }
- }
- return data;
-}
-
-jQuery.extend({
- hasData: function( elem ) {
- return data_user.hasData( elem ) || data_priv.hasData( elem );
- },
-
- data: function( elem, name, data ) {
- return data_user.access( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- data_user.remove( elem, name );
- },
-
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to data_priv methods, these can be deprecated.
- _data: function( elem, name, data ) {
- return data_priv.access( elem, name, data );
- },
-
- _removeData: function( elem, name ) {
- data_priv.remove( elem, name );
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- var i, name, data,
- elem = this[ 0 ],
- attrs = elem && elem.attributes;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = data_user.get( elem );
-
- if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
- i = attrs.length;
- while ( i-- ) {
-
- // Support: IE11+
- // The attrs elements can be null (#14894)
- if ( attrs[ i ] ) {
- name = attrs[ i ].name;
- if ( name.indexOf( "data-" ) === 0 ) {
- name = jQuery.camelCase( name.slice(5) );
- dataAttr( elem, name, data[ name ] );
- }
- }
- }
- data_priv.set( elem, "hasDataAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each(function() {
- data_user.set( this, key );
- });
- }
-
- return access( this, function( value ) {
- var data,
- camelKey = jQuery.camelCase( key );
-
- // The calling jQuery object (element matches) is not empty
- // (and therefore has an element appears at this[ 0 ]) and the
- // `value` parameter was not undefined. An empty jQuery object
- // will result in `undefined` for elem = this[ 0 ] which will
- // throw an exception if an attempt to read a data cache is made.
- if ( elem && value === undefined ) {
- // Attempt to get data from the cache
- // with the key as-is
- data = data_user.get( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // Attempt to get data from the cache
- // with the key camelized
- data = data_user.get( elem, camelKey );
- if ( data !== undefined ) {
- return data;
- }
-
- // Attempt to "discover" the data in
- // HTML5 custom data-* attrs
- data = dataAttr( elem, camelKey, undefined );
- if ( data !== undefined ) {
- return data;
- }
-
- // We tried really hard, but the data doesn't exist.
- return;
- }
-
- // Set the data...
- this.each(function() {
- // First, attempt to store a copy or reference of any
- // data that might've been store with a camelCased key.
- var data = data_user.get( this, camelKey );
-
- // For HTML5 data-* attribute interop, we have to
- // store property names with dashes in a camelCase form.
- // This might not apply to all properties...*
- data_user.set( this, camelKey, value );
-
- // *... In the case of properties that might _actually_
- // have dashes, we need to also store a copy of that
- // unchanged property.
- if ( key.indexOf("-") !== -1 && data !== undefined ) {
- data_user.set( this, key, value );
- }
- });
- }, null, value, arguments.length > 1, null, true );
- },
-
- removeData: function( key ) {
- return this.each(function() {
- data_user.remove( this, key );
- });
- }
-});
-
-
-jQuery.extend({
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = data_priv.get( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || jQuery.isArray( data ) ) {
- queue = data_priv.access( elem, type, jQuery.makeArray(data) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // Clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return data_priv.get( elem, key ) || data_priv.access( elem, key, {
- empty: jQuery.Callbacks("once memory").add(function() {
- data_priv.remove( elem, [ type + "queue", key ] );
- })
- });
- }
-});
-
-jQuery.fn.extend({
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[0], type );
- }
-
- return data === undefined ?
- this :
- this.each(function() {
- var queue = jQuery.queue( this, type, data );
-
- // Ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while ( i-- ) {
- tmp = data_priv.get( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
-});
-var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
-
-var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
-var isHidden = function( elem, el ) {
- // isHidden might be called from jQuery#filter function;
- // in that case, element will be second argument
- elem = el || elem;
- return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
- };
-
-var rcheckableType = (/^(?:checkbox|radio)$/i);
-
-
-
-(function() {
- var fragment = document.createDocumentFragment(),
- div = fragment.appendChild( document.createElement( "div" ) ),
- input = document.createElement( "input" );
-
- // Support: Safari<=5.1
- // Check state lost if the name is set (#11217)
- // Support: Windows Web Apps (WWA)
- // `name` and `type` must use .setAttribute for WWA (#14901)
- input.setAttribute( "type", "radio" );
- input.setAttribute( "checked", "checked" );
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
-
- // Support: Safari<=5.1, Android<4.2
- // Older WebKit doesn't clone checked state correctly in fragments
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE<=11+
- // Make sure textarea (and checkbox) defaultValue is properly cloned
- div.innerHTML = "x ";
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
-})();
-var strundefined = typeof undefined;
-
-
-
-support.focusinBubbles = "onfocusin" in window;
-
-
-var
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
-
-function returnTrue() {
- return true;
-}
-
-function returnFalse() {
- return false;
-}
-
-function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
-
- var handleObjIn, eventHandle, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = data_priv.get( elem );
-
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
- if ( !elemData ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !(events = elemData.events) ) {
- events = elemData.events = {};
- }
- if ( !(eventHandle = elemData.handle) ) {
- eventHandle = elemData.handle = function( e ) {
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
- jQuery.event.dispatch.apply( elem, arguments ) : undefined;
- };
- }
-
- // Handle multiple events separated by a space
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[t] ) || [];
- type = origType = tmp[1];
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
- // There *must* be a type, no attaching namespace-only handlers
- if ( !type ) {
- continue;
- }
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend({
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join(".")
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !(handlers = events[ type ]) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener if the special events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle, false );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var j, origCount, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = data_priv.hasData( elem ) && data_priv.get( elem );
-
- if ( !elemData || !(events = elemData.events) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[t] ) || [];
- type = origType = tmp[1];
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- delete elemData.handle;
- data_priv.remove( elem, "events" );
- }
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
-
- var i, cur, tmp, bubbleType, ontype, handle, special,
- eventPath = [ elem || document ],
- type = hasOwn.call( event, "type" ) ? event.type : event,
- namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
- cur = tmp = elem = elem || document;
-
- // Don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf(".") >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf(":") < 0 && "on" + type;
-
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
- event = event[ jQuery.expando ] ?
- event :
- new jQuery.Event( type, typeof event === "object" && event );
-
- // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join(".");
- event.namespace_re = event.namespace ?
- new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
- null;
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data == null ?
- [ event ] :
- jQuery.makeArray( data, [ event ] );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- if ( !rfocusMorph.test( bubbleType + type ) ) {
- cur = cur.parentNode;
- }
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push( cur );
- tmp = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( tmp === (elem.ownerDocument || document) ) {
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
- }
- }
-
- // Fire handlers on the event path
- i = 0;
- while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
- event.type = i > 1 ?
- bubbleType :
- special.bindType || type;
-
- // jQuery handler
- handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
-
- // Native handler
- handle = ontype && cur[ ontype ];
- if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
- event.result = handle.apply( cur, data );
- if ( event.result === false ) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
- jQuery.acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name name as the event.
- // Don't do default actions on window, that's where global variables be (#6170)
- if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- tmp = elem[ ontype ];
-
- if ( tmp ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if ( tmp ) {
- elem[ ontype ] = tmp;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event );
-
- var i, j, ret, matched, handleObj,
- handlerQueue = [],
- args = slice.call( arguments ),
- handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[0] = event;
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
- // Triggered event must either 1) have no namespace, or 2) have namespace(s)
- // a subset or equal to those in the bound event (both can have no namespace).
- if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( (event.result = ret) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var i, matches, sel, handleObj,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Find delegate handlers
- // Black-hole SVG instance trees (#13180)
- // Avoid non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
-
- for ( ; cur !== this; cur = cur.parentNode || this ) {
-
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.disabled !== true || event.type !== "click" ) {
- matches = [];
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
-
- // Don't conflict with Object.prototype properties (#13203)
- sel = handleObj.selector + " ";
-
- if ( matches[ sel ] === undefined ) {
- matches[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) >= 0 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( matches[ sel ] ) {
- matches.push( handleObj );
- }
- }
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, handlers: matches });
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if ( delegateCount < handlers.length ) {
- handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
- }
-
- return handlerQueue;
- },
-
- // Includes some event props shared by KeyEvent and MouseEvent
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
- fixHooks: {},
-
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function( event, original ) {
-
- // Add which for key events
- if ( event.which == null ) {
- event.which = original.charCode != null ? original.charCode : original.keyCode;
- }
-
- return event;
- }
- },
-
- mouseHooks: {
- props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function( event, original ) {
- var eventDoc, doc, body,
- button = original.button;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && original.clientX != null ) {
- eventDoc = event.target.ownerDocument || document;
- doc = eventDoc.documentElement;
- body = eventDoc.body;
-
- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if ( !event.which && button !== undefined ) {
- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
- }
-
- return event;
- }
- },
-
- fix: function( event ) {
- if ( event[ jQuery.expando ] ) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop, copy,
- type = event.type,
- originalEvent = event,
- fixHook = this.fixHooks[ type ];
-
- if ( !fixHook ) {
- this.fixHooks[ type ] = fixHook =
- rmouseEvent.test( type ) ? this.mouseHooks :
- rkeyEvent.test( type ) ? this.keyHooks :
- {};
- }
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
- event = new jQuery.Event( originalEvent );
-
- i = copy.length;
- while ( i-- ) {
- prop = copy[ i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Support: Cordova 2.5 (WebKit) (#13255)
- // All events should have a target; Cordova deviceready doesn't
- if ( !event.target ) {
- event.target = document;
- }
-
- // Support: Safari 6.0+, Chrome<28
- // Target should not be a text node (#504, #13143)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
- },
-
- special: {
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- focus: {
- // Fire native event if possible so blur/focus sequence is correct
- trigger: function() {
- if ( this !== safeActiveElement() && this.focus ) {
- this.focus();
- return false;
- }
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- if ( this === safeActiveElement() && this.blur ) {
- this.blur();
- return false;
- }
- },
- delegateType: "focusout"
- },
- click: {
- // For checkbox, fire native event so checked state will be right
- trigger: function() {
- if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
- this.click();
- return false;
- }
- },
-
- // For cross-browser consistency, don't fire native .click() on links
- _default: function( event ) {
- return jQuery.nodeName( event.target, "a" );
- }
- },
-
- beforeunload: {
- postDispatch: function( event ) {
-
- // Support: Firefox 20+
- // Firefox doesn't alert if the returnValue field is not set.
- if ( event.result !== undefined && event.originalEvent ) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- },
-
- simulate: function( type, elem, event, bubble ) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if ( bubble ) {
- jQuery.event.trigger( e, null, elem );
- } else {
- jQuery.event.dispatch.call( elem, e );
- }
- if ( e.isDefaultPrevented() ) {
- event.preventDefault();
- }
- }
-};
-
-jQuery.removeEvent = function( elem, type, handle ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
- }
-};
-
-jQuery.Event = function( src, props ) {
- // Allow instantiation without the 'new' keyword
- if ( !(this instanceof jQuery.Event) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = src.defaultPrevented ||
- src.defaultPrevented === undefined &&
- // Support: Android<4.0
- src.returnValue === false ?
- returnTrue :
- returnFalse;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || jQuery.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
-};
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
-
- preventDefault: function() {
- var e = this.originalEvent;
-
- this.isDefaultPrevented = returnTrue;
-
- if ( e && e.preventDefault ) {
- e.preventDefault();
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
-
- this.isPropagationStopped = returnTrue;
-
- if ( e && e.stopPropagation ) {
- e.stopPropagation();
- }
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
-
- this.isImmediatePropagationStopped = returnTrue;
-
- if ( e && e.stopImmediatePropagation ) {
- e.stopImmediatePropagation();
- }
-
- this.stopPropagation();
- }
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-// Support: Chrome 15+
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj;
-
- // For mousenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
-});
-
-// Support: Firefox, Chrome, Safari
-// Create "bubbling" focus and blur events
-if ( !support.focusinBubbles ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler on the document while someone wants focusin/focusout
- var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- var doc = this.ownerDocument || this,
- attaches = data_priv.access( doc, fix );
-
- if ( !attaches ) {
- doc.addEventListener( orig, handler, true );
- }
- data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
- },
- teardown: function() {
- var doc = this.ownerDocument || this,
- attaches = data_priv.access( doc, fix ) - 1;
-
- if ( !attaches ) {
- doc.removeEventListener( orig, handler, true );
- data_priv.remove( doc, fix );
-
- } else {
- data_priv.access( doc, fix, attaches );
- }
- }
- };
- });
-}
-
-jQuery.fn.extend({
-
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- this.on( type, selector, data, types[ type ], one );
- }
- return this;
- }
-
- if ( data == null && fn == null ) {
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return this;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return this.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- });
- },
- one: function( types, selector, data, fn ) {
- return this.on( types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- var handleObj, type;
- if ( types && types.preventDefault && types.handleObj ) {
- // ( event ) dispatched jQuery.Event
- handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
- // ( types-object [, selector] )
- for ( type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each(function() {
- jQuery.event.remove( this, types, fn, selector );
- });
- },
-
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
- triggerHandler: function( type, data ) {
- var elem = this[0];
- if ( elem ) {
- return jQuery.event.trigger( type, data, elem, true );
- }
- }
-});
-
-
-var
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- rtagName = /<([\w:]+)/,
- rhtml = /<|?\w+;/,
- rnoInnerhtml = /<(?:script|style|link)/i,
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptType = /^$|\/(?:java|ecma)script/i,
- rscriptTypeMasked = /^true\/(.*)/,
- rcleanScript = /^\s*\s*$/g,
-
- // We have to close these tags to support XHTML (#13200)
- wrapMap = {
-
- // Support: IE9
- option: [ 1, "", " " ],
-
- thead: [ 1, "" ],
- col: [ 2, "" ],
- tr: [ 2, "" ],
- td: [ 3, "" ],
-
- _default: [ 0, "", "" ]
- };
-
-// Support: IE9
-wrapMap.optgroup = wrapMap.option;
-
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// Support: 1.x compatibility
-// Manipulating tables requires a tbody
-function manipulationTarget( elem, content ) {
- return jQuery.nodeName( elem, "table" ) &&
- jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
-
- elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
- elem;
-}
-
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
- elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
- return elem;
-}
-function restoreScript( elem ) {
- var match = rscriptTypeMasked.exec( elem.type );
-
- if ( match ) {
- elem.type = match[ 1 ];
- } else {
- elem.removeAttribute("type");
- }
-
- return elem;
-}
-
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
- var i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- data_priv.set(
- elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
- );
- }
-}
-
-function cloneCopyEvent( src, dest ) {
- var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
-
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // 1. Copy private data: events, handlers, etc.
- if ( data_priv.hasData( src ) ) {
- pdataOld = data_priv.access( src );
- pdataCur = data_priv.set( dest, pdataOld );
- events = pdataOld.events;
-
- if ( events ) {
- delete pdataCur.handle;
- pdataCur.events = {};
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
- }
-
- // 2. Copy user data
- if ( data_user.hasData( src ) ) {
- udataOld = data_user.access( src );
- udataCur = jQuery.extend( {}, udataOld );
-
- data_user.set( dest, udataCur );
- }
-}
-
-function getAll( context, tag ) {
- var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
- context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
- [];
-
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
- jQuery.merge( [ context ], ret ) :
- ret;
-}
-
-// Fix IE bugs, see support tests
-function fixInput( src, dest ) {
- var nodeName = dest.nodeName.toLowerCase();
-
- // Fails to persist the checked state of a cloned checkbox or radio button.
- if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
- dest.checked = src.checked;
-
- // Fails to return the selected option to the default selected state when cloning options
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
- }
-}
-
-jQuery.extend({
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var i, l, srcElements, destElements,
- clone = elem.cloneNode( true ),
- inPage = jQuery.contains( elem.ownerDocument, elem );
-
- // Fix IE cloning issues
- if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
- !jQuery.isXMLDoc( elem ) ) {
-
- // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
- destElements = getAll( clone );
- srcElements = getAll( elem );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- fixInput( srcElements[ i ], destElements[ i ] );
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- if ( deepDataAndEvents ) {
- srcElements = srcElements || getAll( elem );
- destElements = destElements || getAll( clone );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- cloneCopyEvent( srcElements[ i ], destElements[ i ] );
- }
- } else {
- cloneCopyEvent( elem, clone );
- }
- }
-
- // Preserve script evaluation history
- destElements = getAll( clone, "script" );
- if ( destElements.length > 0 ) {
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
- }
-
- // Return the cloned set
- return clone;
- },
-
- buildFragment: function( elems, context, scripts, selection ) {
- var elem, tmp, tag, wrap, contains, j,
- fragment = context.createDocumentFragment(),
- nodes = [],
- i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- elem = elems[ i ];
-
- if ( elem || elem === 0 ) {
-
- // Add nodes directly
- if ( jQuery.type( elem ) === "object" ) {
- // Support: QtWebKit, PhantomJS
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
- // Convert non-html into a text node
- } else if ( !rhtml.test( elem ) ) {
- nodes.push( context.createTextNode( elem ) );
-
- // Convert html into DOM nodes
- } else {
- tmp = tmp || fragment.appendChild( context.createElement("div") );
-
- // Deserialize a standard representation
- tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
- tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>$2>" ) + wrap[ 2 ];
-
- // Descend through wrappers to the right content
- j = wrap[ 0 ];
- while ( j-- ) {
- tmp = tmp.lastChild;
- }
-
- // Support: QtWebKit, PhantomJS
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, tmp.childNodes );
-
- // Remember the top-level container
- tmp = fragment.firstChild;
-
- // Ensure the created nodes are orphaned (#12392)
- tmp.textContent = "";
- }
- }
- }
-
- // Remove wrapper from fragment
- fragment.textContent = "";
-
- i = 0;
- while ( (elem = nodes[ i++ ]) ) {
-
- // #4087 - If origin and destination elements are the same, and this is
- // that element, do not do anything
- if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
- continue;
- }
-
- contains = jQuery.contains( elem.ownerDocument, elem );
-
- // Append to fragment
- tmp = getAll( fragment.appendChild( elem ), "script" );
-
- // Preserve script evaluation history
- if ( contains ) {
- setGlobalEval( tmp );
- }
-
- // Capture executables
- if ( scripts ) {
- j = 0;
- while ( (elem = tmp[ j++ ]) ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
- }
- }
- }
-
- return fragment;
- },
-
- cleanData: function( elems ) {
- var data, elem, type, key,
- special = jQuery.event.special,
- i = 0;
-
- for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
- if ( jQuery.acceptData( elem ) ) {
- key = elem[ data_priv.expando ];
-
- if ( key && (data = data_priv.cache[ key ]) ) {
- if ( data.events ) {
- for ( type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
- }
- if ( data_priv.cache[ key ] ) {
- // Discard any remaining `private` data
- delete data_priv.cache[ key ];
- }
- }
- }
- // Discard any remaining `user` data
- delete data_user.cache[ elem[ data_user.expando ] ];
- }
- }
-});
-
-jQuery.fn.extend({
- text: function( value ) {
- return access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().each(function() {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- this.textContent = value;
- }
- });
- }, null, value, arguments.length );
- },
-
- append: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.insertBefore( elem, target.firstChild );
- }
- });
- },
-
- before: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this );
- }
- });
- },
-
- after: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- }
- });
- },
-
- remove: function( selector, keepData /* Internal Use Only */ ) {
- var elem,
- elems = selector ? jQuery.filter( selector, this ) : this,
- i = 0;
-
- for ( ; (elem = elems[i]) != null; i++ ) {
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem ) );
- }
-
- if ( elem.parentNode ) {
- if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
- setGlobalEval( getAll( elem, "script" ) );
- }
- elem.parentNode.removeChild( elem );
- }
- }
-
- return this;
- },
-
- empty: function() {
- var elem,
- i = 0;
-
- for ( ; (elem = this[i]) != null; i++ ) {
- if ( elem.nodeType === 1 ) {
-
- // Prevent memory leaks
- jQuery.cleanData( getAll( elem, false ) );
-
- // Remove any remaining nodes
- elem.textContent = "";
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map(function() {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- });
- },
-
- html: function( value ) {
- return access( this, function( value ) {
- var elem = this[ 0 ] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined && elem.nodeType === 1 ) {
- return elem.innerHTML;
- }
-
- // See if we can take a shortcut and just use innerHTML
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
-
- value = value.replace( rxhtmlTag, "<$1>$2>" );
-
- try {
- for ( ; i < l; i++ ) {
- elem = this[ i ] || {};
-
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem, false ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch( e ) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function() {
- var arg = arguments[ 0 ];
-
- // Make the changes, replacing each context element with the new content
- this.domManip( arguments, function( elem ) {
- arg = this.parentNode;
-
- jQuery.cleanData( getAll( this ) );
-
- if ( arg ) {
- arg.replaceChild( elem, this );
- }
- });
-
- // Force removal if there was no new content (e.g., from empty arguments)
- return arg && (arg.length || arg.nodeType) ? this : this.remove();
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, callback ) {
-
- // Flatten any nested arrays
- args = concat.apply( [], args );
-
- var fragment, first, scripts, hasScripts, node, doc,
- i = 0,
- l = this.length,
- set = this,
- iNoClone = l - 1,
- value = args[ 0 ],
- isFunction = jQuery.isFunction( value );
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( isFunction ||
- ( l > 1 && typeof value === "string" &&
- !support.checkClone && rchecked.test( value ) ) ) {
- return this.each(function( index ) {
- var self = set.eq( index );
- if ( isFunction ) {
- args[ 0 ] = value.call( this, index, self.html() );
- }
- self.domManip( args, callback );
- });
- }
-
- if ( l ) {
- fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- if ( first ) {
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
- hasScripts = scripts.length;
-
- // Use the original fragment for the last item instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- for ( ; i < l; i++ ) {
- node = fragment;
-
- if ( i !== iNoClone ) {
- node = jQuery.clone( node, true, true );
-
- // Keep references to cloned scripts for later restoration
- if ( hasScripts ) {
- // Support: QtWebKit
- // jQuery.merge because push.apply(_, arraylike) throws
- jQuery.merge( scripts, getAll( node, "script" ) );
- }
- }
-
- callback.call( this[ i ], node, i );
- }
-
- if ( hasScripts ) {
- doc = scripts[ scripts.length - 1 ].ownerDocument;
-
- // Reenable scripts
- jQuery.map( scripts, restoreScript );
-
- // Evaluate executable scripts on first document insertion
- for ( i = 0; i < hasScripts; i++ ) {
- node = scripts[ i ];
- if ( rscriptType.test( node.type || "" ) &&
- !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
-
- if ( node.src ) {
- // Optional AJAX dependency, but won't run scripts if not present
- if ( jQuery._evalUrl ) {
- jQuery._evalUrl( node.src );
- }
- } else {
- jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
- }
- }
- }
- }
- }
- }
-
- return this;
- }
-});
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var elems,
- ret = [],
- insert = jQuery( selector ),
- last = insert.length - 1,
- i = 0;
-
- for ( ; i <= last; i++ ) {
- elems = i === last ? this : this.clone( true );
- jQuery( insert[ i ] )[ original ]( elems );
-
- // Support: QtWebKit
- // .get() because push.apply(_, arraylike) throws
- push.apply( ret, elems.get() );
- }
-
- return this.pushStack( ret );
- };
-});
-
-
-var iframe,
- elemdisplay = {};
-
-/**
- * Retrieve the actual display of a element
- * @param {String} name nodeName of the element
- * @param {Object} doc Document object
- */
-// Called only from within defaultDisplay
-function actualDisplay( name, doc ) {
- var style,
- elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-
- // getDefaultComputedStyle might be reliably used only on attached element
- display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
-
- // Use of this method is a temporary fix (more like optimization) until something better comes along,
- // since it was removed from specification and supported only in FF
- style.display : jQuery.css( elem[ 0 ], "display" );
-
- // We don't have any data stored on the element,
- // so use "detach" method as fast way to get rid of the element
- elem.detach();
-
- return display;
-}
-
-/**
- * Try to determine the default display value of an element
- * @param {String} nodeName
- */
-function defaultDisplay( nodeName ) {
- var doc = document,
- display = elemdisplay[ nodeName ];
-
- if ( !display ) {
- display = actualDisplay( nodeName, doc );
-
- // If the simple way fails, read from inside an iframe
- if ( display === "none" || !display ) {
-
- // Use the already-created iframe if possible
- iframe = (iframe || jQuery( "" )).appendTo( doc.documentElement );
-
- // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
- doc = iframe[ 0 ].contentDocument;
-
- // Support: IE
- doc.write();
- doc.close();
-
- display = actualDisplay( nodeName, doc );
- iframe.detach();
- }
-
- // Store the correct default display
- elemdisplay[ nodeName ] = display;
- }
-
- return display;
-}
-var rmargin = (/^margin/);
-
-var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-
-var getStyles = function( elem ) {
- // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
- // IE throws on elements created in popups
- // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
- if ( elem.ownerDocument.defaultView.opener ) {
- return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
- }
-
- return window.getComputedStyle( elem, null );
- };
-
-
-
-function curCSS( elem, name, computed ) {
- var width, minWidth, maxWidth, ret,
- style = elem.style;
-
- computed = computed || getStyles( elem );
-
- // Support: IE9
- // getPropertyValue is only needed for .css('filter') (#12537)
- if ( computed ) {
- ret = computed.getPropertyValue( name ) || computed[ name ];
- }
-
- if ( computed ) {
-
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
- ret = jQuery.style( elem, name );
- }
-
- // Support: iOS < 6
- // A tribute to the "awesome hack by Dean Edwards"
- // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
- // Remember the original values
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- // Put in the new values to get a computed value out
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- // Revert the changed values
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
-
- return ret !== undefined ?
- // Support: IE
- // IE returns zIndex value as an integer.
- ret + "" :
- ret;
-}
-
-
-function addGetHookIf( conditionFn, hookFn ) {
- // Define the hook, we'll check on the first run if it's really needed.
- return {
- get: function() {
- if ( conditionFn() ) {
- // Hook not needed (or it's not possible to use it due
- // to missing dependency), remove it.
- delete this.get;
- return;
- }
-
- // Hook needed; redefine it so that the support test is not executed again.
- return (this.get = hookFn).apply( this, arguments );
- }
- };
-}
-
-
-(function() {
- var pixelPositionVal, boxSizingReliableVal,
- docElem = document.documentElement,
- container = document.createElement( "div" ),
- div = document.createElement( "div" );
-
- if ( !div.style ) {
- return;
- }
-
- // Support: IE9-11+
- // Style of cloned element affects source element cloned (#8908)
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
- "position:absolute";
- container.appendChild( div );
-
- // Executing both pixelPosition & boxSizingReliable tests require only one layout
- // so they're executed at the same time to save the second computation.
- function computePixelPositionAndBoxSizingReliable() {
- div.style.cssText =
- // Support: Firefox<29, Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
- "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
- "border:1px;padding:1px;width:4px;position:absolute";
- div.innerHTML = "";
- docElem.appendChild( container );
-
- var divStyle = window.getComputedStyle( div, null );
- pixelPositionVal = divStyle.top !== "1%";
- boxSizingReliableVal = divStyle.width === "4px";
-
- docElem.removeChild( container );
- }
-
- // Support: node.js jsdom
- // Don't assume that getComputedStyle is a property of the global object
- if ( window.getComputedStyle ) {
- jQuery.extend( support, {
- pixelPosition: function() {
-
- // This test is executed only once but we still do memoizing
- // since we can use the boxSizingReliable pre-computing.
- // No need to check if the test was already performed, though.
- computePixelPositionAndBoxSizingReliable();
- return pixelPositionVal;
- },
- boxSizingReliable: function() {
- if ( boxSizingReliableVal == null ) {
- computePixelPositionAndBoxSizingReliable();
- }
- return boxSizingReliableVal;
- },
- reliableMarginRight: function() {
-
- // Support: Android 2.3
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. (#3333)
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // This support function is only executed once so no memoizing is needed.
- var ret,
- marginDiv = div.appendChild( document.createElement( "div" ) );
-
- // Reset CSS: box-sizing; display; margin; border; padding
- marginDiv.style.cssText = div.style.cssText =
- // Support: Firefox<29, Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
- "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
- marginDiv.style.marginRight = marginDiv.style.width = "0";
- div.style.width = "1px";
- docElem.appendChild( container );
-
- ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
-
- docElem.removeChild( container );
- div.removeChild( marginDiv );
-
- return ret;
- }
- });
- }
-})();
-
-
-// A method for quickly swapping in/out CSS properties to get correct calculations.
-jQuery.swap = function( elem, options, callback, args ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.apply( elem, args || [] );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
-};
-
-
-var
- // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
- // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
- rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
-
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- },
-
- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
-
-// Return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
- // Shortcut for names that are not vendor prefixed
- if ( name in style ) {
- return name;
- }
-
- // Check for vendor prefixed names
- var capName = name[0].toUpperCase() + name.slice(1),
- origName = name,
- i = cssPrefixes.length;
-
- while ( i-- ) {
- name = cssPrefixes[ i ] + capName;
- if ( name in style ) {
- return name;
- }
- }
-
- return origName;
-}
-
-function setPositiveNumber( elem, value, subtract ) {
- var matches = rnumsplit.exec( value );
- return matches ?
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
- value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
- var i = extra === ( isBorderBox ? "border" : "content" ) ?
- // If we already have the right measurement, avoid augmentation
- 4 :
- // Otherwise initialize for horizontal or vertical properties
- name === "width" ? 1 : 0,
-
- val = 0;
-
- for ( ; i < 4; i += 2 ) {
- // Both box models exclude margin, so add it if we want it
- if ( extra === "margin" ) {
- val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
- }
-
- if ( isBorderBox ) {
- // border-box includes padding, so remove it if we want content
- if ( extra === "content" ) {
- val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
- }
-
- // At this point, extra isn't border nor margin, so remove border
- if ( extra !== "margin" ) {
- val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- } else {
- // At this point, extra isn't content, so add padding
- val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
- // At this point, extra isn't content nor padding, so add border
- if ( extra !== "padding" ) {
- val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- }
- }
-
- return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
- // Start with offset property, which is equivalent to the border-box value
- var valueIsBorderBox = true,
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
- styles = getStyles( elem ),
- isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
- // Some non-html elements return undefined for offsetWidth, so check for null/undefined
- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
- if ( val <= 0 || val == null ) {
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name, styles );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
- }
-
- // Computed unit is not pixels. Stop here and return.
- if ( rnumnonpx.test(val) ) {
- return val;
- }
-
- // Check for style in case a browser which returns unreliable values
- // for getComputedStyle silently falls back to the reliable elem.style
- valueIsBorderBox = isBorderBox &&
- ( support.boxSizingReliable() || val === elem.style[ name ] );
-
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
- }
-
- // Use the active box-sizing model to add/subtract irrelevant styles
- return ( val +
- augmentWidthOrHeight(
- elem,
- name,
- extra || ( isBorderBox ? "border" : "content" ),
- valueIsBorderBox,
- styles
- )
- ) + "px";
-}
-
-function showHide( elements, show ) {
- var display, elem, hidden,
- values = [],
- index = 0,
- length = elements.length;
-
- for ( ; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
-
- values[ index ] = data_priv.get( elem, "olddisplay" );
- display = elem.style.display;
- if ( show ) {
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !values[ index ] && display === "none" ) {
- elem.style.display = "";
- }
-
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( elem.style.display === "" && isHidden( elem ) ) {
- values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
- }
- } else {
- hidden = isHidden( elem );
-
- if ( display !== "none" || !hidden ) {
- data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
- }
- }
- }
-
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( index = 0; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
- if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
- elem.style.display = show ? values[ index ] || "" : "none";
- }
- }
-
- return elements;
-}
-
-jQuery.extend({
-
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
-
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
-
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- "columnCount": true,
- "fillOpacity": true,
- "flexGrow": true,
- "flexShrink": true,
- "fontWeight": true,
- "lineHeight": true,
- "opacity": true,
- "order": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- "float": "cssFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
-
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, hooks,
- origName = jQuery.camelCase( name ),
- style = elem.style;
-
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
- // Gets hook for the prefixed version, then unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // Convert "+=" or "-=" to relative numbers (#7345)
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that null and NaN values aren't set (#7116)
- if ( value == null || value !== value ) {
- return;
- }
-
- // If a number, add 'px' to the (except for certain CSS properties)
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
- value += "px";
- }
-
- // Support: IE9-11+
- // background-* props affect original clone's values
- if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
- style[ name ] = "inherit";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
- style[ name ] = value;
- }
-
- } else {
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra, styles ) {
- var val, num, hooks,
- origName = jQuery.camelCase( name );
-
- // Make sure that we're working with the right name
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
- // Try prefixed name followed by the unprefixed name
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks ) {
- val = hooks.get( elem, true, extra );
- }
-
- // Otherwise, if a way to get the computed value exists, use that
- if ( val === undefined ) {
- val = curCSS( elem, name, styles );
- }
-
- // Convert "normal" to computed value
- if ( val === "normal" && name in cssNormalTransform ) {
- val = cssNormalTransform[ name ];
- }
-
- // Make numeric if forced or a qualifier was provided and val looks numeric
- if ( extra === "" || extra ) {
- num = parseFloat( val );
- return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
- }
- return val;
- }
-});
-
-jQuery.each([ "height", "width" ], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
-
- // Certain elements can have dimension info if we invisibly show them
- // but it must have a current display style that would benefit
- return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
- jQuery.swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, name, extra );
- }) :
- getWidthOrHeight( elem, name, extra );
- }
- },
-
- set: function( elem, value, extra ) {
- var styles = extra && getStyles( elem );
- return setPositiveNumber( elem, value, extra ?
- augmentWidthOrHeight(
- elem,
- name,
- extra,
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- styles
- ) : 0
- );
- }
- };
-});
-
-// Support: Android 2.3
-jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
- function( elem, computed ) {
- if ( computed ) {
- return jQuery.swap( elem, { "display": "inline-block" },
- curCSS, [ elem, "marginRight" ] );
- }
- }
-);
-
-// These hooks are used by animate to expand properties
-jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
-}, function( prefix, suffix ) {
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i = 0,
- expanded = {},
-
- // Assumes a single number if not a string
- parts = typeof value === "string" ? value.split(" ") : [ value ];
-
- for ( ; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-
- if ( !rmargin.test( prefix ) ) {
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
- }
-});
-
-jQuery.fn.extend({
- css: function( name, value ) {
- return access( this, function( elem, name, value ) {
- var styles, len,
- map = {},
- i = 0;
-
- if ( jQuery.isArray( name ) ) {
- styles = getStyles( elem );
- len = name.length;
-
- for ( ; i < len; i++ ) {
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
- }
-
- return map;
- }
-
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
- },
- show: function() {
- return showHide( this, true );
- },
- hide: function() {
- return showHide( this );
- },
- toggle: function( state ) {
- if ( typeof state === "boolean" ) {
- return state ? this.show() : this.hide();
- }
-
- return this.each(function() {
- if ( isHidden( this ) ) {
- jQuery( this ).show();
- } else {
- jQuery( this ).hide();
- }
- });
- }
-});
-
-
-function Tween( elem, options, prop, end, easing ) {
- return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
- constructor: Tween,
- init: function( elem, options, prop, end, easing, unit ) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || "swing";
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
- },
- cur: function() {
- var hooks = Tween.propHooks[ this.prop ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- if ( this.options.duration ) {
- this.pos = eased = jQuery.easing[ this.easing ](
- percent, this.options.duration * percent, 0, 1, this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = ( this.end - this.start ) * eased + this.start;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- if ( tween.elem[ tween.prop ] != null &&
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
- return tween.elem[ tween.prop ];
- }
-
- // Passing an empty string as a 3rd parameter to .css will automatically
- // attempt a parseFloat and fallback to a string if the parse fails.
- // Simple values such as "10px" are parsed to Float;
- // complex values such as "rotate(1rad)" are returned as-is.
- result = jQuery.css( tween.elem, tween.prop, "" );
- // Empty strings, null, undefined and "auto" are converted to 0.
- return !result || result === "auto" ? 0 : result;
- },
- set: function( tween ) {
- // Use step hook for back compat.
- // Use cssHook if its there.
- // Use .style if available and use plain properties where available.
- if ( jQuery.fx.step[ tween.prop ] ) {
- jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
- } else {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- }
-};
-
-// Support: IE9
-// Panic based approach to setting things on disconnected nodes
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
-};
-
-jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p * Math.PI ) / 2;
- }
-};
-
-jQuery.fx = Tween.prototype.init;
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-
-
-
-var
- fxNow, timerId,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
- rrun = /queueHooks$/,
- animationPrefilters = [ defaultPrefilter ],
- tweeners = {
- "*": [ function( prop, value ) {
- var tween = this.createTween( prop, value ),
- target = tween.cur(),
- parts = rfxnum.exec( value ),
- unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
- // Starting value computation is required for potential unit mismatches
- start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
- rfxnum.exec( jQuery.css( tween.elem, prop ) ),
- scale = 1,
- maxIterations = 20;
-
- if ( start && start[ 3 ] !== unit ) {
- // Trust units reported by jQuery.css
- unit = unit || start[ 3 ];
-
- // Make sure we update the tween properties later on
- parts = parts || [];
-
- // Iteratively approximate from a nonzero starting point
- start = +target || 1;
-
- do {
- // If previous iteration zeroed out, double until we get *something*.
- // Use string for doubling so we don't accidentally see scale as unchanged below
- scale = scale || ".5";
-
- // Adjust and apply
- start = start / scale;
- jQuery.style( tween.elem, prop, start + unit );
-
- // Update scale, tolerating zero or NaN from tween.cur(),
- // break the loop if scale is unchanged or perfect, or if we've just had enough
- } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
- }
-
- // Update tween properties
- if ( parts ) {
- start = tween.start = +start || +target || 0;
- tween.unit = unit;
- // If a +=/-= token was provided, we're doing a relative animation
- tween.end = parts[ 1 ] ?
- start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
- +parts[ 2 ];
- }
-
- return tween;
- } ]
- };
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout(function() {
- fxNow = undefined;
- });
- return ( fxNow = jQuery.now() );
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
- var which,
- i = 0,
- attrs = { height: type };
-
- // If we include width, step value is 1 to do all cssExpand values,
- // otherwise step value is 2 to skip over Left and Right
- includeWidth = includeWidth ? 1 : 0;
- for ( ; i < 4 ; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
-}
-
-function createTween( value, prop, animation ) {
- var tween,
- collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( (tween = collection[ index ].call( animation, prop, value )) ) {
-
- // We're done with this property
- return tween;
- }
- }
-}
-
-function defaultPrefilter( elem, props, opts ) {
- /* jshint validthis: true */
- var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
- anim = this,
- orig = {},
- style = elem.style,
- hidden = elem.nodeType && isHidden( elem ),
- dataShow = data_priv.get( elem, "fxshow" );
-
- // Handle queue: false promises
- if ( !opts.queue ) {
- hooks = jQuery._queueHooks( elem, "fx" );
- if ( hooks.unqueued == null ) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if ( !hooks.unqueued ) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
-
- anim.always(function() {
- // Ensure the complete handler is called before this completes
- anim.always(function() {
- hooks.unqueued--;
- if ( !jQuery.queue( elem, "fx" ).length ) {
- hooks.empty.fire();
- }
- });
- });
- }
-
- // Height/width overflow pass
- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE9-10 do not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height animated
- display = jQuery.css( elem, "display" );
-
- // Test default display if display is currently "none"
- checkDisplay = display === "none" ?
- data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
-
- if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
- style.display = "inline-block";
- }
- }
-
- if ( opts.overflow ) {
- style.overflow = "hidden";
- anim.always(function() {
- style.overflow = opts.overflow[ 0 ];
- style.overflowX = opts.overflow[ 1 ];
- style.overflowY = opts.overflow[ 2 ];
- });
- }
-
- // show/hide pass
- for ( prop in props ) {
- value = props[ prop ];
- if ( rfxtypes.exec( value ) ) {
- delete props[ prop ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
-
- // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
- if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
- hidden = true;
- } else {
- continue;
- }
- }
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
-
- // Any non-fx value stops us from restoring the original display value
- } else {
- display = undefined;
- }
- }
-
- if ( !jQuery.isEmptyObject( orig ) ) {
- if ( dataShow ) {
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = data_priv.access( elem, "fxshow", {} );
- }
-
- // Store state if its toggle - enables .stop().toggle() to "reverse"
- if ( toggle ) {
- dataShow.hidden = !hidden;
- }
- if ( hidden ) {
- jQuery( elem ).show();
- } else {
- anim.done(function() {
- jQuery( elem ).hide();
- });
- }
- anim.done(function() {
- var prop;
-
- data_priv.remove( elem, "fxshow" );
- for ( prop in orig ) {
- jQuery.style( elem, prop, orig[ prop ] );
- }
- });
- for ( prop in orig ) {
- tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
-
- if ( !( prop in dataShow ) ) {
- dataShow[ prop ] = tween.start;
- if ( hidden ) {
- tween.end = tween.start;
- tween.start = prop === "width" || prop === "height" ? 1 : 0;
- }
- }
- }
-
- // If this is a noop like .hide().hide(), restore an overwritten display value
- } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
- style.display = display;
- }
-}
-
-function propFilter( props, specialEasing ) {
- var index, name, easing, value, hooks;
-
- // camelCase, specialEasing and expand cssHook pass
- for ( index in props ) {
- name = jQuery.camelCase( index );
- easing = specialEasing[ name ];
- value = props[ index ];
- if ( jQuery.isArray( value ) ) {
- easing = value[ 1 ];
- value = props[ index ] = value[ 0 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // Not quite $.extend, this won't overwrite existing keys.
- // Reusing 'index' because we have the correct "name"
- for ( index in value ) {
- if ( !( index in props ) ) {
- props[ index ] = value[ index ];
- specialEasing[ index ] = easing;
- }
- }
- } else {
- specialEasing[ name ] = easing;
- }
- }
-}
-
-function Animation( elem, properties, options ) {
- var result,
- stopped,
- index = 0,
- length = animationPrefilters.length,
- deferred = jQuery.Deferred().always( function() {
- // Don't match elem in the :animated selector
- delete tick.elem;
- }),
- tick = function() {
- if ( stopped ) {
- return false;
- }
- var currentTime = fxNow || createFxNow(),
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
- // Support: Android 2.3
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
- temp = remaining / animation.duration || 0,
- percent = 1 - temp,
- index = 0,
- length = animation.tweens.length;
-
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
- if ( percent < 1 && length ) {
- return remaining;
- } else {
- deferred.resolveWith( elem, [ animation ] );
- return false;
- }
- },
- animation = deferred.promise({
- elem: elem,
- props: jQuery.extend( {}, properties ),
- opts: jQuery.extend( true, { specialEasing: {} }, options ),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function( prop, end ) {
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
- animation.tweens.push( tween );
- return tween;
- },
- stop: function( gotoEnd ) {
- var index = 0,
- // If we are going to the end, we want to run all the tweens
- // otherwise we skip this part
- length = gotoEnd ? animation.tweens.length : 0;
- if ( stopped ) {
- return this;
- }
- stopped = true;
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( 1 );
- }
-
- // Resolve when we played the last frame; otherwise, reject
- if ( gotoEnd ) {
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
- } else {
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
- }
- return this;
- }
- }),
- props = animation.props;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length ; index++ ) {
- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- return result;
- }
- }
-
- jQuery.map( props, createTween, animation );
-
- if ( jQuery.isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- elem: elem,
- anim: animation,
- queue: animation.opts.queue
- })
- );
-
- // attach callbacks from options
- return animation.progress( animation.opts.progress )
- .done( animation.opts.done, animation.opts.complete )
- .fail( animation.opts.fail )
- .always( animation.opts.always );
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
- tweener: function( props, callback ) {
- if ( jQuery.isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.split(" ");
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length ; index++ ) {
- prop = props[ index ];
- tweeners[ prop ] = tweeners[ prop ] || [];
- tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- animationPrefilters.unshift( callback );
- } else {
- animationPrefilters.push( callback );
- }
- }
-});
-
-jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // Normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
-};
-
-jQuery.fn.extend({
- fadeTo: function( speed, to, easing, callback ) {
-
- // Show any hidden elements after setting opacity to 0
- return this.filter( isHidden ).css( "opacity", 0 ).show()
-
- // Animate to the value specified
- .end().animate({ opacity: to }, speed, easing, callback );
- },
- animate: function( prop, speed, easing, callback ) {
- var empty = jQuery.isEmptyObject( prop ),
- optall = jQuery.speed( speed, easing, callback ),
- doAnimation = function() {
- // Operate on a copy of prop so per-property easing won't be lost
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations, or finishing resolves immediately
- if ( empty || data_priv.get( this, "finish" ) ) {
- anim.stop( true );
- }
- };
- doAnimation.finish = doAnimation;
-
- return empty || optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
- stop: function( type, clearQueue, gotoEnd ) {
- var stopQueue = function( hooks ) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop( gotoEnd );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each(function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = data_priv.get( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // Start the next in the queue if the last step wasn't forced.
- // Timers currently will call their complete callbacks, which
- // will dequeue but only if they were gotoEnd.
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- finish: function( type ) {
- if ( type !== false ) {
- type = type || "fx";
- }
- return this.each(function() {
- var index,
- data = data_priv.get( this ),
- queue = data[ type + "queue" ],
- hooks = data[ type + "queueHooks" ],
- timers = jQuery.timers,
- length = queue ? queue.length : 0;
-
- // Enable finishing flag on private data
- data.finish = true;
-
- // Empty the queue first
- jQuery.queue( this, type, [] );
-
- if ( hooks && hooks.stop ) {
- hooks.stop.call( this, true );
- }
-
- // Look for any active animations, and finish them
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
- timers[ index ].anim.stop( true );
- timers.splice( index, 1 );
- }
- }
-
- // Look for any animations in the old queue and finish them
- for ( index = 0; index < length; index++ ) {
- if ( queue[ index ] && queue[ index ].finish ) {
- queue[ index ].finish.call( this );
- }
- }
-
- // Turn off finishing flag
- delete data.finish;
- });
- }
-});
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
- var cssFn = jQuery.fn[ name ];
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ?
- cssFn.apply( this, arguments ) :
- this.animate( genFx( name, true ), speed, easing, callback );
- };
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show"),
- slideUp: genFx("hide"),
- slideToggle: genFx("toggle"),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.timers = [];
-jQuery.fx.tick = function() {
- var timer,
- i = 0,
- timers = jQuery.timers;
-
- fxNow = jQuery.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
- jQuery.timers.push( timer );
- if ( timer() ) {
- jQuery.fx.start();
- } else {
- jQuery.timers.pop();
- }
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
- if ( !timerId ) {
- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
- }
-};
-
-jQuery.fx.stop = function() {
- clearInterval( timerId );
- timerId = null;
-};
-
-jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
-};
-
-
-// Based off of the plugin by Clint Helfers, with permission.
-// http://blindsignals.com/index.php/2009/07/jquery-delay/
-jQuery.fn.delay = function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
-};
-
-
-(function() {
- var input = document.createElement( "input" ),
- select = document.createElement( "select" ),
- opt = select.appendChild( document.createElement( "option" ) );
-
- input.type = "checkbox";
-
- // Support: iOS<=5.1, Android<=4.2+
- // Default value for a checkbox should be "on"
- support.checkOn = input.value !== "";
-
- // Support: IE<=11+
- // Must access selectedIndex to make default options select
- support.optSelected = opt.selected;
-
- // Support: Android<=2.3
- // Options inside disabled selects are incorrectly marked as disabled
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Support: IE<=11+
- // An input loses its value after becoming a radio
- input = document.createElement( "input" );
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
-})();
-
-
-var nodeHook, boolHook,
- attrHandle = jQuery.expr.attrHandle;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- }
-});
-
-jQuery.extend({
- attr: function( elem, name, value ) {
- var hooks, ret,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === strundefined ) {
- return jQuery.prop( elem, name, value );
- }
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] ||
- ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
-
- } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- ret = jQuery.find.attr( elem, name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret == null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var name, propName,
- i = 0,
- attrNames = value && value.match( rnotwhite );
-
- if ( attrNames && elem.nodeType === 1 ) {
- while ( (name = attrNames[i++]) ) {
- propName = jQuery.propFix[ name ] || name;
-
- // Boolean attributes get special treatment (#10870)
- if ( jQuery.expr.match.bool.test( name ) ) {
- // Set corresponding property to false
- elem[ propName ] = false;
- }
-
- elem.removeAttribute( name );
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- if ( !support.radioValue && value === "radio" &&
- jQuery.nodeName( elem, "input" ) ) {
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- }
-});
-
-// Hooks for boolean attributes
-boolHook = {
- set: function( elem, value, name ) {
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- elem.setAttribute( name, name );
- }
- return name;
- }
-};
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
- var getter = attrHandle[ name ] || jQuery.find.attr;
-
- attrHandle[ name ] = function( elem, name, isXML ) {
- var ret, handle;
- if ( !isXML ) {
- // Avoid an infinite loop by temporarily removing this function from the getter
- handle = attrHandle[ name ];
- attrHandle[ name ] = ret;
- ret = getter( elem, name, isXML ) != null ?
- name.toLowerCase() :
- null;
- attrHandle[ name ] = handle;
- }
- return ret;
- };
-});
-
-
-
-
-var rfocusable = /^(?:input|select|textarea|button)$/i;
-
-jQuery.fn.extend({
- prop: function( name, value ) {
- return access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- return this.each(function() {
- delete this[ jQuery.propFix[ name ] || name ];
- });
- }
-});
-
-jQuery.extend({
- propFix: {
- "for": "htmlFor",
- "class": "className"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // Don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
- ret :
- ( elem[ name ] = value );
-
- } else {
- return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
- ret :
- elem[ name ];
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
- elem.tabIndex :
- -1;
- }
- }
- }
-});
-
-if ( !support.optSelected ) {
- jQuery.propHooks.selected = {
- get: function( elem ) {
- var parent = elem.parentNode;
- if ( parent && parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- return null;
- }
- };
-}
-
-jQuery.each([
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
-], function() {
- jQuery.propFix[ this.toLowerCase() ] = this;
-});
-
-
-
-
-var rclass = /[\t\r\n\f]/g;
-
-jQuery.fn.extend({
- addClass: function( value ) {
- var classes, elem, cur, clazz, j, finalValue,
- proceed = typeof value === "string" && value,
- i = 0,
- len = this.length;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call( this, j, this.className ) );
- });
- }
-
- if ( proceed ) {
- // The disjunction here is for better compressibility (see removeClass)
- classes = ( value || "" ).match( rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- " "
- );
-
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
-
- // only assign if different to avoid unneeded rendering.
- finalValue = jQuery.trim( cur );
- if ( elem.className !== finalValue ) {
- elem.className = finalValue;
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classes, elem, cur, clazz, j, finalValue,
- proceed = arguments.length === 0 || typeof value === "string" && value,
- i = 0,
- len = this.length;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
- });
- }
- if ( proceed ) {
- classes = ( value || "" ).match( rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- ""
- );
-
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = value ? jQuery.trim( cur ) : "";
- if ( elem.className !== finalValue ) {
- elem.className = finalValue;
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value;
-
- if ( typeof stateVal === "boolean" && type === "string" ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // Toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- classNames = value.match( rnotwhite ) || [];
-
- while ( (className = classNames[ i++ ]) ) {
- // Check each className given, space separated list
- if ( self.hasClass( className ) ) {
- self.removeClass( className );
- } else {
- self.addClass( className );
- }
- }
-
- // Toggle whole class name
- } else if ( type === strundefined || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- data_priv.set( this, "__className__", this.className );
- }
-
- // If the element has a class name or if we're passed `false`,
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
- return true;
- }
- }
-
- return false;
- }
-});
-
-
-
-
-var rreturn = /\r/g;
-
-jQuery.fn.extend({
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // Handle most common string cases
- ret.replace(rreturn, "") :
- // Handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, jQuery( this ).val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
-
- } else if ( typeof val === "number" ) {
- val += "";
-
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map( val, function( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- var val = jQuery.find.attr( elem, "value" );
- return val != null ?
- val :
- // Support: IE10-11+
- // option.text throws exceptions (#14686, #14858)
- jQuery.trim( jQuery.text( elem ) );
- }
- },
- select: {
- get: function( elem ) {
- var value, option,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ?
- max :
- one ? index : 0;
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // IE6-9 doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
- // Don't return options that are disabled or in a disabled optgroup
- ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var optionSet, option,
- options = elem.options,
- values = jQuery.makeArray( value ),
- i = options.length;
-
- while ( i-- ) {
- option = options[ i ];
- if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
- optionSet = true;
- }
- }
-
- // Force browsers to behave consistently when non-matching value is set
- if ( !optionSet ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- }
-});
-
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- };
- if ( !support.checkOn ) {
- jQuery.valHooks[ this ].get = function( elem ) {
- return elem.getAttribute("value") === null ? "on" : elem.value;
- };
- }
-});
-
-
-
-
-// Return jQuery for attributes-only inclusion
-
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-});
-
-jQuery.fn.extend({
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
- }
-});
-
-
-var nonce = jQuery.now();
-
-var rquery = (/\?/);
-
-
-
-// Support: Android 2.3
-// Workaround failure to string-cast null input
-jQuery.parseJSON = function( data ) {
- return JSON.parse( data + "" );
-};
-
-
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
- var xml, tmp;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
-
- // Support: IE9
- try {
- tmp = new DOMParser();
- xml = tmp.parseFromString( data, "text/xml" );
- } catch ( e ) {
- xml = undefined;
- }
-
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
-};
-
-
-var
- rhash = /#.*$/,
- rts = /([?&])_=[^&]*/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
- rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = "*/".concat( "*" ),
-
- // Document location
- ajaxLocation = window.location.href,
-
- // Segment location into parts
- ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- var dataType,
- i = 0,
- dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
-
- if ( jQuery.isFunction( func ) ) {
- // For each dataType in the dataTypeExpression
- while ( (dataType = dataTypes[i++]) ) {
- // Prepend if requested
- if ( dataType[0] === "+" ) {
- dataType = dataType.slice( 1 ) || "*";
- (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
-
- // Otherwise append
- } else {
- (structure[ dataType ] = structure[ dataType ] || []).push( func );
- }
- }
- }
- };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
- var inspected = {},
- seekingTransport = ( structure === transports );
-
- function inspect( dataType ) {
- var selected;
- inspected[ dataType ] = true;
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
- options.dataTypes.unshift( dataTypeOrTransport );
- inspect( dataTypeOrTransport );
- return false;
- } else if ( seekingTransport ) {
- return !( selected = dataTypeOrTransport );
- }
- });
- return selected;
- }
-
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-
- return target;
-}
-
-/* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var ct, type, finalDataType, firstDataType,
- contents = s.contents,
- dataTypes = s.dataTypes;
-
- // Remove auto dataType and get content-type in the process
- while ( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
-}
-
-/* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
-function ajaxConvert( s, response, jqXHR, isSuccess ) {
- var conv2, current, conv, tmp, prev,
- converters = {},
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice();
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- current = dataTypes.shift();
-
- // Convert to each sequential dataType
- while ( current ) {
-
- if ( s.responseFields[ current ] ) {
- jqXHR[ s.responseFields[ current ] ] = response;
- }
-
- // Apply the dataFilter if provided
- if ( !prev && isSuccess && s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- prev = current;
- current = dataTypes.shift();
-
- if ( current ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current === "*" ) {
-
- current = prev;
-
- // Convert response if prev dataType is non-auto and differs from current
- } else if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split( " " );
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.unshift( tmp[ 1 ] );
- }
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s[ "throws" ] ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
- }
- }
- }
- }
- }
- }
-
- return { state: "success", data: response };
-}
-
-jQuery.extend({
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajaxSettings: {
- url: ajaxLocation,
- type: "GET",
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
-
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- return settings ?
-
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var transport,
- // URL without anti-cache param
- cacheURL,
- // Response headers
- responseHeadersString,
- responseHeaders,
- // timeout handle
- timeoutTimer,
- // Cross-domain detection vars
- parts,
- // To know if global events are to be dispatched
- fireGlobals,
- // Loop variable
- i,
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
- // Callbacks context
- callbackContext = s.context || s,
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
- globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks("once memory"),
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
- // The jqXHR state
- state = 0,
- // Default abort message
- strAbort = "canceled",
- // Fake xhr
- jqXHR = {
- readyState: 0,
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( state === 2 ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while ( (match = rheaders.exec( responseHeadersString )) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
- }
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match == null ? null : match;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return state === 2 ? responseHeadersString : null;
- },
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- var lname = name.toLowerCase();
- if ( !state ) {
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( !state ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Status-dependent callbacks
- statusCode: function( map ) {
- var code;
- if ( map ) {
- if ( state < 2 ) {
- for ( code in map ) {
- // Lazy-add the new callback in a way that preserves old ones
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
- }
- } else {
- // Execute the appropriate callbacks
- jqXHR.always( map[ jqXHR.status ] );
- }
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- var finalText = statusText || strAbort;
- if ( transport ) {
- transport.abort( finalText );
- }
- done( 0, finalText );
- return this;
- }
- };
-
- // Attach deferreds
- deferred.promise( jqXHR ).complete = completeDeferred.add;
- jqXHR.success = jqXHR.done;
- jqXHR.error = jqXHR.fail;
-
- // Remove hash character (#7531: and string promotion)
- // Add protocol if not provided (prefilters might expect it)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
- // We also use the url parameter if available
- s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
- .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
-
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
-
- // A cross-domain request is in order when we have a protocol:host:port mismatch
- if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
- );
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
- fireGlobals = jQuery.event && s.global;
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger("ajaxStart");
- }
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- cacheURL = s.url;
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // If data is available, append data to url
- if ( s.data ) {
- cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
- s.url = rts.test( cacheURL ) ?
-
- // If there is already a '_' parameter, set its value
- cacheURL.replace( rts, "$1_=" + nonce++ ) :
-
- // Otherwise add one to the end
- cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
- }
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
- }
- if ( jQuery.etag[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already and return
- return jqXHR.abort();
- }
-
- // Aborting is no longer a cancellation
- strAbort = "abort";
-
- // Install callbacks on deferreds
- for ( i in { success: 1, error: 1, complete: 1 } ) {
- jqXHR[ i ]( s[ i ] );
- }
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
-
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout );
- }
-
- try {
- state = 1;
- transport.send( requestHeaders, done );
- } catch ( e ) {
- // Propagate exception as error if not done
- if ( state < 2 ) {
- done( -1, e );
- // Simply rethrow otherwise
- } else {
- throw e;
- }
- }
- }
-
- // Callback for when everything is done
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
-
- // Called once
- if ( state === 2 ) {
- return;
- }
-
- // State is "done" now
- state = 2;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Determine if successful
- isSuccess = status >= 200 && status < 300 || status === 304;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // Convert no matter what (that way responseXXX fields are always set)
- response = ajaxConvert( s, response, jqXHR, isSuccess );
-
- // If successful, handle type chaining
- if ( isSuccess ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if ( modified ) {
- jQuery.lastModified[ cacheURL ] = modified;
- }
- modified = jqXHR.getResponseHeader("etag");
- if ( modified ) {
- jQuery.etag[ cacheURL ] = modified;
- }
- }
-
- // if no content
- if ( status === 204 || s.type === "HEAD" ) {
- statusText = "nocontent";
-
- // if not modified
- } else if ( status === 304 ) {
- statusText = "notmodified";
-
- // If we have data, let's convert it
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
- // Extract error from statusText and normalize for non-aborts
- error = statusText;
- if ( status || !statusText ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger("ajaxStop");
- }
- }
- }
-
- return jqXHR;
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- }
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
- // Shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
-});
-
-
-jQuery._evalUrl = function( url ) {
- return jQuery.ajax({
- url: url,
- type: "GET",
- dataType: "script",
- async: false,
- global: false,
- "throws": true
- });
-};
-
-
-jQuery.fn.extend({
- wrapAll: function( html ) {
- var wrap;
-
- if ( jQuery.isFunction( html ) ) {
- return this.each(function( i ) {
- jQuery( this ).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[ 0 ] ) {
-
- // The elements to wrap the target around
- wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
- if ( this[ 0 ].parentNode ) {
- wrap.insertBefore( this[ 0 ] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstElementChild ) {
- elem = elem.firstElementChild;
- }
-
- return elem;
- }).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function( i ) {
- jQuery( this ).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each(function( i ) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- }
-});
-
-
-jQuery.expr.filters.hidden = function( elem ) {
- // Support: Opera <= 12.12
- // Opera reports offsetWidths and offsetHeights less than zero on some elements
- return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
-};
-jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
-};
-
-
-
-
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-function buildParams( prefix, obj, traditional, add ) {
- var name;
-
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // Item is non-scalar (array or object), encode its numeric index.
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-
-// Serialize an array of form elements or a set of
-// key/values into a query string
-jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
-};
-
-jQuery.fn.extend({
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map(function() {
- // Can add propHook for "elements" to filter or add form elements
- var elements = jQuery.prop( this, "elements" );
- return elements ? jQuery.makeArray( elements ) : this;
- })
- .filter(function() {
- var type = this.type;
-
- // Use .is( ":disabled" ) so that fieldset[disabled] works
- return this.name && !jQuery( this ).is( ":disabled" ) &&
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
- ( this.checked || !rcheckableType.test( type ) );
- })
- .map(function( i, elem ) {
- var val = jQuery( this ).val();
-
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val ) {
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
- }
-});
-
-
-jQuery.ajaxSettings.xhr = function() {
- try {
- return new XMLHttpRequest();
- } catch( e ) {}
-};
-
-var xhrId = 0,
- xhrCallbacks = {},
- xhrSuccessStatus = {
- // file protocol always yields status code 0, assume 200
- 0: 200,
- // Support: IE9
- // #1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
- },
- xhrSupported = jQuery.ajaxSettings.xhr();
-
-// Support: IE9
-// Open requests must be manually aborted on unload (#5280)
-// See https://support.microsoft.com/kb/2856746 for more info
-if ( window.attachEvent ) {
- window.attachEvent( "onunload", function() {
- for ( var key in xhrCallbacks ) {
- xhrCallbacks[ key ]();
- }
- });
-}
-
-support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-support.ajax = xhrSupported = !!xhrSupported;
-
-jQuery.ajaxTransport(function( options ) {
- var callback;
-
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( support.cors || xhrSupported && !options.crossDomain ) {
- return {
- send: function( headers, complete ) {
- var i,
- xhr = options.xhr(),
- id = ++xhrId;
-
- xhr.open( options.type, options.url, options.async, options.username, options.password );
-
- // Apply custom fields if provided
- if ( options.xhrFields ) {
- for ( i in options.xhrFields ) {
- xhr[ i ] = options.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( options.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( options.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !options.crossDomain && !headers["X-Requested-With"] ) {
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
-
- // Set headers
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
-
- // Callback
- callback = function( type ) {
- return function() {
- if ( callback ) {
- delete xhrCallbacks[ id ];
- callback = xhr.onload = xhr.onerror = null;
-
- if ( type === "abort" ) {
- xhr.abort();
- } else if ( type === "error" ) {
- complete(
- // file: protocol always yields status 0; see #8605, #14207
- xhr.status,
- xhr.statusText
- );
- } else {
- complete(
- xhrSuccessStatus[ xhr.status ] || xhr.status,
- xhr.statusText,
- // Support: IE9
- // Accessing binary-data responseText throws an exception
- // (#11426)
- typeof xhr.responseText === "string" ? {
- text: xhr.responseText
- } : undefined,
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
-
- // Listen to events
- xhr.onload = callback();
- xhr.onerror = callback("error");
-
- // Create the abort callback
- callback = xhrCallbacks[ id ] = callback("abort");
-
- try {
- // Do send the request (this may raise an exception)
- xhr.send( options.hasContent && options.data || null );
- } catch ( e ) {
- // #14683: Only rethrow if this hasn't been notified as an error yet
- if ( callback ) {
- throw e;
- }
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
-});
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
-});
-
-// Handle cache's special case and crossDomain
-jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function( s ) {
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
- var script, callback;
- return {
- send: function( _, complete ) {
- script = jQuery("
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Stack Overflow works best with JavaScript enabled
-
-
-
-
-
-