google

package
v0.0.0-...-a894b33 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeHeader

func SanitizeHeader(header string) string

* Provide a simple function to remove white space and to lower case before comparing

Types

type ByDate

type ByDate []Item

ByAge implements sort.Interface for []Person based on the Age field.

func (ByDate) Len

func (a ByDate) Len() int

func (ByDate) Less

func (a ByDate) Less(i, j int) bool

func (ByDate) Swap

func (a ByDate) Swap(i, j int)

type Directory

type Directory struct {
	File

	//Keep the type for directory anyways
	Type string `json:"type"`

	//Hold a list of items
	Items []Item `json:"items"`

	//Keep the parent id, unless this is root and then it is null
	ParentId string `json:"parentid"`
}

Hold the struct need to create a tree

func (*Directory) MarchDownTree

func (dir *Directory) MarchDownTree(doOnFolder bool, do ItemFunc)

Hold the struct need to create a tree

func (Directory) MarshalJSON

func (dir Directory) MarshalJSON() ([]byte, error)

* Custom marashaler

func (*Directory) UnmarshalJSON

func (dir *Directory) UnmarshalJSON(b []byte) error

type Document

type Document struct {
	File

	Type string `json:"type"`

	//Keep the Preview
	Preview string `json:"preview"`

	//Thumbnail Image
	ThumbnailUrl string `json:"thumbnail"`

	//Also Keep the parent id
	ParentId string `json:"parentid"`
}

Hold the structs need to create a tree

func (Document) MarshalJSON

func (dir Document) MarshalJSON() ([]byte, error)

type Drive

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

func NewDrive

func NewDrive(configFiles ...string) *Drive

Get a new interface

func (*Drive) BuildFileHierarchy

func (gog *Drive) BuildFileHierarchy(dirId string, buildPreview bool, includeFilter func(fileType string) bool) *Directory

* Recursive call to build the file list

func (*Drive) BuildFormHierarchy

func (gog *Drive) BuildFormHierarchy(dirId string) *Directory

* Builds all of the forms and downloads them at the same time

func (*Drive) GetArbitraryFile

func (gog *Drive) GetArbitraryFile(id string) (io.ReadCloser, error)

* * Method to get the file html

func (*Drive) GetFileAsInterface

func (gog *Drive) GetFileAsInterface(id string, inter interface{}) error

* * Method to get the file html

func (*Drive) GetFileHtml

func (gog *Drive) GetFileHtml(id string) string

* * Method to get the file html

func (*Drive) GetFilePreview

func (gog *Drive) GetFilePreview(id string) string

* * Method to get the information hierarchy

func (*Drive) GetFileThumbnailUrl

func (gog *Drive) GetFileThumbnailUrl(id string) string

* * Method to get the information hierarchy

func (*Drive) GetFirstFileMatching

func (gog *Drive) GetFirstFileMatching(dirId string, name string) (io.ReadCloser, error)

*

Gets the files matching the search in the dir

func (*Drive) GetMostRecentFileInDir

func (gog *Drive) GetMostRecentFileInDir(dirId string) (io.ReadCloser, error)

* * Method to get the file html

func (*Drive) PostArbitraryFile

func (gog *Drive) PostArbitraryFile(fileName string, parent string, file io.Reader, mime string) (string, error)

* * Method to upload a file

type Event

type Event struct {
	File

	//Keep a boolean if it is a file
	InfoId string `json:"infoId"`

	//Keep a boolean if it is a file
	SignupId string `json:"signupId"`

	//Keep the parent id, unless this is root and then it is null
	ParentId string `json:"parentid"`
}

Hold the struct need to create a tree

func (Event) MarshalJSON

func (dir Event) MarshalJSON() ([]byte, error)

type File

type File struct {
	//Keep a boolean if it is a file
	Id string `json:"id"`

	//Hold the item
	Name string `json:"name"`

	//Hold if we should hide the item
	HideListing bool `json:"hideListing"`

	//Keep a date if useful
	Date *time.Time `json:"date"`
}

Hold a base type document

func (File) GetDate

func (file File) GetDate() *time.Time

func (File) GetId

func (file File) GetId() string

Hold a base type document

func (File) GetName

func (file File) GetName() string

type Form

type Form struct {
	File
	//Keep the type for directory anyways
	Type string `json:"type"`

	//Keep the parent id, unless this is root and then it is null
	ParentId string `json:"parentid"`

	//Hold the item
	Metadata FormMetaData `json:"metadata"`

	//Hold a list of items
	JSONSchema map[string]interface{} `json:"JSONSchema"`

	//Keep the parent id, unless this is root and then it is null
	UISchema map[string]interface{} `json:"UISchema"`
}

Hold the struct need to create a tree

func (Form) MarshalJSON

func (dir Form) MarshalJSON() ([]byte, error)

type FormDriveInfo

type FormDriveInfo struct {
	SheetId   string `json:"sheetId"`
	SheetName string `json:"sheetName"`
}

Store the forms metadata

type FormMetaData

type FormMetaData struct {
	Title string `json:"title"`

	EmailTo []string `json:"emailTo"`

	EmailTemplate string `json:"emailTemplate"`

	EmailSubjectField string `json:"emailSubjectField"`

	DriveInfo []FormDriveInfo `json:"driveInfo"`

	RequiredPerm []string `json:"requiredPerm"`
}

Store the forms metadata

type Item

type Item interface {
	GetId() string
	GetName() string
	GetDate() *time.Time
}

*

  • An interface type to hold a document or directory

type ItemFunc

type ItemFunc func(item Item)

Define a function

type SheetData

type SheetData struct {

	//Store the values in the row
	Values [][]interface{} //[row][col]

	//Store the Headers
	Headers []string

	//Store a list of original row numbers
	RowNumb []int
	// contains filtered or unexported fields
}

* Used to store a row of data

func NewSheetData

func NewSheetData(values [][]interface{}) (*SheetData, error)

Create a new sheet data

func (*SheetData) CountEntries

func (sheet *SheetData) CountEntries(index int) int

* Count the number of entries for this column

func (*SheetData) FilterSheet

func (sheet *SheetData) FilterSheet(header string, value string) *SheetData

Create a new sheet data

func (*SheetData) GetColumn

func (sheet *SheetData) GetColumn(col int) []interface{}

Create a new sheet data

func (*SheetData) GetEmptyDataRow

func (sheet *SheetData) GetEmptyDataRow() *SheetDataRow

Create a new sheet data

func (*SheetData) GetRow

func (sheet *SheetData) GetRow(row int) *SheetDataRow

Create a new sheet data

func (*SheetData) NumberRows

func (sheet *SheetData) NumberRows() int

Create a new sheet data

func (*SheetData) PrintToScreen

func (sheet *SheetData) PrintToScreen()

Create a new sheet data

type SheetDataRow

type SheetDataRow struct {

	//Store the values in the row
	Values []interface{}

	//Store the Headers
	Headers []string

	//Store the row number, -1 if new
	RowNumber int
	// contains filtered or unexported fields
}

* Used to store a row of data

func (*SheetDataRow) EraseData

func (row *SheetDataRow) EraseData()

* Store the empty data in the row

func (*SheetDataRow) GetValue

func (row *SheetDataRow) GetValue(s string) interface{}

*

  • Looks up the value

func (*SheetDataRow) GetValueAsString

func (row *SheetDataRow) GetValueAsString(s string) string

*

  • Looks up the value

func (*SheetDataRow) SetValue

func (row *SheetDataRow) SetValue(s string, v string)

*

  • Looks up the value and sets it

func (*SheetDataRow) StoreDataInRow

func (row *SheetDataRow) StoreDataInRow(data interface{}) error

* Store the empty data in the row

type Sheets

type Sheets struct {

	//Store the connection to google.  This has been wrapped with the correct Headers
	Connection *sheets.Service
}

func NewSheets

func NewSheets(configFiles ...string) *Sheets

Get a new interface

func (*Sheets) AppendToSheet

func (sheetsCon *Sheets) AppendToSheet(sheetId string, sheetName string, data interface{}) error

* Simple method to append all of the data to the sheet

func (*Sheets) AppendToSheetIdAndName

func (sheetsCon *Sheets) AppendToSheetIdAndName(sheetIdAndName string, data interface{}) error

* Append to the sheet with the name and id split with a /

func (*Sheets) GetEmptyDataRow

func (sheetsCon *Sheets) GetEmptyDataRow(sheetId string, sheetName string) (*SheetDataRow, error)

Get an empty data row

func (*Sheets) GetSheetData

func (sheetsCon *Sheets) GetSheetData(sheetId string, sheetName string) (*SheetData, error)

Get an empty data row

func (*Sheets) SyncHeaders

func (sheetsCon *Sheets) SyncHeaders(sheetId string, sheetName string, headers []string) error

* Simple method to sync the headers

func (*Sheets) UploadRow

func (sheetsCon *Sheets) UploadRow(sheetId string, sheetName string, row *SheetDataRow) error

* Upload the row to the server

Jump to

Keyboard shortcuts

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