Documentation ¶
Index ¶
- Constants
- func NewPushQueueConsumer(config UpstreamConfig) postq.AsyncEventConsumer
- func NewUpstreamReconciler(upstreamConf UpstreamConfig, pageSize int) *upstreamReconciler
- func PushToUpstream(ctx duty.DBContext, config UpstreamConfig, events []postq.Event) []postq.Event
- func SyncCheckStatuses(ctx context.Context, config UpstreamConfig, batchSize int) (error, int)
- type GroupedPushEvents
- type PaginateRequest
- type PaginateResponse
- type PushData
- func (t *PushData) ApplyLabels(labels map[string]string)
- func (p *PushData) Attributes() map[string]any
- func (t *PushData) Count() int
- func (p *PushData) Length() int
- func (t *PushData) PopulateAgentID(id uuid.UUID)
- func (t *PushData) ReplaceTopologyID(id *uuid.UUID)
- func (p *PushData) String() string
- type UpstreamClient
- type UpstreamConfig
Constants ¶
View Source
const EventPushQueueCreate = "push_queue.create"
Variables ¶
This section is empty.
Functions ¶
func NewPushQueueConsumer ¶ added in v1.0.188
func NewPushQueueConsumer(config UpstreamConfig) postq.AsyncEventConsumer
NewPushQueueConsumer creates a new push queue consumer
func NewUpstreamReconciler ¶
func NewUpstreamReconciler(upstreamConf UpstreamConfig, pageSize int) *upstreamReconciler
func PushToUpstream ¶ added in v1.0.188
PushToUpstream fetches records specified in events from this instance and sends them to the upstream instance.
func SyncCheckStatuses ¶ added in v1.0.195
SyncCheckStatuses pushes check statuses, that haven't already been pushed, to upstream.
Types ¶
type GroupedPushEvents ¶ added in v1.0.188
func GroupChangelogsByTables ¶ added in v1.0.188
func GroupChangelogsByTables(events []postq.Event) []GroupedPushEvents
GroupChangelogsByTables groups the given events by the table they belong to.
type PaginateRequest ¶
type PaginateRequest struct { Table string `query:"table"` From string `query:"from"` Size int `query:"size"` }
func (PaginateRequest) String ¶ added in v1.0.259
func (p PaginateRequest) String() string
type PaginateResponse ¶
type PaginateResponse struct { Hash string `gorm:"column:sha256sum"` Next string `gorm:"column:last_id"` Total int `gorm:"column:total"` }
func GetPrimaryKeysHash ¶
func GetPrimaryKeysHash(ctx context.Context, req PaginateRequest, agentID uuid.UUID) (*PaginateResponse, error)
func (PaginateResponse) String ¶ added in v1.0.259
func (p PaginateResponse) String() string
type PushData ¶
type PushData struct { AgentName string `json:"agent_name,omitempty"` Canaries []models.Canary `json:"canaries,omitempty"` Checks []models.Check `json:"checks,omitempty"` Components []models.Component `json:"components,omitempty"` ConfigScrapers []models.ConfigScraper `json:"config_scrapers,omitempty"` ConfigAnalysis []models.ConfigAnalysis `json:"config_analysis,omitempty"` ConfigChanges []models.ConfigChange `json:"config_changes,omitempty"` ConfigItems []models.ConfigItem `json:"config_items,omitempty"` CheckStatuses []models.CheckStatus `json:"check_statuses,omitempty"` ConfigRelationships []models.ConfigRelationship `json:"config_relationships,omitempty"` ComponentRelationships []models.ComponentRelationship `json:"component_relationships,omitempty"` ConfigComponentRelationships []models.ConfigComponentRelationship `json:"config_component_relationships,omitempty"` Topologies []models.Topology `json:"topologies,omitempty"` }
PushData consists of data about changes to components, configs, analysis.
func GetMissingResourceIDs ¶
func (*PushData) ApplyLabels ¶
ApplyLabels injects additional labels to the suitable fields
func (*PushData) Attributes ¶ added in v1.0.205
func (*PushData) PopulateAgentID ¶
PopulateAgentID sets agent_id on all the data
func (*PushData) ReplaceTopologyID ¶
ReplaceTopologyID replaces the topology_id for all the components with the provided id.
type UpstreamClient ¶ added in v1.0.192
func NewUpstreamClient ¶ added in v1.0.192
func NewUpstreamClient(config UpstreamConfig) *UpstreamClient
type UpstreamConfig ¶
type UpstreamConfig struct { AgentName string Host string InsecureSkipVerify bool Username string Password string Labels []string }
func (*UpstreamConfig) IsPartiallyFilled ¶
func (t *UpstreamConfig) IsPartiallyFilled() bool
func (*UpstreamConfig) LabelsMap ¶
func (t *UpstreamConfig) LabelsMap() map[string]string
func (UpstreamConfig) String ¶ added in v1.0.259
func (t UpstreamConfig) String() string
func (*UpstreamConfig) Valid ¶
func (t *UpstreamConfig) Valid() bool
Click to show internal directories.
Click to hide internal directories.