Documentation ¶
Index ¶
- type CacheHandler
- func (c CacheHandler) DelEntries(entrySlice interface{}, sql string, args ...interface{}) error
- func (c CacheHandler) GetEntries(entrySlice interface{}, sql string, args ...interface{}) error
- func (c CacheHandler) GetEntriesAndCount(entries interface{}, sql string, args ...interface{}) (int64, error)
- func (c CacheHandler) GetEntry(entry interface{}) (bool, error)
- type EntryCache
- type ICache
- type ICacheHandler
- type IDB
- type JsonSerializer
- type KeyValue
- type Options
- type OptionsFunc
- type ReturnKeyValue
- type Serializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheHandler ¶
type CacheHandler struct {
// contains filtered or unexported fields
}
func NewCacheHandler ¶
func NewCacheHandler(cacheHandler ICache, databaseHandler IDB, options ...OptionsFunc) *CacheHandler
func (CacheHandler) DelEntries ¶
func (c CacheHandler) DelEntries(entrySlice interface{}, sql string, args ...interface{}) error
func (CacheHandler) GetEntries ¶
func (c CacheHandler) GetEntries(entrySlice interface{}, sql string, args ...interface{}) error
func (CacheHandler) GetEntriesAndCount ¶ added in v0.2.3
func (c CacheHandler) GetEntriesAndCount(entries interface{}, sql string, args ...interface{}) (int64, error)
func (CacheHandler) GetEntry ¶
func (c CacheHandler) GetEntry(entry interface{}) (bool, error)
type EntryCache ¶
type EntryCache struct {
// contains filtered or unexported fields
}
type ICacheHandler ¶
type ICacheHandler interface { // GetEntry get a pointer to an entity type and return the entity GetEntry(entry interface{}) (bool, error) // GetEntries cache the entity content obtained through sql, and return the entity of the array pointer type GetEntries(entrySlice interface{}, sql string, args ...interface{}) error // GetEntriesAndCount cache the entity content obtained through sql, and return the entity of the array pointer type, and return the total quantity GetEntriesAndCount(entries interface{}, sql string, args ...interface{}) (int64, error) // DelEntries delete the corresponding execution entity through sql, // Before the update, you can query the id to be deleted first, and then delete these through defer DelEntries(entrySlice interface{}, sql string, args ...interface{}) error }
type IDB ¶
type IDB interface { // GetEntries cache the entity content obtained through sql, and return the entity of the array pointer type GetEntries(entries interface{}, sql string) error // GetEntry get a pointer to an entity type and return the entity GetEntry(entry interface{}, sql string) (bool, error) }
type JsonSerializer ¶
type JsonSerializer struct { }
func (JsonSerializer) Deserialize ¶
func (j JsonSerializer) Deserialize(data []byte, ptr interface{}) error
func (JsonSerializer) Serialize ¶
func (j JsonSerializer) Serialize(value interface{}) ([]byte, error)
type OptionsFunc ¶
type OptionsFunc func(o *Options)
func WithCacheTagName ¶
func WithCacheTagName(cacheTagName string) OptionsFunc
func WithLogger ¶
func WithLogger(logger log.Logger) OptionsFunc
func WithSerializer ¶
func WithSerializer(serializer Serializer) OptionsFunc
func WithServiceName ¶ added in v0.2.0
func WithServiceName(serviceName string) OptionsFunc
type ReturnKeyValue ¶
Click to show internal directories.
Click to hide internal directories.