Documentation ¶
Index ¶
- func MarshalChange(change *drive.Change) (resource.Change, error)
- func MarshalDrive(d *drive.TeamDrive) (resource.Drive, error)
- func MarshalFile(file *drive.File) (resource.File, error)
- func MarshalPermission(perm *drive.Permission) (resource.Permission, error)
- type Collector
- func (c *Collector) ChangeToken(ctx context.Context) (startToken string, err error)
- func (c *Collector) Changes(ctx context.Context, token string, p []resource.Change) (n int, nextToken string, nextStartToken string, err error)
- func (c *Collector) Drive(ctx context.Context) (resource.Change, error)
- func (c *Collector) Files(ctx context.Context, token string, p []resource.Change) (n int, nextToken string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalChange ¶
MarshalChange marshals the given change as a resource.
func MarshalDrive ¶
MarshalDrive marshals the given team drive as a resource.
func MarshalFile ¶
MarshalFile marshals the given file as a resource.
func MarshalPermission ¶
func MarshalPermission(perm *drive.Permission) (resource.Permission, error)
MarshalPermission marshals the given permission as a resource.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
A Collector is responsible for collecting team drive file data from a drive service.
Collectors should be created by calling New.
func (*Collector) ChangeToken ¶
ChangeToken returns the starting token for a new stream of changes.
func (*Collector) Changes ¶
func (c *Collector) Changes(ctx context.Context, token string, p []resource.Change) (n int, nextToken string, nextStartToken string, err error)
Changes collects a set of changes into p, up to len(p), starting from the change identified by token.
If len(p) is zero it will panic.
The number of changes collected are returned in n.
If there more changes to be collected in the current set, nextToken will be non-empty. If there are no more changes in the current set then nextStartToken will hold the starting token for the next set.
func (*Collector) Drive ¶
Drive collects the current drive data, formatted in the same manner as a change.
func (*Collector) Files ¶
func (c *Collector) Files(ctx context.Context, token string, p []resource.Change) (n int, nextToken string, err error)
Files collects a set of files into p, starting from the file identified by token. It returns the number of files collected as n, and returns a non-empty nextToken if there are additional files in the list yet to be read.
If the provided token is empty it will start at the first file within the team drive.
If the length of p is zero Files will panic.