Documentation ¶
Index ¶
Constants ¶
const ( // ColumTypeTime is the TIME type ColumTypeTime ColumnType = "TIME" // ColumTypeNumber is the NUMBER type ColumTypeNumber = "NUMBER" // ColumTypeString is the STRING type ColumTypeString = "STRING" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnDefinition ¶
type ColumnDefinition struct { Header string ColumnIndex int // contains filtered or unexported fields }
ColumnDefinition represents a spreadsheet column definition.
func NewColumnDefinition ¶
func NewColumnDefinition(header string, index int) *ColumnDefinition
NewColumnDefinition creates a new ColumnDefinition.
func (*ColumnDefinition) CheckCell ¶
func (cd *ColumnDefinition) CheckCell(cell *sheets.CellData)
CheckCell checks a ColumnDefinition's cell.
func (*ColumnDefinition) GetType ¶
func (cd *ColumnDefinition) GetType() ColumnType
GetType gets the type of a ColumnDefinition.
func (*ColumnDefinition) GetUnit ¶
func (cd *ColumnDefinition) GetUnit() string
GetUnit gets the unit of a ColumnDefinition.
func (*ColumnDefinition) HasMixedTypes ¶
func (cd *ColumnDefinition) HasMixedTypes() bool
HasMixedTypes returns whether a ColumnDefinition has mixed types.
func (*ColumnDefinition) HasMixedUnits ¶
func (cd *ColumnDefinition) HasMixedUnits() bool
HasMixedUnits returns whether a ColumnDefinition has mixed units.
type GoogleClient ¶
type GoogleClient struct {
// contains filtered or unexported fields
}
GoogleClient struct
func NewGoogleClient ¶
func NewGoogleClient(ctx context.Context, auth *models.DatasourceSettings) (*GoogleClient, error)
NewGoogleClient creates a new client and initializes a sheet service and a drive service
func (*GoogleClient) GetSpreadsheet ¶
func (gc *GoogleClient) GetSpreadsheet(spreadSheetID string, sheetRange string, includeGridData bool) (*sheets.Spreadsheet, error)
GetSpreadsheet gets a google spreadsheet struct by id and range
func (*GoogleClient) GetSpreadsheetFiles ¶
func (gc *GoogleClient) GetSpreadsheetFiles() ([]*drive.File, error)
GetSpreadsheetFiles lists all files with spreadsheet mimetype that the client has access to.
func (*GoogleClient) TestClient ¶
func (gc *GoogleClient) TestClient() error
TestClient checks that the client can connect to required services
type GoogleSheets ¶
type GoogleSheets struct {
Cache *cache.Cache
}
GoogleSheets provides an interface to the Google Sheets API.
func (*GoogleSheets) GetSpreadsheets ¶
func (gs *GoogleSheets) GetSpreadsheets(ctx context.Context, config *models.DatasourceSettings) (map[string]string, error)
GetSpreadsheets gets spreadsheets from the Google API.
func (*GoogleSheets) Query ¶
func (gs *GoogleSheets) Query(ctx context.Context, refID string, qm *models.QueryModel, config *models.DatasourceSettings, timeRange backend.TimeRange) (dr backend.DataResponse)
Query queries a spreadsheet and returns a corresponding data frame.