chore
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@@ -50,10 +49,6 @@ const (
|
|||||||
defaultStyle = "general"
|
defaultStyle = "general"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
errEndpoint = errors.New("failed to get endpoint")
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetEndpoint 获取语音合成服务的端点信息
|
// GetEndpoint 获取语音合成服务的端点信息
|
||||||
func GetEndpoint() (map[string]interface{}, error) {
|
func GetEndpoint() (map[string]interface{}, error) {
|
||||||
signature := Sign(endpointURL)
|
signature := Sign(endpointURL)
|
||||||
@@ -221,16 +216,3 @@ func VoiceList() ([]interface{}, error) {
|
|||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ByteCountIEC(b int64) string {
|
|
||||||
const unit = 1024
|
|
||||||
if b < unit {
|
|
||||||
return fmt.Sprintf("%d B", b)
|
|
||||||
}
|
|
||||||
div, exp := int64(unit), 0
|
|
||||||
for n := b / unit; n >= unit; n /= unit {
|
|
||||||
div *= unit
|
|
||||||
exp++
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%.1f %ciB", float64(b)/float64(div), "KMGTPE"[exp])
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user