Newer
Older
wg-portal / tmp / persistence / users.go
@Christoph Haas Christoph Haas on 1 Oct 2021 402 bytes WIP: new package structure (in tmp)
package persistence

import "gorm.io/gorm"

type UserFilterCondition func(tx *gorm.DB)

type UsersLoader interface {
	GetUser(id UserIdentifier) (User, error)
	GetUsers() ([]User, error)
	GetUsersUnscoped() ([]User, error)
	GetUsersFiltered(filter ...UserFilterCondition) ([]User, error)
}

type Users interface {
	UsersLoader

	SaveUser(user User) error
	DeleteUser(identifier UserIdentifier) error
}