server

package
v0.0.0-...-a9a82f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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 NewAuth

func NewAuth(cfg *config.Config, service service.IAuth) *Auth

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

func (s *Auth) RegisterPublicRouter(router *mux.Router)

func (*Auth) User

func (s *Auth) User(w http.ResponseWriter, r *http.Request)

swagger:route GET /api/v1/auth/user Auth AuthUserRequest

Getting information about the current user

Responses:
  200: AuthUserResponse

type AuthLoginRequest

type AuthLoginRequest struct {
	// In: body
	Body struct {
		dto.LoginDTO
	}
}

swagger:parameters AuthLoginRequest

type AuthLoginResponse

type AuthLoginResponse struct {
	// In: body
	Body struct {
		Data *entity.Session `json:"data"`
	}
}

swagger:response AuthLoginResponse

type AuthLogoutRequest

type AuthLogoutRequest struct {
}

swagger:parameters AuthLogoutRequest

type AuthLogoutResponse

type AuthLogoutResponse struct {
}

swagger:response AuthLogoutResponse

type AuthRegisterRequest

type AuthRegisterRequest struct {
	// In: body
	Body struct {
		dto.RegisterDTO
	}
}

swagger:parameters AuthRegisterRequest

type AuthRegisterResponse

type AuthRegisterResponse struct {
	// In: body
	Body struct {
		Data *entity.Session `json:"data"`
	}
}

swagger:response AuthRegisterResponse

type AuthUserRequest

type AuthUserRequest struct {
}

swagger:parameters AuthUserRequest

type AuthUserResponse

type AuthUserResponse struct {
	// In: body
	Body struct {
		Data *entity.User `json:"data"`
	}
}

swagger:response AuthUserResponse

type CreateEventRequest

type CreateEventRequest struct {
	// In: body
	Body struct {
		dto.CreateEventDTO
	}
}

swagger:parameters CreateEventRequest

type CreateEventResponse

type CreateEventResponse struct {
	// In: body
	Body struct {
		Data *entity.Event `json:"data"`
	}
}

swagger:response CreateEventResponse

type CreateEventTypeRequest

type CreateEventTypeRequest struct {
	// In: body
	Body struct {
		dto.CreateEventTypeDTO
	}
}

swagger:parameters CreateEventTypeRequest

type CreateEventTypeResponse

type CreateEventTypeResponse struct {
	// In: body
	Body struct {
		Data *entity.EventType `json:"data"`
	}
}

swagger:response CreateEventTypeResponse

type EditEventTypeRequest

type EditEventTypeRequest struct {
	// In: path
	ID int32 `json:"id"`
	// In: body
	Body struct {
		dto.EditEventTypeDTO
	}
}

swagger:parameters EditEventTypeRequest

type EditEventTypeResponse

type EditEventTypeResponse struct {
	// In: body
	Body struct {
		Data *entity.EventType `json:"data"`
	}
}

swagger:response EditEventTypeResponse

type Event

type Event struct {
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(service service.IEvent) *Event

func (*Event) CreateEvent

func (s *Event) CreateEvent(w http.ResponseWriter, r *http.Request)

swagger:route POST /api/v1/events Event CreateEventRequest

Create an event

Responses:
  200: CreateEventResponse

func (*Event) CreateEventType

func (s *Event) CreateEventType(w http.ResponseWriter, r *http.Request)

swagger:route POST /api/v1/events/types EventType CreateEventTypeRequest

Create an event type

Responses:
  200: CreateEventTypeResponse

func (*Event) EditEventType

func (s *Event) EditEventType(w http.ResponseWriter, r *http.Request)

swagger:route PUT /api/v1/events/types/{id} EventType EditEventTypeRequest

Editing the event type

Responses:
  200: EditEventTypeResponse

func (*Event) FeedEvents

func (s *Event) FeedEvents(w http.ResponseWriter, r *http.Request)

swagger:route GET /api/v1/events/feed Event FeedEventsRequest

Getting a list of friend events

Responses:
  200: FeedEventsResponse

func (*Event) ListEvent

func (s *Event) ListEvent(w http.ResponseWriter, r *http.Request)

swagger:route POST /api/v1/events/list Event ListEventRequest

Getting a list of events

Responses:
  200: ListEventResponse

func (*Event) ListEventType

func (s *Event) ListEventType(w http.ResponseWriter, r *http.Request)

swagger:route GET /api/v1/events/types EventType ListEventTypeRequest

Getting a list of all types of events

Responses:
  200: ListEventTypeResponse

func (*Event) RegisterPrivateRouter

func (s *Event) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)

type FeedEventsRequest

type FeedEventsRequest struct {
}

swagger:parameters FeedEventsRequest

type FeedEventsResponse

type FeedEventsResponse struct {
	// In: body
	Body struct {
		Data []*dto.FeedResponseDTO `json:"data"`
		Meta *utils.Meta            `json:"meta"`
	}
}

swagger:response FeedEventsResponse

type Friend

type Friend struct {
	// contains filtered or unexported fields
}

func NewFriend

func NewFriend(service service.IFriend) *Friend

func (*Friend) FriendList

func (s *Friend) FriendList(w http.ResponseWriter, r *http.Request)

swagger:route GET /api/v1/friends Friend FriendListRequest

Get a list of friends

Responses:
  200: FriendListResponse

func (*Friend) InviteAccept

func (s *Friend) InviteAccept(w http.ResponseWriter, r *http.Request)

swagger:route POST /api/v1/friends/invites/{id} Friend InviteAcceptRequest

Accept a friend request

Responses:
  200: InviteAcceptResponse

func (*Friend) InviteFriend

func (s *Friend) InviteFriend(w http.ResponseWriter, r *http.Request)

swagger:route POST /api/v1/friends/invites Friend InviteFriendRequest

Invite user to friends

Responses:
  200: InviteFriendResponse

func (*Friend) InviteList

func (s *Friend) InviteList(w http.ResponseWriter, r *http.Request)

swagger:route GET /api/v1/friends/invites Friend InviteListRequest

Get a list of pending invitations

Responses:
  200: InviteListResponse

func (*Friend) InviteReject

func (s *Friend) InviteReject(w http.ResponseWriter, r *http.Request)

swagger:route DELETE /api/v1/friends/invites/{id} Friend InviteRejectRequest

Reject a friend request

Responses:
  200: InviteRejectResponse

func (*Friend) RegisterPrivateRouter

func (s *Friend) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)

type FriendListRequest

type FriendListRequest struct {
}

swagger:parameters FriendListRequest

type FriendListResponse

type FriendListResponse struct {
	// In: body
	Body struct {
		Data []*entity.User `json:"data"`
		Meta *utils.Meta    `json:"meta"`
	}
}

swagger:response FriendListResponse

type InviteAcceptRequest

type InviteAcceptRequest struct {
	// In:path
	ID int32 `json:"id"`
}

swagger:parameters InviteAcceptRequest

type InviteAcceptResponse

type InviteAcceptResponse struct {
}

swagger:response InviteAcceptResponse

type InviteFriendRequest

type InviteFriendRequest struct {
	// In: body
	Body struct {
		dto.InviteFriendDTO
	}
}

swagger:parameters InviteFriendRequest

type InviteFriendResponse

type InviteFriendResponse struct {
}

swagger:response InviteFriendResponse

type InviteListRequest

type InviteListRequest struct {
}

swagger:parameters InviteListRequest

type InviteListResponse

type InviteListResponse struct {
	// In: body
	Body struct {
		Data []*dto.InviteListResponseDTO `json:"data"`
		Meta *utils.Meta                  `json:"meta"`
	}
}

swagger:response InviteListResponse

type InviteRejectRequest

type InviteRejectRequest struct {
	// In:path
	ID int32 `json:"id"`
}

swagger:parameters InviteRejectRequest

type InviteRejectResponse

type InviteRejectResponse struct {
}

swagger:response InviteRejectResponse

type ListEventRequest

type ListEventRequest struct {
	// In: body
	Body struct {
		dto.ListEventDTO
	}
}

swagger:parameters ListEventRequest

type ListEventResponse

type ListEventResponse struct {
	// In: body
	Body struct {
		Data []*entity.Event `json:"data"`
		Meta *utils.Meta     `json:"meta"`
	}
}

swagger:response ListEventResponse

type ListEventTypeRequest

type ListEventTypeRequest struct {
}

swagger:parameters ListEventTypeRequest

type ListEventTypeResponse

type ListEventTypeResponse struct {
	// In: body
	Body struct {
		Data []*entity.EventType `json:"data"`
		Meta *utils.Meta         `json:"meta"`
	}
}

swagger:response ListEventTypeResponse

type SwaggerRequest

type SwaggerRequest struct {
}

swagger:parameters SwaggerRequest

type SwaggerResponse

type SwaggerResponse struct {
	// In: body
	Body []byte
}

swagger:response SwaggerResponse

type System

type System struct {
	// contains filtered or unexported fields
}

func NewSystem

func NewSystem(service service.ISystem) *System

func (*System) RegisterPublicRouter

func (s *System) RegisterPublicRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)

func (*System) Swagger

func (s *System) Swagger(w http.ResponseWriter, r *http.Request)

swagger:route GET /api/v1/system/swagger System SwaggerRequest

Get the yaml-file of the swagger description

Responses:
  200: SwaggerResponse

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(service service.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) RegisterPrivateRouter

func (s *User) RegisterPrivateRouter(router *mux.Router, middleware ...mux.MiddlewareFunc)

func (*User) UpdateImage

func (s *User) UpdateImage(w http.ResponseWriter, r *http.Request)

swagger:route PUT /api/v1/user/image User UserUpdateImageRequest

Updating user profile image

Responses:
  200: UserUpdateImageResponse

func (*User) UpdateProfile

func (s *User) UpdateProfile(w http.ResponseWriter, r *http.Request)

swagger:route PUT /api/v1/user/profile User UserUpdateProfileRequest

Updating user information

Responses:
  200: UserUpdateProfileResponse

type UserGetRequest

type UserGetRequest struct {
	// In: path
	ID int32 `json:"id"`
}

swagger:parameters UserGetRequest

type UserGetResponse

type UserGetResponse struct {
	// In: body
	Body struct {
		Data *entity.User `json:"data"`
	}
}

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 UserUpdateImageRequest

type UserUpdateImageRequest struct {
	// In: body
	Body struct {
		dto.UpdateProfileImageDTO
	}
}

swagger:parameters UserUpdateImageRequest

type UserUpdateImageResponse

type UserUpdateImageResponse struct {
	// In: body
	Body struct {
		Data *entity.User `json:"data"`
	}
}

swagger:response UserUpdateImageResponse

type UserUpdateProfileRequest

type UserUpdateProfileRequest struct {
	// In: body
	Body struct {
		dto.UpdateProfileDTO
	}
}

swagger:parameters UserUpdateProfileRequest

type UserUpdateProfileResponse

type UserUpdateProfileResponse struct {
	// In: body
	Body struct {
		Data *entity.User `json:"data"`
	}
}

swagger:response UserUpdateProfileResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL