Documentation ¶
Index ¶
- func GetValidator() *validator.Validate
- type Auth
- func (s *Auth) Login(w http.ResponseWriter, r *http.Request)
- func (s *Auth) Logout(w http.ResponseWriter, r *http.Request)
- func (s *Auth) Register(w http.ResponseWriter, r *http.Request)
- func (s *Auth) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
- func (s *Auth) RegisterPublicRouter(router *mux.Router)
- func (s *Auth) User(w http.ResponseWriter, r *http.Request)
- type AuthLoginRequest
- type AuthLoginResponse
- type AuthLogoutRequest
- type AuthLogoutResponse
- type AuthRegisterRequest
- type AuthRegisterResponse
- type AuthUserRequest
- type AuthUserResponse
- type Invite
- type InviteGenerateRequest
- type InviteGenerateResponse
- type InviteRevokeRequest
- type InviteRevokeResponse
- type JSONResponse
- type Post
- func (s *Post) Create(w http.ResponseWriter, r *http.Request)
- func (s *Post) Edit(w http.ResponseWriter, r *http.Request)
- func (s *Post) Feed(w http.ResponseWriter, r *http.Request)
- func (s *Post) List(w http.ResponseWriter, r *http.Request)
- func (s *Post) PublicGet(w http.ResponseWriter, r *http.Request)
- func (s *Post) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
- func (s *Post) RegisterPublicRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
- type PostCreateRequest
- type PostCreateResponse
- type PostEditRequest
- type PostEditResponse
- type PostFeedRequest
- type PostFeedResponse
- type PostListRequest
- type PostListResponse
- type PostPublicGetRequest
- type PostPublicGetResponse
- type User
- func (s *User) Get(w http.ResponseWriter, r *http.Request)
- func (s *User) Password(w http.ResponseWriter, r *http.Request)
- func (s *User) Profile(w http.ResponseWriter, r *http.Request)
- func (s *User) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
- func (s *User) RegisterPublicRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
- type UserGetRequest
- type UserGetResponse
- type UserPasswordRequest
- type UserPasswordResponse
- type UserProfileRequest
- type UserProfileResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValidator ¶
func GetValidator() *validator.Validate
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Login ¶
func (s *Auth) Login(w http.ResponseWriter, r *http.Request)
swagger:route POST /api/v1/auth/login Auth AuthLoginRequest
Login form ¶
Responses: 200: AuthLoginResponse
func (*Auth) Logout ¶
func (s *Auth) Logout(w http.ResponseWriter, r *http.Request)
swagger:route POST /api/v1/auth/logout Auth AuthLogoutRequest
Close the current session ¶
Responses: 200: AuthLogoutResponse
func (*Auth) Register ¶
func (s *Auth) Register(w http.ResponseWriter, r *http.Request)
swagger:route POST /api/v1/auth/register Auth AuthRegisterRequest
Registration form ¶
Responses: 200: AuthRegisterResponse
func (*Auth) RegisterPrivateRouter ¶
func (s *Auth) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
func (*Auth) RegisterPublicRouter ¶
type AuthLoginRequest ¶
swagger:parameters AuthLoginRequest
type AuthRegisterRequest ¶
type AuthRegisterRequest struct { // In: body Body struct { dto.RegisterDTO } }
swagger:parameters AuthRegisterRequest
type AuthRegisterResponse ¶
type AuthRegisterResponse struct { }
swagger:response AuthRegisterResponse
type AuthUserResponse ¶
swagger:response AuthUserResponse
type Invite ¶
type Invite struct {
// contains filtered or unexported fields
}
func NewInvite ¶
func NewInvite(invite serviceInvite.IInvite) *Invite
func (*Invite) Generate ¶
func (s *Invite) Generate(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/v1/invites/generate Invite InviteGenerateRequest
Generate a new invitation code ¶
Responses: 200: InviteGenerateResponse
func (*Invite) RegisterPrivateRouter ¶
func (s *Invite) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
type InviteGenerateRequest ¶
type InviteGenerateRequest struct { }
swagger:parameters InviteGenerateRequest
type InviteGenerateResponse ¶
type InviteGenerateResponse struct { // In: body Body struct { Data string `json:"data"` } }
swagger:response InviteGenerateResponse
type InviteRevokeRequest ¶
type InviteRevokeRequest struct { }
swagger:parameters InviteRevokeRequest
type InviteRevokeResponse ¶
type InviteRevokeResponse struct { }
swagger:response InviteRevokeResponse
type JSONResponse ¶
type Post ¶
type Post struct {
// contains filtered or unexported fields
}
func NewPost ¶
func NewPost(post servicePost.IPost) *Post
func (*Post) Create ¶
func (s *Post) Create(w http.ResponseWriter, r *http.Request)
swagger:route POST /api/v1/posts Post PostCreateRequest
Post creation form ¶
Responses: 201: PostCreateResponse
func (*Post) Edit ¶
func (s *Post) Edit(w http.ResponseWriter, r *http.Request)
swagger:route PUT /api/v1/posts/{id} Post PostEditRequest
Edit post form ¶
Responses: 200: PostEditResponse
func (*Post) Feed ¶
func (s *Post) Feed(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/v1/posts/feed Post PostFeedRequest
Get feed ¶
Responses: 200: PostFeedResponse
func (*Post) List ¶
func (s *Post) List(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/v1/posts Post PostListRequest
Get a list of posts for the current user ¶
Responses: 200: PostListResponse
func (*Post) PublicGet ¶
func (s *Post) PublicGet(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/v1/posts/{id} Post PostPublicGetRequest
Get public post ¶
Responses: 200: PostPublicGetResponse
func (*Post) RegisterPrivateRouter ¶
func (s *Post) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
func (*Post) RegisterPublicRouter ¶
func (s *Post) RegisterPublicRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
type PostCreateRequest ¶
type PostCreateRequest struct { // In: body Body struct { dto.CreatePostDTO } }
swagger:parameters PostCreateRequest
type PostCreateResponse ¶
swagger:response PostCreateResponse
type PostEditRequest ¶
type PostEditRequest struct { // In: path ID int32 `json:"id"` // In: body Body struct { dto.EditPostDTO } }
swagger:parameters PostEditRequest
type PostEditResponse ¶
swagger:response PostEditResponse
type PostFeedRequest ¶
type PostFeedRequest struct { // In: query dto.FeedPostDTO }
swagger:parameters PostFeedRequest
type PostFeedResponse ¶
swagger:response PostFeedResponse
type PostListRequest ¶
type PostListRequest struct { // In: query dto.ListPostDTO }
swagger:parameters PostListRequest
type PostListResponse ¶
swagger:response PostListResponse
type PostPublicGetRequest ¶
type PostPublicGetRequest struct { // In: path ID int32 `json:"id"` }
swagger:parameters PostPublicGetRequest
type PostPublicGetResponse ¶
swagger:response PostPublicGetResponse
type User ¶
type User struct {
// contains filtered or unexported fields
}
func NewUser ¶
func NewUser(user serviceUser.IUser) *User
func (*User) Get ¶
func (s *User) Get(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/v1/user/{id} User UserGetRequest
Getting information about a user by ID ¶
Responses: 200: UserGetResponse
func (*User) Password ¶
func (s *User) Password(w http.ResponseWriter, r *http.Request)
swagger:route PUT /api/v1/user/password User UserPasswordRequest
Updating the password for a user ¶
Responses: 200: UserPasswordResponse
func (*User) Profile ¶
func (s *User) Profile(w http.ResponseWriter, r *http.Request)
swagger:route PUT /api/v1/user/profile User UserProfileRequest
Updating user information ¶
Responses: 200: UserProfileResponse
func (*User) RegisterPrivateRouter ¶
func (s *User) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
func (*User) RegisterPublicRouter ¶
func (s *User) RegisterPublicRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)
type UserGetRequest ¶
type UserGetRequest struct { // In: path ID int32 `json:"id"` }
swagger:parameters UserGetRequest
type UserGetResponse ¶
swagger:response UserGetResponse
type UserPasswordRequest ¶
type UserPasswordRequest struct { // In: body Body struct { dto.UpdatePasswordDTO } }
swagger:parameters UserPasswordRequest
type UserPasswordResponse ¶
type UserPasswordResponse struct { }
swagger:response UserPasswordResponse
type UserProfileRequest ¶
type UserProfileRequest struct { // In: body Body struct { dto.UpdateProfileDTO } }
swagger:parameters UserProfileRequest