Documentation ¶
Index ¶
- Constants
- func NewCredentialsManager(path string) *credentialsManager
- type Client
- func (c *Client) HasCreds() bool
- func (c *Client) ListFiles(ctx context.Context, q string, pageToken string) (*drive.FileList, error)
- func (c *Client) OauthHandler() func(w http.ResponseWriter, r *http.Request)
- func (c *Client) OauthRedirect(w http.ResponseWriter, r *http.Request)
- func (c *Client) Service(ctx context.Context) (*drive.Service, error)
- type ClientOption
- type Config
Constants ¶
View Source
const (
MimeTypeFolder = "application/vnd.google-apps.folder"
)
Variables ¶
This section is empty.
Functions ¶
func NewCredentialsManager ¶
func NewCredentialsManager(path string) *credentialsManager
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientFromFile ¶
func NewClientFromReader ¶
func (*Client) OauthHandler ¶
func (c *Client) OauthHandler() func(w http.ResponseWriter, r *http.Request)
TODO: use / validate state token
func (*Client) OauthRedirect ¶
func (c *Client) OauthRedirect(w http.ResponseWriter, r *http.Request)
type ClientOption ¶
type ClientOption func(*Client)
func CustomHTTPClientOption ¶
func CustomHTTPClientOption(httpClient *http.Client) ClientOption
type Config ¶
type Config struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectURIs []string `json:"redirect_uris"` AuthURI string `json:"auth_uri"` TokenURI string `json:"token_uri"` }
Config is a google-defined client_credentials.json format. Duplicated from golang.org/x/oauth2/google since it is not exported.
Click to show internal directories.
Click to hide internal directories.