util

package
v0.0.0-...-57ed434 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: AGPL-3.0 Imports: 19 Imported by: 13

Documentation

Index

Constants

View Source
const (
	AtPrefix = "@#["
	AtSuffix = "]&$"
	AtSplit  = ":"
)

Variables

This section is empty.

Functions

func CheckIssueCommentLen

func CheckIssueCommentLen(comment string) errs.SystemErrorInfo

func CheckIssueRemarkLen

func CheckIssueRemarkLen(str string) errs.SystemErrorInfo

func CheckIssueTitleLen

func CheckIssueTitleLen(str string) errs.SystemErrorInfo

func CheckUserNameLen

func CheckUserNameLen(str string) errs.SystemErrorInfo

func ConvertObject

func ConvertObject(src interface{}, source interface{}) errs.SystemErrorInfo

func FieldInUpdate

func FieldInUpdate(updateFields []string, field string) bool

func FileRead

func FileRead(dir string) (string, error)

func GetCommentAtUserIds

func GetCommentAtUserIds(content string) []int64

func GetCompressedPath

func GetCompressedPath(path string, typ int) string

func GetCurrentPath

func GetCurrentPath() string

func GetCustomEnv

func GetCustomEnv() string

GetCustomEnv 第三方定制客户(独立部署客户)的环境变量,

func GetDifMemberIds

func GetDifMemberIds(beforeUserIds []int64, afterUserIds []int64) ([]int64, []int64)

*

方法返回参数结束

移除的ids|新增的ids|err

func GetDifMemberIdsByString

func GetDifMemberIdsByString(beforeUserIds []string, afterUserIds []string) ([]string, []string)

*

方法返回参数结束

移除的ids|新增的ids|err

func GetMQTTAppChannel

func GetMQTTAppChannel(orgId, appId int64) string

获取MQTT app channel

func GetMQTTOrgChannel

func GetMQTTOrgChannel(orgId int64) string

获取MQTT组织channel

func GetMQTTOrgRootChannel

func GetMQTTOrgRootChannel(orgId int64) string

获取MQTT组织channel

func GetMQTTProjectChannel

func GetMQTTProjectChannel(orgId, projectId int64) string

获取MQTT项目channel

func GetMQTTTableChannel

func GetMQTTTableChannel(orgId, appId, tableId int64) string

获取MQTT表channel

func GetMQTTUserChannel

func GetMQTTUserChannel(orgId, userId int64) string

获取MQTT用户channel

func GetMobile

func GetMobile(mobile string) string

func GetOssKeyInfo

func GetOssKeyInfo(key string) bo.OssKeyInfo

func GzipEncoding

func GzipEncoding(in []byte) []byte

func InterfaceToInt64

func InterfaceToInt64(v interface{}) (int64, bool)

InterfaceToInt64 interface 转 int64

func IsBool

func IsBool(t int) bool

判断是否为bool类型(为1或2)

func IsChinaMobileEnv

func IsChinaMobileEnv() bool

IsChinaMobileEnv 应用当前运行环境是否是“中国移动”的独立部署环境

func JointUrl

func JointUrl(host, path string) string

拼接url

func ModifyFileName

func ModifyFileName(path string, str string) string

植入文件名

func PageOption

func PageOption(page *int, size *int) (pageA uint, sizeA uint)

func ParseCacheKey

func ParseCacheKey(key string, params map[string]interface{}) (string, errs.SystemErrorInfo)

func ParseFileName

func ParseFileName(path string) string

获取文件名

func ParseFileSuffix

func ParseFileSuffix(fileName string) string

获取文件后缀

func PwdEncrypt

func PwdEncrypt(cleartextPassword, salt string) string

func PwdEncryptForLesscodeAccoutLogin

func PwdEncryptForLesscodeAccoutLogin(loginNamePlusInputPwd, salt string) string

func ReadAndWrite

func ReadAndWrite(dirFrom string, context map[string]interface{}, tx sqlbuilder.Tx) errs.SystemErrorInfo

func RenderCommentContentToMarkDown

func RenderCommentContentToMarkDown(content string, onlyComment bool) string

评论提及规则: @#[姓名:open_id:user_id]&$

func RenderCommentContentToMarkDownWithOpenIdMap

func RenderCommentContentToMarkDownWithOpenIdMap(content string, onlyComment bool, openIdMap map[string]string) string

评论 带替换

func RenderCommentContentToOrigin

func RenderCommentContentToOrigin(content string) string

将评论转成原始格式,输入@#[xxx:open_id:user_id]&$ 你好, 输出@xxx 你好

func RoleOperationCodesMatch

func RoleOperationCodesMatch(operationCode string, operationCodes string) bool

func UnicodeEmojiCodeFilter

func UnicodeEmojiCodeFilter(s string) string

表情转换

func WriteWithIoutil

func WriteWithIoutil(name, content string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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