sheets

package module
v0.0.0-...-c3ab7e9 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 14 Imported by: 3

README

sheets

This project provides a wrapper around the Google Sheets API, simplifying the process of creating and adding formatting to a Google Sheet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToSheet

func AppendToSheet(ctx context.Context, srv *sheets.Service, spreadsheetID string, rowData map[string][]*sheets.RowData) (*sheets.Spreadsheet, error)

func CreateSheet

func CreateSheet(ctx context.Context, srv *sheets.Service, title string, rowData map[string][]*sheets.RowData) (*sheets.Spreadsheet, error)

func GetSpreadsheetID

func GetSpreadsheetID(url string) (string, error)

Return the Google Sheets spreadsheet ID for the given URL. If the URL is an invalid format, an error will be returned.

func GoogleSheetsService

func GoogleSheetsService(ctx context.Context, credentialsFile, tokenFile string) (*sheets.Service, error)

func PaleYellow

func PaleYellow() color.Color

func Write

func Write(_ context.Context, outputDir string, data map[string][]*Row, rowData map[string][]*sheets.RowData) error

Write populates the given rowData with the given data.

Types

type Cell

type Cell struct {
	Text      string
	Hyperlink string
}

func (*Cell) HyperlinkFormula

func (c *Cell) HyperlinkFormula() string

type Row

type Row struct {
	Cells    []*Cell
	Color    color.Color
	BoldText bool
}

func TotalRow

func TotalRow(values ...string) *Row

func (*Row) ToCells

func (r *Row) ToCells() []string

Jump to

Keyboard shortcuts

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