lib

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileMode = os.FileMode(0600)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GSheetService

type GSheetService struct {
	*sheets.Service
}

func NewGsheetService

func NewGsheetService(credentialFilePath string) (gsrv *GSheetService, err error)

func NewGsheetServiceV2

func NewGsheetServiceV2() (gsrv *GSheetService, err error)

func (*GSheetService) Append

func (srv *GSheetService) Append(
	spreadsheetID string, range_ string, values [][]any,
) (resp *sheets.AppendValuesResponse, err error)

API: POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append DOC: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append

func (*GSheetService) ReadSheet

func (srv *GSheetService) ReadSheet(spreadsheetID, readRange string) (values [][]string)
  • Example: spreadsheetId := "1AGHH6abcXzBmfC5e9r50t3wXKhlUs5XIE-fj1U4fV0Q" readRange := "Log1!A2:B" *

func (*GSheetService) Search

func (srv *GSheetService) Search(
	spreadsheetID string,
) (result *sheets.SearchDeveloperMetadataResponse, err error)

func (*GSheetService) Update

func (srv *GSheetService) Update(
	spreadsheetID, updateRange string, values *sheets.ValueRange,
) (result *sheets.UpdateValuesResponse, err error)

type ISheetService

type ISheetService interface {
	ReadSheet(spreadsheetID, readRange string) (values [][]string)
	Append(spreadsheetID string, range_ string, values [][]any) (resp *sheets.AppendValuesResponse, err error)
}

Jump to

Keyboard shortcuts

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