connection_repository

package
v0.0.0-...-fe06dec Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidClientIDError = errors.New("Invalid ClientID")
View Source
var InvalidOrgIDError = errors.New("Invalid OrgID")
View Source
var NotFoundError = errors.New("Not found")

Functions

func ProcessConnectionCounts

func ProcessConnectionCounts(ctx context.Context, databaseConn *sql.DB, sqlTimeout time.Duration, accountsToExclude []string, processConnectionCount ConnectionCountProcessor) error

func ProcessStaleConnections

func ProcessStaleConnections(ctx context.Context, databaseConn *sql.DB, sqlTimeout time.Duration, staleTimeCutoff time.Time, chunkSize int, processConnection ConnectionProcessor) error

func StartConnectedAccountReport

func StartConnectedAccountReport(accountsToExcludeCmdLineArg string, processorFunc ConnectionCountProcessor)

func UpdateStaleTimestampInDB

func UpdateStaleTimestampInDB(ctx context.Context, databaseConn *sql.DB, sqlTimeout time.Duration, rhcClient domain.ConnectorClientState)

Types

type ConnectionCountProcessor

type ConnectionCountProcessor func(context.Context, domain.AccountID, int) error

type ConnectionProcessor

type ConnectionProcessor func(context.Context, domain.ConnectorClientState) error

type ConnectionRegistrar

type ConnectionRegistrar interface {
	Register(context.Context, domain.ConnectorClientState) error
	Unregister(context.Context, domain.ClientID) error
	FindConnectionByClientID(context.Context, domain.ClientID) (domain.ConnectorClientState, error)
}

type FatalError

type FatalError struct {
	Err error
}

func (FatalError) Error

func (fe FatalError) Error() string

type GetAllConnections

type GetAllConnections func(context.Context, int, int) (map[domain.AccountID]map[domain.ClientID]domain.ConnectorClientState, int, error)

func NewGetAllConnections

func NewGetAllConnections(cfg *config.Config, database *sql.DB) (GetAllConnections, error)

type GetConnectionByClientID

type GetConnectionByClientID func(context.Context, *logrus.Entry, domain.OrgID, domain.ClientID) (domain.ConnectorClientState, error)

func NewPermittedTenantSqlGetConnectionByClientID

func NewPermittedTenantSqlGetConnectionByClientID(cfg *config.Config, database *sql.DB) (GetConnectionByClientID, error)

func NewSqlGetConnectionByClientID

func NewSqlGetConnectionByClientID(cfg *config.Config, database *sql.DB) (GetConnectionByClientID, error)

type GetConnectionsByOrgID

type GetConnectionsByOrgID func(context.Context, *logrus.Entry, domain.OrgID, int, int) (map[domain.ClientID]domain.ConnectorClientState, int, error)

func NewSqlGetConnectionsByOrgID

func NewSqlGetConnectionsByOrgID(cfg *config.Config, database *sql.DB) (GetConnectionsByOrgID, error)

type SqlConnectionRegistrar

type SqlConnectionRegistrar struct {
	// contains filtered or unexported fields
}

func NewSqlConnectionRegistrar

func NewSqlConnectionRegistrar(cfg *config.Config, database *sql.DB) (*SqlConnectionRegistrar, error)

func (*SqlConnectionRegistrar) FindConnectionByClientID

func (scm *SqlConnectionRegistrar) FindConnectionByClientID(ctx context.Context, client_id domain.ClientID) (domain.ConnectorClientState, error)

func (*SqlConnectionRegistrar) Register

func (*SqlConnectionRegistrar) Unregister

func (scm *SqlConnectionRegistrar) Unregister(ctx context.Context, client_id domain.ClientID) error

Jump to

Keyboard shortcuts

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