Documentation ¶
Index ¶
- type GoogleDrive
- func (d *GoogleDrive) Add(code, filepath string, content io.ReadCloser) error
- func (d *GoogleDrive) AuthURL() string
- func (d *GoogleDrive) Browse(code, filepath string) ([]string, error)
- func (d *GoogleDrive) Publish(code, filepath string) (string, error)
- func (d *GoogleDrive) Read(code, filepath string) (*http.Response, error)
- func (d *GoogleDrive) Remove(code, filepath string) error
- func (d *GoogleDrive) Validate(code string) (string, time.Time, error)
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
Click to show internal directories.
Click to hide internal directories.