Skip to content
Snippets Groups Projects
Commit 0a927de3 authored by ko_oler's avatar ko_oler
Browse files

добавлен метод ToMap для Entry

parent 7dfb595a
No related merge requests found
......@@ -4,6 +4,7 @@ import (
"time"
pb "git.perx.ru/perxis/perxis-go/proto/log"
"github.com/mitchellh/mapstructure"
"google.golang.org/protobuf/types/known/timestamppb"
)
......@@ -81,3 +82,9 @@ func EntryFromPB(request *pb.LogEntry) *Entry {
Tags: request.Tags,
}
}
func (e *Entry) ToMap() map[string]string {
res := make(map[string]string)
mapstructure.Decode(e, &res)
return res
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment