sortx

package
v1.1.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Order added in v1.1.8

type Order string

按照接口中的某个字段排序

const (
	ASC  Order = "ASC"
	DESC Order = "DESC"
)

type Sort

type Sort struct {
	Obj  interface{} `json:"obj"`
	Sort float64     `json:"sort"`
}

type SortList

type SortList struct {
	List  []Sort `json:"list"`
	Order Order  `json:"order"`
}

func NewSortList added in v1.1.8

func NewSortList(order Order) *SortList

func (*SortList) Len

func (list *SortList) Len() int

func (*SortList) Less

func (list *SortList) Less(i, j int) bool

func (*SortList) Swap

func (list *SortList) Swap(i, j int)

Jump to

Keyboard shortcuts

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