helpers

package
v0.0.0-...-1ef3636 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnclosedBracketError = errors.New("can not find the pair of bracket")
)

Functions

func Add

func Add(a, b int) int

func CamelCase

func CamelCase(s string, fn convert) string

func CatchError

func CatchError(fn func(interface{}) (interface{}, error)) func(interface{}) interface{}

func CatchErrorForString

func CatchErrorForString(fn func(string) (string, error)) func(string) string

func Chop

func Chop(s string, d rune) string

func ConvertArrayForGo

func ConvertArrayForGo(m []string) string

func ConvertJSONTagForGo

func ConvertJSONTagForGo(tag string) string

func ConvertTypeForGo

func ConvertTypeForGo(s string) string

func ConvertTypeForJS

func ConvertTypeForJS(s string) string

func ConvertTypeInJSONForGo

func ConvertTypeInJSONForGo(s string) string

func ConvertXORMTagForGo

func ConvertXORMTagForGo(tag string) string

func GetColumn

func GetColumn(ts *schema.Schema) (cn, ct string, err error)

func GetKeyFromJSONPath

func GetKeyFromJSONPath(url string) string

func GetPrivate

func GetPrivate(ts *schema.Schema) (bool, error)

func GetTable

func GetTable(ts *schema.Schema) (tn string, err error)

func In

func In(e interface{}, s []interface{}) bool

func JoinTypes

func JoinTypes(ts schema.PrimitiveTypes, sep string) string

func LinkTitle

func LinkTitle(title, method, suffix string) string

func LowerCamelCase

func LowerCamelCase(s string) string

func LowerSnakeCase

func LowerSnakeCase(s string) string

func NotLast

func NotLast(i, len int) bool

func ParseParam

func ParseParam(p string) string

func Serialize

func Serialize(v interface{}) string

func Slice

func Slice(s ...interface{}) []interface{}

func SnakeCase

func SnakeCase(s string) string

func SnakeToLowerCamelCase

func SnakeToLowerCamelCase(s string) string

SnakeToLowerCamelCase is deprecated

func SnakeToUpperCamelCase

func SnakeToUpperCamelCase(s string) string

SnakeToUpperCamelCase is deprecated

func SpaceToUpperCamelCase

func SpaceToUpperCamelCase(s string) string

SpaceToUpperCamelCase is deprecated

func Sub

func Sub(a, b int) int

func ToLiteralForGo

func ToLiteralForGo(input interface{}) string

func ToLiteralForJS

func ToLiteralForJS(input interface{}) string

func ToLowerFirst

func ToLowerFirst(s string) string

ToLowerFirst is deprecated

func ToPathLikeGorilla

func ToPathLikeGorilla(p string) (string, error)

func ToPathLikeSinatra

func ToPathLikeSinatra(p string) (string, error)

func ToStringLiteral

func ToStringLiteral(v interface{}) string

func ToUpperFirst

func ToUpperFirst(s string) string

ToUpperFirst is deprecated

func UpperCamelCase

func UpperCamelCase(s string) string

func UpperSnakeCase

func UpperSnakeCase(s string) string

Types

type Chunk

type Chunk string

func NewChunk

func NewChunk(s string) *Chunk

func (*Chunk) Append

func (c *Chunk) Append(b byte)

func (Chunk) Gorilla

func (c Chunk) Gorilla() string

func (Chunk) IsRef

func (c Chunk) IsRef() bool

func (Chunk) Sinatra

func (c Chunk) Sinatra() string

func (Chunk) String

func (c Chunk) String() string

type Ref

type Ref string

func NewRef

func NewRef(s string) *Ref

func (*Ref) Append

func (r *Ref) Append(b byte)

func (Ref) Gorilla

func (r Ref) Gorilla() string

func (Ref) IsRef

func (r Ref) IsRef() bool

func (Ref) Sinatra

func (r Ref) Sinatra() string

func (Ref) String

func (r Ref) String() string

type Token

type Token interface {
	String() string
	Gorilla() string
	Sinatra() string
}

func BuildURLToken

func BuildURLToken(p string) ([]Token, error)

type UncaughtCharacterError

type UncaughtCharacterError struct {
	Path      string
	Position  int
	Character byte
}

func (UncaughtCharacterError) Error

func (err UncaughtCharacterError) Error() string

Jump to

Keyboard shortcuts

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