googledrive

package
v0.0.2-0...-de76ab9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleDrive

type GoogleDrive struct {
	// contains filtered or unexported fields
}

GoogleDrive holds the configuration for the Google Drive SDK

func NewGoogleDrive

func NewGoogleDrive(filepath string) (*GoogleDrive, error)

NewGoogleDrive reads the information from the supplied secret file and parses it into the config of a new googledrive object. It returns the newly created object.

func (*GoogleDrive) Add

func (d *GoogleDrive) Add(code, filepath string, content io.ReadCloser) error

Add inserts a new file on Google Drive

func (*GoogleDrive) AuthURL

func (d *GoogleDrive) AuthURL() string

AuthURL returns a URL to the Google OAuth2 login page

func (*GoogleDrive) Browse

func (d *GoogleDrive) Browse(code, filepath string) ([]string, error)

Browse return the content of a directory as a list

func (*GoogleDrive) Publish

func (d *GoogleDrive) Publish(code, filepath string) (string, error)

Publish sets a file to public and returns its public url

func (*GoogleDrive) Read

func (d *GoogleDrive) Read(code, filepath string) (*http.Response, error)

Read returns the content of a file

func (*GoogleDrive) Remove

func (d *GoogleDrive) Remove(code, filepath string) error

Remove deletes a file from Google Drive

func (*GoogleDrive) Validate

func (d *GoogleDrive) Validate(code string) (string, time.Time, error)

Validate validates an access code against the oauth2.config object. It then returns the real token togehter with an expiry date.

Jump to

Keyboard shortcuts

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