chezmoi net
1.0.0
Ini adalah implementasi JsonRPC2 dua arah melalui Web Socket. Contoh paling dasar disediakan di bawah paket klien obrolan. Anda dapat menjalankan contohnya dengan.
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