github.com/gofunct/common@v0.0.0-20190131174352-fd058c7fbf22/pkg/transport/api/server.go (about) 1 package api 2 3 import ( 4 "context" 5 "net" 6 7 "github.com/grpc-ecosystem/grpc-gateway/runtime" 8 "google.golang.org/grpc" 9 ) 10 11 // Server is an interface for representing gRPC server implementations. 12 type Server interface { 13 RegisterWithServer(*grpc.Server) 14 RegisterWithHandler(context.Context, *runtime.ServeMux, *grpc.ClientConn) error 15 } 16 17 type Interface interface { 18 Serve(l net.Listener) error 19 Shutdown() 20 }