Documentation ¶
Index ¶
- func GetDatasourceID(ctx context.Context) int64
- func GetDatasourceLastUpdatedTime(ctx context.Context) string
- type AWSDatasource
- func (s *AWSDatasource) GetAPI(id int64, options sqlds.Options, settingsLoader models.Loader, ...) (api.AWSAPI, error)
- func (s *AWSDatasource) GetAsyncDB(id int64, options sqlds.Options, settingsLoader models.Loader, ...) (awsds.AsyncDB, error)
- func (s *AWSDatasource) GetDB(id int64, options sqlds.Options, settingsLoader models.Loader, ...) (*sql.DB, error)
- func (s *AWSDatasource) Init(config backend.DataSourceInstanceSettings)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatasourceID ¶
func GetDatasourceLastUpdatedTime ¶ added in v0.17.0
Types ¶
type AWSDatasource ¶
type AWSDatasource struct {
// contains filtered or unexported fields
}
AWSDatasource stores a cache of several instances. Each Map will depend on the datasource ID (and connection options):
- config: Base configuration. It will be used as base to populate datasource settings. It does not depend on connection options (only one per datasource)
- api: API instace with the common methods to contact the data source API.
- driver: Abstraction on top the upstream sql.Driver. Defined to handle multiple connections.
- db: Upstream database (sql.DB).
- sessionCache: AWS cache. This is not a Map since it does not depend on the datasource.
func New ¶
func New() *AWSDatasource
func (*AWSDatasource) GetAPI ¶
func (s *AWSDatasource) GetAPI( id int64, options sqlds.Options, settingsLoader models.Loader, apiLoader api.Loader, ) (api.AWSAPI, error)
GetAPI returns an API interface. When called multiple times with the same id and options, it will return a cached version of the API. The first time, it will use the loader functions to initialize the required settings and API.
func (*AWSDatasource) GetAsyncDB ¶ added in v0.11.1
func (s *AWSDatasource) GetAsyncDB( id int64, options sqlds.Options, settingsLoader models.Loader, apiLoader api.Loader, driverLoader asyncDriver.Loader, ) (awsds.AsyncDB, error)
GetAsyncDB returns a sqlds.AsyncDB. It will use the loader functions to initialize the required settings, API and driver and finally create a DB.
func (*AWSDatasource) GetDB ¶
func (s *AWSDatasource) GetDB( id int64, options sqlds.Options, settingsLoader models.Loader, apiLoader api.Loader, driverLoader driver.Loader, ) (*sql.DB, error)
GetDB returns a *sql.DB. It will use the loader functions to initialize the required settings, API and driver and finally create a DB.
func (*AWSDatasource) Init ¶
func (s *AWSDatasource) Init(config backend.DataSourceInstanceSettings)
Init stores the data source configuration. It's needed for the GetDB and GetAPI functions