// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: allocator/allocator.proto /* Package allocator is a generated protocol buffer package. It is generated from these files: allocator/allocator.proto It has these top-level messages: InverseOfferStatus */ package allocator import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import mesos "github.com/mesos/mesos-go/api/v1/lib" import _ "github.com/gogo/protobuf/gogoproto" import strconv "strconv" import strings "strings" import reflect "reflect" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" import io "io" // 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package type InverseOfferStatus_Status int32 const ( // We have not received a response yet. This is the default state before // receiving a response. InverseOfferStatus_UNKNOWN InverseOfferStatus_Status = 1 // The framework is ok with the inverse offer. This means it will not // violate any SLAs and will attempt to evacuate any tasks running on the // agent. If the tasks are not evacuated by the framework, the operator can // manually shut down the slave knowing that the framework will not have // violated its SLAs. InverseOfferStatus_ACCEPT InverseOfferStatus_Status = 2 // The framework wants to block the maintenance operation from happening. An // example would be that it cannot meet its SLA by losing resources. InverseOfferStatus_DECLINE InverseOfferStatus_Status = 3 ) var InverseOfferStatus_Status_name = map[int32]string{ 1: "UNKNOWN", 2: "ACCEPT", 3: "DECLINE", } var InverseOfferStatus_Status_value = map[string]int32{ "UNKNOWN": 1, "ACCEPT": 2, "DECLINE": 3, } func (x InverseOfferStatus_Status) Enum() *InverseOfferStatus_Status { p := new(InverseOfferStatus_Status) *p = x return p } func (x InverseOfferStatus_Status) MarshalJSON() ([]byte, error) { return proto.MarshalJSONEnum(InverseOfferStatus_Status_name, int32(x)) } func (x *InverseOfferStatus_Status) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(InverseOfferStatus_Status_value, data, "InverseOfferStatus_Status") if err != nil { return err } *x = InverseOfferStatus_Status(value) return nil } func (InverseOfferStatus_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorAllocator, []int{0, 0} } // * // Describes the status of an inverse offer. // // This is a protobuf so as to be able to share the status to inverse offers // through endpoints such as the maintenance status endpoint. type InverseOfferStatus struct { Status *InverseOfferStatus_Status `protobuf:"varint,1,req,name=status,enum=mesos.allocator.InverseOfferStatus_Status" json:"status,omitempty"` FrameworkID mesos.FrameworkID `protobuf:"bytes,2,req,name=framework_id,json=frameworkId" json:"framework_id"` // Time, since the epoch, when this status was last updated. Timestamp mesos.TimeInfo `protobuf:"bytes,3,req,name=timestamp" json:"timestamp"` } func (m *InverseOfferStatus) Reset() { *m = InverseOfferStatus{} } func (*InverseOfferStatus) ProtoMessage() {} func (*InverseOfferStatus) Descriptor() ([]byte, []int) { return fileDescriptorAllocator, []int{0} } func (m *InverseOfferStatus) GetStatus() InverseOfferStatus_Status { if m != nil && m.Status != nil { return *m.Status } return InverseOfferStatus_UNKNOWN } func (m *InverseOfferStatus) GetFrameworkID() mesos.FrameworkID { if m != nil { return m.FrameworkID } return mesos.FrameworkID{} } func (m *InverseOfferStatus) GetTimestamp() mesos.TimeInfo { if m != nil { return m.Timestamp } return mesos.TimeInfo{} } func init() { proto.RegisterType((*InverseOfferStatus)(nil), "mesos.allocator.InverseOfferStatus") proto.RegisterEnum("mesos.allocator.InverseOfferStatus_Status", InverseOfferStatus_Status_name, InverseOfferStatus_Status_value) } func (x InverseOfferStatus_Status) String() string { s, ok := InverseOfferStatus_Status_name[int32(x)] if ok { return s } return strconv.Itoa(int(x)) } func (this *InverseOfferStatus) VerboseEqual(that interface{}) error { if that == nil { if this == nil { return nil } return fmt.Errorf("that == nil && this != nil") } that1, ok := that.(*InverseOfferStatus) if !ok { that2, ok := that.(InverseOfferStatus) if ok { that1 = &that2 } else { return fmt.Errorf("that is not of type *InverseOfferStatus") } } if that1 == nil { if this == nil { return nil } return fmt.Errorf("that is type *InverseOfferStatus but is nil && this != nil") } else if this == nil { return fmt.Errorf("that is type *InverseOfferStatus but is not nil && this == nil") } if this.Status != nil && that1.Status != nil { if *this.Status != *that1.Status { return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) } } else if this.Status != nil { return fmt.Errorf("this.Status == nil && that.Status != nil") } else if that1.Status != nil { return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) } if !this.FrameworkID.Equal(&that1.FrameworkID) { return fmt.Errorf("FrameworkID this(%v) Not Equal that(%v)", this.FrameworkID, that1.FrameworkID) } if !this.Timestamp.Equal(&that1.Timestamp) { return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) } return nil } func (this *InverseOfferStatus) Equal(that interface{}) bool { if that == nil { if this == nil { return true } return false } that1, ok := that.(*InverseOfferStatus) if !ok { that2, ok := that.(InverseOfferStatus) if ok { that1 = &that2 } else { return false } } if that1 == nil { if this == nil { return true } return false } else if this == nil { return false } if this.Status != nil && that1.Status != nil { if *this.Status != *that1.Status { return false } } else if this.Status != nil { return false } else if that1.Status != nil { return false } if !this.FrameworkID.Equal(&that1.FrameworkID) { return false } if !this.Timestamp.Equal(&that1.Timestamp) { return false } return true } func (this *InverseOfferStatus) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&allocator.InverseOfferStatus{") if this.Status != nil { s = append(s, "Status: "+valueToGoStringAllocator(this.Status, "InverseOfferStatus_Status")+",\n") } s = append(s, "FrameworkID: "+strings.Replace(this.FrameworkID.GoString(), `&`, ``, 1)+",\n") s = append(s, "Timestamp: "+strings.Replace(this.Timestamp.GoString(), `&`, ``, 1)+",\n") s = append(s, "}") return strings.Join(s, "") } func valueToGoStringAllocator(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } func (m *InverseOfferStatus) Marshal() (dAtA []byte, err error) { size := m.ProtoSize() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *InverseOfferStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Status == nil { return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") } else { dAtA[i] = 0x8 i++ i = encodeVarintAllocator(dAtA, i, uint64(*m.Status)) } dAtA[i] = 0x12 i++ i = encodeVarintAllocator(dAtA, i, uint64(m.FrameworkID.ProtoSize())) n1, err := m.FrameworkID.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 dAtA[i] = 0x1a i++ i = encodeVarintAllocator(dAtA, i, uint64(m.Timestamp.ProtoSize())) n2, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 return i, nil } func encodeFixed64Allocator(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) dAtA[offset+4] = uint8(v >> 32) dAtA[offset+5] = uint8(v >> 40) dAtA[offset+6] = uint8(v >> 48) dAtA[offset+7] = uint8(v >> 56) return offset + 8 } func encodeFixed32Allocator(dAtA []byte, offset int, v uint32) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) return offset + 4 } func encodeVarintAllocator(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func NewPopulatedInverseOfferStatus(r randyAllocator, easy bool) *InverseOfferStatus { this := &InverseOfferStatus{} v1 := InverseOfferStatus_Status([]int32{1, 2, 3}[r.Intn(3)]) this.Status = &v1 v2 := mesos.NewPopulatedFrameworkID(r, easy) this.FrameworkID = *v2 v3 := mesos.NewPopulatedTimeInfo(r, easy) this.Timestamp = *v3 if !easy && r.Intn(10) != 0 { } return this } type randyAllocator interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneAllocator(r randyAllocator) rune { ru := r.Intn(62) if ru < 10 { return rune(ru + 48) } else if ru < 36 { return rune(ru + 55) } return rune(ru + 61) } func randStringAllocator(r randyAllocator) string { v4 := r.Intn(100) tmps := make([]rune, v4) for i := 0; i < v4; i++ { tmps[i] = randUTF8RuneAllocator(r) } return string(tmps) } func randUnrecognizedAllocator(r randyAllocator, maxFieldNumber int) (dAtA []byte) { l := r.Intn(5) for i := 0; i < l; i++ { wire := r.Intn(4) if wire == 3 { wire = 5 } fieldNumber := maxFieldNumber + r.Intn(100) dAtA = randFieldAllocator(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldAllocator(dAtA []byte, r randyAllocator, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateAllocator(dAtA, uint64(key)) v5 := r.Int63() if r.Intn(2) == 0 { v5 *= -1 } dAtA = encodeVarintPopulateAllocator(dAtA, uint64(v5)) case 1: dAtA = encodeVarintPopulateAllocator(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) case 2: dAtA = encodeVarintPopulateAllocator(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateAllocator(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateAllocator(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } return dAtA } func encodeVarintPopulateAllocator(dAtA []byte, v uint64) []byte { for v >= 1<<7 { dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) v >>= 7 } dAtA = append(dAtA, uint8(v)) return dAtA } func (m *InverseOfferStatus) ProtoSize() (n int) { var l int _ = l if m.Status != nil { n += 1 + sovAllocator(uint64(*m.Status)) } l = m.FrameworkID.ProtoSize() n += 1 + l + sovAllocator(uint64(l)) l = m.Timestamp.ProtoSize() n += 1 + l + sovAllocator(uint64(l)) return n } func sovAllocator(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozAllocator(x uint64) (n int) { return sovAllocator(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *InverseOfferStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&InverseOfferStatus{`, `Status:` + valueToStringAllocator(this.Status) + `,`, `FrameworkID:` + strings.Replace(strings.Replace(this.FrameworkID.String(), "FrameworkID", "mesos.FrameworkID", 1), `&`, ``, 1) + `,`, `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "TimeInfo", "mesos.TimeInfo", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } func valueToStringAllocator(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *InverseOfferStatus) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAllocator } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: InverseOfferStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: InverseOfferStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var v InverseOfferStatus_Status for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAllocator } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (InverseOfferStatus_Status(b) & 0x7F) << shift if b < 0x80 { break } } m.Status = &v hasFields[0] |= uint64(0x00000001) case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FrameworkID", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAllocator } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthAllocator } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.FrameworkID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex hasFields[0] |= uint64(0x00000002) case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAllocator } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthAllocator } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex hasFields[0] |= uint64(0x00000004) default: iNdEx = preIndex skippy, err := skipAllocator(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthAllocator } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if hasFields[0]&uint64(0x00000001) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") } if hasFields[0]&uint64(0x00000002) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") } if hasFields[0]&uint64(0x00000004) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipAllocator(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAllocator } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAllocator } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAllocator } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthAllocator } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAllocator } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipAllocator(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthAllocator = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAllocator = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("allocator/allocator.proto", fileDescriptorAllocator) } var fileDescriptorAllocator = []byte{ // 361 bytes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