rtnl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: BSD-3-Clause Imports: 25 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 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) 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) 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) ShortURLInfo added in v0.2.0

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