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
}
DB implements the Store interface from Postgres.
func (*DB) HistoryBySchedule ¶
func (db *DB) HistoryBySchedule(ctx context.Context, scheduleID string, start, end time.Time) ([]Shift, error)
HistoryBySchedule will return the list of shifts that overlap the start and end time for the given schedule.
func (*DB) OnCallUsersByService ¶
func (db *DB) OnCallUsersByService(ctx context.Context, serviceID string) ([]ServiceOnCallUser, error)
OnCallUsersByService will return the current set of users who are on-call for the given service.
type ServiceOnCallUser ¶
type ServiceOnCallUser struct {
StepNumber int `json:"step_number"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
}
ServiceOnCallUser represents a currently on-call user for a service.
type Shift ¶
type Shift struct {
UserID string `json:"user_id"`
Start time.Time `json:"start_time"`
End time.Time `json:"end_time"`
Truncated bool `json:"truncated"`
}
A Shift represents a duration a user is on-call. If truncated is true, then the End time does not represent the time the user stopped being on call, instead it indicates they were still on-call at that time.
type Store ¶
type Store interface {
OnCallUsersByService(ctx context.Context, serviceID string) ([]ServiceOnCallUser, error)
// HistoryBySchedule(ctx context.Context, stepID string, start, end time.Time) ([]Shift, error)
HistoryBySchedule(ctx context.Context, scheduleID string, start, end time.Time) ([]Shift, error)
}
Store allows retrieving and calculating on-call information.
Click to show internal directories.
Click to hide internal directories.