googlesheets

package
v0.0.0-...-31a5500 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MonthHeaderRow = 2

Variables

This section is empty.

Functions

func AddColumn

func AddColumn(sheetID int64, spreadsheetID string, srv *sheets.Service)

AddColumn inserts an additional column at the right of the existing columns of the Sheet

func ArchiveResultsForMonth

func ArchiveResultsForMonth(contactGroupName, period, spreadsheetID, nodePingToken string, countLimit int)

func ConvertColumnIndexToLetter

func ConvertColumnIndexToLetter(index int64) (string, error)

func EnsureCheckRowExists

func EnsureCheckRowExists(nodePingCheck, year string, sheetsData SheetsData) (int, error)

EnsureCheckRowExists looks for a match for the check name in the Sheet's A column (starting at row 3) If it finds a match or a blank cell, it returns that row number. Otherwise, it looks down the column until it finds an existing check name that comes after it in terms of alphabetical order. Once it finds such an existing check name, it inserts a row above the existing row and then inserts the new check name into the first cell of the inserted row.

func EnsureMonthColumnExists

func EnsureMonthColumnExists(month, year string, sheetsData SheetsData) (int, error)

func EnsureSheetExists

func EnsureSheetExists(sheetName string, sheetsData SheetsData) (int64, error)

func GetAuthConfig

func GetAuthConfig() *jwt.Config

func GetMonthPosition

func GetMonthPosition(monthLabel string) (int, error)

func GetRequiredEnvVar

func GetRequiredEnvVar(envName string) string

func GetSheetIDFromTitle

func GetSheetIDFromTitle(title string, sheetsData SheetsData) (bool, int64, error)

func InsertColumn

func InsertColumn(index, sheetID int64, spreadsheetID string, srv *sheets.Service) error

func InsertRow

func InsertRow(index, sheetID int64, spreadsheetID string, srv *sheets.Service) error

func InsertRowOrColumn

func InsertRowOrColumn(insertRowNotColumn bool, index, sheetID int64, spreadsheetID string, srv *sheets.Service) error

func WriteToCellWithColumnIndex

func WriteToCellWithColumnIndex(rowIndex, columnIndex int64, newValue, sheetName, spreadsheetID string, srv *sheets.Service) error

func WriteToCellWithColumnLetter

func WriteToCellWithColumnLetter(rowIndex int64, columnLetter, newValue, sheetName, spreadsheetID string, srv *sheets.Service) error

Types

type SheetsData

type SheetsData struct {
	SpreadsheetID string // The ID of the whole Google Sheets file
	SheetID       int64  // The index of the individual sheet
	Service       *sheets.Service
}

Jump to

Keyboard shortcuts

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