Example #1
0
func (m *CounterEvent) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Name == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintMetric(data, i, uint64(len(*m.Name)))
		i += copy(data[i:], *m.Name)
	}
	if m.Delta == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("delta")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintMetric(data, i, uint64(*m.Delta))
	}
	if m.Total != nil {
		data[i] = 0x18
		i++
		i = encodeVarintMetric(data, i, uint64(*m.Total))
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
func (m *Entry) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Name == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintState(data, i, uint64(len(*m.Name)))
		i += copy(data[i:], *m.Name)
	}
	if m.Uuid == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid")
	} else {
		data[i] = 0x12
		i++
		i = encodeVarintState(data, i, uint64(len(m.Uuid)))
		i += copy(data[i:], m.Uuid)
	}
	if m.Value == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value")
	} else {
		data[i] = 0x1a
		i++
		i = encodeVarintState(data, i, uint64(len(m.Value)))
		i += copy(data[i:], m.Value)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #3
0
func (m *ValueMetric) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Name == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintMetric(data, i, uint64(len(*m.Name)))
		i += copy(data[i:], *m.Name)
	}
	if m.Value == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value")
	} else {
		data[i] = 0x11
		i++
		i = encodeFixed64Metric(data, i, uint64(math.Float64bits(*m.Value)))
	}
	if m.Unit == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("unit")
	} else {
		data[i] = 0x1a
		i++
		i = encodeVarintMetric(data, i, uint64(len(*m.Unit)))
		i += copy(data[i:], *m.Unit)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #4
0
func (m *ServerInfoResponse) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Server == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("server")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(len(*m.Server)))
		i += copy(data[i:], *m.Server)
	}
	if m.Info == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("info")
	} else {
		data[i] = 0x12
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(m.Info.Size()))
		n2, err := m.Info.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n2
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #5
0
func (m *Error) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Source == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("source")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintError(data, i, uint64(len(*m.Source)))
		i += copy(data[i:], *m.Source)
	}
	if m.Code == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("code")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintError(data, i, uint64(*m.Code))
	}
	if m.Message == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message")
	} else {
		data[i] = 0x1a
		i++
		i = encodeVarintError(data, i, uint64(len(*m.Message)))
		i += copy(data[i:], *m.Message)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #6
0
func (m *GlobMatch) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Path == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("path")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(len(*m.Path)))
		i += copy(data[i:], *m.Path)
	}
	if m.IsLeaf == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("isLeaf")
	} else {
		data[i] = 0x10
		i++
		if *m.IsLeaf {
			data[i] = 1
		} else {
			data[i] = 0
		}
		i++
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #7
0
func (m *ContainerMetric) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.ApplicationId == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("applicationId")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintMetric(data, i, uint64(len(*m.ApplicationId)))
		i += copy(data[i:], *m.ApplicationId)
	}
	if m.InstanceIndex == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("instanceIndex")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintMetric(data, i, uint64(*m.InstanceIndex))
	}
	if m.CpuPercentage == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("cpuPercentage")
	} else {
		data[i] = 0x19
		i++
		i = encodeFixed64Metric(data, i, uint64(math.Float64bits(float64(*m.CpuPercentage))))
	}
	if m.MemoryBytes == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("memoryBytes")
	} else {
		data[i] = 0x20
		i++
		i = encodeVarintMetric(data, i, uint64(*m.MemoryBytes))
	}
	if m.DiskBytes == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("diskBytes")
	} else {
		data[i] = 0x28
		i++
		i = encodeVarintMetric(data, i, uint64(*m.DiskBytes))
	}
	if m.MemoryBytesQuota != nil {
		data[i] = 0x30
		i++
		i = encodeVarintMetric(data, i, uint64(*m.MemoryBytesQuota))
	}
	if m.DiskBytesQuota != nil {
		data[i] = 0x38
		i++
		i = encodeVarintMetric(data, i, uint64(*m.DiskBytesQuota))
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #8
0
func (m *ControlMessage) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Origin == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("origin")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintControlmessage(data, i, uint64(len(*m.Origin)))
		i += copy(data[i:], *m.Origin)
	}
	if m.Identifier == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("identifier")
	} else {
		data[i] = 0x12
		i++
		i = encodeVarintControlmessage(data, i, uint64(m.Identifier.Size()))
		n1, err := m.Identifier.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if m.Timestamp == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp")
	} else {
		data[i] = 0x18
		i++
		i = encodeVarintControlmessage(data, i, uint64(*m.Timestamp))
	}
	if m.ControlType == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("controlType")
	} else {
		data[i] = 0x20
		i++
		i = encodeVarintControlmessage(data, i, uint64(*m.ControlType))
	}
	if m.HeartbeatRequest != nil {
		data[i] = 0x2a
		i++
		i = encodeVarintControlmessage(data, i, uint64(m.HeartbeatRequest.Size()))
		n2, err := m.HeartbeatRequest.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n2
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #9
0
func (m *InfoResponse) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Name == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(len(*m.Name)))
		i += copy(data[i:], *m.Name)
	}
	if m.AggregationMethod == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("aggregationMethod")
	} else {
		data[i] = 0x12
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(len(*m.AggregationMethod)))
		i += copy(data[i:], *m.AggregationMethod)
	}
	if m.MaxRetention == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("maxRetention")
	} else {
		data[i] = 0x18
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(*m.MaxRetention))
	}
	if m.XFilesFactor == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("xFilesFactor")
	} else {
		data[i] = 0x25
		i++
		i = encodeFixed32Carbonzipper(data, i, uint32(math.Float32bits(*m.XFilesFactor)))
	}
	if len(m.Retentions) > 0 {
		for _, msg := range m.Retentions {
			data[i] = 0x2a
			i++
			i = encodeVarintCarbonzipper(data, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(data[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #10
0
func (m *LogMessage) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Message == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintLog(data, i, uint64(len(m.Message)))
		i += copy(data[i:], m.Message)
	}
	if m.MessageType == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message_type")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintLog(data, i, uint64(*m.MessageType))
	}
	if m.Timestamp == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp")
	} else {
		data[i] = 0x18
		i++
		i = encodeVarintLog(data, i, uint64(*m.Timestamp))
	}
	if m.AppId != nil {
		data[i] = 0x22
		i++
		i = encodeVarintLog(data, i, uint64(len(*m.AppId)))
		i += copy(data[i:], *m.AppId)
	}
	if m.SourceType != nil {
		data[i] = 0x2a
		i++
		i = encodeVarintLog(data, i, uint64(len(*m.SourceType)))
		i += copy(data[i:], *m.SourceType)
	}
	if m.SourceInstance != nil {
		data[i] = 0x32
		i++
		i = encodeVarintLog(data, i, uint64(len(*m.SourceInstance)))
		i += copy(data[i:], *m.SourceInstance)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #11
0
func (m *GlobResponse) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Name == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(len(*m.Name)))
		i += copy(data[i:], *m.Name)
	}
	if len(m.Matches) > 0 {
		for _, msg := range m.Matches {
			data[i] = 0x12
			i++
			i = encodeVarintCarbonzipper(data, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(data[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #12
0
File: api.pb.go Project: jackdoe/no
func (m *Message) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Header == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("header")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintApi(data, i, uint64(m.Header.Size()))
		n1, err := m.Header.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if len(m.Frames) > 0 {
		for _, msg := range m.Frames {
			data[i] = 0x12
			i++
			i = encodeVarintApi(data, i, uint64(msg.Size()))
			n, err := msg.MarshalTo(data[i:])
			if err != nil {
				return 0, err
			}
			i += n
		}
	}
	return i, nil
}
Example #13
0
File: data.pb.go Project: mrares/no
func (m *Header) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.TimeId == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("time_id")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintData(data, i, uint64(*m.TimeId))
	}
	if m.Offset == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("offset")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintData(data, i, uint64(*m.Offset))
	}
	if m.NodeId == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("node_id")
	} else {
		data[i] = 0x18
		i++
		i = encodeVarintData(data, i, uint64(*m.NodeId))
	}
	if len(m.Tags) > 0 {
		for _, s := range m.Tags {
			data[i] = 0x22
			i++
			l = len(s)
			for l >= 1<<7 {
				data[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			data[i] = uint8(l)
			i++
			i += copy(data[i:], s)
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #14
0
func (m *InternalAuthenticationResult) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Success == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("success")
	} else {
		data[i] = 0x8
		i++
		if *m.Success {
			data[i] = 1
		} else {
			data[i] = 0
		}
		i++
	}
	if m.Completed == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("completed")
	} else {
		data[i] = 0x10
		i++
		if *m.Completed {
			data[i] = 1
		} else {
			data[i] = 0
		}
		i++
	}
	if m.Pid == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pid")
	} else {
		data[i] = 0x1a
		i++
		i = encodeVarintInternal(data, i, uint64(len(*m.Pid)))
		i += copy(data[i:], *m.Pid)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #15
0
func (m *NodeInfo) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.PubKey == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pubKey")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintTest(data, i, uint64(m.PubKey.Size()))
		n3, err := m.PubKey.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n3
	}
	data[i] = 0x12
	i++
	i = encodeVarintTest(data, i, uint64(len(m.Moniker)))
	i += copy(data[i:], m.Moniker)
	data[i] = 0x1a
	i++
	i = encodeVarintTest(data, i, uint64(len(m.Network)))
	i += copy(data[i:], m.Network)
	data[i] = 0x22
	i++
	i = encodeVarintTest(data, i, uint64(len(m.RemoteAddr)))
	i += copy(data[i:], m.RemoteAddr)
	data[i] = 0x2a
	i++
	i = encodeVarintTest(data, i, uint64(len(m.ListenAddr)))
	i += copy(data[i:], m.ListenAddr)
	data[i] = 0x32
	i++
	i = encodeVarintTest(data, i, uint64(len(m.Version)))
	i += copy(data[i:], m.Version)
	if len(m.Other) > 0 {
		for _, s := range m.Other {
			data[i] = 0x3a
			i++
			l = len(s)
			for l >= 1<<7 {
				data[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			data[i] = uint8(l)
			i++
			i += copy(data[i:], s)
		}
	}
	return i, nil
}
func (m *Heartbeat) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.SentCount == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("sentCount")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintHeartbeat(data, i, uint64(*m.SentCount))
	}
	if m.ReceivedCount == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("receivedCount")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintHeartbeat(data, i, uint64(*m.ReceivedCount))
	}
	if m.ErrorCount == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("errorCount")
	} else {
		data[i] = 0x18
		i++
		i = encodeVarintHeartbeat(data, i, uint64(*m.ErrorCount))
	}
	if m.ControlMessageIdentifier != nil {
		data[i] = 0x22
		i++
		i = encodeVarintHeartbeat(data, i, uint64(m.ControlMessageIdentifier.Size()))
		n1, err := m.ControlMessageIdentifier.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #17
0
func (m *LogEntry) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Index == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Index")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintLogEntry(data, i, uint64(*m.Index))
	}
	if m.Term == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Term")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintLogEntry(data, i, uint64(*m.Term))
	}
	if m.CommandName == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("CommandName")
	} else {
		data[i] = 0x1a
		i++
		i = encodeVarintLogEntry(data, i, uint64(len(*m.CommandName)))
		i += copy(data[i:], *m.CommandName)
	}
	if m.Command != nil {
		data[i] = 0x22
		i++
		i = encodeVarintLogEntry(data, i, uint64(len(m.Command)))
		i += copy(data[i:], m.Command)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #18
0
func (m *UUID) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Low == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("low")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintUuid(data, i, uint64(*m.Low))
	}
	if m.High == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("high")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintUuid(data, i, uint64(*m.High))
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #19
0
func (m *Retention) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.SecondsPerPoint == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("secondsPerPoint")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(*m.SecondsPerPoint))
	}
	if m.NumberOfPoints == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("numberOfPoints")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintCarbonzipper(data, i, uint64(*m.NumberOfPoints))
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
func (m *Operation) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Type == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintState(data, i, uint64(*m.Type))
	}
	if m.Snapshot != nil {
		data[i] = 0x12
		i++
		i = encodeVarintState(data, i, uint64(m.Snapshot.Size()))
		n1, err := m.Snapshot.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if m.Expunge != nil {
		data[i] = 0x1a
		i++
		i = encodeVarintState(data, i, uint64(m.Expunge.Size()))
		n2, err := m.Expunge.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n2
	}
	if m.Diff != nil {
		data[i] = 0x22
		i++
		i = encodeVarintState(data, i, uint64(m.Diff.Size()))
		n3, err := m.Diff.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n3
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
func (m *AuthenticationStepMessage) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Data == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintAuthentication(data, i, uint64(len(m.Data)))
		i += copy(data[i:], m.Data)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #22
0
func (m *Operation_Expunge) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Name == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintState(data, i, uint64(len(*m.Name)))
		i += copy(data[i:], *m.Name)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #23
0
func (m *ResultStatus) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.NodeInfo != nil {
		data[i] = 0xa
		i++
		i = encodeVarintTest(data, i, uint64(m.NodeInfo.Size()))
		n1, err := m.NodeInfo.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n1
	}
	if m.PubKey == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pubKey")
	} else {
		data[i] = 0x12
		i++
		i = encodeVarintTest(data, i, uint64(m.PubKey.Size()))
		n2, err := m.PubKey.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n2
	}
	if m.LatestBlockHash != nil {
		data[i] = 0x1a
		i++
		i = encodeVarintTest(data, i, uint64(len(m.LatestBlockHash)))
		i += copy(data[i:], m.LatestBlockHash)
	}
	data[i] = 0x20
	i++
	i = encodeVarintTest(data, i, uint64(m.LatestBlockHeight))
	data[i] = 0x28
	i++
	i = encodeVarintTest(data, i, uint64(m.LatestBlocktime))
	return i, nil
}
Example #24
0
func (m *RequiredExample) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.TheRequiredString == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("theRequiredString")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintRequiredexample(data, i, uint64(len(*m.TheRequiredString)))
		i += copy(data[i:], *m.TheRequiredString)
	}
	if m.TheOptionalString != nil {
		data[i] = 0x12
		i++
		i = encodeVarintRequiredexample(data, i, uint64(len(*m.TheOptionalString)))
		i += copy(data[i:], *m.TheOptionalString)
	}
	if len(m.TheRepeatedStrings) > 0 {
		for _, s := range m.TheRepeatedStrings {
			data[i] = 0x1a
			i++
			l = len(s)
			for l >= 1<<7 {
				data[i] = uint8(uint64(l)&0x7f | 0x80)
				l >>= 7
				i++
			}
			data[i] = uint8(l)
			i++
			i += copy(data[i:], s)
		}
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
func (m *Operation_Diff) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Entry == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintState(data, i, uint64(m.Entry.Size()))
		n5, err := m.Entry.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n5
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #26
0
func (m *Registry_Slave) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Info == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("info")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintRegistry(data, i, uint64(m.Info.Size()))
		n4, err := m.Info.MarshalTo(data[i:])
		if err != nil {
			return 0, err
		}
		i += n4
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #27
0
func (m *Header) MarshalTo(data []byte) (n int, err error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.MessageLength == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message_length")
	} else {
		data[i] = 0x8
		i++
		i = encodeVarintMessage(data, i, uint64(*m.MessageLength))
	}
	if m.HmacHashFunction != nil {
		data[i] = 0x18
		i++
		i = encodeVarintMessage(data, i, uint64(*m.HmacHashFunction))
	}
	if m.HmacSigner != nil {
		data[i] = 0x22
		i++
		i = encodeVarintMessage(data, i, uint64(len(*m.HmacSigner)))
		i += copy(data[i:], *m.HmacSigner)
	}
	if m.HmacKeyVersion != nil {
		data[i] = 0x28
		i++
		i = encodeVarintMessage(data, i, uint64(*m.HmacKeyVersion))
	}
	if m.Hmac != nil {
		data[i] = 0x32
		i++
		i = encodeVarintMessage(data, i, uint64(len(m.Hmac)))
		i += copy(data[i:], m.Hmac)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #28
0
func (m *A) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Strings != nil {
		data[i] = 0xa
		i++
		i = encodeVarintVanity(data, i, uint64(len(*m.Strings)))
		i += copy(data[i:], *m.Strings)
	}
	if m.Int == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int")
	} else {
		data[i] = 0x10
		i++
		i = encodeVarintVanity(data, i, uint64(*m.Int))
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
Example #29
0
File: data.pb.go Project: mrares/no
func (m *Payload) MarshalTo(data []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.Data == nil {
		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data")
	} else {
		data[i] = 0xa
		i++
		i = encodeVarintData(data, i, uint64(len(m.Data)))
		i += copy(data[i:], m.Data)
	}
	if m.Id != nil {
		data[i] = 0x12
		i++
		i = encodeVarintData(data, i, uint64(len(*m.Id)))
		i += copy(data[i:], *m.Id)
	}
	if m.XXX_unrecognized != nil {
		i += copy(data[i:], m.XXX_unrecognized)
	}
	return i, nil
}
func (m *HttpStart) Unmarshal(data []byte) error {
	var hasFields [1]uint64
	l := len(data)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			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)
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
			}
			var v int64
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				v |= (int64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Timestamp = &v
			hasFields[0] |= uint64(0x00000001)
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.RequestId == nil {
				m.RequestId = &UUID{}
			}
			if err := m.RequestId.Unmarshal(data[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
			hasFields[0] |= uint64(0x00000002)
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field PeerType", wireType)
			}
			var v PeerType
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				v |= (PeerType(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.PeerType = &v
			hasFields[0] |= uint64(0x00000004)
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType)
			}
			var v Method
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				v |= (Method(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Method = &v
			hasFields[0] |= uint64(0x00000008)
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(data[iNdEx:postIndex])
			m.Uri = &s
			iNdEx = postIndex
			hasFields[0] |= uint64(0x00000010)
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field RemoteAddress", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(data[iNdEx:postIndex])
			m.RemoteAddress = &s
			iNdEx = postIndex
			hasFields[0] |= uint64(0x00000020)
		case 7:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field UserAgent", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(data[iNdEx:postIndex])
			m.UserAgent = &s
			iNdEx = postIndex
			hasFields[0] |= uint64(0x00000040)
		case 8:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ParentRequestId", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ParentRequestId == nil {
				m.ParentRequestId = &UUID{}
			}
			if err := m.ParentRequestId.Unmarshal(data[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 9:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ApplicationId", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				msglen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ApplicationId == nil {
				m.ApplicationId = &UUID{}
			}
			if err := m.ApplicationId.Unmarshal(data[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 10:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field InstanceIndex", wireType)
			}
			var v int32
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				v |= (int32(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.InstanceIndex = &v
		case 11:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field InstanceId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := data[iNdEx]
				iNdEx++
				stringLen |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthHttp
			}
			postIndex := iNdEx + intStringLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			s := string(data[iNdEx:postIndex])
			m.InstanceId = &s
			iNdEx = postIndex
		default:
			var sizeOfWire int
			for {
				sizeOfWire++
				wire >>= 7
				if wire == 0 {
					break
				}
			}
			iNdEx -= sizeOfWire
			skippy, err := skipHttp(data[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthHttp
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}
	if hasFields[0]&uint64(0x00000001) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp")
	}
	if hasFields[0]&uint64(0x00000002) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("requestId")
	}
	if hasFields[0]&uint64(0x00000004) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("peerType")
	}
	if hasFields[0]&uint64(0x00000008) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("method")
	}
	if hasFields[0]&uint64(0x00000010) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("uri")
	}
	if hasFields[0]&uint64(0x00000020) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("remoteAddress")
	}
	if hasFields[0]&uint64(0x00000040) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("userAgent")
	}

	return nil
}