Documentation
¶
Index ¶
- type CacheMod
- type PgCache
- func (s *PgCache) CleanUp(ctx context.Context, interval int)
- func (s *PgCache) ClearCacheStore()
- func (s *PgCache) CreateCacheTable()
- func (s *PgCache) Delete(id string)
- func (s *PgCache) DeleteExpired()
- func (s *PgCache) DropCacheStore()
- func (s *PgCache) Get(id string) ([]byte, bool)
- func (s *PgCache) Put(id string, content []byte)
- func (s *PgCache) PutWitTTL(id string, content []byte, ttl int)
- func (s *PgCache) StartCleaner(interval int)
- func (s *PgCache) StopCleaner()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PgCache ¶
type PgCache struct {
DbPool *sql.DB `required:"true"`
TTL int
CacheTable string `required:"true"`
CleanerInterval int `default:"60"` // in seconds
// contains filtered or unexported fields
}
func NewPgCache ¶
func (*PgCache) ClearCacheStore ¶
func (s *PgCache) ClearCacheStore()
func (*PgCache) CreateCacheTable ¶
func (s *PgCache) CreateCacheTable()
func (*PgCache) DeleteExpired ¶
func (s *PgCache) DeleteExpired()
func (*PgCache) DropCacheStore ¶
func (s *PgCache) DropCacheStore()
func (*PgCache) StartCleaner ¶
func (*PgCache) StopCleaner ¶
func (s *PgCache) StopCleaner()
Click to show internal directories.
Click to hide internal directories.