Documentation ¶
Index ¶
- Variables
- func GetPageByTitle(pages []*components.Page, title string) *components.Page
- func WithUser(ctx context.Context, user *AuthenticatedUser) context.Context
- type ApiV1WorkersConnectGETResponse
- type AuthenticatedContext
- type AuthenticatedHandler
- type AuthenticatedPrincipal
- type AuthenticatedUser
- type AuthenticatedWorker
- type BaseHandler
- func (h *BaseHandler) ApiV1WorkersConnectGET(c echo.Context) error
- func (h *BaseHandler) AuthenticateRequestWithCookies(r *http.Request) (*AuthenticatedUser, error)
- func (h *BaseHandler) AuthenticateRequestWithToken(r *http.Request) (*AuthenticatedPrincipal, error)
- func (h *BaseHandler) Authenticated(next echo.HandlerFunc) echo.HandlerFunc
- func (h *BaseHandler) AuthenticatedUserToOAuth2Token(user *AuthenticatedUser) *oauth2.Token
- func (h *BaseHandler) ClearAuthenticatedUserForRequest(w http.ResponseWriter, r *http.Request) error
- func (h *BaseHandler) Error404(c echo.Context) error
- func (h *BaseHandler) Incidents(c echo.Context) error
- func (h *BaseHandler) Index(c echo.Context) error
- func (h *BaseHandler) OAuth2CallbackGET(c echo.Context) error
- func (h *BaseHandler) OAuth2LoginGET(c echo.Context) error
- func (h *BaseHandler) OAuth2LogoutGET(c echo.Context) error
- func (h *BaseHandler) RefreshToken(w http.ResponseWriter, r *http.Request, user *AuthenticatedUser) (*AuthenticatedUser, error)
- func (h *BaseHandler) SetAuthenticatedUserForRequest(w http.ResponseWriter, r *http.Request, user *AuthenticatedUser) error
- func (h *BaseHandler) SettingsChecksCreateGET(c echo.Context) error
- func (h *BaseHandler) SettingsChecksCreatePOST(c echo.Context) error
- func (h *BaseHandler) SettingsChecksDescribeDELETE(c echo.Context) error
- func (h *BaseHandler) SettingsChecksDescribeGET(c echo.Context) error
- func (h *BaseHandler) SettingsChecksDescribePOST(c echo.Context) error
- func (h *BaseHandler) SettingsChecksDisableGET(c echo.Context) error
- func (h *BaseHandler) SettingsChecksEnableGET(c echo.Context) error
- func (h *BaseHandler) SettingsChecksGET(c echo.Context) error
- func (h *BaseHandler) SettingsHomeGET(c echo.Context) error
- func (h *BaseHandler) SettingsHooksCreateGET(c echo.Context) error
- func (h *BaseHandler) SettingsHooksCreatePOST(c echo.Context) error
- func (h *BaseHandler) SettingsHooksDescribeDELETE(c echo.Context) error
- func (h *BaseHandler) SettingsHooksDescribeGET(c echo.Context) error
- func (h *BaseHandler) SettingsHooksDescribePOST(c echo.Context) error
- func (h *BaseHandler) SettingsHooksDisableGET(c echo.Context) error
- func (h *BaseHandler) SettingsHooksEnableGET(c echo.Context) error
- func (h *BaseHandler) SettingsHooksGET(c echo.Context) error
- func (h *BaseHandler) SettingsIncidentsGET(c echo.Context) error
- func (h *BaseHandler) SettingsNotificationsGET(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsCreateGET(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsCreatePOST(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsDescribeDELETE(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsDescribeGET(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsDescribePOST(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsDisableGET(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsEnableGET(c echo.Context) error
- func (h *BaseHandler) SettingsTargetsGET(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersCreateGET(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersCreatePOST(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersDescribeDELETE(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersDescribeGET(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersDescribePOST(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersDisableGET(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersEnableGET(c echo.Context) error
- func (h *BaseHandler) SettingsTriggersGET(c echo.Context) error
- func (h *BaseHandler) SettingsWorkerGroupsCreateGET(c echo.Context) error
- func (h *BaseHandler) SettingsWorkerGroupsCreatePOST(c echo.Context) error
- func (h *BaseHandler) SettingsWorkerGroupsDescribeDELETE(c echo.Context) error
- func (h *BaseHandler) SettingsWorkerGroupsDescribeGET(c echo.Context) error
- func (h *BaseHandler) SettingsWorkerGroupsGET(c echo.Context) error
- func (h *BaseHandler) Temporal(c echo.Context) error
- type CheckWithWorkerGroupsAndState
- type CreateCheck
- type CreateHook
- type CreateTarget
- type CreateTrigger
- type History
- type HistoryItem
- type HistoryItemCheck
- type HistoryOutcome
- type HookWithState
- type Incident
- type IndexData
- type Notification
- type Settings
- type SettingsCheck
- type SettingsCheckCreate
- type SettingsChecks
- type SettingsHome
- type SettingsHook
- type SettingsHookCreate
- type SettingsHooks
- type SettingsIncidents
- type SettingsNotifications
- type SettingsSidebarGroup
- type SettingsTarget
- type SettingsTargetCreate
- type SettingsTargets
- type SettingsTrigger
- type SettingsTriggerCreate
- type SettingsTriggers
- type SettingsWorker
- type SettingsWorkerGroups
- type Target
- type TargetsAndStatus
- type TriggerWithState
- type UpdateCheck
- type UpdateHook
- type UpdateTarget
- type UpdateTrigger
- type UserInfo
- type WorkerGroupWithActiveWorkers
- type WorkerWithTokenAndActiveWorkers
Constants ¶
This section is empty.
Variables ¶
View Source
var Pages = []*components.Page{
{Path: "/", Title: "Status", Breadcrumb: "Status"},
{Path: "/incidents", Title: "Incidents", Breadcrumb: "Incidents"},
{Path: "/settings", Title: "Settings", Breadcrumb: "Settings"},
}
View Source
var SettingsPages = []*components.Page{
{Path: "/settings", Title: "Home", Breadcrumb: "Home"},
{Path: "/settings/incidents", Title: "Incidents", Breadcrumb: "Incidents"},
{Path: "/settings/targets", Title: "Targets", Breadcrumb: "Targets"},
{Path: "/settings/targets/create", Title: "Targets Create", Breadcrumb: "Create"},
{Path: "/settings/hooks", Title: "Hooks", Breadcrumb: "Hooks"},
{Path: "/settings/hooks/create", Title: "Hooks Create", Breadcrumb: "Create"},
{Path: "/settings/checks", Title: "Checks", Breadcrumb: "Checks"},
{Path: "/settings/checks/create", Title: "Checks Create", Breadcrumb: "Create"},
{Path: "/settings/worker-groups", Title: "Worker Groups", Breadcrumb: "Worker Groups"},
{Path: "/settings/worker-groups/create", Title: "Worker Groups Create", Breadcrumb: "Create"},
{Path: "/settings/notifications", Title: "Notifications", Breadcrumb: "Notifications"},
{Path: "/settings/notifications/create", Title: "Notifications Create", Breadcrumb: "Create"},
{Path: "/settings/triggers", Title: "Triggers", Breadcrumb: "Triggers"},
{Path: "/settings/triggers/create", Title: "Triggers Create", Breadcrumb: "Create"},
{Path: "/settings/temporal", Title: "Temporal", Breadcrumb: "Temporal"},
{Path: "/oauth2/logout", Title: "Logout", Breadcrumb: "Logout"},
}
View Source
var SettingsSidebar = []SettingsSidebarGroup{ { Group: "Overview", Pages: []*components.Page{ GetPageByTitle(SettingsPages, "Home"), }, }, { Group: "Monitor", Pages: []*components.Page{ GetPageByTitle(SettingsPages, "Targets"), GetPageByTitle(SettingsPages, "Checks"), GetPageByTitle(SettingsPages, "Hooks"), }, }, { Group: "Alert", Pages: []*components.Page{ GetPageByTitle(SettingsPages, "Triggers"), }, }, { Group: "Notify", Pages: []*components.Page{ GetPageByTitle(SettingsPages, "Incidents"), GetPageByTitle(SettingsPages, "Notifications"), }, }, { Group: "Manage", Pages: []*components.Page{ GetPageByTitle(SettingsPages, "Worker Groups"), GetPageByTitle(SettingsPages, "Temporal"), GetPageByTitle(SettingsPages, "Logout"), }, }, }
Functions ¶
func GetPageByTitle ¶
func GetPageByTitle(pages []*components.Page, title string) *components.Page
Types ¶
type AuthenticatedContext ¶
type AuthenticatedContext struct { echo.Context Principal *AuthenticatedPrincipal }
type AuthenticatedHandler ¶
type AuthenticatedHandler func(http.ResponseWriter, *http.Request, *AuthenticatedPrincipal)
type AuthenticatedPrincipal ¶
type AuthenticatedPrincipal struct { User *AuthenticatedUser Worker *AuthenticatedWorker }
type AuthenticatedUser ¶
type AuthenticatedUser struct { ID string Email string OAuth2AccessToken string OAuth2RefreshToken string OAuth2TokenType string OAuth2Expiry time.Time }
func GetUser ¶
func GetUser(ctx context.Context) *AuthenticatedUser
type AuthenticatedWorker ¶
type AuthenticatedWorker struct {
Group string
}
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
func NewBaseHandler ¶
func NewBaseHandler(db *sqlx.DB, kvStore database.KeyValueStore, temporal client.Client, config *config.ServerConfig, logger *slog.Logger) *BaseHandler
func (*BaseHandler) ApiV1WorkersConnectGET ¶
func (h *BaseHandler) ApiV1WorkersConnectGET(c echo.Context) error
func (*BaseHandler) AuthenticateRequestWithCookies ¶
func (h *BaseHandler) AuthenticateRequestWithCookies(r *http.Request) (*AuthenticatedUser, error)
func (*BaseHandler) AuthenticateRequestWithToken ¶
func (h *BaseHandler) AuthenticateRequestWithToken(r *http.Request) (*AuthenticatedPrincipal, error)
func (*BaseHandler) Authenticated ¶
func (h *BaseHandler) Authenticated(next echo.HandlerFunc) echo.HandlerFunc
func (*BaseHandler) AuthenticatedUserToOAuth2Token ¶
func (h *BaseHandler) AuthenticatedUserToOAuth2Token(user *AuthenticatedUser) *oauth2.Token
func (*BaseHandler) ClearAuthenticatedUserForRequest ¶
func (h *BaseHandler) ClearAuthenticatedUserForRequest(w http.ResponseWriter, r *http.Request) error
func (*BaseHandler) Error404 ¶
func (h *BaseHandler) Error404(c echo.Context) error
func (*BaseHandler) Incidents ¶
func (h *BaseHandler) Incidents(c echo.Context) error
func (*BaseHandler) Index ¶
func (h *BaseHandler) Index(c echo.Context) error
func (*BaseHandler) OAuth2CallbackGET ¶
func (h *BaseHandler) OAuth2CallbackGET(c echo.Context) error
func (*BaseHandler) OAuth2LoginGET ¶
func (h *BaseHandler) OAuth2LoginGET(c echo.Context) error
func (*BaseHandler) OAuth2LogoutGET ¶
func (h *BaseHandler) OAuth2LogoutGET(c echo.Context) error
func (*BaseHandler) RefreshToken ¶
func (h *BaseHandler) RefreshToken(w http.ResponseWriter, r *http.Request, user *AuthenticatedUser) (*AuthenticatedUser, error)
func (*BaseHandler) SetAuthenticatedUserForRequest ¶
func (h *BaseHandler) SetAuthenticatedUserForRequest(w http.ResponseWriter, r *http.Request, user *AuthenticatedUser) error
func (*BaseHandler) SettingsChecksCreateGET ¶
func (h *BaseHandler) SettingsChecksCreateGET(c echo.Context) error
func (*BaseHandler) SettingsChecksCreatePOST ¶
func (h *BaseHandler) SettingsChecksCreatePOST(c echo.Context) error
func (*BaseHandler) SettingsChecksDescribeDELETE ¶
func (h *BaseHandler) SettingsChecksDescribeDELETE(c echo.Context) error
func (*BaseHandler) SettingsChecksDescribeGET ¶
func (h *BaseHandler) SettingsChecksDescribeGET(c echo.Context) error
func (*BaseHandler) SettingsChecksDescribePOST ¶
func (h *BaseHandler) SettingsChecksDescribePOST(c echo.Context) error
func (*BaseHandler) SettingsChecksDisableGET ¶
func (h *BaseHandler) SettingsChecksDisableGET(c echo.Context) error
func (*BaseHandler) SettingsChecksEnableGET ¶
func (h *BaseHandler) SettingsChecksEnableGET(c echo.Context) error
func (*BaseHandler) SettingsChecksGET ¶
func (h *BaseHandler) SettingsChecksGET(c echo.Context) error
func (*BaseHandler) SettingsHomeGET ¶
func (h *BaseHandler) SettingsHomeGET(c echo.Context) error
func (*BaseHandler) SettingsHooksCreateGET ¶
func (h *BaseHandler) SettingsHooksCreateGET(c echo.Context) error
func (*BaseHandler) SettingsHooksCreatePOST ¶
func (h *BaseHandler) SettingsHooksCreatePOST(c echo.Context) error
func (*BaseHandler) SettingsHooksDescribeDELETE ¶
func (h *BaseHandler) SettingsHooksDescribeDELETE(c echo.Context) error
func (*BaseHandler) SettingsHooksDescribeGET ¶
func (h *BaseHandler) SettingsHooksDescribeGET(c echo.Context) error
func (*BaseHandler) SettingsHooksDescribePOST ¶
func (h *BaseHandler) SettingsHooksDescribePOST(c echo.Context) error
func (*BaseHandler) SettingsHooksDisableGET ¶
func (h *BaseHandler) SettingsHooksDisableGET(c echo.Context) error
func (*BaseHandler) SettingsHooksEnableGET ¶
func (h *BaseHandler) SettingsHooksEnableGET(c echo.Context) error
func (*BaseHandler) SettingsHooksGET ¶
func (h *BaseHandler) SettingsHooksGET(c echo.Context) error
func (*BaseHandler) SettingsIncidentsGET ¶
func (h *BaseHandler) SettingsIncidentsGET(c echo.Context) error
func (*BaseHandler) SettingsNotificationsGET ¶
func (h *BaseHandler) SettingsNotificationsGET(c echo.Context) error
func (*BaseHandler) SettingsTargetsCreateGET ¶
func (h *BaseHandler) SettingsTargetsCreateGET(c echo.Context) error
func (*BaseHandler) SettingsTargetsCreatePOST ¶
func (h *BaseHandler) SettingsTargetsCreatePOST(c echo.Context) error
func (*BaseHandler) SettingsTargetsDescribeDELETE ¶
func (h *BaseHandler) SettingsTargetsDescribeDELETE(c echo.Context) error
func (*BaseHandler) SettingsTargetsDescribeGET ¶
func (h *BaseHandler) SettingsTargetsDescribeGET(c echo.Context) error
func (*BaseHandler) SettingsTargetsDescribePOST ¶
func (h *BaseHandler) SettingsTargetsDescribePOST(c echo.Context) error
func (*BaseHandler) SettingsTargetsDisableGET ¶
func (h *BaseHandler) SettingsTargetsDisableGET(c echo.Context) error
func (*BaseHandler) SettingsTargetsEnableGET ¶
func (h *BaseHandler) SettingsTargetsEnableGET(c echo.Context) error
func (*BaseHandler) SettingsTargetsGET ¶
func (h *BaseHandler) SettingsTargetsGET(c echo.Context) error
func (*BaseHandler) SettingsTriggersCreateGET ¶
func (h *BaseHandler) SettingsTriggersCreateGET(c echo.Context) error
func (*BaseHandler) SettingsTriggersCreatePOST ¶
func (h *BaseHandler) SettingsTriggersCreatePOST(c echo.Context) error
func (*BaseHandler) SettingsTriggersDescribeDELETE ¶
func (h *BaseHandler) SettingsTriggersDescribeDELETE(c echo.Context) error
func (*BaseHandler) SettingsTriggersDescribeGET ¶
func (h *BaseHandler) SettingsTriggersDescribeGET(c echo.Context) error
func (*BaseHandler) SettingsTriggersDescribePOST ¶
func (h *BaseHandler) SettingsTriggersDescribePOST(c echo.Context) error
func (*BaseHandler) SettingsTriggersDisableGET ¶
func (h *BaseHandler) SettingsTriggersDisableGET(c echo.Context) error
func (*BaseHandler) SettingsTriggersEnableGET ¶
func (h *BaseHandler) SettingsTriggersEnableGET(c echo.Context) error
func (*BaseHandler) SettingsTriggersGET ¶
func (h *BaseHandler) SettingsTriggersGET(c echo.Context) error
func (*BaseHandler) SettingsWorkerGroupsCreateGET ¶
func (h *BaseHandler) SettingsWorkerGroupsCreateGET(c echo.Context) error
func (*BaseHandler) SettingsWorkerGroupsCreatePOST ¶
func (h *BaseHandler) SettingsWorkerGroupsCreatePOST(c echo.Context) error
func (*BaseHandler) SettingsWorkerGroupsDescribeDELETE ¶
func (h *BaseHandler) SettingsWorkerGroupsDescribeDELETE(c echo.Context) error
func (*BaseHandler) SettingsWorkerGroupsDescribeGET ¶
func (h *BaseHandler) SettingsWorkerGroupsDescribeGET(c echo.Context) error
func (*BaseHandler) SettingsWorkerGroupsGET ¶
func (h *BaseHandler) SettingsWorkerGroupsGET(c echo.Context) error
func (*BaseHandler) Temporal ¶
func (h *BaseHandler) Temporal(c echo.Context) error
type CheckWithWorkerGroupsAndState ¶
type CheckWithWorkerGroupsAndState struct { *models.CheckWithWorkerGroups State models.CheckState }
type CreateCheck ¶
type CreateHook ¶
type CreateTarget ¶
type CreateTrigger ¶
type History ¶
type History struct { List []*HistoryItem Uptime float64 }
type HistoryItem ¶
type HistoryItem struct { Outcome HistoryOutcome StatusCounts map[models.TargetStatus]int Counts int Date time.Time Checks []*HistoryItemCheck SuccessRate float64 }
type HistoryItemCheck ¶
type HistoryItemCheck struct { Name string WorkerGroupName string Status models.TargetStatus StatusCounts map[models.TargetStatus]int Counts int SuccessRate float64 }
type HistoryOutcome ¶
type HistoryOutcome string
const ( HistoryOutcomeHealthy HistoryOutcome = "HEALTHY" HistoryOutcomeDegraded HistoryOutcome = "DEGRADED" HistoryOutcomeUnknown HistoryOutcome = "UNKNOWN" HistoryOutcomeDown HistoryOutcome = "DOWN" )
func TargetStatusToHistoryOutcome ¶
func TargetStatusToHistoryOutcome(status models.TargetStatus) HistoryOutcome
type IndexData ¶
type IndexData struct { *components.Base Targets map[string]TargetsAndStatus TargetsLength int TimeRange string Outcome HistoryOutcome }
type Notification ¶
type Notification struct{}
type Settings ¶
type Settings struct { *components.Base SettingsGroupName string SettingsSidebarActive *components.Page SettingsSidebar []SettingsSidebarGroup User *AuthenticatedUser SettingsBreadcrumbs []*components.Page }
func NewSettings ¶
func NewSettings(user *AuthenticatedUser, page *components.Page, breadCrumbs []*components.Page) *Settings
type SettingsCheck ¶
type SettingsCheck struct { *Settings Check *CheckWithWorkerGroupsAndState History []*services.CheckHistory }
type SettingsCheckCreate ¶
type SettingsChecks ¶
type SettingsHome ¶
type SettingsHook ¶
type SettingsHook struct { *Settings Hook *HookWithState History []*services.HookHistory }
type SettingsHookCreate ¶
type SettingsHooks ¶
type SettingsIncidents ¶
type SettingsNotifications ¶
type SettingsNotifications struct { *Settings Notifications []*Notification }
type SettingsSidebarGroup ¶
type SettingsSidebarGroup struct { Group string Pages []*components.Page }
type SettingsTarget ¶
type SettingsTarget struct { *Settings Target *models.Target History []*services.TargetHistory }
type SettingsTargetCreate ¶
type SettingsTargets ¶
type SettingsTrigger ¶
type SettingsTrigger struct { *Settings Trigger *TriggerWithState History []*services.TriggerHistory }
type SettingsTriggerCreate ¶
type SettingsTriggers ¶
type SettingsTriggers struct { *Settings Triggers []*TriggerWithState }
type SettingsWorker ¶
type SettingsWorker struct { *Settings Worker *WorkerWithTokenAndActiveWorkers }
type SettingsWorkerGroups ¶
type SettingsWorkerGroups struct { *Settings WorkerGroups []*WorkerGroupWithActiveWorkers }
type Target ¶
type Target struct { Name string Visibility models.TargetVisibility Group string Outcome HistoryOutcome History []*HistoryItem Uptime float64 }
type TargetsAndStatus ¶
type TargetsAndStatus struct { Outcome HistoryOutcome Targets []*Target }
type TriggerWithState ¶
type TriggerWithState struct { *models.Trigger State models.TriggerState }
type UpdateCheck ¶
type UpdateHook ¶
type UpdateTarget ¶
type UpdateTrigger ¶
type UpdateTrigger struct {
Script string `validate:"required"`
}
type WorkerGroupWithActiveWorkers ¶
type WorkerGroupWithActiveWorkers struct { *models.WorkerGroupWithChecks ActiveWorkers []string }
type WorkerWithTokenAndActiveWorkers ¶
type WorkerWithTokenAndActiveWorkers struct { *models.WorkerGroup Token string ActiveWorkers []string }
Click to show internal directories.
Click to hide internal directories.