lens @ e359eaaebd7270476075ca9e08b7b53fb9e69f24

 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		Password string
18	}
19
20	CreateUser struct {
21		Username string
22		Name     string
23		Password []byte
24		IsAdmin  bool
25		Path     string
26	}
27
28	UserRepository interface {
29		Get(ctx context.Context, id uint) (*User, error)
30		GetPathFromUserID(ctx context.Context, id uint) (string, error)
31		List(ctx context.Context) ([]*User, error)
32		Create(ctx context.Context, createUser *CreateUser) (uint, error)
33		Update(ctx context.Context, id uint, updateUser *UpdateUser) error
34		Any(ctx context.Context) (bool, error)
35	}
36)