// MarshalBinary encodes the object to a binary format. func (s *Series) MarshalBinary() ([]byte, error) { var pb internal.Series pb.Key = &s.Key for k, v := range s.Tags { key := k value := v pb.Tags = append(pb.Tags, &internal.Tag{Key: &key, Value: &value}) } return proto.Marshal(&pb) }