Documentation
¶
Index ¶
- func DefaultHandleFunc(c *gin.Context)
- func NewRouter(handleFunctions ApiHandleFunctions) *gin.Engine
- func NewRouterWithGinEngine(router *gin.Engine, handleFunctions ApiHandleFunctions) *gin.Engine
- type ApiHandleFunctions
- type Attachment
- type AuthRequest
- type AuthResponse
- type Chat
- type DefaultAPI
- type ErrorResponse
- type Message
- type Route
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHandleFunc ¶
Default handler for not yet implemented routes
func NewRouter ¶
func NewRouter(handleFunctions ApiHandleFunctions) *gin.Engine
NewRouter returns a new router.
func NewRouterWithGinEngine ¶
func NewRouterWithGinEngine(router *gin.Engine, handleFunctions ApiHandleFunctions) *gin.Engine
NewRouter add routes to existing gin engine.
Types ¶
type ApiHandleFunctions ¶
type ApiHandleFunctions struct {
// Routes for the DefaultAPI part of the API
DefaultAPI DefaultAPI
}
type Attachment ¶
type AuthRequest ¶
type AuthResponse ¶
type DefaultAPI ¶
type DefaultAPI interface {
// CreateChat Post /chats
CreateChat(c *gin.Context)
// CreateMessage Post /chats/:chatId/messages
CreateMessage(c *gin.Context)
// DeleteChat Delete /chats/:chatId
DeleteChat(c *gin.Context)
// GetChat Get /chats/:chatId
GetChat(c *gin.Context)
// GetChats Get /chats
GetChats(c *gin.Context)
// GetMe Get /users/me
GetMe(c *gin.Context)
// GetMessage Get /chats/:chatId/messages/:messageId
GetMessage(c *gin.Context)
// GetMessages Get /chats/:chatId/messages
GetMessages(c *gin.Context)
// GetUsersList Get /users
GetUsersList(c *gin.Context)
// LoginUser Post /auth/login
LoginUser(c *gin.Context)
// RegisterUser Post /auth/register
RegisterUser(c *gin.Context)
// UpdateChat Put /chats/:chatId
UpdateChat(c *gin.Context)
// UpdateMessage Put /chats/:chatId/messages/:messageId
UpdateMessage(c *gin.Context)
}
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error,omitempty"`
}
type Route ¶
type Route struct {
// Name is the name of this Route.
Name string
// Method is the string for the HTTP method. ex) GET, POST etc..
Method string
// Pattern is the pattern of the URI.
Pattern string
// HandlerFunc is the handler function of this route.
HandlerFunc gin.HandlerFunc
}
Route is the information for every URI.
Click to show internal directories.
Click to hide internal directories.