services

package
v0.0.0-...-7eda018 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const HeartbeatTreshold = internal.HeartbeatInterval * 2
View Source
const (
	SlesIdentifier string = "SLES_SAP"
)

Variables

This section is empty.

Functions

func NewChecksService

func NewChecksService(db *gorm.DB, premiumDetectionService PremiumDetectionService) *checksService

func NewClustersService

func NewClustersService(db *gorm.DB, checksService ChecksService) *clustersService

func NewCollectorService

func NewCollectorService(db *gorm.DB, projectorsChannel chan *datapipeline.DataCollectedEvent) *collectorService

func NewHostsService

func NewHostsService(db *gorm.DB, promService PrometheusService) *hostsService

func NewPremiumDetectionService

func NewPremiumDetectionService(flavor string, subscriptions SubscriptionsService, settings SettingsService) *premiumDetectionService

func NewPrometheusService

func NewPrometheusService(db *gorm.DB, promApi prometheusInternal.PrometheusAPI) *prometheusService

func NewSAPSystemsService

func NewSAPSystemsService(db *gorm.DB) *sapSystemsService

func NewSubscriptionsService

func NewSubscriptionsService(db *gorm.DB) *subscriptionsService

func NewTagsService

func NewTagsService(db *gorm.DB) *tagsService

func Paginate

func Paginate(p *Page) func(db *gorm.DB) *gorm.DB

Types

type ChecksService

type ChecksService interface {
	// Check catalog services
	GetChecksCatalog() (models.ChecksCatalog, error)
	GetChecksCatalogByGroup() (models.GroupedCheckList, error)
	CreateChecksCatalogEntry(check *models.Check) error // seems to be never used
	CreateChecksCatalog(checkList models.ChecksCatalog) error
	// Check result services
	CreateChecksResult(checksResult *models.ChecksResult) error
	GetLastExecutionByGroup() ([]*models.ChecksResult, error)
	GetChecksResultByCluster(clusterId string) (*models.ChecksResult, error)
	GetChecksResultAndMetadataByCluster(clusterId string) (*models.ChecksResultAsList, error)
	GetAggregatedChecksResultByHost(clusterId string) (map[string]*models.AggregatedCheckData, error)
	GetAggregatedChecksResultByCluster(clusterId string) (*models.AggregatedCheckData, error)
	// Selected checks services
	GetSelectedChecksById(id string) (models.SelectedChecks, error)
	CreateSelectedChecks(id string, selectedChecksList []string) error
	// Connection data services
	GetConnectionSettingsById(id string) (map[string]models.ConnectionSettings, error)
	GetConnectionSettingsByNode(node string) (models.ConnectionSettings, error)
	CreateConnectionSettings(node, cluster, user string) error
}

type ClustersFilter

type ClustersFilter struct {
	ID          []string
	Name        []string
	ClusterType []string
	SIDs        []string
	Tags        []string
	Health      []string
}

type ClustersService

type ClustersService interface {
	GetAll(*ClustersFilter, *Page) (models.ClusterList, error)
	GetByID(string) (*models.Cluster, error)
	GetCount() (int, error)
	GetAllClusterNames() ([]string, error)
	GetAllClusterTypes() ([]string, error)
	GetAllSIDs() ([]string, error)
	GetAllTags() ([]string, error)
	GetAllClustersSettings() (models.ClustersSettings, error)
	GetClusterSettingsByID(id string) (*models.ClusterSettings, error)
}

type CollectorService

type CollectorService interface {
	StoreEvent(dataCollected *datapipeline.DataCollectedEvent) error
}

type HealthSummaryService

type HealthSummaryService interface {
	GetHealthSummary() (models.HealthSummary, error)
}

func NewHealthSummaryService

func NewHealthSummaryService(sapSystemsService SAPSystemsService,
	clustersService ClustersService,
	hostsService HostsService) HealthSummaryService

type HostsFilter

type HostsFilter struct {
	ID     []string
	SIDs   []string
	Tags   []string
	Health []string
}

type HostsService

type HostsService interface {
	GetAll(*HostsFilter, *Page) (models.HostList, error)
	GetByID(string) (*models.Host, error)
	GetAllBySAPSystemID(string) (models.HostList, error)
	GetCount() (int, error)
	GetAllSIDs() ([]string, error)
	GetAllTags() ([]string, error)
	Heartbeat(agentID string) error
	GetExportersState(hostname string) (map[string]string, error)
}

type MockChecksService

type MockChecksService struct {
	mock.Mock
}

MockChecksService is an autogenerated mock type for the ChecksService type

func (*MockChecksService) CreateChecksCatalog

func (_m *MockChecksService) CreateChecksCatalog(checkList models.ChecksCatalog) error

CreateChecksCatalog provides a mock function with given fields: checkList

func (*MockChecksService) CreateChecksCatalogEntry

func (_m *MockChecksService) CreateChecksCatalogEntry(check *models.Check) error

CreateChecksCatalogEntry provides a mock function with given fields: check

func (*MockChecksService) CreateChecksResult

func (_m *MockChecksService) CreateChecksResult(checksResult *models.ChecksResult) error

CreateChecksResult provides a mock function with given fields: checksResult

func (*MockChecksService) CreateConnectionSettings

func (_m *MockChecksService) CreateConnectionSettings(node string, cluster string, user string) error

CreateConnectionSettings provides a mock function with given fields: node, cluster, user

func (*MockChecksService) CreateSelectedChecks

func (_m *MockChecksService) CreateSelectedChecks(id string, selectedChecksList []string) error

CreateSelectedChecks provides a mock function with given fields: id, selectedChecksList

func (*MockChecksService) GetAggregatedChecksResultByCluster

func (_m *MockChecksService) GetAggregatedChecksResultByCluster(clusterId string) (*models.AggregatedCheckData, error)

GetAggregatedChecksResultByCluster provides a mock function with given fields: clusterId

func (*MockChecksService) GetAggregatedChecksResultByHost

func (_m *MockChecksService) GetAggregatedChecksResultByHost(clusterId string) (map[string]*models.AggregatedCheckData, error)

GetAggregatedChecksResultByHost provides a mock function with given fields: clusterId

func (*MockChecksService) GetChecksCatalog

func (_m *MockChecksService) GetChecksCatalog() (models.ChecksCatalog, error)

GetChecksCatalog provides a mock function with given fields:

func (*MockChecksService) GetChecksCatalogByGroup

func (_m *MockChecksService) GetChecksCatalogByGroup() (models.GroupedCheckList, error)

GetChecksCatalogByGroup provides a mock function with given fields:

func (*MockChecksService) GetChecksResultAndMetadataByCluster

func (_m *MockChecksService) GetChecksResultAndMetadataByCluster(clusterId string) (*models.ChecksResultAsList, error)

GetChecksResultAndMetadataByCluster provides a mock function with given fields: clusterId

func (*MockChecksService) GetChecksResultByCluster

func (_m *MockChecksService) GetChecksResultByCluster(clusterId string) (*models.ChecksResult, error)

GetChecksResultByCluster provides a mock function with given fields: clusterId

func (*MockChecksService) GetConnectionSettingsById

func (_m *MockChecksService) GetConnectionSettingsById(id string) (map[string]models.ConnectionSettings, error)

GetConnectionSettingsById provides a mock function with given fields: id

func (*MockChecksService) GetConnectionSettingsByNode

func (_m *MockChecksService) GetConnectionSettingsByNode(node string) (models.ConnectionSettings, error)

GetConnectionSettingsByNode provides a mock function with given fields: node

func (*MockChecksService) GetLastExecutionByGroup

func (_m *MockChecksService) GetLastExecutionByGroup() ([]*models.ChecksResult, error)

GetLastExecutionByGroup provides a mock function with given fields:

func (*MockChecksService) GetSelectedChecksById

func (_m *MockChecksService) GetSelectedChecksById(id string) (models.SelectedChecks, error)

GetSelectedChecksById provides a mock function with given fields: id

type MockClustersService

type MockClustersService struct {
	mock.Mock
}

MockClustersService is an autogenerated mock type for the ClustersService type

func (*MockClustersService) GetAll

func (_m *MockClustersService) GetAll(_a0 *ClustersFilter, _a1 *Page) (models.ClusterList, error)

GetAll provides a mock function with given fields: _a0, _a1

func (*MockClustersService) GetAllClusterNames

func (_m *MockClustersService) GetAllClusterNames() ([]string, error)

GetAllClusterNames provides a mock function with given fields:

func (*MockClustersService) GetAllClusterTypes

func (_m *MockClustersService) GetAllClusterTypes() ([]string, error)

GetAllClusterTypes provides a mock function with given fields:

func (*MockClustersService) GetAllClustersSettings

func (_m *MockClustersService) GetAllClustersSettings() (models.ClustersSettings, error)

GetAllClustersSettings provides a mock function with given fields:

func (*MockClustersService) GetAllSIDs

func (_m *MockClustersService) GetAllSIDs() ([]string, error)

GetAllSIDs provides a mock function with given fields:

func (*MockClustersService) GetAllTags

func (_m *MockClustersService) GetAllTags() ([]string, error)

GetAllTags provides a mock function with given fields:

func (*MockClustersService) GetByID

func (_m *MockClustersService) GetByID(_a0 string) (*models.Cluster, error)

GetByID provides a mock function with given fields: _a0

func (*MockClustersService) GetClusterSettingsByID

func (_m *MockClustersService) GetClusterSettingsByID(id string) (*models.ClusterSettings, error)

GetClusterSettingsByID provides a mock function with given fields: id

func (*MockClustersService) GetCount

func (_m *MockClustersService) GetCount() (int, error)

GetCount provides a mock function with given fields:

type MockCollectorService

type MockCollectorService struct {
	mock.Mock
}

MockCollectorService is an autogenerated mock type for the CollectorService type

func (*MockCollectorService) StoreEvent

func (_m *MockCollectorService) StoreEvent(dataCollected *datapipeline.DataCollectedEvent) error

StoreEvent provides a mock function with given fields: dataCollected

type MockHealthSummaryService

type MockHealthSummaryService struct {
	mock.Mock
}

MockHealthSummaryService is an autogenerated mock type for the HealthSummaryService type

func (*MockHealthSummaryService) GetHealthSummary

func (_m *MockHealthSummaryService) GetHealthSummary() (models.HealthSummary, error)

GetHealthSummary provides a mock function with given fields:

type MockHostsService

type MockHostsService struct {
	mock.Mock
}

MockHostsService is an autogenerated mock type for the HostsService type

func (*MockHostsService) GetAll

func (_m *MockHostsService) GetAll(_a0 *HostsFilter, _a1 *Page) (models.HostList, error)

GetAll provides a mock function with given fields: _a0, _a1

func (*MockHostsService) GetAllBySAPSystemID

func (_m *MockHostsService) GetAllBySAPSystemID(_a0 string) (models.HostList, error)

GetAllBySAPSystemID provides a mock function with given fields: _a0

func (*MockHostsService) GetAllSIDs

func (_m *MockHostsService) GetAllSIDs() ([]string, error)

GetAllSIDs provides a mock function with given fields:

func (*MockHostsService) GetAllTags

func (_m *MockHostsService) GetAllTags() ([]string, error)

GetAllTags provides a mock function with given fields:

func (*MockHostsService) GetByID

func (_m *MockHostsService) GetByID(_a0 string) (*models.Host, error)

GetByID provides a mock function with given fields: _a0

func (*MockHostsService) GetCount

func (_m *MockHostsService) GetCount() (int, error)

GetCount provides a mock function with given fields:

func (*MockHostsService) GetExportersState

func (_m *MockHostsService) GetExportersState(hostname string) (map[string]string, error)

GetExportersState provides a mock function with given fields: hostname

func (*MockHostsService) Heartbeat

func (_m *MockHostsService) Heartbeat(agentID string) error

Heartbeat provides a mock function with given fields: agentID

type MockPremiumDetectionService

type MockPremiumDetectionService struct {
	mock.Mock
}

MockPremiumDetectionService is an autogenerated mock type for the PremiumDetectionService type

func (*MockPremiumDetectionService) CanPublishTelemetry

func (_m *MockPremiumDetectionService) CanPublishTelemetry() (bool, error)

CanPublishTelemetry provides a mock function with given fields:

func (*MockPremiumDetectionService) IsPremiumActive

func (_m *MockPremiumDetectionService) IsPremiumActive() (bool, error)

IsPremiumActive provides a mock function with given fields:

func (*MockPremiumDetectionService) RequiresEulaAcceptance

func (_m *MockPremiumDetectionService) RequiresEulaAcceptance() (bool, error)

RequiresEulaAcceptance provides a mock function with given fields:

type MockPrometheusService

type MockPrometheusService struct {
	mock.Mock
}

MockPrometheusService is an autogenerated mock type for the PrometheusService type

func (*MockPrometheusService) GetHttpSDTargets

func (_m *MockPrometheusService) GetHttpSDTargets() (models.PrometheusTargetsList, error)

GetHttpSDTargets provides a mock function with given fields:

func (*MockPrometheusService) Query

func (_m *MockPrometheusService) Query(query string, ts time.Time) (model.Value, error)

Query provides a mock function with given fields: query, ts

type MockSAPSystemsService

type MockSAPSystemsService struct {
	mock.Mock
}

MockSAPSystemsService is an autogenerated mock type for the SAPSystemsService type

func (*MockSAPSystemsService) GetAllApplications

func (_m *MockSAPSystemsService) GetAllApplications(filter *SAPSystemFilter, page *Page) (models.SAPSystemList, error)

GetAllApplications provides a mock function with given fields: filter, page

func (*MockSAPSystemsService) GetAllApplicationsSIDs

func (_m *MockSAPSystemsService) GetAllApplicationsSIDs() ([]string, error)

GetAllApplicationsSIDs provides a mock function with given fields:

func (*MockSAPSystemsService) GetAllApplicationsTags

func (_m *MockSAPSystemsService) GetAllApplicationsTags() ([]string, error)

GetAllApplicationsTags provides a mock function with given fields:

func (*MockSAPSystemsService) GetAllDatabases

func (_m *MockSAPSystemsService) GetAllDatabases(filter *SAPSystemFilter, page *Page) (models.SAPSystemList, error)

GetAllDatabases provides a mock function with given fields: filter, page

func (*MockSAPSystemsService) GetAllDatabasesSIDs

func (_m *MockSAPSystemsService) GetAllDatabasesSIDs() ([]string, error)

GetAllDatabasesSIDs provides a mock function with given fields:

func (*MockSAPSystemsService) GetAllDatabasesTags

func (_m *MockSAPSystemsService) GetAllDatabasesTags() ([]string, error)

GetAllDatabasesTags provides a mock function with given fields:

func (*MockSAPSystemsService) GetApplicationsCount

func (_m *MockSAPSystemsService) GetApplicationsCount() (int, error)

GetApplicationsCount provides a mock function with given fields:

func (*MockSAPSystemsService) GetByID

func (_m *MockSAPSystemsService) GetByID(ID string) (*models.SAPSystem, error)

GetByID provides a mock function with given fields: ID

func (*MockSAPSystemsService) GetDatabasesCount

func (_m *MockSAPSystemsService) GetDatabasesCount() (int, error)

GetDatabasesCount provides a mock function with given fields:

type MockSettingsService

type MockSettingsService struct {
	mock.Mock
}

MockSettingsService is an autogenerated mock type for the SettingsService type

func (*MockSettingsService) AcceptEula

func (_m *MockSettingsService) AcceptEula() error

AcceptEula provides a mock function with given fields:

func (*MockSettingsService) InitializeIdentifier

func (_m *MockSettingsService) InitializeIdentifier() (uuid.UUID, error)

InitializeIdentifier provides a mock function with given fields:

func (*MockSettingsService) IsEulaAccepted

func (_m *MockSettingsService) IsEulaAccepted() (bool, error)

IsEulaAccepted provides a mock function with given fields:

type MockSubscriptionsService

type MockSubscriptionsService struct {
	mock.Mock
}

MockSubscriptionsService is an autogenerated mock type for the SubscriptionsService type

func (*MockSubscriptionsService) GetHostSubscriptions

func (_m *MockSubscriptionsService) GetHostSubscriptions(host string) ([]*models.SlesSubscription, error)

GetHostSubscriptions provides a mock function with given fields: host

func (*MockSubscriptionsService) GetPremiumData

func (_m *MockSubscriptionsService) GetPremiumData() (*models.PremiumData, error)

GetPremiumData provides a mock function with given fields:

func (*MockSubscriptionsService) IsTrentoPremium

func (_m *MockSubscriptionsService) IsTrentoPremium() (bool, error)

IsTrentoPremium provides a mock function with given fields:

type MockTagsService

type MockTagsService struct {
	mock.Mock
}

MockTagsService is an autogenerated mock type for the TagsService type

func (*MockTagsService) Create

func (_m *MockTagsService) Create(value string, resourceType string, resourceId string) error

Create provides a mock function with given fields: value, resourceType, resourceId

func (*MockTagsService) Delete

func (_m *MockTagsService) Delete(value string, resourceType string, resourceId string) error

Delete provides a mock function with given fields: value, resourceType, resourceId

func (*MockTagsService) GetAll

func (_m *MockTagsService) GetAll(resourceTypeFilter ...string) ([]string, error)

GetAll provides a mock function with given fields: resourceTypeFilter

func (*MockTagsService) GetAllByResource

func (_m *MockTagsService) GetAllByResource(resourceType string, resourceId string) ([]string, error)

GetAllByResource provides a mock function with given fields: resourceType, resourceId

type Page

type Page struct {
	Number int
	Size   int
}

type PremiumDetectionService

type PremiumDetectionService interface {
	RequiresEulaAcceptance() (bool, error)
	CanPublishTelemetry() (bool, error)
	IsPremiumActive() (bool, error)
}

type PrometheusService

type PrometheusService interface {
	GetHttpSDTargets() (models.PrometheusTargetsList, error)
	Query(query string, ts time.Time) (prometheusModel.Value, error)
}

type SAPSystemFilter

type SAPSystemFilter struct {
	Tags []string
	SIDs []string
}

type SAPSystemsService

type SAPSystemsService interface {
	GetAllApplications(filter *SAPSystemFilter, page *Page) (models.SAPSystemList, error)
	GetAllDatabases(filter *SAPSystemFilter, page *Page) (models.SAPSystemList, error)
	GetByID(ID string) (*models.SAPSystem, error)
	GetApplicationsCount() (int, error)
	GetDatabasesCount() (int, error)
	GetAllApplicationsSIDs() ([]string, error)
	GetAllDatabasesSIDs() ([]string, error)
	GetAllApplicationsTags() ([]string, error)
	GetAllDatabasesTags() ([]string, error)
}

type SettingsService

type SettingsService interface {
	InitializeIdentifier() (uuid.UUID, error)
	IsEulaAccepted() (bool, error)
	AcceptEula() error
}

func NewSettingsService

func NewSettingsService(db *gorm.DB) SettingsService

type SubscriptionsService

type SubscriptionsService interface {
	IsTrentoPremium() (bool, error)
	GetPremiumData() (*models.PremiumData, error)
	GetHostSubscriptions(host string) ([]*models.SlesSubscription, error)
}

type TagsService

type TagsService interface {
	GetAll(resourceTypeFilter ...string) ([]string, error)
	GetAllByResource(resourceType string, resourceId string) ([]string, error)
	Create(value string, resourceType string, resourceId string) error
	Delete(value string, resourceType string, resourceId string) error
}

Jump to

Keyboard shortcuts

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