1 Star 0 Fork 0

leminewx/polarisprotocol

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
identity.go 465 Bytes
一键复制 编辑 原始数据 按行查看 历史
wenxian 提交于 2024-01-04 18:06 +08:00 . 优化协议
package protocol
type Identity uint8
const (
IDE_GATEWAY Identity = iota
IDE_INSTANCE
IDE_REGISTRAR
)
func (own Identity) String() string {
switch own {
case IDE_GATEWAY:
return "gateway"
case IDE_INSTANCE:
return "instance"
case IDE_REGISTRAR:
return "registrar"
default:
return "unknown"
}
}
func HasIdentity(sender Identity) bool {
switch sender {
case IDE_GATEWAY, IDE_INSTANCE, IDE_REGISTRAR:
return true
default:
return false
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leminewx/polarisprotocol.git
git@gitee.com:leminewx/polarisprotocol.git
leminewx
polarisprotocol
polarisprotocol
edd3e93176c7

搜索帮助