mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 02:07:58 +00:00
Add vendor folder to git
This commit is contained in:
parent
66cf5eaafb
commit
183585f56f
6916 changed files with 2629581 additions and 1 deletions
62
vendor/github.com/googleapis/gnostic/extensions/sample/INSTALL.sh
generated
vendored
Normal file
62
vendor/github.com/googleapis/gnostic/extensions/sample/INSTALL.sh
generated
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
go get github.com/golang/protobuf/protoc-gen-go
|
||||
|
||||
|
||||
# ONE TIME
|
||||
#
|
||||
#
|
||||
|
||||
############################# FOR E2E TESTING ########################################
|
||||
# ensure vendorextension proto contract is compiled.
|
||||
pushd $GOPATH/src/github.com/googleapis/gnostic/extensions
|
||||
./COMPILE-EXTENSION.sh
|
||||
popd
|
||||
|
||||
pushd $GOPATH/src/github.com/googleapis/gnostic/generator
|
||||
./INSTALL.sh
|
||||
|
||||
pushd $GOPATH/src/github.com/googleapis/gnostic
|
||||
go install
|
||||
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
|
||||
# Now generate sample extension plugins and install them.
|
||||
#
|
||||
#
|
||||
pushd $GOPATH/src/github.com/googleapis/gnostic/extensions
|
||||
|
||||
EXTENSION_OUT_DIR=$GOPATH/src/"github.com/googleapis/gnostic/extensions/sample/generated"
|
||||
# For SAMPLE_ONE Extension Example
|
||||
#
|
||||
#
|
||||
SAMPLE_ONE_EXTENSION_SCHEMA="sample/x-samplecompanyone.json"
|
||||
|
||||
generator --extension $SAMPLE_ONE_EXTENSION_SCHEMA --out_dir=$EXTENSION_OUT_DIR
|
||||
|
||||
pushd $EXTENSION_OUT_DIR/openapi_extensions_samplecompanyone/proto
|
||||
protoc --go_out=Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. *.proto
|
||||
go install
|
||||
popd
|
||||
|
||||
pushd $EXTENSION_OUT_DIR/openapi_extensions_samplecompanyone
|
||||
go install
|
||||
popd
|
||||
|
||||
# For SAMPLE_TWO Extension Example
|
||||
#
|
||||
#
|
||||
SAMPLE_TWO_EXTENSION_SCHEMA="sample/x-samplecompanytwo.json"
|
||||
|
||||
generator --extension $SAMPLE_TWO_EXTENSION_SCHEMA --out_dir=$EXTENSION_OUT_DIR
|
||||
|
||||
pushd $EXTENSION_OUT_DIR/openapi_extensions_samplecompanytwo/proto
|
||||
protoc --go_out=Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. *.proto
|
||||
go install
|
||||
popd
|
||||
|
||||
pushd $EXTENSION_OUT_DIR/openapi_extensions_samplecompanytwo
|
||||
go install
|
||||
popd
|
||||
popd
|
||||
44
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/main.go
generated
vendored
Normal file
44
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/main.go
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright 2017 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/googleapis/gnostic/compiler"
|
||||
"github.com/googleapis/gnostic/extensions"
|
||||
"github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func handleExtension(extensionName string, info yaml.MapSlice) (bool, proto.Message, error) {
|
||||
switch extensionName {
|
||||
// All supported extensions
|
||||
|
||||
case "x-samplecompanyone-book":
|
||||
newObject, err := samplecompanyone.NewSampleCompanyOneBook(info, compiler.NewContext("$root", nil))
|
||||
return true, newObject, err
|
||||
case "x-samplecompanyone-shelve":
|
||||
newObject, err := samplecompanyone.NewSampleCompanyOneShelve(info, compiler.NewContext("$root", nil))
|
||||
return true, newObject, err
|
||||
default:
|
||||
return false, nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
openapiextension_v1.ProcessExtension(handleExtension)
|
||||
}
|
||||
131
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto/x-samplecompanyone.go
generated
vendored
Normal file
131
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto/x-samplecompanyone.go
generated
vendored
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
// Copyright 2017 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED.
|
||||
|
||||
package samplecompanyone
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/googleapis/gnostic/compiler"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Version() string {
|
||||
return "samplecompanyone"
|
||||
}
|
||||
|
||||
func NewSampleCompanyOneBook(in interface{}, context *compiler.Context) (*SampleCompanyOneBook, error) {
|
||||
errors := make([]error, 0)
|
||||
x := &SampleCompanyOneBook{}
|
||||
m, ok := compiler.UnpackMap(in)
|
||||
if !ok {
|
||||
message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
} else {
|
||||
requiredKeys := []string{"code", "message"}
|
||||
missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
|
||||
if len(missingKeys) > 0 {
|
||||
message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
allowedKeys := []string{"code", "message"}
|
||||
allowedPatterns := []string{}
|
||||
invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
|
||||
if len(invalidKeys) > 0 {
|
||||
message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
// int64 code = 1;
|
||||
v1 := compiler.MapValueForKey(m, "code")
|
||||
if v1 != nil {
|
||||
t, ok := v1.(int)
|
||||
if ok {
|
||||
x.Code = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for code: %+v (%T)", v1, v1)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
// int64 message = 2;
|
||||
v2 := compiler.MapValueForKey(m, "message")
|
||||
if v2 != nil {
|
||||
t, ok := v2.(int)
|
||||
if ok {
|
||||
x.Message = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for message: %+v (%T)", v2, v2)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
}
|
||||
return x, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
|
||||
func NewSampleCompanyOneShelve(in interface{}, context *compiler.Context) (*SampleCompanyOneShelve, error) {
|
||||
errors := make([]error, 0)
|
||||
x := &SampleCompanyOneShelve{}
|
||||
m, ok := compiler.UnpackMap(in)
|
||||
if !ok {
|
||||
message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
} else {
|
||||
requiredKeys := []string{"bar", "foo1"}
|
||||
missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
|
||||
if len(missingKeys) > 0 {
|
||||
message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
allowedKeys := []string{"bar", "foo1"}
|
||||
allowedPatterns := []string{}
|
||||
invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
|
||||
if len(invalidKeys) > 0 {
|
||||
message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
// int64 foo1 = 1;
|
||||
v1 := compiler.MapValueForKey(m, "foo1")
|
||||
if v1 != nil {
|
||||
t, ok := v1.(int)
|
||||
if ok {
|
||||
x.Foo1 = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for foo1: %+v (%T)", v1, v1)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
// int64 bar = 2;
|
||||
v2 := compiler.MapValueForKey(m, "bar")
|
||||
if v2 != nil {
|
||||
t, ok := v2.(int)
|
||||
if ok {
|
||||
x.Bar = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for bar: %+v (%T)", v2, v2)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
}
|
||||
return x, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
|
||||
func (m *SampleCompanyOneBook) ResolveReferences(root string) (interface{}, error) {
|
||||
errors := make([]error, 0)
|
||||
return nil, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
|
||||
func (m *SampleCompanyOneShelve) ResolveReferences(root string) (interface{}, error) {
|
||||
errors := make([]error, 0)
|
||||
return nil, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
101
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto/x-samplecompanyone.pb.go
generated
vendored
Normal file
101
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto/x-samplecompanyone.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
// Code generated by protoc-gen-go.
|
||||
// source: x-samplecompanyone.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package samplecompanyone is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
x-samplecompanyone.proto
|
||||
|
||||
It has these top-level messages:
|
||||
SampleCompanyOneBook
|
||||
SampleCompanyOneShelve
|
||||
*/
|
||||
package samplecompanyone
|
||||
|
||||
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 SampleCompanyOneBook struct {
|
||||
Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
|
||||
Message int64 `protobuf:"varint,2,opt,name=message" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SampleCompanyOneBook) Reset() { *m = SampleCompanyOneBook{} }
|
||||
func (m *SampleCompanyOneBook) String() string { return proto.CompactTextString(m) }
|
||||
func (*SampleCompanyOneBook) ProtoMessage() {}
|
||||
func (*SampleCompanyOneBook) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *SampleCompanyOneBook) GetCode() int64 {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SampleCompanyOneBook) GetMessage() int64 {
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SampleCompanyOneShelve struct {
|
||||
Foo1 int64 `protobuf:"varint,1,opt,name=foo1" json:"foo1,omitempty"`
|
||||
Bar int64 `protobuf:"varint,2,opt,name=bar" json:"bar,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SampleCompanyOneShelve) Reset() { *m = SampleCompanyOneShelve{} }
|
||||
func (m *SampleCompanyOneShelve) String() string { return proto.CompactTextString(m) }
|
||||
func (*SampleCompanyOneShelve) ProtoMessage() {}
|
||||
func (*SampleCompanyOneShelve) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *SampleCompanyOneShelve) GetFoo1() int64 {
|
||||
if m != nil {
|
||||
return m.Foo1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SampleCompanyOneShelve) GetBar() int64 {
|
||||
if m != nil {
|
||||
return m.Bar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SampleCompanyOneBook)(nil), "samplecompanyone.SampleCompanyOneBook")
|
||||
proto.RegisterType((*SampleCompanyOneShelve)(nil), "samplecompanyone.SampleCompanyOneShelve")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("x-samplecompanyone.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 192 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0xa8, 0xd0, 0x2d, 0x4e,
|
||||
0xcc, 0x2d, 0xc8, 0x49, 0x4d, 0xce, 0xcf, 0x2d, 0x48, 0xcc, 0xab, 0xcc, 0xcf, 0x4b, 0xd5, 0x2b,
|
||||
0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x17, 0x57, 0x72, 0xe1, 0x12, 0x09, 0x06, 0x8b, 0x39,
|
||||
0x43, 0xc4, 0xfc, 0xf3, 0x52, 0x9d, 0xf2, 0xf3, 0xb3, 0x85, 0x84, 0xb8, 0x58, 0x92, 0xf3, 0x53,
|
||||
0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4,
|
||||
0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x26, 0xb0, 0x30, 0x8c, 0xab, 0x64, 0xc7, 0x25, 0x86, 0x6e,
|
||||
0x4a, 0x70, 0x46, 0x6a, 0x4e, 0x59, 0x2a, 0xc8, 0x9c, 0xb4, 0xfc, 0x7c, 0x43, 0x98, 0x39, 0x20,
|
||||
0xb6, 0x90, 0x00, 0x17, 0x73, 0x52, 0x62, 0x11, 0xd4, 0x0c, 0x10, 0xd3, 0x29, 0x98, 0x4b, 0x2d,
|
||||
0xbf, 0x28, 0x5d, 0x2f, 0xbf, 0x20, 0x35, 0x2f, 0xb1, 0x20, 0x53, 0x2f, 0xb5, 0xa2, 0x24, 0x35,
|
||||
0xaf, 0x38, 0x33, 0x3f, 0x4f, 0x0f, 0xdd, 0xbd, 0x4e, 0x22, 0x61, 0xa9, 0x79, 0x29, 0xf9, 0x45,
|
||||
0xae, 0x30, 0x15, 0x01, 0x20, 0x7f, 0x05, 0x30, 0x2e, 0x62, 0xc2, 0xf0, 0x5a, 0x12, 0x1b, 0xd8,
|
||||
0xcf, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0x17, 0xf7, 0x22, 0x0f, 0x01, 0x00, 0x00,
|
||||
}
|
||||
51
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto/x-samplecompanyone.proto
generated
vendored
Normal file
51
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanyone/proto/x-samplecompanyone.proto
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright 2017 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package samplecompanyone;
|
||||
|
||||
// This option lets the proto compiler generate Java code inside the package
|
||||
// name (see below) instead of inside an outer class. It creates a simpler
|
||||
// developer experience by reducing one-level of name nesting and be
|
||||
// consistent with most programming languages that don't support outer classes.
|
||||
option java_multiple_files = true;
|
||||
|
||||
// The Java outer classname should be the filename in UpperCamelCase. This
|
||||
// class is only used to hold proto descriptor, so developers don't need to
|
||||
// work with it directly.
|
||||
option java_outer_classname = "VendorExtensionProto";
|
||||
|
||||
// The Java package name must be proto package name with proper prefix.
|
||||
option java_package = "org.openapi.extension.samplecompanyone";
|
||||
|
||||
// A reasonable prefix for the Objective-C symbols generated from the package.
|
||||
// It should at a minimum be 3 characters long, all uppercase, and convention
|
||||
// is to use an abbreviation of the package name. Something short, but
|
||||
// hopefully unique enough to not conflict with things that may come along in
|
||||
// the future. 'GPB' is reserved for the protocol buffer implementation itself.
|
||||
option objc_class_prefix = "samplecompanyone";
|
||||
|
||||
message SampleCompanyOneBook {
|
||||
int64 code = 1;
|
||||
int64 message = 2;
|
||||
}
|
||||
|
||||
message SampleCompanyOneShelve {
|
||||
int64 foo1 = 1;
|
||||
int64 bar = 2;
|
||||
}
|
||||
|
||||
44
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/main.go
generated
vendored
Normal file
44
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/main.go
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright 2017 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/googleapis/gnostic/compiler"
|
||||
"github.com/googleapis/gnostic/extensions"
|
||||
"github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func handleExtension(extensionName string, info yaml.MapSlice) (bool, proto.Message, error) {
|
||||
switch extensionName {
|
||||
// All supported extensions
|
||||
|
||||
case "x-samplecompanytwo-book":
|
||||
newObject, err := samplecompanytwo.NewSampleCompanyTwoBook(info, compiler.NewContext("$root", nil))
|
||||
return true, newObject, err
|
||||
case "x-samplecompanytwo-shelve":
|
||||
newObject, err := samplecompanytwo.NewSampleCompanyTwoShelve(info, compiler.NewContext("$root", nil))
|
||||
return true, newObject, err
|
||||
default:
|
||||
return false, nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
openapiextension_v1.ProcessExtension(handleExtension)
|
||||
}
|
||||
131
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto/x-samplecompanytwo.go
generated
vendored
Normal file
131
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto/x-samplecompanytwo.go
generated
vendored
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
// Copyright 2017 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED.
|
||||
|
||||
package samplecompanytwo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/googleapis/gnostic/compiler"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Version() string {
|
||||
return "samplecompanytwo"
|
||||
}
|
||||
|
||||
func NewSampleCompanyTwoBook(in interface{}, context *compiler.Context) (*SampleCompanyTwoBook, error) {
|
||||
errors := make([]error, 0)
|
||||
x := &SampleCompanyTwoBook{}
|
||||
m, ok := compiler.UnpackMap(in)
|
||||
if !ok {
|
||||
message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
} else {
|
||||
requiredKeys := []string{"code", "message"}
|
||||
missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
|
||||
if len(missingKeys) > 0 {
|
||||
message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
allowedKeys := []string{"code", "message"}
|
||||
allowedPatterns := []string{}
|
||||
invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
|
||||
if len(invalidKeys) > 0 {
|
||||
message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
// int64 code = 1;
|
||||
v1 := compiler.MapValueForKey(m, "code")
|
||||
if v1 != nil {
|
||||
t, ok := v1.(int)
|
||||
if ok {
|
||||
x.Code = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for code: %+v (%T)", v1, v1)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
// int64 message = 2;
|
||||
v2 := compiler.MapValueForKey(m, "message")
|
||||
if v2 != nil {
|
||||
t, ok := v2.(int)
|
||||
if ok {
|
||||
x.Message = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for message: %+v (%T)", v2, v2)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
}
|
||||
return x, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
|
||||
func NewSampleCompanyTwoShelve(in interface{}, context *compiler.Context) (*SampleCompanyTwoShelve, error) {
|
||||
errors := make([]error, 0)
|
||||
x := &SampleCompanyTwoShelve{}
|
||||
m, ok := compiler.UnpackMap(in)
|
||||
if !ok {
|
||||
message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
} else {
|
||||
requiredKeys := []string{"bar", "foo1"}
|
||||
missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
|
||||
if len(missingKeys) > 0 {
|
||||
message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
allowedKeys := []string{"bar", "foo1"}
|
||||
allowedPatterns := []string{}
|
||||
invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
|
||||
if len(invalidKeys) > 0 {
|
||||
message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
// int64 foo1 = 1;
|
||||
v1 := compiler.MapValueForKey(m, "foo1")
|
||||
if v1 != nil {
|
||||
t, ok := v1.(int)
|
||||
if ok {
|
||||
x.Foo1 = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for foo1: %+v (%T)", v1, v1)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
// int64 bar = 2;
|
||||
v2 := compiler.MapValueForKey(m, "bar")
|
||||
if v2 != nil {
|
||||
t, ok := v2.(int)
|
||||
if ok {
|
||||
x.Bar = int64(t)
|
||||
} else {
|
||||
message := fmt.Sprintf("has unexpected value for bar: %+v (%T)", v2, v2)
|
||||
errors = append(errors, compiler.NewError(context, message))
|
||||
}
|
||||
}
|
||||
}
|
||||
return x, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
|
||||
func (m *SampleCompanyTwoBook) ResolveReferences(root string) (interface{}, error) {
|
||||
errors := make([]error, 0)
|
||||
return nil, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
|
||||
func (m *SampleCompanyTwoShelve) ResolveReferences(root string) (interface{}, error) {
|
||||
errors := make([]error, 0)
|
||||
return nil, compiler.NewErrorGroupOrNil(errors)
|
||||
}
|
||||
101
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto/x-samplecompanytwo.pb.go
generated
vendored
Normal file
101
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto/x-samplecompanytwo.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
// Code generated by protoc-gen-go.
|
||||
// source: x-samplecompanytwo.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package samplecompanytwo is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
x-samplecompanytwo.proto
|
||||
|
||||
It has these top-level messages:
|
||||
SampleCompanyTwoBook
|
||||
SampleCompanyTwoShelve
|
||||
*/
|
||||
package samplecompanytwo
|
||||
|
||||
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 SampleCompanyTwoBook struct {
|
||||
Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
|
||||
Message int64 `protobuf:"varint,2,opt,name=message" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SampleCompanyTwoBook) Reset() { *m = SampleCompanyTwoBook{} }
|
||||
func (m *SampleCompanyTwoBook) String() string { return proto.CompactTextString(m) }
|
||||
func (*SampleCompanyTwoBook) ProtoMessage() {}
|
||||
func (*SampleCompanyTwoBook) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *SampleCompanyTwoBook) GetCode() int64 {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SampleCompanyTwoBook) GetMessage() int64 {
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SampleCompanyTwoShelve struct {
|
||||
Foo1 int64 `protobuf:"varint,1,opt,name=foo1" json:"foo1,omitempty"`
|
||||
Bar int64 `protobuf:"varint,2,opt,name=bar" json:"bar,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SampleCompanyTwoShelve) Reset() { *m = SampleCompanyTwoShelve{} }
|
||||
func (m *SampleCompanyTwoShelve) String() string { return proto.CompactTextString(m) }
|
||||
func (*SampleCompanyTwoShelve) ProtoMessage() {}
|
||||
func (*SampleCompanyTwoShelve) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *SampleCompanyTwoShelve) GetFoo1() int64 {
|
||||
if m != nil {
|
||||
return m.Foo1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SampleCompanyTwoShelve) GetBar() int64 {
|
||||
if m != nil {
|
||||
return m.Bar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SampleCompanyTwoBook)(nil), "samplecompanytwo.SampleCompanyTwoBook")
|
||||
proto.RegisterType((*SampleCompanyTwoShelve)(nil), "samplecompanytwo.SampleCompanyTwoShelve")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("x-samplecompanytwo.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 191 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x8f, 0x41, 0xeb, 0x82, 0x30,
|
||||
0x18, 0x87, 0x51, 0xff, 0xfc, 0x83, 0x9d, 0x64, 0x48, 0xec, 0x18, 0x1e, 0xa2, 0x4b, 0x83, 0xe8,
|
||||
0xde, 0xc1, 0xea, 0x2e, 0x19, 0xdd, 0xa7, 0xbe, 0x99, 0xa4, 0x7b, 0xc7, 0x26, 0x69, 0x5f, 0xa7,
|
||||
0x4f, 0x1a, 0x5b, 0x79, 0xb1, 0xdb, 0x6f, 0x0f, 0xe3, 0xe1, 0x7d, 0x08, 0x1b, 0xd6, 0x46, 0xb4,
|
||||
0xaa, 0x81, 0x02, 0x5b, 0x25, 0xe4, 0xb3, 0xeb, 0x91, 0x2b, 0x8d, 0x1d, 0xd2, 0x70, 0xca, 0xe3,
|
||||
0x03, 0x89, 0x32, 0xc7, 0xf6, 0x1f, 0x76, 0xee, 0x31, 0x41, 0xbc, 0x53, 0x4a, 0xfe, 0x0a, 0x2c,
|
||||
0x81, 0x79, 0x0b, 0x6f, 0x15, 0x9c, 0xdc, 0xa6, 0x8c, 0xcc, 0x5a, 0x30, 0x46, 0x54, 0xc0, 0x7c,
|
||||
0x87, 0xc7, 0x67, 0xbc, 0x23, 0xf3, 0xa9, 0x25, 0xbb, 0x41, 0xf3, 0x00, 0xeb, 0xb9, 0x22, 0x6e,
|
||||
0x46, 0x8f, 0xdd, 0x34, 0x24, 0x41, 0x2e, 0xf4, 0xd7, 0x61, 0x67, 0x92, 0x91, 0x25, 0xea, 0x8a,
|
||||
0xa3, 0x02, 0x29, 0x54, 0xcd, 0x61, 0xe8, 0x40, 0x9a, 0x1a, 0x25, 0x9f, 0xde, 0x9b, 0x44, 0x17,
|
||||
0x90, 0x25, 0xea, 0xe3, 0xf8, 0x23, 0xb5, 0x5d, 0xa9, 0xf7, 0xf2, 0x7f, 0xd2, 0xf2, 0x7f, 0xd7,
|
||||
0xbc, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x45, 0x2d, 0x48, 0x0f, 0x01, 0x00, 0x00,
|
||||
}
|
||||
51
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto/x-samplecompanytwo.proto
generated
vendored
Normal file
51
vendor/github.com/googleapis/gnostic/extensions/sample/generated/openapi_extensions_samplecompanytwo/proto/x-samplecompanytwo.proto
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright 2017 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package samplecompanytwo;
|
||||
|
||||
// This option lets the proto compiler generate Java code inside the package
|
||||
// name (see below) instead of inside an outer class. It creates a simpler
|
||||
// developer experience by reducing one-level of name nesting and be
|
||||
// consistent with most programming languages that don't support outer classes.
|
||||
option java_multiple_files = true;
|
||||
|
||||
// The Java outer classname should be the filename in UpperCamelCase. This
|
||||
// class is only used to hold proto descriptor, so developers don't need to
|
||||
// work with it directly.
|
||||
option java_outer_classname = "VendorExtensionProto";
|
||||
|
||||
// The Java package name must be proto package name with proper prefix.
|
||||
option java_package = "org.openapi.extension.samplecompanytwo";
|
||||
|
||||
// A reasonable prefix for the Objective-C symbols generated from the package.
|
||||
// It should at a minimum be 3 characters long, all uppercase, and convention
|
||||
// is to use an abbreviation of the package name. Something short, but
|
||||
// hopefully unique enough to not conflict with things that may come along in
|
||||
// the future. 'GPB' is reserved for the protocol buffer implementation itself.
|
||||
option objc_class_prefix = "samplecompanytwo";
|
||||
|
||||
message SampleCompanyTwoBook {
|
||||
int64 code = 1;
|
||||
int64 message = 2;
|
||||
}
|
||||
|
||||
message SampleCompanyTwoShelve {
|
||||
int64 foo1 = 1;
|
||||
int64 bar = 2;
|
||||
}
|
||||
|
||||
38
vendor/github.com/googleapis/gnostic/extensions/sample/x-samplecompanyone.json
generated
vendored
Normal file
38
vendor/github.com/googleapis/gnostic/extensions/sample/x-samplecompanyone.json
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"definitions": {
|
||||
"SampleCompanyOneBook": {
|
||||
"type": "object",
|
||||
"id": "x-samplecompanyone-book",
|
||||
"required": [
|
||||
"code",
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SampleCompanyOneShelve": {
|
||||
"type": "object",
|
||||
"id": "x-samplecompanyone-shelve",
|
||||
"required": [
|
||||
"foo1",
|
||||
"bar"
|
||||
],
|
||||
"properties": {
|
||||
"foo1": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"bar": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
vendor/github.com/googleapis/gnostic/extensions/sample/x-samplecompanytwo.json
generated
vendored
Normal file
38
vendor/github.com/googleapis/gnostic/extensions/sample/x-samplecompanytwo.json
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"definitions": {
|
||||
"SampleCompanyTwoBook": {
|
||||
"type": "object",
|
||||
"id": "x-samplecompanytwo-book",
|
||||
"required": [
|
||||
"code",
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SampleCompanyTwoShelve": {
|
||||
"type": "object",
|
||||
"id": "x-samplecompanytwo-shelve",
|
||||
"required": [
|
||||
"foo1",
|
||||
"bar"
|
||||
],
|
||||
"properties": {
|
||||
"foo1": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"bar": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue