sheets

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A1Range

type A1Range struct {
	Original  string
	SheetName string
	FromCell  string
	ToCell    string
}

func NewA1Range

func NewA1Range(s string) A1Range

type AuthClient

type AuthClient interface {
	HTTPClient() *http.Client
}

type BatchUpdateRowsRequest

type BatchUpdateRowsRequest struct {
	A1Range string
	Values  [][]interface{}
}

type BatchUpdateRowsResult

type BatchUpdateRowsResult []UpdateRowsResult

type InsertRowsResult

type InsertRowsResult struct {
	UpdatedRange   A1Range
	UpdatedRows    int64
	UpdatedColumns int64
	UpdatedCells   int64
	InsertedValues [][]interface{}
}

type MockWrapper

type MockWrapper struct {
	CreateSpreadsheetResult string
	CreateSpreadsheetError  error

	CreateSheetError error

	InsertRowsResult InsertRowsResult
	InsertRowsError  error

	OverwriteRowsResult InsertRowsResult
	OverwriteRowsError  error

	UpdateRowsResult UpdateRowsResult
	UpdateRowsError  error

	BatchUpdateRowsResult BatchUpdateRowsResult
	BatchUpdateRowsError  error

	QueryRowsResult QueryRowsResult
	QueryRowsError  error

	ClearResult []string
	ClearError  error
}

func (*MockWrapper) BatchUpdateRows

func (w *MockWrapper) BatchUpdateRows(ctx context.Context, spreadsheetID string, requests []BatchUpdateRowsRequest) (BatchUpdateRowsResult, error)

func (*MockWrapper) Clear

func (w *MockWrapper) Clear(ctx context.Context, spreadsheetID string, ranges []string) ([]string, error)

func (*MockWrapper) CreateSheet

func (w *MockWrapper) CreateSheet(ctx context.Context, spreadsheetID string, sheetName string) error

func (*MockWrapper) CreateSpreadsheet

func (w *MockWrapper) CreateSpreadsheet(ctx context.Context, title string) (string, error)

func (*MockWrapper) DeleteSheets

func (w *MockWrapper) DeleteSheets(ctx context.Context, spreadsheetID string, sheetIDs []int64) error

func (*MockWrapper) GetSheetNameToID

func (w *MockWrapper) GetSheetNameToID(ctx context.Context, spreadsheetID string) (map[string]int64, error)

func (*MockWrapper) InsertRows

func (w *MockWrapper) InsertRows(ctx context.Context, spreadsheetID string, a1Range string, values [][]interface{}) (InsertRowsResult, error)

func (*MockWrapper) OverwriteRows

func (w *MockWrapper) OverwriteRows(ctx context.Context, spreadsheetID string, a1Range string, values [][]interface{}) (InsertRowsResult, error)

func (*MockWrapper) QueryRows

func (w *MockWrapper) QueryRows(ctx context.Context, spreadsheetID string, sheetName string, query string, skipHeader bool) (QueryRowsResult, error)

func (*MockWrapper) UpdateRows

func (w *MockWrapper) UpdateRows(ctx context.Context, spreadsheetID string, a1Range string, values [][]interface{}) (UpdateRowsResult, error)

type QueryRowsResult

type QueryRowsResult struct {
	Rows [][]interface{}
}

type UpdateRowsResult

type UpdateRowsResult struct {
	UpdatedRange   A1Range
	UpdatedRows    int64
	UpdatedColumns int64
	UpdatedCells   int64
	UpdatedValues  [][]interface{}
}

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

func NewWrapper

func NewWrapper(authClient AuthClient) (*Wrapper, error)

func (*Wrapper) BatchUpdateRows

func (w *Wrapper) BatchUpdateRows(
	ctx context.Context,
	spreadsheetID string,
	requests []BatchUpdateRowsRequest,
) (BatchUpdateRowsResult, error)

func (*Wrapper) Clear

func (w *Wrapper) Clear(ctx context.Context, spreadsheetID string, ranges []string) ([]string, error)

func (*Wrapper) CreateSheet

func (w *Wrapper) CreateSheet(ctx context.Context, spreadsheetID string, sheetName string) error

func (*Wrapper) CreateSpreadsheet

func (w *Wrapper) CreateSpreadsheet(ctx context.Context, title string) (string, error)

func (*Wrapper) DeleteSheets

func (w *Wrapper) DeleteSheets(ctx context.Context, spreadsheetID string, sheetIDs []int64) error

func (*Wrapper) GetSheetNameToID

func (w *Wrapper) GetSheetNameToID(ctx context.Context, spreadsheetID string) (map[string]int64, error)

func (*Wrapper) InsertRows

func (w *Wrapper) InsertRows(
	ctx context.Context,
	spreadsheetID string,
	a1Range string,
	values [][]interface{},
) (InsertRowsResult, error)

func (*Wrapper) OverwriteRows

func (w *Wrapper) OverwriteRows(
	ctx context.Context,
	spreadsheetID string,
	a1Range string,
	values [][]interface{},
) (InsertRowsResult, error)

func (*Wrapper) QueryRows

func (w *Wrapper) QueryRows(
	ctx context.Context,
	spreadsheetID string,
	sheetName string,
	query string,
	skipHeader bool,
) (QueryRowsResult, error)

func (*Wrapper) UpdateRows

func (w *Wrapper) UpdateRows(
	ctx context.Context,
	spreadsheetID string,
	a1Range string,
	values [][]interface{},
) (UpdateRowsResult, error)

Jump to

Keyboard shortcuts

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