repositorypackage
0.0.0-20220325162120-a87e9754f752
Repository: https://github.com/go-roc/roc.git
Documentation: pkg.go.dev
# README
Roc
👋 Roc is a rpc micro framework,it designed with go,and transport protocol by rsocket-go.
IT IS UNDER ACTIVE DEVELOPMENT, APIs are unstable and maybe change at any time until release of v1.0.0.
👀 Features
- Simple to use ✨
- Lightweight ✨
- High performance ✨
- Service discovery ✨
- Support websocket and socket same time ✨
- Support json or gogo proto when use rpc ✨
🌱 Quick start
GO111MODULE=on go get github.com/go-roc/roc/cmd/protoc-gen-roc
- generate proto file to go file,like hello.proto
protoc --roc_out = plugins = roc:.*.proto
- run a roc service
package main
import (
"tutorials/app/api/api.hello/say"
"tutorials/proto/phello"
"github.com/go-roc/roc"
)
func main() {
s := roc.New(
roc.HttpAddress("0.0.0.0:9999"),
roc.Namespace("api.hello"),
roc.TCPAddress("0.0.0.0:8888"),
roc.WssAddress("0.0.0.0:10000", "/hello"),
)
phello.RegisterHelloServer(s.Server(), &say.Say{})
_ = s.Run()
}
- config help
package main
import (
"fmt"
"github.com/go-roc/roc/config"
)
//put key/value to etcd:
//go:generate etcdctl put configroc/v1.0.0/public/roc.test "{ "name":"roc", "age":18 }"
func main() {
//new config use default option
config.NewConfig()
var result struct {
Name string `json:"name"`
Age int `json:"age"`
}
_ = config.DecodePublic("test", v)
}
💞️ see more example for more help.
📫 How to reach me and be a contributor ...
✨ TODO ✨
- broadcast
- topic publish/subscript
- sidecar
- more example
- more singleton tests
- generate dir
- command for request service
- sidecar service
- config service
- broker redirect request service
- logger service
- simple service GUI