helper

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2016 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DebugMode bool
)

Functions

func Connect

func Connect() (dbox.IConnection, error)

func ConnectUsingDataConn

func ConnectUsingDataConn(dataConn *colonycore.Connection) *queryWrapper

func ConstructPermission

func ConstructPermission(strPermission string) (result string, err error)

func CreateResult

func CreateResult(success bool, data interface{}, message string) map[string]interface{}

func FakeWebContext

func FakeWebContext() *knot.WebContext

func FetchDataSource

func FetchDataSource(_id string, dsType string, path string) ([]map[string]interface{}, error)

func FetchJSON

func FetchJSON(url string) ([]map[string]interface{}, error)

func FetchQuerySelector

func FetchQuerySelector(data []map[string]interface{}, payload map[string]interface{}) ([]map[string]interface{}, error)

func FetchThenSaveFile

func FetchThenSaveFile(r *http.Request, sourceFileName string, destinationFileName string) (multipart.File, *multipart.FileHeader, error)

func ForceAsString

func ForceAsString(data toolkit.M, which string) string

func GetBetterType

func GetBetterType(src interface{}) (string, interface{})

func GetFileExtension

func GetFileExtension(file string) string

func HandleError

func HandleError(err error, optionalArgs ...interface{}) bool

func LoadConfig

func LoadConfig(pathJson string) (dbox.IConnection, error)

func Printf

func Printf(format string, a ...interface{}) (n int, err error)

func Query

func Query(driver string, host string, other ...interface{}) *queryWrapper

func RandomIDWithPrefix

func RandomIDWithPrefix(prefix string) string

func Recursiver

func Recursiver(data []interface{}, sub func(interface{}) []interface{}, callback func(interface{}))

func ReplaceHostAlias

func ReplaceHostAlias(path string, server colonycore.Server) string

func RunCommandWithTimeout

func RunCommandWithTimeout(sshSetting *sshclient.SshSetting, cmd string, timeout int) error

func ToUpper

func ToUpper(src string) string

func UploadHandler

func UploadHandler(r *knot.WebContext, filename, dstpath string) (error, string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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