googlesheets

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_ACCOUNT_AUTH = "serviceAccount"
	OAUTH2_AUTH          = "oauth2"

	READ_ACTION       = "read"
	APPEND_ACTION     = "append"
	UPDATE_ACTION     = "update"
	BULKUPDATE_ACTION = "bulkUpdate"
	DELETE_ACTION     = "delete"
	CREATE_ACTION     = "create"
	COPY_ACTION       = "copy"
	LIST_ACTION       = "list"
	GET_ACTION        = "get"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Method string                 `validate:"required,oneof=read append update bulkUpdate delete create copy list get"`
	Opts   map[string]interface{} `validate:"required_unless=Method list"`
}

type ActionRunner

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

func (*ActionRunner) Append

func (r *ActionRunner) Append() (common.RuntimeResult, error)

func (*ActionRunner) BulkUpdate

func (r *ActionRunner) BulkUpdate() (common.RuntimeResult, error)

func (*ActionRunner) CopyFromAToB

func (r *ActionRunner) CopyFromAToB() (common.RuntimeResult, error)

func (*ActionRunner) CreateASpreadsheet

func (r *ActionRunner) CreateASpreadsheet() (common.RuntimeResult, error)

func (*ActionRunner) DeleteSingleRow

func (r *ActionRunner) DeleteSingleRow() (common.RuntimeResult, error)

func (*ActionRunner) GetSpreadsheetInfo

func (r *ActionRunner) GetSpreadsheetInfo() (common.RuntimeResult, error)

func (*ActionRunner) Read

func (r *ActionRunner) Read() (common.RuntimeResult, error)

func (*ActionRunner) Update

func (r *ActionRunner) Update() (common.RuntimeResult, error)

type AppendOpts

type AppendOpts struct {
	Spreadsheet string `validate:"required"`
	SheetName   string
	Values      []map[string]interface{}
}

type BulkUpdateOpts

type BulkUpdateOpts struct {
	Spreadsheet string `validate:"required"`
	SheetName   string
	PrimaryKey  string `validate:"required"`
	RowsArray   []map[string]interface{}
}

type Connector

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

func (*Connector) GetMetaInfo

func (g *Connector) GetMetaInfo(resourceOptions map[string]interface{}) (common.MetaInfoResult, error)

func (*Connector) Run

func (g *Connector) Run(resourceOptions map[string]interface{}, actionOptions map[string]interface{}, rawActionOptions map[string]interface{}) (common.RuntimeResult, error)

func (*Connector) TestConnection

func (g *Connector) TestConnection(resourceOptions map[string]interface{}) (common.ConnectionResult, error)

func (*Connector) ValidateActionTemplate

func (g *Connector) ValidateActionTemplate(actionOptions map[string]interface{}) (common.ValidateResult, error)

func (*Connector) ValidateResourceOptions

func (g *Connector) ValidateResourceOptions(resourceOptions map[string]interface{}) (common.ValidateResult, error)

type CopyOpts

type CopyOpts struct {
	Spreadsheet   string `validate:"required"`
	SheetName     string
	ToSpreadsheet string `validate:"required"`
	ToSheet       string
}

type CreateOpts

type CreateOpts struct {
	Title string `validate:"required"`
}

type DeleteOpts

type DeleteOpts struct {
	Spreadsheet string `validate:"required"`
	SheetName   string
	RowIndex    int
}

type Filter

type Filter struct {
	Key      string
	Operator string
	Value    string
}

type GetOpts

type GetOpts struct {
	Spreadsheet string `validate:"required"`
}

type OAuth2Opts

type OAuth2Opts struct {
	AccessType   string `validate:"required,oneof=rw r"`
	AccessToken  string
	TokenType    string
	RefreshToken string
	Status       int
}

type ReadOpts

type ReadOpts struct {
	Spreadsheet string `validate:"required"`
	SheetName   string
	Limit       int
	Offset      int
	RangeType   string `validate:"required,oneof=a1 limit"`
	A1Notation  string
}

type Resource

type Resource struct {
	Authentication string                 `validate:"required,oneof=serviceAccount oauth2"`
	Opts           map[string]interface{} `validate:"required"`
}

type SAOpts

type SAOpts struct {
	PrivateKey string `validate:"required"`
}

type UpdateOpts

type UpdateOpts struct {
	Spreadsheet string `validate:"required"`
	FilterType  string `validate:"required,oneof=a1 filter"`
	A1Notation  string
	Values      []map[string]interface{}
	SheetName   string
	Filters     []Filter
}

Jump to

Keyboard shortcuts

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