google

package
v0.0.0-...-75eb559 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Folder

type Folder struct {
	MinNextNum int
	// contains filtered or unexported fields
}

func NewFolder

func NewFolder(cbuf []byte, folderid string, docPattern *regexp.Regexp, minNextNum int) (gf *Folder, err error)

NewFolder returns an object that represents a single gdrive folder. We assume that the folder is accessible by the service account json credentials provided in cbuf.

func (*Folder) BatchStart

func (gf *Folder) BatchStart() (b *batch)

func (*Folder) Copy

func (gf *Folder) Copy(tnode *Node, newName string) (node *Node, err error)

func (*Folder) CreateAnyonePermission

func (gf *Folder) CreateAnyonePermission(role string) *drive.Permission

func (*Folder) CreateUserPermission

func (gf *Folder) CreateUserPermission(email string, role string) *drive.Permission

permissions example: https://github.com/kayac/alphawing/blob/52f67ecb99394dd263e7e33b8f73394e939f53aa/app/models/googleservice.go#L181

func (*Folder) DeletePermission

func (gf *Folder) DeletePermission(fileId string, permissionId string) error

func (*Folder) Doc2json

func (gf *Folder) Doc2json(node *Node) (buf []byte, err error)

func (*Folder) Doc2txt

func (gf *Folder) Doc2txt(node *Node) (txt string, err error)

func (*Folder) FindTextRun

func (gf *Folder) FindTextRun(node *Node, txt string) (el *docs.ParagraphElement, err error)

func (*Folder) GetHeaders

func (gf *Folder) GetHeaders(node *Node) (h map[string]string, err error)

func (*Folder) GetPermissionList

func (gf *Folder) GetPermissionList(fileId string) (*drive.PermissionList, error)

func (*Folder) InsertPermission

func (gf *Folder) InsertPermission(fileId string, permission *drive.Permission) (*drive.Permission, error)

func (*Folder) QueryNodes

func (gf *Folder) QueryNodes(query string) (nodes []*Node, err error)

func (*Folder) Rm

func (gf *Folder) Rm(rmnode *Node) (err error)

func (*Folder) UpdatePermission

func (gf *Folder) UpdatePermission(fileId string, permissionId string, permission *drive.Permission) (*drive.Permission, error)

type Node

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

func (*Node) Created

func (n *Node) Created() string

func (*Node) Id

func (n *Node) Id() string

func (*Node) MimeType

func (n *Node) MimeType() string

func (*Node) Name

func (n *Node) Name() string

func (*Node) Num

func (n *Node) Num() int

func (*Node) URL

func (n *Node) URL() string

Jump to

Keyboard shortcuts

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