Skip to content

Commit

Permalink
docs: update docs (#88)
Browse files Browse the repository at this point in the history
* docs: add syntax highlighting

* docs: replace gitbook references with local site-local links

* docs: fix mis-spelled words

* docs: fix hyperlinks on home page

* docs: guides: fix links in overview section

* docs: update how topic name generation works

* docs: fix broken links in contribute section

* docs: remove duplicate roadmap on sidebar

* docs: restructure Data Formatters > Protobuf

* docs: restructure Publishing > gRPC

* docs: fix missing syntax highlighting

* docs: restructure architecture > event distribution

* docs: clarify how dynamic kafka client configs work

* docs: update code structure guide

* wip: quickstart code examples

* wip: quickstart code examples

* docs: quickstart: add java client example

* docs: add deployment instructions for prometheus

* docs: update package name (internal)

* docs: add instructions for prometheus in guides > monitoring

* docs: reference: mention prometheus as a metric exporter

* docs: add information about prometheus in architecture > observability

* docs: architecture: add information about available producers

* docs: arch: abstract out publisher

* docs: replace use of `kafka` with `publishers`

* docs: config: add separate section for each publisher

* docs: update release process

* clients: fix broken go client installation due to relocated dependency

* clients: go: fix broken tests

* docs: quickstart: use anon org name

* docs: quickstart: add a self-contained setup for raccoon

* docs: metrics: update toc

* docs: quickstart: fix typo
  • Loading branch information
turtleDev authored Jul 18, 2024
1 parent ed65b3e commit 3e5bc0a
Show file tree
Hide file tree
Showing 34 changed files with 15,220 additions and 1,797 deletions.
12 changes: 1 addition & 11 deletions clients/go/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
.PHONY: all
all : setup fmt staticcheck test

setup:
@echo "installing the dependencies..."
go get go.buf.build/raystack/gw/raystack/proton
go get golang.org/x/lint
go get google.golang.org/protobuf
go get github.com/gorilla/websocket
go get github.com/stretchr/testify
go get github.com/stretchr/testify
go get honnef.co/go/tools
all : fmt staticcheck test

fmt:
@echo "code formatting..."
Expand Down
38 changes: 30 additions & 8 deletions clients/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
module github.com/raystack/raccoon/clients/go

go 1.16
go 1.21

toolchain go1.22.4

require (
github.com/stretchr/testify v1.8.0
go.buf.build/raystack/gw/raystack/proton v1.1.131
github.com/stretchr/testify v1.8.4
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
honnef.co/go/tools v0.3.3
)

require (
github.com/gojek/heimdall/v7 v7.0.2
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.5.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gojek/valkyrie v0.0.0-20180215180059-6aee720afcdf // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
buf.build/gen/go/raystack/proton/grpc/go v1.4.0-20240713100241-5efa7d29c01b.2
buf.build/gen/go/raystack/proton/protocolbuffers/go v1.34.2-20240713100241-5efa7d29c01b.2
github.com/gojek/heimdall/v7 v7.0.3
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.0
)
194 changes: 45 additions & 149 deletions clients/go/go.sum

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions clients/go/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (

"github.com/raystack/raccoon/clients/go/log"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
rpc "buf.build/gen/go/raystack/proton/grpc/go/raystack/raccoon/v1beta1/raccoonv1beta1grpc"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
Expand Down Expand Up @@ -60,7 +61,7 @@ func (gc *Grpc) Send(events []*raccoon.Event) (string, *raccoon.Response, error)
})
}

svc := pb.NewEventServiceClient(gc.client)
svc := rpc.NewEventServiceClient(gc.client)
meta := metadata.New(gc.headers)
racReq := &pb.SendEventRequest{
ReqGuid: reqId,
Expand Down
7 changes: 4 additions & 3 deletions clients/go/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
"testing"
"time"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
rpc "buf.build/gen/go/raystack/proton/grpc/go/raystack/raccoon/v1beta1/raccoonv1beta1grpc"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
Expand All @@ -24,7 +25,7 @@ import (
const connId string = "X-UniqueId"

type mockEventServiceServer struct {
pb.UnimplementedEventServiceServer
rpc.UnimplementedEventServiceServer
}

func (*mockEventServiceServer) SendEvent(ctx context.Context, req *pb.SendEventRequest) (*pb.SendEventResponse, error) {
Expand Down Expand Up @@ -52,7 +53,7 @@ func (*mockEventServiceServer) SendEvent(ctx context.Context, req *pb.SendEventR
func dialer() func(context.Context, string) (net.Conn, error) {
listener := bufconn.Listen(1024 * 1024)
server := grpc.NewServer()
pb.RegisterEventServiceServer(server, &mockEventServiceServer{})
rpc.RegisterEventServiceServer(server, &mockEventServiceServer{})
go func() {
if err := server.Serve(listener); err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion clients/go/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"net/http"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/gojek/heimdall/v7/httpclient"
Expand Down
2 changes: 1 addition & 1 deletion clients/go/rest/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"
"net/http/httptest"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"

raccoon "github.com/raystack/raccoon/clients/go"
"github.com/raystack/raccoon/clients/go/serializer"
Expand Down
2 changes: 1 addition & 1 deletion clients/go/serializer/serializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"encoding/json"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"
"google.golang.org/protobuf/proto"

"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion clients/go/wire/wire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wire
import (
"testing"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"

"github.com/stretchr/testify/assert"
)
Expand Down
20 changes: 19 additions & 1 deletion clients/go/ws/option_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
package ws

import (
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"testing"

"github.com/stretchr/testify/assert"
)

func noopHandler(w http.ResponseWriter, r *http.Request) {
c, err := upgrader.Upgrade(w, r, nil)
if err != nil {
panic(err)
}
c.Close()
}

func TestWebSocketOptionsSet(t *testing.T) {
assert := assert.New(t)

url := "ws://localhost:8080/api/v1/events"
srv := httptest.NewServer(http.HandlerFunc(noopHandler))
defer srv.Close()

u, err := url.Parse(srv.URL)
assert.NoError(err)

url := fmt.Sprintf("ws://%s/api/v1/events", u.Host)
key := "authorization"
val := "123"

Expand Down
2 changes: 1 addition & 1 deletion clients/go/ws/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"net/http"

pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"
raccoon "github.com/raystack/raccoon/clients/go"
pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/google/uuid"
Expand Down
2 changes: 1 addition & 1 deletion clients/go/ws/ws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"net/http/httptest"

pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
pb "buf.build/gen/go/raystack/proton/protocolbuffers/go/raystack/raccoon/v1beta1"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"

Expand Down
Loading

0 comments on commit 3e5bc0a

Please sign in to comment.