grafana

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncidentID

func IncidentID(msg string) int

Types

type AlertGroup

type AlertGroup struct {
	ID                       string              `json:"pk"`
	AlertsCount              int                 `json:"alerts_count"`
	InsideOrganizationNumber int                 `json:"inside_organization_number"`
	AlertReceiveChannel      alertReceiveChannel `json:"alert_receive_channel"`
	Resolved                 bool                `json:"resolved"`
	ResolvedBy               int                 `json:"resolved_by"`
	ResolvedByUser           string              `json:"resolved_by_user"`
	ResolvedAt               time.Time           `json:"resolved_at"`
	AcknowledgedAt           time.Time           `json:"acknowledged_at"`
	Acknowledged             bool                `json:"acknowledged"`
	AcknowledgedOnSource     bool                `json:"acknowledged_on_source"`
	AcknowledgedByUser       acknowledgedByUser  `json:"acknowledged_by_user"`
	Silenced                 bool                `json:"silenced"`
	SilencedByUser           string              `json:"silenced_by_user"`
	SilencedAt               time.Time           `json:"silenced_at"`
	SilencedUntil            time.Time           `json:"silenced_until"`
	StartedAt                time.Time           `json:"started_at"`
	RelatedUsers             []relatedUser       `json:"related_users"`
	RenderForWeb             renderWeb           `json:"render_for_web"`
	RenderForClassicMarkdown renderMarkdown      `json:"render_for_classic_markdown"`
	DependentAlertGroups     []string            `json:"dependent_alert_groups"`
	RootAlertGroup           string              `json:"root_alert_group"`
	Status                   int                 `json:"status"`
}

func (*AlertGroup) AlertID

func (a *AlertGroup) AlertID() string

func (*AlertGroup) PhoneCall

func (a *AlertGroup) PhoneCall(originalMessage string) string

func (*AlertGroup) Raw

func (a *AlertGroup) Raw() interface{}

func (*AlertGroup) SMSText

func (a *AlertGroup) SMSText(originalMessage string) string

type DutyState

type DutyState struct {
	Name string
	// contains filtered or unexported fields
}

func NewDutyState

func NewDutyState(name string) *DutyState

func (*DutyState) IsEmpty

func (s *DutyState) IsEmpty() bool

IsEmpty checks if is empty

func (*DutyState) Peek

func (s *DutyState) Peek() ([]string, error)

Peek returns the top element without removing it. Returns an error if empty

func (*DutyState) Pop

func (s *DutyState) Pop() ([]string, error)

Pop removes and returns the top element. Returns an error if empty

func (*DutyState) Push

func (s *DutyState) Push(element []string)

Push adds an element

type Err

type Err struct {
	AccessErrorID string `json:"accessErrorId,omitempty"`
	Message       string `json:"message"`
	Title         string `json:"title,omitempty"`
}

type Ics

type Ics struct {
	// contains filtered or unexported fields
}

func NewIcsInstance

func NewIcsInstance(iCalURL string, pm *metrics.Storage) *Ics

func (*Ics) Current

func (i *Ics) Current(ctx context.Context) (*ScheduleItem, error)

Current returns who on call now

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func (*Instance) IncidentDetails

func (g *Instance) IncidentDetails(ctx context.Context, incidentID int) (Render, error)

func (*Instance) Start

func (g *Instance) Start(ctx context.Context)

type Ok

type Ok struct {
	Success bool `json:"success"`
}

type OnDuty

type OnDuty struct {
	// contains filtered or unexported fields
}

OnDuty manages multiple stacks identified by string keys.

func NewOnDuty

func NewOnDuty() *OnDuty

NewOnDuty creates a new OnDuty

func (*OnDuty) CreateEntry

func (m *OnDuty) CreateEntry(key string)

CreateEntry creates a new stack for the given key.

func (*OnDuty) Get

func (m *OnDuty) Get(key string) *DutyState

func (*OnDuty) Push

func (m *OnDuty) Push(key string, element []string) error

Push pushes an element onto the stack identified by the given key.

type Render

type Render interface {
	AlertID() string
	PhoneCall(string) string
	SMSText(string) string
	Raw() interface{}
}

type ScheduleItem

type ScheduleItem struct {
	ID       string   `json:"id"`
	TeamID   string   `json:"team_id"`
	Name     string   `json:"name"`
	TimeZone string   `json:"time_zone"`
	Users    []string `json:"on_call_now"`
	Shifts   []string `json:"shifts"`
	// contains filtered or unexported fields
}

type ScheduleProcessor

type ScheduleProcessor interface {
	Current(ctx context.Context) (*ScheduleItem, error)
}

type Service

type Service interface {
	IncidentDetails(context.Context, int) (Render, error)
	Start(context.Context)
}

type User

type User struct {
	ID            int      `json:"id"`
	Name          string   `json:"name"`
	Login         string   `json:"login"`
	Email         string   `json:"email,omitempty"`
	IsAdmin       bool     `json:"isAdmin"`
	IsDisabled    bool     `json:"isDisabled"`
	LastSeenAt    string   `json:"lastSeenAt"`
	LastSeenAtAge string   `json:"lastSeenAtAge"`
	AuthLabels    []string `json:"authLabels"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL