GetRulesConfig gets the rules config for a user.
(ctx context.Context, userID string)
| 90 | |
| 91 | // GetRulesConfig gets the rules config for a user. |
| 92 | func (d *DB) GetRulesConfig(ctx context.Context, userID string) (userconfig.VersionedRulesConfig, error) { |
| 93 | c, ok := d.cfgs[userID] |
| 94 | if !ok { |
| 95 | return userconfig.VersionedRulesConfig{}, sql.ErrNoRows |
| 96 | } |
| 97 | cfg := c.GetVersionedRulesConfig() |
| 98 | if cfg == nil { |
| 99 | return userconfig.VersionedRulesConfig{}, sql.ErrNoRows |
| 100 | } |
| 101 | return *cfg, nil |
| 102 | } |
| 103 | |
| 104 | // SetRulesConfig sets the rules config for a user. |
| 105 | func (d *DB) SetRulesConfig(ctx context.Context, userID string, oldConfig, newConfig userconfig.RulesConfig) (bool, error) { |
nothing calls this directly
no test coverage detected