implement/fix peer and user disable event (#337, #273)
Some checks are pending
Docker / Build and Push (push) Waiting to run
Docker / release (push) Blocked by required conditions
github-pages / deploy (push) Waiting to run

This commit is contained in:
Christoph Haas
2025-01-05 10:06:34 +01:00
parent 62dbdfe0f9
commit 6d86f15ff8
14 changed files with 394 additions and 188 deletions

View File

@@ -1,10 +1,9 @@
package domain
import (
"database/sql/driver"
"errors"
"time"
"database/sql/driver"
)
type BaseModel struct {
@@ -26,30 +25,32 @@ func (PrivateString) String() string {
func (ps PrivateString) Value() (driver.Value, error) {
if len(ps) == 0 {
return nil, nil
}
return nil, nil
}
return string(ps), nil
}
func (ps *PrivateString) Scan(value interface{}) error {
if value == nil {
*ps = ""
return nil
}
switch v := value.(type) {
case string:
*ps = PrivateString(v)
case []byte:
*ps = PrivateString(string(v))
default:
return errors.New("invalid type for PrivateString")
}
return nil
if value == nil {
*ps = ""
return nil
}
switch v := value.(type) {
case string:
*ps = PrivateString(v)
case []byte:
*ps = PrivateString(string(v))
default:
return errors.New("invalid type for PrivateString")
}
return nil
}
const (
DisabledReasonExpired = "expired"
DisabledReasonDeleted = "deleted"
DisabledReasonUserDisabled = "user disabled"
DisabledReasonUserDeleted = "user deleted"
DisabledReasonUserEdit = "user edit action"
DisabledReasonUserCreate = "user create action"
DisabledReasonAdminEdit = "admin edit action"