common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Alphanum = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
	Alpha    = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
	Number   = "0123456789"
)
View Source
const (
	JsonEngine  = CopyEngine("json")
	GobEngine   = CopyEngine("gob")
	GojayEngine = CopyEngine("gojay")
)
View Source
const (
	ScriptLangTs         = ScriptLang("ts")
	ScriptLangCoffee     = ScriptLang("coffeescript")
	ScriptLangJavascript = ScriptLang("javascript")
)
View Source
const (
	FlowElementsPrototypeDefault        = FlowElementsPrototypeType("default")
	FlowElementsPrototypeMessageHandler = FlowElementsPrototypeType("MessageHandler")
	FlowElementsPrototypeMessageEmitter = FlowElementsPrototypeType("MessageEmitter")
	FlowElementsPrototypeTask           = FlowElementsPrototypeType("Task")
	FlowElementsPrototypeGateway        = FlowElementsPrototypeType("Gateway")
	FlowElementsPrototypeFlow           = FlowElementsPrototypeType("Flow")
)
View Source
const (
	Enabled  = StatusType("enabled")
	Disabled = StatusType("disabled")
	Frozen   = StatusType("frozen")
)
View Source
const (
	PrototypeTypeText   = PrototypeType("text")
	PrototypeTypeImage  = PrototypeType("image")
	PrototypeTypeDevice = PrototypeType("device")
	PrototypeTypeEmpty  = PrototypeType("")
)
View Source
const (
	LogLevelEmergency = LogLevel("Emergency")
	LogLevelAlert     = LogLevel("Alert")
	LogLevelCritical  = LogLevel("Critical")
	LogLevelError     = LogLevel("Error")
	LogLevelWarning   = LogLevel("Warning")
	LogLevelNotice    = LogLevel("Notice")
	LogLevelInfo      = LogLevel("Info")
	LogLevelDebug     = LogLevel("Debug")
)
View Source
const (
	MapDeviceHistoryState  = MapDeviceHistoryType("state")
	MapDeviceHistoryOption = MapDeviceHistoryType("option")
)

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func ComputeHmac256

func ComputeHmac256() string

func Copy

func Copy(to, from interface{}, params ...CopyEngine) (err error)

func CopyFile

func CopyFile(f, t string)

func FileExist

func FileExist(path string) (exist bool)

func GetFileSize

func GetFileSize(name string) (int64, error)

func GetFullPath

func GetFullPath(name string) string

func GetLinkPath

func GetLinkPath(name string) string

func HashPassword

func HashPassword(password string) (string, error)

func Int added in v0.0.17

func Int(v int) *int

func Int64 added in v0.0.17

func Int64(v int64) *int64

func Int64Value added in v0.0.17

func Int64Value(v *int64) int64

func IntValue added in v0.0.17

func IntValue(v *int) int

func ParseHmacToken

func ParseHmacToken(tokenString string, key []byte) (jwt.MapClaims, error)

func RandInt

func RandInt(min int, max int) int

func RandStr

func RandStr(strSize int, dictionary string) string

func RandomString

func RandomString(l int) string

func StaticPath added in v0.1.0

func StaticPath() string

func StoragePath

func StoragePath() string

func String added in v0.0.17

func String(v string) *string

func StringValue added in v0.0.17

func StringValue(v *string) string

func Strtomd5

func Strtomd5(s string) string

create md5 string

Types

type CopyEngine

type CopyEngine string

type DeviceType

type DeviceType string

type FlowElementsPrototypeType

type FlowElementsPrototypeType string

type GinEngine added in v0.0.11

type GinEngine interface {
	GetEngine() *gin.Engine
}

type LogLevel

type LogLevel string

type Logger added in v0.1.3

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

func MustGetLogger added in v0.1.3

func MustGetLogger(p string) *Logger

func (*Logger) Debug added in v0.1.3

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Debugf added in v0.1.3

func (l *Logger) Debugf(format string, args ...interface{})

func (*Logger) Error added in v0.1.3

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Errorf added in v0.1.3

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Fatal added in v0.1.3

func (l *Logger) Fatal(format string, args ...interface{})

func (*Logger) Fatalf added in v0.1.3

func (l *Logger) Fatalf(format string, args ...interface{})

func (*Logger) Info added in v0.1.3

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) Infof added in v0.1.3

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) Warn added in v0.1.3

func (l *Logger) Warn(format string, args ...interface{})

func (*Logger) Warnf added in v0.1.3

func (l *Logger) Warnf(format string, args ...interface{})

type MapDeviceHistoryType added in v0.2.0

type MapDeviceHistoryType string

type PrototypeType

type PrototypeType string

type ScriptLang

type ScriptLang string

type StatusType

type StatusType string

type Validation added in v0.0.19

type Validation struct {
}

func (Validation) Valid added in v0.0.19

func (d Validation) Valid() (ok bool, errs []*validation.Error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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