common

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash ...

func ComputeHmac256

func ComputeHmac256() string

ComputeHmac256 ...

func Copy

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

Copy ...

func CopyFile

func CopyFile(f, t string)

CopyFile ...

func FileExist

func FileExist(path string) (exist bool)

FileExist ...

func GetFileSize

func GetFileSize(name string) (int64, error)

GetFileSize ...

func GetFullPath

func GetFullPath(name string) string

GetFullPath ...

func GetLinkPath

func GetLinkPath(name string) string

GetLinkPath ...

func HashPassword

func HashPassword(password string) (string, error)

HashPassword ...

func Int added in v0.0.17

func Int(v int) *int

Int ...

func Int64 added in v0.0.17

func Int64(v int64) *int64

Int64 ...

func Int64Value added in v0.0.17

func Int64Value(v *int64) int64

Int64Value ...

func IntValue added in v0.0.17

func IntValue(v *int) int

IntValue ...

func ParseHmacToken

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

ParseHmacToken ...

func RandInt

func RandInt(min int, max int) int

RandInt ...

func RandStr

func RandStr(strSize int, dictionary string) string

RandStr ...

func RandomString

func RandomString(l int) string

RandomString ...

func StaticPath added in v0.1.0

func StaticPath() string

StaticPath ...

func StoragePath

func StoragePath() string

StoragePath ...

func String added in v0.0.17

func String(v string) *string

String ...

func StringValue added in v0.0.17

func StringValue(v *string) string

StringValue ...

func Strtomd5

func Strtomd5(s string) string

create md5 string

Types

type CopyEngine

type CopyEngine string

CopyEngine ...

type DeviceType

type DeviceType string

DeviceType ...

type FlowElementsPrototypeType

type FlowElementsPrototypeType string

FlowElementsPrototypeType ...

type GinEngine added in v0.0.11

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

GinEngine ...

type LogLevel

type LogLevel string

LogLevel ...

type Logger added in v0.1.3

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

Logger ...

func MustGetLogger added in v0.1.3

func MustGetLogger(p string) *Logger

MustGetLogger ...

func (*Logger) Debug added in v0.1.3

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

Debug ...

func (*Logger) Debugf added in v0.1.3

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

Debugf ...

func (*Logger) Error added in v0.1.3

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

Error ...

func (*Logger) Errorf added in v0.1.3

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

Errorf ...

func (*Logger) Fatal added in v0.1.3

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

Fatal ...

func (*Logger) Fatalf added in v0.1.3

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

Fatalf ...

func (*Logger) Info added in v0.1.3

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

Info ...

func (*Logger) Infof added in v0.1.3

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

Infof ...

func (*Logger) Warn added in v0.1.3

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

Warn ...

func (*Logger) Warnf added in v0.1.3

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

Warnf ...

type MapDeviceHistoryType added in v0.2.0

type MapDeviceHistoryType string

MapDeviceHistoryType ...

type PrototypeType

type PrototypeType string

PrototypeType ...

type ScriptLang

type ScriptLang string

ScriptLang ...

type StatusType

type StatusType string

StatusType ...

type Validation added in v0.0.19

type Validation struct {
}

Validation ...

func (Validation) Valid added in v0.0.19

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

Valid ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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