Documentation ¶
Index ¶
- Variables
- type CommentPhoto
- type Controller
- func NewBansController(s services.BansService) Controller
- func NewCommentsController(s services.CommentsService) Controller
- func NewFollowsController(s services.FollowsService) Controller
- func NewLikesController(s services.LikesService) Controller
- func NewLoginController(s services.AuthService) Controller
- func NewPhotosController(s services.PhotosService) Controller
- func NewUsersController(s services.UsersService) Controller
- type DoLoginRequest
- type DoLoginResponse
- type ErrorHandler
- type ForbiddenError
- type NotFoundError
- type ParsingError
- type RequiredError
- type SetMyUserNameRequest
Constants ¶
This section is empty.
Variables ¶
var ErrCommentContentIsNotValid = errors.New("Comment is too long")
var ErrCommentContentIsZero = errors.New("Comment content is empty")
var ErrLoginNameIsNotValid = errors.New("Name should be at least 3 characters long")
var ErrLoginNameIsZero = errors.New("Login name is zero value")
var ErrSeMyUserNameOpIsNotValid = errors.New("Op value is not valid")
var ErrSeMyUserNameOpIsZero = errors.New("Op is zero value")
var ErrSeMyUserNamePathIsNotValid = errors.New("Path value is not valid")
var ErrSeMyUserNamePathIsZero = errors.New("Path is zero value")
var ErrSetMyUserNameValueIsNotValid = errors.New("Value should be at least 3 characters long")
var ErrSetMyUserNameValueIsZero = errors.New("Value name is zero value")
var ( // ErrTypeAssertionError is thrown when type an interface does not match the asserted type ErrTypeAssertionError = errors.New("unable to assert type") )
Functions ¶
This section is empty.
Types ¶
type CommentPhoto ¶
type CommentPhoto struct { // User name Content string `json:"content,omitempty"` }
CommentPhoto - Comment a photo
type Controller ¶
Router defines the required methods for retrieving api routes
func NewBansController ¶
func NewBansController(s services.BansService) Controller
NewBansController creates a default api controller
func NewCommentsController ¶
func NewCommentsController(s services.CommentsService) Controller
Newc creates a default api controller
func NewFollowsController ¶
func NewFollowsController(s services.FollowsService) Controller
NewFollowsController creates a default api controller
func NewLikesController ¶
func NewLikesController(s services.LikesService) Controller
NewLikesController creates a default api controller
func NewLoginController ¶
func NewLoginController(s services.AuthService) Controller
NewLoginController creates a default api controller
func NewPhotosController ¶
func NewPhotosController(s services.PhotosService) Controller
NewPhotosController creates a default api controller
func NewUsersController ¶
func NewUsersController(s services.UsersService) Controller
NewUsersController creates a default api controller
type DoLoginRequest ¶
type DoLoginRequest struct { // User name Name string `json:"name,omitempty"` }
DoLoginRequest - Name of the user
type DoLoginResponse ¶
type DoLoginResponse struct { // Token identifier for a logged in user Identifier string `json:"identifier,omitempty"` }
DoLoginResponse - Token identifier for a logged in user
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, ctx reqcontext.RequestContext)
ErrorHandler defines the required method for handling error.
type ForbiddenError ¶
type ForbiddenError struct {
Err error
}
Forbidden indicates that an error has occurred when trying to access a forbidden resource
func (*ForbiddenError) Error ¶
func (e *ForbiddenError) Error() string
func (*ForbiddenError) Unwrap ¶
func (e *ForbiddenError) Unwrap() error
type NotFoundError ¶
type NotFoundError struct {
Entity string
}
NotFoundError indicates that an error has occurred when trying to access a not existing entity
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type ParsingError ¶
type ParsingError struct {
Err error
}
ParsingError indicates that an error has occurred when parsing request parameters
func (*ParsingError) Error ¶
func (e *ParsingError) Error() string
func (*ParsingError) Unwrap ¶
func (e *ParsingError) Unwrap() error
type RequiredError ¶
type RequiredError struct {
Field string
}
RequiredError indicates that an error has occurred when parsing required request parameters
func (*RequiredError) Error ¶
func (e *RequiredError) Error() string