Skip to content

Commit

Permalink
Merge pull request #137 from meshery/feat/bumpgo
Browse files Browse the repository at this point in the history
Bump go version and remove no useful tracing code
  • Loading branch information
Aisuko authored Oct 27, 2023
2 parents a0dffc1 + 1487d71 commit aab8a58
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 510 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Default Meshery Adapter Library CI
name: CI

on:
push:
Expand Down
5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ linters-settings:
enabled: true
check-shadowing: true
tests: true
golint:
gofmt:
enabled: true
min-confidence: 0.8
unused:
enabled: true
check-exported: true
Expand All @@ -47,7 +46,7 @@ linters:
- goconst
- gocritic
- govet
- golint
- gofmt
- unused
- cyclop
- scopelint
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ tidy:

verify:
go mod verify
go vet ./...

test:
go test --short ./... -race -coverprofile=coverage.txt -covermode=atomic
13 changes: 2 additions & 11 deletions api/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ import (

"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery"
"github.com/layer5io/meshery-adapter-library/adapter"
"github.com/layer5io/meshery-adapter-library/api/tracing"
"github.com/layer5io/meshery-adapter-library/meshes"
"github.com/layer5io/meshkit/utils/events"
otelgrpc "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/otel"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
Expand Down Expand Up @@ -60,19 +57,13 @@ func panicHandler(r interface{}) error {
}

// Start starts grpc server.
func Start(s *Service, _ tracing.Handler) error {
func Start(s *Service) error {
address := fmt.Sprintf(":%s", s.Port)
listener, err := net.Listen("tcp", address)
if err != nil {
return ErrGrpcListener(err)
}

tp := sdktrace.NewTracerProvider(
sdktrace.WithSampler(sdktrace.AlwaysSample()),
)

otel.SetTracerProvider(tp)

server := grpc.NewServer(
grpc.ChainUnaryInterceptor(
otelgrpc.UnaryServerInterceptor(),
Expand Down
8 changes: 0 additions & 8 deletions api/grpc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ import (
"context"
)

// // CreateMeshInstance is the handler function for the method CreateMeshInstance.
// func (s *Service) CreateMeshInstance(ctx context.Context, req *meshes.CreateMeshInstanceRequest) (*meshes.CreateMeshInstanceResponse, error) {
// err := s.Handler.CreateInstance(&s.Channel)
// if err != nil {
// return nil, err
// }
// return &meshes.CreateMeshInstanceResponse{}, nil
// }

// MeshName is the handler function for the method MeshName.
func (s *Service) MeshName(ctx context.Context, req *meshes.MeshNameRequest) (*meshes.MeshNameResponse, error) {
Expand Down
85 changes: 0 additions & 85 deletions api/tracing/tracing.go

This file was deleted.

Loading

0 comments on commit aab8a58

Please sign in to comment.