Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for New (0.11 sec)

  1. internal/cachevalue/cache.go

    	valErr atomic.Pointer[struct {
    		v T
    		e error
    	}]
    	lastUpdateMs atomic.Int64
    	updating     sync.Mutex
    }
    
    // New allocates a new cached value instance. Tt must be initialized with
    // `.TnitOnce`.
    func New[T any]() *Cache[T] {
    	return &Cache[T]{}
    }
    
    // NewFromFunc allocates a new cached value instance and initializes it with an
    // update function, making it ready for use.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Mar 01 16:00:42 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  2. internal/config/cache/cache.go

    }
    
    // Update updates new cache frequency
    func (c *Config) Update(ncfg Config) {
    	configLock.Lock()
    	defer configLock.Unlock()
    
    	c.Enable = ncfg.Enable
    	c.Endpoint = ncfg.Endpoint
    	c.BlockSize = ncfg.BlockSize
    	c.clnt = ncfg.clnt
    }
    
    // cache related errors
    var (
    	ErrInvalidArgument = errors.New("invalid argument")
    	ErrKeyMissing      = errors.New("key is missing")
    )
    
    const (
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.6K bytes
    - Viewed (0)
Back to top