connector

package
v4.1.13 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 5 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) (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) (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