v0.5.0
Overview
- Simplified storage.
New storage interface
Main storage, rate limit storage, and cache has been unified into a single storage. The mainStorage, rateLimitStorage, and cache parameters of NewSever() has been replaced by a single storage parameter. The MainStorageInterface, RateLimitStorage, and CacheInterface has been replaced by StorageInterface.
The new StorageInterface has a similar API to the previous MainStorageInterface, but with the errors replaced and the Set() method replaced by an Add() method.
type StorageInterface interface {
Get(key string) ([]byte, int32, error)
Add(key string, value []byte, expiresAt time.Time) error
Update(key string, value []byte, expiresAt time.Time, counter int32) error
Delete(key string) error
}Note all existing data will be invalid.