package credentials import "golang.org/x/net/context" type TokenCredential struct { Token string } func (cred *TokenCredential) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { return map[string]string{ "token": cred.Token, }, nil } func (cred *TokenCredential) RequireTransportSecurity() bool { return false }