Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplaceGlobals ¶
func ReplaceGlobals(repository Repository) func()
ReplaceGlobals affect a new repository to the global repository singleton
Types ¶
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
PostgresRepository is a repository containing the Fact definition based on a PSQL database and implementing the repository interface
func (*PostgresRepository) GetLastConnectionReading ¶
func (r *PostgresRepository) GetLastConnectionReading(connectorID string, successOnly bool, maxAgeDays int64) (map[string]time.Time, error)
GetLastConnectionReading returns the datetime of the last connections reading for a connector id
type Repository ¶
type Repository interface {
GetLastConnectionReading(connectorID string, successOnly bool, maxAge int64) (map[string]time.Time, error)
}
Repository is a storage interface which can be implemented by multiple backend (in-memory map, sql database, in-memory cache, file system, ...) It allows to read and write the connections configuration
func NewPostgresRepository ¶
func NewPostgresRepository(dbClient *sqlx.DB) Repository
NewPostgresRepository returns a new instance of PostgresRepository
Click to show internal directories.
Click to hide internal directories.