Documentation ¶
Index ¶
- func FilterSlice[T any](ss []T, test func(T) bool) []T
- func Find[T any](ts []T, f func(T) bool) int
- func FindTrackByID(id string, tracks []*mediaprovider.Track) *mediaprovider.Track
- func IndexOf[T comparable](ts []T, t T) int
- func MapSlice[T any, U any](ts []T, f func(T) U) []U
- func ReorderTracks(tracks []*mediaprovider.Track, idxToMove []int, op TrackReorderOp) []*mediaprovider.Track
- func Reversed[T any](ts []T) []T
- func SliceContains[T comparable](ts []T, t T) bool
- func SliceEqual[T comparable](a []T, b []T) bool
- func ToSet[T comparable](ts []T) map[T]struct{}
- func TrackIDOrEmptyStr(track *mediaprovider.Track) string
- func TracksToIDs(tracks []*mediaprovider.Track) []string
- type TrackReorderOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterSlice ¶
func FindTrackByID ¶
func FindTrackByID(id string, tracks []*mediaprovider.Track) *mediaprovider.Track
func IndexOf ¶
func IndexOf[T comparable](ts []T, t T) int
func ReorderTracks ¶
func ReorderTracks(tracks []*mediaprovider.Track, idxToMove []int, op TrackReorderOp) []*mediaprovider.Track
Reorder tracks and return a new track slice. idxToMove must contain only valid indexes into tracks, and no repeats
func SliceContains ¶
func SliceContains[T comparable](ts []T, t T) bool
func SliceEqual ¶ added in v0.6.0
func SliceEqual[T comparable](a []T, b []T) bool
func ToSet ¶ added in v0.3.1
func ToSet[T comparable](ts []T) map[T]struct{}
func TrackIDOrEmptyStr ¶
func TrackIDOrEmptyStr(track *mediaprovider.Track) string
func TracksToIDs ¶
func TracksToIDs(tracks []*mediaprovider.Track) []string
Types ¶
type TrackReorderOp ¶
type TrackReorderOp int
const ( MoveToTop TrackReorderOp = iota MoveToBottom MoveUp MoveDown )
Click to show internal directories.
Click to hide internal directories.