github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/utils/cache/without_db.go (about)

     1  //go:build no_cachedb
     2  // +build no_cachedb
     3  
     4  package cache
     5  
     6  import (
     7  	"context"
     8  	"time"
     9  )
    10  
    11  func SetPath(_ string) {
    12  	// no nothing
    13  }
    14  
    15  func createDb(_ string) {
    16  	// do nothing
    17  }
    18  
    19  func Read(namespace string, key string, ptr any) bool {
    20  	return read(namespace, key, ptr)
    21  }
    22  
    23  func listDb(_ context.Context, _ string) (interface{}, error) {
    24  	return nil, nil
    25  }
    26  
    27  func Write(namespace string, key string, value any, ttl time.Time) {
    28  	write(namespace, key, value, ttl)
    29  }
    30  
    31  func trimDb(_ context.Context, _ string) ([]string, error) {
    32  	return nil, nil
    33  }
    34  
    35  func flushDb(_ context.Context, _ string) ([]string, error) {
    36  	return nil, nil
    37  }
    38  
    39  func CloseDb() {
    40  	// do nothing
    41  }