Documentation ¶
Index ¶
- Variables
- type File
- type FileModel
- func (p FileModel) Add(ctx context.Context, item *File) error
- func (p FileModel) CheckIfExists(ctx context.Context, name string) (bool, error)
- func (p FileModel) Delete(ctx context.Context, name, userID string) (int, error)
- func (p FileModel) Get(ctx context.Context, name string) (File, error)
- func (p FileModel) GetAll(ctx context.Context, userID, pageID, limit int) ([]File, error)
- func (p FileModel) GetEveryFile(ctx context.Context, pageID, limit int) ([]File, error)
- func (p FileModel) GetWithAuth(ctx context.Context, name, userID string) (File, error)
- func (p FileModel) PostUploadFileUpdate(ctx context.Context, userID int, name, contentType string) error
- func (p FileModel) UpdateContentType(ctx context.Context, name, contentType string) error
- type FileModelInterface
- type Models
- type PgxIface
- type User
- type UserModel
- func (m UserModel) Add(ctx context.Context, user User) error
- func (m UserModel) Authenticate(ctx context.Context, u User) (User, error)
- func (m UserModel) Delete(ctx context.Context, userID int) (int, error)
- func (m UserModel) Get(ctx context.Context, userID int) (User, error)
- func (m UserModel) GetAll(ctx context.Context) ([]User, error)
- func (m UserModel) Search(ctx context.Context, username string) (User, error)
- func (m UserModel) Update(ctx context.Context, userID int, u User) error
- func (m UserModel) UpdateSelf(ctx context.Context, userID int, u User) error
- type UserModelInterface
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type File ¶
type FileModel ¶
type FileModel struct { DB PgxIface FileModelInterface }
func (FileModel) CheckIfExists ¶
func (FileModel) Delete ¶
func (FileModel) GetAll ¶
GetAll returns all files for userID but without content. Now with pagination!
func (FileModel) GetEveryFile ¶
func (FileModel) GetWithAuth ¶
func (FileModel) PostUploadFileUpdate ¶
type FileModelInterface ¶
type Models ¶
type PgxIface ¶
type User ¶
type UserModel ¶
type UserModel struct { DB PgxIface UserModelInterface }
func (UserModel) Authenticate ¶
Authenticate returns true if credentials correct.
func (UserModel) Get ¶
Get returns user based on user ID.
func (UserModel) Search ¶
Search returns user based on username.
func (UserModel) Update ¶
TODO partial update ?
type UserModelInterface ¶
type UserModelInterface interface { Add(ctx context.Context, u User) error Get(ctx context.Context, name string) (User, error) GetAll(ctx context.Context) ([]User, error) Delete(ctx context.Context, name string) error Update(ctx context.Context, name string, u User) error Authenticate(ctx context.Context, u User) (User, error) }
Click to show internal directories.
Click to hide internal directories.