github.com/argoproj/argo-cd@v1.8.7/util/cache/client.go (about)

     1  package cache
     2  
     3  import (
     4  	"context"
     5  	"errors"
     6  	"time"
     7  )
     8  
     9  var ErrCacheMiss = errors.New("cache: key is missing")
    10  
    11  type Item struct {
    12  	Key    string
    13  	Object interface{}
    14  	// Expiration is the cache expiration time.
    15  	Expiration time.Duration
    16  }
    17  
    18  type CacheClient interface {
    19  	Set(item *Item) error
    20  	Get(key string, obj interface{}) error
    21  	Delete(key string) error
    22  	OnUpdated(ctx context.Context, key string, callback func() error) error
    23  	NotifyUpdated(key string) error
    24  }