lb5tr | e5f8e8a | 2019-07-23 11:27:07 -0700 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "flag" |
| 6 | |
| 7 | "github.com/golang/glog" |
| 8 | "google.golang.org/grpc/codes" |
| 9 | "google.golang.org/grpc/status" |
| 10 | |
| 11 | pb "code.hackerspace.pl/hscloud/bgpwtf/cccampix/proto" |
| 12 | "code.hackerspace.pl/hscloud/go/mirko" |
| 13 | ) |
| 14 | |
| 15 | type service struct { |
| 16 | } |
| 17 | |
| 18 | func (s *service) KeyInfo(ctx context.Context, req *pb.KeyInfoRequest) (*pb.KeyInfoResponse, error) { |
| 19 | return nil, status.Error(codes.Unimplemented, "not implemented yet") |
| 20 | } |
| 21 | |
| 22 | func (s *service) Encrypt(stream pb.PGPEncryptor_EncryptServer) error { |
| 23 | return status.Error(codes.Unimplemented, "not implemented yet") |
| 24 | } |
| 25 | |
| 26 | func main() { |
| 27 | flag.Parse() |
| 28 | mi := mirko.New() |
| 29 | |
| 30 | if err := mi.Listen(); err != nil { |
| 31 | glog.Exitf("Listen failed: %v", err) |
| 32 | } |
| 33 | |
| 34 | s := &service{} |
| 35 | pb.RegisterPGPEncryptorServer(mi.GRPC(), s) |
| 36 | |
| 37 | if err := mi.Serve(); err != nil { |
| 38 | glog.Exitf("Serve failed: %v", err) |
| 39 | } |
| 40 | |
| 41 | <-mi.Done() |
| 42 | } |