Documentation ¶
Index ¶
- Constants
- Variables
- func AddCheckStatuses(ctx context.Context, ids []string, status models.CheckHealthStatus) error
- func CleanupCanaries()
- func CleanupChecks()
- func Connect() error
- 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 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, excludeTypes ...string) ([]string, error)
- func GoOffline() error
- func Init() error
- func IsConfigured() bool
- func IsConnected() bool
- func LatestCheckStatus(ctx context.Context, checkID string) (*models.CheckStatus, error)
- 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 RemoveTransformedChecks(ctx context.Context, ids []string) error
- func SaveCheckConfigRelationship(ctx context.Context, relationship *models.CheckConfigRelationship) error
- func Start(ctx context.Context) error
- func StartPostgrest()
- func StopServer() error
- func SuspendCanary(ctx context.Context, id string, suspend bool) error
- func UpdateComponentCosts() error
- func UpdateStatusAndSummaryForComponent(id uuid.UUID, status types.ComponentStatus, summary types.Summary) (int64, error)
- type ConfigComponentRelationship
Constants ¶
View Source
const ( DefaultCheckRetentionDays = 7 DefaultCanaryRetentionDays = 7 )
View Source
const CheckStatuses = "check_statuses"
Variables ¶
View Source
var ( CheckRetentionDays int CanaryRetentionDays int )
View Source
var AggregateCheckStatues1d = job.Job{ Name: "AggregateCheckStatuses1h", Schedule: "@every 1h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses err, count := job.AggregateCheckStatus1h(ctx.Context) ctx.History.SuccessCount = count return err }, }
View Source
var AggregateCheckStatues1h = job.Job{ Name: "AggregateCheckStatuses1d", Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses err, count := job.AggregateCheckStatus1d(ctx.Context) ctx.History.SuccessCount = count return err }, }
View Source
var CheckStatusJobs = []job.Job{ AggregateCheckStatues1d, AggregateCheckStatues1h, DeleteOldCheckStatues, DeleteOldCheckStatues1h, DeleteOldCheckStatues1d, RefreshCheckStatusSummary, RefreshCheckStatusSummaryAged, }
View Source
var (
CheckStatusRetention = 60
)
View Source
var ConnectionString string
View Source
var DBMetrics bool
View Source
var DefaultExpiryDays int
View Source
var DeleteOldCheckStatues = job.Job{ Name: "DeleteOldCheckStatuses", Singleton: true, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses err, count := job.DeleteOldCheckStatuses1h(ctx.Context, CheckStatusRetention*3) ctx.History.SuccessCount = count return err }, }
View Source
var DeleteOldCheckStatues1d = job.Job{ Name: "DeleteOldCheckStatuses1d", Singleton: true, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses err, count := job.DeleteOldCheckStatuses1d(ctx.Context, CheckStatusRetention*9) ctx.History.SuccessCount = count return err }, }
View Source
var DeleteOldCheckStatues1h = job.Job{ Name: "DeleteOldCheckStatuses1h", Singleton: true, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses err, count := job.DeleteOldCheckStatuses1h(ctx.Context, CheckStatusRetention*3) ctx.History.SuccessCount = count return err }, }
View Source
var Gorm *gorm.DB
View Source
var HTTPEndpoint = "http://localhost:8080/db"
View Source
var Pool *pgxpool.Pool
View Source
var PostgRESTServerPort = 3000
View Source
var PostgRESTVersion = "v9.0.0"
View Source
var (
PostgresDuplicateKeyError = &pgconn.PgError{Code: "23505"}
)
View Source
var PostgresServer *embeddedpostgres.EmbeddedPostgres
View Source
var RefreshCheckStatusSummary = job.Job{ Name: "RefreshCheckStatusSummary", Singleton: true, Timeout: 1 * time.Minute, Schedule: "@every 1m", JobHistory: true, Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses return job.RefreshCheckStatusSummary(ctx.Context) }, }
View Source
var RefreshCheckStatusSummaryAged = job.Job{ Name: "RefreshCheckStatusSummaryAged", Timeout: 60 * time.Minute, Schedule: "@every 1h", Singleton: true, JobHistory: true, Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses return job.RefreshCheckStatusSummaryAged(ctx.Context) }, }
View Source
var RunMigrations bool
Functions ¶
func AddCheckStatuses ¶ added in v1.0.10
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 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 LatestCheckStatus ¶ added in v1.0.124
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 RemoveTransformedChecks ¶ added in v1.0.10
func SaveCheckConfigRelationship ¶ added in v1.0.129
func SaveCheckConfigRelationship(ctx context.Context, relationship *models.CheckConfigRelationship) error
func StartPostgrest ¶ added in v0.38.137
func StartPostgrest()
func StopServer ¶ added in v0.38.83
func StopServer() error
func SuspendCanary ¶ added in v1.0.125
SuspendCanary sets the suspend annotation on the canary table.
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.