Documentation
¶
Index ¶
- Constants
- func AvailableFields() []string
- func FormatValue(value any) string
- func Marshal(settings Settings) ([]byte, error)
- func Template() []byte
- func Validate(settings Settings) error
- func WebBaseDirID(baseDir string) string
- type Batch
- type ChannelSettings
- type Event
- type EventKind
- type Field
- type Loaded
- type Payload
- type PayloadEvent
- type Settings
- type WebhookSettings
Constants ¶
View Source
const FileName = "notifications.toml"
View Source
const WebBaseDirRoutePrefix = "/_basedir/"
WebBaseDirRoutePrefix is the Web UI path prefix that serves one basedir as WebBaseDirRoutePrefix + WebBaseDirID(baseDir) + "/".
Variables ¶
This section is empty.
Functions ¶
func AvailableFields ¶
func AvailableFields() []string
func FormatValue ¶
func WebBaseDirID ¶ added in v0.1.21
WebBaseDirID returns the Web UI route ID of baseDir, an absolute, clean path.
Types ¶
type Batch ¶
type ChannelSettings ¶
type ChannelSettings struct {
JobFailure bool `json:"job_failure"`
JobSuccess bool `json:"job_success"`
RunFailure bool `json:"run_failure"`
RunSuccess bool `json:"run_success"`
Fields []string `json:"fields"`
MaxJobs int `json:"max_jobs"`
}
func (ChannelSettings) Includes ¶
func (settings ChannelSettings) Includes(event Event) bool
type Event ¶
type Event struct {
Kind EventKind `json:"event"`
OccurredAt string `json:"occurred_at"`
Project string `json:"project,omitempty"`
RunID string `json:"run_id,omitempty"`
RunName string `json:"run_name,omitempty"`
RunStatus string `json:"run_status,omitempty"`
JobStatus string `json:"job_status,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
Successes int `json:"success_count,omitempty"`
Failures int `json:"failure_count,omitempty"`
DiagnosisOutdated bool `json:"diagnosis_outdated,omitempty"`
Job *model.JobSpec `json:"job,omitempty"`
Result *model.JobResult `json:"result,omitempty"`
StartedAt string `json:"started_at,omitempty"`
FinishedAt string `json:"finished_at,omitempty"`
}
func NewJobEvent ¶
func NewRunEvent ¶
func (*Event) SetDiagnosisOutdated ¶
func (*Event) SetTimestamps ¶
type Payload ¶
type Payload struct {
SchemaVersion int `json:"schema_version"`
CreatedAt string `json:"created_at"`
Events []PayloadEvent `json:"events"`
OmittedJobs int `json:"omitted_jobs,omitempty"`
}
type PayloadEvent ¶
type Settings ¶
type Settings struct {
Webhook WebhookSettings `json:"webhook"`
Browser ChannelSettings `json:"browser"`
}
type WebhookSettings ¶
type WebhookSettings struct {
ChannelSettings
URL string `json:"url,omitempty"`
WebURL string `json:"web_url,omitempty"`
Format string `json:"format"`
}
Click to show internal directories.
Click to hide internal directories.