orderby

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateOrderByExp

func GenerateOrderByExp(source string, dict PropertyDict) string

GenerateOrderByExp returns a generated orderBy expresion by given source dto order string (split by ",", such as "name desc,age asc") and PropertyDict. The generated expression is in mysql-sql and neo4j-cypher style, that is "xx ASC", "xx DESC".

Types

type PropertyDict

type PropertyDict map[string]*PropertyValue

PropertyDict represents a DTO-PO PropertyValue dictionary, used in GenerateOrderByExp.

type PropertyValue

type PropertyValue struct {
	// contains filtered or unexported fields
}

PropertyValue represents a PO entity's property mapping rule.

func NewPropertyValue

func NewPropertyValue(reverse bool, destinations ...string) *PropertyValue

NewPropertyValue creates a PropertyValue by given reverse and destinations.

func (*PropertyValue) Destinations

func (p *PropertyValue) Destinations() []string

Destinations returns the destinations of PropertyValue.

func (*PropertyValue) Reverse

func (p *PropertyValue) Reverse() bool

Reverse returns the reverse of PropertyValue.

Jump to

Keyboard shortcuts

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