github.com/angenalZZZ/gofunc@v0.0.0-20210507121333-48ff1be3917b/data/cache/codec/interface.go (about)

     1  package codec
     2  
     3  import (
     4  	"github.com/angenalZZZ/gofunc/data/cache/store"
     5  	"time"
     6  )
     7  
     8  // CodecInterface represents an instance of a cache codec
     9  type CodecInterface interface {
    10  	Get(key string) (interface{}, error)
    11  	Set(key string, value interface{}, options *store.Options) error
    12  	TTL(key string) (time.Duration, error)
    13  	Delete(key string) error
    14  	Invalidate(options store.InvalidateOptions) error
    15  	Clear() error
    16  
    17  	GetStore() store.Interface
    18  	GetStats() *Stats
    19  }