rtnl

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: BSD-3-Clause Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentDisposition = "Content-Disposition"
	ContentType        = "Content-Type"
	ContentLength      = "Content-Length"
	AcceptLength       = "Accept-Length"
	ContentTypePNG     = "image/png"
)

Variables

This section is empty.

Functions

func GetBearerToken added in v1.0.0

func GetBearerToken(c *gin.Context) (tks string, err error)

func ParseToken added in v1.0.0

func ParseToken(token string) (clientID, secret string, err error)

Types

type Render added in v1.1.0

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

func NewRender added in v1.1.0

func NewRender(fsys fs.FS, pattern string, includes ...string) (render *Render, err error)

func (*Render) AddPattern added in v1.1.0

func (r *Render) AddPattern(fsys fs.FS, pattern string, includes ...string) (err error)

func (*Render) Instance added in v1.1.0

func (r *Render) Instance(name string, data any) render.Render

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Implements the link shortening service and API.

func New

func New(conf config.Config) (s *Server, err error)

func (*Server) Authenticate added in v1.0.0

func (s *Server) Authenticate(c *gin.Context)

func (*Server) AuthorizeAccessToken added in v1.2.0

func (s *Server) AuthorizeAccessToken(c *gin.Context) (err error)

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 (s *Server) ClearAuthCookies(c *gin.Context)

func (*Server) DeleteShortURL added in v0.2.0

func (s *Server) DeleteShortURL(c *gin.Context)

func (*Server) Healthz added in v0.2.0

func (s *Server) Healthz(c *gin.Context)

func (*Server) Index added in v1.1.0

func (s *Server) Index(c *gin.Context)

Index returns the home page and landing dashboard.

func (*Server) IsHealthy

func (s *Server) IsHealthy() bool

Determines if the server is healthy or not.

func (*Server) IsReady added in v0.2.0

func (s *Server) IsReady() bool

Determines if the server is ready or not.

func (*Server) List added in v1.1.0

func (s *Server) List(c *gin.Context)

func (*Server) Login added in v1.1.0

func (s *Server) Login(c *gin.Context)

Login handles the POST request from Google when a user successfully logs in.

func (*Server) LoginPage added in v1.1.0

func (s *Server) LoginPage(c *gin.Context)

Login page returns the web-based login for a Google sign-in button.

func (*Server) Logout added in v1.2.0

func (s *Server) Logout(c *gin.Context)

func (*Server) NotAllowed

func (s *Server) NotAllowed(c *gin.Context)

func (*Server) NotFound

func (s *Server) NotFound(c *gin.Context)

func (*Server) Readyz added in v0.2.0

func (s *Server) Readyz(c *gin.Context)

func (*Server) Redirect added in v0.2.0

func (s *Server) Redirect(c *gin.Context)

func (*Server) Routes

func (s *Server) Routes(router *gin.Engine) (err error)

func (*Server) Serve

func (s *Server) Serve() (err error)

func (*Server) SetAuthCookies added in v1.2.0

func (s *Server) SetAuthCookies(c *gin.Context, accessToken, refreshToken string) (err error)

func (*Server) SetHealthy added in v0.2.0

func (s *Server) SetHealthy(status bool)

Set the server health state to the status bool.

func (*Server) SetReady added in v0.2.0

func (s *Server) SetReady(status bool)

Set the server ready state to the status bool.

func (*Server) ShortURLDetail added in v1.1.0

func (s *Server) ShortURLDetail(c *gin.Context)

ShortURL detail returns the detail page for a short URL including analytics info.

func (*Server) ShortURLInfo added in v0.2.0

func (s *Server) ShortURLInfo(c *gin.Context)

func (*Server) ShortURLList added in v1.1.0

func (s *Server) ShortURLList(c *gin.Context)

func (*Server) ShortURLQRCode added in v1.3.0

func (s *Server) ShortURLQRCode(c *gin.Context)

func (*Server) ShortcrustStats added in v1.2.0

func (s *Server) ShortcrustStats(c *gin.Context)

func (*Server) ShortenURL added in v0.2.0

func (s *Server) ShortenURL(c *gin.Context)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) (err error)

func (*Server) Status

func (s *Server) Status(c *gin.Context)

func (*Server) URL

func (s *Server) URL() string

URL returns the URL of the server determined by the socket addr.

func (*Server) Updates added in v1.1.0

func (s *Server) Updates(c *gin.Context)

Updates serves a web socket connection to stream live updates back to the client.

func (*Server) Uptime

func (s *Server) Uptime() time.Duration

Compute how long the server has been running for status calls.

func (*Server) WebAuthenticate added in v1.2.0

func (s *Server) WebAuthenticate(c *gin.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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