collection2

package
v0.7.28 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Async

type Async[Id constraints.Ordered, MapItem any, DbItem any] struct {
	// contains filtered or unexported fields
}

func (*Async[Id, MapItem, DbItem]) Add

func (o *Async[Id, MapItem, DbItem]) Add(e DbItem) (Id, error)

func (*Async[Id, MapItem, DbItem]) AddNamed

func (o *Async[Id, MapItem, DbItem]) AddNamed(name string, e DbItem) (Id, error)

func (*Async[Id, MapItem, DbItem]) Close

func (o *Async[Id, MapItem, DbItem]) Close()

func (*Async[Id, MapItem, DbItem]) Count

func (o *Async[Id, MapItem, DbItem]) Count() int

func (*Async[Id, MapItem, DbItem]) Db

func (o *Async[Id, MapItem, DbItem]) Db() *db.Db

func (*Async[Id, MapItem, DbItem]) DbList

func (o *Async[Id, MapItem, DbItem]) DbList() []DbItem

func (*Async[Id, MapItem, DbItem]) Delete

func (o *Async[Id, MapItem, DbItem]) Delete(id Id) error

func (*Async[Id, MapItem, DbItem]) DeleteAll

func (o *Async[Id, MapItem, DbItem]) DeleteAll() error

func (*Async[Id, MapItem, DbItem]) Empty

func (o *Async[Id, MapItem, DbItem]) Empty() bool

func (*Async[Id, MapItem, DbItem]) ExcludeMutex

func (o *Async[Id, MapItem, DbItem]) ExcludeMutex()

func (*Async[Id, MapItem, DbItem]) Exist

func (o *Async[Id, MapItem, DbItem]) Exist(id Id) bool

func (*Async[Id, MapItem, DbItem]) ForEach

func (o *Async[Id, MapItem, DbItem]) ForEach(fn func(MapItem))

func (*Async[Id, MapItem, DbItem]) ForEachSwarm

func (o *Async[Id, MapItem, DbItem]) ForEachSwarm(fn func(MapItem))

func (*Async[Id, MapItem, DbItem]) Get

func (o *Async[Id, MapItem, DbItem]) Get(id Id) (MapItem, error)

func (*Async[Id, MapItem, DbItem]) GetIfExists

func (o *Async[Id, MapItem, DbItem]) GetIfExists(id Id) (MapItem, bool)

func (*Async[Id, MapItem, DbItem]) HandleImmediate

func (o *Async[Id, MapItem, DbItem]) HandleImmediate()

func (*Async[Id, MapItem, DbItem]) Init

func (o *Async[Id, MapItem, DbItem]) Init()

func (*Async[Id, MapItem, DbItem]) InitError

func (o *Async[Id, MapItem, DbItem]) InitError() error

func (*Async[Id, MapItem, DbItem]) Inited

func (o *Async[Id, MapItem, DbItem]) Inited() bool

func (*Async[Id, MapItem, DbItem]) Keys

func (o *Async[Id, MapItem, DbItem]) Keys() []Id

func (*Async[Id, MapItem, DbItem]) List

func (o *Async[Id, MapItem, DbItem]) List() []MapItem

func (*Async[Id, MapItem, DbItem]) Log

func (o *Async[Id, MapItem, DbItem]) Log() *ulog.Log

func (*Async[Id, MapItem, DbItem]) LogUpdate

func (o *Async[Id, MapItem, DbItem]) LogUpdate(yes bool)

func (*Async[Id, MapItem, DbItem]) OnConvert

func (o *Async[Id, MapItem, DbItem]) OnConvert(newMapItem func(DbItem) MapItem, mapToDbItem func(MapItem) DbItem)

func (*Async[Id, MapItem, DbItem]) OnDelete

func (o *Async[Id, MapItem, DbItem]) OnDelete(onDelete func(MapItem, *bun.DeleteQuery))

func (*Async[Id, MapItem, DbItem]) OnSelect

func (o *Async[Id, MapItem, DbItem]) OnSelect(onSelect func(*bun.SelectQuery))

func (*Async[Id, MapItem, DbItem]) Open

func (o *Async[Id, MapItem, DbItem]) Open(name string, log *ulog.Log, db *db.Db, dbItemId func(DbItem) Id, interval time.Duration, handle func())

func (*Async[Id, MapItem, DbItem]) Remove

func (o *Async[Id, MapItem, DbItem]) Remove(id Id, fn func(e MapItem) MapItem) error

func (*Async[Id, MapItem, DbItem]) Replace

func (o *Async[Id, MapItem, DbItem]) Replace(e MapItem) error

func (*Async[Id, MapItem, DbItem]) SoftDelete

func (o *Async[Id, MapItem, DbItem]) SoftDelete(id Id, fn func(e MapItem) MapItem) error

func (*Async[Id, MapItem, DbItem]) SoftReplace

func (o *Async[Id, MapItem, DbItem]) SoftReplace(e MapItem) error

func (*Async[Id, MapItem, DbItem]) SoftUpdate

func (o *Async[Id, MapItem, DbItem]) SoftUpdate(id Id, fn func(e MapItem) MapItem) error

func (*Async[Id, MapItem, DbItem]) TwoStageClose

func (o *Async[Id, MapItem, DbItem]) TwoStageClose() func()

func (*Async[Id, MapItem, DbItem]) Update

func (o *Async[Id, MapItem, DbItem]) Update(id Id, fn func(e MapItem) MapItem) error

func (*Async[Id, MapItem, DbItem]) Walk

func (o *Async[Id, MapItem, DbItem]) Walk(fn func(MapItem) bool) bool

type AsyncPlain

type AsyncPlain[Id constraints.Ordered, Item any] struct {
	// contains filtered or unexported fields
}

func (*AsyncPlain[Id, Item]) Add

func (o *AsyncPlain[Id, Item]) Add(e Item) (Id, error)

func (*AsyncPlain[Id, Item]) AddNamed

func (o *AsyncPlain[Id, Item]) AddNamed(name string, e Item) (Id, error)

func (*AsyncPlain[Id, Item]) Close

func (o *AsyncPlain[Id, Item]) Close()

func (*AsyncPlain[Id, Item]) Count

func (o *AsyncPlain[Id, Item]) Count() int

func (*AsyncPlain[Id, Item]) Db

func (o *AsyncPlain[Id, Item]) Db() *db.Db

func (*AsyncPlain[Id, Item]) Delete

func (o *AsyncPlain[Id, Item]) Delete(id Id) error

func (*AsyncPlain[Id, Item]) DeleteAll

func (o *AsyncPlain[Id, Item]) DeleteAll() error

func (*AsyncPlain[Id, Item]) Empty

func (o *AsyncPlain[Id, Item]) Empty() bool

func (*AsyncPlain[Id, Item]) ExcludeMutex

func (o *AsyncPlain[Id, Item]) ExcludeMutex()

func (*AsyncPlain[Id, Item]) Exist

func (o *AsyncPlain[Id, Item]) Exist(id Id) bool

func (*AsyncPlain[Id, Item]) ForEach

func (o *AsyncPlain[Id, Item]) ForEach(fn func(Item))

func (*AsyncPlain[Id, Item]) ForEachSwarm

func (o *AsyncPlain[Id, Item]) ForEachSwarm(fn func(Item))

func (*AsyncPlain[Id, Item]) Get

func (o *AsyncPlain[Id, Item]) Get(id Id) (Item, error)

func (*AsyncPlain[Id, Item]) GetIfExists

func (o *AsyncPlain[Id, Item]) GetIfExists(id Id) (Item, bool)

func (*AsyncPlain[Id, Item]) HandleImmediate

func (o *AsyncPlain[Id, Item]) HandleImmediate()

func (*AsyncPlain[Id, Item]) Init

func (o *AsyncPlain[Id, Item]) Init()

func (*AsyncPlain[Id, Item]) InitError

func (o *AsyncPlain[Id, Item]) InitError() error

func (*AsyncPlain[Id, Item]) Inited

func (o *AsyncPlain[Id, Item]) Inited() bool

func (*AsyncPlain[Id, Item]) Keys

func (o *AsyncPlain[Id, Item]) Keys() []Id

func (*AsyncPlain[Id, Item]) List

func (o *AsyncPlain[Id, Item]) List() []Item

func (*AsyncPlain[Id, Item]) Log

func (o *AsyncPlain[Id, Item]) Log() *ulog.Log

func (*AsyncPlain[Id, Item]) LogUpdate

func (o *AsyncPlain[Id, Item]) LogUpdate(yes bool)

func (*AsyncPlain[Id, Item]) OnDelete

func (o *AsyncPlain[Id, Item]) OnDelete(onDelete func(Item, *bun.DeleteQuery))

func (*AsyncPlain[Id, Item]) OnSelect

func (o *AsyncPlain[Id, Item]) OnSelect(onSelect func(*bun.SelectQuery))

func (*AsyncPlain[Id, Item]) Open

func (o *AsyncPlain[Id, Item]) Open(name string, log *ulog.Log, db *db.Db, ItemId func(Item) Id, interval time.Duration, handle func())

func (*AsyncPlain[Id, Item]) Remove

func (o *AsyncPlain[Id, Item]) Remove(id Id, fn func(e Item) Item) error

func (*AsyncPlain[Id, Item]) Replace

func (o *AsyncPlain[Id, Item]) Replace(e Item) error

func (*AsyncPlain[Id, Item]) SoftDelete

func (o *AsyncPlain[Id, Item]) SoftDelete(id Id, fn func(e Item) Item) error

func (*AsyncPlain[Id, Item]) SoftReplace

func (o *AsyncPlain[Id, Item]) SoftReplace(e Item) error

func (*AsyncPlain[Id, Item]) SoftUpdate

func (o *AsyncPlain[Id, Item]) SoftUpdate(id Id, fn func(e Item) Item) error

func (*AsyncPlain[Id, Item]) TwoStageClose

func (o *AsyncPlain[Id, Item]) TwoStageClose() func()

func (*AsyncPlain[Id, Item]) Update

func (o *AsyncPlain[Id, Item]) Update(id Id, fn func(e Item) Item) error

func (*AsyncPlain[Id, Item]) Walk

func (o *AsyncPlain[Id, Item]) Walk(fn func(Item) bool) bool

type Funcs

type Funcs[Id constraints.Ordered, MapItem any, DbItem any] struct {
	// contains filtered or unexported fields
}

type Sync

type Sync[Id constraints.Ordered, MapItem any, DbItem any] struct {
	// contains filtered or unexported fields
}

func (*Sync[Id, MapItem, DbItem]) Add

func (o *Sync[Id, MapItem, DbItem]) Add(e DbItem) (Id, error)

func (*Sync[Id, MapItem, DbItem]) AddNamed

func (o *Sync[Id, MapItem, DbItem]) AddNamed(name string, e DbItem) (Id, error)

func (*Sync[Id, MapItem, DbItem]) Close

func (o *Sync[Id, MapItem, DbItem]) Close()

func (*Sync[Id, MapItem, DbItem]) Count

func (o *Sync[Id, MapItem, DbItem]) Count() int

func (*Sync[Id, MapItem, DbItem]) Db

func (o *Sync[Id, MapItem, DbItem]) Db() *db.Db

func (*Sync[Id, MapItem, DbItem]) DbList

func (o *Sync[Id, MapItem, DbItem]) DbList() []DbItem

func (*Sync[Id, MapItem, DbItem]) Delete

func (o *Sync[Id, MapItem, DbItem]) Delete(id Id) error

func (*Sync[Id, MapItem, DbItem]) DeleteAll

func (o *Sync[Id, MapItem, DbItem]) DeleteAll() (err error)

func (*Sync[Id, MapItem, DbItem]) Empty

func (o *Sync[Id, MapItem, DbItem]) Empty() bool

func (*Sync[Id, MapItem, DbItem]) ExcludeMutex

func (o *Sync[Id, MapItem, DbItem]) ExcludeMutex()

func (*Sync[Id, MapItem, DbItem]) Exist

func (o *Sync[Id, MapItem, DbItem]) Exist(id Id) bool

func (*Sync[Id, MapItem, DbItem]) ForEach

func (o *Sync[Id, MapItem, DbItem]) ForEach(fn func(MapItem))

func (*Sync[Id, MapItem, DbItem]) ForEachSwarm

func (o *Sync[Id, MapItem, DbItem]) ForEachSwarm(fn func(MapItem))

func (*Sync[Id, MapItem, DbItem]) Get

func (o *Sync[Id, MapItem, DbItem]) Get(id Id) (MapItem, error)

func (*Sync[Id, MapItem, DbItem]) GetIfExists

func (o *Sync[Id, MapItem, DbItem]) GetIfExists(id Id) (MapItem, bool)

func (*Sync[Id, MapItem, DbItem]) Init

func (o *Sync[Id, MapItem, DbItem]) Init() bool

func (*Sync[Id, MapItem, DbItem]) InitError

func (o *Sync[Id, MapItem, DbItem]) InitError() error

func (*Sync[Id, MapItem, DbItem]) Inited

func (o *Sync[Id, MapItem, DbItem]) Inited() bool

func (*Sync[Id, MapItem, DbItem]) Keys

func (o *Sync[Id, MapItem, DbItem]) Keys() []Id

func (*Sync[Id, MapItem, DbItem]) List

func (o *Sync[Id, MapItem, DbItem]) List() []MapItem

func (*Sync[Id, MapItem, DbItem]) Log

func (o *Sync[Id, MapItem, DbItem]) Log() *ulog.Log

func (*Sync[Id, MapItem, DbItem]) LogUpdate

func (o *Sync[Id, MapItem, DbItem]) LogUpdate(yes bool)

func (*Sync[Id, MapItem, DbItem]) OnConvert

func (o *Sync[Id, MapItem, DbItem]) OnConvert(newMapItem func(DbItem) MapItem, mapToDbItem func(MapItem) DbItem)

func (*Sync[Id, MapItem, DbItem]) OnDelete

func (o *Sync[Id, MapItem, DbItem]) OnDelete(onDelete func(MapItem, *bun.DeleteQuery))

func (*Sync[Id, MapItem, DbItem]) OnSelect

func (o *Sync[Id, MapItem, DbItem]) OnSelect(onSelect func(*bun.SelectQuery))

func (*Sync[Id, MapItem, DbItem]) Open

func (o *Sync[Id, MapItem, DbItem]) Open(name string, log *ulog.Log, db *db.Db, dbItemId func(DbItem) Id)

func (*Sync[Id, MapItem, DbItem]) Remove

func (o *Sync[Id, MapItem, DbItem]) Remove(id Id, fn func(e MapItem) MapItem) error

func (*Sync[Id, MapItem, DbItem]) Replace

func (o *Sync[Id, MapItem, DbItem]) Replace(e MapItem) error

func (*Sync[Id, MapItem, DbItem]) SoftDelete

func (o *Sync[Id, MapItem, DbItem]) SoftDelete(id Id, fn func(e MapItem) MapItem) error

func (*Sync[Id, MapItem, DbItem]) SoftReplace

func (o *Sync[Id, MapItem, DbItem]) SoftReplace(e MapItem) error

func (*Sync[Id, MapItem, DbItem]) SoftUpdate

func (o *Sync[Id, MapItem, DbItem]) SoftUpdate(id Id, fn func(e MapItem) MapItem) error

func (*Sync[Id, MapItem, DbItem]) Update

func (o *Sync[Id, MapItem, DbItem]) Update(id Id, fn func(e MapItem) MapItem) error

func (*Sync[Id, MapItem, DbItem]) Walk

func (o *Sync[Id, MapItem, DbItem]) Walk(fn func(MapItem) bool) bool

type SyncPlain

type SyncPlain[Id constraints.Ordered, Item any] struct {
	// contains filtered or unexported fields
}

func (*SyncPlain[Id, Item]) Add

func (o *SyncPlain[Id, Item]) Add(e Item) (Id, error)

func (*SyncPlain[Id, Item]) AddNamed

func (o *SyncPlain[Id, Item]) AddNamed(name string, e Item) (Id, error)

func (*SyncPlain[Id, Item]) Close

func (o *SyncPlain[Id, Item]) Close()

func (*SyncPlain[Id, Item]) Count

func (o *SyncPlain[Id, Item]) Count() int

func (*SyncPlain[Id, Item]) Db

func (o *SyncPlain[Id, Item]) Db() *db.Db

func (*SyncPlain[Id, Item]) Delete

func (o *SyncPlain[Id, Item]) Delete(id Id) error

func (*SyncPlain[Id, Item]) DeleteAll

func (o *SyncPlain[Id, Item]) DeleteAll() error

func (*SyncPlain[Id, Item]) Empty

func (o *SyncPlain[Id, Item]) Empty() bool

func (*SyncPlain[Id, Item]) ExcludeMutex

func (o *SyncPlain[Id, Item]) ExcludeMutex()

func (*SyncPlain[Id, Item]) Exist

func (o *SyncPlain[Id, Item]) Exist(id Id) bool

func (*SyncPlain[Id, Item]) ForEach

func (o *SyncPlain[Id, Item]) ForEach(fn func(Item))

func (*SyncPlain[Id, Item]) ForEachSwarm

func (o *SyncPlain[Id, Item]) ForEachSwarm(fn func(Item))

func (*SyncPlain[Id, Item]) Get

func (o *SyncPlain[Id, Item]) Get(id Id) (Item, error)

func (*SyncPlain[Id, Item]) GetIfExists

func (o *SyncPlain[Id, Item]) GetIfExists(id Id) (Item, bool)

func (*SyncPlain[Id, Item]) Init

func (o *SyncPlain[Id, Item]) Init() bool

func (*SyncPlain[Id, Item]) InitError

func (o *SyncPlain[Id, Item]) InitError() error

func (*SyncPlain[Id, Item]) Inited

func (o *SyncPlain[Id, Item]) Inited() bool

func (*SyncPlain[Id, Item]) Keys

func (o *SyncPlain[Id, Item]) Keys() []Id

func (*SyncPlain[Id, Item]) List

func (o *SyncPlain[Id, Item]) List() []Item

func (*SyncPlain[Id, Item]) Log

func (o *SyncPlain[Id, Item]) Log() *ulog.Log

func (*SyncPlain[Id, Item]) LogUpdate

func (o *SyncPlain[Id, Item]) LogUpdate(yes bool)

func (*SyncPlain[Id, Item]) OnDelete

func (o *SyncPlain[Id, Item]) OnDelete(onDelete func(Item, *bun.DeleteQuery))

func (*SyncPlain[Id, Item]) OnSelect

func (o *SyncPlain[Id, Item]) OnSelect(onSelect func(*bun.SelectQuery))

func (*SyncPlain[Id, Item]) Open

func (o *SyncPlain[Id, Item]) Open(name string, log *ulog.Log, db *db.Db, ItemId func(Item) Id)

func (*SyncPlain[Id, Item]) Remove

func (o *SyncPlain[Id, Item]) Remove(id Id, fn func(e Item) Item) error

func (*SyncPlain[Id, Item]) Replace

func (o *SyncPlain[Id, Item]) Replace(e Item) error

func (*SyncPlain[Id, Item]) SoftDelete

func (o *SyncPlain[Id, Item]) SoftDelete(id Id, fn func(e Item) Item) error

func (*SyncPlain[Id, Item]) SoftReplace

func (o *SyncPlain[Id, Item]) SoftReplace(e Item) error

func (*SyncPlain[Id, Item]) SoftUpdate

func (o *SyncPlain[Id, Item]) SoftUpdate(id Id, fn func(e Item) Item) error

func (*SyncPlain[Id, Item]) Update

func (o *SyncPlain[Id, Item]) Update(id Id, fn func(e Item) Item) error

func (*SyncPlain[Id, Item]) Upsert

func (o *SyncPlain[Id, Item]) Upsert(e Item) error

func (*SyncPlain[Id, Item]) UpsertNamed

func (o *SyncPlain[Id, Item]) UpsertNamed(name string, e Item) error

func (*SyncPlain[Id, Item]) Walk

func (o *SyncPlain[Id, Item]) Walk(fn func(Item) bool) bool

Jump to

Keyboard shortcuts

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