Skip to content

Commit 3584477

Browse files
committed
add GenUserSigWithBuf
1 parent e356f99 commit 3584477

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

TLSSigAPITest.go

100755100644
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"github.com/tencentyun/tls-sig-api-v2-golang/tencentyun"
54
"fmt"
5+
"github.com/tencentyun/tls-sig-api-v2-golang/tencentyun"
66
)
77

88
const (
@@ -29,4 +29,10 @@ func main() {
2929
} else {
3030
fmt.Println(sig)
3131
}
32+
sig, err = tencentyun.GenUserSigWithBuf(sdkappid, key, "xiaojun", 86400*180, []byte("abc"))
33+
if err != nil {
34+
fmt.Println(err.Error())
35+
} else {
36+
fmt.Println(sig)
37+
}
3238
}

tencentyun/TLSSigAPI.go

100755100644
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ func GenUserSig(sdkappid int, key string, userid string, expire int) (string, er
2525
return genSig(sdkappid, key, userid, expire, nil)
2626
}
2727

28+
func GenUserSigWithBuf(sdkappid int, key string, userid string, expire int, buf []byte) (string, error) {
29+
return genSig(sdkappid, key, userid, expire, buf)
30+
}
31+
2832
/**
2933
*【功能说明】
3034
* 用于签发 TRTC 进房参数中可选的 PrivateMapKey 权限票据。

tencentyun/base64url.go

100755100644
File mode changed.

0 commit comments

Comments
 (0)