connector

package
v5.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 6 Imported by: 0

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

func R

func R() Repository

R is used to access the global repository singleton

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL