Documentation ¶
Index ¶
- Constants
- func ArrayDiff(arr1, arr2 []string) (diffArr []string)
- func CheckStrInArray(strArray []string, target string) bool
- func CountStrByGBK(str string) int
- func DeleteSliceElement(array []string, elem string) []string
- func GetCardCommentRealWords(comment string) string
- func GetTruncatedComment(comment string, limitWords int, userIds []int64) string
- func InArray(needle string, strSlice []string) bool
- func Int64Implode(list []int64, glue string) string
- func Last(str string, n int) string
- func LcFirst(str string) string
- func ParseOssKey(url string) string
- func RenderAtSomeoneStr(openId, userName string) string
- func ReplaceWhiteSpaceCharToSpace(str string) string
- func RuneLen(s string) int
- func Substr(str string, start, length int) string
- func ToInt64(dest interface{}) (int64, error)
- func ToPtr(s string) *string
- func ToString(dest interface{}) string
- func TrimComment(str string) string
- func TrimHtml(src string) string
- func TruncateColumnName(column lc_table.LcCommonField) string
- func TruncateName(name string, limit int) string
- func TruncateText(text string, count int) string
- func UrlParse(url string) (string, string)
- type CutCommentObj
- func (obj *CutCommentObj) CutComment(limit int) string
- func (obj *CutCommentObj) Peek(n int) string
- func (obj *CutCommentObj) Read(n int) string
- func (obj *CutCommentObj) ReadAttachmentText() (consumeStr string, isAttach bool)
- func (obj *CutCommentObj) ReadCommentText() string
- func (obj *CutCommentObj) ReadOneAtExp() (consumeStr string, isAtText bool)
- func (obj *CutCommentObj) SkipWhitespace()
Constants ¶
View Source
const ( // 定义换行符 EOF = '\x03' // 结束字符 NL = '\n' CR = '\r' EOL = '\n' )
Variables ¶
This section is empty.
Functions ¶
func CheckStrInArray ¶
CheckStrInArray 判断字符串是否字符串切片中
func CountStrByGBK ¶
func DeleteSliceElement ¶
DeleteSliceElement 删除指定字符串元素
func GetTruncatedComment ¶
GetTruncatedComment 评论字数截断,不包含@成员的字数 卫忠实现的 暂时没用。
func ParseOssKey ¶
func ReplaceWhiteSpaceCharToSpace ¶
ReplaceWhiteSpaceCharToSpace 将空白字符替换为一个空格
func Substr ¶
start:正数 - 在字符串的指定位置开始,超出字符串长度强制把start变为字符串长度
负数 - 在从字符串结尾的指定位置开始 0 - 在字符串中的第一个字符处开始
length:正数 - 从 start 参数所在的位置返回
负数 - 从字符串末端返回
func TruncateColumnName ¶
func TruncateColumnName(column lc_table.LcCommonField) string
TruncateColumnName 飞书卡片中,列名部分的截断处理
func TruncateName ¶
func TruncateText ¶
TruncateText 截断文本 count 保留的字符个数
Types ¶
type CutCommentObj ¶
type CutCommentObj struct { Src string SrcRune []rune Offset int Line int Col int Total int // src 总长度 IsPeek bool Ch rune }
CutCommentObj 按照要求解析评论内容用于计算评论长度。at 符号不算作长度。只计算评论文本。 ref: https://github.com/suhanyujie/hello_parser_of_js
func NewCommentCutter ¶
func NewCommentCutter(comment string) *CutCommentObj
func (*CutCommentObj) CutComment ¶
func (obj *CutCommentObj) CutComment(limit int) string
func (*CutCommentObj) ReadAttachmentText ¶
func (obj *CutCommentObj) ReadAttachmentText() (consumeStr string, isAttach bool)
ReadAttachmentText 读取并消耗 `[附件]` 文本
func (*CutCommentObj) ReadCommentText ¶
func (obj *CutCommentObj) ReadCommentText() string
func (*CutCommentObj) ReadOneAtExp ¶
func (obj *CutCommentObj) ReadOneAtExp() (consumeStr string, isAtText bool)
ReadOneAtExp 读取一个 at 标签字符串 <at id=ou_3ab7fe596cf91692218f744558ae157f></at>
func (*CutCommentObj) SkipWhitespace ¶
func (obj *CutCommentObj) SkipWhitespace()
Click to show internal directories.
Click to hide internal directories.