oauther

package module
v5.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 22 Imported by: 2

README

OAuther

Go Reference Go Report Card

This package includes functions and types that encapsulate common OAuth patterns when using Google data APIs and other similar systems.

Documentation

Overview

Package oauther encapsulates common OAuth patterns for Google data APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(ctx context.Context, filename string, creds []byte, scope ...string) (*http.Client, error)

Client obtains an oauth2-authorized HTTP client. Arguments are the same as for Token, and authorization works the same way.

func Token

func Token(ctx context.Context, filename string, creds []byte, scope ...string) (*oauth2.Token, error)

Token obtains an oauth2 token from the given filename. If the file does not exist, or the token is invalid (e.g. expired), Token first tries to refresh the token (if applicable) and falls back to doing "loopback auth" in the user's browser, storing the resulting token in the named file on success before returning it. Creds are the bytes of a JSON credentials file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址