sheet

package
v0.0.0-...-feb89da Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearRange

func ClearRange(srv *sheets.Service, spec *DataSpec) error

func ClearWorksheet

func ClearWorksheet(srv *sheets.Service, spec *DataSpec, protect bool, force bool) error

func DeleteAlias

func DeleteAlias(name string) error

func FormatValues

func FormatValues(v *sheets.ValueRange, f DataFormat) string

func GetAllAliases

func GetAllAliases() map[string]*DataSpec

func GetClient

func GetClient(secretfile string, tokfile string) *http.Client

Retrieve a token, saves the token, then returns the generated client.

func GetService

func GetService() (*sheets.Service, error)

func PrintValues

func PrintValues(v *sheets.ValueRange, f DataFormat)

func ScanValues

func ScanValues(r *bufio.Reader, f DataFormat) ([][]string, error)

func SetAlias

func SetAlias(name string, spec *DataSpec) error

func SetupTempConfig

func SetupTempConfig(t *testing.T, cfname string)

func WriteDataToRange

func WriteDataToRange(srv *sheets.Service, spec *DataSpec, data [][]string) error

func WriteDataToWorksheet

func WriteDataToWorksheet(srv *sheets.Service, spec *DataSpec, data [][]string, protect bool, force bool) error

Types

type DataFormat

type DataFormat string
const (
	CsvFormat DataFormat = "csv"
	TsvFormat DataFormat = "tsv"
)

func (*DataFormat) Separator

func (f *DataFormat) Separator() string

func (*DataFormat) Set

func (f *DataFormat) Set(v string) error

func (*DataFormat) String

func (f *DataFormat) String() string

func (*DataFormat) Type

func (f *DataFormat) Type() string

type DataFormatValue

type DataFormatValue interface {
	String() string
	Set(string) error
	Type() string
	Separator() string
}

Implement an enum-a-like for the [input|output]-format flag

type DataRange

type DataRange struct {
	StartRow int
	StartCol int
	EndRow   int
	EndCol   int
}

func RangeFromString

func RangeFromString(s string) DataRange

func (*DataRange) FromString

func (d *DataRange) FromString(s string) (*DataRange, error)

func (*DataRange) IsFixedSize

func (d *DataRange) IsFixedSize() bool

func (*DataRange) SizeXY

func (d *DataRange) SizeXY() (int, int)

func (*DataRange) String

func (d *DataRange) String() string

type DataSpec

type DataSpec struct {
	Workbook  string
	Worksheet string
	Range     DataRange
}

func ExpandArgsToDataSpec

func ExpandArgsToDataSpec(args []string) (*DataSpec, error)

func GetAlias

func GetAlias(name string) (*DataSpec, error)

func (*DataSpec) FromString

func (d *DataSpec) FromString(s string) (*DataSpec, error)

func (*DataSpec) GetInSheetDataSpec

func (d *DataSpec) GetInSheetDataSpec() string

func (*DataSpec) IsRange

func (d *DataSpec) IsRange() bool

func (*DataSpec) IsWorkbook

func (d *DataSpec) IsWorkbook() bool

func (*DataSpec) IsWorksheet

func (d *DataSpec) IsWorksheet() bool

func (*DataSpec) String

func (d *DataSpec) String() string

Jump to

Keyboard shortcuts

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