Documentation ¶
Index ¶
- Constants
- type GDrive
- type GDriveSpreadsheet
- func (spreadsheet *GDriveSpreadsheet) AddSheet(title string) (int64, error)
- func (spreadsheet *GDriveSpreadsheet) AddSpreadsheet(spreadsheetTitle string, isDomain bool) error
- func (spreadsheet *GDriveSpreadsheet) GetSheetByTitle(title string) (int64, error)
- func (spreadsheet *GDriveSpreadsheet) GetSpreadsheet(spreadsheetID string) (*sheets.Spreadsheet, error)
- func (spreadsheet *GDriveSpreadsheet) InitSpreadsheet() error
- func (spreadsheet *GDriveSpreadsheet) LoadSpreadsheet() error
- func (spreadsheet *GDriveSpreadsheet) SetSpreadsheetService() error
- func (spreadsheet *GDriveSpreadsheet) UpsertSheet(title string) (int64, error)
- type SACreds
Constants ¶
View Source
const ( // GroupAPI is the group API scope use in this package GroupAPI = "sxlibs.k8s.startx.fr" // GroupName is the group name use in this package GroupName = "gdrive" )
View Source
const (
// GroupName is the group name use in this package
GroupNameGDrive = "gsheet"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GDrive ¶
type GDrive struct { CredentialFilePath string CredentialFileBase string CredentialFileName string Domain string // contains filtered or unexported fields }
GDrive is a wrapper around api.Config
func (*GDrive) CheckCredentials ¶
CheckCredentials verifies if the credentials file is valid for connecting to Google API
func (*GDrive) SetCredentialsContent ¶
func (gdrive *GDrive) SetCredentialsContent( typeName string, project_id string, private_key_id string, private_key string, client_email string, client_id string, auth_uri string, token_uri string, auth_provider_x509_cert_url string, client_x509_cert_url string, universe_domain string, ) error
Set the credentials content from params
type GDriveSpreadsheet ¶
type GDriveSpreadsheet struct { GDrive *GDrive Service *sheets.Service SpreadsheetID string Spreadsheet *sheets.Spreadsheet // contains filtered or unexported fields }
GDrive is a wrapper around api.Config
func NewGDriveSpreadsheet ¶
func NewGDriveSpreadsheet(gdrive *GDrive, spreadsheetID string) *GDriveSpreadsheet
Initialize a gdrive object ex:
gdrive := kc.NewGDrive()
func (*GDriveSpreadsheet) AddSheet ¶
func (spreadsheet *GDriveSpreadsheet) AddSheet(title string) (int64, error)
Add a sheet and return its object
func (*GDriveSpreadsheet) AddSpreadsheet ¶
func (spreadsheet *GDriveSpreadsheet) AddSpreadsheet(spreadsheetTitle string, isDomain bool) error
Add a spreadsheet and load it
func (*GDriveSpreadsheet) GetSheetByTitle ¶
func (spreadsheet *GDriveSpreadsheet) GetSheetByTitle(title string) (int64, error)
Get a sheet and return its ID
func (*GDriveSpreadsheet) GetSpreadsheet ¶
func (spreadsheet *GDriveSpreadsheet) GetSpreadsheet(spreadsheetID string) (*sheets.Spreadsheet, error)
Get a spreadsheet and return its object
func (*GDriveSpreadsheet) InitSpreadsheet ¶
func (spreadsheet *GDriveSpreadsheet) InitSpreadsheet() error
Initialize a spreadsheet must be used prior to calling any other method
func (*GDriveSpreadsheet) LoadSpreadsheet ¶
func (spreadsheet *GDriveSpreadsheet) LoadSpreadsheet() error
Load a spreadsheet
func (*GDriveSpreadsheet) SetSpreadsheetService ¶
func (spreadsheet *GDriveSpreadsheet) SetSpreadsheetService() error
Set the spreadsheet Service
func (*GDriveSpreadsheet) UpsertSheet ¶
func (spreadsheet *GDriveSpreadsheet) UpsertSheet(title string) (int64, error)
Update or insert a sheet and return its object
type SACreds ¶
type SACreds struct { Type string `json:"type"` ProjectID string `json:"project_id"` PrivateKeyID string `json:"private_key_id"` PrivateKey string `json:"private_key"` ClientEmail string `json:"client_email"` ClientID string `json:"client_id"` AuthURI string `json:"auth_uri"` TokenURI string `json:"token_uri"` AuthProviderCertURL string `json:"auth_provider_x509_cert_url"` ClientCertURL string `json:"client_x509_cert_url"` UniverseDomain string `json:"universe_domain"` }
Click to show internal directories.
Click to hide internal directories.