Documentation
¶
Index ¶
- type ActiveStep
- type ActiveStepReader
- type Config
- type DB
- func (db *DB) ActiveStep(ctx context.Context, alertID int, policyID string) (*ActiveStep, error)
- func (db *DB) AddStepTarget(ctx context.Context, stepID string, tgt assignment.Target) error
- func (db *DB) AddStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
- func (db *DB) CreatePolicy(ctx context.Context, p *Policy) (*Policy, error)
- func (db *DB) CreatePolicyTx(ctx context.Context, tx *sql.Tx, p *Policy) (*Policy, error)
- func (db *DB) CreateStep(ctx context.Context, s *Step) (*Step, error)
- func (db *DB) CreateStepTx(ctx context.Context, tx *sql.Tx, s *Step) (*Step, error)
- func (db *DB) DeleteManyPoliciesTx(ctx context.Context, tx *sql.Tx, ids []string) error
- func (db *DB) DeletePolicy(ctx context.Context, id string) error
- func (db *DB) DeletePolicyTx(ctx context.Context, tx *sql.Tx, id string) error
- func (db *DB) DeleteStep(ctx context.Context, id string) (string, error)
- func (db *DB) DeleteStepTarget(ctx context.Context, stepID string, tgt assignment.Target) error
- func (db *DB) DeleteStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
- func (db *DB) DeleteStepTx(ctx context.Context, tx *sql.Tx, id string) (string, error)
- func (db *DB) FindAllOnCallStepsForUserTx(ctx context.Context, tx *sql.Tx, userID string) ([]Step, error)
- func (db *DB) FindAllPolicies(ctx context.Context) ([]Policy, error)
- func (db *DB) FindAllPoliciesBySchedule(ctx context.Context, scheduleID string) ([]Policy, error)
- func (db *DB) FindAllStepTargets(ctx context.Context, stepID string) ([]assignment.Target, error)
- func (db *DB) FindAllStepTargetsTx(ctx context.Context, tx *sql.Tx, stepID string) ([]assignment.Target, error)
- func (db *DB) FindAllSteps(ctx context.Context, policyID string) ([]Step, error)
- func (db *DB) FindAllStepsTx(ctx context.Context, tx *sql.Tx, policyID string) ([]Step, error)
- func (db *DB) FindManyPolicies(ctx context.Context, ids []string) ([]Policy, error)
- func (db *DB) FindOnePolicy(ctx context.Context, id string) (*Policy, error)
- func (db *DB) FindOnePolicyForUpdateTx(ctx context.Context, tx *sql.Tx, id string) (*Policy, error)
- func (db *DB) FindOnePolicyTx(ctx context.Context, tx *sql.Tx, id string) (*Policy, error)
- func (db *DB) FindOneStep(ctx context.Context, id string) (*Step, error)
- func (db *DB) FindOneStepForUpdateTx(ctx context.Context, tx *sql.Tx, id string) (*Step, error)
- func (db *DB) FindOneStepTx(ctx context.Context, tx *sql.Tx, id string) (*Step, error)
- func (db *DB) MoveStep(ctx context.Context, id string, newPos int) error
- func (db *DB) Search(ctx context.Context, opts *SearchOptions) ([]Policy, error)
- func (db *DB) UpdatePolicy(ctx context.Context, p *Policy) error
- func (db *DB) UpdatePolicyTx(ctx context.Context, tx *sql.Tx, p *Policy) error
- func (db *DB) UpdateStep(ctx context.Context, s *Step) error
- func (db *DB) UpdateStepDelayTx(ctx context.Context, tx *sql.Tx, stepID string, stepDelay int) error
- func (db *DB) UpdateStepNumberTx(ctx context.Context, tx *sql.Tx, stepID string, stepNumber int) error
- type Manager
- type Policy
- type PolicyStore
- type SearchCursor
- type SearchOptions
- type Step
- type StepStore
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveStep ¶
type ActiveStepReader ¶
type ActiveStepReader interface {
ActiveStep(ctx context.Context, alertID int, policyID string) (*ActiveStep, error)
// FindOneStep will return a single escalation policy step.
// Note: it does not currently fetch the Targets.
FindOneStep(context.Context, string) (*Step, error)
FindOneStepTx(context.Context, *sql.Tx, string) (*Step, error)
FindOneStepForUpdateTx(context.Context, *sql.Tx, string) (*Step, error)
// FindAllSteps will return escalation policy steps for the given policy ID.
// Note: it does not currently fetch the Targets.
FindAllSteps(context.Context, string) ([]Step, error)
FindAllStepsTx(context.Context, *sql.Tx, string) ([]Step, error)
FindAllOnCallStepsForUserTx(ctx context.Context, tx *sql.Tx, userID string) ([]Step, error)
}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) ActiveStep ¶
func (*DB) AddStepTarget ¶
func (*DB) AddStepTargetTx ¶
func (*DB) CreatePolicy ¶
func (*DB) CreatePolicyTx ¶
func (*DB) CreateStepTx ¶
func (*DB) DeleteManyPoliciesTx ¶
func (*DB) DeletePolicyTx ¶
func (*DB) DeleteStepTarget ¶
func (*DB) DeleteStepTargetTx ¶
func (*DB) DeleteStepTx ¶
func (*DB) FindAllOnCallStepsForUserTx ¶
func (*DB) FindAllPoliciesBySchedule ¶
func (*DB) FindAllStepTargets ¶
func (*DB) FindAllStepTargetsTx ¶
func (*DB) FindAllSteps ¶
func (*DB) FindAllStepsTx ¶
func (*DB) FindManyPolicies ¶
func (*DB) FindOnePolicy ¶
func (*DB) FindOnePolicyForUpdateTx ¶
func (*DB) FindOnePolicyTx ¶
func (*DB) FindOneStepForUpdateTx ¶
func (*DB) FindOneStepTx ¶
func (*DB) UpdatePolicyTx ¶
func (*DB) UpdateStepDelayTx ¶
type Policy ¶
type PolicyStore ¶
type PolicyStore interface {
FindOnePolicy(context.Context, string) (*Policy, error)
FindOnePolicyTx(context.Context, *sql.Tx, string) (*Policy, error)
FindOnePolicyForUpdateTx(context.Context, *sql.Tx, string) (*Policy, error)
FindAllPolicies(context.Context) ([]Policy, error)
CreatePolicy(context.Context, *Policy) (*Policy, error)
CreatePolicyTx(context.Context, *sql.Tx, *Policy) (*Policy, error)
UpdatePolicy(context.Context, *Policy) error
UpdatePolicyTx(context.Context, *sql.Tx, *Policy) error
DeletePolicy(ctx context.Context, id string) error
DeletePolicyTx(ctx context.Context, tx *sql.Tx, id string) error
FindAllStepTargets(ctx context.Context, stepID string) ([]assignment.Target, error)
FindAllStepTargetsTx(ctx context.Context, tx *sql.Tx, stepID string) ([]assignment.Target, error)
AddStepTarget(ctx context.Context, stepID string, tgt assignment.Target) error
AddStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
DeleteStepTarget(ctx context.Context, stepID string, tgt assignment.Target) error
DeleteStepTargetTx(ctx context.Context, tx *sql.Tx, stepID string, tgt assignment.Target) error
FindAllPoliciesBySchedule(ctx context.Context, scheduleID string) ([]Policy, error)
FindManyPolicies(ctx context.Context, ids []string) ([]Policy, error)
DeleteManyPoliciesTx(ctx context.Context, tx *sql.Tx, ids []string) error
Search(context.Context, *SearchOptions) ([]Policy, error)
}
type SearchCursor ¶
type SearchCursor struct {
Name string `json:"n,omitempty"`
}
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"`
// 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 StepStore ¶
type StepStore interface {
// CreateStep is replaced by CreateStepTx.
CreateStep(context.Context, *Step) (*Step, error)
// CreateStepTx will create an escalation policy step within the given transaction.
// Note: Targets are not assigned during creation.
CreateStepTx(context.Context, *sql.Tx, *Step) (*Step, error)
UpdateStepNumberTx(context.Context, *sql.Tx, string, int) error
// Update step allows updating a steps delay
// Note: it does not update the Targets.
UpdateStep(context.Context, *Step) error
UpdateStepDelayTx(context.Context, *sql.Tx, string, int) error
DeleteStep(context.Context, string) (string, error)
DeleteStepTx(context.Context, *sql.Tx, string) (string, error)
MoveStep(context.Context, string, int) error
}
type Store ¶
type Store interface {
PolicyStore
StepStore
ActiveStepReader
}
Click to show internal directories.
Click to hide internal directories.