chezmoi net
1.0.0
이는 웹 소켓을 통한 양방향 JsonRPC2 구현입니다. 가장 기본적인 예는 chatclient 패키지에 제공됩니다. 다음을 통해 예제를 실행할 수 있습니다.
go run cmd/server/server.go
go run cmd/client/client.go
go run cmd/client/client.go -join
// Use the client package register service functions
client.RegisterService(chatClient, chatClient.Client, chatClient.target)
// use client instance to get rpcClient
rpcClient := chatClient.Client.GetRpcClientForService(*chatClient)
sname := chatClient.Client.GetServiceName(*chatClient)
if rpcClient != nil {
var reply string
rpcClient.Call(sname+".OnMessage", Message{Source: *chatClient.Client.Id, Message: message}, &reply)
}
https://github.com/nmorenor/chezmoi
https://nmorenor.com