bgpwtf/cccampix/pgpencryptor: add service base
Add emacs swap files to .gitignore.
Change-Id: I5e0e3e31a0a0cd6d73e6c89a82b73412f0f78a15
diff --git a/bgpwtf/cccampix/pgpencryptor/main.go b/bgpwtf/cccampix/pgpencryptor/main.go
new file mode 100644
index 0000000..d8e410a
--- /dev/null
+++ b/bgpwtf/cccampix/pgpencryptor/main.go
@@ -0,0 +1,42 @@
+package main
+
+import (
+ "context"
+ "flag"
+
+ "github.com/golang/glog"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
+
+ pb "code.hackerspace.pl/hscloud/bgpwtf/cccampix/proto"
+ "code.hackerspace.pl/hscloud/go/mirko"
+)
+
+type service struct {
+}
+
+func (s *service) KeyInfo(ctx context.Context, req *pb.KeyInfoRequest) (*pb.KeyInfoResponse, error) {
+ return nil, status.Error(codes.Unimplemented, "not implemented yet")
+}
+
+func (s *service) Encrypt(stream pb.PGPEncryptor_EncryptServer) error {
+ return status.Error(codes.Unimplemented, "not implemented yet")
+}
+
+func main() {
+ flag.Parse()
+ mi := mirko.New()
+
+ if err := mi.Listen(); err != nil {
+ glog.Exitf("Listen failed: %v", err)
+ }
+
+ s := &service{}
+ pb.RegisterPGPEncryptorServer(mi.GRPC(), s)
+
+ if err := mi.Serve(); err != nil {
+ glog.Exitf("Serve failed: %v", err)
+ }
+
+ <-mi.Done()
+}