cachepool

package
v3.5.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cachepool []byte缓存池

Index

Constants

This section is empty.

Variables

View Source
var (
	//CachePool []byte 缓存池 2
	CachePool = cachePool2{}
)
View Source
var (
	// IDCachePool []byte 缓存池
	IDCachePool = cachePool{
		// contains filtered or unexported fields
	}
)

Functions

func Apply

func Apply(size int) (id int32)

Apply 申请缓存, 返回缓存id

func Delete

func Delete(id int32)

Delete 通过缓存id删除缓存

func DeleteAll

func DeleteAll()

DeleteAll 清空缓存池

func Existed

func Existed(id int32) bool

Existed 通过缓存id检测是否存在缓存

func Get

func Get(id int32) []byte

Get 通过缓存id获取缓存[]byte

func Set

func Set(id int32, size int) []byte

Set 设置缓存, 通过给定的缓存id

func SetIfNotExist

func SetIfNotExist(id int32, size int) []byte

SetIfNotExist 如果缓存不存在, 则设置缓存池

Types

type Cache

type Cache interface {
	Bytes() []byte
	Free()
}

Cache cache

func Require

func Require(size int) Cache

Require 申请Cache

Jump to

Keyboard shortcuts

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