Ai
4 Star 4 Fork 0

Gitee 极速下载/Speedle

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/oracle/speedle
克隆/下载
utils.go 604 Bytes
一键复制 编辑 原始数据 按行查看 历史
//Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
//Licensed under the Universal Permissive License (UPL) Version 1.0 as shown at http://oss.oracle.com/licenses/upl.
package subjectutils
import (
"fmt"
adsapi "github.com/oracle/speedle/api/ads"
)
// EncodePrincipal encodes prinicpal object to string
// Form: [idd=<IDD>:]<Type>:<Name>
func EncodePrincipal(principal *adsapi.Principal) string {
if len(principal.IDD) != 0 {
return fmt.Sprintf("idd=%s:%s:%s", principal.IDD, principal.Type, principal.Name)
}
return fmt.Sprintf("%s:%s", principal.Type, principal.Name)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/Speedle.git
git@gitee.com:mirrors/Speedle.git
mirrors
Speedle
Speedle
1643d905b0e4

搜索帮助