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

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

parent 7dfb595a
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"time" "time"
pb "git.perx.ru/perxis/perxis-go/proto/log" pb "git.perx.ru/perxis/perxis-go/proto/log"
"github.com/mitchellh/mapstructure"
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
) )
...@@ -81,3 +82,9 @@ func EntryFromPB(request *pb.LogEntry) *Entry { ...@@ -81,3 +82,9 @@ func EntryFromPB(request *pb.LogEntry) *Entry {
Tags: request.Tags, 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.
Please register or to comment