container

package
v0.0.0-...-b22f859 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

github.com/donnie4w/tldb

Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

github.com/donnie4w/tldb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bloomfilter

type Bloomfilter struct {
	// contains filtered or unexported fields
}

func NewBloomFilter

func NewBloomFilter(limit int) *Bloomfilter

func (*Bloomfilter) Add

func (this *Bloomfilter) Add(key []byte)

func (*Bloomfilter) Contains

func (this *Bloomfilter) Contains(key []byte) bool

type Consistenthash

type Consistenthash struct {
	// contains filtered or unexported fields
}

func NewConsistenthash

func NewConsistenthash(replicas int) (m *Consistenthash)

func (*Consistenthash) Add

func (this *Consistenthash) Add(keys ...int64)

func (*Consistenthash) Del

func (this *Consistenthash) Del(key int64)

func (*Consistenthash) Get

func (this *Consistenthash) Get(value int64) (node int64)

type FastLinkedMap

type FastLinkedMap[K, V any] struct {
	// contains filtered or unexported fields
}

func NewFastLinkedMap

func NewFastLinkedMap[K, V any]() *FastLinkedMap[K, V]

func (*FastLinkedMap[K, V]) Put

func (this *FastLinkedMap[K, V]) Put(k K, v V)

func (*FastLinkedMap[K, V]) Range

func (this *FastLinkedMap[K, V]) Range(f func(k K, v V) bool)

func (*FastLinkedMap[K, V]) RangeAndDelete

func (this *FastLinkedMap[K, V]) RangeAndDelete(f func(id int64, k K, v V) bool)

type LimitMap

type LimitMap[K, V any] struct {
	// contains filtered or unexported fields
}

func NewLimitMap

func NewLimitMap[K, V any](limit int64) *LimitMap[K, V]

func (*LimitMap[K, V]) Get

func (this *LimitMap[K, V]) Get(k K) (_r V, b bool)

func (*LimitMap[K, V]) Has

func (this *LimitMap[K, V]) Has(k K) (b bool)

func (*LimitMap[K, V]) Put

func (this *LimitMap[K, V]) Put(k K, v V)

type LinkedMap

type LinkedMap[K, V any] struct {
	// contains filtered or unexported fields
}

**********************************************************

func NewLinkedMap

func NewLinkedMap[K, V any]() *LinkedMap[K, V]

func (*LinkedMap[K, V]) Back

func (this *LinkedMap[K, V]) Back() (k K)

func (*LinkedMap[K, V]) BackForEach

func (this *LinkedMap[K, V]) BackForEach(f func(k K, v V) bool)

func (*LinkedMap[K, V]) Del

func (this *LinkedMap[K, V]) Del(key K) (ok bool)

func (*LinkedMap[K, V]) Front

func (this *LinkedMap[K, V]) Front() (k K)

func (*LinkedMap[K, V]) FrontForEach

func (this *LinkedMap[K, V]) FrontForEach(f func(k K, v V) bool)

func (*LinkedMap[K, V]) Get

func (this *LinkedMap[K, V]) Get(key K) (v V, ok bool)

func (*LinkedMap[K, V]) Has

func (this *LinkedMap[K, V]) Has(key K) (ok bool)

func (*LinkedMap[K, V]) Len

func (this *LinkedMap[K, V]) Len() int

func (*LinkedMap[K, V]) Next

func (this *LinkedMap[K, V]) Next(key K) (k K, v V)

func (*LinkedMap[K, V]) Prev

func (this *LinkedMap[K, V]) Prev(key K) (k K, v V, _ok bool)

func (*LinkedMap[K, V]) Put

func (this *LinkedMap[K, V]) Put(k K, v V)

type LruCache

type LruCache[T any] struct {
	// contains filtered or unexported fields
}

func NewLruCache

func NewLruCache[T any](maxEntries int) *LruCache[T]

func (*LruCache[T]) Add

func (this *LruCache[T]) Add(key lru.Key, value T)

func (*LruCache[T]) Get

func (this *LruCache[T]) Get(key lru.Key) (value T, b bool)

func (*LruCache[T]) Remove

func (this *LruCache[T]) Remove(key lru.Key)

func (*LruCache[T]) RemoveMulti

func (this *LruCache[T]) RemoveMulti(keys []string)

type Map

type Map[K any, V any] struct {
	// contains filtered or unexported fields
}

*********************************************************

func NewMap

func NewMap[K any, V any]() *Map[K, V]

func (*Map[K, V]) Del

func (this *Map[K, V]) Del(key K) (ok bool)

func (*Map[K, V]) Get

func (this *Map[K, V]) Get(key K) (v V, b bool)

func (*Map[K, V]) Has

func (this *Map[K, V]) Has(key K) (ok bool)

func (*Map[K, V]) Put

func (this *Map[K, V]) Put(key K, value V)

func (*Map[K, V]) Range

func (this *Map[K, V]) Range(f func(k K, v V) bool)

func (*Map[K, V]) Swap

func (this *Map[K, V]) Swap(key K, value V) (v V, ok bool)

type MapL

type MapL[K any, V any] struct {
	// contains filtered or unexported fields
}

func NewMapL

func NewMapL[K any, V any]() *MapL[K, V]

func (*MapL[K, V]) Del

func (this *MapL[K, V]) Del(key K) (ok bool)

func (*MapL[K, V]) Get

func (this *MapL[K, V]) Get(key K) (_r V, b bool)

func (*MapL[K, V]) Has

func (this *MapL[K, V]) Has(key K) (ok bool)

func (*MapL[K, V]) Len

func (this *MapL[K, V]) Len() int64

func (*MapL[K, V]) Put

func (this *MapL[K, V]) Put(key K, value V)

func (*MapL[K, V]) Range

func (this *MapL[K, V]) Range(f func(k K, v V) bool)

type SortMap

type SortMap[K int | int64 | int8 | int32 | string, V any] struct {
	// contains filtered or unexported fields
}

********************************************************** the big numbers come front

func NewSortMap

func NewSortMap[K int | int64 | int8 | int32 | string, V any]() *SortMap[K, V]

func (*SortMap[K, V]) BackForEach

func (this *SortMap[K, V]) BackForEach(f func(k K, v V) bool)

func (*SortMap[K, V]) DelAndLoadBack

func (this *SortMap[K, V]) DelAndLoadBack() (k K, v V)

func (*SortMap[K, V]) FrontForEach

func (this *SortMap[K, V]) FrontForEach(f func(k K, v V) bool)

func (*SortMap[K, V]) Get

func (this *SortMap[K, V]) Get(key K) (v V, ok bool)

func (*SortMap[K, V]) GetFrontKey

func (this *SortMap[K, V]) GetFrontKey() (k K, ok bool)

func (*SortMap[K, V]) Len

func (this *SortMap[K, V]) Len() int

func (*SortMap[K, V]) Put

func (this *SortMap[K, V]) Put(key K, value V)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL