github.com/wormhole-foundation/wormhole-explorer/common@v0.0.0-20240604151348-09585b5b97c5/client/cache/dummycache.go (about)

     1  package cache
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  )
     7  
     8  // DummyCacheClient dummy cache client.
     9  type DummyCacheClient struct {
    10  }
    11  
    12  // NewDummyCacheClient create a new instance of DummyCacheClient
    13  func NewDummyCacheClient() *DummyCacheClient {
    14  	return &DummyCacheClient{}
    15  }
    16  
    17  // Get get method is a dummy method that always does not find the cache.
    18  // Use this Get function when run development enviroment
    19  func (d *DummyCacheClient) Get(ctx context.Context, key string) (string, error) {
    20  	return "", ErrNotFound
    21  }
    22  
    23  // Set set method is a dummy method that always does not set the cache.
    24  func (d *DummyCacheClient) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error {
    25  	return nil
    26  }
    27  
    28  // Close dummy cache client.
    29  func (d *DummyCacheClient) Close() error {
    30  	return nil
    31  }