package
0.0.0-20241224114647-05f97e917eb5
Repository: https://github.com/v0vc/go-music-grpc.git
Documentation: pkg.go.dev

# Functions

DefaultHooks returns a Hooks instance with most fields defined as no-ops.
MakeIndexValid forces the given index to be in bounds for given slice.
NewCompact returns a Compact with the given maximum size and using the given Comparator to sort its contents.
NewManager constructs a manager.
SerialAtOrAfter returns the serial of the element at the given index if it is not NoSerial.
SerialAtOrBefore returns the serial of the element at the given index if it is not NoSerial.
SliceFilter removes elements for which the predicate returns false from the slice.
SliceRemove takes the given index of a slice and swaps it with the final index in the slice, then shortens the slice by one element.
Synthesize applies a Synthesizer to a slice of elements, returning the resulting slice of elements as well as a mapping from the index of each resulting element to the input element that generated it.

# Constants

After refers to serial values after a reference value (usually the end of the viewport).
Before refers to serial values earlier than a reference value (usually the beginning of the viewport).
Both indicates the Before and After Directions simultaneously.
DefaultPrefetch is the default prefetching threshold.
NoDirection refers to no specific direction.
NoSerial is a special serial that can be used by Elements that do not require a unique identifier.

# Structs

Compact is a list of sorted Elements with a specific maximum size.
End is a pseudo Element that indicates the end of the list view, that is, the end of the elements currently loaded in memory.
Hooks provides the lifecycle hooks necessary for a Manager to orchestrate the state of all its managed elements.
Manager presents heterogeneous Element data.
Start is a pseudo Element that indicates the beginning of the list view, that is, the beginning of the elements currently loaded in memory.
Synthesis holds the results of transforming a slice of Elements with a Synthesizer hook.

# Interfaces

Element is a type that can be presented by a Manager.

# Type aliases

Allocator is a function that can allocate the appropriate state type for a given Element.
Comparator returns whether element a sorts before element b in the list.
Direction indicates a direction relative to the viewport of a list.
Loader is a function that can fulfill load requests.
Presenter is a function that can transform the data for an Element into a widget to be laid out in the user interface.
Serial uniquely identifies a list element.
Synthesizer is a function that can insert synthetic elements into a list of elements.