github.com/angenalZZZ/gofunc@v0.0.0-20210507121333-48ff1be3917b/cmd/fastcache1e6/cache.go (about)

     1  package main
     2  
     3  import "context"
     4  
     5  type cacheServiceImpl struct{}
     6  
     7  var defaultService *cacheServiceImpl
     8  
     9  // Handle input and output, processing logic.
    10  func (c *cacheServiceImpl) Handle(in []byte) (out []byte) {
    11  	out = in
    12  	return
    13  }
    14  
    15  func (c *cacheServiceImpl) Write(context.Context, *CacheWriter) (*CacheTtl, error) {
    16  	return &CacheTtl{Ttl: 0}, nil
    17  }
    18  
    19  func (c *cacheServiceImpl) Read(context.Context, *CacheReader) (*CacheValue, error) {
    20  	return &CacheValue{Value: []byte{}}, nil
    21  }
    22  
    23  func (c *cacheServiceImpl) Delete(context.Context, *CacheReader) (*CacheTtl, error) {
    24  	return &CacheTtl{Ttl: 0}, nil
    25  }
    26  
    27  func (c *cacheServiceImpl) Ttl(context.Context, *CacheReader) (*CacheTtl, error) {
    28  	return &CacheTtl{Ttl: 0}, nil
    29  }