mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	pin dependency github.com/beorn7/perks from v1.0.0 to v1.0.1 pin dependency github.com/golang/protobuf from v1.3.3 to v1.4.2 pin denpendency github.com/json-iterator/go from v1.1.8 to v1.1.9 pin dependency github.com/prometheus/common from v0.4.1 to v0.9.1 pin dependency github.com/prometheus/procfs from v0.0.5 to v0.0.11 pin dependency github.com/alecthomas/template from v0.0.0-20160405071501-a0175ee3bccc to v0.0.0-20190718012654-fb15b899a751 pin dependency github.com/alecthomas/units from v0.0.0-20151022065526-2efee857e7cf to v0.0.0-20190717042225-c3de453c63f4 pin dependency github.com/go-kit/kit from v0.8.0 to v0.9.0 pin dependency github.com/go-logfmt/logfmt from v0.3.0 to v0.4.0 Co-Authored-By: Jordan Liggitt <jordan@liggitt.net>
		
			
				
	
	
		
			98 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			98 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2018 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.
 | |
| 
 | |
| // Code generated by generate-types. DO NOT EDIT.
 | |
| 
 | |
| package proto
 | |
| 
 | |
| import (
 | |
| 	"math"
 | |
| 	"unicode/utf8"
 | |
| 
 | |
| 	"google.golang.org/protobuf/encoding/protowire"
 | |
| 	"google.golang.org/protobuf/internal/errors"
 | |
| 	"google.golang.org/protobuf/internal/strs"
 | |
| 	"google.golang.org/protobuf/reflect/protoreflect"
 | |
| )
 | |
| 
 | |
| var wireTypes = map[protoreflect.Kind]protowire.Type{
 | |
| 	protoreflect.BoolKind:     protowire.VarintType,
 | |
| 	protoreflect.EnumKind:     protowire.VarintType,
 | |
| 	protoreflect.Int32Kind:    protowire.VarintType,
 | |
| 	protoreflect.Sint32Kind:   protowire.VarintType,
 | |
| 	protoreflect.Uint32Kind:   protowire.VarintType,
 | |
| 	protoreflect.Int64Kind:    protowire.VarintType,
 | |
| 	protoreflect.Sint64Kind:   protowire.VarintType,
 | |
| 	protoreflect.Uint64Kind:   protowire.VarintType,
 | |
| 	protoreflect.Sfixed32Kind: protowire.Fixed32Type,
 | |
| 	protoreflect.Fixed32Kind:  protowire.Fixed32Type,
 | |
| 	protoreflect.FloatKind:    protowire.Fixed32Type,
 | |
| 	protoreflect.Sfixed64Kind: protowire.Fixed64Type,
 | |
| 	protoreflect.Fixed64Kind:  protowire.Fixed64Type,
 | |
| 	protoreflect.DoubleKind:   protowire.Fixed64Type,
 | |
| 	protoreflect.StringKind:   protowire.BytesType,
 | |
| 	protoreflect.BytesKind:    protowire.BytesType,
 | |
| 	protoreflect.MessageKind:  protowire.BytesType,
 | |
| 	protoreflect.GroupKind:    protowire.StartGroupType,
 | |
| }
 | |
| 
 | |
| func (o MarshalOptions) marshalSingular(b []byte, fd protoreflect.FieldDescriptor, v protoreflect.Value) ([]byte, error) {
 | |
| 	switch fd.Kind() {
 | |
| 	case protoreflect.BoolKind:
 | |
| 		b = protowire.AppendVarint(b, protowire.EncodeBool(v.Bool()))
 | |
| 	case protoreflect.EnumKind:
 | |
| 		b = protowire.AppendVarint(b, uint64(v.Enum()))
 | |
| 	case protoreflect.Int32Kind:
 | |
| 		b = protowire.AppendVarint(b, uint64(int32(v.Int())))
 | |
| 	case protoreflect.Sint32Kind:
 | |
| 		b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(int32(v.Int()))))
 | |
| 	case protoreflect.Uint32Kind:
 | |
| 		b = protowire.AppendVarint(b, uint64(uint32(v.Uint())))
 | |
| 	case protoreflect.Int64Kind:
 | |
| 		b = protowire.AppendVarint(b, uint64(v.Int()))
 | |
| 	case protoreflect.Sint64Kind:
 | |
| 		b = protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int()))
 | |
| 	case protoreflect.Uint64Kind:
 | |
| 		b = protowire.AppendVarint(b, v.Uint())
 | |
| 	case protoreflect.Sfixed32Kind:
 | |
| 		b = protowire.AppendFixed32(b, uint32(v.Int()))
 | |
| 	case protoreflect.Fixed32Kind:
 | |
| 		b = protowire.AppendFixed32(b, uint32(v.Uint()))
 | |
| 	case protoreflect.FloatKind:
 | |
| 		b = protowire.AppendFixed32(b, math.Float32bits(float32(v.Float())))
 | |
| 	case protoreflect.Sfixed64Kind:
 | |
| 		b = protowire.AppendFixed64(b, uint64(v.Int()))
 | |
| 	case protoreflect.Fixed64Kind:
 | |
| 		b = protowire.AppendFixed64(b, v.Uint())
 | |
| 	case protoreflect.DoubleKind:
 | |
| 		b = protowire.AppendFixed64(b, math.Float64bits(v.Float()))
 | |
| 	case protoreflect.StringKind:
 | |
| 		if strs.EnforceUTF8(fd) && !utf8.ValidString(v.String()) {
 | |
| 			return b, errors.InvalidUTF8(string(fd.FullName()))
 | |
| 		}
 | |
| 		b = protowire.AppendString(b, v.String())
 | |
| 	case protoreflect.BytesKind:
 | |
| 		b = protowire.AppendBytes(b, v.Bytes())
 | |
| 	case protoreflect.MessageKind:
 | |
| 		var pos int
 | |
| 		var err error
 | |
| 		b, pos = appendSpeculativeLength(b)
 | |
| 		b, err = o.marshalMessage(b, v.Message())
 | |
| 		if err != nil {
 | |
| 			return b, err
 | |
| 		}
 | |
| 		b = finishSpeculativeLength(b, pos)
 | |
| 	case protoreflect.GroupKind:
 | |
| 		var err error
 | |
| 		b, err = o.marshalMessage(b, v.Message())
 | |
| 		if err != nil {
 | |
| 			return b, err
 | |
| 		}
 | |
| 		b = protowire.AppendVarint(b, protowire.EncodeTag(fd.Number(), protowire.EndGroupType))
 | |
| 	default:
 | |
| 		return b, errors.New("invalid kind %v", fd.Kind())
 | |
| 	}
 | |
| 	return b, nil
 | |
| }
 |