aboutsummaryrefslogtreecommitdiff
path: root/pkg/components/user
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/components/user')
-rw-r--r--pkg/components/user/controller.go1
-rw-r--r--pkg/components/user/model.go33
2 files changed, 34 insertions, 0 deletions
diff --git a/pkg/components/user/controller.go b/pkg/components/user/controller.go
new file mode 100644
index 0000000..a00006b
--- /dev/null
+++ b/pkg/components/user/controller.go
@@ -0,0 +1 @@
+package user
diff --git a/pkg/components/user/model.go b/pkg/components/user/model.go
new file mode 100644
index 0000000..f957c39
--- /dev/null
+++ b/pkg/components/user/model.go
@@ -0,0 +1,33 @@
+package user
+
+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 string
+ IsAdmin bool
+ Path string
+ }
+
+ Repository interface {
+ List(ctx context.Context) ([]*User, error)
+ Create(ctx context.Context, createUser *CreateUser) error
+ Update(ctx context.Context, id uint, updateUser *UpdateUser) error
+ }
+)