Documentation ¶
Index ¶
- type AdminHandler
- type SimpleTtlStore
- func (s *SimpleTtlStore) Add(key string, val []byte, ttl uint32) error
- func (s *SimpleTtlStore) Delete(key string)
- func (s *SimpleTtlStore) Find(val []byte, prefix string) string
- func (s *SimpleTtlStore) FindAll(val []byte, prefix string) (keys []string)
- func (s *SimpleTtlStore) Get(key string) []byte
- func (s *SimpleTtlStore) List(prefix string) (keys []string)
- func (s *SimpleTtlStore) LoadFile(path string) error
- func (s *SimpleTtlStore) Prune()
- func (s *SimpleTtlStore) PrunePeriodically(interval time.Duration)
- func (s *SimpleTtlStore) Remove(key string, val []byte)
- func (s *SimpleTtlStore) Set(key string, val []byte, ttl uint32) error
- func (s *SimpleTtlStore) Size() int
- func (s *SimpleTtlStore) Values(key string) (vals [][]byte)
- func (s *SimpleTtlStore) WriteFile(path string) error
- func (s *SimpleTtlStore) WriteFilePeriodically(path string, interval time.Duration) error
- type TtlStore
- type ValueWithExpiration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminHandler ¶
func (*AdminHandler) ServeHTTP ¶
func (h *AdminHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type SimpleTtlStore ¶
type SimpleTtlStore struct { MaxSize int // contains filtered or unexported fields }
func (*SimpleTtlStore) Delete ¶
func (s *SimpleTtlStore) Delete(key string)
func (*SimpleTtlStore) FindAll ¶
func (s *SimpleTtlStore) FindAll(val []byte, prefix string) (keys []string)
func (*SimpleTtlStore) Get ¶
func (s *SimpleTtlStore) Get(key string) []byte
func (*SimpleTtlStore) List ¶
func (s *SimpleTtlStore) List(prefix string) (keys []string)
func (*SimpleTtlStore) LoadFile ¶
func (s *SimpleTtlStore) LoadFile(path string) error
func (*SimpleTtlStore) Prune ¶
func (s *SimpleTtlStore) Prune()
func (*SimpleTtlStore) PrunePeriodically ¶
func (s *SimpleTtlStore) PrunePeriodically(interval time.Duration)
func (*SimpleTtlStore) Remove ¶
func (s *SimpleTtlStore) Remove(key string, val []byte)
func (*SimpleTtlStore) Size ¶
func (s *SimpleTtlStore) Size() int
func (*SimpleTtlStore) Values ¶
func (s *SimpleTtlStore) Values(key string) (vals [][]byte)
func (*SimpleTtlStore) WriteFile ¶
func (s *SimpleTtlStore) WriteFile(path string) error
func (*SimpleTtlStore) WriteFilePeriodically ¶
func (s *SimpleTtlStore) WriteFilePeriodically(path string, interval time.Duration) error
type TtlStore ¶
type TtlStore interface { // appends val to any other values associated with key Add(key string, val []byte, ttl uint32) error // associates val with key, replacing any other values Set(key string, val []byte, ttl uint32) error // gets all keys starting with prefix List(prefix string) []string // gets the first key starting with prefix found associated with val Find(val []byte, prefix string) string // gets all keys starting with prefix found associated with val FindAll(val []byte, prefix string) []string // gets all non-expired values associated with key Values(key string) [][]byte // gets the first non-expired value associated with key Get(key string) []byte // unassociates val with key, leaving any other values Remove(key string, val []byte) // deletes all values associated with key Delete(key string) }
type ValueWithExpiration ¶
Click to show internal directories.
Click to hide internal directories.