Documentation ¶
Index ¶
- type NotificationRule
- type Store
- func (s *Store) CreateTx(ctx context.Context, tx *sql.Tx, n *NotificationRule) (*NotificationRule, error)
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) DeleteTx(ctx context.Context, tx *sql.Tx, ids ...string) error
- func (s *Store) DoTx(f func(*Store) error) error
- func (s *Store) FindAll(ctx context.Context, userID string) ([]NotificationRule, error)
- func (s *Store) FindOne(ctx context.Context, id string) (*NotificationRule, error)
- func (s *Store) Insert(ctx context.Context, n *NotificationRule) (*NotificationRule, error)
- func (s *Store) UpdateDelay(ctx context.Context, id string, delay int) error
- func (s *Store) WrapTx(tx *sql.Tx) *Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationRule ¶
type NotificationRule struct { ID string `json:"id"` UserID string `json:"-"` DelayMinutes int `json:"delay"` ContactMethodID string `json:"contact_method_id"` }
func (NotificationRule) Normalize ¶
func (n NotificationRule) Normalize(update bool) (*NotificationRule, error)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store allows the lookup and management of NotificationRules.
func NewStore ¶ added in v0.30.0
NewDB will create a DB backend from a sql.DB. An error will be returned if statements fail to prepare.
func (*Store) CreateTx ¶
func (s *Store) CreateTx(ctx context.Context, tx *sql.Tx, n *NotificationRule) (*NotificationRule, error)
CreateTx implements the NotificationRuleStore interface by inserting the new NotificationRule into the database. A new ID is always created.
func (*Store) Insert ¶
func (s *Store) Insert(ctx context.Context, n *NotificationRule) (*NotificationRule, error)
Insert implements the NotificationRuleStore interface by inserting the new NotificationRule into the database. A new ID is always created.
func (*Store) UpdateDelay ¶
Update implements the NotificationRuleStore interface.
Click to show internal directories.
Click to hide internal directories.