aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/repository/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/database/repository/user.go')
-rw-r--r--pkg/database/repository/user.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/database/repository/user.go b/pkg/database/repository/user.go
new file mode 100644
index 0000000..f8bd719
--- /dev/null
+++ b/pkg/database/repository/user.go
@@ -0,0 +1,35 @@
+package repository
+
+import "context"
+
+type (
+ User struct {
+ ID uint
+ Username string
+ Name string
+ IsAdmin bool
+ Path string
+ }
+
+ UpdateUser struct {
+ Username string
+ Name string
+ Password string
+ }
+
+ CreateUser struct {
+ Username string
+ Name string
+ Password []byte
+ IsAdmin bool
+ Path string
+ }
+
+ UserRepository interface {
+ Get(ctx context.Context, id uint) (*User, error)
+ List(ctx context.Context) ([]*User, error)
+ Create(ctx context.Context, createUser *CreateUser) (uint, error)
+ Update(ctx context.Context, id uint, updateUser *UpdateUser) error
+ Any(ctx context.Context) (bool, error)
+ }
+)