Documentation ¶
Index ¶
- Constants
- Variables
- func ArtifactsByCheck(ctx context.Context, checkID uuid.UUID, checkTime time.Time) ([]models.Artifact, error)
- func ArtifactsByPlaybookRun(ctx context.Context, runID uuid.UUID) ([]models.Artifact, error)
- func CheckSummary(ctx context.Context, opts ...CheckSummaryOptions) ([]models.CheckSummary, error)
- func CheckSummaryByID(ctx context.Context, checkID string) (*models.CheckSummary, error)
- func ComponentFromCache(ctx context.Context, id string) (models.Component, error)
- func ConfigIDsByTypeFromCache(ctx context.Context, id, typ string) ([]string, error)
- func ConfigItemFromCache(ctx context.Context, id string) (models.ConfigItem, error)
- func ConfigRelationsFromCache(ctx context.Context, id string) ([]string, error)
- func ConfigSummary(ctx context.Context, req ConfigSummaryRequest) (types.JSON, error)
- func FindAgent(ctx context.Context, name string) (*models.Agent, error)
- func FindCachedAgent(ctx context.Context, identifier string) (*models.Agent, error)
- func FindCachedCanary(ctx context.Context, id string) (*models.Canary, error)
- func FindCachedCheck(ctx context.Context, id string) (*models.Check, error)
- func FindCheckIDs(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]uuid.UUID, error)
- func FindChecks(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]models.Check, error)
- func FindComponentIDs(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]uuid.UUID, error)
- func FindComponents(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]models.Component, error)
- func FindConfig(ctx context.Context, query types.ConfigQuery) (*models.ConfigItem, error)
- func FindConfigForComponent(ctx context.Context, componentID, configType string) ([]models.ConfigItem, error)
- func FindConfigIDs(ctx context.Context, config types.ConfigQuery) ([]uuid.UUID, error)
- func FindConfigIDsByResourceSelector(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]uuid.UUID, error)
- func FindConfigs(ctx context.Context, config types.ConfigQuery) ([]models.ConfigItem, error)
- func FindConfigsByResourceSelector(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]models.ConfigItem, error)
- func FindPerson(ctx context.Context, identifier string, opts ...GetterOption) (*models.Person, error)
- func FindTeam(ctx context.Context, identifier string, opts ...GetterOption) (*models.Team, error)
- func FlushComponentCache(ctx context.Context) error
- func FlushConfigCache(ctx context.Context) error
- func FlushGettersCache()
- func FlushTopologyCache()
- func GetAllResourceIDsOfAgent(ctx context.Context, table, from string, size int, agentID uuid.UUID) ([]string, error)
- func GetCachedComponent(ctx context.Context, id string) (*models.Component, error)
- func GetCachedConfig(ctx context.Context, id string) (*models.ConfigItem, error)
- func GetCachedIncident(ctx context.Context, id string) (*models.Incident, error)
- func GetChecksByIDs(ctx context.Context, ids []uuid.UUID) ([]models.Check, error)
- func GetComponent(ctx context.Context, id string) (*models.Component, error)
- func GetComponentsByIDs(ctx context.Context, ids []uuid.UUID) ([]models.Component, error)
- func GetConfigsByIDs(ctx context.Context, ids []uuid.UUID) ([]models.ConfigItem, error)
- func ParseFilteringQuery(query string) (in []interface{}, notIN []interface{}, prefix, suffix []string)
- func SortComponentsByField(c models.Components, sortBy TopologyQuerySortBy, asc bool)
- func SyncComponentCache(ctx context.Context) error
- func SyncConfigCache(ctx context.Context) error
- func TraverseConfig(ctx context.Context, configID, relationType, direction string) []models.ConfigItem
- type CatalogChangesSearchRequest
- type CatalogChangesSearchResponse
- type CheckQueryParams
- func (q CheckQueryParams) ExecuteDetails(ctx context.Context) ([]Timeseries, types.Uptime, types.Latency, error)
- func (q CheckQueryParams) GetEndTime() *time.Time
- func (q CheckQueryParams) GetStartTime() *time.Time
- func (q CheckQueryParams) GetWhereClause() (string, map[string]interface{}, error)
- func (q *CheckQueryParams) Init(queryParams url.Values) error
- func (q CheckQueryParams) String() string
- func (q *CheckQueryParams) Validate() error
- type CheckSummaryOptions
- type CheckSummarySortBy
- type ConfigChangeRow
- type ConfigSummaryRequest
- type ConfigSummaryRequestAnalysis
- type ConfigSummaryRequestChanges
- type GetterOption
- type GetterOptions
- type SearchResourcesRequest
- type SearchResourcesResponse
- type SelectedResource
- type Tags
- type Timeseries
- type TopologyOptions
- type TopologyQuerySortBy
- type TopologyResponse
Constants ¶
View Source
const ( CatalogChangeRecursiveUpstream = "upstream" CatalogChangeRecursiveDownstream = "downstream" CatalogChangeRecursiveAll = "all" )
View Source
const DefaultDepth = 5
Variables ¶
View Source
var (
// Default search window
DefaultCheckQueryWindow = "1h"
)
View Source
var DefaultQueryTimeout = 30 * time.Second
View Source
var LocalFilter = "deleted_at is NULL AND agent_id = '00000000-0000-0000-0000-000000000000' OR agent_id IS NULL"
View Source
var SyncComponentCacheJob = &job.Job{ Name: "SyncComponentCache", Schedule: "@every 5m", JobHistory: true, Retention: job.RetentionFew, Fn: func(ctx job.JobRuntime) error { return SyncComponentCache(ctx.Context) }, }
View Source
var SyncConfigCacheJob = &job.Job{ Name: "SyncConfigCache", Schedule: "@every 5m", JobHistory: true, Retention: job.RetentionFew, Fn: func(ctx job.JobRuntime) error { return SyncConfigCache(ctx.Context) }, }
Functions ¶
func ArtifactsByCheck ¶ added in v1.0.225
func ArtifactsByPlaybookRun ¶ added in v1.0.225
func CheckSummary ¶
func CheckSummary(ctx context.Context, opts ...CheckSummaryOptions) ([]models.CheckSummary, error)
func CheckSummaryByID ¶
func ComponentFromCache ¶ added in v1.0.324
func ConfigIDsByTypeFromCache ¶ added in v1.0.318
func ConfigItemFromCache ¶ added in v1.0.318
func ConfigRelationsFromCache ¶ added in v1.0.318
func ConfigSummary ¶ added in v1.0.421
func FindCachedAgent ¶ added in v1.0.324
func FindCachedCanary ¶ added in v1.0.324
func FindCachedCheck ¶ added in v1.0.324
func FindCheckIDs ¶ added in v1.0.324
func FindChecks ¶ added in v1.0.324
func FindComponentIDs ¶ added in v1.0.324
func FindComponents ¶ added in v1.0.324
func FindConfig ¶ added in v1.0.253
func FindConfig(ctx context.Context, query types.ConfigQuery) (*models.ConfigItem, error)
func FindConfigForComponent ¶ added in v1.0.253
func FindConfigIDs ¶ added in v1.0.294
func FindConfigIDsByResourceSelector ¶ added in v1.0.324
func FindConfigs ¶ added in v1.0.254
func FindConfigs(ctx context.Context, config types.ConfigQuery) ([]models.ConfigItem, error)
func FindConfigsByResourceSelector ¶ added in v1.0.324
func FindConfigsByResourceSelector(ctx context.Context, resourceSelectors ...types.ResourceSelector) ([]models.ConfigItem, error)
func FindPerson ¶ added in v1.0.324
func FindPerson(ctx context.Context, identifier string, opts ...GetterOption) (*models.Person, error)
FindPerson looks up a person by the given identifier which can either be
- UUID
func FindTeam ¶ added in v1.0.324
FindTeam looks up a team by the given identifier which can either be
- UUID
- team name
func FlushComponentCache ¶ added in v1.0.330
func FlushConfigCache ¶ added in v1.0.330
func FlushGettersCache ¶ added in v1.0.327
func FlushGettersCache()
func FlushTopologyCache ¶ added in v1.0.414
func FlushTopologyCache()
func GetAllResourceIDsOfAgent ¶ added in v1.0.274
func GetCachedComponent ¶ added in v1.0.324
func GetCachedConfig ¶ added in v1.0.324
func GetCachedIncident ¶ added in v1.0.324
func GetChecksByIDs ¶ added in v1.0.324
func GetComponentsByIDs ¶ added in v1.0.324
func GetConfigsByIDs ¶ added in v1.0.324
func ParseFilteringQuery ¶ added in v1.0.376
func ParseFilteringQuery(query string) (in []interface{}, notIN []interface{}, prefix, suffix []string)
ParseFilteringQuery parses a filtering query string. It returns four slices: 'in', 'notIN', 'prefix', and 'suffix'.
func SortComponentsByField ¶ added in v1.0.427
func SortComponentsByField(c models.Components, sortBy TopologyQuerySortBy, asc bool)
func SyncComponentCache ¶ added in v1.0.324
func SyncConfigCache ¶ added in v1.0.318
func TraverseConfig ¶ added in v1.0.318
func TraverseConfig(ctx context.Context, configID, relationType, direction string) []models.ConfigItem
Types ¶
type CatalogChangesSearchRequest ¶ added in v1.0.373
type CatalogChangesSearchRequest struct { CatalogID string `query:"id"` ConfigType string `query:"config_type"` ChangeType string `query:"type"` Severity string `query:"severity"` IncludeDeletedConfigs bool `query:"include_deleted_configs"` Depth int `query:"depth"` CreatedByRaw string `query:"created_by"` Summary string `query:"summary"` Tags string `query:"tags"` // From date in datemath format From string `query:"from"` // To date in datemath format To string `query:"to"` PageSize int `query:"page_size"` Page int `query:"page"` SortBy string `query:"sort_by"` // upstream | downstream | both Recursive string `query:"recursive"` // contains filtered or unexported fields }
func (*CatalogChangesSearchRequest) SetDefaults ¶ added in v1.0.379
func (t *CatalogChangesSearchRequest) SetDefaults()
func (CatalogChangesSearchRequest) String ¶ added in v1.0.385
func (t CatalogChangesSearchRequest) String() string
func (*CatalogChangesSearchRequest) Validate ¶ added in v1.0.373
func (t *CatalogChangesSearchRequest) Validate() error
type CatalogChangesSearchResponse ¶ added in v1.0.373
type CatalogChangesSearchResponse struct { Summary map[string]int `json:"summary,omitempty"` Total int64 `json:"total,omitempty"` Changes []ConfigChangeRow `json:"changes,omitempty"` }
func FindCatalogChanges ¶ added in v1.0.373
func FindCatalogChanges(ctx context.Context, req CatalogChangesSearchRequest) (*CatalogChangesSearchResponse, error)
func (*CatalogChangesSearchResponse) Summarize ¶ added in v1.0.373
func (t *CatalogChangesSearchResponse) Summarize()
type CheckQueryParams ¶ added in v1.0.260
type CheckQueryParams struct { Check string CanaryID string Start, End string IncludeMessages bool IncludeDetails bool StatusCount int Labels map[string]string Trace bool WindowDuration time.Duration // contains filtered or unexported fields }
func (CheckQueryParams) ExecuteDetails ¶ added in v1.0.260
func (q CheckQueryParams) ExecuteDetails(ctx context.Context) ([]Timeseries, types.Uptime, types.Latency, error)
func (CheckQueryParams) GetEndTime ¶ added in v1.0.260
func (q CheckQueryParams) GetEndTime() *time.Time
func (CheckQueryParams) GetStartTime ¶ added in v1.0.260
func (q CheckQueryParams) GetStartTime() *time.Time
func (CheckQueryParams) GetWhereClause ¶ added in v1.0.260
func (q CheckQueryParams) GetWhereClause() (string, map[string]interface{}, error)
func (*CheckQueryParams) Init ¶ added in v1.0.260
func (q *CheckQueryParams) Init(queryParams url.Values) error
func (CheckQueryParams) String ¶ added in v1.0.260
func (q CheckQueryParams) String() string
func (*CheckQueryParams) Validate ¶ added in v1.0.260
func (q *CheckQueryParams) Validate() error
type CheckSummaryOptions ¶
type CheckSummaryOptions struct { Timeout time.Duration CheckID *uuid.UUID SortBy CheckSummarySortBy DeleteFrom *time.Time // Labels apply to both the canary and check labels Labels map[string]string }
func OrderByName ¶
func OrderByName() CheckSummaryOptions
type CheckSummarySortBy ¶
type CheckSummarySortBy string
var CheckSummarySortByName CheckSummarySortBy = "name"
type ConfigChangeRow ¶ added in v1.0.379
type ConfigChangeRow struct { ExternalChangeId string `gorm:"column:external_change_id" json:"external_change_id"` ID string `gorm:"primaryKey;unique_index;not null;column:id" json:"id"` ConfigID string `gorm:"column:config_id;default:''" json:"config_id"` ChangeType string `gorm:"column:change_type" json:"change_type" faker:"oneof: RunInstances, diff"` Severity string `gorm:"column:severity" json:"severity" faker:"oneof: critical, high, medium, low, info"` Source string `gorm:"column:source" json:"source"` Summary string `gorm:"column:summary;default:null" json:"summary,omitempty"` CreatedAt *time.Time `gorm:"column:created_at" json:"created_at"` ConfigName string `gorm:"column:name" json:"name,omitempty"` ConfigType string `gorm:"column:type" json:"type,omitempty"` CreatedBy *uuid.UUID `gorm:"column:created_by" json:"created_by,omitempty"` ExternalCreatedBy string `gorm:"column:external_created_by" json:"external_created_by,omitempty"` }
type ConfigSummaryRequest ¶ added in v1.0.421
type ConfigSummaryRequest struct { Changes ConfigSummaryRequestChanges `json:"changes"` Analysis ConfigSummaryRequestAnalysis `json:"analysis"` Cost string `json:"cost"` Deleted bool `json:"deleted"` Filter map[string]string `json:"filter"` // Filter by labels GroupBy []string `json:"groupBy"` Tags []string `json:"tags"` Status string `json:"status"` Health string `json:"health"` }
func (*ConfigSummaryRequest) OrderBy ¶ added in v1.0.421
func (t *ConfigSummaryRequest) OrderBy() string
func (*ConfigSummaryRequest) Parse ¶ added in v1.0.421
func (t *ConfigSummaryRequest) Parse() error
func (*ConfigSummaryRequest) SetDefaults ¶ added in v1.0.421
func (t *ConfigSummaryRequest) SetDefaults()
type ConfigSummaryRequestAnalysis ¶ added in v1.0.421
type ConfigSummaryRequestAnalysis struct { Since string `json:"since"` // contains filtered or unexported fields }
type ConfigSummaryRequestChanges ¶ added in v1.0.421
type ConfigSummaryRequestChanges struct { Since string `json:"since"` // contains filtered or unexported fields }
type GetterOption ¶ added in v1.0.324
type GetterOption uint8
const (
GetterOptionNoCache GetterOption = iota + 1
)
type GetterOptions ¶ added in v1.0.324
type GetterOptions []GetterOption
func (GetterOptions) IsSet ¶ added in v1.0.324
func (t GetterOptions) IsSet(option GetterOption) bool
type SearchResourcesRequest ¶ added in v1.0.392
type SearchResourcesRequest struct { Checks []types.ResourceSelector `json:"checks"` Components []types.ResourceSelector `json:"components"` Configs []types.ResourceSelector `json:"configs"` }
type SearchResourcesResponse ¶ added in v1.0.402
type SearchResourcesResponse struct { Checks []SelectedResource `json:"checks,omitempty"` Components []SelectedResource `json:"components,omitempty"` Configs []SelectedResource `json:"configs,omitempty"` }
func SearchResources ¶ added in v1.0.392
func SearchResources(ctx context.Context, req SearchResourcesRequest) (*SearchResourcesResponse, error)
type SelectedResource ¶ added in v1.0.401
type Timeseries ¶ added in v1.0.260
type Timeseries struct { Key string `json:"key,omitempty"` Time string `json:"time,omitempty"` Status bool `json:"status,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Duration int `json:"duration"` // Count is the number of times the check has been run in the specified time window Count int `json:"count,omitempty"` Passed int `json:"passed,omitempty"` Failed int `json:"failed,omitempty"` }
type TopologyOptions ¶
type TopologyOptions struct { ID string Owner string Labels map[string]string AgentID string Flatten bool Depth int // TODO: Filter status and types in DB Query Types []string Status []string SortBy TopologyQuerySortBy SortOrder string NoCache bool // contains filtered or unexported fields }
func (TopologyOptions) CacheKey ¶ added in v1.0.317
func (opt TopologyOptions) CacheKey() string
func (TopologyOptions) String ¶
func (opt TopologyOptions) String() string
type TopologyQuerySortBy ¶ added in v1.0.298
type TopologyQuerySortBy string
const ( TopologyQuerySortByName TopologyQuerySortBy = "name" TopologyQuerySortByField TopologyQuerySortBy = "field:" )
type TopologyResponse ¶
type TopologyResponse struct { Components models.Components `json:"components"` HealthStatuses []string `json:"healthStatuses"` Teams []string `json:"teams"` Tags Tags `json:"tags"` Types []string `json:"types"` }
func Topology ¶
func Topology(ctx context.Context, params TopologyOptions) (*TopologyResponse, error)
Click to show internal directories.
Click to hide internal directories.