Documentation ¶
Index ¶
- type ActiveStep
- type Config
- type Policy
- type SearchCursor
- type SearchOptions
- type Step
- type Store
- func (s *Store) AddStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
- func (s *Store) CreatePolicyTx(ctx context.Context, tx *sql.Tx, p *Policy) (*Policy, error)
- func (s *Store) CreateStepTx(ctx context.Context, tx *sql.Tx, st *Step) (*Step, error)
- func (s *Store) DeleteManyPoliciesTx(ctx context.Context, tx *sql.Tx, ids []string) error
- func (s *Store) DeleteStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
- func (s *Store) DeleteStepTx(ctx context.Context, tx *sql.Tx, id string) (string, error)
- func (s *Store) FindAllOnCallStepsForUserTx(ctx context.Context, tx *sql.Tx, userID string) ([]Step, error)
- func (s *Store) FindAllPoliciesBySchedule(ctx context.Context, scheduleID string) ([]Policy, error)
- func (s *Store) FindAllStepTargetsTx(ctx context.Context, tx *sql.Tx, stepID string) ([]assignment.Target, error)
- func (s *Store) FindAllSteps(ctx context.Context, policyID string) ([]Step, error)
- func (s *Store) FindAllStepsTx(ctx context.Context, tx *sql.Tx, policyID string) ([]Step, error)
- func (s *Store) FindManyPolicies(ctx context.Context, ids []string) ([]Policy, error)
- func (s *Store) FindOnePolicyForUpdateTx(ctx context.Context, tx *sql.Tx, id string) (*Policy, error)
- func (s *Store) FindOnePolicyTx(ctx context.Context, tx *sql.Tx, id string) (*Policy, error)
- func (s *Store) FindOneStepForUpdateTx(ctx context.Context, tx *sql.Tx, id string) (*Step, error)
- func (s *Store) Search(ctx context.Context, opts *SearchOptions) ([]Policy, error)
- func (s *Store) UpdatePolicyTx(ctx context.Context, tx *sql.Tx, p *Policy) error
- func (s *Store) UpdateStepDelayTx(ctx context.Context, tx *sql.Tx, stepID string, stepDelay int) error
- func (s *Store) UpdateStepNumberTx(ctx context.Context, tx *sql.Tx, stepID string, stepNumber int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveStep ¶
type Policy ¶
type Policy struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Repeat int `json:"repeat"` // contains filtered or unexported fields }
func (Policy) IsUserFavorite ¶ added in v0.28.0
IsUserFavorite returns true if this policy is a favorite of the current user.
type SearchCursor ¶
SearchCursor is used to indicate a position in a paginated list.
type SearchOptions ¶
type SearchOptions struct { Search string `json:"s,omitempty"` After SearchCursor `json:"a,omitempty"` // FavoritesUserID specifies the UserID whose favorite escalation policies want to be displayed. FavoritesUserID string `json:"u,omitempty"` // FavoritesOnly controls filtering the results to those marked as favorites by FavoritesUserID. FavoritesOnly bool `json:"g,omitempty"` // FavoritesFirst indicates that escalation policy marked as favorite (by FavoritesUserID) should be returned first (before any non-favorites). FavoritesFirst bool `json:"f,omitempty"` // Omit specifies a list of policy IDs to exclude from the results. Omit []string `json:"o,omitempty"` Limit int `json:"-"` }
SearchOptions allow filtering and paginating the list of escalation policies.
type Step ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddStepTargetTx ¶ added in v0.30.0
func (s *Store) AddStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
AddStepTargetTx adds a target to an escalation policy step.
func (*Store) CreatePolicyTx ¶ added in v0.30.0
CreatePolicyTx creates a new escalation policy in the database.
func (*Store) CreateStepTx ¶ added in v0.30.0
CreateStepTx adds a step to an escalation policy.
func (*Store) DeleteManyPoliciesTx ¶ added in v0.30.0
DeleteManyPoliciesTx deletes multiple policies in a single transaction.
func (*Store) DeleteStepTargetTx ¶ added in v0.30.0
func (s *Store) DeleteStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
DeleteStepTargetTx removes the target from the step.
func (*Store) DeleteStepTx ¶ added in v0.30.0
DeleteStepTx deletes a step from an escalation policy.
func (*Store) FindAllOnCallStepsForUserTx ¶ added in v0.30.0
func (s *Store) FindAllOnCallStepsForUserTx(ctx context.Context, tx *sql.Tx, userID string) ([]Step, error)
FindAllOnCallStepsForUserTx returns all steps a user is currently on-call for.
func (*Store) FindAllPoliciesBySchedule ¶ added in v0.30.0
FindAllPoliciesBySchedule will return all policies that have the given schedule assigned to them.
func (*Store) FindAllStepTargetsTx ¶ added in v0.30.0
func (s *Store) FindAllStepTargetsTx(ctx context.Context, tx *sql.Tx, stepID string) ([]assignment.Target, error)
FindAllStepTargetsTx returns the targets for a step.
func (*Store) FindAllSteps ¶ added in v0.30.0
func (*Store) FindAllStepsTx ¶ added in v0.30.0
FindAllStepsTx returns all steps for a policy.
func (*Store) FindManyPolicies ¶ added in v0.30.0
FindManyPolicies returns escalation policies for the given IDs.
func (*Store) FindOnePolicyForUpdateTx ¶ added in v0.30.0
func (s *Store) FindOnePolicyForUpdateTx(ctx context.Context, tx *sql.Tx, id string) (*Policy, error)
FindOnePolicyForUpdateTx returns a single policy locked to the tx for updating.
func (*Store) FindOnePolicyTx ¶ added in v0.30.0
FindOnePolicyTx returns a policy by ID.
func (*Store) FindOneStepForUpdateTx ¶ added in v0.30.0
FindOneStepForUpdateTx returns a step locked within the tx for update.
func (*Store) UpdatePolicyTx ¶ added in v0.30.0
UpdatePolicyTx will update a single escalation policy.