bgpwtf/cccampix/pgpencryptor: add service base

Add emacs swap files to .gitignore.

Change-Id: I5e0e3e31a0a0cd6d73e6c89a82b73412f0f78a15
This commit is contained in:
lb5tr 2019-07-23 11:27:07 -07:00
parent 0e223ec77f
commit e5f8e8ae0c
4 changed files with 75 additions and 0 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
*swp
/bazel-*
.kubectl
*~
\#*

View file

@ -0,0 +1,21 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor",
visibility = ["//visibility:private"],
deps = [
"//bgpwtf/cccampix/proto:go_default_library",
"//go/mirko:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)
go_binary(
name = "pgpencryptor",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,10 @@
PGPEncryptor service
==============
Exposes and caches pgp keys from public key servers.
API defined in [ix.proto](../proto/ix.proto).
Usage
-----

View file

@ -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()
}