github.com/safedep/dry@v0.0.0-20241016050132-a15651f0548b/cache/nocache.go (about)

     1  package cache
     2  
     3  import (
     4  	"fmt"
     5  	"time"
     6  )
     7  
     8  type noCache struct{}
     9  
    10  func newNoCache() Cache {
    11  	return &noCache{}
    12  }
    13  
    14  func (c *noCache) Put(key *CacheKey, data *CacheData, ttl time.Duration) error {
    15  	return fmt.Errorf("nocache: no put")
    16  }
    17  
    18  func (c *noCache) Get(key *CacheKey) (*CacheData, error) {
    19  	return nil, fmt.Errorf("nocache: no get")
    20  }