This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package example.foo; | |
service Example1 { | |
rpc Ping(Ping) returns (Pong) {} | |
} | |
message Ping { | |
string content = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Groa = require('groa'); | |
const app = new Groa(); | |
// Add proto file | |
app.addProto(__dirname + '/example1.proto'); | |
// Add middleware | |
app.use(async (ctx, next) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client } = require('groa'); | |
const main = async () => { | |
let client = new Client('0.0.0.0', 50051); | |
// Load definition file | |
await client.loadProto(__dirname + '/example1.proto'); | |
// Get specific service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package example.foo; | |
service Example1 { | |
rpc Ping(Echo) returns (Echo) {} | |
rpc Echo(Echo) returns (Echo) {} | |
rpc Hello(Hello) returns (Hello) {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Groa = require('groa'); | |
const Router = require('groa-router'); | |
const app = new Groa(); | |
const router = new Router(); | |
// Add proto file | |
app.addProto(__dirname + '/router.proto'); | |
// package: example.foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Connect() error { | |
var nc *nats.Conn | |
// Connect to NATS | |
nc, err := nats.Connect(eb.host, | |
nats.PingInterval(10*time.Second), | |
nats.MaxPingsOutstanding(3), | |
nats.MaxReconnects(-1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mergeUpdates(data) { | |
let output = {}; | |
Object.entries(data).forEach(function(entry) { | |
let key = entry[0]; | |
let value = entry[1]; | |
if (key.startsWith(fieldName + '.')) { | |
let column = key.split('.')[1]; | |
output[column] = value; | |
return |
OlderNewer