mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
251 lines
7.6 KiB
Go
251 lines
7.6 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: attribute.proto
|
|
|
|
package 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
|
|
|
|
// Attribute is used to describe the value of an attribute, optionally
|
|
// specifying units
|
|
type Attribute struct {
|
|
// Types that are valid to be assigned to Value:
|
|
// *Attribute_FloatVal
|
|
// *Attribute_IntVal
|
|
// *Attribute_StringVal
|
|
// *Attribute_BoolVal
|
|
Value isAttribute_Value `protobuf_oneof:"value"`
|
|
// unit gives the unit type: MHz, MB, etc.
|
|
Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Attribute) Reset() { *m = Attribute{} }
|
|
func (m *Attribute) String() string { return proto.CompactTextString(m) }
|
|
func (*Attribute) ProtoMessage() {}
|
|
func (*Attribute) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_attribute_bfac9d16cf08e8f5, []int{0}
|
|
}
|
|
func (m *Attribute) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Attribute.Unmarshal(m, b)
|
|
}
|
|
func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Attribute.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *Attribute) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Attribute.Merge(dst, src)
|
|
}
|
|
func (m *Attribute) XXX_Size() int {
|
|
return xxx_messageInfo_Attribute.Size(m)
|
|
}
|
|
func (m *Attribute) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Attribute.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Attribute proto.InternalMessageInfo
|
|
|
|
type isAttribute_Value interface {
|
|
isAttribute_Value()
|
|
}
|
|
|
|
type Attribute_FloatVal struct {
|
|
FloatVal float64 `protobuf:"fixed64,1,opt,name=float_val,json=floatVal,proto3,oneof"`
|
|
}
|
|
|
|
type Attribute_IntVal struct {
|
|
IntVal int64 `protobuf:"varint,2,opt,name=int_val,json=intVal,proto3,oneof"`
|
|
}
|
|
|
|
type Attribute_StringVal struct {
|
|
StringVal string `protobuf:"bytes,3,opt,name=string_val,json=stringVal,proto3,oneof"`
|
|
}
|
|
|
|
type Attribute_BoolVal struct {
|
|
BoolVal bool `protobuf:"varint,4,opt,name=bool_val,json=boolVal,proto3,oneof"`
|
|
}
|
|
|
|
func (*Attribute_FloatVal) isAttribute_Value() {}
|
|
|
|
func (*Attribute_IntVal) isAttribute_Value() {}
|
|
|
|
func (*Attribute_StringVal) isAttribute_Value() {}
|
|
|
|
func (*Attribute_BoolVal) isAttribute_Value() {}
|
|
|
|
func (m *Attribute) GetValue() isAttribute_Value {
|
|
if m != nil {
|
|
return m.Value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Attribute) GetFloatVal() float64 {
|
|
if x, ok := m.GetValue().(*Attribute_FloatVal); ok {
|
|
return x.FloatVal
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Attribute) GetIntVal() int64 {
|
|
if x, ok := m.GetValue().(*Attribute_IntVal); ok {
|
|
return x.IntVal
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Attribute) GetStringVal() string {
|
|
if x, ok := m.GetValue().(*Attribute_StringVal); ok {
|
|
return x.StringVal
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Attribute) GetBoolVal() bool {
|
|
if x, ok := m.GetValue().(*Attribute_BoolVal); ok {
|
|
return x.BoolVal
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *Attribute) GetUnit() string {
|
|
if m != nil {
|
|
return m.Unit
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
func (*Attribute) 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 _Attribute_OneofMarshaler, _Attribute_OneofUnmarshaler, _Attribute_OneofSizer, []interface{}{
|
|
(*Attribute_FloatVal)(nil),
|
|
(*Attribute_IntVal)(nil),
|
|
(*Attribute_StringVal)(nil),
|
|
(*Attribute_BoolVal)(nil),
|
|
}
|
|
}
|
|
|
|
func _Attribute_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*Attribute)
|
|
// value
|
|
switch x := m.Value.(type) {
|
|
case *Attribute_FloatVal:
|
|
b.EncodeVarint(1<<3 | proto.WireFixed64)
|
|
b.EncodeFixed64(math.Float64bits(x.FloatVal))
|
|
case *Attribute_IntVal:
|
|
b.EncodeVarint(2<<3 | proto.WireVarint)
|
|
b.EncodeVarint(uint64(x.IntVal))
|
|
case *Attribute_StringVal:
|
|
b.EncodeVarint(3<<3 | proto.WireBytes)
|
|
b.EncodeStringBytes(x.StringVal)
|
|
case *Attribute_BoolVal:
|
|
t := uint64(0)
|
|
if x.BoolVal {
|
|
t = 1
|
|
}
|
|
b.EncodeVarint(4<<3 | proto.WireVarint)
|
|
b.EncodeVarint(t)
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("Attribute.Value has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _Attribute_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*Attribute)
|
|
switch tag {
|
|
case 1: // value.float_val
|
|
if wire != proto.WireFixed64 {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeFixed64()
|
|
m.Value = &Attribute_FloatVal{math.Float64frombits(x)}
|
|
return true, err
|
|
case 2: // value.int_val
|
|
if wire != proto.WireVarint {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeVarint()
|
|
m.Value = &Attribute_IntVal{int64(x)}
|
|
return true, err
|
|
case 3: // value.string_val
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeStringBytes()
|
|
m.Value = &Attribute_StringVal{x}
|
|
return true, err
|
|
case 4: // value.bool_val
|
|
if wire != proto.WireVarint {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
x, err := b.DecodeVarint()
|
|
m.Value = &Attribute_BoolVal{x != 0}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _Attribute_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*Attribute)
|
|
// value
|
|
switch x := m.Value.(type) {
|
|
case *Attribute_FloatVal:
|
|
n += 1 // tag and wire
|
|
n += 8
|
|
case *Attribute_IntVal:
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(x.IntVal))
|
|
case *Attribute_StringVal:
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(len(x.StringVal)))
|
|
n += len(x.StringVal)
|
|
case *Attribute_BoolVal:
|
|
n += 1 // tag and wire
|
|
n += 1
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Attribute)(nil), "hashicorp.nomad.plugins.shared.structs.Attribute")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("attribute.proto", fileDescriptor_attribute_bfac9d16cf08e8f5) }
|
|
|
|
var fileDescriptor_attribute_bfac9d16cf08e8f5 = []byte{
|
|
// 209 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0xcf, 0xb1, 0x4e, 0xc3, 0x30,
|
|
0x10, 0x06, 0xe0, 0x98, 0x36, 0x4d, 0x7c, 0x0b, 0x92, 0xa7, 0x22, 0x84, 0xb0, 0x18, 0x90, 0x27,
|
|
0x2f, 0x3c, 0x01, 0x9d, 0x3c, 0x7b, 0x60, 0x60, 0x41, 0x97, 0x36, 0x34, 0x96, 0x8c, 0x1d, 0xd9,
|
|
0xe7, 0x3e, 0x0f, 0x8f, 0x8a, 0xec, 0x88, 0xe9, 0x4e, 0xff, 0x77, 0xff, 0x70, 0x70, 0x8f, 0x44,
|
|
0xc9, 0x4d, 0x85, 0x66, 0xbd, 0xa6, 0x48, 0x51, 0xbc, 0x2e, 0x98, 0x17, 0x77, 0x8e, 0x69, 0xd5,
|
|
0x21, 0xfe, 0xe0, 0x45, 0xaf, 0xbe, 0x5c, 0x5d, 0xc8, 0x3a, 0x2f, 0x98, 0xe6, 0x8b, 0xce, 0x94,
|
|
0xca, 0x99, 0xf2, 0xcb, 0x2f, 0x03, 0xfe, 0xfe, 0xdf, 0x15, 0x4f, 0xc0, 0xbf, 0x7d, 0x44, 0xfa,
|
|
0xba, 0xa1, 0x3f, 0x32, 0xc9, 0x14, 0x33, 0x9d, 0x1d, 0x5b, 0xf4, 0x81, 0x5e, 0x3c, 0xc0, 0xe0,
|
|
0xc2, 0x86, 0x77, 0x92, 0xa9, 0x9d, 0xe9, 0xec, 0xc1, 0x85, 0x46, 0xcf, 0x00, 0x99, 0x92, 0x0b,
|
|
0xd7, 0xa6, 0x3b, 0xc9, 0x14, 0x37, 0x9d, 0xe5, 0x5b, 0x56, 0x0f, 0x1e, 0x61, 0x9c, 0x62, 0xf4,
|
|
0x8d, 0xf7, 0x92, 0xa9, 0xd1, 0x74, 0x76, 0xa8, 0x49, 0x45, 0x01, 0xfb, 0x12, 0x1c, 0x1d, 0xfb,
|
|
0xda, 0xb3, 0x6d, 0x3f, 0x0d, 0xd0, 0xdf, 0xd0, 0x97, 0xf9, 0x34, 0x7c, 0xf6, 0xed, 0xa7, 0xe9,
|
|
0xd0, 0xc6, 0xdb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0x18, 0x15, 0x15, 0xed, 0x00, 0x00,
|
|
0x00,
|
|
}
|