Documentation
¶
Index ¶
- Constants
- func GetBearerToken(c *gin.Context) (tks string, err error)
- func ParseToken(token string) (clientID, secret string, err error)
- type Render
- type Server
- func (s *Server) Authenticate(c *gin.Context)
- func (s *Server) AuthorizeAccessToken(c *gin.Context) (err error)
- func (s *Server) Available() gin.HandlerFunc
- func (s *Server) ClearAuthCookies(c *gin.Context)
- func (s *Server) DeleteShortURL(c *gin.Context)
- func (s *Server) Healthz(c *gin.Context)
- func (s *Server) Index(c *gin.Context)
- func (s *Server) IsHealthy() bool
- func (s *Server) IsReady() bool
- func (s *Server) List(c *gin.Context)
- func (s *Server) Login(c *gin.Context)
- func (s *Server) LoginPage(c *gin.Context)
- func (s *Server) Logout(c *gin.Context)
- func (s *Server) NotAllowed(c *gin.Context)
- func (s *Server) NotFound(c *gin.Context)
- func (s *Server) Readyz(c *gin.Context)
- func (s *Server) Redirect(c *gin.Context)
- func (s *Server) Routes(router *gin.Engine) (err error)
- func (s *Server) Serve() (err error)
- func (s *Server) SetAuthCookies(c *gin.Context, accessToken, refreshToken string) (err error)
- func (s *Server) SetHealthy(status bool)
- func (s *Server) SetReady(status bool)
- func (s *Server) ShortURLDetail(c *gin.Context)
- func (s *Server) ShortURLInfo(c *gin.Context)
- func (s *Server) ShortURLList(c *gin.Context)
- func (s *Server) ShortURLQRCode(c *gin.Context)
- func (s *Server) ShortcrustStats(c *gin.Context)
- func (s *Server) ShortenURL(c *gin.Context)
- func (s *Server) Shutdown(ctx context.Context) (err error)
- func (s *Server) Status(c *gin.Context)
- func (s *Server) URL() string
- func (s *Server) Updates(c *gin.Context)
- func (s *Server) Uptime() time.Duration
- func (s *Server) WebAuthenticate(c *gin.Context)
Constants ¶
const ( ContentDisposition = "Content-Disposition" ContentType = "Content-Type" ContentLength = "Content-Length" AcceptLength = "Accept-Length" ContentTypePNG = "image/png" )
Variables ¶
This section is empty.
Functions ¶
func ParseToken ¶ added in v1.0.0
Types ¶
type Render ¶ added in v1.1.0
type Render struct {
// contains filtered or unexported fields
}
func (*Render) AddPattern ¶ added in v1.1.0
type Server ¶
Implements the link shortening service and API.
func (*Server) Authenticate ¶ added in v1.0.0
func (*Server) AuthorizeAccessToken ¶ added in v1.2.0
func (*Server) Available ¶
func (s *Server) Available() gin.HandlerFunc
Available is middleware that uses healthy boolean to return a service unavailable http status code if the server is shutting down or in maintenance mode. This middleware must be fairly early on in the chain to ensure that complex handling does not slow the shutdown of the server.
func (*Server) ClearAuthCookies ¶ added in v1.2.0
func (*Server) DeleteShortURL ¶ added in v0.2.0
func (*Server) Login ¶ added in v1.1.0
Login handles the POST request from Google when a user successfully logs in.
func (*Server) LoginPage ¶ added in v1.1.0
Login page returns the web-based login for a Google sign-in button.
func (*Server) NotAllowed ¶
func (*Server) SetAuthCookies ¶ added in v1.2.0
func (*Server) SetHealthy ¶ added in v0.2.0
Set the server health state to the status bool.
func (*Server) ShortURLDetail ¶ added in v1.1.0
ShortURL detail returns the detail page for a short URL including analytics info.
func (*Server) ShortURLInfo ¶ added in v0.2.0
func (*Server) ShortURLList ¶ added in v1.1.0
func (*Server) ShortURLQRCode ¶ added in v1.3.0
func (*Server) ShortcrustStats ¶ added in v1.2.0
func (*Server) ShortenURL ¶ added in v0.2.0
func (*Server) Updates ¶ added in v1.1.0
Updates serves a web socket connection to stream live updates back to the client.