Skip to content

Commit 19424b0

Browse files
committed
reorg as per discussion
1 parent a42ee3f commit 19424b0

26 files changed

+70
-43
lines changed

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ Routing](docs/sandbox-routing.md).
1111

1212
The Signadot Operator packages a routeserver deployment and service in the
1313
`signadot` namespace, running a GRPC service at
14-
`routeserver.signadot.svc:7777`. This repository provides client support for
15-
using the routeserver.
14+
`routeserver.signadot.svc:7777`. This repository provides the service
15+
definition, examples, and [a Go client](go-routesapi/README.md).
1616

1717
## Contents
1818

1919
This repository hosts
2020

2121
- The [GRPC service definition](routes.proto).
22-
- A generated Go client.
23-
- Libraries for destination workload routing.
24-
- A command for querying the route server.
22+
- A generated Go client with supporting libraries and a command for querying the routeserver.
2523
- Documentation
2624
* [Sandbox Routing](docs/sandbox-routing.md)
2725
* [Workload Rules](docs/workload-rules.md)

Makefile renamed to go-routesapi/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
generate-proto:
33
protoc --go_out=. --go_opt=paths=source_relative \
44
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
5-
routes.proto
5+
-I .. \
6+
../routes.proto
67
perl -i -pe s/SandboxId/SandboxID/g *.go

go-routesapi/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Signadot Routes API Go Client
2+
3+
## Overview
4+
5+
The Signadot Routes API provides access to routing rules pertinent to Signadot
6+
Sandboxes on a cluster with the Signadot Operator (>= v0.14.2) installed.
7+
Effective use of the Routes API requires an understanding of [Sandbox
8+
Routing](../docs/sandbox-routing.md).
9+
10+
## Routeserver
11+
12+
The Signadot Operator packages a routeserver deployment and service in the
13+
`signadot` namespace, running a GRPC service at
14+
`routeserver.signadot.svc:7777`. This repository provides client support for
15+
using the routeserver.
16+
17+
## Contents
18+
19+
This directory hosts
20+
21+
- A generated Go client.
22+
- Libraries for destination workload routing.
23+
- A command for querying the route server.
24+
- Documentation
25+
* [Sidecar Routing](docs/sidecar-routing.md)
26+
* [Message queues](docs/message-queues.md)
27+
28+
29+
30+
31+
32+
33+
34+
35+

cmd/sdroutes/main.go renamed to go-routesapi/cmd/sdroutes/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"log"
88
"time"
99

10-
"github.com/signadot/routesapi"
10+
"github.com/signadot/routesapi/go-routesapi"
1111
"google.golang.org/grpc"
1212
"google.golang.org/protobuf/encoding/protojson"
1313
)
File renamed without changes.
File renamed without changes.
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
module github.com/signadot/routesapi
1+
module github.com/signadot/routesapi/go-routesapi
22

33
go 1.21.3
44

55
require (
6-
google.golang.org/grpc v1.59.0
6+
google.golang.org/grpc v1.60.0
77
google.golang.org/protobuf v1.31.0
88
k8s.io/apimachinery v0.28.4
99
)
@@ -14,7 +14,7 @@ require (
1414
golang.org/x/net v0.17.0 // indirect
1515
golang.org/x/sys v0.13.0 // indirect
1616
golang.org/x/text v0.13.0 // indirect
17-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
17+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
1818
k8s.io/klog/v2 v2.100.1 // indirect
1919
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
2020
)

go.sum renamed to go-routesapi/go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1414
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
1515
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
1616
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
17-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
18-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
19-
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
20-
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
17+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0=
18+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY=
19+
google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k=
20+
google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
2121
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
2222
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
2323
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
File renamed without changes.
File renamed without changes.

routes.pb.go renamed to go-routesapi/routes.pb.go

+8-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.

watched/baseline_watched.go renamed to go-routesapi/watched/baseline_watched.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package watched
33
import (
44
"context"
55

6-
"github.com/signadot/routesapi"
6+
"github.com/signadot/routesapi/go-routesapi"
77
"google.golang.org/protobuf/proto"
88
)
99

File renamed without changes.
File renamed without changes.
File renamed without changes.

watched/key.go renamed to go-routesapi/watched/key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package watched
22

3-
import "github.com/signadot/routesapi"
3+
import "github.com/signadot/routesapi/go-routesapi"
44

55
// key represents a way to identify a [routes.WorkloadRule].
66
type key struct {

watched/watched.go renamed to go-routesapi/watched/watched.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"context"
55
"sync"
66

7-
"github.com/signadot/routesapi"
8-
"github.com/signadot/routesapi/internal/indices"
9-
"github.com/signadot/routesapi/internal/queue"
7+
"github.com/signadot/routesapi/go-routesapi"
8+
"github.com/signadot/routesapi/go-routesapi/internal/indices"
9+
"github.com/signadot/routesapi/go-routesapi/internal/queue"
1010
"google.golang.org/grpc"
1111
"google.golang.org/protobuf/proto"
1212
)

watched/watched_test.go renamed to go-routesapi/watched/watched_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"log/slog"
99

10-
"github.com/signadot/routesapi"
10+
"github.com/signadot/routesapi/go-routesapi"
1111
)
1212

1313
func TestWatched(t *testing.T) {

watched/watcher.go renamed to go-routesapi/watched/watcher.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"context"
55
"time"
66

7-
"github.com/signadot/routesapi"
8-
"github.com/signadot/routesapi/internal/queue"
9-
"github.com/signadot/routesapi/internal/retrypolicy"
7+
"github.com/signadot/routesapi/go-routesapi"
8+
"github.com/signadot/routesapi/go-routesapi/internal/queue"
9+
"github.com/signadot/routesapi/go-routesapi/internal/retrypolicy"
1010
"google.golang.org/grpc"
1111
)
1212

workload/config.go renamed to go-routesapi/workload/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"log/slog"
55
"os"
66

7-
"github.com/signadot/routesapi/watched"
7+
"github.com/signadot/routesapi/go-routesapi/watched"
88
)
99

1010
type Config struct {

workload/env.go renamed to go-routesapi/workload/env.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package workload
22

3-
import "github.com/signadot/routesapi/watched"
3+
import "github.com/signadot/routesapi/go-routesapi/watched"
44

55
func RouteserverAddr() string {
66
return watched.GetRouteServerAddr()

workload/router.go renamed to go-routesapi/workload/router.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/signadot/routesapi"
8-
"github.com/signadot/routesapi/watched"
7+
"github.com/signadot/routesapi/go-routesapi"
8+
"github.com/signadot/routesapi/go-routesapi/watched"
99
)
1010

1111
type Router interface {

routes.proto

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
option go_package = "github.com/signadot/routesapi";
3+
option go_package = "github.com/signadot/routesapi/routesapi-go;routesapi";
44

55
package routes;
66

@@ -16,10 +16,6 @@ service Routes {
1616
rpc WatchWorkloadRoutes(WorkloadRoutesRequest) returns (stream WorkloadRuleOp) {}
1717
}
1818

19-
20-
21-
22-
2319
// WorkloadRoutesRequest is a request for a set of WorkloadRules,
2420
// which give information about how to route requests when they are intercepted
2521
// at a given workload. Each field is optional and constrains the the set
@@ -48,7 +44,6 @@ message GetRoutesResponse {
4844

4945
// WatchRoutes
5046
// ----------------------------------------------------------------------------
51-
5247
enum WatchOp {
5348
ADD = 0;
5449
REMOVE = 1;
@@ -124,7 +119,3 @@ message Location {
124119
uint32 port = 2;
125120
}
126121

127-
128-
129-
130-

0 commit comments

Comments
 (0)