mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-04 11:33:25 +00:00
Checkpoint.
This commit is contained in:
parent
41068c2e84
commit
f39b9c3c8e
7 changed files with 284 additions and 110 deletions
|
@ -21,8 +21,15 @@ type ProtocolBufferEncoder struct {
|
|||
message proto.Message
|
||||
}
|
||||
|
||||
func (p *ProtocolBufferEncoder) Encode() ([]byte, error) {
|
||||
return proto.Marshal(p.message)
|
||||
func (p *ProtocolBufferEncoder) Encode() (raw []byte, err error) {
|
||||
raw, err = proto.Marshal(p.message)
|
||||
|
||||
// XXX: Adjust legacy users of this to not check for error.
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func NewProtocolBufferEncoder(message proto.Message) *ProtocolBufferEncoder {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue