sheets

package
v0.0.0-...-ae87ca3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGoogleSheetClient

func CreateGoogleSheetClient(serviceAccountJsonPath string) (*sheets.Service, error)

Types

type Columns

type Columns struct {
	ID        string
	Client    string
	Date      string
	StartTime string
	EndTime   string
	TotalTime string
	Note      string
}

type Record

type Record struct {
	Session models.Session
	Row     int
}

type Sheet

type Sheet struct {
	Service       *sheets.Service
	SpreadsheetId string
	SheetName     string
	Columns       Columns
}

func GetSheet

func GetSheet(srv *sheets.Service, cfg config.SpreadsheetRemote) (*Sheet, error)

func NewSheet

func NewSheet(cfg config.SpreadsheetRemote) (*Sheet, error)

func (*Sheet) AddRow

func (s *Sheet) AddRow(session models.Session) error

func (*Sheet) ParseHeaders

func (s *Sheet) ParseHeaders(row []interface{})

func (*Sheet) ParseSheet

func (s *Sheet) ParseSheet(records *[]Record) error

func (*Sheet) SessionFromRow

func (s *Sheet) SessionFromRow(row []interface{}) (*models.Session, error)

func (*Sheet) SessionToRow

func (s *Sheet) SessionToRow(session models.Session) []interface{}

func (*Sheet) UpdateRow

func (s *Sheet) UpdateRow(record Record) error

Jump to

Keyboard shortcuts

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