Documentation ¶
Index ¶
- Variables
- type Cache
- type CacheNode
- func (node *CacheNode) Del(ctx context.Context, key string)
- func (node *CacheNode) Get(ctx context.Context, key string) (value []byte, expiredAt time.Time, found bool)
- func (node *CacheNode) Owners(key string) (owners []string)
- func (node *CacheNode) Rebase(ctx context.Context)
- func (node *CacheNode) Set(ctx context.Context, key string, value []byte)
- func (node *CacheNode) SetExpired(ctx context.Context, key string, value []byte, expiredAt time.Time)
- func (node *CacheNode) SetTTL(ctx context.Context, key string, value []byte, ttlSeconds int)
- func (node *CacheNode) Stats(_ context.Context) (stats Stats)
- type Node
- type Option
- type Stats
- type Storage
- type Swarm
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var NeverExpired = time.Time{}
Functions ¶
This section is empty.
Types ¶
type CacheNode ¶
type CacheNode struct {
// contains filtered or unexported fields
}
func (*CacheNode) SetExpired ¶
type Swarm ¶
type Swarm interface { Name() string KeyOwners(key string) []Node OnRebase(func(ctx context.Context)) Del(ctx context.Context, key string) (err error) Set(ctx context.Context, key string, value []byte, expiredAt time.Time) (err error) OnStats(func(ctx context.Context) Stats) OnDel(func(ctx context.Context, key string)) OnSet(func(ctx context.Context, key string, value []byte, expiredAt time.Time)) OnGet(func(ctx context.Context, key string) (value []byte, expiredAt time.Time, found bool)) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.