utils

package
v0.0.0-...-ea25219 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetField

func GetField(fields map[string]*gorm.Field, name string) (*gorm.Field, bool)

func GetLocale

func GetLocale(context *qor.Context) string

func GetNestedModel

func GetNestedModel(value interface{}, alias string, context *qor.Context) interface{}

func HumanizeString

func HumanizeString(str string) string

Humanize separates string based on capitalizd letters e.g. "OrderItem" -> "Order Item"

func NewValue

func NewValue(t reflect.Type) (v reflect.Value)

func ParseNestedField

func ParseNestedField(value reflect.Value, name string) (reflect.Value, string)

Profile.Name

func ParseTagOption

func ParseTagOption(str string) map[string]string

func PatchURL

func PatchURL(originalURL string, params ...interface{}) (patchedURL string, err error)

PatchURL updates the query part of the current request url. You can access it in template by `patch_url`.

patch_url "key" "value"

func Stringify

func Stringify(object interface{}) string

func ToArray

func ToArray(value interface{}) (values []string)

func ToFloat

func ToFloat(value interface{}) float64

func ToInt

func ToInt(value interface{}) int64

func ToParamString

func ToParamString(str string) string

ToParamString replaces spaces and separates words (by uppercase letters) with underscores in a string, also downcase it e.g. ToParamString -> to_param_string, To ParamString -> to_param_string

func ToString

func ToString(value interface{}) string

func ToUint

func ToUint(value interface{}) uint64

Types

This section is empty.

Jump to

Keyboard shortcuts

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