Created
October 20, 2016 07:03
-
-
Save ctaggart/9f9ab43171fbe8b02d6a9a39281f7bae to your computer and use it in GitHub Desktop.
AppEngine Auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctx := appengine.NewContext(request) | |
hc := &http.Client{ | |
Transport: &oauth2.Transport{ | |
Source: oauth2.StaticTokenSource(&oauth2.Token{AccessToken: githubToken}), | |
Base: &urlfetch.Transport{Context: ctx}, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func dialService(ctx context.Context, address string) (*grpc.ClientConn, error) { | |
dialer := func(addr string, timeout time.Duration) (net.Conn, error) { | |
return socket.DialTimeout(ctx, "tcp", addr, timeout) | |
} | |
return grpc.Dial(address, grpc.WithInsecure(), grpc.WithDialer(dialer)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment