Documentation ¶
Index ¶
- Variables
- type APIObject
- type Cache
- func (c *Cache) BatchUpdateObjects(objects []*APIObject) error
- func (c *Cache) Close() error
- func (c *Cache) DeleteObject(id string) error
- func (c *Cache) GetObject(id string) (object *APIObject, err error)
- func (c *Cache) GetObjectByParentAndName(parent, name string) (object *APIObject, err error)
- func (c *Cache) GetObjectsByParent(parent string) ([]*APIObject, error)
- func (c *Cache) GetStartPageToken() (string, error)
- func (c *Cache) LoadToken() (*oauth2.Token, error)
- func (c *Cache) StoreStartPageToken(token string) error
- func (c *Cache) StoreToken(token *oauth2.Token) error
- func (c *Cache) UpdateObject(object *APIObject) error
- type Client
- func (d *Client) GetNativeClient() *http.Client
- func (d *Client) GetObject(id string) (*APIObject, error)
- func (d *Client) GetObjectByParentAndName(parent, name string) (*APIObject, error)
- func (d *Client) GetObjectsByParent(parent string) ([]*APIObject, error)
- func (d *Client) GetRoot() (*APIObject, error)
- func (d *Client) Mkdir(parent string, Name string) (*APIObject, error)
- func (d *Client) Remove(object *APIObject, parent string) error
- func (d *Client) Rename(object *APIObject, OldParent string, NewParent string, NewName string) error
- type PageToken
Constants ¶
This section is empty.
Variables ¶
var Fields string
Fields are the fields that should be returned by the Google Drive API
Functions ¶
This section is empty.
Types ¶
type APIObject ¶
type APIObject struct { ObjectID string Name string IsDir bool Size uint64 LastModified time.Time DownloadURL string Parents []string CanTrash bool }
APIObject is a Google Drive file object
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is the cache
func (*Cache) BatchUpdateObjects ¶
func (*Cache) DeleteObject ¶
DeleteObject deletes an object by id
func (*Cache) GetObjectByParentAndName ¶
GetObjectByParentAndName finds a child element by name and its parent id
func (*Cache) GetObjectsByParent ¶
GetObjectsByParent get all objects under parent id
func (*Cache) GetStartPageToken ¶
GetStartPageToken gets the start page token
func (*Cache) StoreStartPageToken ¶
StoreStartPageToken stores the page token for changes
func (*Cache) StoreToken ¶
StoreToken stores a token in the cache or updates the existing token element
func (*Cache) UpdateObject ¶
UpdateObject updates an object
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the Google Drive API connection(s)
func NewClient ¶
func NewClient(config *config.Config, cache *Cache, refreshInterval time.Duration, rootNodeID string, driveID string) (*Client, error)
NewClient creates a new Google Drive client
func (*Client) GetNativeClient ¶
GetNativeClient gets a native http client
func (*Client) GetObjectByParentAndName ¶
GetObjectByParentAndName finds a child element by name and its parent id
func (*Client) GetObjectsByParent ¶
GetObjectsByParent get all objects under parent id