resolver

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(ctx context.Context, db *sql.DB, rules rule.Store, sched schedule.Store) (*DB, error)

func (*DB) AlertEPID

func (db *DB) AlertEPID(ctx context.Context, alertID int) (string, error)

func (*DB) IsUserOnCall

func (db *DB) IsUserOnCall(ctx context.Context, userID string) (bool, error)

func (*DB) OnCallByUser

func (db *DB) OnCallByUser(ctx context.Context, userID string) ([]OnCallAssignment, error)

type OnCallAssignment

type OnCallAssignment struct {
	ServiceID    string `json:"service_id"`
	ServiceName  string `json:"service_name"`
	EPID         string `json:"escalation_policy_id"`
	EPName       string `json:"escalation_policy_name"`
	Level        int    `json:"escalation_policy_step_number"`
	RotationID   string `json:"rotation_id"`
	RotationName string `json:"rotation_name"`
	ScheduleID   string `json:"schedule_id"`
	ScheduleName string `json:"schedule_name"`
	UserID       string `json:"user_id"`
	IsActive     bool   `json:"is_active"`
}

type Resolver

type Resolver interface {
	AlertEPID(context.Context, int) (string, error)
	IsUserOnCall(ctx context.Context, userID string) (bool, error)
	OnCallByUser(ctx context.Context, userID string) ([]OnCallAssignment, error)
}

type State

type State struct {
	Time    time.Time
	AlertID int
}

Jump to

Keyboard shortcuts

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