Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPartitionNum uint64 = 16 DefaultPartitionMask uint64 = 0xF )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataDictionary ¶
type DataDictionary interface { Add(key uint64, data []byte, expiration time.Time) error Get(key uint64) (Buffer, error) Clean(ctx context.Context) error }
func NewMapDictionary ¶
func NewMapDictionary(pool DataPool) DataDictionary
func NewPartitionedDictionary ¶
func NewPartitionedDictionary( partitionNum uint64, partitionMask uint64, partitionFabric func() (DataDictionary, error), ) (DataDictionary, error)
func NewSyncMapDictionary ¶
func NewSyncMapDictionary(pool DataPool) DataDictionary
type DataPool ¶
type DataPool interface { Copy(data []byte, expiration time.Time) (Buffer, error) Clean(ctx context.Context) error }
func NewDataPool ¶
func NewDataPool(memPool MemoryPool) (DataPool, error)
type InMemStorages ¶
type InMemStorages struct {
// contains filtered or unexported fields
}
func (*InMemStorages) Add ¶
func (o *InMemStorages) Add(key, body []byte) error
func (*InMemStorages) ID ¶
func (o *InMemStorages) ID() string
type MapDictionary ¶
type MemoryPool ¶
func NewMemoryPool ¶
func NewMemoryPool(sz int) MemoryPool
type PartitionedDictionary ¶
type PartitionedDictionary struct {
// contains filtered or unexported fields
}
type Storages ¶
type Storages interface { ID() string Add(key, body []byte) error Get(key []byte) (Buffer, error) Clean(ctx context.Context) error }
func NewInMemStorages ¶
func NewInMemStorages( config config.Config, dataDict DataDictionary, ) (Storages, error)
type SyncMapDictionary ¶
Click to show internal directories.
Click to hide internal directories.