Documentation ¶
Overview ¶
Package googledrive holds the implementation related to Drive interactions.
Index ¶
- Constants
- Variables
- type Client
- func (d *Client) CreateDir(name string, parentID string) (*drive.File, error)
- func (d *Client) CreateFile(name string, mimeType string, content io.Reader, parentID string) (*drive.File, error)
- func (d *Client) FileContent(fileID string) ([]byte, error)
- func (d *Client) Init() error
- func (d *Client) IsDirExists(dirName string) (bool, string, error)
- func (d *Client) IsFileExists(dirID string, fileName string) (bool, string, error)
- func (d *Client) UpdateFileContent(fileID string, content []byte) error
Constants ¶
View Source
const ( // FileMimeType represents the GDrive file mime type. FileMimeType = "mimeType = 'application/vnd.googledrive-apps.file'" // DirMimeType represents the GDrive directory mime type. DirMimeType = "mimeType = 'application/vnd.googledrive-apps.folder'" )
Variables ¶
View Source
var ( // ClientSecret is the client secret for the GDrive client and must be set from the LD flags. ClientSecret string // ClientID is the client ID for the GDrive client and must be set from the LD flags. ClientID string )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { TokenFile string // contains filtered or unexported fields }
Client represents the GDrive client.
func (*Client) CreateFile ¶
func (d *Client) CreateFile(name string, mimeType string, content io.Reader, parentID string) (*drive.File, error)
CreateFile method creates the given file.
func (*Client) FileContent ¶
FileContent method downloads the given file content.
func (*Client) IsDirExists ¶
IsDirExists method checks whether the given directory exists or not.
func (*Client) IsFileExists ¶
IsFileExists method checks whether the given file exists under the given directory or not.
Click to show internal directories.
Click to hide internal directories.