block5.go 428 B

12345678910111213141516171819
  1. package cblocks
  2. import (
  3. "html/template"
  4. )
  5. func (this *CacheBlocks) GetBlock5(host, url string) (template.HTML, bool) {
  6. if mapCache, ok := this.cacheBlocks[host]; ok {
  7. if data, ok := mapCache.CacheBlock5[url]; ok {
  8. return data, ok
  9. }
  10. }
  11. return template.HTML(""), false
  12. }
  13. func (this *CacheBlocks) SetBlock5(host, url string, data template.HTML) {
  14. this.prepare(host)
  15. this.cacheBlocks[host].CacheBlock5[url] = data
  16. }