https://github.com/kachit/gocent-grpc
Centrifugo gRPC golang sdk
https://github.com/kachit/gocent-grpc
centrifugo go golang grpc protobuf
Last synced: about 1 month ago
JSON representation
Centrifugo gRPC golang sdk
- Host: GitHub
- URL: https://github.com/kachit/gocent-grpc
- Owner: Kachit
- License: mit
- Created: 2025-10-25T15:27:33.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-25T16:11:01.000Z (8 months ago)
- Last Synced: 2025-10-25T17:28:38.587Z (8 months ago)
- Topics: centrifugo, go, golang, grpc, protobuf
- Language: Go
- Homepage:
- Size: 133 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Centrifugo gRPC golang sdk
[](https://github.com/Kachit/gocent-grpc/actions)
[](https://goreportcard.com/report/github.com/kachit/gocent-grpc)
[](https://go.dev/doc/go1.24)
[](https://github.com/Kachit/gocent-grpc/releases)
[](https://pkg.go.dev/github.com/kachit/gocent-grpc)
[](https://github.com/Kachit/gocent-grpc/blob/master/LICENSE)
## Install
```shell
go get -u github.com/kachit/gocent-grpc
```
## Usage (Client)
```go
package main
import (
"context"
"fmt"
"log"
"github.com/kachit/gocent-grpc/auth"
pb "github.com/kachit/gocent-grpc/pkg"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
func main() {
conn, err := grpc.NewClient(
"127.0.0.1:10000",
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithPerRPCCredentials(auth.KeyAuth{Key: "qwerty"}),
)
if err != nil {
log.Fatalln(err)
}
defer conn.Close()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
req := &pb.PresenceRequest{Channel: "channel-name"}
//
client := pb.NewCentrifugoApiClient(conn)
result, err := client.Presence(ctx, req)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}
```
## Proto
https://raw.githubusercontent.com/centrifugal/centrifugo/master/internal/apiproto/api.proto
## ProtoGen Golang
```shell
protoc --go_out=pkg --proto_path=proto --go-grpc_out=pkg --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative proto/*.proto
```
## Linters ##
```bash
golangci-lint run
```