Ai
1 Star 0 Fork 17

Ellan-bm/SIP协议

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
util.go 448 Bytes
一键复制 编辑 原始数据 按行查看 历史
shallot 提交于 2020-04-05 12:24 +08:00 . 添加SIP协议的解析代码。
package sip
import (
"encoding/json"
)
// 行分隔符(CRLF)
const CRLF = "\r\n"
// 是否是有效的行(CRLF)
func IsValidLine(line string) bool {
l := len(line)
return l >= 2 && line[l-2:] == CRLF
}
// 移除行的CRLF标志
func RemoveLineCRLF(line string) string {
return line[:len(line)-2]
}
// TODO 克隆一个对象
func Clone(src interface{}, target interface{}) {
str, _ := json.Marshal(src)
_ = json.Unmarshal(str, target)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ellan-bm/sip.git
git@gitee.com:ellan-bm/sip.git
ellan-bm
sip
SIP协议
master

搜索帮助