util

package
v0.0.0-...-8a61662 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

View Source
const Time int64 = 1 //3600 * 10

过期时间 10小时

Variables

This section is empty.

Functions

func Copy

func Copy(src, dest string) error

Copy copies src to dest, doesn't matter if src is a directory or a file

func Init

func Init()

Types

type Cache

type Cache struct {
	Value interface{}
	Times int64
}

type CacheManager

type CacheManager struct {
	// contains filtered or unexported fields
}
var Caches *CacheManager

动态缓存数据库

func NewCacheManager

func NewCacheManager(size int) *CacheManager

func (*CacheManager) Delete

func (this *CacheManager) Delete(key string) *Cache

func (*CacheManager) Get

func (this *CacheManager) Get(key string) *Cache

func (*CacheManager) IsExist

func (this *CacheManager) IsExist(key string) bool

func (*CacheManager) IsExpired

func (this *CacheManager) IsExpired(key string, ttl int) bool

func (*CacheManager) Set

func (this *CacheManager) Set(key string, v interface{})

Jump to

Keyboard shortcuts

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