func main() {
	var (
		repository = storage.NewInMemory()
		portServer = service.NewPortServer(repository)
	)

	listener, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
	if err != nil {
		log.Fatalf("cannot start the server: %s", err)
	}

	grpcServer := grpc.NewServer()

	proto.RegisterStorageServer(grpcServer, portServer)

	log.Printf("starting GRPC server on %s", listener.Addr().String())
	if err := grpcServer.Serve(listener); err != nil {
		log.Fatalf("failed to start the server: %s", err)
	}
}
// TODO:
// - TLS
// - server side interceptors
// - reflection API
// - graceful shutdown
- TLS
- server side interceptors
- reflection API
- graceful shutdown
// TODO : // - TLS // - server side interceptors // - reflection API // - graceful shutdown
func main() {
	var (
		repository = storage.NewInMemory()
		portServer = service.NewPortServer(repository)
	)
	listener, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
	if err != nil {
		log.Fatalf("cannot start the server: %s", err)
	}
	grpcServer := grpc.NewServer()
	proto.RegisterStorageServer(grpcServer, portServer)
	log.Printf("starting GRPC server on %s", listener.Addr().String())
	if err := grpcServer.Serve(listener); err != nil {
		log.Fatalf("failed to start the server: %s", err)
	}
}
func main ( ) { var ( repository = storage . NewInMemory ( ) portServer = service . NewPortServer ( repository ) ) listener , err := net . Listen ( " " , fmt . Sprintf ( " " , port ) ) if err != nil { log . Fatalf ( " " , err ) } grpcServer := grpc . NewServer ( ) proto . RegisterStorageServer ( grpcServer , portServer ) log . Printf ( " " , listener . Addr ( ) . String ( ) ) if err := grpcServer . Serve ( listener ) ; err != nil { log . Fatalf ( " " , err ) } }
TLS
 server side interceptors
 reflection API
 graceful shutdown
TLS server side interceptors reflection API graceful shutdown