Skip to content

Instantly share code, notes, and snippets.

@kyriediculous
Created May 8, 2019 11:51
import (
// other imports ...
blogpb "../proto"
// ...
)
type BlogServiceServer struct {}
func main() {
// STEP 1 & STEP 2
// ...
// Set options, here we can configure things like TLS support
opts := []grpc.ServerOption{}
// Create new gRPC server with (blank) options
s := grpc.NewServer(opts...)
// Create BlogService type
srv := &BlogServiceServer{}
// Register the service with the server
blogpb.RegisterBlogServiceServer(s, srv)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment