Repository: Ippolid/auth
Pull request #1: add holostay logika+grpc server
Author: login: Ippolid
Created: 2025-04-01T18:46:31Z | Merged: 2025-04-02T12:02:21Z

Прото фаил есть уже, тупанул сразу в мейне


Diff:
diff --git a/.gitignore b/.gitignore
index 28a280c..40ffa9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 .idea
 /bin/
+/grpc/bin/
diff --git a/.golangci.pipeline.yaml b/.golangci.pipeline.yaml
index c24a6a3..fb86f87 100755
--- a/.golangci.pipeline.yaml
+++ b/.golangci.pipeline.yaml
@@ -1,28 +1,69 @@
-# More info on config here: https://golangci-lint.run/usage/configuration/#config-file
+## More info on config here: https://golangci-lint.run/usage/configuration/#config-file
+#run:
+#  concurrency: 8
+#  timeout: 10m
+#  issues-exit-code: 1
+#  tests: true
+#  issues:
+#    exclude-files:
+#      - \.pb\.go$
+#      - \.pb\.gw\.go$
+#    exclude-dirs:
+#      - bin
+#      - vendor
+#      - var
+#      - tmp
+#      - .cache
+#
+#output:
+#  formats: colored-line-number
+#  print-issued-lines: true
+#  print-linter-name: true
+#
+#linters-settings:
+#  govet:
+#    shadow: true
+#  dupl:
+#    threshold: 100
+#  goconst:
+#    min-len: 2
+#    min-occurrences: 2
+#
+#linters:
+#  disable-all: true
+#  enable:
+#    - errcheck
+#    - goconst
+#    - goimports
+#    - gosec
+#    - govet
+#    - ineffassign
+#    - revive
+#    - typecheck
+#    - unused
+#
+#issues:
+#  exclude-use-default: false
+#  exclude:
+#    - G104 # _ instead of err checks
+#    - exported func .* returns unexported type .*, which can be annoying to use
+#    - should have a package comment
+#    - don't use an underscore in package name
+
+
 run:
   concurrency: 8
   timeout: 10m
   issues-exit-code: 1
   tests: true
-  issues:
-    exclude-files:
-      - \.pb\.go$
-      - \.pb\.gw\.go$
-    exclude-dirs:
-      - bin
-      - vendor
-      - var
-      - tmp
-      - .cache
 
 output:
-  formats: colored-line-number
+  formats:
+    - format: colored-line-number
   print-issued-lines: true
   print-linter-name: true
 
-linters-settings:
-  govet:
-    shadow: true
+linters-settings:  # Исправлено: убрали settings.shadow
   dupl:
     threshold: 100
   goconst:
@@ -43,6 +84,15 @@ linters:
     - unused
 
 issues:
+  exclude-files:
+    - \.pb\.go$
+    - \.pb\.gw\.go$
+  exclude-dirs:
+    - bin
+    - vendor
+    - var
+    - tmp
+    - .cache
   exclude-use-default: false
   exclude:
     - G104 # _ instead of err checks
diff --git a/Makefile b/Makefile
index c93a787..2d9ff3c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,29 @@
 LOCAL_BIN:=$(CURDIR)/bin
 
-install-golangci-lint:
+#LOCAL_BIN:=$(CURDIR)/bin
+#LOCAL_BIN:=$(CURDIR)/../bin
+
+install-deps:
+	GOBIN=$(LOCAL_BIN) go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
+	GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
 	GOBIN=$(LOCAL_BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
 
+get-deps:
+	go get -u google.golang.org/protobuf/cmd/protoc-gen-go
+	go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
+
+
+generate:
+	make generate-auth-api
+
+generate-auth-api:
+	mkdir -p grpc/pkg/auth_v1
+	protoc --proto_path grpc/api/auth_v1 \
+	--go_out=grpc/pkg/auth_v1 --go_opt=paths=source_relative \
+	--plugin=protoc-gen-go=bin/protoc-gen-go \
+	--go-grpc_out=grpc/pkg/auth_v1 --go-grpc_opt=paths=source_relative \
+	--plugin=protoc-gen-go-grpc=bin/protoc-gen-go-grpc \
+	grpc/api/auth_v1/auth.proto
+
 lint:
 	$(LOCAL_BIN)/golangci-lint run ./... --config .golangci.pipeline.yaml
\ No newline at end of file
diff --git a/go.mod b/go.mod
index 63ae8c2..7ceadd5 100644
--- a/go.mod
+++ b/go.mod
@@ -1,11 +1,20 @@
-module github.com/olezhek28/microservices_course_boilerplate
+module github.com/Ippolid/auth
 
-go 1.23
+go 1.23.3
 
-require github.com/fatih/color v1.17.0
+require (
+	github.com/brianvoe/gofakeit v3.18.0+incompatible
+	github.com/fatih/color v1.18.0
+	google.golang.org/grpc v1.71.1
+	google.golang.org/protobuf v1.36.6
+)
 
 require (
 	github.com/mattn/go-colorable v0.1.13 // indirect
 	github.com/mattn/go-isatty v0.0.20 // indirect
-	golang.org/x/sys v0.25.0 // indirect
+	golang.org/x/net v0.34.0 // indirect
+	golang.org/x/sys v0.29.0 // indirect
+	golang.org/x/text v0.21.0 // indirect
+	google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
+	google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 // indirect
 )
diff --git a/go.sum b/go.sum
index c572d48..4eaaab3 100644
--- a/go.sum
+++ b/go.sum
@@ -1,11 +1,47 @@
-github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
-github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
+github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8=
+github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc=
+github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
+github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
 github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
 github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
 github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
 github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
+go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
+go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
+go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
+go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
+go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
+go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
+go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
+go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
+go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
+go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
+go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
+golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
+golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
 golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
-golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
+golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
+golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
+google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI=
+google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
+google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A=
+google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA=
+google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
+google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
diff --git a/grpc/Makefile b/grpc/Makefile
deleted file mode 100644
index 69d59ad..0000000
--- a/grpc/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-LOCAL_BIN:=$(CURDIR)/bin
-
-install-deps:
-	GOBIN=$(LOCAL_BIN) go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
-	GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
-
-get-deps:
-	go get -u google.golang.org/protobuf/cmd/protoc-gen-go
-	go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
-
-
-generate:
-	make generate-auth-api
-
-generate-auth-api:
-	mkdir -p pkg/auth_v1
-	protoc --proto_path api/auth_v1 \
-	--go_out=pkg/auth_v1 --go_opt=paths=source_relative \
-	--plugin=protoc-gen-go=bin/protoc-gen-go \
-	--go-grpc_out=pkg/auth_v1 --go-grpc_opt=paths=source_relative \
-	--plugin=protoc-gen-go-grpc=bin/protoc-gen-go-grpc \
-	api/auth_v1/auth.proto
\ No newline at end of file
diff --git a/grpc/bin/protoc-gen-go b/grpc/bin/protoc-gen-go
deleted file mode 100755
index 883dc7f..0000000
Binary files a/grpc/bin/protoc-gen-go and /dev/null differ
diff --git a/grpc/bin/protoc-gen-go-grpc b/grpc/bin/protoc-gen-go-grpc
deleted file mode 100755
index b476707..0000000
Binary files a/grpc/bin/protoc-gen-go-grpc and /dev/null differ
diff --git a/grpc/cmd/grpc_server/main.go b/grpc/cmd/grpc_server/main.go
new file mode 100644
index 0000000..2ed04d2
--- /dev/null
+++ b/grpc/cmd/grpc_server/main.go
@@ -0,0 +1,80 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"log"
+	"net"
+
+	"github.com/Ippolid/auth/grpc/pkg/auth_v1"
+	"google.golang.org/protobuf/types/known/emptypb"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+)
+
+const grpcPort = 50051
+
+type server struct {
+	auth_v1.UnimplementedAuthV1Server
+}
+
+// Get ...
+func (s *server) Get(_ context.Context, req *auth_v1.GetRequest) (*auth_v1.GetResponse, error) {
+	log.Printf("Note id: %d", req.GetId())
+
+	return &auth_v1.GetResponse{
+		Note: &auth_v1.UserGet{
+			Id: req.GetId(),
+			Info: &auth_v1.UserInfo{
+				Name:  gofakeit.BeerName(),
+				Email: gofakeit.Email(),
+			},
+			CreatedAt: timestamppb.New(gofakeit.Date()),
+			UpdatedAt: timestamppb.New(gofakeit.Date()),
+		},
+	}, nil
+}
+
+func (s *server) Create(_ context.Context, req *auth_v1.CreateRequest) (*auth_v1.CreateResponse, error) {
+	//чето делается
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &auth_v1.CreateResponse{
+		Id: gofakeit.Int64(),
+	}, nil
+}
+
+func (s *server) Update(_ context.Context, req *auth_v1.UpdateRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &emptypb.Empty{}, nil
+}
+
+func (s *server) Delete(_ context.Context, req *auth_v1.DeleteRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+
+	return &emptypb.Empty{}, nil
+}
+
+func main() {
+	lis, err := net.Listen("tcp", fmt.Sprintf(":%d", grpcPort))
+	if err != nil {
+		log.Fatalf("failed to listen: %v", err)
+	}
+
+	s := grpc.NewServer()
+	reflection.Register(s)
+	auth_v1.RegisterAuthV1Server(s, &server{})
+
+	log.Printf("server listening at %v", lis.Addr())
+
+	if err = s.Serve(lis); err != nil {
+		log.Fatalf("failed to serve: %v", err)
+	}
+}
diff --git a/grpc/go.mod b/grpc/go.mod
deleted file mode 100644
index b943873..0000000
--- a/grpc/go.mod
+++ /dev/null
@@ -1,15 +0,0 @@
-module github.com/Ippolid/auth/tree/main/grpc
-
-go 1.23.3
-
-require (
-	google.golang.org/grpc v1.71.1
-	google.golang.org/protobuf v1.36.6
-)
-
-require (
-	golang.org/x/net v0.34.0 // indirect
-	golang.org/x/sys v0.29.0 // indirect
-	golang.org/x/text v0.21.0 // indirect
-	google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
-)
diff --git a/grpc/go.sum b/grpc/go.sum
deleted file mode 100644
index 979d395..0000000
--- a/grpc/go.sum
+++ /dev/null
@@ -1,34 +0,0 @@
-github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
-github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
-github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
-github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
-github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
-github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
-go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
-go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
-go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
-go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
-go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
-go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
-go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
-go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
-go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
-go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
-go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
-golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
-golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
-golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
-golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
-golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
-google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI=
-google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
-google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
-google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This pull request adds a new gRPC server implementation that provides basic endpoints (Get, Create, Update, Delete) using a proto file from an existing repository and dummy data from gofakeit.  
- Introduces a new main.go for the gRPC server with basic endpoint logic.  
- Implements endpoint methods that generate fake data for responses.

<details>
<summary>Files not reviewed (1)</summary>

* **grpc/go.mod**: Language not supported
</details>

<details>
<summary>Comments suppressed due to low confidence (4)</summary>

**grpc/cmd/grpc_server/main.go:41**
* [nitpick] The comment here is ambiguous; please replace it with a clear description of the intended functionality in the Create method.
```
//чето делается
```
**grpc/cmd/grpc_server/main.go:50**
* [nitpick] The comment in the Update method is unclear; consider updating it to explain precisely what changes or logic are being applied.
```
//чето делается
```
**grpc/cmd/grpc_server/main.go:42**
* [nitpick] Consider using log.Printf instead of fmt.Printf for consistency with the other logging statements in the code.
```
fmt.Printf("name +%v\n", req.Info)
```
**grpc/cmd/grpc_server/main.go:51**
* [nitpick] It may be beneficial to add a newline or use log.Printf here to ensure the log messages are clearly separated.
```
fmt.Printf("User id: %d", req.GetId())
```
</details>


state: COMMENTED
author_association: NONE
submitted_at: 2025-04-01T18:46:49Z
user: login: Dnlbb
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-01T20:20:14Z
user: login: Ippolid
state: COMMENTED
author_association: OWNER
submitted_at: 2025-04-01T21:07:57Z
user: login: Ippolid
state: COMMENTED
author_association: OWNER
submitted_at: 2025-04-01T21:08:21Z
user: login: Dnlbb
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-01T21:12:17Z
user: login: Dnlbb
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-02T11:56:25Z

Review comments:
diff_hunk: @@ -1,2 +1,3 @@
 .idea
 /bin/
+/grpc/bin/
path: .gitignore
user: login: Dnlbb
body: сделай чтобы папка с бинарниками одна была
created_at: 2025-04-01T20:13:49Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
path: grpc/cmd/grpc_server/main.go
user: login: Dnlbb
body: вот это убери, просто пакета название чтобы было 
created_at: 2025-04-01T20:14:40Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
+)
+
+const grpcPort = 50051
+
+type server struct {
+	desc.UnimplementedAuthV1Server
+}
+
+// Get ...
+func (s *server) Get(ctx context.Context, req *desc.GetRequest) (*desc.GetResponse, error) {
+	log.Printf("Note id: %d", req.GetId())
path: grpc/cmd/grpc_server/main.go
user: login: Dnlbb
body: перед return пустая строка
created_at: 2025-04-01T20:16:02Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
+)
+
+const grpcPort = 50051
+
+type server struct {
+	desc.UnimplementedAuthV1Server
+}
+
+// Get ...
+func (s *server) Get(ctx context.Context, req *desc.GetRequest) (*desc.GetResponse, error) {
+	log.Printf("Note id: %d", req.GetId())
+	return &desc.GetResponse{
+		Note: &desc.UserGet{
+			Id: req.GetId(),
+			Info: &desc.UserInfo{
+				Name:  gofakeit.BeerName(),
+				Email: gofakeit.Email(),
+			},
+			CreatedAt: timestamppb.New(gofakeit.Date()),
+			UpdatedAt: timestamppb.New(gofakeit.Date()),
+		},
+	}, nil
+}
+
+func (s *server) Create(ctx context.Context, req *desc.CreateRequest) (*desc.CreateResponse, error) {
+	//чето делается
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &desc.CreateResponse{
+		Id: gofakeit.Int64(),
+	}, nil
+}
+
+func (s *server) Update(ctx context.Context, req *desc.UpdateRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &emptypb.Empty{}, nil
+}
+
+func (s *server) Delete(ctx context.Context, req *desc.DeleteRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
path: grpc/cmd/grpc_server/main.go
user: login: Dnlbb
body: перед return пустая строка 
created_at: 2025-04-01T20:16:30Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
+)
+
+const grpcPort = 50051
+
+type server struct {
+	desc.UnimplementedAuthV1Server
+}
+
+// Get ...
+func (s *server) Get(ctx context.Context, req *desc.GetRequest) (*desc.GetResponse, error) {
+	log.Printf("Note id: %d", req.GetId())
+	return &desc.GetResponse{
+		Note: &desc.UserGet{
+			Id: req.GetId(),
+			Info: &desc.UserInfo{
+				Name:  gofakeit.BeerName(),
+				Email: gofakeit.Email(),
+			},
+			CreatedAt: timestamppb.New(gofakeit.Date()),
+			UpdatedAt: timestamppb.New(gofakeit.Date()),
+		},
+	}, nil
+}
+
+func (s *server) Create(ctx context.Context, req *desc.CreateRequest) (*desc.CreateResponse, error) {
+	//чето делается
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &desc.CreateResponse{
+		Id: gofakeit.Int64(),
+	}, nil
+}
+
+func (s *server) Update(ctx context.Context, req *desc.UpdateRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &emptypb.Empty{}, nil
+}
+
+func (s *server) Delete(ctx context.Context, req *desc.DeleteRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+	return &emptypb.Empty{}, nil
+}
+
+func main() {
+	lis, err := net.Listen("tcp", fmt.Sprintf(":%d", grpcPort))
+	if err != nil {
+		log.Fatalf("failed to listen: %v", err)
+	}
+
+	s := grpc.NewServer()
+	reflection.Register(s)
path: grpc/cmd/grpc_server/main.go
user: login: Dnlbb
body: зачем это знаешь?

created_at: 2025-04-01T20:17:13Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
path: grpc/cmd/grpc_server/main.go
user: login: Ippolid
body: а почему ?

created_at: 2025-04-01T21:07:57Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
+)
+
+const grpcPort = 50051
+
+type server struct {
+	desc.UnimplementedAuthV1Server
+}
+
+// Get ...
+func (s *server) Get(ctx context.Context, req *desc.GetRequest) (*desc.GetResponse, error) {
+	log.Printf("Note id: %d", req.GetId())
+	return &desc.GetResponse{
+		Note: &desc.UserGet{
+			Id: req.GetId(),
+			Info: &desc.UserInfo{
+				Name:  gofakeit.BeerName(),
+				Email: gofakeit.Email(),
+			},
+			CreatedAt: timestamppb.New(gofakeit.Date()),
+			UpdatedAt: timestamppb.New(gofakeit.Date()),
+		},
+	}, nil
+}
+
+func (s *server) Create(ctx context.Context, req *desc.CreateRequest) (*desc.CreateResponse, error) {
+	//чето делается
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &desc.CreateResponse{
+		Id: gofakeit.Int64(),
+	}, nil
+}
+
+func (s *server) Update(ctx context.Context, req *desc.UpdateRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+	fmt.Printf("name +%v\n", req.Info)
+
+	return &emptypb.Empty{}, nil
+}
+
+func (s *server) Delete(ctx context.Context, req *desc.DeleteRequest) (*emptypb.Empty, error) {
+	//чето делается
+	fmt.Printf("User id: %d", req.GetId())
+	return &emptypb.Empty{}, nil
+}
+
+func main() {
+	lis, err := net.Listen("tcp", fmt.Sprintf(":%d", grpcPort))
+	if err != nil {
+		log.Fatalf("failed to listen: %v", err)
+	}
+
+	s := grpc.NewServer()
+	reflection.Register(s)
path: grpc/cmd/grpc_server/main.go
user: login: Ippolid
body: типо по запросу документацию отправлять
created_at: 2025-04-01T21:08:20Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,78 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"google.golang.org/protobuf/types/known/emptypb"
+	"log"
+	"net"
+
+	"github.com/brianvoe/gofakeit"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/reflection"
+	"google.golang.org/protobuf/types/known/timestamppb"
+
+	desc "github.com/Ippolid/auth/tree/main/grpc/pkg/auth_v1"
path: grpc/cmd/grpc_server/main.go
user: login: Dnlbb
body: потому что будет еще кроме этого импорта и что тогда? desc2?
created_at: 2025-04-01T21:12:16Z
author_association: COLLABORATOR
diff_hunk: @@ -1,5 +1,29 @@
 LOCAL_BIN:=$(CURDIR)/bin
 
+#LOCAL_BIN:=$(CURDIR)/bin
+#LOCAL_BIN:=$(CURDIR)/../bin
+
+install-deps:
+	GOBIN=$(LOCAL_BIN) go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
+	GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
+
+get-deps:
+	go get -u google.golang.org/protobuf/cmd/protoc-gen-go
+	go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
+
+
+generate:
+	make generate-auth-api
+
+generate-auth-api:
+	mkdir -p grpc/pkg/auth_v1
+	protoc --proto_path grpc/api/auth_v1 \
+	--go_out=grpc/pkg/auth_v1 --go_opt=paths=source_relative \
+	--plugin=protoc-gen-go=bin/protoc-gen-go \
+	--go-grpc_out=grpc/pkg/auth_v1 --go-grpc_opt=paths=source_relative \
+	--plugin=protoc-gen-go-grpc=bin/protoc-gen-go-grpc \
+	grpc/api/auth_v1/auth.proto
+
 install-golangci-lint:
path: Makefile
user: login: Dnlbb
body: вот этому место как-будто в install-deps
created_at: 2025-04-02T11:56:22Z
author_association: COLLABORATOR

PR comments:
user: login: Dnlbb
created_at: 2025-04-01T18:47:19Z
body: линтер
author_association: COLLABORATOR
user: login: Dnlbb
created_at: 2025-04-01T18:59:54Z
body: в игнор добавь bin
author_association: COLLABORATOR
user: login: Dnlbb
created_at: 2025-04-02T06:10:06Z
body: у тебя откуда-то появился go.mod и go.sum в папке grpc их там быть не должно, они одни на весь сервис
author_association: COLLABORATOR
user: login: Dnlbb
created_at: 2025-04-02T06:10:47Z
body: у тебя должен быть один Makefile в корне, в нем и пропиши скачивание зависимостей для proto
author_association: COLLABORATOR
user: login: Dnlbb
created_at: 2025-04-02T11:55:23Z
body: удали bin из grpc вообще 
author_association: COLLABORATOR