Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadBody = errors.New("bad body avatar")
View Source
var ErrUserAuthentication = errors.New("user authentication")
Functions ¶
Types ¶
type ProfileUpdateData ¶
type ProfileUpdateData struct { Username *string `json:"username"` Email *string `json:"email"` Name *string `json:"name"` Surname *string `json:"surname"` AboutMe *string `json:"about_me"` Password *string `json:"password"` }
func (ProfileUpdateData) MarshalEasyJSON ¶
func (v ProfileUpdateData) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProfileUpdateData) MarshalJSON ¶
func (v ProfileUpdateData) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProfileUpdateData) UnmarshalEasyJSON ¶
func (v *ProfileUpdateData) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProfileUpdateData) UnmarshalJSON ¶
func (v *ProfileUpdateData) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Usecase ¶
type Usecase interface { Register(ctx context.Context, user *entity.User) error Authentication(ctx context.Context, credentials UserCredentials) (*entity.User, error) FindOutUsernameAndAvatar(ctx context.Context, userID int) (username string, avatar string, err error) UpdateUserAvatar(ctx context.Context, userID int, mimeTypeAvatar string, sizeAvatar int64, avatar io.Reader) error GetAllProfileInfo(ctx context.Context, userID int) (*entity.User, error) GetUserInfo(ctx context.Context, userID int) (user *entity.User, isSubscribed bool, subsCount int, err error) GetProfileInfo(ctx context.Context) (user *entity.User, subsCount int, err error) EditProfileInfo(ctx context.Context, userID int, updateData *ProfileUpdateData) error }
type UserCredentials ¶
func (UserCredentials) MarshalEasyJSON ¶
func (v UserCredentials) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserCredentials) MarshalJSON ¶
func (v UserCredentials) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserCredentials) UnmarshalEasyJSON ¶
func (v *UserCredentials) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserCredentials) UnmarshalJSON ¶
func (v *UserCredentials) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
Source Files ¶
Click to show internal directories.
Click to hide internal directories.