Documentation
¶
Index ¶
- type ConcurrentSlice
- func (cs *ConcurrentSlice) Append(item itemWithID)
- func (cs *ConcurrentSlice) CurrentItems() []itemWithID
- func (cs *ConcurrentSlice) DeleteByID(id uuid.UUID) bool
- func (cs *ConcurrentSlice) Get(idx int) (itemWithID, bool)
- func (cs *ConcurrentSlice) GetByID(id uuid.UUID) (itemWithID, bool)
- func (cs *ConcurrentSlice) Len() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentSlice ¶
ConcurrentSlice is a slice which is safe for usage in multiple goroutines. It can only hold items which have function ID() uuid.UUID
func (*ConcurrentSlice) Append ¶
func (cs *ConcurrentSlice) Append(item itemWithID)
Append appends item to ConcurrentSlice
func (*ConcurrentSlice) CurrentItems ¶
func (cs *ConcurrentSlice) CurrentItems() []itemWithID
CurrentItems returns a normal slice of items in ConcurrentSlice
func (*ConcurrentSlice) DeleteByID ¶
func (cs *ConcurrentSlice) DeleteByID(id uuid.UUID) bool
DeleteByID deletes item with correspondind ID from slice
func (*ConcurrentSlice) Get ¶
func (cs *ConcurrentSlice) Get(idx int) (itemWithID, bool)
Get returns item from ConcurrentSlice with given index
func (*ConcurrentSlice) GetByID ¶
func (cs *ConcurrentSlice) GetByID(id uuid.UUID) (itemWithID, bool)
GetByID returns item from ConcurrentSlice with given id
func (*ConcurrentSlice) Len ¶
func (cs *ConcurrentSlice) Len() int
Len returns length of ConcurrentSlice
Click to show internal directories.
Click to hide internal directories.