Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RefreshJob ¶
type RefreshJob struct {
// contains filtered or unexported fields
}
RefreshJob is a set of RefreshTasks
func FromConfig ¶
func FromConfig(config []byte) (*RefreshJob, error)
FromConfig instantiates Job from config
type RefreshTask ¶
type RefreshTask struct { Source *SourceFile `yaml:"source"` // Source file info (defined below) Target *TargetSpreadsheet `yaml:"target"` // Target sheet info (defined below) }
RefreshTask contains all information needed to refresh the Google Spreadsheet from an external file
func NewTask ¶
func NewTask(source *SourceFile, target *TargetSpreadsheet) *RefreshTask
NewTask creates the task
type SourceFile ¶
type SourceFile struct { // Location specifies the file location // Valid values: // // https://www.example.com/dataset.xlsx // file://MyWorkbook.xlsx -- not implemented yet! FileLocation string `yaml:"location"` // SheetAddress is the address within the source workbook. // I.e. "Data!A1:U" SheetAddressRange []string `yaml:"address_range"` // contains filtered or unexported fields }
SourceFile contains the information about the source file and address + range of cells to copy
func (*SourceFile) Delete ¶
func (sf *SourceFile) Delete(client *http.Client) error
Delete deletes the temporary file from the google drive
func (*SourceFile) FetchAndUpload ¶
func (sf *SourceFile) FetchAndUpload(client *http.Client) (string, error)
FetchAndUpload downloads the file from source and uploads it to Google Drive
type TargetSpreadsheet ¶
type TargetSpreadsheet struct { // SpreadsheetID is the Google Spreadsheet ID // i.e. 1lqbZm_TCsqcOTvOHPjG2CvZ6PpmDtBg_6qe-J1I91sk SpreadsheetID string `yaml:"spreadsheet_id"` // TargetSheet specifies the start location within the target // Google Sheet for all corresponding SheetAddressRange that // are defined on the source. Example: [ Sheet2!B4, Sheet3!A1 ] SheetAddress []string `yaml:"address"` // Clear specifies if the process should delete all data from the // Target Sheet before updating Clear bool `yaml:"clear,omitempty"` Create bool `yaml:"create,omitempty"` }
TargetSpreadsheet bears the information about the target spreadsheet and address within it
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
examples
|
|
drive
Google Drive upload example combined from mixed sources (Stack Overflow + Google API doc)
|
Google Drive upload example combined from mixed sources (Stack Overflow + Google API doc) |
sheets
Go Quickstart for Google Sheets API v4 https://developers.google.com/sheets/api/quickstart/go
|
Go Quickstart for Google Sheets API v4 https://developers.google.com/sheets/api/quickstart/go |
Click to show internal directories.
Click to hide internal directories.