lens @ 72ec551e6cb422531e543e3fb431324aed5ac025

 1package repository
 2
 3import "context"
 4
 5type (
 6	User struct {
 7		ID       uint
 8		Username string
 9		Name     string
10		IsAdmin  bool
11		Path     string
12	}
13
14	UpdateUser struct {
15		Username string
16		Name     string
17		IsAdmin  bool
18		Path     string
19	}
20
21	CreateUser struct {
22		Username string
23		Name     string
24		Password []byte
25		IsAdmin  bool
26		Path     string
27	}
28
29	UserRepository interface {
30		Get(ctx context.Context, id uint) (*User, error)
31		GetPathFromUserID(ctx context.Context, id uint) (string, error)
32		List(ctx context.Context) ([]*User, error)
33		Create(ctx context.Context, createUser *CreateUser) (uint, error)
34		Update(ctx context.Context, id uint, updateUser *UpdateUser) error
35		Delete(ctx context.Context, id uint) error
36		UpdatePassword(ctx context.Context, id uint, password []byte) error
37		Any(ctx context.Context) (bool, error)
38	}
39)