Documentation
¶
Index ¶
- Constants
- func AddClientforMobile(g *gin.Context)
- func AddPubkey(g *gin.Context)
- func CreateAccountCli(g *gin.Context)
- func CreateBucket(g *gin.Context)
- func DownloadFile(g *gin.Context)
- func DownloadFileForSGX(g *gin.Context)
- func ExporterAuthData(g *gin.Context)
- func GetDownloadProgress(g *gin.Context)
- func GetFileAllInfo(g *gin.Context)
- func GetFileBlockDetails(g *gin.Context)
- func GetObjects(g *gin.Context)
- func GetProgramVersion(g *gin.Context)
- func GetProgress(g *gin.Context)
- func GetRandomString2(n int) string
- func Importclient(userName, privateKey string) (*api.Client, error)
- func ImporterAuth(g *gin.Context)
- func LicensedTo(g *gin.Context)
- func ListBucket(g *gin.Context)
- func Login(g *gin.Context)
- func Register(g *gin.Context)
- func SaveFileToLocal(g *gin.Context)
- func UploadFile(g *gin.Context)
- func UploadForAuth(g *gin.Context)
- type AccClient
- type Auth
- type Block
- type Bucket
- type CreateParam
- type CreateRespCli
- type FileBlockAndShardInfo
- type ObjectItem
- type Response
- type ResponseCli
- type Shard
- type User
Constants ¶
View Source
const ( //Function tag Function = "function" //SNID tag SNID = "snID" //MinerID tag MinerID = "minerID" //BlockID tag BlockID = "blockID" //ShardID tag ShardID = "shardID" )
View Source
const ( Success = 0 ReadRequestFailed = -1 ReadResponseFailed = -2 InvalidParameter = -3 SignFailed = -4 VerifyFailed = -5 JsonMarshalFailed = -6 CreateRequestFailed = -7 ServerProcessFailed = -8 SendTrx1Failed = -10 SendTrx2Failed = -11 )
View Source
const AUTH_FAILURE = 0x55
Variables ¶
This section is empty.
Functions ¶
func AddClientforMobile ¶
func CreateAccountCli ¶
func DownloadFileForSGX ¶
func ExporterAuthData ¶
ExporterAuthData 导出授权文件证书,byte类型
func ExporterAuthData(g *gin.Context) {
bucketName := g.Query("bucketName")
fileName := g.Query("fileName")
ownerPublic := g.Query("ownerPublic")
otherPublicKey := g.Query("otherPublicKey")
content := ownerPublic[3:]
c := api.GetClient(content)
exporter, yerr := c.ExporterAuth(bucketName, fileName)
if yerr != nil {
logrus.Panicf("初始化授权导出失败:%s\n", yerr.Msg)
}
newOtherPublicKey := otherPublicKey[3:]
authdata, yerr := exporter.Export(newOtherPublicKey)
if yerr != nil {
logrus.Panicf("导出授权文件失败:%s\n", yerr.Msg)
}
g.JSON(http.StatusOK, gin.H{"authdata": authdata})
}
func GetProgramVersion ¶
func GetProgress ¶
g.String(http.StatusOK, strconv.FormatInt(int64(ii), 10)) }
func GetRandomString2 ¶
func Importclient ¶
Importclient 2.注册导入授权的用户实例
func LicensedTo ¶
func SaveFileToLocal ¶
Types ¶
type Auth ¶
type Auth struct {
BucketName string `form:"bucketName" json:"bucketName" binding:"required"`
FileName string `form:"fileName" json:"fileName" xml:"fileName" binding:"required"`
OwnerPublic string `form:"ownerPublic" json:"ownerPublic" xml:"ownerPublic" binding:"required"`
AuthPath string `form:"path" json:"path" binding:"required"`
}
type Block ¶
type Block struct {
BlockNum string //分块编号
BlockEncPath string //16进制加密
BlockSrcPath string //16进制非加密
BlockZipPath string
Shards []*Shard
}
Block 块信息
type CreateParam ¶
type CreateRespCli ¶
type FileBlockAndShardInfo ¶
type FileBlockAndShardInfo struct {
FileName string //文件名
FileLength int64
BlockCount int //文件总块数量
Blocks []*Block
}
FileBlockAndShardInfo 文件信息
type ObjectItem ¶
type ResponseCli ¶
type ResponseCli struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data *CreateRespCli `json:"data"`
}
func CreateResponseCli ¶
func CreateResponseCli(code int, err error, data *CreateRespCli) *ResponseCli
Click to show internal directories.
Click to hide internal directories.