Documentation ¶
Index ¶
- func CreateDocument(email, title string) (file *drive.File, err error)
- func CreateTemplate(email, template, title string) (file *drive.File, err error)
- func LastModifiedDate(fileID string) (string, error)
- func SetPermission(fileID, email, perm string) (err error)
- type Document
- func AddDocOwner(email, fileID string) (*Document, error)
- func AddUserDoc(id, title, url, email string) (*Document, error)
- func AddUserSign(email, fileID string) (*Document, error)
- func GetUserDoc(fileID string) (ud *Document, err error)
- func GetUserDocList(email string) ([]Document, error)
- func RemoveUserSign(email, fileID string) (*Document, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDocument ¶
CreateDocument creates a new document, with given title and gives writer role to email.
func CreateTemplate ¶
CreateTemplate creates a new document with contents of template document and gives writer role to email
func LastModifiedDate ¶
LastModifiedDate returns last modified date of drive file
func SetPermission ¶
SetPermission sets read or write permission to a user for a document
Types ¶
type Document ¶
type Document struct { DocID string `json:"doc_id" gorm:"type: TEXT; UNIQUE; PRIMARY_KEY; NOT NULL"` DocTitle string `json:"doc_title" gorm:"type: TEXT; NOT NULL"` DocURL string `json:"doc_url" gorm:"type: TEXT; NOT NULL"` Owner1 string `json:"owner1" gorm:"type: TEXT"` Owner2 string `json:"owner2" gorm:"type: TEXT"` Signed1 int `json:"signed1" gorm:"type: INTEGER"` Signed2 int `json:"signed2" gorm:"type: INTEGER"` DateSigned1 string `json:"date_signed1" gorm:"type: TEXT"` DateSigned2 string `json:"date_signed2" gorm:"type: TEXT"` }
Document struct represents a document of google drive, with it's owners and permissions
func AddDocOwner ¶
AddDocOwner adds the user 'email' as the owner of doc 'fileID' to DB
func AddUserDoc ¶
AddUserDoc adds a document in a DB
func AddUserSign ¶
AddUserSign sets the sign field of a second user document in DB to either true or false
func GetUserDoc ¶
GetUserDoc returns a UserDoc structure with a document info from DB
func GetUserDocList ¶
GetUserDocList returns a slice of documents that belong to user
func RemoveUserSign ¶
RemoveUserSign removes signed and signed date fields of a document from DB