cache

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

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