resolver

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

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