cache

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const HeaderXData = "x-data"
View Source
const MsgSuccess = "success"

Variables

This section is empty.

Functions

func NewHandlers

func NewHandlers() *handlers

Types

type CacheHandler

type CacheHandler interface {
	// Get is a gin handler that gets cache data.
	Get(c *gin.Context)

	// Set is a gin handler that sets cache data.
	Set(c *gin.Context)

	// Delete is a gin handler that deletes cache data.
	Delete(c *gin.Context)

	// List is a gin handler that lists cache data.
	List(c *gin.Context)

	// Purge is a gin handler that purges cache data.
	Purge(c *gin.Context)
}

type Cacher

type Cacher interface {
	// Get gets data based on `key`.
	Get(key string) (value interface{}, exists bool)

	// Set sets data `key:values`.
	Set(key string, value interface{})

	// Delete deletes data based on `key`.
	Delete(key string)

	// List lists all of data.
	List() map[string]interface{}

	// Purge purges all of data.
	Purge()
}

func NewCache

func NewCache() Cacher

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Inject

func (r *Router) Inject(router *gin.RouterGroup)

Jump to

Keyboard shortcuts

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