rtnl

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: BSD-3-Clause Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

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) 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) 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)

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)

func (*Server) LoginPage added in v1.1.0

func (s *Server) LoginPage(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) 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)

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) 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)

func (*Server) Uptime

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

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

Jump to

Keyboard shortcuts

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