From 426d7b39e30252d4fc81035538f73baad14f8458 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Thu, 27 Jan 2022 18:18:42 +0100 Subject: [PATCH 01/37] TRAF-1451 - Provide homing-pigeon with a Pub/Sub ack service --- .github/workflows/ci.yml | 2 +- Dockerfile | 2 +- Makefile | 3 +- README.md | 3 +- docker-compose.yaml | 1 + go.mod | 1 + go.sum | 2 + pkg/ack/manager.go | 58 ++++++++++ pkg/ack/server.go | 50 ++++++++ pkg/main.go | 2 + pkg/messages/ack.go | 5 +- pkg/messages/message.go | 10 +- pkg/services/container.go | 67 ++++++++--- proto/ack.pb.go | 236 ++++++++++++++++++++++++++++++++++++++ proto/ack.proto | 24 ++++ 15 files changed, 442 insertions(+), 24 deletions(-) create mode 100644 pkg/ack/manager.go create mode 100644 pkg/ack/server.go create mode 100644 proto/ack.pb.go create mode 100644 proto/ack.proto diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ef65e3..24f17fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: test: strategy: matrix: - go-version: [1.13.x] + go-version: [1.17.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} env: diff --git a/Dockerfile b/Dockerfile index 7dbd76f..a80380f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13-buster AS build +FROM golang:1.17-buster AS build RUN apt-get update \ && apt-get install -y protobuf-compiler diff --git a/Makefile b/Makefile index f75020e..0ec55ad 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,13 @@ TAG ?= dev generate-proto: protoc -I proto/ proto/middleware.proto --go_out=plugins=grpc:proto + protoc -I proto/ proto/ack.proto --go_out=plugins=grpc:proto dep: go get -u github.com/rakyll/gotest go get -u github.com/sarulabs/dingo/dingo go get -u github.com/vektra/mockery/.../ go get -u github.com/golang/protobuf/proto - go get -u github.com/golang/protobuf/protoc-gen-go + go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.2 go get -u google.golang.org/grpc go mod download build: dep generate-proto diff --git a/README.md b/README.md index 3c747c3..a0dc7d8 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,11 @@ In order to start up correctly, it needs well defined environment variables: ##### Core | Name | Value | -| ------------------------------------ | -------------------------------------------------------------------------- | +| ------------------------------------ |----------------------------------------------------------------------------| | MESSAGE_BUFFER_LENGTH | Buffer length for internal golang channel used for messaging | | ACK_BUFFER_LENGTH | Buffer length for internal golang channel used for acks | | MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | +| ACK_SERVICE_ADDRESS | Channel to send ACK message stream. Ex: localhost:12345" | ##### Read Adapters diff --git a/docker-compose.yaml b/docker-compose.yaml index be53630..ab32e4e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,6 +26,7 @@ services: GRPC_GO_LOG_VERBOSITY_LEVEL: 99 GRPC_GO_LOG_SEVERITY_LEVEL: info MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" + #ACK_SERVICE_ADDRESS: ":8090" hp-middleware-pass: volumes: - ./sockets:/tmp diff --git a/go.mod b/go.mod index b1883e2..6b279ca 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/gobuffalo/packr v1.30.1 // indirect github.com/golang/protobuf v1.4.3 github.com/golangci/golangci-lint v1.33.0 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/rakyll/gotest v0.0.5 // indirect github.com/rogpeppe/go-internal v1.6.2 // indirect github.com/sarulabs/dingo v2.0.0+incompatible diff --git a/go.sum b/go.sum index 634baf0..6f8b900 100644 --- a/go.sum +++ b/go.sum @@ -191,6 +191,8 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gookit/color v1.3.1/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go new file mode 100644 index 0000000..c108078 --- /dev/null +++ b/pkg/ack/manager.go @@ -0,0 +1,58 @@ +package ack + +import ( + "github.com/softonic/homing-pigeon/pkg/messages" + "github.com/softonic/homing-pigeon/proto" + "google.golang.org/grpc" + "k8s.io/klog" + "net" + "sync" +) + +// @TODO Tests missing +type Manager struct { + InputChannel <-chan messages.Ack + OutputChannel chan<- messages.Ack + ServiceChannel chan messages.Ack + ServiceAddress string +} + +func (t *Manager) StartServer() { + lis, err := net.Listen("tcp", t.ServiceAddress) + if err != nil { + klog.Errorf("Failed to listen: %v", err) + } + + grpcServer := grpc.NewServer(grpc.MaxConcurrentStreams(10)) + proto.RegisterAckServiceServer(grpcServer, &Server{ + clients: make(map[string]proto.AckService_GetMessagesServer), + InputChannel: t.ServiceChannel, + mu: sync.RWMutex{}, + }) + + klog.V(1).Info("ACK-Manager listening...") + err = grpcServer.Serve(lis) + if err != nil { + klog.Error(err) + } +} + +func (t *Manager) Start() { + + if t.shouldStartAckService() { + go t.StartServer() + } + + for message := range t.InputChannel { + t.OutputChannel <- message + t.ServiceChannel <- message + } +} + +func (t *Manager) shouldStartAckService() bool { + if t.ServiceAddress == "" { + klog.V(1).Info("ACK-Manager not available") + return false + } + return true +} diff --git a/pkg/ack/server.go b/pkg/ack/server.go new file mode 100644 index 0000000..2debf94 --- /dev/null +++ b/pkg/ack/server.go @@ -0,0 +1,50 @@ +package ack + +import ( + "github.com/google/uuid" + "github.com/softonic/homing-pigeon/pkg/messages" + "github.com/softonic/homing-pigeon/proto" + "k8s.io/klog" + "sync" +) + +type Server struct { + clients map[string]proto.AckService_GetMessagesServer + InputChannel <-chan messages.Ack + mu sync.RWMutex +} + +func (s *Server) addClient(uid string, client proto.AckService_GetMessagesServer) { + s.mu.Lock() + defer s.mu.Unlock() + s.clients[uid] = client + klog.V(1).Info("New client connected") +} + +func (s *Server) getClients() []proto.AckService_GetMessagesServer { + var clients []proto.AckService_GetMessagesServer + + s.mu.RLock() + defer s.mu.RUnlock() + for _, client := range s.clients { + clients = append(clients, client) + } + return clients +} + +func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckService_GetMessagesServer) error { + uid := uuid.Must(uuid.NewRandom()).String() + + s.addClient(uid, client) + + for message := range s.InputChannel { + klog.V(1).Info("Sending ACK to clients") + for _, client := range s.getClients() { + client.Send(&proto.Message{ + Body: message.Body, + Ack: message.Ack, + }) + } + } + return nil +} diff --git a/pkg/main.go b/pkg/main.go index bf698b0..27f00d2 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -15,9 +15,11 @@ func main() { } reader := container.GetReader() middleware := container.GetMiddleware() + ackManager := container.GetAckManager() writer := container.GetWriter() go reader.Start() go middleware.Start() + go ackManager.Start() writer.Start() } diff --git a/pkg/messages/ack.go b/pkg/messages/ack.go index 32ff3cd..b0350c0 100644 --- a/pkg/messages/ack.go +++ b/pkg/messages/ack.go @@ -1,6 +1,7 @@ package messages type Ack struct { - Id interface{} - Ack bool + Id interface{} + Body []byte + Ack bool } diff --git a/pkg/messages/message.go b/pkg/messages/message.go index 28613e7..f885c3a 100644 --- a/pkg/messages/message.go +++ b/pkg/messages/message.go @@ -15,8 +15,9 @@ func (m Message) Nack() (Ack, error) { } return Ack{ - Id: m.Id, - Ack: false, + Id: m.Id, + Body: m.Body, + Ack: false, }, nil } @@ -27,8 +28,9 @@ func (m Message) Ack() (Ack, error) { } return Ack{ - Id: m.Id, - Ack: true, + Id: m.Id, + Body: m.Body, + Ack: true, }, nil } diff --git a/pkg/services/container.go b/pkg/services/container.go index 102bf68..9219840 100644 --- a/pkg/services/container.go +++ b/pkg/services/container.go @@ -4,9 +4,10 @@ import ( "bytes" "crypto/tls" "crypto/x509" - "github.com/elastic/go-elasticsearch/v7" + elasticsearch "github.com/elastic/go-elasticsearch/v7" "github.com/sarulabs/dingo" - . "github.com/softonic/homing-pigeon/pkg/helpers" + "github.com/softonic/homing-pigeon/pkg/ack" + "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/pkg/middleware" "github.com/softonic/homing-pigeon/pkg/readers" @@ -228,7 +229,7 @@ var Container = []dingo.Def{ } tpl := template.New("queueName") - tpl, err := tpl.Parse(GetEnv("RABBITMQ_QUEUE_NAME", "")) + tpl, err := tpl.Parse(helpers.GetEnv("RABBITMQ_QUEUE_NAME", "")) if err != nil { klog.Errorf("Invalid RABBITMQ_QUEUE_NAME: %v", err) } @@ -250,16 +251,16 @@ var Container = []dingo.Def{ } return amqpAdapter.Config{ - Url: GetEnv("RABBITMQ_URL", ""), - DeadLettersExchangeName: GetEnv("RABBITMQ_DLX_NAME", ""), - DeadLettersQueueName: GetEnv("RABBITMQ_DLX_QUEUE_NAME", ""), - ExchangeName: GetEnv("RABBITMQ_EXCHANGE_NAME", ""), - ExchangeType: GetEnv("RABBITMQ_EXCHANGE_TYPE", "fanout"), - OuterExchangeName: GetEnv("RABBITMQ_OUTER_EXCHANGE_NAME", ""), - OuterExchangeType: GetEnv("RABBITMQ_OUTER_EXCHANGE_TYPE", ""), - OuterExchangeBindingKey: GetEnv("RABBITMQ_OUTER_EXCHANGE_BINDING_KEY", ""), + Url: helpers.GetEnv("RABBITMQ_URL", ""), + DeadLettersExchangeName: helpers.GetEnv("RABBITMQ_DLX_NAME", ""), + DeadLettersQueueName: helpers.GetEnv("RABBITMQ_DLX_QUEUE_NAME", ""), + ExchangeName: helpers.GetEnv("RABBITMQ_EXCHANGE_NAME", ""), + ExchangeType: helpers.GetEnv("RABBITMQ_EXCHANGE_TYPE", "fanout"), + OuterExchangeName: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_NAME", ""), + OuterExchangeType: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_TYPE", ""), + OuterExchangeBindingKey: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_BINDING_KEY", ""), QueueName: queueName, - QueueBindingKey: GetEnv("RABBITMQ_QUEUE_BINDING_KEY", "#"), + QueueBindingKey: helpers.GetEnv("RABBITMQ_QUEUE_BINDING_KEY", "#"), QosPrefetchCount: qosPrefetchCount, ConsumerName: consumerName, }, nil @@ -271,7 +272,7 @@ var Container = []dingo.Def{ return &middleware.MiddlwareManager{ InputChannel: InputMiddlewareChannel, OutputChannel: OutputMiddlewareChannel, - MiddlewareAddress: GetEnv("MIDDLEWARES_SOCKET", ""), + MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), }, nil }, Params: dingo.Params{ @@ -279,6 +280,22 @@ var Container = []dingo.Def{ "1": dingo.Service("OutputMiddlewareChannel"), }, }, + { + Name: "AckManager", + Build: func(inputChannel chan messages.Ack, outputChannel chan messages.Ack, serviceChannel chan messages.Ack) (*ack.Manager, error) { + return &ack.Manager{ + InputChannel: inputChannel, + OutputChannel: outputChannel, + ServiceChannel: serviceChannel, + ServiceAddress: helpers.GetEnv("ACK_SERVICE_ADDRESS", ""), + }, nil + }, + Params: dingo.Params{ + "0": dingo.Service("AckManagerChannel"), + "1": dingo.Service("AckChannel"), + "2": dingo.Service("AckServiceChannel"), + }, + }, { Name: "Writer", Build: func(OutputMiddlewareChannel chan messages.Message, ackChannel chan messages.Ack, writeAdapter writeAdapters.WriteAdapter) (*writers.Writer, error) { @@ -290,7 +307,7 @@ var Container = []dingo.Def{ }, Params: dingo.Params{ "0": dingo.Service("OutputMiddlewareChannel"), - "1": dingo.Service("AckChannel"), + "1": dingo.Service("AckManagerChannel"), "2": dingo.Service("ElasticsearchAdapter"), }, }, @@ -358,4 +375,26 @@ var Container = []dingo.Def{ return c, nil }, }, + { + Name: "AckManagerChannel", + Build: func() (chan messages.Ack, error) { + bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) + if err != nil { + bufLen = 0 + } + c := make(chan messages.Ack, bufLen) + return c, nil + }, + }, + { + Name: "AckServiceChannel", + Build: func() (chan messages.Ack, error) { + bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) + if err != nil { + bufLen = 0 + } + c := make(chan messages.Ack, bufLen) + return c, nil + }, + }, } diff --git a/proto/ack.pb.go b/proto/ack.pb.go new file mode 100644 index 0000000..42fe5fb --- /dev/null +++ b/proto/ack.pb.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: ack.proto + +package proto + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type EmptyRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EmptyRequest) Reset() { *m = EmptyRequest{} } +func (m *EmptyRequest) String() string { return proto.CompactTextString(m) } +func (*EmptyRequest) ProtoMessage() {} +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_29efde0d93e5101c, []int{0} +} + +func (m *EmptyRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EmptyRequest.Unmarshal(m, b) +} +func (m *EmptyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EmptyRequest.Marshal(b, m, deterministic) +} +func (m *EmptyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmptyRequest.Merge(m, src) +} +func (m *EmptyRequest) XXX_Size() int { + return xxx_messageInfo_EmptyRequest.Size(m) +} +func (m *EmptyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EmptyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EmptyRequest proto.InternalMessageInfo + +// Message is represented with the body that contains the actual data and a boolean flag. +type Message struct { + Body []byte `protobuf:"bytes,1,opt,name=Body,proto3" json:"Body,omitempty"` + Ack bool `protobuf:"varint,2,opt,name=Ack,proto3" json:"Ack,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} +func (*Message) Descriptor() ([]byte, []int) { + return fileDescriptor_29efde0d93e5101c, []int{1} +} + +func (m *Message) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Message.Unmarshal(m, b) +} +func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Message.Marshal(b, m, deterministic) +} +func (m *Message) XXX_Merge(src proto.Message) { + xxx_messageInfo_Message.Merge(m, src) +} +func (m *Message) XXX_Size() int { + return xxx_messageInfo_Message.Size(m) +} +func (m *Message) XXX_DiscardUnknown() { + xxx_messageInfo_Message.DiscardUnknown(m) +} + +var xxx_messageInfo_Message proto.InternalMessageInfo + +func (m *Message) GetBody() []byte { + if m != nil { + return m.Body + } + return nil +} + +func (m *Message) GetAck() bool { + if m != nil { + return m.Ack + } + return false +} + +func init() { + proto.RegisterType((*EmptyRequest)(nil), "proto.EmptyRequest") + proto.RegisterType((*Message)(nil), "proto.Message") +} + +func init() { proto.RegisterFile("ack.proto", fileDescriptor_29efde0d93e5101c) } + +var fileDescriptor_29efde0d93e5101c = []byte{ + // 183 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x4c, 0xce, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x7c, 0x5c, 0x3c, 0xae, 0xb9, 0x05, + 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0xfa, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, + 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, 0x29, 0x95, 0x12, 0x8c, 0x0a, 0x8c, + 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x00, 0x17, 0xb3, 0x63, 0x72, 0xb6, 0x04, 0x93, 0x02, 0xa3, + 0x06, 0x47, 0x10, 0x88, 0x69, 0xe4, 0xc2, 0xc5, 0xe5, 0x98, 0x9c, 0x1d, 0x9c, 0x5a, 0x54, 0x96, + 0x99, 0x9c, 0x2a, 0x64, 0xc6, 0xc5, 0xed, 0x9e, 0x5a, 0x02, 0x35, 0xa1, 0x58, 0x48, 0x18, 0x62, + 0x99, 0x1e, 0xb2, 0x15, 0x52, 0x7c, 0x50, 0x41, 0xa8, 0x2a, 0x25, 0x06, 0x03, 0x46, 0x27, 0x5d, + 0x2e, 0xd9, 0xe4, 0xfc, 0x5c, 0xbd, 0xe2, 0xfc, 0xb4, 0x92, 0xfc, 0xbc, 0xcc, 0x64, 0xbd, 0x8c, + 0xfc, 0xdc, 0xcc, 0xbc, 0xf4, 0x82, 0xcc, 0xf4, 0xd4, 0xfc, 0x3c, 0xbd, 0xc4, 0xe4, 0x6c, 0x27, + 0x24, 0x4b, 0x02, 0x18, 0x93, 0xd8, 0xc0, 0x26, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, + 0x2c, 0xa9, 0x16, 0xd0, 0x00, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// AckServiceClient is the client API for AckService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AckServiceClient interface { + // Handle the given data and return it. + GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckService_GetMessagesClient, error) +} + +type ackServiceClient struct { + cc *grpc.ClientConn +} + +func NewAckServiceClient(cc *grpc.ClientConn) AckServiceClient { + return &ackServiceClient{cc} +} + +func (c *ackServiceClient) GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckService_GetMessagesClient, error) { + stream, err := c.cc.NewStream(ctx, &_AckService_serviceDesc.Streams[0], "/proto.AckService/GetMessages", opts...) + if err != nil { + return nil, err + } + x := &ackServiceGetMessagesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type AckService_GetMessagesClient interface { + Recv() (*Message, error) + grpc.ClientStream +} + +type ackServiceGetMessagesClient struct { + grpc.ClientStream +} + +func (x *ackServiceGetMessagesClient) Recv() (*Message, error) { + m := new(Message) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AckServiceServer is the server API for AckService service. +type AckServiceServer interface { + // Handle the given data and return it. + GetMessages(*EmptyRequest, AckService_GetMessagesServer) error +} + +// UnimplementedAckServiceServer can be embedded to have forward compatible implementations. +type UnimplementedAckServiceServer struct { +} + +func (*UnimplementedAckServiceServer) GetMessages(req *EmptyRequest, srv AckService_GetMessagesServer) error { + return status.Errorf(codes.Unimplemented, "method GetMessages not implemented") +} + +func RegisterAckServiceServer(s *grpc.Server, srv AckServiceServer) { + s.RegisterService(&_AckService_serviceDesc, srv) +} + +func _AckService_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(EmptyRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(AckServiceServer).GetMessages(m, &ackServiceGetMessagesServer{stream}) +} + +type AckService_GetMessagesServer interface { + Send(*Message) error + grpc.ServerStream +} + +type ackServiceGetMessagesServer struct { + grpc.ServerStream +} + +func (x *ackServiceGetMessagesServer) Send(m *Message) error { + return x.ServerStream.SendMsg(m) +} + +var _AckService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.AckService", + HandlerType: (*AckServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetMessages", + Handler: _AckService_GetMessages_Handler, + ServerStreams: true, + }, + }, + Metadata: "ack.proto", +} diff --git a/proto/ack.proto b/proto/ack.proto new file mode 100644 index 0000000..df8158f --- /dev/null +++ b/proto/ack.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "com.softonic.homingpigeon.ack"; +option java_outer_classname = "AckService"; + +package proto; + +// Ack Service interface. +service AckService { + + // Handle the given data and return it. + rpc GetMessages(EmptyRequest) returns (stream Message) {} + +} + +message EmptyRequest {} + +// Message is represented with the body that contains the actual data and a boolean flag. +message Message { + bytes Body = 1; + bool Ack = 2; +} + From a01d9d7ce6294a3e195279cdc9acfd9c5a08e597 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 28 Jan 2022 10:30:34 +0100 Subject: [PATCH 02/37] Improve naming and format --- go.mod | 2 +- pkg/ack/manager.go | 4 ++-- pkg/ack/server.go | 11 +++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6b279ca..deb9a27 100644 --- a/go.mod +++ b/go.mod @@ -26,4 +26,4 @@ require ( k8s.io/klog v1.0.0 ) -go 1.13 +go 1.17 diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go index c108078..10d180a 100644 --- a/pkg/ack/manager.go +++ b/pkg/ack/manager.go @@ -39,7 +39,7 @@ func (t *Manager) StartServer() { func (t *Manager) Start() { - if t.shouldStartAckService() { + if t.ShouldStartAckService() { go t.StartServer() } @@ -49,7 +49,7 @@ func (t *Manager) Start() { } } -func (t *Manager) shouldStartAckService() bool { +func (t *Manager) ShouldStartAckService() bool { if t.ServiceAddress == "" { klog.V(1).Info("ACK-Manager not available") return false diff --git a/pkg/ack/server.go b/pkg/ack/server.go index 2debf94..e4aaade 100644 --- a/pkg/ack/server.go +++ b/pkg/ack/server.go @@ -14,18 +14,17 @@ type Server struct { mu sync.RWMutex } -func (s *Server) addClient(uid string, client proto.AckService_GetMessagesServer) { +func (s *Server) AddClient(uid string, client proto.AckService_GetMessagesServer) { s.mu.Lock() defer s.mu.Unlock() s.clients[uid] = client klog.V(1).Info("New client connected") } -func (s *Server) getClients() []proto.AckService_GetMessagesServer { - var clients []proto.AckService_GetMessagesServer - +func (s *Server) GetClientsCopy() []proto.AckService_GetMessagesServer { s.mu.RLock() defer s.mu.RUnlock() + var clients []proto.AckService_GetMessagesServer for _, client := range s.clients { clients = append(clients, client) } @@ -35,11 +34,11 @@ func (s *Server) getClients() []proto.AckService_GetMessagesServer { func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckService_GetMessagesServer) error { uid := uuid.Must(uuid.NewRandom()).String() - s.addClient(uid, client) + s.AddClient(uid, client) for message := range s.InputChannel { klog.V(1).Info("Sending ACK to clients") - for _, client := range s.getClients() { + for _, client := range s.GetClientsCopy() { client.Send(&proto.Message{ Body: message.Body, Ack: message.Ack, From 0558aa00644e501dd6ded736734218b275521568 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 28 Jan 2022 13:02:15 +0100 Subject: [PATCH 03/37] Improve naming --- README.md | 4 +-- pkg/ack/manager.go | 24 ++++++------- pkg/ack/server.go | 10 +++--- pkg/services/container.go | 14 ++++---- proto/ack.pb.go | 74 +++++++++++++++++++-------------------- proto/ack.proto | 4 +-- 6 files changed, 65 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index a0dc7d8..5bd5133 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,11 @@ In order to start up correctly, it needs well defined environment variables: ##### Core | Name | Value | -| ------------------------------------ |----------------------------------------------------------------------------| +|--------------------------------------|----------------------------------------------------------------------------| | MESSAGE_BUFFER_LENGTH | Buffer length for internal golang channel used for messaging | | ACK_BUFFER_LENGTH | Buffer length for internal golang channel used for acks | | MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | -| ACK_SERVICE_ADDRESS | Channel to send ACK message stream. Ex: localhost:12345" | +| ACK_BROKER_ADDRESS | Channel to send ACK message stream. Ex: localhost:12345" | ##### Read Adapters diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go index 10d180a..c443f78 100644 --- a/pkg/ack/manager.go +++ b/pkg/ack/manager.go @@ -11,22 +11,22 @@ import ( // @TODO Tests missing type Manager struct { - InputChannel <-chan messages.Ack - OutputChannel chan<- messages.Ack - ServiceChannel chan messages.Ack - ServiceAddress string + InputChannel <-chan messages.Ack + OutputChannel chan<- messages.Ack + BrokerChannel chan messages.Ack + BrokerAddress string } func (t *Manager) StartServer() { - lis, err := net.Listen("tcp", t.ServiceAddress) + lis, err := net.Listen("tcp", t.BrokerAddress) if err != nil { klog.Errorf("Failed to listen: %v", err) } grpcServer := grpc.NewServer(grpc.MaxConcurrentStreams(10)) - proto.RegisterAckServiceServer(grpcServer, &Server{ - clients: make(map[string]proto.AckService_GetMessagesServer), - InputChannel: t.ServiceChannel, + proto.RegisterAckBrokerServer(grpcServer, &Server{ + clients: make(map[string]proto.AckBroker_GetMessagesServer), + InputChannel: t.BrokerChannel, mu: sync.RWMutex{}, }) @@ -39,18 +39,18 @@ func (t *Manager) StartServer() { func (t *Manager) Start() { - if t.ShouldStartAckService() { + if t.ShouldStartAckBroker() { go t.StartServer() } for message := range t.InputChannel { t.OutputChannel <- message - t.ServiceChannel <- message + t.BrokerChannel <- message } } -func (t *Manager) ShouldStartAckService() bool { - if t.ServiceAddress == "" { +func (t *Manager) ShouldStartAckBroker() bool { + if t.BrokerAddress == "" { klog.V(1).Info("ACK-Manager not available") return false } diff --git a/pkg/ack/server.go b/pkg/ack/server.go index e4aaade..7d1a0a8 100644 --- a/pkg/ack/server.go +++ b/pkg/ack/server.go @@ -9,29 +9,29 @@ import ( ) type Server struct { - clients map[string]proto.AckService_GetMessagesServer + clients map[string]proto.AckBroker_GetMessagesServer InputChannel <-chan messages.Ack mu sync.RWMutex } -func (s *Server) AddClient(uid string, client proto.AckService_GetMessagesServer) { +func (s *Server) AddClient(uid string, client proto.AckBroker_GetMessagesServer) { s.mu.Lock() defer s.mu.Unlock() s.clients[uid] = client klog.V(1).Info("New client connected") } -func (s *Server) GetClientsCopy() []proto.AckService_GetMessagesServer { +func (s *Server) GetClientsCopy() []proto.AckBroker_GetMessagesServer { s.mu.RLock() defer s.mu.RUnlock() - var clients []proto.AckService_GetMessagesServer + var clients []proto.AckBroker_GetMessagesServer for _, client := range s.clients { clients = append(clients, client) } return clients } -func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckService_GetMessagesServer) error { +func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckBroker_GetMessagesServer) error { uid := uuid.Must(uuid.NewRandom()).String() s.AddClient(uid, client) diff --git a/pkg/services/container.go b/pkg/services/container.go index 9219840..1959db3 100644 --- a/pkg/services/container.go +++ b/pkg/services/container.go @@ -282,18 +282,18 @@ var Container = []dingo.Def{ }, { Name: "AckManager", - Build: func(inputChannel chan messages.Ack, outputChannel chan messages.Ack, serviceChannel chan messages.Ack) (*ack.Manager, error) { + Build: func(inputChannel chan messages.Ack, outputChannel chan messages.Ack, brokerChannel chan messages.Ack) (*ack.Manager, error) { return &ack.Manager{ - InputChannel: inputChannel, - OutputChannel: outputChannel, - ServiceChannel: serviceChannel, - ServiceAddress: helpers.GetEnv("ACK_SERVICE_ADDRESS", ""), + InputChannel: inputChannel, + OutputChannel: outputChannel, + BrokerChannel: brokerChannel, + BrokerAddress: helpers.GetEnv("ACK_BROKER_ADDRESS", ""), }, nil }, Params: dingo.Params{ "0": dingo.Service("AckManagerChannel"), "1": dingo.Service("AckChannel"), - "2": dingo.Service("AckServiceChannel"), + "2": dingo.Service("AckBrokerChannel"), }, }, { @@ -387,7 +387,7 @@ var Container = []dingo.Def{ }, }, { - Name: "AckServiceChannel", + Name: "AckBrokerChannel", Build: func() (chan messages.Ack, error) { bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) if err != nil { diff --git a/proto/ack.pb.go b/proto/ack.pb.go index 42fe5fb..13a235c 100644 --- a/proto/ack.pb.go +++ b/proto/ack.pb.go @@ -111,19 +111,19 @@ func init() { func init() { proto.RegisterFile("ack.proto", fileDescriptor_29efde0d93e5101c) } var fileDescriptor_29efde0d93e5101c = []byte{ - // 183 bytes of a gzipped FileDescriptorProto + // 182 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x4c, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x7c, 0x5c, 0x3c, 0xae, 0xb9, 0x05, 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0xfa, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, 0x29, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x00, 0x17, 0xb3, 0x63, 0x72, 0xb6, 0x04, 0x93, 0x02, 0xa3, - 0x06, 0x47, 0x10, 0x88, 0x69, 0xe4, 0xc2, 0xc5, 0xe5, 0x98, 0x9c, 0x1d, 0x9c, 0x5a, 0x54, 0x96, - 0x99, 0x9c, 0x2a, 0x64, 0xc6, 0xc5, 0xed, 0x9e, 0x5a, 0x02, 0x35, 0xa1, 0x58, 0x48, 0x18, 0x62, - 0x99, 0x1e, 0xb2, 0x15, 0x52, 0x7c, 0x50, 0x41, 0xa8, 0x2a, 0x25, 0x06, 0x03, 0x46, 0x27, 0x5d, - 0x2e, 0xd9, 0xe4, 0xfc, 0x5c, 0xbd, 0xe2, 0xfc, 0xb4, 0x92, 0xfc, 0xbc, 0xcc, 0x64, 0xbd, 0x8c, - 0xfc, 0xdc, 0xcc, 0xbc, 0xf4, 0x82, 0xcc, 0xf4, 0xd4, 0xfc, 0x3c, 0xbd, 0xc4, 0xe4, 0x6c, 0x27, - 0x24, 0x4b, 0x02, 0x18, 0x93, 0xd8, 0xc0, 0x26, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, - 0x2c, 0xa9, 0x16, 0xd0, 0x00, 0x00, 0x00, + 0x06, 0x47, 0x10, 0x88, 0x69, 0xe4, 0xcc, 0xc5, 0xe9, 0x98, 0x9c, 0xed, 0x54, 0x94, 0x9f, 0x9d, + 0x5a, 0x24, 0x64, 0xc6, 0xc5, 0xed, 0x9e, 0x5a, 0x02, 0x35, 0xa0, 0x58, 0x48, 0x18, 0x62, 0x97, + 0x1e, 0xb2, 0x0d, 0x52, 0x7c, 0x50, 0x41, 0xa8, 0x2a, 0x25, 0x06, 0x03, 0x46, 0x27, 0x1d, 0x2e, + 0xd9, 0xe4, 0xfc, 0x5c, 0xbd, 0xe2, 0xfc, 0xb4, 0x92, 0xfc, 0xbc, 0xcc, 0x64, 0xbd, 0x8c, 0xfc, + 0xdc, 0xcc, 0xbc, 0xf4, 0x82, 0xcc, 0xf4, 0xd4, 0xfc, 0x3c, 0xbd, 0xc4, 0xe4, 0x6c, 0x27, 0x84, + 0x1d, 0x01, 0x8c, 0x49, 0x6c, 0x60, 0x03, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x0f, + 0xd6, 0x77, 0xce, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -134,28 +134,28 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// AckServiceClient is the client API for AckService service. +// AckBrokerClient is the client API for AckBroker service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AckServiceClient interface { +type AckBrokerClient interface { // Handle the given data and return it. - GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckService_GetMessagesClient, error) + GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckBroker_GetMessagesClient, error) } -type ackServiceClient struct { +type ackBrokerClient struct { cc *grpc.ClientConn } -func NewAckServiceClient(cc *grpc.ClientConn) AckServiceClient { - return &ackServiceClient{cc} +func NewAckBrokerClient(cc *grpc.ClientConn) AckBrokerClient { + return &ackBrokerClient{cc} } -func (c *ackServiceClient) GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckService_GetMessagesClient, error) { - stream, err := c.cc.NewStream(ctx, &_AckService_serviceDesc.Streams[0], "/proto.AckService/GetMessages", opts...) +func (c *ackBrokerClient) GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckBroker_GetMessagesClient, error) { + stream, err := c.cc.NewStream(ctx, &_AckBroker_serviceDesc.Streams[0], "/proto.AckBroker/GetMessages", opts...) if err != nil { return nil, err } - x := &ackServiceGetMessagesClient{stream} + x := &ackBrokerGetMessagesClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -165,16 +165,16 @@ func (c *ackServiceClient) GetMessages(ctx context.Context, in *EmptyRequest, op return x, nil } -type AckService_GetMessagesClient interface { +type AckBroker_GetMessagesClient interface { Recv() (*Message, error) grpc.ClientStream } -type ackServiceGetMessagesClient struct { +type ackBrokerGetMessagesClient struct { grpc.ClientStream } -func (x *ackServiceGetMessagesClient) Recv() (*Message, error) { +func (x *ackBrokerGetMessagesClient) Recv() (*Message, error) { m := new(Message) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -182,53 +182,53 @@ func (x *ackServiceGetMessagesClient) Recv() (*Message, error) { return m, nil } -// AckServiceServer is the server API for AckService service. -type AckServiceServer interface { +// AckBrokerServer is the server API for AckBroker service. +type AckBrokerServer interface { // Handle the given data and return it. - GetMessages(*EmptyRequest, AckService_GetMessagesServer) error + GetMessages(*EmptyRequest, AckBroker_GetMessagesServer) error } -// UnimplementedAckServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAckServiceServer struct { +// UnimplementedAckBrokerServer can be embedded to have forward compatible implementations. +type UnimplementedAckBrokerServer struct { } -func (*UnimplementedAckServiceServer) GetMessages(req *EmptyRequest, srv AckService_GetMessagesServer) error { +func (*UnimplementedAckBrokerServer) GetMessages(req *EmptyRequest, srv AckBroker_GetMessagesServer) error { return status.Errorf(codes.Unimplemented, "method GetMessages not implemented") } -func RegisterAckServiceServer(s *grpc.Server, srv AckServiceServer) { - s.RegisterService(&_AckService_serviceDesc, srv) +func RegisterAckBrokerServer(s *grpc.Server, srv AckBrokerServer) { + s.RegisterService(&_AckBroker_serviceDesc, srv) } -func _AckService_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { +func _AckBroker_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(EmptyRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AckServiceServer).GetMessages(m, &ackServiceGetMessagesServer{stream}) + return srv.(AckBrokerServer).GetMessages(m, &ackBrokerGetMessagesServer{stream}) } -type AckService_GetMessagesServer interface { +type AckBroker_GetMessagesServer interface { Send(*Message) error grpc.ServerStream } -type ackServiceGetMessagesServer struct { +type ackBrokerGetMessagesServer struct { grpc.ServerStream } -func (x *ackServiceGetMessagesServer) Send(m *Message) error { +func (x *ackBrokerGetMessagesServer) Send(m *Message) error { return x.ServerStream.SendMsg(m) } -var _AckService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.AckService", - HandlerType: (*AckServiceServer)(nil), +var _AckBroker_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.AckBroker", + HandlerType: (*AckBrokerServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "GetMessages", - Handler: _AckService_GetMessages_Handler, + Handler: _AckBroker_GetMessages_Handler, ServerStreams: true, }, }, diff --git a/proto/ack.proto b/proto/ack.proto index df8158f..30ccc89 100644 --- a/proto/ack.proto +++ b/proto/ack.proto @@ -2,12 +2,12 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "com.softonic.homingpigeon.ack"; -option java_outer_classname = "AckService"; +option java_outer_classname = "AckBroker"; package proto; // Ack Service interface. -service AckService { +service AckBroker { // Handle the given data and return it. rpc GetMessages(EmptyRequest) returns (stream Message) {} From 4d65df53837e1e551ccc2ede850f4cd27697dbf2 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 28 Jan 2022 13:30:52 +0100 Subject: [PATCH 04/37] Improve proto naming --- Makefile | 2 +- pkg/ack/manager.go | 4 +- pkg/ack/server.go | 10 +-- proto/{ack.pb.go => ack_event.pb.go} | 96 ++++++++++++++-------------- proto/{ack.proto => ack_event.proto} | 7 +- 5 files changed, 59 insertions(+), 60 deletions(-) rename proto/{ack.pb.go => ack_event.pb.go} (60%) rename proto/{ack.proto => ack_event.proto} (75%) diff --git a/Makefile b/Makefile index 0ec55ad..0e2347e 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ TAG ?= dev generate-proto: protoc -I proto/ proto/middleware.proto --go_out=plugins=grpc:proto - protoc -I proto/ proto/ack.proto --go_out=plugins=grpc:proto + protoc -I proto/ proto/ack_event.proto --go_out=plugins=grpc:proto dep: go get -u github.com/rakyll/gotest go get -u github.com/sarulabs/dingo/dingo diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go index c443f78..d308ad7 100644 --- a/pkg/ack/manager.go +++ b/pkg/ack/manager.go @@ -24,8 +24,8 @@ func (t *Manager) StartServer() { } grpcServer := grpc.NewServer(grpc.MaxConcurrentStreams(10)) - proto.RegisterAckBrokerServer(grpcServer, &Server{ - clients: make(map[string]proto.AckBroker_GetMessagesServer), + proto.RegisterAckEventServer(grpcServer, &Server{ + clients: make(map[string]proto.AckEvent_GetMessagesServer), InputChannel: t.BrokerChannel, mu: sync.RWMutex{}, }) diff --git a/pkg/ack/server.go b/pkg/ack/server.go index 7d1a0a8..b15b89e 100644 --- a/pkg/ack/server.go +++ b/pkg/ack/server.go @@ -9,29 +9,29 @@ import ( ) type Server struct { - clients map[string]proto.AckBroker_GetMessagesServer + clients map[string]proto.AckEvent_GetMessagesServer InputChannel <-chan messages.Ack mu sync.RWMutex } -func (s *Server) AddClient(uid string, client proto.AckBroker_GetMessagesServer) { +func (s *Server) AddClient(uid string, client proto.AckEvent_GetMessagesServer) { s.mu.Lock() defer s.mu.Unlock() s.clients[uid] = client klog.V(1).Info("New client connected") } -func (s *Server) GetClientsCopy() []proto.AckBroker_GetMessagesServer { +func (s *Server) GetClientsCopy() []proto.AckEvent_GetMessagesServer { s.mu.RLock() defer s.mu.RUnlock() - var clients []proto.AckBroker_GetMessagesServer + var clients []proto.AckEvent_GetMessagesServer for _, client := range s.clients { clients = append(clients, client) } return clients } -func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckBroker_GetMessagesServer) error { +func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckEvent_GetMessagesServer) error { uid := uuid.Must(uuid.NewRandom()).String() s.AddClient(uid, client) diff --git a/proto/ack.pb.go b/proto/ack_event.pb.go similarity index 60% rename from proto/ack.pb.go rename to proto/ack_event.pb.go index 13a235c..332d0ec 100644 --- a/proto/ack.pb.go +++ b/proto/ack_event.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: ack.proto +// source: ack_event.proto package proto @@ -34,7 +34,7 @@ func (m *EmptyRequest) Reset() { *m = EmptyRequest{} } func (m *EmptyRequest) String() string { return proto.CompactTextString(m) } func (*EmptyRequest) ProtoMessage() {} func (*EmptyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_29efde0d93e5101c, []int{0} + return fileDescriptor_90a7cdd5cc2411b0, []int{0} } func (m *EmptyRequest) XXX_Unmarshal(b []byte) error { @@ -68,7 +68,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_29efde0d93e5101c, []int{1} + return fileDescriptor_90a7cdd5cc2411b0, []int{1} } func (m *Message) XXX_Unmarshal(b []byte) error { @@ -108,22 +108,22 @@ func init() { proto.RegisterType((*Message)(nil), "proto.Message") } -func init() { proto.RegisterFile("ack.proto", fileDescriptor_29efde0d93e5101c) } +func init() { proto.RegisterFile("ack_event.proto", fileDescriptor_90a7cdd5cc2411b0) } -var fileDescriptor_29efde0d93e5101c = []byte{ - // 182 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x4c, 0xce, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x7c, 0x5c, 0x3c, 0xae, 0xb9, 0x05, - 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0xfa, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, - 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, 0x29, 0x95, 0x12, 0x8c, 0x0a, 0x8c, - 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x00, 0x17, 0xb3, 0x63, 0x72, 0xb6, 0x04, 0x93, 0x02, 0xa3, - 0x06, 0x47, 0x10, 0x88, 0x69, 0xe4, 0xcc, 0xc5, 0xe9, 0x98, 0x9c, 0xed, 0x54, 0x94, 0x9f, 0x9d, - 0x5a, 0x24, 0x64, 0xc6, 0xc5, 0xed, 0x9e, 0x5a, 0x02, 0x35, 0xa0, 0x58, 0x48, 0x18, 0x62, 0x97, - 0x1e, 0xb2, 0x0d, 0x52, 0x7c, 0x50, 0x41, 0xa8, 0x2a, 0x25, 0x06, 0x03, 0x46, 0x27, 0x1d, 0x2e, - 0xd9, 0xe4, 0xfc, 0x5c, 0xbd, 0xe2, 0xfc, 0xb4, 0x92, 0xfc, 0xbc, 0xcc, 0x64, 0xbd, 0x8c, 0xfc, - 0xdc, 0xcc, 0xbc, 0xf4, 0x82, 0xcc, 0xf4, 0xd4, 0xfc, 0x3c, 0xbd, 0xc4, 0xe4, 0x6c, 0x27, 0x84, - 0x1d, 0x01, 0x8c, 0x49, 0x6c, 0x60, 0x03, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x0f, - 0xd6, 0x77, 0xce, 0x00, 0x00, 0x00, +var fileDescriptor_90a7cdd5cc2411b0 = []byte{ + // 184 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x4c, 0xce, 0x8e, + 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, + 0x7c, 0x5c, 0x3c, 0xae, 0xb9, 0x05, 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, + 0xfa, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, + 0x29, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x00, 0x17, 0xb3, 0x63, + 0x72, 0xb6, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x88, 0x69, 0xe4, 0xc4, 0xc5, 0xe1, 0x98, + 0x9c, 0xed, 0x0a, 0x32, 0x59, 0xc8, 0x8c, 0x8b, 0xdb, 0x3d, 0xb5, 0x04, 0xaa, 0xbf, 0x58, 0x48, + 0x18, 0x62, 0x95, 0x1e, 0xb2, 0x05, 0x52, 0x7c, 0x50, 0x41, 0xa8, 0x2a, 0x25, 0x06, 0x03, 0x46, + 0x27, 0x43, 0x2e, 0xe5, 0xe4, 0xfc, 0x5c, 0xbd, 0xe2, 0xfc, 0xb4, 0x92, 0xfc, 0xbc, 0xcc, 0x64, + 0xbd, 0x8c, 0xfc, 0xdc, 0xcc, 0xbc, 0xf4, 0x82, 0xcc, 0xf4, 0xd4, 0xfc, 0x3c, 0x3d, 0xb8, 0xc3, + 0x9d, 0xe0, 0x16, 0x05, 0x30, 0x26, 0xb1, 0x81, 0x4d, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x9f, 0x81, 0x8f, 0xd2, 0xd8, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -134,28 +134,28 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// AckBrokerClient is the client API for AckBroker service. +// AckEventClient is the client API for AckEvent service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AckBrokerClient interface { +type AckEventClient interface { // Handle the given data and return it. - GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckBroker_GetMessagesClient, error) + GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckEvent_GetMessagesClient, error) } -type ackBrokerClient struct { +type ackEventClient struct { cc *grpc.ClientConn } -func NewAckBrokerClient(cc *grpc.ClientConn) AckBrokerClient { - return &ackBrokerClient{cc} +func NewAckEventClient(cc *grpc.ClientConn) AckEventClient { + return &ackEventClient{cc} } -func (c *ackBrokerClient) GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckBroker_GetMessagesClient, error) { - stream, err := c.cc.NewStream(ctx, &_AckBroker_serviceDesc.Streams[0], "/proto.AckBroker/GetMessages", opts...) +func (c *ackEventClient) GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckEvent_GetMessagesClient, error) { + stream, err := c.cc.NewStream(ctx, &_AckEvent_serviceDesc.Streams[0], "/proto.AckEvent/GetMessages", opts...) if err != nil { return nil, err } - x := &ackBrokerGetMessagesClient{stream} + x := &ackEventGetMessagesClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -165,16 +165,16 @@ func (c *ackBrokerClient) GetMessages(ctx context.Context, in *EmptyRequest, opt return x, nil } -type AckBroker_GetMessagesClient interface { +type AckEvent_GetMessagesClient interface { Recv() (*Message, error) grpc.ClientStream } -type ackBrokerGetMessagesClient struct { +type ackEventGetMessagesClient struct { grpc.ClientStream } -func (x *ackBrokerGetMessagesClient) Recv() (*Message, error) { +func (x *ackEventGetMessagesClient) Recv() (*Message, error) { m := new(Message) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -182,55 +182,55 @@ func (x *ackBrokerGetMessagesClient) Recv() (*Message, error) { return m, nil } -// AckBrokerServer is the server API for AckBroker service. -type AckBrokerServer interface { +// AckEventServer is the server API for AckEvent service. +type AckEventServer interface { // Handle the given data and return it. - GetMessages(*EmptyRequest, AckBroker_GetMessagesServer) error + GetMessages(*EmptyRequest, AckEvent_GetMessagesServer) error } -// UnimplementedAckBrokerServer can be embedded to have forward compatible implementations. -type UnimplementedAckBrokerServer struct { +// UnimplementedAckEventServer can be embedded to have forward compatible implementations. +type UnimplementedAckEventServer struct { } -func (*UnimplementedAckBrokerServer) GetMessages(req *EmptyRequest, srv AckBroker_GetMessagesServer) error { +func (*UnimplementedAckEventServer) GetMessages(req *EmptyRequest, srv AckEvent_GetMessagesServer) error { return status.Errorf(codes.Unimplemented, "method GetMessages not implemented") } -func RegisterAckBrokerServer(s *grpc.Server, srv AckBrokerServer) { - s.RegisterService(&_AckBroker_serviceDesc, srv) +func RegisterAckEventServer(s *grpc.Server, srv AckEventServer) { + s.RegisterService(&_AckEvent_serviceDesc, srv) } -func _AckBroker_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { +func _AckEvent_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(EmptyRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AckBrokerServer).GetMessages(m, &ackBrokerGetMessagesServer{stream}) + return srv.(AckEventServer).GetMessages(m, &ackEventGetMessagesServer{stream}) } -type AckBroker_GetMessagesServer interface { +type AckEvent_GetMessagesServer interface { Send(*Message) error grpc.ServerStream } -type ackBrokerGetMessagesServer struct { +type ackEventGetMessagesServer struct { grpc.ServerStream } -func (x *ackBrokerGetMessagesServer) Send(m *Message) error { +func (x *ackEventGetMessagesServer) Send(m *Message) error { return x.ServerStream.SendMsg(m) } -var _AckBroker_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.AckBroker", - HandlerType: (*AckBrokerServer)(nil), +var _AckEvent_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.AckEvent", + HandlerType: (*AckEventServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "GetMessages", - Handler: _AckBroker_GetMessages_Handler, + Handler: _AckEvent_GetMessages_Handler, ServerStreams: true, }, }, - Metadata: "ack.proto", + Metadata: "ack_event.proto", } diff --git a/proto/ack.proto b/proto/ack_event.proto similarity index 75% rename from proto/ack.proto rename to proto/ack_event.proto index 30ccc89..fd3d76b 100644 --- a/proto/ack.proto +++ b/proto/ack_event.proto @@ -1,13 +1,13 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "com.softonic.homingpigeon.ack"; -option java_outer_classname = "AckBroker"; +option java_package = "com.softonic.homingpigeon.ack_event"; +option java_outer_classname = "AckEvent"; package proto; // Ack Service interface. -service AckBroker { +service AckEvent { // Handle the given data and return it. rpc GetMessages(EmptyRequest) returns (stream Message) {} @@ -21,4 +21,3 @@ message Message { bytes Body = 1; bool Ack = 2; } - From c9813d0847c7b8298039b3ae6f5b44e2e9bd047a Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 28 Jan 2022 13:43:05 +0100 Subject: [PATCH 05/37] Change ENV var in docker-compose --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index ab32e4e..30bd050 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,7 +26,7 @@ services: GRPC_GO_LOG_VERBOSITY_LEVEL: 99 GRPC_GO_LOG_SEVERITY_LEVEL: info MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" - #ACK_SERVICE_ADDRESS: ":8090" + #ACK_BROKER_ADDRESS: ":8090" hp-middleware-pass: volumes: - ./sockets:/tmp From d8ce524c4f2208e497bddf1ae510310c01633cad Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 31 Jan 2022 16:30:08 +0100 Subject: [PATCH 06/37] TRAF-1451 - Add ACK broker and remove dingo --- Makefile | 3 - docker-compose.yaml | 2 +- pkg/ack/manager.go | 10 ++ pkg/main.go | 35 +++- pkg/middleware/manager.go | 9 + pkg/readers/adapters/amqp.go | 227 ++++++++++++++++++++++++++ pkg/readers/reader.go | 17 ++ pkg/stress/main.go | 6 +- pkg/writers/adapters/elasticsearch.go | 25 +++ pkg/writers/writer.go | 12 ++ 10 files changed, 330 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 0e2347e..1277172 100644 --- a/Makefile +++ b/Makefile @@ -5,17 +5,14 @@ generate-proto: protoc -I proto/ proto/ack_event.proto --go_out=plugins=grpc:proto dep: go get -u github.com/rakyll/gotest - go get -u github.com/sarulabs/dingo/dingo go get -u github.com/vektra/mockery/.../ go get -u github.com/golang/protobuf/proto go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.2 go get -u google.golang.org/grpc go mod download build: dep generate-proto - dingo -src="./pkg/services" -dest="./pkg/generatedServices" CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags="-w -s" -o bin/homing-pigeon pkg/main.go stress-build: dep generate-proto - dingo -src="./pkg/services" -dest="./pkg/generatedServices" CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags="-w -s" -o bin/stress-pigeon pkg/stress/main.go docker-build: docker build -t softonic/homing-pigeon:${TAG} . diff --git a/docker-compose.yaml b/docker-compose.yaml index 30bd050..a30f6af 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,7 +26,7 @@ services: GRPC_GO_LOG_VERBOSITY_LEVEL: 99 GRPC_GO_LOG_SEVERITY_LEVEL: info MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" - #ACK_BROKER_ADDRESS: ":8090" + ACK_BROKER_ADDRESS: ":8090" hp-middleware-pass: volumes: - ./sockets:/tmp diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go index d308ad7..12e18ce 100644 --- a/pkg/ack/manager.go +++ b/pkg/ack/manager.go @@ -1,6 +1,7 @@ package ack import ( + "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/proto" "google.golang.org/grpc" @@ -56,3 +57,12 @@ func (t *Manager) ShouldStartAckBroker() bool { } return true } + +func NewAckManager(inputChannel chan messages.Ack, outputChannel chan messages.Ack, brokerChannel chan messages.Ack) *Manager { + return &Manager{ + InputChannel: inputChannel, + OutputChannel: outputChannel, + BrokerChannel: brokerChannel, + BrokerAddress: helpers.GetEnv("ACK_BROKER_ADDRESS", ""), + } +} diff --git a/pkg/main.go b/pkg/main.go index 27f00d2..2915cbf 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -1,25 +1,44 @@ package main import ( - "github.com/sarulabs/dingo" - "github.com/softonic/homing-pigeon/pkg/generatedServices/dic" + "github.com/softonic/homing-pigeon/pkg/ack" + "github.com/softonic/homing-pigeon/pkg/messages" + "github.com/softonic/homing-pigeon/pkg/middleware" + "github.com/softonic/homing-pigeon/pkg/readers" + "github.com/softonic/homing-pigeon/pkg/writers" "k8s.io/klog" + "os" + "strconv" ) func main() { klog.InitFlags(nil) - container, err := dic.NewContainer(dingo.App) + bufLen, err := strconv.Atoi(os.Getenv("MESSAGE_BUFFER_LENGTH")) + if err != nil { + bufLen = 0 + } + inputChannel := make(chan messages.Message, bufLen) + ackChannel := make(chan messages.Ack, bufLen) + outputChannel := make(chan messages.Message, bufLen) + ackManagerChannel := make(chan messages.Ack, bufLen) + brokerAckChannel := make(chan messages.Ack, bufLen) + + reader, err := readers.NewAMQPReader(inputChannel, ackChannel) + if err != nil { + panic(err) + } + + middlewareManager := middleware.NewMiddlewareManager(inputChannel, outputChannel) + ackManager := ack.NewAckManager(ackManagerChannel, ackChannel, brokerAckChannel) + + writer, err := writers.NewElasticsearchWriter(outputChannel, ackManagerChannel) if err != nil { panic(err) } - reader := container.GetReader() - middleware := container.GetMiddleware() - ackManager := container.GetAckManager() - writer := container.GetWriter() go reader.Start() - go middleware.Start() + go middlewareManager.Start() go ackManager.Start() writer.Start() } diff --git a/pkg/middleware/manager.go b/pkg/middleware/manager.go index 706d161..de3d013 100644 --- a/pkg/middleware/manager.go +++ b/pkg/middleware/manager.go @@ -2,6 +2,7 @@ package middleware import ( "context" + "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/proto" "google.golang.org/grpc" @@ -63,3 +64,11 @@ func (m *MiddlwareManager) Start() { func (m *MiddlwareManager) isMiddlewareNotAvailable() bool { return m.MiddlewareAddress == "" } + +func NewMiddlewareManager(inputChannel chan messages.Message, outputChannel chan messages.Message) *MiddlwareManager { + return &MiddlwareManager{ + InputChannel: inputChannel, + OutputChannel: outputChannel, + MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), + } +} diff --git a/pkg/readers/adapters/amqp.go b/pkg/readers/adapters/amqp.go index 947ea3b..07db82d 100644 --- a/pkg/readers/adapters/amqp.go +++ b/pkg/readers/adapters/amqp.go @@ -1,10 +1,19 @@ package adapters import ( + "bytes" + "crypto/tls" + "crypto/x509" + "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" amqpAdapter "github.com/softonic/homing-pigeon/pkg/readers/adapters/amqp" "github.com/streadway/amqp" + "html/template" + "io/ioutil" "k8s.io/klog" + "os" + "strconv" + "strings" ) type Amqp struct { @@ -59,3 +68,221 @@ func (a *Amqp) HandleAck(ackChannel <-chan messages.Ack) { } } } + +func NewAmqpReaderAdapter(config amqpAdapter.Config) (ReadAdapter, error) { + failOnError := func(err error, msg string) { + if err != nil { + klog.Errorf("%s: %s", msg, err) + } + } + var err error + var conn *amqp.Connection + caPath := os.Getenv("RABBITMQ_CA_PATH") + + if caPath != "" { + cfg := new(tls.Config) + cfg.RootCAs = x509.NewCertPool() + var ca []byte + ca, err = ioutil.ReadFile(caPath) + if err == nil { + cfg.RootCAs.AppendCertsFromPEM(ca) + klog.V(0).Infof("Added CA certificate %s", caPath) + } + failOnError(err, "Failed loading RabbitMQ CA") + + tlsClientCert := os.Getenv("RABBITMQ_TLS_CLIENT_CERT") + tlsClientKey := os.Getenv("RABBITMQ_TLS_CLIENT_KEY") + if tlsClientCert != "" && tlsClientKey != "" { + cert, err := tls.LoadX509KeyPair(tlsClientCert, tlsClientKey) + if err == nil { + cfg.Certificates = append(cfg.Certificates, cert) + klog.V(0).Infof("Loaded RabbitMQ client cert %s", tlsClientCert) + klog.V(0).Infof("Loaded RabbitMQ client key %s", tlsClientKey) + } + failOnError(err, "Failed loading RabbitMQ client certificate") + } + conn, err = amqp.DialTLS(config.Url, cfg) + failOnError(err, "Failed to connect to RabbitMQ") + if err == nil { + klog.V(0).Infof("TLS Connection established") + } + } else { + conn, err = amqp.Dial(config.Url) + if err == nil { + klog.V(0).Infof("Non TLS Connection established") + } + } + failOnError(err, "Failed to connect to RabbitMQ") + notify := conn.NotifyClose(make(chan *amqp.Error)) + + ch, err := conn.Channel() + failOnError(err, "Failed to open channel") + + err = ch.ExchangeDeclare( + config.DeadLettersExchangeName, + "fanout", + true, + false, + true, + false, + nil, + ) + failOnError(err, "Failed to declare dead letter exchange") + + dq, err := ch.QueueDeclare( + config.DeadLettersQueueName, + false, + false, + false, + false, + nil, + ) + failOnError(err, "Failed to declare dead letter queue") + + err = ch.QueueBind( + dq.Name, + "#", + config.DeadLettersExchangeName, + false, + nil, + ) + failOnError(err, "Failed to declare dead letter binding") + + internalExchange := os.Getenv("RABBITMQ_EXCHANGE_INTERNAL") + + isInternalExchange := false + if internalExchange == "true" { + isInternalExchange = true + } + + err = ch.ExchangeDeclare( + config.ExchangeName, + config.ExchangeType, + true, + false, + isInternalExchange, + false, + nil, + ) + failOnError(err, "Failed to declare exchange") + + if config.OuterExchangeName != "" { + err = ch.ExchangeDeclare( + config.OuterExchangeName, + config.OuterExchangeType, + true, + false, + false, + false, + nil, + ) + failOnError(err, "Failed to declare outer exchange") + err = ch.ExchangeBind( + config.ExchangeName, + config.OuterExchangeBindingKey, + config.OuterExchangeName, + false, + nil, + ) + failOnError(err, "Failed to bind outer exchange") + } + q, err := ch.QueueDeclare( + config.QueueName, + false, + false, + false, + false, + amqp.Table{"x-dead-letter-exchange": config.DeadLettersExchangeName}, + ) + failOnError(err, "Failed to declare queue") + + err = ch.QueueBind( + q.Name, + config.QueueBindingKey, + config.ExchangeName, + false, + nil, + ) + failOnError(err, "Failed to declare binding") + + err = ch.Qos(config.QosPrefetchCount, 0, false) + failOnError(err, "Failed setting Qos") + + msgs, err := ch.Consume( + q.Name, + config.ConsumerName, + false, + false, + false, + false, + nil, + ) + if err != nil { + klog.Errorf("Failed to consume: %s", err) + } + + return &Amqp{ + ConsumedMessages: msgs, + Conn: conn, + Ch: ch, + Notify: notify, + }, nil +} + +func NewAmqpConfig() (amqpAdapter.Config, error) { + // @TODO this needs to be extracted to its own method + consumerId := os.Getenv("CONSUMER_ID") + if consumerId == "" { + // Work out consumer ID based on hostname: useful for k8s resources (pods controlled by deployment, statefulset) + hostname, err := os.Hostname() + if err != nil { + klog.Errorf("Could not set ConsumerID: %v", err) + } + pos := strings.LastIndex(hostname, "-") + consumerId = hostname[pos+1:] + } + + // @TODO This needs to be extracted to its own object + data := struct { + ConsumerId string + }{ + consumerId, + } + + tpl := template.New("queueName") + tpl, err := tpl.Parse(helpers.GetEnv("RABBITMQ_QUEUE_NAME", "")) + if err != nil { + klog.Errorf("Invalid RABBITMQ_QUEUE_NAME: %v", err) + } + var buf bytes.Buffer + err = tpl.Execute(&buf, data) + if err != nil { + klog.Errorf("Invalid RABBITMQ_QUEUE_NAME: %v", err) + } + queueName := buf.String() + + qosPrefetchCount, err := strconv.Atoi(os.Getenv("RABBITMQ_QOS_PREFETCH_COUNT")) + if err != nil { + qosPrefetchCount = 0 + } + + consumerName := os.Getenv("RABBITMQ_CONSUMER_NAME") + if consumerName == "" { + consumerName, _ = os.Hostname() + } + + return amqpAdapter.Config{ + Url: helpers.GetEnv("RABBITMQ_URL", ""), + DeadLettersExchangeName: helpers.GetEnv("RABBITMQ_DLX_NAME", ""), + DeadLettersQueueName: helpers.GetEnv("RABBITMQ_DLX_QUEUE_NAME", ""), + ExchangeName: helpers.GetEnv("RABBITMQ_EXCHANGE_NAME", ""), + ExchangeType: helpers.GetEnv("RABBITMQ_EXCHANGE_TYPE", "fanout"), + OuterExchangeName: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_NAME", ""), + OuterExchangeType: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_TYPE", ""), + OuterExchangeBindingKey: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_BINDING_KEY", ""), + QueueName: queueName, + QueueBindingKey: helpers.GetEnv("RABBITMQ_QUEUE_BINDING_KEY", "#"), + QosPrefetchCount: qosPrefetchCount, + ConsumerName: consumerName, + }, nil +} diff --git a/pkg/readers/reader.go b/pkg/readers/reader.go index 232eee4..4b9b594 100644 --- a/pkg/readers/reader.go +++ b/pkg/readers/reader.go @@ -15,3 +15,20 @@ func (r *Reader) Start() { go r.ReadAdapter.HandleAck(r.AckChannel) r.ReadAdapter.Listen(r.MsgChannel) } + +func NewAMQPReader(inputChannel chan messages.Message, ackChannel chan messages.Ack) (*Reader, error) { + + amqpConfig, err := adapters.NewAmqpConfig() + if err != nil { + return nil, err + } + adapter, err := adapters.NewAmqpReaderAdapter(amqpConfig) + if err != nil { + return nil, err + } + return &Reader{ + ReadAdapter: adapter, + MsgChannel: inputChannel, + AckChannel: ackChannel, + }, nil +} diff --git a/pkg/stress/main.go b/pkg/stress/main.go index fb2eae8..09a72b7 100644 --- a/pkg/stress/main.go +++ b/pkg/stress/main.go @@ -1,19 +1,17 @@ package main import ( - "github.com/sarulabs/dingo" - "github.com/softonic/homing-pigeon/pkg/generatedServices/dic" + "github.com/softonic/homing-pigeon/pkg/readers/adapters" "github.com/streadway/amqp" "k8s.io/klog" "log" ) func main() { - container, err := dic.NewContainer(dingo.App) + cfg, err := adapters.NewAmqpConfig() if err != nil { panic(err) } - cfg := container.GetAmqpConfig() conn, err := amqp.Dial(cfg.Url) failOnError(err, "Failed to connect to RabbitMQ") defer conn.Close() diff --git a/pkg/writers/adapters/elasticsearch.go b/pkg/writers/adapters/elasticsearch.go index 69e559e..1298d4a 100644 --- a/pkg/writers/adapters/elasticsearch.go +++ b/pkg/writers/adapters/elasticsearch.go @@ -4,10 +4,13 @@ import ( "bytes" "encoding/json" "errors" + "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esapi" "github.com/softonic/homing-pigeon/pkg/messages" esAdapter "github.com/softonic/homing-pigeon/pkg/writers/adapters/elasticsearch" "k8s.io/klog" + "os" + "strconv" "time" ) @@ -147,3 +150,25 @@ func (es *Elasticsearch) decodeBody(msg []byte) (esAdapter.ElasticsearchBody, er return body, err } + +func NewElasticsearchAdapter() (WriteAdapter, error) { + flushMaxSize, err := strconv.Atoi(os.Getenv("ELASTICSEARCH_FLUSH_MAX_SIZE")) + if err != nil { + flushMaxSize = 1 + } + + flushMaxIntervalMs, err := strconv.Atoi(os.Getenv("ELASTICSEARCH_FLUSH_MAX_INTERVAL_MS")) + if err != nil { + flushMaxIntervalMs = 1000 + } + + es, err := elasticsearch.NewClient(elasticsearch.Config{}) + if err != nil { + return nil, err + } + return &Elasticsearch{ + FlushMaxSize: flushMaxSize, + FlushInterval: time.Duration(flushMaxIntervalMs) * time.Millisecond, + Bulk: es.Bulk, + }, nil +} diff --git a/pkg/writers/writer.go b/pkg/writers/writer.go index 7598750..23cf6ab 100644 --- a/pkg/writers/writer.go +++ b/pkg/writers/writer.go @@ -64,3 +64,15 @@ func (ew *Writer) sendAcks(acks []messages.Ack, ackChannel chan<- messages.Ack) ackChannel <- ack } } + +func NewElasticsearchWriter(outputChannel chan messages.Message, ackChannel chan messages.Ack) (*Writer, error) { + adapter, err := adapters.NewElasticsearchAdapter() + if err != nil { + return nil, err + } + return &Writer{ + MsgChannel: outputChannel, + AckChannel: ackChannel, + WriteAdapter: adapter, + }, nil +} From ed70f1c9ad37a9ef857fbabeff1abe6418b93444 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 31 Jan 2022 16:33:15 +0100 Subject: [PATCH 07/37] update go mod --- docker-compose.yaml | 16 ++ go.mod | 28 +- go.sum | 616 +------------------------------------------- 3 files changed, 34 insertions(+), 626 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index a30f6af..003de85 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -34,6 +34,22 @@ services: environment: IN_SOCKET: "/tmp/hp" command: ["-stderrthreshold=INFO"] + hp-ack: + build: + context: . + dockerfile: hp-ack.Dockerfile + image: softonic/hp-ack:dev + environment: + SOCKET: "homing-pigeon:8090" + command: ["-stderrthreshold=INFO"] + hp-ack-2: + build: + context: . + dockerfile: hp-ack.Dockerfile + image: softonic/hp-ack:dev + environment: + SOCKET: "homing-pigeon:8090" + command: [ "-stderrthreshold=INFO" ] rabbit-mq: image: rabbitmq:3.8-management ports: diff --git a/go.mod b/go.mod index deb9a27..4989e82 100644 --- a/go.mod +++ b/go.mod @@ -2,28 +2,30 @@ module github.com/softonic/homing-pigeon require ( github.com/elastic/go-elasticsearch/v7 v7.10.0 - github.com/gobuffalo/envy v1.9.0 // indirect - github.com/gobuffalo/packd v1.0.0 // indirect - github.com/gobuffalo/packr v1.30.1 // indirect github.com/golang/protobuf v1.4.3 - github.com/golangci/golangci-lint v1.33.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/rakyll/gotest v0.0.5 // indirect - github.com/rogpeppe/go-internal v1.6.2 // indirect + github.com/google/uuid v1.3.0 github.com/sarulabs/dingo v2.0.0+incompatible github.com/streadway/amqp v1.0.0 - github.com/stretchr/objx v0.3.0 // indirect github.com/stretchr/testify v1.6.1 - github.com/vektra/mockery v1.1.2 // indirect + google.golang.org/grpc v1.33.2 + google.golang.org/protobuf v1.25.0 + k8s.io/klog v1.0.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/google/go-cmp v0.5.2 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/objx v0.3.0 // indirect golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect golang.org/x/text v0.3.4 // indirect - golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 // indirect - google.golang.org/grpc v1.33.2 - google.golang.org/protobuf v1.25.0 + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect - k8s.io/klog v1.0.0 ) go 1.17 diff --git a/go.sum b/go.sum index 6f8b900..1ccc672 100644 --- a/go.sum +++ b/go.sum @@ -1,142 +1,22 @@ -4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a h1:wFEQiK85fRsEVF0CRrPAos5LoAryUsIX1kPW/WrIqFw= -4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5 h1:XTrzB+F8+SpRmbhAH8HLxhiiG6nYNwaBZjrFps1oWEk= -github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard v1.0.1 h1:VlW4R6jmBIv3/u1JNlawEvJMM4J+dPORPaZasQee8Us= -github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bombsimon/wsl/v3 v3.1.0 h1:E5SRssoBgtVFPcYWUOFJEcgaySgdtTNYzsSKDOY7ss8= -github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daixiang0/gci v0.2.4 h1:BUCKk5nlK2m+kRIsoj+wb/5hazHvHeZieBKWd9Afa8Q= -github.com/daixiang0/gci v0.2.4/go.mod h1:+AV8KmHTGxxwp/pY84TLQfFKp2vuKXXJVzF3kD/hfR4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denis-tingajkin/go-header v0.3.1 h1:ymEpSiFjeItCy1FOP+x0M2KdCELdEAHUsNa8F+hHc6w= -github.com/denis-tingajkin/go-header v0.3.1/go.mod h1:sq/2IxMhaZX+RRcgHfCRx/m0M5na0fBt4/CRe7Lrji0= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/elastic/go-elasticsearch/v7 v7.4.1 h1:Kd/cwKNF5+tABpJ0t39Aucvb5QtYc8RAzy4nwVn1NnM= -github.com/elastic/go-elasticsearch/v7 v7.4.1/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elastic/go-elasticsearch/v7 v7.10.0 h1:vYRwqgFM46ZUHFMRdvKr+y1WA4ehJO6WqAGV9Btbl2o= github.com/elastic/go-elasticsearch/v7 v7.10.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-critic/go-critic v0.5.2 h1:3RJdgf6u4NZUumoP8nzbqiiNT8e1tC2Oc7jlgqre/IA= -github.com/go-critic/go-critic v0.5.2/go.mod h1:cc0+HvdE3lFpqLecgqMaJcvWWH77sLdBp+wLGPM1Yyo= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8= -github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v1.0.0 h1:4zxD8j3JRFNyLN46lodQuqz3xdKSrur7U/sr0SDS/gQ= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= -github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= -github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= -github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.8.1 h1:RUr68liRvs0TS1D5qdW3mQv2SjAsu1QWMCx1tG4kDjs= -github.com/gobuffalo/envy v1.8.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= -github.com/gobuffalo/envy v1.9.0 h1:eZR0DuEgVLfeIb1zIKt3bT4YovIMf9O9LXQeCZLXpqE= -github.com/gobuffalo/envy v1.9.0/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= -github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= -github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packd v1.0.0 h1:6ERZvJHfe24rfFmA9OaoKBdC7+c9sydrytMg8SdFGBM= -github.com/gobuffalo/packd v1.0.0/go.mod h1:6VTc4htmJRFB7u1m/4LeMTWjFoYrUiBkU9Fdec9hrhI= -github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= -github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= -github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gofrs/flock v0.8.0 h1:MSdYClljsF3PbENUUEx85nkWfJSGfzYI9yEBZOJz6CY= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -144,537 +24,81 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 h1:YYWNAGTKWhKpcLLt7aSj/odlKrSrelQwlovBpDuf19w= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZBf8NjltjWihK2QfBBBZuv91cMFfDHw= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= -github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d h1:pXTK/gkVNs7Zyy7WKgLXmpQ5bHTrq5GDsp8R9Qs67g0= -github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.33.0 h1:/o4OtOR3Idim4FHKBJXcy+6ZjNDm82gwK/v6+gWyH9U= -github.com/golangci/golangci-lint v1.33.0/go.mod h1:zMnMLSCaDlrXExYsuq2LOweE9CHVqYk5jexk23UsjYM= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 h1:EL/O5HGrF7Jaq0yNhBLucz9hTuRzj2LdwGBOaENgxIk= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 h1:leSNB7iYzLYSSx3J/s5sVf4Drkc68W2wm4Ixh/mr0us= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1aiNg8JbBMO2+E1WIQ+j/gL4SQqGPg= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gookit/color v1.3.1/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.1.0 h1:E4c8Y1EQURbBEAHoXc/jBTK7Np14ArT8NPUiSFOl9yc= -github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/comment v1.3.0 h1:wTVgynbFu8/nz6SGgywA0TcyIoAVsYc7ai/Zp5xNGlw= -github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jgautheron/goconst v0.0.0-20201117150253-ccae5bf973f3 h1:7nkB9fLPMwtn/R6qfPcHileL/x9ydlhw8XyDrLI1ZXg= -github.com/jgautheron/goconst v0.0.0-20201117150253-ccae5bf973f3/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a h1:GmsqmapfzSJkm28dhRoHz2tLRbJmqhU86IPgBtN3mmk= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3 h1:jNYPNLe3d8smommaoQlK7LOA5ESyUJJ+Wf79ZtA7Vp4= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kunwardeep/paralleltest v1.0.2 h1:/jJRv0TiqPoEy/Y8dQxCFJhD56uS/pnvtatgTZBHokU= -github.com/kunwardeep/paralleltest v1.0.2/go.mod h1:ZPqNm1fVHPllh5LPVujzbVz1JN2GhLxSfY+oqUsvG30= -github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= -github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/maratori/testpackage v1.0.1 h1:QtJ5ZjqapShm0w5DosRjg0PRlSdAdlx+W6cCKoALdbQ= -github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb h1:RHba4YImhrUVQDHUCe2BNSOz4tVy2yGyXhvYDvxGgeE= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mbilski/exhaustivestruct v1.1.0 h1:4ykwscnAFeHJruT+EY3M3vdeP8uXMh0VV2E61iR7XD8= -github.com/mbilski/exhaustivestruct v1.1.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EHf4= -github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= -github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nakabonne/nestif v0.3.0 h1:+yOViDGhg8ygGrmII72nV9B/zGxY188TYpfolntsaPw= -github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.1.0 h1:kVlMw8h2LHPMGUVqUj6230oQjjTMFjwcZrnkhXzFfl8= -github.com/nishanths/exhaustive v0.1.0/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v0.0.0-20201006195004-351e25ade6e3 h1:Amgs0nbayPhBNGh1qPqqr2e7B2qNAcBgRjnBH/lmn8k= -github.com/polyfloyd/go-errorlint v0.0.0-20201006195004-351e25ade6e3/go.mod h1:wi9BfjxjF/bwiZ701TzmfKu6UKC357IOAtNr0Td0Lvw= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= -github.com/quasilyte/go-ruleguard v0.2.0 h1:UOVMyH2EKkxIfzrULvA9n/tO+HtEhqD9mrLSWMr5FwU= -github.com/quasilyte/go-ruleguard v0.2.0/go.mod h1:2RT/tf0Ce0UDj5y243iWKosQogJd8+1G3Rs2fxmlYnw= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/rakyll/gotest v0.0.0-20191108192113-45d501058f2a h1:/kX+lZpr87Pb0yJKyxW40ZZO6jl52jFMmoQ0YhfwGLM= -github.com/rakyll/gotest v0.0.0-20191108192113-45d501058f2a/go.mod h1:jpFrc1UTqK0FtfF3doi3pEUBgWHYELkOPPECUlDsM2Q= -github.com/rakyll/gotest v0.0.5 h1:+BrdqPxKPDaxvhtIiVzfiYXLhi4BrSOqdwaEiA7qjpk= -github.com/rakyll/gotest v0.0.5/go.mod h1:SkoesdNCWmiD4R2dljIUcfSnNdVZ12y8qK4ojDkc2Sc= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.5.0 h1:Usqs0/lDK/NqTkvrmKSwA/3XkZAs7ZAW/eLeQ2MVBTw= -github.com/rogpeppe/go-internal v1.5.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.2 h1:aIihoIOHCiLZHxyoNQ+ABL4NKhFTgKLBdMLyEAh98m0= -github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.1.0 h1:DWbye9KyMgytn8uYpuHkwf0RHqAYO6Ay/D0TbCpPtVU= -github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= -github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= -github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sarulabs/dingo v2.0.0+incompatible h1:f9pmmm5cHdSOMQntbLqWh7rjmTXFR5oDOHMxbEurh1A= github.com/sarulabs/dingo v2.0.0+incompatible/go.mod h1:Jmr4WvEOXuTjOixjySJxjvnbELR7dmlYPX4szOBCcU4= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/securego/gosec/v2 v2.5.0 h1:kjfXLeKdk98gBe2+eYRFMpC4+mxmQQtbidpiiOQ69Qc= -github.com/securego/gosec/v2 v2.5.0/go.mod h1:L/CDXVntIff5ypVHIkqPXbtRpJiNCh6c6Amn68jXDjo= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= -github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/ssgreg/nlreturn/v2 v2.1.0 h1:6/s4Rc49L6Uo6RLjhWZGBpWWjfzk2yrf1nIW8m4wgVA= -github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 h1:WhxRHzgeVGETMlmVfqhRn8RIeeNoPr2Czh33I4Zdccw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tetafro/godot v1.3.0 h1:rKXb6aAz2AnwS98jYlU3snCFFXnIInQdaGiftNwpj+k= -github.com/tetafro/godot v1.3.0/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck v0.0.0-20200807122107-df9e8bcb914d h1:3EZyvNUMsGD1QA8cu0STNn1L7I77rvhf2IhOcHYQhSw= -github.com/tomarrell/wrapcheck v0.0.0-20200807122107-df9e8bcb914d/go.mod h1:yiFB6fFoV7saXirUGfuK+cPtUh4NX/Hf5y2WC2lehu0= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa h1:RC4maTWLKKwb7p1cnoygsbKIgNlJqSYBeAFON3Ar8As= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.4 h1:If7Va4cM03mpgrNH9k49/VOicWpGoG70XPBFFODYDsg= -github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/uudashr/gocognit v1.0.1 h1:MoG2fZ0b/Eo7NXoIwCVFLG5JED3qgQz5/NEE+rOsjPs= -github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= -github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5 h1:Xim2mBRFdXzXmKRO8DJg/FJtn/8Fj9NOEpO6+WuMPmk= -github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5/go.mod h1:ppEjwdhyy7Y31EnHRDm1JkChoC7LXIJ7Ex0VYLWtZtQ= -github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4= -github.com/vektra/mockery v1.1.2/go.mod h1:VcfZjKaFOPO+MpN4ZvwPjs4c48lkq1o3Ym8yHZJu0jU= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181112210238-4b1f3b6b1646/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c h1:KfpJVdWhuRqNk4XVXzjXf2KAV4TBEP77SYdFGjeGuIE= -golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191212051200-825cb0626375 h1:hrBCt+pkb1irxFjg/GeadSn24gLxi5/Z861I53OkQbc= -golang.org/x/tools v0.0.0-20191212051200-825cb0626375/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201007032633-0806396f153e/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201011145850-ed2f50202694/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb h1:z5+u0pkAUPUWd3taoTialQ2JAMo4Wo1Z3L25U4ZV9r0= -golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y= -google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 h1:Rt0FRalMgdSlXAVJvX4pr65KfqaxHXSLkSJRD9pw6g0= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= @@ -685,52 +109,18 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc= -honnef.co/go/tools v0.0.1-2020.1.6/go.mod h1:pyyisuGw24ruLjrr1ddx39WE0y9OooInRzEYLhQB2YY= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ= -mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d/go.mod h1:bzrjFmaD6+xqohD3KYP0H2FEuxknnBmyyOxdhLdaIws= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7 h1:kAREL6MPwpsk1/PQPFD3Eg7WAQR5mPTWZJaBiG5LDbY= -mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From a6d60f838ea10e15aa5b436ccee1d2ca431f2501 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 31 Jan 2022 16:35:48 +0100 Subject: [PATCH 08/37] Remove ack broker client (example) --- docker-compose.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 003de85..a30f6af 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -34,22 +34,6 @@ services: environment: IN_SOCKET: "/tmp/hp" command: ["-stderrthreshold=INFO"] - hp-ack: - build: - context: . - dockerfile: hp-ack.Dockerfile - image: softonic/hp-ack:dev - environment: - SOCKET: "homing-pigeon:8090" - command: ["-stderrthreshold=INFO"] - hp-ack-2: - build: - context: . - dockerfile: hp-ack.Dockerfile - image: softonic/hp-ack:dev - environment: - SOCKET: "homing-pigeon:8090" - command: [ "-stderrthreshold=INFO" ] rabbit-mq: image: rabbitmq:3.8-management ports: From 690ee53cb548e3e7861c6784482d22c0cb07bbcb Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 31 Jan 2022 17:03:05 +0100 Subject: [PATCH 09/37] grpc.withinsecure is deprecated --- go.mod | 27 +++++--- go.sum | 106 ++++++++++++++++++++++++++++++++ pkg/middleware/manager.go | 3 +- pkg/middleware/unimplemented.go | 3 +- 4 files changed, 127 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 4989e82..4b42c62 100644 --- a/go.mod +++ b/go.mod @@ -2,30 +2,37 @@ module github.com/softonic/homing-pigeon require ( github.com/elastic/go-elasticsearch/v7 v7.10.0 - github.com/golang/protobuf v1.4.3 + github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.3.0 github.com/sarulabs/dingo v2.0.0+incompatible github.com/streadway/amqp v1.0.0 - github.com/stretchr/testify v1.6.1 - google.golang.org/grpc v1.33.2 - google.golang.org/protobuf v1.25.0 + github.com/stretchr/testify v1.7.0 + google.golang.org/grpc v1.44.0 + google.golang.org/protobuf v1.27.1 k8s.io/klog v1.0.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/google/go-cmp v0.5.2 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/google/go-cmp v0.5.5 // indirect github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rakyll/gotest v0.0.6 // indirect github.com/stretchr/objx v0.3.0 // indirect - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect - golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect - golang.org/x/text v0.3.4 // indirect + github.com/vektra/mockery v1.1.2 // indirect + golang.org/x/mod v0.5.1 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/tools v0.1.9 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 // indirect + google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) go 1.17 diff --git a/go.sum b/go.sum index 1ccc672..6db670d 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,19 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -12,20 +23,33 @@ github.com/elastic/go-elasticsearch/v7 v7.10.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyEr github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -33,76 +57,149 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rakyll/gotest v0.0.6 h1:hBTqkO3jiuwYW/M9gL4bu0oTYcm8J6knQAAPUsJsz1I= +github.com/rakyll/gotest v0.0.6/go.mod h1:SkoesdNCWmiD4R2dljIUcfSnNdVZ12y8qK4ojDkc2Sc= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/sarulabs/dingo v2.0.0+incompatible h1:f9pmmm5cHdSOMQntbLqWh7rjmTXFR5oDOHMxbEurh1A= github.com/sarulabs/dingo v2.0.0+incompatible/go.mod h1:Jmr4WvEOXuTjOixjySJxjvnbELR7dmlYPX4szOBCcU4= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4= +github.com/vektra/mockery v1.1.2/go.mod h1:VcfZjKaFOPO+MpN4ZvwPjs4c48lkq1o3Ym8yHZJu0jU= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 h1:Rt0FRalMgdSlXAVJvX4pr65KfqaxHXSLkSJRD9pw6g0= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 h1:YxHp5zqIcAShDEvRr5/0rVESVS+njYF68PSdazrNLJo= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0-pre h1:PVZrwq0Uyu/ItyjGm2UJMD65GYT5F32WIornvBYEPrE= +google.golang.org/grpc v1.28.0-pre/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -114,12 +211,21 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= diff --git a/pkg/middleware/manager.go b/pkg/middleware/manager.go index de3d013..7ceb596 100644 --- a/pkg/middleware/manager.go +++ b/pkg/middleware/manager.go @@ -6,6 +6,7 @@ import ( "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/proto" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "k8s.io/klog" "time" ) @@ -28,7 +29,7 @@ func (m *MiddlwareManager) Start() { klog.V(1).Infof("Middlewares available") var opts []grpc.DialOption - opts = append(opts, grpc.WithInsecure()) + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) opts = append(opts, grpc.WithBlock()) conn, err := grpc.Dial(m.MiddlewareAddress, opts...) diff --git a/pkg/middleware/unimplemented.go b/pkg/middleware/unimplemented.go index 3c53278..8873c07 100644 --- a/pkg/middleware/unimplemented.go +++ b/pkg/middleware/unimplemented.go @@ -5,6 +5,7 @@ import ( . "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/proto" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "k8s.io/klog" "net" "os" @@ -68,7 +69,7 @@ func (b *UnimplementedMiddleware) getOutputGrpc() (*grpc.ClientConn, *proto.Midd nextSocketAddr := GetEnv("OUT_SOCKET", "") if nextSocketAddr != "" { var opts []grpc.DialOption - opts = append(opts, grpc.WithInsecure()) + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) opts = append(opts, grpc.WithBlock()) conn, err := grpc.Dial(nextSocketAddr, opts...) From 69ecaa6715f962e234c8cbc4c9cad259e710bafa Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 31 Jan 2022 17:15:14 +0100 Subject: [PATCH 10/37] Fix unhandled error --- pkg/ack/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/ack/server.go b/pkg/ack/server.go index b15b89e..4e73a0a 100644 --- a/pkg/ack/server.go +++ b/pkg/ack/server.go @@ -39,10 +39,14 @@ func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckEvent_GetM for message := range s.InputChannel { klog.V(1).Info("Sending ACK to clients") for _, client := range s.GetClientsCopy() { - client.Send(&proto.Message{ + err := client.Send(&proto.Message{ Body: message.Body, Ack: message.Ack, }) + + if err != nil { + klog.Errorf("Error sending to grpc client: %v", err) + } } } return nil From b8aada19c0ace69f00aa57e308cd91055dc0a1d4 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 31 Jan 2022 17:24:33 +0100 Subject: [PATCH 11/37] Remove services container --- pkg/services/container.go | 400 -------------------------------------- 1 file changed, 400 deletions(-) delete mode 100644 pkg/services/container.go diff --git a/pkg/services/container.go b/pkg/services/container.go deleted file mode 100644 index 1959db3..0000000 --- a/pkg/services/container.go +++ /dev/null @@ -1,400 +0,0 @@ -package services - -import ( - "bytes" - "crypto/tls" - "crypto/x509" - elasticsearch "github.com/elastic/go-elasticsearch/v7" - "github.com/sarulabs/dingo" - "github.com/softonic/homing-pigeon/pkg/ack" - "github.com/softonic/homing-pigeon/pkg/helpers" - "github.com/softonic/homing-pigeon/pkg/messages" - "github.com/softonic/homing-pigeon/pkg/middleware" - "github.com/softonic/homing-pigeon/pkg/readers" - readAdapters "github.com/softonic/homing-pigeon/pkg/readers/adapters" - amqpAdapter "github.com/softonic/homing-pigeon/pkg/readers/adapters/amqp" - "github.com/softonic/homing-pigeon/pkg/writers" - writeAdapters "github.com/softonic/homing-pigeon/pkg/writers/adapters" - "github.com/streadway/amqp" - "html/template" - "io/ioutil" - "k8s.io/klog" - "os" - "strconv" - "strings" - "time" -) - -var Container = []dingo.Def{ - { - Name: "Reader", - Build: func(InputMiddlewareChannel chan messages.Message, ackChannel chan messages.Ack, readAdapter readAdapters.ReadAdapter) (*readers.Reader, error) { - return &readers.Reader{ - ReadAdapter: readAdapter, - MsgChannel: InputMiddlewareChannel, - AckChannel: ackChannel, - }, nil - }, - Params: dingo.Params{ - "0": dingo.Service("InputMiddlewareChannel"), - "1": dingo.Service("AckChannel"), - "2": dingo.Service("AmqpAdapter"), - }, - }, - { - Name: "DummyAdapter", - Build: func() (readAdapters.ReadAdapter, error) { - return &readAdapters.Dummy{}, nil - }, - }, - { - Name: "AmqpAdapter", - Build: func(config amqpAdapter.Config) (readAdapters.ReadAdapter, error) { - failOnError := func(err error, msg string) { - if err != nil { - klog.Errorf("%s: %s", msg, err) - } - } - var err error - var conn *amqp.Connection - caPath := os.Getenv("RABBITMQ_CA_PATH") - - if caPath != "" { - cfg := new(tls.Config) - cfg.RootCAs = x509.NewCertPool() - ca, err := ioutil.ReadFile(caPath) - if err == nil { - cfg.RootCAs.AppendCertsFromPEM(ca) - klog.V(0).Infof("Added CA certificate %s", caPath) - } - failOnError(err, "Failed loading RabbitMQ CA") - - tlsClientCert := os.Getenv("RABBITMQ_TLS_CLIENT_CERT") - tlsClientKey := os.Getenv("RABBITMQ_TLS_CLIENT_KEY") - if tlsClientCert != "" && tlsClientKey != "" { - cert, err := tls.LoadX509KeyPair(tlsClientCert, tlsClientKey) - if err == nil { - cfg.Certificates = append(cfg.Certificates, cert) - klog.V(0).Infof("Loaded RabbitMQ client cert %s", tlsClientCert) - klog.V(0).Infof("Loaded RabbitMQ client key %s", tlsClientKey) - } - failOnError(err, "Failed loading RabbitMQ client certificate") - } - conn, err = amqp.DialTLS(config.Url, cfg) - klog.V(0).Infof("TLS Connection established") - } else { - conn, err = amqp.Dial(config.Url) - klog.V(0).Infof("Non TLS Connection established") - } - failOnError(err, "Failed to connect to RabbitMQ") - notify := conn.NotifyClose(make(chan *amqp.Error)) - - ch, err := conn.Channel() - failOnError(err, "Failed to open channel") - - err = ch.ExchangeDeclare( - config.DeadLettersExchangeName, - "fanout", - true, - false, - true, - false, - nil, - ) - failOnError(err, "Failed to declare dead letter exchange") - - dq, err := ch.QueueDeclare( - config.DeadLettersQueueName, - false, - false, - false, - false, - nil, - ) - failOnError(err, "Failed to declare dead letter queue") - - err = ch.QueueBind( - dq.Name, - "#", - config.DeadLettersExchangeName, - false, - nil, - ) - failOnError(err, "Failed to declare dead letter binding") - - internalExchange := os.Getenv("RABBITMQ_EXCHANGE_INTERNAL") - - isInternalExchange := false - if internalExchange == "true" { - isInternalExchange = true - } - - err = ch.ExchangeDeclare( - config.ExchangeName, - config.ExchangeType, - true, - false, - isInternalExchange, - false, - nil, - ) - failOnError(err, "Failed to declare exchange") - - if config.OuterExchangeName != "" { - err = ch.ExchangeDeclare( - config.OuterExchangeName, - config.OuterExchangeType, - true, - false, - false, - false, - nil, - ) - failOnError(err, "Failed to declare outer exchange") - err = ch.ExchangeBind( - config.ExchangeName, - config.OuterExchangeBindingKey, - config.OuterExchangeName, - false, - nil, - ) - failOnError(err, "Failed to bind outer exchange") - } - q, err := ch.QueueDeclare( - config.QueueName, - false, - false, - false, - false, - amqp.Table{"x-dead-letter-exchange": config.DeadLettersExchangeName}, - ) - failOnError(err, "Failed to declare queue") - - err = ch.QueueBind( - q.Name, - config.QueueBindingKey, - config.ExchangeName, - false, - nil, - ) - failOnError(err, "Failed to declare binding") - - err = ch.Qos(config.QosPrefetchCount, 0, false) - failOnError(err, "Failed setting Qos") - - msgs, err := ch.Consume( - q.Name, - config.ConsumerName, - false, - false, - false, - false, - nil, - ) - if err != nil { - klog.Errorf("Failed to consume: %s", err) - } - - return &readAdapters.Amqp{ - ConsumedMessages: msgs, - Conn: conn, - Ch: ch, - Notify: notify, - }, nil - }, - Params: dingo.Params{ - "0": dingo.Service("AmqpConfig"), - }, - }, - { - Name: "AmqpConfig", - Build: func() (amqpAdapter.Config, error) { - // @TODO this needs to be extracted to its own method - consumerId := os.Getenv("CONSUMER_ID") - if consumerId == "" { - // Work out consumer ID based on hostname: useful for k8s resources (pods controlled by deployment, statefulset) - hostname, err := os.Hostname() - if err != nil { - klog.Errorf("Could not set ConsumerID: %v", err) - } - pos := strings.LastIndex(hostname, "-") - consumerId = hostname[pos+1:] - } - - // @TODO This needs to be extracted to its own object - data := struct { - ConsumerId string - }{ - consumerId, - } - - tpl := template.New("queueName") - tpl, err := tpl.Parse(helpers.GetEnv("RABBITMQ_QUEUE_NAME", "")) - if err != nil { - klog.Errorf("Invalid RABBITMQ_QUEUE_NAME: %v", err) - } - var buf bytes.Buffer - err = tpl.Execute(&buf, data) - if err != nil { - klog.Errorf("Invalid RABBITMQ_QUEUE_NAME: %v", err) - } - queueName := buf.String() - - qosPrefetchCount, err := strconv.Atoi(os.Getenv("RABBITMQ_QOS_PREFETCH_COUNT")) - if err != nil { - qosPrefetchCount = 0 - } - - consumerName := os.Getenv("RABBITMQ_CONSUMER_NAME") - if consumerName == "" { - consumerName, _ = os.Hostname() - } - - return amqpAdapter.Config{ - Url: helpers.GetEnv("RABBITMQ_URL", ""), - DeadLettersExchangeName: helpers.GetEnv("RABBITMQ_DLX_NAME", ""), - DeadLettersQueueName: helpers.GetEnv("RABBITMQ_DLX_QUEUE_NAME", ""), - ExchangeName: helpers.GetEnv("RABBITMQ_EXCHANGE_NAME", ""), - ExchangeType: helpers.GetEnv("RABBITMQ_EXCHANGE_TYPE", "fanout"), - OuterExchangeName: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_NAME", ""), - OuterExchangeType: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_TYPE", ""), - OuterExchangeBindingKey: helpers.GetEnv("RABBITMQ_OUTER_EXCHANGE_BINDING_KEY", ""), - QueueName: queueName, - QueueBindingKey: helpers.GetEnv("RABBITMQ_QUEUE_BINDING_KEY", "#"), - QosPrefetchCount: qosPrefetchCount, - ConsumerName: consumerName, - }, nil - }, - }, - { - Name: "Middleware", - Build: func(InputMiddlewareChannel chan messages.Message, OutputMiddlewareChannel chan messages.Message) (*middleware.MiddlwareManager, error) { - return &middleware.MiddlwareManager{ - InputChannel: InputMiddlewareChannel, - OutputChannel: OutputMiddlewareChannel, - MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), - }, nil - }, - Params: dingo.Params{ - "0": dingo.Service("InputMiddlewareChannel"), - "1": dingo.Service("OutputMiddlewareChannel"), - }, - }, - { - Name: "AckManager", - Build: func(inputChannel chan messages.Ack, outputChannel chan messages.Ack, brokerChannel chan messages.Ack) (*ack.Manager, error) { - return &ack.Manager{ - InputChannel: inputChannel, - OutputChannel: outputChannel, - BrokerChannel: brokerChannel, - BrokerAddress: helpers.GetEnv("ACK_BROKER_ADDRESS", ""), - }, nil - }, - Params: dingo.Params{ - "0": dingo.Service("AckManagerChannel"), - "1": dingo.Service("AckChannel"), - "2": dingo.Service("AckBrokerChannel"), - }, - }, - { - Name: "Writer", - Build: func(OutputMiddlewareChannel chan messages.Message, ackChannel chan messages.Ack, writeAdapter writeAdapters.WriteAdapter) (*writers.Writer, error) { - return &writers.Writer{ - MsgChannel: OutputMiddlewareChannel, - AckChannel: ackChannel, - WriteAdapter: writeAdapter, - }, nil - }, - Params: dingo.Params{ - "0": dingo.Service("OutputMiddlewareChannel"), - "1": dingo.Service("AckManagerChannel"), - "2": dingo.Service("ElasticsearchAdapter"), - }, - }, - - { - Name: "ElasticsearchAdapter", - Build: func() (writeAdapters.WriteAdapter, error) { - flushMaxSize, err := strconv.Atoi(os.Getenv("ELASTICSEARCH_FLUSH_MAX_SIZE")) - if err != nil { - flushMaxSize = 1 - } - - flushMaxIntervalMs, err := strconv.Atoi(os.Getenv("ELASTICSEARCH_FLUSH_MAX_INTERVAL_MS")) - if err != nil { - flushMaxIntervalMs = 1000 - } - - es, err := elasticsearch.NewClient(elasticsearch.Config{}) - if err != nil { - return nil, err - } - return &writeAdapters.Elasticsearch{ - FlushMaxSize: flushMaxSize, - FlushInterval: time.Duration(flushMaxIntervalMs) * time.Millisecond, - Bulk: es.Bulk, - }, nil - }, - }, - { - Name: "NopAdapter", - Build: func() (writeAdapters.WriteAdapter, error) { - return &writeAdapters.Nop{}, nil - }, - }, - { - Name: "InputMiddlewareChannel", - Build: func() (chan messages.Message, error) { - bufLen, err := strconv.Atoi(os.Getenv("MESSAGE_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - c := make(chan messages.Message, bufLen) - return c, nil - }, - }, - { - Name: "OutputMiddlewareChannel", - Build: func() (chan messages.Message, error) { - bufLen, err := strconv.Atoi(os.Getenv("MESSAGE_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - c := make(chan messages.Message, bufLen) - return c, nil - }, - }, - { - Name: "AckChannel", - Build: func() (chan messages.Ack, error) { - bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - c := make(chan messages.Ack, bufLen) - return c, nil - }, - }, - { - Name: "AckManagerChannel", - Build: func() (chan messages.Ack, error) { - bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - c := make(chan messages.Ack, bufLen) - return c, nil - }, - }, - { - Name: "AckBrokerChannel", - Build: func() (chan messages.Ack, error) { - bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - c := make(chan messages.Ack, bufLen) - return c, nil - }, - }, -} From a8bd165eeca2026b62e97186d64ce5887cfab7de Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Tue, 1 Feb 2022 18:54:58 +0100 Subject: [PATCH 12/37] Skeleton to add new adapters --- .gitignore | 1 - pkg/main.go | 19 ++++++++++++------- pkg/readers/reader.go | 33 +++++++++++++++++++++++---------- pkg/writers/adapters/dummy.go | 28 ++++++++++++++++++++++++++++ pkg/writers/writer.go | 21 +++++++++++++++------ 5 files changed, 78 insertions(+), 24 deletions(-) create mode 100644 pkg/writers/adapters/dummy.go diff --git a/.gitignore b/.gitignore index 3e36fe4..c8d20de 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,5 @@ *.out # Ignore generated files -pkg/generatedServices bin sockets diff --git a/pkg/main.go b/pkg/main.go index 2915cbf..5c651bc 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -19,24 +19,29 @@ func main() { bufLen = 0 } inputChannel := make(chan messages.Message, bufLen) - ackChannel := make(chan messages.Ack, bufLen) outputChannel := make(chan messages.Message, bufLen) - ackManagerChannel := make(chan messages.Ack, bufLen) + + bufLen, err = strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) + if err != nil { + bufLen = 0 + } + ackChannel := make(chan messages.Ack, bufLen) brokerAckChannel := make(chan messages.Ack, bufLen) + ackManagerChannel := make(chan messages.Ack, bufLen) - reader, err := readers.NewAMQPReader(inputChannel, ackChannel) + reader, err := readers.NewReader(inputChannel, ackChannel) if err != nil { panic(err) } - middlewareManager := middleware.NewMiddlewareManager(inputChannel, outputChannel) - ackManager := ack.NewAckManager(ackManagerChannel, ackChannel, brokerAckChannel) - - writer, err := writers.NewElasticsearchWriter(outputChannel, ackManagerChannel) + writer, err := writers.NewWriter(outputChannel, ackManagerChannel) if err != nil { panic(err) } + middlewareManager := middleware.NewMiddlewareManager(inputChannel, outputChannel) + ackManager := ack.NewAckManager(ackManagerChannel, ackChannel, brokerAckChannel) + go reader.Start() go middlewareManager.Start() go ackManager.Start() diff --git a/pkg/readers/reader.go b/pkg/readers/reader.go index 4b9b594..215cd58 100644 --- a/pkg/readers/reader.go +++ b/pkg/readers/reader.go @@ -1,6 +1,7 @@ package readers import ( + "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/pkg/readers/adapters" ) @@ -16,19 +17,31 @@ func (r *Reader) Start() { r.ReadAdapter.Listen(r.MsgChannel) } -func NewAMQPReader(inputChannel chan messages.Message, ackChannel chan messages.Ack) (*Reader, error) { +func NewReader(inputChannel chan messages.Message, ackChannel chan messages.Ack) (*Reader, error) { - amqpConfig, err := adapters.NewAmqpConfig() - if err != nil { - return nil, err - } - adapter, err := adapters.NewAmqpReaderAdapter(amqpConfig) - if err != nil { - return nil, err + var err error + var readAdapter adapters.ReadAdapter + adapter := helpers.GetEnv("READ_ADAPTER", "") + + switch adapter { + case "dummy": + readAdapter, err = &adapters.Dummy{}, nil + default: + readAdapter, err = NewAMQPAdapter() } + return &Reader{ - ReadAdapter: adapter, + ReadAdapter: readAdapter, MsgChannel: inputChannel, AckChannel: ackChannel, - }, nil + }, err +} + +func NewAMQPAdapter() (adapters.ReadAdapter, error) { + + amqpConfig, err := adapters.NewAmqpConfig() + if err != nil { + return nil, err + } + return adapters.NewAmqpReaderAdapter(amqpConfig) } diff --git a/pkg/writers/adapters/dummy.go b/pkg/writers/adapters/dummy.go new file mode 100644 index 0000000..39f97d9 --- /dev/null +++ b/pkg/writers/adapters/dummy.go @@ -0,0 +1,28 @@ +package adapters + +import ( + "github.com/softonic/homing-pigeon/pkg/messages" + "time" +) + +type Dummy struct{} + +func (d *Dummy) ProcessMessages(msgs []messages.Message) []messages.Ack { + var processedMsg []messages.Ack + for i := 0; i < len(msgs); i++ { + processedMsg = append(processedMsg, messages.Ack{ + Id: uint64(i), + Body: msgs[i].Body, + Ack: true, + }) + } + return processedMsg +} + +func (d *Dummy) ShouldProcess(msgs []messages.Message) bool { + return len(msgs) > 0 +} + +func (d *Dummy) GetTimeout() time.Duration { + return time.Second +} diff --git a/pkg/writers/writer.go b/pkg/writers/writer.go index 23cf6ab..25b5f79 100644 --- a/pkg/writers/writer.go +++ b/pkg/writers/writer.go @@ -1,6 +1,7 @@ package writers import ( + "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/pkg/writers/adapters" "sync" @@ -65,14 +66,22 @@ func (ew *Writer) sendAcks(acks []messages.Ack, ackChannel chan<- messages.Ack) } } -func NewElasticsearchWriter(outputChannel chan messages.Message, ackChannel chan messages.Ack) (*Writer, error) { - adapter, err := adapters.NewElasticsearchAdapter() - if err != nil { - return nil, err +func NewWriter(outputChannel chan messages.Message, ackChannel chan messages.Ack) (*Writer, error) { + + var err error + var writeAdapter adapters.WriteAdapter + adapter := helpers.GetEnv("WRITE_ADAPTER", "") + + switch adapter { + case "dummy": + writeAdapter, err = &adapters.Dummy{}, nil + default: + writeAdapter, err = adapters.NewElasticsearchAdapter() } + return &Writer{ MsgChannel: outputChannel, AckChannel: ackChannel, - WriteAdapter: adapter, - }, nil + WriteAdapter: writeAdapter, + }, err } From ae355fae07f6cdca2cb8d9135bb26936d9238be7 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Tue, 1 Feb 2022 18:57:12 +0100 Subject: [PATCH 13/37] Rename broker address to broker port --- README.md | 2 +- docker-compose.yaml | 2 +- pkg/ack/manager.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5bd5133..29ebfda 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ In order to start up correctly, it needs well defined environment variables: | MESSAGE_BUFFER_LENGTH | Buffer length for internal golang channel used for messaging | | ACK_BUFFER_LENGTH | Buffer length for internal golang channel used for acks | | MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | -| ACK_BROKER_ADDRESS | Channel to send ACK message stream. Ex: localhost:12345" | +| ACK_BROKER_PORT | Channel to send ACK message stream. Ex: localhost:12345" | ##### Read Adapters diff --git a/docker-compose.yaml b/docker-compose.yaml index a30f6af..2c3b547 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,7 +26,7 @@ services: GRPC_GO_LOG_VERBOSITY_LEVEL: 99 GRPC_GO_LOG_SEVERITY_LEVEL: info MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" - ACK_BROKER_ADDRESS: ":8090" + ACK_BROKER_PORT: ":8090" hp-middleware-pass: volumes: - ./sockets:/tmp diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go index 12e18ce..b187614 100644 --- a/pkg/ack/manager.go +++ b/pkg/ack/manager.go @@ -15,11 +15,11 @@ type Manager struct { InputChannel <-chan messages.Ack OutputChannel chan<- messages.Ack BrokerChannel chan messages.Ack - BrokerAddress string + BrokerPort string } func (t *Manager) StartServer() { - lis, err := net.Listen("tcp", t.BrokerAddress) + lis, err := net.Listen("tcp", t.BrokerPort) if err != nil { klog.Errorf("Failed to listen: %v", err) } @@ -51,7 +51,7 @@ func (t *Manager) Start() { } func (t *Manager) ShouldStartAckBroker() bool { - if t.BrokerAddress == "" { + if t.BrokerPort == "" { klog.V(1).Info("ACK-Manager not available") return false } @@ -63,6 +63,6 @@ func NewAckManager(inputChannel chan messages.Ack, outputChannel chan messages.A InputChannel: inputChannel, OutputChannel: outputChannel, BrokerChannel: brokerChannel, - BrokerAddress: helpers.GetEnv("ACK_BROKER_ADDRESS", ""), + BrokerPort: helpers.GetEnv("ACK_BROKER_PORT", ""), } } From b812d6e0b400e9cf2dde3109a7212d55f89f21a3 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Tue, 1 Feb 2022 19:02:44 +0100 Subject: [PATCH 14/37] Add ENV variables to choose between adapters --- README.md | 14 ++++++++------ docker-compose.yaml | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 29ebfda..6c63218 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,14 @@ In order to start up correctly, it needs well defined environment variables: ##### Core -| Name | Value | -|--------------------------------------|----------------------------------------------------------------------------| -| MESSAGE_BUFFER_LENGTH | Buffer length for internal golang channel used for messaging | -| ACK_BUFFER_LENGTH | Buffer length for internal golang channel used for acks | -| MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | -| ACK_BROKER_PORT | Channel to send ACK message stream. Ex: localhost:12345" | +| Name | Value | +|-----------------------|----------------------------------------------------------------------------| +| MESSAGE_BUFFER_LENGTH | Buffer length for internal golang channel used for messaging | +| ACK_BUFFER_LENGTH | Buffer length for internal golang channel used for acks | +| MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | +| READ_ADAPTER | Read interface implementation. Default: amqp | +| WRITE_ADAPTER | Write interface implementation. Default: elasticsearch | +| ACK_BROKER_PORT | Channel to send ACK message stream. Ex: localhost:12345" | ##### Read Adapters diff --git a/docker-compose.yaml b/docker-compose.yaml index 2c3b547..4c262ea 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,6 +26,8 @@ services: GRPC_GO_LOG_VERBOSITY_LEVEL: 99 GRPC_GO_LOG_SEVERITY_LEVEL: info MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" + READ_ADAPTER: "amqp" + WRITE_ADAPTER: "elasticsearch" ACK_BROKER_PORT: ":8090" hp-middleware-pass: volumes: From 32b3184e61c69e3294a15b67291ac01efd46a72d Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 7 Feb 2022 15:41:35 +0100 Subject: [PATCH 15/37] Broker middleware --- Makefile | 2 +- README.md | 2 +- docker-compose.yaml | 2 +- pkg/ack/manager.go | 68 --------------- pkg/ack/server.go | 53 ------------ pkg/main.go | 40 ++++----- pkg/middleware/broker.go | 53 ++++++++++++ pkg/middleware/manager.go | 83 ++++++++++++++++--- proto/{ack_event.pb.go => broker.pb.go} | 106 ++++++++++++------------ proto/{ack_event.proto => broker.proto} | 10 +-- proto/middleware.proto | 1 - 11 files changed, 205 insertions(+), 215 deletions(-) delete mode 100644 pkg/ack/manager.go delete mode 100644 pkg/ack/server.go create mode 100644 pkg/middleware/broker.go rename proto/{ack_event.pb.go => broker.pb.go} (56%) rename proto/{ack_event.proto => broker.proto} (59%) diff --git a/Makefile b/Makefile index 1277172..0f7ce7c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ TAG ?= dev generate-proto: protoc -I proto/ proto/middleware.proto --go_out=plugins=grpc:proto - protoc -I proto/ proto/ack_event.proto --go_out=plugins=grpc:proto + protoc -I proto/ proto/broker.proto --go_out=plugins=grpc:proto dep: go get -u github.com/rakyll/gotest go get -u github.com/vektra/mockery/.../ diff --git a/README.md b/README.md index 6c63218..dd03d34 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ In order to start up correctly, it needs well defined environment variables: | MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | | READ_ADAPTER | Read interface implementation. Default: amqp | | WRITE_ADAPTER | Write interface implementation. Default: elasticsearch | -| ACK_BROKER_PORT | Channel to send ACK message stream. Ex: localhost:12345" | +| RESPONSE_BROKER_PORT | TCP port where broker will emit each response Ex: ":12345" | ##### Read Adapters diff --git a/docker-compose.yaml b/docker-compose.yaml index 4c262ea..64125ed 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,7 +28,7 @@ services: MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" READ_ADAPTER: "amqp" WRITE_ADAPTER: "elasticsearch" - ACK_BROKER_PORT: ":8090" + RESPONSE_BROKER_PORT: ":8090" hp-middleware-pass: volumes: - ./sockets:/tmp diff --git a/pkg/ack/manager.go b/pkg/ack/manager.go deleted file mode 100644 index b187614..0000000 --- a/pkg/ack/manager.go +++ /dev/null @@ -1,68 +0,0 @@ -package ack - -import ( - "github.com/softonic/homing-pigeon/pkg/helpers" - "github.com/softonic/homing-pigeon/pkg/messages" - "github.com/softonic/homing-pigeon/proto" - "google.golang.org/grpc" - "k8s.io/klog" - "net" - "sync" -) - -// @TODO Tests missing -type Manager struct { - InputChannel <-chan messages.Ack - OutputChannel chan<- messages.Ack - BrokerChannel chan messages.Ack - BrokerPort string -} - -func (t *Manager) StartServer() { - lis, err := net.Listen("tcp", t.BrokerPort) - if err != nil { - klog.Errorf("Failed to listen: %v", err) - } - - grpcServer := grpc.NewServer(grpc.MaxConcurrentStreams(10)) - proto.RegisterAckEventServer(grpcServer, &Server{ - clients: make(map[string]proto.AckEvent_GetMessagesServer), - InputChannel: t.BrokerChannel, - mu: sync.RWMutex{}, - }) - - klog.V(1).Info("ACK-Manager listening...") - err = grpcServer.Serve(lis) - if err != nil { - klog.Error(err) - } -} - -func (t *Manager) Start() { - - if t.ShouldStartAckBroker() { - go t.StartServer() - } - - for message := range t.InputChannel { - t.OutputChannel <- message - t.BrokerChannel <- message - } -} - -func (t *Manager) ShouldStartAckBroker() bool { - if t.BrokerPort == "" { - klog.V(1).Info("ACK-Manager not available") - return false - } - return true -} - -func NewAckManager(inputChannel chan messages.Ack, outputChannel chan messages.Ack, brokerChannel chan messages.Ack) *Manager { - return &Manager{ - InputChannel: inputChannel, - OutputChannel: outputChannel, - BrokerChannel: brokerChannel, - BrokerPort: helpers.GetEnv("ACK_BROKER_PORT", ""), - } -} diff --git a/pkg/ack/server.go b/pkg/ack/server.go deleted file mode 100644 index 4e73a0a..0000000 --- a/pkg/ack/server.go +++ /dev/null @@ -1,53 +0,0 @@ -package ack - -import ( - "github.com/google/uuid" - "github.com/softonic/homing-pigeon/pkg/messages" - "github.com/softonic/homing-pigeon/proto" - "k8s.io/klog" - "sync" -) - -type Server struct { - clients map[string]proto.AckEvent_GetMessagesServer - InputChannel <-chan messages.Ack - mu sync.RWMutex -} - -func (s *Server) AddClient(uid string, client proto.AckEvent_GetMessagesServer) { - s.mu.Lock() - defer s.mu.Unlock() - s.clients[uid] = client - klog.V(1).Info("New client connected") -} - -func (s *Server) GetClientsCopy() []proto.AckEvent_GetMessagesServer { - s.mu.RLock() - defer s.mu.RUnlock() - var clients []proto.AckEvent_GetMessagesServer - for _, client := range s.clients { - clients = append(clients, client) - } - return clients -} - -func (s *Server) GetMessages(req *proto.EmptyRequest, client proto.AckEvent_GetMessagesServer) error { - uid := uuid.Must(uuid.NewRandom()).String() - - s.AddClient(uid, client) - - for message := range s.InputChannel { - klog.V(1).Info("Sending ACK to clients") - for _, client := range s.GetClientsCopy() { - err := client.Send(&proto.Message{ - Body: message.Body, - Ack: message.Ack, - }) - - if err != nil { - klog.Errorf("Error sending to grpc client: %v", err) - } - } - } - return nil -} diff --git a/pkg/main.go b/pkg/main.go index 5c651bc..2fb4ec2 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -1,7 +1,6 @@ package main import ( - "github.com/softonic/homing-pigeon/pkg/ack" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/pkg/middleware" "github.com/softonic/homing-pigeon/pkg/readers" @@ -14,36 +13,37 @@ import ( func main() { klog.InitFlags(nil) - bufLen, err := strconv.Atoi(os.Getenv("MESSAGE_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - inputChannel := make(chan messages.Message, bufLen) - outputChannel := make(chan messages.Message, bufLen) + bufLen := GetBufferLength("MESSAGE_BUFFER_LENGTH") + msgCh1 := make(chan messages.Message, bufLen) + msgCh2 := make(chan messages.Message, bufLen) - bufLen, err = strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - ackChannel := make(chan messages.Ack, bufLen) - brokerAckChannel := make(chan messages.Ack, bufLen) - ackManagerChannel := make(chan messages.Ack, bufLen) + bufLen = GetBufferLength("ACK_BUFFER_LENGTH") + ackCh1 := make(chan messages.Ack, bufLen) + ackCh2 := make(chan messages.Ack, bufLen) - reader, err := readers.NewReader(inputChannel, ackChannel) + reader, err := readers.NewReader(msgCh1, ackCh2) if err != nil { panic(err) } - writer, err := writers.NewWriter(outputChannel, ackManagerChannel) + writer, err := writers.NewWriter(msgCh2, ackCh1) if err != nil { panic(err) } - middlewareManager := middleware.NewMiddlewareManager(inputChannel, outputChannel) - ackManager := ack.NewAckManager(ackManagerChannel, ackChannel, brokerAckChannel) + incomingMiddleware := middleware.NewMiddlewareManager(msgCh1, msgCh2, ackCh1, ackCh2) go reader.Start() - go middlewareManager.Start() - go ackManager.Start() + go incomingMiddleware.HandleInput() + go incomingMiddleware.HandleOutput() writer.Start() } + +func GetBufferLength(bufferKey string) int { + bufLen, err := strconv.Atoi(os.Getenv(bufferKey)) + if err != nil { + bufLen = 0 + } + + return bufLen +} diff --git a/pkg/middleware/broker.go b/pkg/middleware/broker.go new file mode 100644 index 0000000..9087bf9 --- /dev/null +++ b/pkg/middleware/broker.go @@ -0,0 +1,53 @@ +package middleware + +import ( + "github.com/google/uuid" + "github.com/softonic/homing-pigeon/pkg/messages" + "github.com/softonic/homing-pigeon/proto" + "k8s.io/klog" + "sync" +) + +type Broker struct { + clients map[string]proto.Broker_GetMessageServer + InputChannel <-chan messages.Ack + mu sync.RWMutex +} + +func (b *Broker) AddClient(uid string, client proto.Broker_GetMessageServer) { + b.mu.Lock() + defer b.mu.Unlock() + b.clients[uid] = client + klog.V(1).Info("New client connected") +} + +func (b *Broker) GetClientsCopy() []proto.Broker_GetMessageServer { + b.mu.RLock() + defer b.mu.RUnlock() + var clients []proto.Broker_GetMessageServer + for _, client := range b.clients { + clients = append(clients, client) + } + return clients +} + +func (b *Broker) GetMessage(req *proto.EmptyRequest, client proto.Broker_GetMessageServer) error { + uid := uuid.Must(uuid.NewRandom()).String() + + b.AddClient(uid, client) + + for message := range b.InputChannel { + klog.V(1).Info("Sending ACK to clients") + for _, client := range b.GetClientsCopy() { + err := client.Send(&proto.Message{ + Body: message.Body, + Success: message.Ack, + }) + + if err != nil { + klog.Errorf("Error sending to grpc client: %v", err) + } + } + } + return nil +} diff --git a/pkg/middleware/manager.go b/pkg/middleware/manager.go index 7ceb596..5e24f4d 100644 --- a/pkg/middleware/manager.go +++ b/pkg/middleware/manager.go @@ -8,21 +8,28 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "k8s.io/klog" + "net" + "os" + "strconv" + "sync" "time" ) // @TODO Tests missing type MiddlwareManager struct { - InputChannel <-chan messages.Message - OutputChannel chan<- messages.Message - MiddlewareAddress string + MsgIncomingChannel <-chan messages.Message + MsgOutgoingChannel chan<- messages.Message + AckIncomingChannel <-chan messages.Ack + AckOutgoingChannel chan<- messages.Ack + MiddlewareAddress string + BrokerPort string } -func (m *MiddlwareManager) Start() { +func (m *MiddlwareManager) HandleInput() { if m.isMiddlewareNotAvailable() { klog.V(1).Infof("Middlewares not available") - for message := range m.InputChannel { - m.OutputChannel <- message + for message := range m.MsgIncomingChannel { + m.MsgOutgoingChannel <- message } } @@ -42,7 +49,7 @@ func (m *MiddlwareManager) Start() { defer conn.Close() client := proto.NewMiddlewareClient(conn) - for message := range m.InputChannel { + for message := range m.MsgIncomingChannel { klog.V(5).Infof("Sending message to proto") start := time.Now() @@ -58,7 +65,43 @@ func (m *MiddlwareManager) Start() { message.Body = data.GetBody() - m.OutputChannel <- message + m.MsgOutgoingChannel <- message + } +} + +func (m *MiddlwareManager) HandleOutput() { + if m.isBrokerNotAvailable() { + for message := range m.AckIncomingChannel { + m.AckOutgoingChannel <- message + } + } + + brokerChannel := getBrokerChannel() + + // Start Broker server + go func() { + lis, err := net.Listen("tcp", m.BrokerPort) + if err != nil { + klog.Errorf("Failed to listen: %v", err) + } + + grpcServer := grpc.NewServer(grpc.MaxConcurrentStreams(10)) + proto.RegisterBrokerServer(grpcServer, &Broker{ + clients: make(map[string]proto.Broker_GetMessageServer), + InputChannel: brokerChannel, + mu: sync.RWMutex{}, + }) + + klog.V(1).Info("Response Broker listening...") + err = grpcServer.Serve(lis) + if err != nil { + klog.Error(err) + } + }() + + for message := range m.AckIncomingChannel { + m.AckOutgoingChannel <- message + brokerChannel <- message } } @@ -66,10 +109,26 @@ func (m *MiddlwareManager) isMiddlewareNotAvailable() bool { return m.MiddlewareAddress == "" } -func NewMiddlewareManager(inputChannel chan messages.Message, outputChannel chan messages.Message) *MiddlwareManager { +func (m *MiddlwareManager) isBrokerNotAvailable() bool { + return m.BrokerPort == "" +} + +func getBrokerChannel() chan messages.Ack { + bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) + if err != nil { + bufLen = 0 + } + + return make(chan messages.Ack, bufLen) +} + +func NewMiddlewareManager(msgCh1 chan messages.Message, msgCh2 chan messages.Message, ackCh1 chan messages.Ack, ackCh2 chan messages.Ack) *MiddlwareManager { return &MiddlwareManager{ - InputChannel: inputChannel, - OutputChannel: outputChannel, - MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), + MsgIncomingChannel: msgCh1, + MsgOutgoingChannel: msgCh2, + AckIncomingChannel: ackCh1, + AckOutgoingChannel: ackCh2, + MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), + BrokerPort: helpers.GetEnv("RESPONSE_BROKER_PORT", ""), } } diff --git a/proto/ack_event.pb.go b/proto/broker.pb.go similarity index 56% rename from proto/ack_event.pb.go rename to proto/broker.pb.go index 332d0ec..193b941 100644 --- a/proto/ack_event.pb.go +++ b/proto/broker.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: ack_event.proto +// source: broker.proto package proto @@ -34,7 +34,7 @@ func (m *EmptyRequest) Reset() { *m = EmptyRequest{} } func (m *EmptyRequest) String() string { return proto.CompactTextString(m) } func (*EmptyRequest) ProtoMessage() {} func (*EmptyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_90a7cdd5cc2411b0, []int{0} + return fileDescriptor_f209535e190f2bed, []int{0} } func (m *EmptyRequest) XXX_Unmarshal(b []byte) error { @@ -58,7 +58,7 @@ var xxx_messageInfo_EmptyRequest proto.InternalMessageInfo // Message is represented with the body that contains the actual data and a boolean flag. type Message struct { Body []byte `protobuf:"bytes,1,opt,name=Body,proto3" json:"Body,omitempty"` - Ack bool `protobuf:"varint,2,opt,name=Ack,proto3" json:"Ack,omitempty"` + Success bool `protobuf:"varint,2,opt,name=Success,proto3" json:"Success,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -68,7 +68,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_90a7cdd5cc2411b0, []int{1} + return fileDescriptor_f209535e190f2bed, []int{1} } func (m *Message) XXX_Unmarshal(b []byte) error { @@ -96,9 +96,9 @@ func (m *Message) GetBody() []byte { return nil } -func (m *Message) GetAck() bool { +func (m *Message) GetSuccess() bool { if m != nil { - return m.Ack + return m.Success } return false } @@ -108,22 +108,22 @@ func init() { proto.RegisterType((*Message)(nil), "proto.Message") } -func init() { proto.RegisterFile("ack_event.proto", fileDescriptor_90a7cdd5cc2411b0) } +func init() { proto.RegisterFile("broker.proto", fileDescriptor_f209535e190f2bed) } -var fileDescriptor_90a7cdd5cc2411b0 = []byte{ - // 184 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x4c, 0xce, 0x8e, - 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, - 0x7c, 0x5c, 0x3c, 0xae, 0xb9, 0x05, 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, - 0xfa, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, - 0x29, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x00, 0x17, 0xb3, 0x63, - 0x72, 0xb6, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x88, 0x69, 0xe4, 0xc4, 0xc5, 0xe1, 0x98, - 0x9c, 0xed, 0x0a, 0x32, 0x59, 0xc8, 0x8c, 0x8b, 0xdb, 0x3d, 0xb5, 0x04, 0xaa, 0xbf, 0x58, 0x48, - 0x18, 0x62, 0x95, 0x1e, 0xb2, 0x05, 0x52, 0x7c, 0x50, 0x41, 0xa8, 0x2a, 0x25, 0x06, 0x03, 0x46, - 0x27, 0x43, 0x2e, 0xe5, 0xe4, 0xfc, 0x5c, 0xbd, 0xe2, 0xfc, 0xb4, 0x92, 0xfc, 0xbc, 0xcc, 0x64, - 0xbd, 0x8c, 0xfc, 0xdc, 0xcc, 0xbc, 0xf4, 0x82, 0xcc, 0xf4, 0xd4, 0xfc, 0x3c, 0x3d, 0xb8, 0xc3, - 0x9d, 0xe0, 0x16, 0x05, 0x30, 0x26, 0xb1, 0x81, 0x4d, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x9f, 0x81, 0x8f, 0xd2, 0xd8, 0x00, 0x00, 0x00, +var fileDescriptor_f209535e190f2bed = []byte{ + // 180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x2a, 0xca, 0xcf, + 0x4e, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x7c, 0x5c, 0x3c, + 0xae, 0xb9, 0x05, 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0xe6, 0x5c, 0xec, + 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, 0x29, 0x95, 0x12, + 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x04, 0x17, 0x7b, 0x70, 0x69, 0x72, 0x72, + 0x6a, 0x71, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x8c, 0x6b, 0x64, 0xcf, 0xc5, 0xe6, + 0x04, 0x36, 0x5f, 0xc8, 0x94, 0x8b, 0xcb, 0x3d, 0xb5, 0x04, 0x66, 0x8a, 0x30, 0xc4, 0x3e, 0x3d, + 0x64, 0x5b, 0xa4, 0xf8, 0xa0, 0x82, 0x50, 0x45, 0x4a, 0x0c, 0x06, 0x8c, 0x4e, 0x3a, 0x5c, 0x0a, + 0xc9, 0xf9, 0xb9, 0x7a, 0xc5, 0xf9, 0x69, 0x25, 0xf9, 0x79, 0x99, 0xc9, 0x7a, 0x19, 0xf9, 0xb9, + 0x99, 0x79, 0xe9, 0x05, 0x99, 0xe9, 0xa9, 0xf9, 0x79, 0x7a, 0x10, 0xa7, 0x3b, 0x41, 0xad, 0x08, + 0x60, 0x4c, 0x62, 0x03, 0x1b, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x10, 0xb0, 0x1e, + 0xd5, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -134,28 +134,28 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// AckEventClient is the client API for AckEvent service. +// BrokerClient is the client API for Broker service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AckEventClient interface { +type BrokerClient interface { // Handle the given data and return it. - GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckEvent_GetMessagesClient, error) + GetMessage(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (Broker_GetMessageClient, error) } -type ackEventClient struct { +type brokerClient struct { cc *grpc.ClientConn } -func NewAckEventClient(cc *grpc.ClientConn) AckEventClient { - return &ackEventClient{cc} +func NewBrokerClient(cc *grpc.ClientConn) BrokerClient { + return &brokerClient{cc} } -func (c *ackEventClient) GetMessages(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (AckEvent_GetMessagesClient, error) { - stream, err := c.cc.NewStream(ctx, &_AckEvent_serviceDesc.Streams[0], "/proto.AckEvent/GetMessages", opts...) +func (c *brokerClient) GetMessage(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (Broker_GetMessageClient, error) { + stream, err := c.cc.NewStream(ctx, &_Broker_serviceDesc.Streams[0], "/proto.Broker/GetMessage", opts...) if err != nil { return nil, err } - x := &ackEventGetMessagesClient{stream} + x := &brokerGetMessageClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -165,16 +165,16 @@ func (c *ackEventClient) GetMessages(ctx context.Context, in *EmptyRequest, opts return x, nil } -type AckEvent_GetMessagesClient interface { +type Broker_GetMessageClient interface { Recv() (*Message, error) grpc.ClientStream } -type ackEventGetMessagesClient struct { +type brokerGetMessageClient struct { grpc.ClientStream } -func (x *ackEventGetMessagesClient) Recv() (*Message, error) { +func (x *brokerGetMessageClient) Recv() (*Message, error) { m := new(Message) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -182,55 +182,55 @@ func (x *ackEventGetMessagesClient) Recv() (*Message, error) { return m, nil } -// AckEventServer is the server API for AckEvent service. -type AckEventServer interface { +// BrokerServer is the server API for Broker service. +type BrokerServer interface { // Handle the given data and return it. - GetMessages(*EmptyRequest, AckEvent_GetMessagesServer) error + GetMessage(*EmptyRequest, Broker_GetMessageServer) error } -// UnimplementedAckEventServer can be embedded to have forward compatible implementations. -type UnimplementedAckEventServer struct { +// UnimplementedBrokerServer can be embedded to have forward compatible implementations. +type UnimplementedBrokerServer struct { } -func (*UnimplementedAckEventServer) GetMessages(req *EmptyRequest, srv AckEvent_GetMessagesServer) error { - return status.Errorf(codes.Unimplemented, "method GetMessages not implemented") +func (*UnimplementedBrokerServer) GetMessage(req *EmptyRequest, srv Broker_GetMessageServer) error { + return status.Errorf(codes.Unimplemented, "method GetMessage not implemented") } -func RegisterAckEventServer(s *grpc.Server, srv AckEventServer) { - s.RegisterService(&_AckEvent_serviceDesc, srv) +func RegisterBrokerServer(s *grpc.Server, srv BrokerServer) { + s.RegisterService(&_Broker_serviceDesc, srv) } -func _AckEvent_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Broker_GetMessage_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(EmptyRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(AckEventServer).GetMessages(m, &ackEventGetMessagesServer{stream}) + return srv.(BrokerServer).GetMessage(m, &brokerGetMessageServer{stream}) } -type AckEvent_GetMessagesServer interface { +type Broker_GetMessageServer interface { Send(*Message) error grpc.ServerStream } -type ackEventGetMessagesServer struct { +type brokerGetMessageServer struct { grpc.ServerStream } -func (x *ackEventGetMessagesServer) Send(m *Message) error { +func (x *brokerGetMessageServer) Send(m *Message) error { return x.ServerStream.SendMsg(m) } -var _AckEvent_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.AckEvent", - HandlerType: (*AckEventServer)(nil), +var _Broker_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Broker", + HandlerType: (*BrokerServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { - StreamName: "GetMessages", - Handler: _AckEvent_GetMessages_Handler, + StreamName: "GetMessage", + Handler: _Broker_GetMessage_Handler, ServerStreams: true, }, }, - Metadata: "ack_event.proto", + Metadata: "broker.proto", } diff --git a/proto/ack_event.proto b/proto/broker.proto similarity index 59% rename from proto/ack_event.proto rename to proto/broker.proto index fd3d76b..de8a5d0 100644 --- a/proto/ack_event.proto +++ b/proto/broker.proto @@ -1,16 +1,16 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "com.softonic.homingpigeon.ack_event"; -option java_outer_classname = "AckEvent"; +option java_package = "com.softonic.homingpigeon.broker"; +option java_outer_classname = "Broker"; package proto; // Ack Service interface. -service AckEvent { +service Broker { // Handle the given data and return it. - rpc GetMessages(EmptyRequest) returns (stream Message) {} + rpc GetMessage(EmptyRequest) returns (stream Message) {} } @@ -19,5 +19,5 @@ message EmptyRequest {} // Message is represented with the body that contains the actual data and a boolean flag. message Message { bytes Body = 1; - bool Ack = 2; + bool Success = 2; } diff --git a/proto/middleware.proto b/proto/middleware.proto index 232e16d..46ec55b 100644 --- a/proto/middleware.proto +++ b/proto/middleware.proto @@ -18,4 +18,3 @@ service Middleware { message Data { bytes Body = 1; } - From d4d93bdb18a726170751cac161f85c0d7be22378 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Mon, 7 Feb 2022 15:49:33 +0100 Subject: [PATCH 16/37] Dummy implementation when no adatper is defined --- README.md | 4 ++-- docker-compose.yaml | 4 ++-- pkg/readers/reader.go | 10 ++++++---- pkg/writers/writer.go | 10 ++++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dd03d34..5642a9b 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,8 @@ In order to start up correctly, it needs well defined environment variables: | MESSAGE_BUFFER_LENGTH | Buffer length for internal golang channel used for messaging | | ACK_BUFFER_LENGTH | Buffer length for internal golang channel used for acks | | MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | -| READ_ADAPTER | Read interface implementation. Default: amqp | -| WRITE_ADAPTER | Write interface implementation. Default: elasticsearch | +| READ_ADAPTER | Read interface implementation. Default: AMQP | +| WRITE_ADAPTER | Write interface implementation. Default: ELASTIC | | RESPONSE_BROKER_PORT | TCP port where broker will emit each response Ex: ":12345" | ##### Read Adapters diff --git a/docker-compose.yaml b/docker-compose.yaml index 64125ed..9cc9ea5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,8 +26,8 @@ services: GRPC_GO_LOG_VERBOSITY_LEVEL: 99 GRPC_GO_LOG_SEVERITY_LEVEL: info MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" - READ_ADAPTER: "amqp" - WRITE_ADAPTER: "elasticsearch" + READ_ADAPTER: "AMQP" + WRITE_ADAPTER: "ELASTIC" RESPONSE_BROKER_PORT: ":8090" hp-middleware-pass: volumes: diff --git a/pkg/readers/reader.go b/pkg/readers/reader.go index 215cd58..3be224a 100644 --- a/pkg/readers/reader.go +++ b/pkg/readers/reader.go @@ -4,6 +4,7 @@ import ( "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/pkg/readers/adapters" + "k8s.io/klog" ) type Reader struct { @@ -21,13 +22,14 @@ func NewReader(inputChannel chan messages.Message, ackChannel chan messages.Ack) var err error var readAdapter adapters.ReadAdapter - adapter := helpers.GetEnv("READ_ADAPTER", "") + adapter := helpers.GetEnv("READ_ADAPTER", "AMQP") switch adapter { - case "dummy": - readAdapter, err = &adapters.Dummy{}, nil - default: + case "AMQP": readAdapter, err = NewAMQPAdapter() + default: + klog.Warning("Reader not defined, using dummy implementation") + readAdapter, err = &adapters.Dummy{}, nil } return &Reader{ diff --git a/pkg/writers/writer.go b/pkg/writers/writer.go index 25b5f79..d06243e 100644 --- a/pkg/writers/writer.go +++ b/pkg/writers/writer.go @@ -4,6 +4,7 @@ import ( "github.com/softonic/homing-pigeon/pkg/helpers" "github.com/softonic/homing-pigeon/pkg/messages" "github.com/softonic/homing-pigeon/pkg/writers/adapters" + "k8s.io/klog" "sync" "time" ) @@ -70,13 +71,14 @@ func NewWriter(outputChannel chan messages.Message, ackChannel chan messages.Ack var err error var writeAdapter adapters.WriteAdapter - adapter := helpers.GetEnv("WRITE_ADAPTER", "") + adapter := helpers.GetEnv("WRITE_ADAPTER", "ELASTIC") switch adapter { - case "dummy": - writeAdapter, err = &adapters.Dummy{}, nil - default: + case "ELASTIC": writeAdapter, err = adapters.NewElasticsearchAdapter() + default: + klog.Warning("Writer not defined, using dummy implementation") + writeAdapter, err = &adapters.Dummy{}, nil } return &Writer{ From a7a0ea95869ab272023caa59587692b586ad2cf3 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Thu, 15 Jun 2023 16:53:32 +0200 Subject: [PATCH 17/37] feat: update Golang to 1.17 and remove Dingo --- Makefile | 1 - README.md | 1 - docker-compose.yaml | 4 +- pkg/main.go | 5 +- pkg/messages/ack.go | 5 +- pkg/messages/message.go | 10 +- pkg/middleware/broker.go | 53 -------- pkg/middleware/manager.go | 83 ++---------- pkg/writers/adapters/dummy.go | 5 +- proto/broker.pb.go | 236 ---------------------------------- proto/broker.proto | 23 ---- 11 files changed, 24 insertions(+), 402 deletions(-) delete mode 100644 pkg/middleware/broker.go delete mode 100644 proto/broker.pb.go delete mode 100644 proto/broker.proto diff --git a/Makefile b/Makefile index 0f7ce7c..ad789f4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ TAG ?= dev generate-proto: protoc -I proto/ proto/middleware.proto --go_out=plugins=grpc:proto - protoc -I proto/ proto/broker.proto --go_out=plugins=grpc:proto dep: go get -u github.com/rakyll/gotest go get -u github.com/vektra/mockery/.../ diff --git a/README.md b/README.md index d710b9b..3c3caf9 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,6 @@ In order to start up correctly, it needs well defined environment variables: | MIDDLEWARES_SOCKET | Socket to connect to middlewares. Ex: passthrough:///unix://tmp/test.sock" | | READ_ADAPTER | Read interface implementation. Default: AMQP | | WRITE_ADAPTER | Write interface implementation. Default: ELASTIC | -| RESPONSE_BROKER_PORT | TCP port where broker will emit each response Ex: ":12345" | ##### Read Adapters diff --git a/docker-compose.yaml b/docker-compose.yaml index 9cc9ea5..5fb53d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,13 +28,12 @@ services: MIDDLEWARES_SOCKET: "passthrough:///unix:///tmp/hp" READ_ADAPTER: "AMQP" WRITE_ADAPTER: "ELASTIC" - RESPONSE_BROKER_PORT: ":8090" hp-middleware-pass: volumes: - ./sockets:/tmp image: softonic/hp-pass-middleware:0.1.0 environment: - IN_SOCKET: "/tmp/hp" + IN_SOCKET: "unix:///tmp/hp" command: ["-stderrthreshold=INFO"] rabbit-mq: image: rabbitmq:3.8-management @@ -51,6 +50,7 @@ services: - bootstrap.memory_lock=true - discovery.seed_hosts=elasticsearch - cluster.initial_master_nodes=elasticsearch + - vm.max_map_count=262144 ulimits: memlock: soft: -1 diff --git a/pkg/main.go b/pkg/main.go index 2fb4ec2..1336165 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -31,11 +31,10 @@ func main() { panic(err) } - incomingMiddleware := middleware.NewMiddlewareManager(msgCh1, msgCh2, ackCh1, ackCh2) + middleware := middleware.NewMiddlewareManager(msgCh1, msgCh2) go reader.Start() - go incomingMiddleware.HandleInput() - go incomingMiddleware.HandleOutput() + go middleware.Start() writer.Start() } diff --git a/pkg/messages/ack.go b/pkg/messages/ack.go index b0350c0..32ff3cd 100644 --- a/pkg/messages/ack.go +++ b/pkg/messages/ack.go @@ -1,7 +1,6 @@ package messages type Ack struct { - Id interface{} - Body []byte - Ack bool + Id interface{} + Ack bool } diff --git a/pkg/messages/message.go b/pkg/messages/message.go index f885c3a..28613e7 100644 --- a/pkg/messages/message.go +++ b/pkg/messages/message.go @@ -15,9 +15,8 @@ func (m Message) Nack() (Ack, error) { } return Ack{ - Id: m.Id, - Body: m.Body, - Ack: false, + Id: m.Id, + Ack: false, }, nil } @@ -28,9 +27,8 @@ func (m Message) Ack() (Ack, error) { } return Ack{ - Id: m.Id, - Body: m.Body, - Ack: true, + Id: m.Id, + Ack: true, }, nil } diff --git a/pkg/middleware/broker.go b/pkg/middleware/broker.go deleted file mode 100644 index 9087bf9..0000000 --- a/pkg/middleware/broker.go +++ /dev/null @@ -1,53 +0,0 @@ -package middleware - -import ( - "github.com/google/uuid" - "github.com/softonic/homing-pigeon/pkg/messages" - "github.com/softonic/homing-pigeon/proto" - "k8s.io/klog" - "sync" -) - -type Broker struct { - clients map[string]proto.Broker_GetMessageServer - InputChannel <-chan messages.Ack - mu sync.RWMutex -} - -func (b *Broker) AddClient(uid string, client proto.Broker_GetMessageServer) { - b.mu.Lock() - defer b.mu.Unlock() - b.clients[uid] = client - klog.V(1).Info("New client connected") -} - -func (b *Broker) GetClientsCopy() []proto.Broker_GetMessageServer { - b.mu.RLock() - defer b.mu.RUnlock() - var clients []proto.Broker_GetMessageServer - for _, client := range b.clients { - clients = append(clients, client) - } - return clients -} - -func (b *Broker) GetMessage(req *proto.EmptyRequest, client proto.Broker_GetMessageServer) error { - uid := uuid.Must(uuid.NewRandom()).String() - - b.AddClient(uid, client) - - for message := range b.InputChannel { - klog.V(1).Info("Sending ACK to clients") - for _, client := range b.GetClientsCopy() { - err := client.Send(&proto.Message{ - Body: message.Body, - Success: message.Ack, - }) - - if err != nil { - klog.Errorf("Error sending to grpc client: %v", err) - } - } - } - return nil -} diff --git a/pkg/middleware/manager.go b/pkg/middleware/manager.go index 5e24f4d..69b3c2d 100644 --- a/pkg/middleware/manager.go +++ b/pkg/middleware/manager.go @@ -8,28 +8,21 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "k8s.io/klog" - "net" - "os" - "strconv" - "sync" "time" ) // @TODO Tests missing type MiddlwareManager struct { - MsgIncomingChannel <-chan messages.Message - MsgOutgoingChannel chan<- messages.Message - AckIncomingChannel <-chan messages.Ack - AckOutgoingChannel chan<- messages.Ack - MiddlewareAddress string - BrokerPort string + InputChannel <-chan messages.Message + OutputChannel chan<- messages.Message + MiddlewareAddress string } -func (m *MiddlwareManager) HandleInput() { +func (m *MiddlwareManager) Start() { if m.isMiddlewareNotAvailable() { klog.V(1).Infof("Middlewares not available") - for message := range m.MsgIncomingChannel { - m.MsgOutgoingChannel <- message + for message := range m.InputChannel { + m.OutputChannel <- message } } @@ -49,7 +42,7 @@ func (m *MiddlwareManager) HandleInput() { defer conn.Close() client := proto.NewMiddlewareClient(conn) - for message := range m.MsgIncomingChannel { + for message := range m.InputChannel { klog.V(5).Infof("Sending message to proto") start := time.Now() @@ -65,43 +58,7 @@ func (m *MiddlwareManager) HandleInput() { message.Body = data.GetBody() - m.MsgOutgoingChannel <- message - } -} - -func (m *MiddlwareManager) HandleOutput() { - if m.isBrokerNotAvailable() { - for message := range m.AckIncomingChannel { - m.AckOutgoingChannel <- message - } - } - - brokerChannel := getBrokerChannel() - - // Start Broker server - go func() { - lis, err := net.Listen("tcp", m.BrokerPort) - if err != nil { - klog.Errorf("Failed to listen: %v", err) - } - - grpcServer := grpc.NewServer(grpc.MaxConcurrentStreams(10)) - proto.RegisterBrokerServer(grpcServer, &Broker{ - clients: make(map[string]proto.Broker_GetMessageServer), - InputChannel: brokerChannel, - mu: sync.RWMutex{}, - }) - - klog.V(1).Info("Response Broker listening...") - err = grpcServer.Serve(lis) - if err != nil { - klog.Error(err) - } - }() - - for message := range m.AckIncomingChannel { - m.AckOutgoingChannel <- message - brokerChannel <- message + m.OutputChannel <- message } } @@ -109,26 +66,10 @@ func (m *MiddlwareManager) isMiddlewareNotAvailable() bool { return m.MiddlewareAddress == "" } -func (m *MiddlwareManager) isBrokerNotAvailable() bool { - return m.BrokerPort == "" -} - -func getBrokerChannel() chan messages.Ack { - bufLen, err := strconv.Atoi(os.Getenv("ACK_BUFFER_LENGTH")) - if err != nil { - bufLen = 0 - } - - return make(chan messages.Ack, bufLen) -} - -func NewMiddlewareManager(msgCh1 chan messages.Message, msgCh2 chan messages.Message, ackCh1 chan messages.Ack, ackCh2 chan messages.Ack) *MiddlwareManager { +func NewMiddlewareManager(msgCh1 chan messages.Message, msgCh2 chan messages.Message) *MiddlwareManager { return &MiddlwareManager{ - MsgIncomingChannel: msgCh1, - MsgOutgoingChannel: msgCh2, - AckIncomingChannel: ackCh1, - AckOutgoingChannel: ackCh2, - MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), - BrokerPort: helpers.GetEnv("RESPONSE_BROKER_PORT", ""), + InputChannel: msgCh1, + OutputChannel: msgCh2, + MiddlewareAddress: helpers.GetEnv("MIDDLEWARES_SOCKET", ""), } } diff --git a/pkg/writers/adapters/dummy.go b/pkg/writers/adapters/dummy.go index 39f97d9..f96c450 100644 --- a/pkg/writers/adapters/dummy.go +++ b/pkg/writers/adapters/dummy.go @@ -11,9 +11,8 @@ func (d *Dummy) ProcessMessages(msgs []messages.Message) []messages.Ack { var processedMsg []messages.Ack for i := 0; i < len(msgs); i++ { processedMsg = append(processedMsg, messages.Ack{ - Id: uint64(i), - Body: msgs[i].Body, - Ack: true, + Id: uint64(i), + Ack: true, }) } return processedMsg diff --git a/proto/broker.pb.go b/proto/broker.pb.go deleted file mode 100644 index 193b941..0000000 --- a/proto/broker.pb.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: broker.proto - -package proto - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type EmptyRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyRequest) Reset() { *m = EmptyRequest{} } -func (m *EmptyRequest) String() string { return proto.CompactTextString(m) } -func (*EmptyRequest) ProtoMessage() {} -func (*EmptyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f209535e190f2bed, []int{0} -} - -func (m *EmptyRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmptyRequest.Unmarshal(m, b) -} -func (m *EmptyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmptyRequest.Marshal(b, m, deterministic) -} -func (m *EmptyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyRequest.Merge(m, src) -} -func (m *EmptyRequest) XXX_Size() int { - return xxx_messageInfo_EmptyRequest.Size(m) -} -func (m *EmptyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyRequest proto.InternalMessageInfo - -// Message is represented with the body that contains the actual data and a boolean flag. -type Message struct { - Body []byte `protobuf:"bytes,1,opt,name=Body,proto3" json:"Body,omitempty"` - Success bool `protobuf:"varint,2,opt,name=Success,proto3" json:"Success,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_f209535e190f2bed, []int{1} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Message.Unmarshal(m, b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return xxx_messageInfo_Message.Size(m) -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -func (m *Message) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -func (m *Message) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func init() { - proto.RegisterType((*EmptyRequest)(nil), "proto.EmptyRequest") - proto.RegisterType((*Message)(nil), "proto.Message") -} - -func init() { proto.RegisterFile("broker.proto", fileDescriptor_f209535e190f2bed) } - -var fileDescriptor_f209535e190f2bed = []byte{ - // 180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x2a, 0xca, 0xcf, - 0x4e, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x7c, 0x5c, 0x3c, - 0xae, 0xb9, 0x05, 0x25, 0x95, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0xe6, 0x5c, 0xec, - 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x42, 0x5c, 0x2c, 0x4e, 0xf9, 0x29, 0x95, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x04, 0x17, 0x7b, 0x70, 0x69, 0x72, 0x72, - 0x6a, 0x71, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x8c, 0x6b, 0x64, 0xcf, 0xc5, 0xe6, - 0x04, 0x36, 0x5f, 0xc8, 0x94, 0x8b, 0xcb, 0x3d, 0xb5, 0x04, 0x66, 0x8a, 0x30, 0xc4, 0x3e, 0x3d, - 0x64, 0x5b, 0xa4, 0xf8, 0xa0, 0x82, 0x50, 0x45, 0x4a, 0x0c, 0x06, 0x8c, 0x4e, 0x3a, 0x5c, 0x0a, - 0xc9, 0xf9, 0xb9, 0x7a, 0xc5, 0xf9, 0x69, 0x25, 0xf9, 0x79, 0x99, 0xc9, 0x7a, 0x19, 0xf9, 0xb9, - 0x99, 0x79, 0xe9, 0x05, 0x99, 0xe9, 0xa9, 0xf9, 0x79, 0x7a, 0x10, 0xa7, 0x3b, 0x41, 0xad, 0x08, - 0x60, 0x4c, 0x62, 0x03, 0x1b, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x10, 0xb0, 0x1e, - 0xd5, 0x00, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// BrokerClient is the client API for Broker service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type BrokerClient interface { - // Handle the given data and return it. - GetMessage(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (Broker_GetMessageClient, error) -} - -type brokerClient struct { - cc *grpc.ClientConn -} - -func NewBrokerClient(cc *grpc.ClientConn) BrokerClient { - return &brokerClient{cc} -} - -func (c *brokerClient) GetMessage(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (Broker_GetMessageClient, error) { - stream, err := c.cc.NewStream(ctx, &_Broker_serviceDesc.Streams[0], "/proto.Broker/GetMessage", opts...) - if err != nil { - return nil, err - } - x := &brokerGetMessageClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Broker_GetMessageClient interface { - Recv() (*Message, error) - grpc.ClientStream -} - -type brokerGetMessageClient struct { - grpc.ClientStream -} - -func (x *brokerGetMessageClient) Recv() (*Message, error) { - m := new(Message) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// BrokerServer is the server API for Broker service. -type BrokerServer interface { - // Handle the given data and return it. - GetMessage(*EmptyRequest, Broker_GetMessageServer) error -} - -// UnimplementedBrokerServer can be embedded to have forward compatible implementations. -type UnimplementedBrokerServer struct { -} - -func (*UnimplementedBrokerServer) GetMessage(req *EmptyRequest, srv Broker_GetMessageServer) error { - return status.Errorf(codes.Unimplemented, "method GetMessage not implemented") -} - -func RegisterBrokerServer(s *grpc.Server, srv BrokerServer) { - s.RegisterService(&_Broker_serviceDesc, srv) -} - -func _Broker_GetMessage_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(EmptyRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BrokerServer).GetMessage(m, &brokerGetMessageServer{stream}) -} - -type Broker_GetMessageServer interface { - Send(*Message) error - grpc.ServerStream -} - -type brokerGetMessageServer struct { - grpc.ServerStream -} - -func (x *brokerGetMessageServer) Send(m *Message) error { - return x.ServerStream.SendMsg(m) -} - -var _Broker_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Broker", - HandlerType: (*BrokerServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetMessage", - Handler: _Broker_GetMessage_Handler, - ServerStreams: true, - }, - }, - Metadata: "broker.proto", -} diff --git a/proto/broker.proto b/proto/broker.proto deleted file mode 100644 index de8a5d0..0000000 --- a/proto/broker.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "com.softonic.homingpigeon.broker"; -option java_outer_classname = "Broker"; - -package proto; - -// Ack Service interface. -service Broker { - - // Handle the given data and return it. - rpc GetMessage(EmptyRequest) returns (stream Message) {} - -} - -message EmptyRequest {} - -// Message is represented with the body that contains the actual data and a boolean flag. -message Message { - bytes Body = 1; - bool Success = 2; -} From ed488b26734b15d672bf9fd05c8f758d821627ef Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 16 Jun 2023 08:30:07 +0200 Subject: [PATCH 18/37] feat: update imports --- go.mod | 13 +---------- go.sum | 74 ++++------------------------------------------------------ 2 files changed, 5 insertions(+), 82 deletions(-) diff --git a/go.mod b/go.mod index 4b42c62..cc8ebc8 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,6 @@ module github.com/softonic/homing-pigeon require ( github.com/elastic/go-elasticsearch/v7 v7.10.0 github.com/golang/protobuf v1.5.2 - github.com/google/uuid v1.3.0 - github.com/sarulabs/dingo v2.0.0+incompatible github.com/streadway/amqp v1.0.0 github.com/stretchr/testify v1.7.0 google.golang.org/grpc v1.44.0 @@ -14,22 +12,13 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/google/go-cmp v0.5.5 // indirect github.com/kr/text v0.2.0 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rakyll/gotest v0.0.6 // indirect github.com/stretchr/objx v0.3.0 // indirect - github.com/vektra/mockery v1.1.2 // indirect - golang.org/x/mod v0.5.1 // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/tools v0.1.9 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 6db670d..5b9a3c1 100644 --- a/go.sum +++ b/go.sum @@ -27,15 +27,11 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -45,7 +41,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= @@ -55,79 +50,45 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rakyll/gotest v0.0.6 h1:hBTqkO3jiuwYW/M9gL4bu0oTYcm8J6knQAAPUsJsz1I= -github.com/rakyll/gotest v0.0.6/go.mod h1:SkoesdNCWmiD4R2dljIUcfSnNdVZ12y8qK4ojDkc2Sc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/sarulabs/dingo v2.0.0+incompatible h1:f9pmmm5cHdSOMQntbLqWh7rjmTXFR5oDOHMxbEurh1A= -github.com/sarulabs/dingo v2.0.0+incompatible/go.mod h1:Jmr4WvEOXuTjOixjySJxjvnbELR7dmlYPX4szOBCcU4= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4= -github.com/vektra/mockery v1.1.2/go.mod h1:VcfZjKaFOPO+MpN4ZvwPjs4c48lkq1o3Ym8yHZJu0jU= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -136,29 +97,20 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -167,35 +119,22 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 h1:Rt0FRalMgdSlXAVJvX4pr65KfqaxHXSLkSJRD9pw6g0= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 h1:YxHp5zqIcAShDEvRr5/0rVESVS+njYF68PSdazrNLJo= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0-pre h1:PVZrwq0Uyu/ItyjGm2UJMD65GYT5F32WIornvBYEPrE= -google.golang.org/grpc v1.28.0-pre/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= @@ -208,10 +147,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= @@ -222,8 +158,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From cdfac6b111d61fc139a4e9680cb69fb0d59afc87 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 16 Jun 2023 08:54:15 +0200 Subject: [PATCH 19/37] feat: try to fix linter --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24f17fd..82da2de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,5 +33,7 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.29 + skip-pkg-cache: true + skip-build-cache: true - name: Test run: go test -v -race ./... From 83321f367e085cc42b50c2b0baa8afc1162402f6 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 16 Jun 2023 12:15:31 +0200 Subject: [PATCH 20/37] revert changes in ci.yml --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82da2de..24f17fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,5 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.29 - skip-pkg-cache: true - skip-build-cache: true - name: Test run: go test -v -race ./... From f28b9c30ef7975a7d2f1d5966ddafb2eedd0dacb Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 16 Jun 2023 12:21:13 +0200 Subject: [PATCH 21/37] change ci steps order --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24f17fd..beed1ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,10 @@ jobs: env: GO111MODULE: on steps: + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 - name: Checkout code uses: actions/checkout@v2 - name: Install Go @@ -29,9 +33,5 @@ jobs: run: | sudo apt-get install -y protobuf-compiler make build - - name: Lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.29 - name: Test run: go test -v -race ./... From 4479d1b10cbe63faa69697ea5e44535a3568b884 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 16 Jun 2023 12:30:13 +0200 Subject: [PATCH 22/37] revert ci.yaml --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index beed1ed..3267798 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,6 @@ jobs: env: GO111MODULE: on steps: - - name: Lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.29 - name: Checkout code uses: actions/checkout@v2 - name: Install Go @@ -33,5 +29,10 @@ jobs: run: | sudo apt-get install -y protobuf-compiler make build + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 + skip-cache: true - name: Test run: go test -v -race ./... From b4dda4a79950374477838689a337c15453912721 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Fri, 16 Jun 2023 12:39:49 +0200 Subject: [PATCH 23/37] skip pkg cache --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3267798..4ecd991 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,6 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.29 - skip-cache: true + skip-pkg-cache: true - name: Test run: go test -v -race ./... From 7e616f856edfd711003e5e9f67fb5efb9299ea67 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 28 Jun 2023 08:29:19 +0200 Subject: [PATCH 24/37] try to fix pipeline --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ecd991..c8a49d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,5 +34,6 @@ jobs: with: version: v1.29 skip-pkg-cache: true + skip-go-installation: true - name: Test run: go test -v -race ./... From 5e030e2e0c8b0f6f47eb3287fc82091c1fa818cc Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 28 Jun 2023 09:03:43 +0200 Subject: [PATCH 25/37] revert skip pkg cache --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8a49d6..aa42fe7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,6 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.29 - skip-pkg-cache: true skip-go-installation: true - name: Test run: go test -v -race ./... From 03250d915c70c0d251443fc2096b08831679216f Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 28 Jun 2023 09:08:51 +0200 Subject: [PATCH 26/37] upgrade golangci lint to v3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa42fe7..a5bff0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: sudo apt-get install -y protobuf-compiler make build - name: Lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: v1.29 skip-go-installation: true From fa50d0653b7c4f7a883e4ed8a7487e0493827c05 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 28 Jun 2023 09:23:13 +0200 Subject: [PATCH 27/37] upgrade action version --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5bff0c..020c13c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,16 +4,16 @@ jobs: test: strategy: matrix: - go-version: [1.17.x] + go-version: [1.17] os: [ubuntu-latest] runs-on: ${{ matrix.os }} env: GO111MODULE: on steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} # - name: Cache go modules @@ -33,6 +33,5 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: v1.29 - skip-go-installation: true - name: Test run: go test -v -race ./... From 0fc97d3543e702b0bb08fe9be4e98bc525850b81 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 28 Jun 2023 09:58:47 +0200 Subject: [PATCH 28/37] skipt build and pkg cache --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 020c13c..a1376f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,5 +33,7 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: v1.29 + skip-pkg-cache: true + skip-build-cache: true - name: Test run: go test -v -race ./... From a456cb026f5a9507c40b27c6de2dc9f42589084b Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 28 Jun 2023 10:10:07 +0200 Subject: [PATCH 29/37] update insecure packages --- go.mod | 6 +++--- go.sum | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index cc8ebc8..251dfb9 100644 --- a/go.mod +++ b/go.mod @@ -16,9 +16,9 @@ require ( github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.3.0 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20220225143137-f80d34dcf065 // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/text v0.3.8 // indirect google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 5b9a3c1..59d5e26 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225143137-f80d34dcf065 h1:jgKfOyUVauyu8RYKct8kOTXHrkh9e00pVImB+HKeGa0= +golang.org/x/net v0.0.0-20220225143137-f80d34dcf065/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -104,16 +104,14 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From ebcc56b682dc28a2a255594a81ada4670ea9abdb Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Tue, 2 Apr 2024 18:38:26 +0200 Subject: [PATCH 30/37] revert to golangci-lint v2 --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1376f3..1424e05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,10 +30,8 @@ jobs: sudo apt-get install -y protobuf-compiler make build - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v2 with: version: v1.29 - skip-pkg-cache: true - skip-build-cache: true - name: Test run: go test -v -race ./... From fb1949a9cca756725490c750e026328f7f595c90 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 09:23:36 +0200 Subject: [PATCH 31/37] update to go 1.19 --- .github/workflows/ci.yml | 2 +- Dockerfile | 2 +- Makefile | 2 +- go.mod | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1424e05..20a8a3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: test: strategy: matrix: - go-version: [1.17] + go-version: [1.19] os: [ubuntu-latest] runs-on: ${{ matrix.os }} env: diff --git a/Dockerfile b/Dockerfile index a80380f..5dca9e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.17-buster AS build +FROM golang:1.19-buster AS build RUN apt-get update \ && apt-get install -y protobuf-compiler diff --git a/Makefile b/Makefile index ad789f4..769c301 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ dep: go get -u github.com/rakyll/gotest go get -u github.com/vektra/mockery/.../ go get -u github.com/golang/protobuf/proto - go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.2 + go install github.com/golang/protobuf/protoc-gen-go@v1.3.2 go get -u google.golang.org/grpc go mod download build: dep generate-proto diff --git a/go.mod b/go.mod index 251dfb9..586cd3d 100644 --- a/go.mod +++ b/go.mod @@ -24,4 +24,4 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -go 1.17 +go 1.19 From 9c37b192df3a2276551abd8e24e49b8da92eda7b Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 09:29:41 +0200 Subject: [PATCH 32/37] upgrade golangci-lint --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20a8a3b..ff84069 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,8 @@ jobs: sudo apt-get install -y protobuf-compiler make build - name: Lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v4 with: - version: v1.29 + version: v1.54 - name: Test run: go test -v -race ./... From 5c2d783b75c23449d0b8ad5be1806b8988169e71 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 09:37:33 +0200 Subject: [PATCH 33/37] revert to go 1.17 --- .github/workflows/ci.yml | 2 +- Dockerfile | 2 +- go.mod | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff84069..2adcf6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: test: strategy: matrix: - go-version: [1.19] + go-version: [1.17] os: [ubuntu-latest] runs-on: ${{ matrix.os }} env: diff --git a/Dockerfile b/Dockerfile index 5dca9e9..a80380f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19-buster AS build +FROM golang:1.17-buster AS build RUN apt-get update \ && apt-get install -y protobuf-compiler diff --git a/go.mod b/go.mod index 586cd3d..251dfb9 100644 --- a/go.mod +++ b/go.mod @@ -24,4 +24,4 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -go 1.19 +go 1.17 From 9ffe7a4ceb7cb6295574d51a47a4d4355687cdc5 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 09:45:30 +0200 Subject: [PATCH 34/37] use go 1.19 --- .github/workflows/ci.yml | 2 +- Dockerfile | 2 +- docker-compose.yaml | 2 +- go.mod | 2 +- pkg/readers/adapters/amqp.go | 3 +-- pkg/writers/adapters/elasticsearch_test.go | 10 +++++----- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2adcf6f..ff84069 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: test: strategy: matrix: - go-version: [1.17] + go-version: [1.19] os: [ubuntu-latest] runs-on: ${{ matrix.os }} env: diff --git a/Dockerfile b/Dockerfile index a80380f..5dca9e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.17-buster AS build +FROM golang:1.19-buster AS build RUN apt-get update \ && apt-get install -y protobuf-compiler diff --git a/docker-compose.yaml b/docker-compose.yaml index 5fb53d9..e930585 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -50,7 +50,7 @@ services: - bootstrap.memory_lock=true - discovery.seed_hosts=elasticsearch - cluster.initial_master_nodes=elasticsearch - - vm.max_map_count=262144 + # - bootstrap.system_call_filter=false ulimits: memlock: soft: -1 diff --git a/go.mod b/go.mod index 251dfb9..586cd3d 100644 --- a/go.mod +++ b/go.mod @@ -24,4 +24,4 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -go 1.17 +go 1.19 diff --git a/pkg/readers/adapters/amqp.go b/pkg/readers/adapters/amqp.go index 07db82d..cde1c40 100644 --- a/pkg/readers/adapters/amqp.go +++ b/pkg/readers/adapters/amqp.go @@ -9,7 +9,6 @@ import ( amqpAdapter "github.com/softonic/homing-pigeon/pkg/readers/adapters/amqp" "github.com/streadway/amqp" "html/template" - "io/ioutil" "k8s.io/klog" "os" "strconv" @@ -83,7 +82,7 @@ func NewAmqpReaderAdapter(config amqpAdapter.Config) (ReadAdapter, error) { cfg := new(tls.Config) cfg.RootCAs = x509.NewCertPool() var ca []byte - ca, err = ioutil.ReadFile(caPath) + ca, err = os.ReadFile(caPath) if err == nil { cfg.RootCAs.AppendCertsFromPEM(ca) klog.V(0).Infof("Added CA certificate %s", caPath) diff --git a/pkg/writers/adapters/elasticsearch_test.go b/pkg/writers/adapters/elasticsearch_test.go index 2533f35..c5d423f 100644 --- a/pkg/writers/adapters/elasticsearch_test.go +++ b/pkg/writers/adapters/elasticsearch_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "io" - "io/ioutil" + "os" "strings" "testing" ) @@ -98,7 +98,7 @@ func TestBulkActionWithSingleItemSucessful(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: ioutil.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")), + Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")), } bulk.On("func1", mock.Anything).Once().Return(&response, nil) @@ -125,7 +125,7 @@ func TestBulkActionWithSingleItemUnsuccessful(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: ioutil.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")), + Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")), } bulk.On("func1", mock.Anything).Once().Return(&response, nil) @@ -152,7 +152,7 @@ func TestBulkActionWithMixedItemStatus(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: ioutil.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")), + Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")), } bulk.On("func1", mock.Anything).Once().Return(&response, nil) @@ -189,7 +189,7 @@ func TestBulkActionWithOnlyMetadata(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: ioutil.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")), + Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")), } expectedBody := "{\"delete\":{\"_id\":\"123\"}}\n" bulk.On("func1", expectedBody).Once().Return(&response, nil) From ecc1e5d727c79dc3af57708aa64484047e0eacb5 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 10:01:47 +0200 Subject: [PATCH 35/37] try disabling package caching --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff84069..4b50293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,5 +33,6 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: v1.54 + skip-pkg-cache: true - name: Test run: go test -v -race ./... From ea0f2a126f9bb650573d0048c9c3f9236f2192e5 Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 10:09:07 +0200 Subject: [PATCH 36/37] fix lint errors --- pkg/messages/message.go | 2 +- pkg/writers/adapters/elasticsearch_test.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/messages/message.go b/pkg/messages/message.go index 28613e7..5d8d51a 100644 --- a/pkg/messages/message.go +++ b/pkg/messages/message.go @@ -32,7 +32,7 @@ func (m Message) Ack() (Ack, error) { }, nil } -func (m Message) setAsAcked() error { +func (m *Message) setAsAcked() error { if m.acked { return errors.New("Message already acked") } diff --git a/pkg/writers/adapters/elasticsearch_test.go b/pkg/writers/adapters/elasticsearch_test.go index c5d423f..4afe95d 100644 --- a/pkg/writers/adapters/elasticsearch_test.go +++ b/pkg/writers/adapters/elasticsearch_test.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "io" - "os" "strings" "testing" ) @@ -98,7 +97,7 @@ func TestBulkActionWithSingleItemSucessful(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")), + Body: io.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")), } bulk.On("func1", mock.Anything).Once().Return(&response, nil) @@ -125,7 +124,7 @@ func TestBulkActionWithSingleItemUnsuccessful(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")), + Body: io.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")), } bulk.On("func1", mock.Anything).Once().Return(&response, nil) @@ -152,7 +151,7 @@ func TestBulkActionWithMixedItemStatus(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")), + Body: io.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")), } bulk.On("func1", mock.Anything).Once().Return(&response, nil) @@ -189,7 +188,7 @@ func TestBulkActionWithOnlyMetadata(t *testing.T) { response := esapi.Response{ StatusCode: 201, Header: nil, - Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")), + Body: io.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")), } expectedBody := "{\"delete\":{\"_id\":\"123\"}}\n" bulk.On("func1", expectedBody).Once().Return(&response, nil) From 81f196a4af021f28e6f0c86a150f9175dcf2121a Mon Sep 17 00:00:00 2001 From: Pau Peinado Date: Wed, 3 Apr 2024 11:43:10 +0200 Subject: [PATCH 37/37] revert socket name --- docker-compose.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index e930585..e038d1a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -33,7 +33,7 @@ services: - ./sockets:/tmp image: softonic/hp-pass-middleware:0.1.0 environment: - IN_SOCKET: "unix:///tmp/hp" + IN_SOCKET: "/tmp/hp" command: ["-stderrthreshold=INFO"] rabbit-mq: image: rabbitmq:3.8-management @@ -50,7 +50,6 @@ services: - bootstrap.memory_lock=true - discovery.seed_hosts=elasticsearch - cluster.initial_master_nodes=elasticsearch - # - bootstrap.system_call_filter=false ulimits: memlock: soft: -1