sortable

package
v0.0.5-0...-8e55a6f Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveAfter

func MoveAfter(opSort, targetSort int, l *[]Sortable)

func MoveBefore

func MoveBefore(opSort, targetSort int, l *[]Sortable)

func MoveFirst

func MoveFirst(opSort int, l *[]Sortable)

func MoveLast

func MoveLast(opSort int, l *[]Sortable)

func Normalize

func Normalize[T Sortable](l []T)

Normalize set sort by index

func Sort

func Sort[T Sortable](s []T) []T

Types

type Embed

type Embed struct {
	Sort int
}

Embed implements Sortable interface. resource which supports sorting like "move up", "move to" can embed this struct

func (*Embed) GetSort

func (e *Embed) GetSort() int

func (*Embed) SetSort

func (e *Embed) SetSort(i int)

type Sortable

type Sortable interface {
	GetSort() int
	SetSort(int)
}

Jump to

Keyboard shortcuts

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