From 0a927de3407ea398f469bc5c3fe220a95c045f65 Mon Sep 17 00:00:00 2001
From: ko_oler <kooler89@gmail.com>
Date: Mon, 29 Jan 2024 12:40:10 +0300
Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?=
 =?UTF-8?q?=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20ToMap=20=D0=B4=D0=BB?=
 =?UTF-8?q?=D1=8F=20Entry?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pkg/log/log.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pkg/log/log.go b/pkg/log/log.go
index 962a0ee5..bb34948e 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -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
+}
-- 
GitLab