Documentation
¶
Index ¶
- func IsNotFound(err error) bool
- type APIResponse
- type Alert
- type AlertChannel
- type AlertSilenced
- type Client
- func (c *Client) CreateAlert(ctx context.Context, alert Alert) (*Alert, error)
- func (c *Client) CreateDashboard(ctx context.Context, dashboard Dashboard) (*Dashboard, error)
- func (c *Client) CreateSavedSearch(ctx context.Context, search SavedSearch) (*SavedSearch, error)
- func (c *Client) DeleteAlert(ctx context.Context, id string) error
- func (c *Client) DeleteDashboard(ctx context.Context, id string) error
- func (c *Client) DeleteSavedSearch(ctx context.Context, id string) error
- func (c *Client) GetAlert(ctx context.Context, id string) (*Alert, error)
- func (c *Client) GetDashboard(ctx context.Context, id string) (*Dashboard, error)
- func (c *Client) GetSavedSearch(ctx context.Context, id string) (*SavedSearch, error)
- func (c *Client) ListAlerts(ctx context.Context) ([]Alert, error)
- func (c *Client) ListDashboards(ctx context.Context) ([]Dashboard, error)
- func (c *Client) ListSavedSearches(ctx context.Context) ([]SavedSearch, error)
- func (c *Client) ListSources(ctx context.Context) ([]Source, error)
- func (c *Client) ListWebhooks(ctx context.Context) ([]Webhook, error)
- func (c *Client) UpdateAlert(ctx context.Context, id string, alert Alert) (*Alert, error)
- func (c *Client) UpdateDashboard(ctx context.Context, id string, dashboard Dashboard) (*Dashboard, error)
- func (c *Client) UpdateSavedSearch(ctx context.Context, id string, search SavedSearch) (*SavedSearch, error)
- type Dashboard
- type Filter
- type NotFoundError
- type SavedFilterValue
- type SavedSearch
- type SavedSearchFilter
- type Source
- type Tile
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type APIResponse ¶
type APIResponse[T any] struct { Status int `json:"status"` RequestID string `json:"requestId"` Result T `json:"result"` Error string `json:"error,omitempty"` }
APIResponse is the ClickHouse Cloud API envelope.
type Alert ¶
type Alert struct {
ID string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Message *string `json:"message,omitempty"`
Source string `json:"source"`
Threshold float64 `json:"threshold"`
ThresholdType string `json:"thresholdType"`
Interval string `json:"interval"`
NumConsecutiveWindows *int64 `json:"numConsecutiveWindows,omitempty"`
Channel AlertChannel `json:"channel"`
DashboardID *string `json:"dashboardId,omitempty"`
TileID *string `json:"tileId,omitempty"`
SavedSearchID *string `json:"savedSearchId,omitempty"`
GroupBy *string `json:"groupBy,omitempty"`
ScheduleOffsetMinutes *int `json:"scheduleOffsetMinutes,omitempty"`
ScheduleStartAt *string `json:"scheduleStartAt,omitempty"`
State string `json:"state,omitempty"`
TeamID string `json:"teamId,omitempty"`
Silenced *AlertSilenced `json:"silenced,omitempty"`
CreatedAt *string `json:"createdAt,omitempty"`
UpdatedAt *string `json:"updatedAt,omitempty"`
}
Alert represents a ClickStack alert.
type AlertChannel ¶
type AlertChannel struct {
Type string `json:"type"`
// Webhook fields
WebhookID *string `json:"webhookId,omitempty"`
WebhookService *string `json:"webhookService,omitempty"`
SlackChannelID *string `json:"slackChannelId,omitempty"`
Severity *string `json:"severity,omitempty"`
// Email fields
EmailRecipients []string `json:"emailRecipients,omitempty"`
}
AlertChannel represents the notification channel for an alert.
type AlertSilenced ¶
type AlertSilenced struct {
By string `json:"by"`
At string `json:"at"`
Until *string `json:"until,omitempty"`
}
AlertSilenced represents silencing metadata on an alert.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateAlert ¶
func (*Client) CreateDashboard ¶
func (*Client) CreateSavedSearch ¶
func (c *Client) CreateSavedSearch(ctx context.Context, search SavedSearch) (*SavedSearch, error)
func (*Client) DeleteDashboard ¶
func (*Client) DeleteSavedSearch ¶
func (*Client) GetDashboard ¶
func (*Client) GetSavedSearch ¶
func (*Client) ListDashboards ¶
func (*Client) ListSavedSearches ¶
func (c *Client) ListSavedSearches(ctx context.Context) ([]SavedSearch, error)
func (*Client) UpdateAlert ¶
func (*Client) UpdateDashboard ¶
func (*Client) UpdateSavedSearch ¶
func (c *Client) UpdateSavedSearch(ctx context.Context, id string, search SavedSearch) (*SavedSearch, error)
type Dashboard ¶
type Dashboard struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Tiles []Tile `json:"tiles"`
Tags []string `json:"tags,omitempty"`
Filters []Filter `json:"filters,omitempty"`
SavedQuery *string `json:"savedQuery,omitempty"`
SavedQueryLanguage *string `json:"savedQueryLanguage,omitempty"`
SavedFilterValues []SavedFilterValue `json:"savedFilterValues,omitempty"`
}
Dashboard represents a ClickStack dashboard.
type Filter ¶
type Filter struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Expression string `json:"expression"`
SourceID string `json:"sourceId"`
SourceMetricType *string `json:"sourceMetricType,omitempty"`
}
Filter represents a dashboard-level filter.
type NotFoundError ¶
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type SavedFilterValue ¶
type SavedFilterValue struct {
Condition string `json:"condition"`
Type *string `json:"type,omitempty"`
}
SavedFilterValue represents a persisted filter value on a dashboard.
type SavedSearch ¶
type SavedSearch struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
SourceID string `json:"sourceId"`
Select string `json:"select,omitempty"`
Where string `json:"where,omitempty"`
WhereLanguage string `json:"whereLanguage,omitempty"`
OrderBy string `json:"orderBy,omitempty"`
Tags []string `json:"tags,omitempty"`
Filters []SavedSearchFilter `json:"filters,omitempty"`
TeamID string `json:"teamId,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
SavedSearch represents a ClickStack saved search.
type SavedSearchFilter ¶ added in v0.0.3
type SavedSearchFilter struct {
Type string `json:"type,omitempty"`
Condition string `json:"condition"`
}
SavedSearchFilter represents a SQL predicate pinned to a saved search.
type Tile ¶
type Tile struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
X int `json:"x"`
Y int `json:"y"`
W int `json:"w"`
H int `json:"h"`
Config json.RawMessage `json:"config,omitempty"`
Series json.RawMessage `json:"series,omitempty"`
}
Tile represents a dashboard tile.
type Webhook ¶
type Webhook struct {
ID string `json:"id"`
Name string `json:"name"`
Service string `json:"service"`
URL string `json:"url"`
Description *string `json:"description,omitempty"`
CreatedAt *string `json:"createdAt,omitempty"`
UpdatedAt *string `json:"updatedAt,omitempty"`
}
Webhook represents a ClickStack webhook (read-only).
Click to show internal directories.
Click to hide internal directories.