sort

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByFieldIndex

func ByFieldIndex(fi *reflectx.FieldInfo) func(i interface{}) interface{}

Order by the field

func ByHost

func ByHost() func(i interface{}) interface{}

Order by Host.Project key

func ByKey

func ByKey() func(i interface{}) interface{}

Order by GroupBy key

func ByLen

func ByLen() func(i interface{}) interface{}

Order by count

func FromChannelQuery

func FromChannelQuery(ch chan interface{}, opt *Options) (linq.Query, error)

func GroupBy

func GroupBy(groupBy *reflectx.FieldInfo) (func(i interface{}) interface{}, func(i interface{}) interface{})

func OrderBy

func OrderBy(groupBy, orderBy *reflectx.FieldInfo) func(i interface{}) interface{}

func ValidFieldValue

func ValidFieldValue(keys []string, v interface{}) (interface{}, error)

func ValidOrderBy

func ValidOrderBy(keys []string, v interface{}) bool

Types

type Cached

type Cached bool

func (Cached) String

func (c Cached) String() string

type Element

type Element struct {
	Host   *client.Host
	Struct interface{}
	Cached Cached
}

type Elements

type Elements []interface{}

func (Elements) Cached

func (e Elements) Cached() (cached Cached)

func (Elements) Hosts

func (e Elements) Hosts() client.Hosts

func (Elements) Typed

func (e Elements) Typed() []Element

type Options

type Options struct {
	SortBy, GroupBy string

	OrderBy    []string
	StructType interface{}
}

type Result

type Result struct {
	Count    int
	Key      string
	Elements Elements
	Cached   Cached
}

func FromChannel

func FromChannel(ch chan interface{}, opt *Options) ([]Result, error)

Jump to

Keyboard shortcuts

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