golib/gcache/cache.go

19 lines
326 B
Go
Raw Normal View History

//
// cache.go
// Copyright (C) 2023 tiglog <me@tiglog.com>
//
// Distributed under terms of the MIT license.
//
package gcache
import "time"
type ICache interface {
Set(key string, data []byte, expires time.Duration) error
Get(key string) ([]byte, error)
Delete(key string) error
Flush() error
Has(key string) bool
}