Skip to content

Instantly share code, notes, and snippets.

View amsokol's full-sized avatar

Aleksandr Sokolovskii amsokol

View GitHub Profile
package rest
import (
"context"
"net/http"
"os"
"os/signal"
"time"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
syntax = "proto3";
package main;
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
message Data {
bool boolValue = 1;
package main
import (
"context"
"log"
"time"
"github.com/mongodb/mongo-go-driver/bson"
"github.com/mongodb/mongo-go-driver/mongo"
package main
import (
"context"
"log"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/wrappers"
TopologyOptions: []topology.Option{
topology.WithServerOptions(func(opts ...topology.ServerOption) []topology.ServerOption {
return []topology.ServerOption{
topology.WithRegistry(func(r *bsoncodec.Registry) *bsoncodec.Registry {
return reg
}),
}
}),
},
syntax = "proto3";
package main;
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "protoc-gen-gotag/tagger/tagger.proto";
message Data {
bool boolValue = 1;
@amsokol
amsokol / flutter-grpc-tutorial.go-server.pkg.service.v1.chat.go
Last active January 13, 2019 10:03
flutter-grpc-tutorial.go-server.pkg.service.v1.chat.go
package v1
import (
"context"
"fmt"
"log"
"github.com/golang/protobuf/ptypes/empty"
"github.com/golang/protobuf/ptypes/wrappers"
@amsokol
amsokol / flutter-grpc-tutorial.go-server.pkg.protocol.grpc.server.go
Created January 13, 2019 10:02
flutter-grpc-tutorial.go-server.pkg.protocol.grpc.server.go
package grpc
import (
"context"
"log"
"net"
"google.golang.org/grpc"
"github.com/amsokol/flutter-grpc-tutorial/go-server/pkg/api/v1"
@amsokol
amsokol / flutter-grpc-tutorial.go-server.cmd.server.main.go
Created January 13, 2019 10:08
flutter-grpc-tutorial.go-server.cmd.server.main.go
package main
import (
"context"
"fmt"
"os"
"github.com/amsokol/flutter-grpc-tutorial/go-server/pkg/protocol/grpc"
"github.com/amsokol/flutter-grpc-tutorial/go-server/pkg/service/v1"
)
@amsokol
amsokol / flutter-grpc-tutorial.flutter_client.lib.main.dart
Created January 13, 2019 12:43
flutter-grpc-tutorial.flutter_client.lib.main.dart
import 'package:flutter/material.dart';
import 'app.dart';
/// main is entry point of Flutter application
void main() {
runApp(FriendlychatApp());
}