From 2dafa69b93c043fd7754d3b81b194a17a94edb53 Mon Sep 17 00:00:00 2001 From: IliaDenisov Date: Tue, 10 Mar 2026 17:01:47 +0200 Subject: [PATCH] connector interface --- client/connector.go | 9 +++++++++ client/connector/http/http.go | 9 +++++++++ pkg/model/report/report.go | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 client/connector.go create mode 100644 client/connector/http/http.go diff --git a/client/connector.go b/client/connector.go new file mode 100644 index 0000000..4874bad --- /dev/null +++ b/client/connector.go @@ -0,0 +1,9 @@ +package client + +import ( + "galaxy/model/report" +) + +type Connector interface { + Turn(uint, func(report.Report, error)) error +} diff --git a/client/connector/http/http.go b/client/connector/http/http.go new file mode 100644 index 0000000..e7d682a --- /dev/null +++ b/client/connector/http/http.go @@ -0,0 +1,9 @@ +package http + +type httpConnector struct { +} + +func NewHttpConnector() *httpConnector { + h := &httpConnector{} + return h +} diff --git a/pkg/model/report/report.go b/pkg/model/report/report.go index 1a0d98e..bcc691e 100644 --- a/pkg/model/report/report.go +++ b/pkg/model/report/report.go @@ -3,7 +3,7 @@ package report import ( "encoding/json" - n "galaxy/util" + u "galaxy/util" "github.com/google/uuid" ) @@ -11,7 +11,7 @@ import ( type Float float64 func F(v float64) Float { - return Float(n.Fixed3(v)) + return Float(u.Fixed3(v)) } type Report struct {