Documentation
¶
Index ¶
- type CsvDataSource
- type GoogleAuthConfig
- type GoogleSheetsConfig
- type GoogleSheetsDataSource
- func (ds *GoogleSheetsDataSource) DriveService() *drive.Service
- func (ds *GoogleSheetsDataSource) FetchRedirectMapping() (state.RedirectMap, error)
- func (ds *GoogleSheetsDataSource) Id() string
- func (ds *GoogleSheetsDataSource) LastModified() time.Time
- func (ds *GoogleSheetsDataSource) LastUpdate() time.Time
- func (ds *GoogleSheetsDataSource) NeedsUpdate() bool
- func (ds *GoogleSheetsDataSource) SheetsService() *sheets.Service
- func (ds *GoogleSheetsDataSource) SpreadsheetId() string
- func (ds *GoogleSheetsDataSource) SpreadsheetWebLink() (string, error)
- type RedirectDataSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CsvDataSource ¶
type CsvDataSource struct {
// contains filtered or unexported fields
}
CsvDataSource is a very simple implementation of the RedirectDataSource interface. It's not being used in the actual application, but it's here for testing and demonstration purposes.
func CreateCsvDataSource ¶
func CreateCsvDataSource(filePath string, checkModificationTime bool) *CsvDataSource
func (*CsvDataSource) FetchRedirectMapping ¶
func (ds *CsvDataSource) FetchRedirectMapping() (state.RedirectMap, error)
func (*CsvDataSource) Id ¶
func (ds *CsvDataSource) Id() string
func (*CsvDataSource) LastModified ¶
func (ds *CsvDataSource) LastModified() time.Time
func (*CsvDataSource) LastUpdate ¶
func (ds *CsvDataSource) LastUpdate() time.Time
func (*CsvDataSource) NeedsUpdate ¶
func (ds *CsvDataSource) NeedsUpdate() bool
type GoogleAuthConfig ¶
type GoogleSheetsConfig ¶
type GoogleSheetsConfig struct {
SpreadsheetId string
SkipFirstRow bool
ApiKey string
Auth *GoogleAuthConfig
}
func (*GoogleSheetsConfig) UseServiceAccount ¶
func (dsc *GoogleSheetsConfig) UseServiceAccount() bool
type GoogleSheetsDataSource ¶
type GoogleSheetsDataSource struct {
// contains filtered or unexported fields
}
func CreateSheetsDataSource ¶
func CreateSheetsDataSource(ctx context.Context) *GoogleSheetsDataSource
func (*GoogleSheetsDataSource) DriveService ¶
func (ds *GoogleSheetsDataSource) DriveService() *drive.Service
func (*GoogleSheetsDataSource) FetchRedirectMapping ¶
func (ds *GoogleSheetsDataSource) FetchRedirectMapping() (state.RedirectMap, error)
func (*GoogleSheetsDataSource) Id ¶
func (ds *GoogleSheetsDataSource) Id() string
func (*GoogleSheetsDataSource) LastModified ¶
func (ds *GoogleSheetsDataSource) LastModified() time.Time
func (*GoogleSheetsDataSource) LastUpdate ¶
func (ds *GoogleSheetsDataSource) LastUpdate() time.Time
func (*GoogleSheetsDataSource) NeedsUpdate ¶
func (ds *GoogleSheetsDataSource) NeedsUpdate() bool
func (*GoogleSheetsDataSource) SheetsService ¶
func (ds *GoogleSheetsDataSource) SheetsService() *sheets.Service
func (*GoogleSheetsDataSource) SpreadsheetId ¶
func (ds *GoogleSheetsDataSource) SpreadsheetId() string
func (*GoogleSheetsDataSource) SpreadsheetWebLink ¶
func (ds *GoogleSheetsDataSource) SpreadsheetWebLink() (string, error)
type RedirectDataSource ¶
type RedirectDataSource interface {
// LastUpdate returns the timestamp at which the last update occurred
LastUpdate() time.Time
// LastModified returns the timestamp at which the data source has been modified
LastModified() time.Time
// NeedsUpdate returns true when the data source provider determined that an update of the redirect mapping is necessary
NeedsUpdate() bool
// FetchRedirectMapping returns the current redirect mapping from the provider
FetchRedirectMapping() (state.RedirectMap, error)
// Id returns a provider specific identifier
Id() string
}
Click to show internal directories.
Click to hide internal directories.