Compare commits

..

8 Commits

Author SHA1 Message Date
Piotr Biernat
35e4bc8ac2 module update 2024-12-06 14:27:51 +01:00
Piotr Biernat
68e6e3ef55 module update 2024-12-06 14:15:02 +01:00
Piotr Biernat
feff40bf55 update 2024-12-06 14:05:06 +01:00
eb1e8a9cb0 consul registration update 2024-07-21 21:11:34 +02:00
2c797164e0 consul registration update 2024-07-21 21:00:49 +02:00
7725e5dd65 debug fix 2024-07-20 20:12:29 +02:00
07c0cd6f2e debug fix 2024-07-20 19:59:12 +02:00
d29bd0810b debug fix 2024-07-20 19:55:33 +02:00
3 changed files with 14 additions and 12 deletions

View File

@@ -6,7 +6,7 @@ import (
"strconv"
"time"
"git.pbiernat.io/egommerce/go-api-pkg/config"
"git.ego.cloudns.be/egommerce/go-api-pkg/config"
consul "github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/connect"
)
@@ -25,8 +25,8 @@ type Service struct {
connect *connect.Service
kv *consul.KV
hcTicker *time.Ticker
ttlTicker *time.Ticker
// hcTicker *time.Ticker
// ttlTicker *time.Ticker
}
var ErrServiceUnavailable = fmt.Errorf("Service is unavailable")
@@ -85,11 +85,13 @@ func (s *Service) Register() error {
Address: s.Address,
Port: s.port,
Tags: s.getTags(),
// Connect: &consul.AgentServiceConnect{Native: true},
Connect: &consul.AgentServiceConnect{Native: true},
// Proxy: &consul.AgentServiceConnectProxyConfig{
// DestinationServiceName: s.Name,
// },
Check: &consul.AgentServiceCheck{
// Interval: "5s",
// Timeout: "1s",
TTL: s.ttl.String(),
Status: "passing",
DeregisterCriticalServiceAfter: "10s",
@@ -142,11 +144,10 @@ func (s *Service) Connect() (*connect.Service, error) {
// })
svc, err := connect.NewService(s.Name, s.client)
s.connect = svc
cnf := svc.ServerTLSConfig()
fmt.Printf("CONNECT SERVER:: %s CONFIG:: %v\n", s.Name, cnf)
for k, c := range cnf.Certificates {
fmt.Printf("CONNECT CERT %d: %v", k, c)
}
fmt.Printf("CONNECT SERVER:: %s CERTS:: %v\n", s.Name, svc.ServerTLSConfig())
// for k, c := range cnf.Certificates {
// fmt.Printf("CONNECT CERT %d: %v", k, c)
// }
return svc, err
}

4
go.mod
View File

@@ -1,9 +1,8 @@
module git.pbiernat.io/egommerce/go-api-pkg
module git.ego.cloudns.be/egommerce/go-api-pkg
go 1.18
require (
git.pbiernat.io/egommerce/api-entities v0.2.3
github.com/fluent/fluent-logger-golang v1.9.0
github.com/go-redis/redis/v8 v8.11.5
github.com/hashicorp/consul v1.16.0
@@ -12,6 +11,7 @@ require (
)
require (
git.ego.cloudns.be/egommerce/api-entities v0.2.5 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/armon/go-radix v1.0.0 // indirect

3
go.sum
View File

@@ -35,7 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.pbiernat.io/egommerce/api-entities v0.2.3/go.mod h1:INXAG5x4+i+vNwg1NpfPHiDW8nY1kn1K7pgLOtX+/I0=
git.ego.cloudns.be/egommerce/api-entities v0.2.5 h1:A7KQNXLB3l0ck7/R6MzyU33H490feZOlEodnU6bC+DA=
git.ego.cloudns.be/egommerce/api-entities v0.2.5/go.mod h1:xr9mW9DKq+oNO4cMqtqY3VCAVCn6iImw4MqNj51dTFc=
github.com/Azure/azure-sdk-for-go v44.0.0+incompatible h1:e82Yv2HNpS0kuyeCrV29OPKvEiqfs2/uJHic3/3iKdg=
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM=