For cloudsql in particular, you can connect via the `/cloudsql` Unix socket. But anything that needs raw socket access can now be used from App Engine.
See https://cloud.google.com/appengine/docs/standard/go111/using... and scroll way down to the sample code.