Documentation ¶
Index ¶
- Constants
- Variables
- func AddCheckStatuses(ctx context.Context, ids []string, status models.CheckHealthStatus) error
- func AggregateCheckStatuses1d()
- func AggregateCheckStatuses1h()
- func CleanupCanaries()
- func CleanupChecks()
- func CreateCanary(canary *pkg.Canary) error
- func CreateCheck(canary pkg.Canary, check *pkg.Check) error
- func CreateComponentCanaryFromInline(id, name, namespace, schedule, owner string, spec *v1.CanarySpec) (*pkg.Canary, error)
- func DeleteAllOldCheckStatuses()
- func DeleteCanary(id string, deleteTime time.Time) error
- func DeleteCheckComponentRelationshipsForCanary(id string, deleteTime time.Time) error
- func DeleteChecksForCanary(id string, deleteTime time.Time) ([]string, error)
- func DeleteComponentChildren(componentID string, deleteTime time.Time) error
- func DeleteComponentRelationship(componentID string, deleteTime time.Time) error
- func DeleteComponentsOfTopology(topologyID string, deleteTime time.Time) error
- func DeleteComponentsWithIDs(compIDs []string, deleteTime time.Time) error
- func DeleteConfigRelationshipForComponent(componentID uuid.UUID, deleteTime time.Time) error
- func DeleteInlineCanariesForComponent(componentID string, deleteTime time.Time) error
- func DeleteNonTransformedChecks(id []string) error
- func DeleteTopology(t *v1.Topology) error
- func FindCanary(namespace, name string) (*pkg.Canary, error)
- func FindCanaryByID(id string) (*pkg.Canary, error)
- func FindCheck(canary pkg.Canary, name string) (*pkg.Check, error)
- func FindChecks(ctx context.Context, idOrName, checkType string) ([]models.Check, error)
- func FindConfig(config pkg.Config) (*pkg.Config, error)
- func FindConfigForComponent(componentID, configType string) ([]pkg.Config, error)
- func FindDeletedChecksSince(ctx context.Context, since time.Time) ([]string, error)
- func GetActiveComponentsIDsOfTopology(topologyID string) (compIDs []uuid.UUID, err error)
- func GetAllActiveChecksForCanary(canaryID uuid.UUID) (checks pkg.Checks, err error)
- func GetAllCanariesForSync(ctx context.Context, namespace string) ([]pkg.Canary, error)
- func GetAllChecksForCanary(canaryID uuid.UUID) (checks pkg.Checks, err error)
- func GetAllComponentWithCanaries() (components pkg.Components, err error)
- func GetAllComponentsWithConfigs() (components pkg.Components, err error)
- func GetAllComponentsWithSelectors() (components pkg.Components, err error)
- func GetAllTopologiesForSync() ([]v1.Topology, error)
- func GetCanary(id string) (pkg.Canary, error)
- func GetCheck(id string) (*pkg.Check, error)
- func GetCheckRelationshipsForComponent(componentID uuid.UUID) ([]pkg.CheckComponentRelationship, error)
- func GetChecksWithLabelSelector(labelSelector string) (selectedChecks pkg.Checks, err error)
- func GetChildRelationshipsForParentComponent(componentID uuid.UUID) ([]pkg.ComponentRelationship, error)
- func GetComponentsWithFieldSelector(fieldSelector string) (components pkg.Components, err error)
- func GetComponentsWithLabelSelector(labelSelector string) (components pkg.Components, err error)
- func GetComponentsWithSelectors(resourceSelectors v1.ResourceSelectors) (components pkg.Components, err error)
- func GetDB() (*sql.DB, error)
- func GetLabelsFromSelector(selector string) (matchLabels map[string]string)
- func GetTopology(ctx context.Context, id string) (*v1.Topology, error)
- func GetTransformedCheckIDs(ctx context.Context, canaryID string) ([]string, error)
- func GoOffline() error
- func Init() error
- func IsConfigured() bool
- func IsConnected() bool
- func NewComponentRelationships(relationshipID uuid.UUID, path string, components pkg.Components) (relationships []*pkg.ComponentRelationship, err error)
- func PersistCanary(canary v1.Canary, source string) (*pkg.Canary, error)
- func PersistCanaryModel(model pkg.Canary) (*pkg.Canary, error)
- func PersistCheck(check pkg.Check, canaryID uuid.UUID) (uuid.UUID, error)
- func PersistCheckComponentRelationship(relationship *pkg.CheckComponentRelationship) error
- func PersistComponent(component *pkg.Component) ([]uuid.UUID, error)
- func PersistComponentRelationships(relationships []*pkg.ComponentRelationship) error
- func PersistComponents(results []*pkg.Component) error
- func PersistConfigComponentRelationship(configID, componentID uuid.UUID, selectorID string) error
- func PersistJobHistory(h *models.JobHistory) error
- func PersistTopology(t *v1.Topology) (bool, error)
- func PostgRESTEndpoint() string
- func RefreshCheckStatusSummary()
- func RemoveTransformedChecks(ctx context.Context, ids []string) error
- func Start(ctx context.Context) error
- func StartPostgrest()
- func StopServer() error
- func UpdateComponentCosts() error
- func UpdateStatusAndSummaryForComponent(id uuid.UUID, status types.ComponentStatus, summary types.Summary) (int64, error)
- type ConfigComponentRelationship
Constants ¶
const ( DefaultCheckRetentionDays = 7 DefaultCanaryRetentionDays = 7 )
const ( DefaultCheckStatusRetentionDays = 60 RetentionDaysFor1hCheckStatusAggregate = 180 RetentionDaysFor1dCheckStatusAggregate = 1000 )
Variables ¶
var ( CheckRetentionDays int CanaryRetentionDays int )
var CheckStatusRetentionDays int
var ConnectionString string
var DBMetrics bool
var DefaultExpiryDays int
var Gorm *gorm.DB
var HTTPEndpoint = "http://localhost:8080/db"
var Pool *pgxpool.Pool
var PostgRESTServerPort = 3000
var PostgRESTVersion = "v9.0.0"
var PostgresServer *embeddedpostgres.EmbeddedPostgres
var RunMigrations bool
Functions ¶
func AddCheckStatuses ¶ added in v1.0.10
func AggregateCheckStatuses1d ¶ added in v0.38.246
func AggregateCheckStatuses1d()
AggregateCheckStatuses aggregates check statuses daily and stores it to the corresponding tables.
func AggregateCheckStatuses1h ¶ added in v0.38.246
func AggregateCheckStatuses1h()
AggregateCheckStatuses aggregates check statuses hourly and stores it to the corresponding tables.
func CleanupCanaries ¶ added in v0.38.332
func CleanupCanaries()
func CleanupChecks ¶ added in v0.38.332
func CleanupChecks()
func CreateCanary ¶ added in v0.38.85
func CreateComponentCanaryFromInline ¶ added in v0.38.151
func DeleteAllOldCheckStatuses ¶ added in v0.38.246
func DeleteAllOldCheckStatuses()
DeleteAllOldCheckStatuses deletes check statuses older than the configured retention period from 3 different tables.
func DeleteCheckComponentRelationshipsForCanary ¶ added in v0.38.151
func DeleteChecksForCanary ¶ added in v0.38.151
func DeleteComponentChildren ¶ added in v0.38.210
func DeleteComponentRelationship ¶ added in v0.38.140
func DeleteComponentsOfTopology ¶ added in v0.38.266
DeleteComponents deletes all components associated with a topology
func DeleteComponentsWithIDs ¶ added in v0.38.125
DeleteComponentsWithID deletes all components with specified ids.
func DeleteConfigRelationshipForComponent ¶ added in v0.38.165
func DeleteInlineCanariesForComponent ¶ added in v0.38.151
func DeleteNonTransformedChecks ¶ added in v1.0.10
func DeleteTopology ¶ added in v0.38.266
func FindChecks ¶ added in v1.0.85
func FindConfigForComponent ¶ added in v0.38.195
func FindDeletedChecksSince ¶ added in v0.38.328
func GetActiveComponentsIDsOfTopology ¶ added in v0.38.266
func GetAllActiveChecksForCanary ¶ added in v0.38.160
returns all the checks associated with canary which are currently executing
func GetAllCanariesForSync ¶ added in v1.0.6
func GetAllChecksForCanary ¶ added in v0.38.151
returns all the checks associated with canary.
func GetAllComponentWithCanaries ¶ added in v0.38.151
func GetAllComponentWithCanaries() (components pkg.Components, err error)
func GetAllComponentsWithConfigs ¶ added in v0.38.172
func GetAllComponentsWithConfigs() (components pkg.Components, err error)
func GetAllComponentsWithSelectors ¶ added in v0.38.198
func GetAllComponentsWithSelectors() (components pkg.Components, err error)
Get all the components from table which has not null selectors
func GetAllTopologiesForSync ¶ added in v1.0.6
func GetCheckRelationshipsForComponent ¶ added in v0.38.181
func GetCheckRelationshipsForComponent(componentID uuid.UUID) ([]pkg.CheckComponentRelationship, error)
func GetChecksWithLabelSelector ¶ added in v0.38.151
func GetChildRelationshipsForParentComponent ¶ added in v0.38.181
func GetChildRelationshipsForParentComponent(componentID uuid.UUID) ([]pkg.ComponentRelationship, error)
func GetComponentsWithFieldSelector ¶ added in v0.38.198
func GetComponentsWithFieldSelector(fieldSelector string) (components pkg.Components, err error)
func GetComponentsWithLabelSelector ¶ added in v0.38.198
func GetComponentsWithLabelSelector(labelSelector string) (components pkg.Components, err error)
func GetComponentsWithSelectors ¶ added in v0.38.151
func GetComponentsWithSelectors(resourceSelectors v1.ResourceSelectors) (components pkg.Components, err error)
func GetLabelsFromSelector ¶ added in v0.38.114
func GetTopology ¶ added in v0.38.266
func GetTransformedCheckIDs ¶ added in v0.38.260
func IsConfigured ¶ added in v0.38.85
func IsConfigured() bool
func IsConnected ¶ added in v0.38.85
func IsConnected() bool
func NewComponentRelationships ¶ added in v0.38.181
func NewComponentRelationships(relationshipID uuid.UUID, path string, components pkg.Components) (relationships []*pkg.ComponentRelationship, err error)
func PersistCanary ¶ added in v0.38.85
func PersistCanaryModel ¶ added in v1.0.26
func PersistCheck ¶ added in v0.38.85
func PersistCheckComponentRelationship ¶ added in v0.38.151
func PersistCheckComponentRelationship(relationship *pkg.CheckComponentRelationship) error
func PersistComponent ¶ added in v0.38.85
TODO: Simplify logic and improve readability
func PersistComponentRelationships ¶ added in v0.38.151
func PersistComponentRelationships(relationships []*pkg.ComponentRelationship) error
func PersistComponents ¶ added in v0.38.135
func PersistConfigComponentRelationship ¶ added in v0.38.165
func PersistJobHistory ¶ added in v0.38.201
func PersistJobHistory(h *models.JobHistory) error
func PostgRESTEndpoint ¶ added in v0.38.137
func PostgRESTEndpoint() string
func RefreshCheckStatusSummary ¶ added in v0.38.232
func RefreshCheckStatusSummary()
func RemoveTransformedChecks ¶ added in v1.0.10
func StartPostgrest ¶ added in v0.38.137
func StartPostgrest()
func StopServer ¶ added in v0.38.83
func StopServer() error
func UpdateComponentCosts ¶ added in v0.38.199
func UpdateComponentCosts() error
func UpdateStatusAndSummaryForComponent ¶ added in v0.38.146
Types ¶
type ConfigComponentRelationship ¶ added in v0.38.176
type ConfigComponentRelationship struct { ComponentID uuid.UUID ConfigID uuid.UUID SelectorID string DeletedAt *time.Time }
Store entry in config_component_relationship table
func GetConfigRelationshipsForComponent ¶ added in v0.38.165
func GetConfigRelationshipsForComponent(componentID uuid.UUID) ([]ConfigComponentRelationship, error)