concretes

package
v0.0.0-...-f513fc6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(
	request contracts.Request,
	response contracts.Response,
	cache contracts.Cachable,
	stack []contracts.ThenableFunc,
	route contracts.Route,
) contracts.ThenableContext

NewContext create new Context instance

func NewMemoryCache

func NewMemoryCache(gc time.Duration) contracts.Cachable

NewMemoryCache create memory cache instance.

func NewRequest

func NewRequest(parent *http.Request) contracts.Request

NewRequest create new request instance.

func NewResponse

func NewResponse(parent http.ResponseWriter) contracts.Response

NewResponse create new response instance.

func NewRoute

func NewRoute(method string, path string, callable contracts.Callable, stack ...contracts.ThenableFunc) contracts.Route

NewRoute returns route instance.

func NewRouter

func NewRouter() contracts.Router

NewRouter create new router.

func NewSession

func NewSession() contracts.Session

NewSession create session storage instance.

func NewUploadedFile

NewUploadedFile 为接收到的文件创建上传文件对象

Types

type MemoryCacher

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

MemoryCacher cacher of mango.

func (*MemoryCacher) Del

func (c *MemoryCacher) Del(id string)

Del deletes stored value by id.

func (*MemoryCacher) Flush

func (c *MemoryCacher) Flush()

Flush clear all cached data.

func (*MemoryCacher) GC

func (c *MemoryCacher) GC()

GC clear expired data.

func (*MemoryCacher) Get

func (c *MemoryCacher) Get(id string) interface{}

Get retrieves cached value from cacher.

func (*MemoryCacher) Pop

func (c *MemoryCacher) Pop(id string) interface{}

Pop pops value from queue.

func (*MemoryCacher) Push

func (c *MemoryCacher) Push(id string, value interface{})

Push pushs value into queue.

func (*MemoryCacher) Set

func (c *MemoryCacher) Set(id string, value interface{}, ttl time.Duration)

Set stores given value into cacher.

Jump to

Keyboard shortcuts

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