Documentation
¶
Index ¶
- Variables
- type CacheOptions
- type Plugin
- func (c *Plugin) AfterChange(db *gorm.DB, event string)
- func (c *Plugin) AfterCreate(db *gorm.DB)
- func (c *Plugin) AfterDelete(db *gorm.DB)
- func (c *Plugin) AfterQuery(db *gorm.DB)
- func (c *Plugin) AfterUpdate(db *gorm.DB)
- func (c *Plugin) CustomQuery(db *gorm.DB)
- func (c *Plugin) Debug(v ...interface{})
- func (c *Plugin) FetchPluginFromDb(db *gorm.DB) (*Plugin, error)
- func (c *Plugin) FlushDB(ctx context.Context) error
- func (c *Plugin) FlushStruct(ctx context.Context, v interface{}) error
- func (c *Plugin) FlushTags(ctx context.Context, v ...string) error
- func (c *Plugin) GetTableNameByStruct(v interface{}) (string, error)
- func (c *Plugin) Hash(db *gorm.DB) string
- func (c *Plugin) Initialize(db *gorm.DB) error
- func (c *Plugin) Name() string
- func (c *Plugin) New(options *CacheOptions) (*Plugin, error)
- func (c *Plugin) ResetCount()
- func (c *Plugin) Tags(db *gorm.DB) []string
- func (c *Plugin) Verbose(v ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var G4Cache = &Plugin{}
View Source
var Helper = &helper{}
Functions ¶
This section is empty.
Types ¶
type CacheOptions ¶
type CacheOptions struct {
Prefix string // prefix for cache layer key
Ttl time.Duration // time to life, for cache data from gorm DB
Serializer serializer.Serializer // need to support serialize & deserialize
Cache cache.Adapter // cache layer
AutoFlush bool // auto flush cache by tag and behaviors(delete, update, save)
Debug bool // show debug [warning], by gorm.DB.Logger
Verbose bool // show verbose debug [info], by gorm.DB.Logger
}
type Plugin ¶ added in v1.0.4
type Plugin struct {
Options *CacheOptions
CountQuery int64
CountHit int64
// contains filtered or unexported fields
}
func (*Plugin) AfterChange ¶ added in v1.0.4
func (*Plugin) AfterCreate ¶ added in v1.0.4
func (*Plugin) AfterDelete ¶ added in v1.0.4
func (*Plugin) AfterQuery ¶ added in v1.0.4
func (*Plugin) AfterUpdate ¶ added in v1.0.4
func (*Plugin) CustomQuery ¶ added in v1.0.4
func (*Plugin) FetchPluginFromDb ¶ added in v1.0.4
func (*Plugin) FlushStruct ¶ added in v1.0.4
func (*Plugin) GetTableNameByStruct ¶ added in v1.0.4
func (*Plugin) ResetCount ¶ added in v1.0.4
func (c *Plugin) ResetCount()
Click to show internal directories.
Click to hide internal directories.