refactor wip

This commit is contained in:
Kevin Pham
2023-11-19 15:03:11 -06:00
parent 98fa53287b
commit ee9066dedb
27 changed files with 377 additions and 210 deletions

View File

@@ -0,0 +1,19 @@
package proxychain
import "time"
// Cache provides an interface for caching mechanisms.
// It supports operations to get, set, and invalidate cache entries.
// Implementations should ensure thread safety, efficiency
type Cache interface {
// Get Retrieves a cached value by its key. Returns the value and a boolean indicating
Get(key string) (value interface{}, found bool)
// Set - Stores a value associated with a key in the cache for a specified time-to-live (ttl).
// If ttl is zero, the cache item has no expiration.
Set(key string, value interface{}, ttl time.Duration)
// Invalidate - Removes a value from the cache by its key. If the key does not exist,
// it should perform a no-op or return a suitable error.
Invalidate(key string) error
}