Documentation
¶
Index ¶
- Constants
- func NewLogger() *logrus.Logger
- func SetupRouter(server *Server) *gin.Engine
- type CreateShortURLRequest
- type Server
- func (server *Server) CreateShortURL(ctx *gin.Context)
- func (server *Server) DeleteShortURL(ctx *gin.Context)
- func (server *Server) GetOriginalURL(ctx *gin.Context)
- func (server *Server) GetURLStats(ctx *gin.Context)
- func (server *Server) HealthCheck(ctx *gin.Context)
- func (server *Server) Start() error
- func (server *Server) UpdateShortURL(ctx *gin.Context)
- type UpdateShortURLRequest
Constants ¶
View Source
const ( ErrInvalidURL = "invalid url format" ErrShortCodeRequired = "short url code is required" ErrShortCodeNotFound = "short url not found" )
Variables ¶
This section is empty.
Functions ¶
func SetupRouter ¶
Types ¶
type CreateShortURLRequest ¶
type CreateShortURLRequest struct {
URL string `json:"url" binding:"required,httpurl"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CreateShortURL ¶
func (*Server) DeleteShortURL ¶
func (*Server) GetOriginalURL ¶
func (*Server) GetURLStats ¶
func (*Server) HealthCheck ¶
func (*Server) UpdateShortURL ¶
type UpdateShortURLRequest ¶
type UpdateShortURLRequest struct {
URL string `json:"url" binding:"required,httpurl"`
}
Click to show internal directories.
Click to hide internal directories.