Documentation ¶
Index ¶
- Constants
- type UidList
- func (ul *UidList) AddItem(uid cmb.Id, addToTop bool) (err error)
- func (ul *UidList) AsArray() (arr []cmb.Id)
- func (ul *UidList) CheckIntegrity() (err error)
- func (ul *UidList) HasItem(uid cmb.Id) bool
- func (ul *UidList) LastElement() (lastElement *cmb.Id)
- func (ul *UidList) MoveItemDown(uid cmb.Id) (err error)
- func (ul *UidList) MoveItemUp(uid cmb.Id) (err error)
- func (ul *UidList) OnPage(pageNumber cmb.Count, pageSize cmb.Count) (ulop *UidList)
- func (ul *UidList) RaiseItem(uid cmb.Id) (isAlreadyRaised bool, err error)
- func (ul *UidList) RemoveItem(uid cmb.Id) (err error)
- func (ul *UidList) RemoveItemAtPos(pos cmb.Index) (err error)
- func (ul *UidList) Scan(src any) (err error)
- func (ul *UidList) SearchForItem(uid cmb.Id) (idx cmb.Index, err error)
- func (ul *UidList) Size() (n cmb.Count)
- func (ul *UidList) Value() (dv driver.Value, err error)
- func (ul *UidList) ValuesString() (values string, err error)
Constants ¶
const ( Err_DestinationIsNotInitialised = "destination is not initialised" Err_ItemsAreNotUnique = "items are not unique" Err_EdgePosition = "edge position" Err_Position = "position error" ErrF_UidIsNotFound = "uid is not found: %v" ErrF_DuplicateUid = "duplicate uid: %v" ErrF_UnsupportedDataType = "unsupported data type: %s" )
const ( IndexOnError = cmb.Index(-1) ListItemSeparator = "," StringOnError = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UidList ¶
UidList is a list unique identifiers.
The main purpose of this list is to store a chronological order of all added identifiers. The order of items in the list is important and, thus, the list may not be sorted. New items are added to the end of the list, deleted items shift existing items. All operations on the list assume that the list is unique before the operation, thus, every operation must ensure that its results do not break the uniqueness of items in the list.
func (*UidList) AddItem ¶
AddItem add a new identifier to the end of the list. If 'addToTop' is set to 'True', then the item is added to the beginning (top) of the list; otherwise – to the end (bottom) of the list.
func (*UidList) CheckIntegrity ¶
CheckIntegrity verifies integrity of the list.
func (*UidList) HasItem ¶ added in v0.0.49
HasItem checks whether an item is contained in the list or not.
func (*UidList) LastElement ¶ added in v0.0.44
LastElement returns the last item of the list.
func (*UidList) MoveItemDown ¶ added in v0.0.38
MoveItemDown moves an existing identifier one position downwards if possible.
func (*UidList) MoveItemUp ¶ added in v0.0.38
MoveItemUp moves an existing identifier one position upwards if possible.
func (*UidList) RemoveItem ¶
RemoveItem deletes an identifier from the list shifting its items.
func (*UidList) RemoveItemAtPos ¶ added in v0.0.49
RemoveItemAtPos removes the item at position.
func (*UidList) SearchForItem ¶ added in v0.0.49
SearchForItem searches for an item in the list. If an item is found, its index is returned without error. If an item is not found, an error is returned.
func (*UidList) ValuesString ¶
ValuesString lists items as a simple plain text with a comma as separator.