common

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: GPL-3.0 Imports: 29 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 (
	// Enabled ...
	Enabled = StatusType("enabled")
	// Disabled ...
	Disabled = StatusType("disabled")
	// Frozen ...
	Frozen = StatusType("frozen")
)
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 (
	// EntityHistoryState ...
	EntityHistoryState = EntityHistoryType("state")
	// EntityHistoryOption ...
	EntityHistoryOption = EntityHistoryType("option")
)
View Source
const (
	// MetricTypeLine ...
	MetricTypeLine = MetricType("line")
	// MetricTypeBar ...
	MetricTypeBar = MetricType("bar")
	// MetricTypeDoughnut ...
	MetricTypeDoughnut = MetricType("doughnut")
	// MetricTypeRadar ...
	MetricTypeRadar = MetricType("radar")
	// MetricTypePie ...
	MetricTypePie = MetricType("pie")
	// MetricTypeHorizontalBar ...
	MetricTypeHorizontalBar = MetricType("horizontal bar")
)
View Source
const (
	MetricRange6H  = MetricRange("6h")
	MetricRange12H = MetricRange("12h")
	MetricRange24H = MetricRange("24h")
	MetricRange7d  = MetricRange("7d")
	MetricRange30d = MetricRange("30d")
	MetricRange1m  = MetricRange("1m")
)
View Source
const (
	// AttributeString ...
	AttributeString = AttributeType("string")
	// AttributeInt ...
	AttributeInt = AttributeType("int")
	// AttributeTime ...
	AttributeTime = AttributeType("time")
	// AttributeBool ...
	AttributeBool = AttributeType("bool")
	// AttributeFloat ...
	AttributeFloat = AttributeType("float")
	// AttributeImage ...
	AttributeImage = AttributeType("image")
	// AttributeIcon ...
	AttributeIcon = AttributeType("icon")
	// AttributePoint ...
	AttributePoint = AttributeType("point")
	// AttributeEncrypted ...
	AttributeEncrypted = AttributeType("encrypted")
	//DEPRECATED
	AttributeArray = AttributeType("array")
	//DEPRECATED
	AttributeMap = AttributeType("map")
)
View Source
const (
	// ConditionOr ...
	ConditionOr = ConditionType("or")
	// ConditionAnd ...
	ConditionAnd = ConditionType("and")
)
View Source
const (
	// DebugMode ...
	DebugMode = RunMode("debug")
	// ReleaseMode ...
	ReleaseMode = RunMode("release")
	// DemoMode
	DemoMode = RunMode("demo")
)
View Source
const DefaultPageSize int64 = 15

DefaultPageSize ...

Variables

This section is empty.

Functions

func Bool added in v0.5.2

func Bool(v bool) *bool

Bool ...

func BoolValue added in v0.5.2

func BoolValue(v *bool) bool

BoolValue ...

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 Dir added in v0.5.0

func Dir() string

Dir ...

func FileExist

func FileExist(path string) (exist bool)

FileExist ...

func Float32 added in v0.5.2

func Float32(v float32) *float32

Float32 ...

func Float32Value added in v0.5.2

func Float32Value(v *float32) float32

Float32Value ...

func FormatSourceCode added in v0.5.0

func FormatSourceCode(filename string)

FormatSourceCode ...

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 IsRunningInDockerContainer added in v0.13.0

func IsRunningInDockerContainer() bool

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 Rounding added in v0.5.0

func Rounding(num float64, k uint) float64

Rounding ...

func Rounding32 added in v0.6.0

func Rounding32(num float64, k uint) float32

Rounding32 ...

func SetField added in v0.14.0

func SetField(obj interface{}, name string, value interface{}) error

func SetFields added in v0.14.0

func SetFields(obj interface{}, params map[string]interface{}) (err error)

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

func TestMode added in v0.5.0

func TestMode() bool

TestMode ...

func Time added in v0.5.0

func Time(v time.Time) *time.Time

Time ...

func TimeValue added in v0.5.0

func TimeValue(v *time.Time) time.Time

TimeValue ...

Types

type AttributeType added in v0.5.0

type AttributeType string

AttributeType ...

type ConditionType added in v0.5.0

type ConditionType string

ConditionType ...

type CopyEngine

type CopyEngine string

CopyEngine ...

type EntityHistoryType added in v0.5.0

type EntityHistoryType string

EntityHistoryType ...

type EntityId added in v0.5.0

type EntityId string

EntityId ...

func NewEntityId added in v0.5.0

func NewEntityId(s string) *EntityId

NewEntityId ...

func NewEntityIdFromPtr added in v0.11.0

func NewEntityIdFromPtr(s *string) *EntityId

NewEntityIdFromPtr ...

func (EntityId) Name added in v0.5.0

func (e EntityId) Name() string

Name ...

func (EntityId) PluginName added in v0.5.2

func (e EntityId) PluginName() string

PluginName ...

func (EntityId) Ptr added in v0.17.0

func (e EntityId) Ptr() *EntityId

Ptr ...

func (*EntityId) String added in v0.5.0

func (e *EntityId) String() string

String ...

func (*EntityId) StringPtr added in v0.11.0

func (e *EntityId) StringPtr() *string

StringPtr ...

type GinEngine added in v0.0.11

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

GinEngine ...

type LogLevel

type LogLevel string

LogLevel ...

type MetricRange added in v0.7.0

type MetricRange string

func (MetricRange) Ptr added in v0.12.0

func (m MetricRange) Ptr() *MetricRange

func (MetricRange) String added in v0.7.0

func (m MetricRange) String() string

type MetricType added in v0.5.0

type MetricType string

MetricType ...

type PageParams added in v0.5.1

type PageParams struct {
	Limit   int64  `json:"limit" validate:"required,gte=1,lte=1000"`
	Offset  int64  `json:"offset" validate:"required,gte=0,lte=1000"`
	Order   string `json:"order" validate:"required,oneof=created_at"`
	SortBy  string `json:"sort_by" validate:"required,oneof=desc asc"`
	PageReq int64
	SortReq string
}

PageParams ...

type RunMode added in v0.5.0

type RunMode string

RunMode ...

type ScriptLang

type ScriptLang string

ScriptLang ...

type SearchParams added in v0.5.2

type SearchParams struct {
	Query  string `json:"query" validate:"required,min=1,max;255"`
	Limit  int64  `json:"limit" validate:"required,gte=1,lte=1000"`
	Offset int64  `json:"offset" validate:"required,gte=0,lte=1000"`
}

SearchParams ...

type StatusType

type StatusType string

StatusType ...

Directories

Path Synopsis
astronomics
web

Jump to

Keyboard shortcuts

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