Documentation
¶
Index ¶
- Constants
- func VerifySign(pkey, signmsg, sign []byte) (bool, error)
- type AuthType
- type CustomClaims
- type DelList
- type FileMetaData
- type FragmentInfo
- type Node
- func (n *Node) AddToBlacklist(peerid string)
- func (n *Node) DelFromBlacklist(peerid string)
- func (n *Node) DeleteTrackFile(filehash string)
- func (n *Node) EncodePeers() []byte
- func (n *Node) GetAllPeerId() []string
- func (n *Node) GetPeer(peerid string) (peer.AddrInfo, bool)
- func (n *Node) HasBlacklist(peerid string) (int64, bool)
- func (n *Node) HasPeer(peerid string) bool
- func (n *Node) HasTrackFile(filehash string) bool
- func (n *Node) ListTrackFiles() ([]string, error)
- func (n *Node) LoadPeersFromDisk(path string) error
- func (n *Node) ParseTrackFromFile(filehash string) (RecordInfo, error)
- func (n *Node) QueryAssignedMiner(minerTaskList []pattern.MinerTaskList) ([]string, []string, error)
- func (n *Node) RebuildDirs()
- func (n *Node) RemovePeerIntranetAddr()
- func (n *Node) Run()
- func (n *Node) SaveOrUpdatePeerUnSafe(peerid string, addr peer.AddrInfo)
- func (n *Node) SavePeer(peerid string, addr peer.AddrInfo)
- func (n *Node) SavePeersToDisk(path string) error
- func (n *Node) SetSignkey(signkey []byte)
- func (n *Node) SetTrackDir(dir string)
- func (n *Node) TaskMgt()
- func (n *Node) WriteTrackFile(filehash string, data []byte) error
- type Oss
- type RecordInfo
- type RespMsg
- type RtnBlockInfo
- type RtnFileType
- type RtnUserBrief
- type SegmentInfo
Constants ¶
View Source
const ( HTTPHeader_Authorization = "Authorization" HTTPHeader_BucketName = "BucketName" HTTPHeader_Account = "Account" HTTPHeader_Digest = "Digest" HTTPHeader_Operation = "Operation" HTTPHeader_Message = "Message" HTTPHeader_Signature = "Signature" HTTPHeader_Fid = "Fid" )
HTTP HEADER
View Source
const ( Active = iota Calculate Missing Recovery )
View Source
const ( HTTP_ParameterName = "name" FormFileKey1 = "file" FormFileKey2 = "File" FormFileKey3 = "FILE" )
View Source
const ( INFO_PutRequest = "PutRequest" INFO_GetRequest = "GetRequest" INFO_DelRequest = "DelRequest" ERR_DuplicateOrder = "duplicate order" ERR_MissToken = "InvalidHead.MissToken" ERR_EmptySeed = "InvalidProfile.EmptySeed" ERR_MissAccount = "InvalidHead.MissAccount" ERR_InvalidAccount = "InvalidHead.Account" ERR_NoPermission = "InvalidToken.NoPermission" ERR_InvalidToken = "InvalidHead.Token" ERR_InvalidName = "InvalidParameter.Name" ERR_InvalidFilehash = "InvalidParameter.FileHash" ERR_InvalidParaBucketName = "InvalidParameter.BucketName" ERR_InvalidBucketName = "InvalidHead.BucketName" ERR_EmptyBucketName = "Invalid.EmptyBucketName" ERR_EmptyFile = "InvalidBody.EmptyFile" ERR_ReadBody = "InvalidBody.ReadErr" ERR_ParseBody = "InvalidBody.ParseErr" //ERR_SpaceExpired = "space expired" ERR_NotEnoughSpace = "not enough account space" ERR_InternalServer = "InternalError" )
View Source
const ( ERR_Authorization = "HeaderErr_Invalid_Authorization" ERR_HeadOperation = "HeaderErr_Invalid_Operation" ERR_NotFound = "Not found" ERR_BodyFormat = "BodyErr_InvalidDataFormat" ERR_BodyFieldAccount = "BodyErr_InvalidField_account" ERR_BodyFieldMessage = "BodyErr_InvalidField_message" ERR_BodyFieldSignature = "BodyErr_InvalidField_signature" ERR_BodyEmptyFile = "BodyErr_EmptyFile" ERR_HeaderFieldBucketName = "HeaderErr_InvalidBucketName" ERR_AccountNotExist = "account does not exist" ERR_RpcFailed = "rpc connection failed" ERR_SpaceExpiresSoon = "space expires soon" ERR_SpaceNotAuth = "space is not authorized" ERR_DeviceSpaceNoLeft = "no space left on the server device" ERR_SysMemNoLeft = "server unsupported file size" ERR_ReceiveFile = "InternalError" )
View Source
const MaxMemUsed = 512 << 20
View Source
const MaxTrackThread = 50
View Source
const MinRecordInfoLength = 132
MinRecordInfoLength = len(json.Marshal(RecordInfo{}))
View Source
const TokenDated = 60 * 60 * 24 * 30
Variables ¶
This section is empty.
Functions ¶
func VerifySign ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct {
Account string `json:"account"`
jwt.StandardClaims
}
type FileMetaData ¶
type FileMetaData struct {
Completion uint32
State string
SegmentList []SegmentInfo
Owner []RtnUserBrief
}
file meta info
type FragmentInfo ¶
type Node ¶
type Node struct {
confile.Confile
logger.Logger
db.Cache
sdk.SDK
*gin.Engine
// contains filtered or unexported fields
}
func (*Node) AddToBlacklist ¶ added in v0.3.0
func (*Node) DelFromBlacklist ¶ added in v0.3.0
func (*Node) DeleteTrackFile ¶
func (*Node) EncodePeers ¶ added in v0.2.5
func (*Node) GetAllPeerId ¶ added in v0.2.1
func (*Node) HasBlacklist ¶ added in v0.3.0
func (*Node) HasTrackFile ¶
func (*Node) ListTrackFiles ¶
func (*Node) LoadPeersFromDisk ¶ added in v0.2.4
func (*Node) ParseTrackFromFile ¶
func (n *Node) ParseTrackFromFile(filehash string) (RecordInfo, error)
func (*Node) QueryAssignedMiner ¶
func (*Node) RebuildDirs ¶
func (n *Node) RebuildDirs()
func (*Node) RemovePeerIntranetAddr ¶ added in v0.2.5
func (n *Node) RemovePeerIntranetAddr()
func (*Node) SaveOrUpdatePeerUnSafe ¶ added in v0.2.5
func (*Node) SavePeersToDisk ¶ added in v0.2.4
func (*Node) SetSignkey ¶
func (*Node) SetTrackDir ¶ added in v0.2.4
type RecordInfo ¶
type RecordInfo struct {
SegmentInfo []pattern.SegmentDataInfo `json:"segmentInfo"`
Owner []byte `json:"owner"`
Roothash string `json:"roothash"`
Filename string `json:"filename"`
Buckname string `json:"buckname"`
Filesize uint64 `json:"filesize"`
Putflag bool `json:"putflag"`
Count uint8 `json:"count"`
Duplicate bool `json:"duplicate"`
}
type RtnBlockInfo ¶
file block info
type RtnFileType ¶
type RtnFileType struct {
FileSize uint64
FileState string
UserBriefs []RtnUserBrief
BlockInfo []RtnBlockInfo
}
type RtnUserBrief ¶
type SegmentInfo ¶
type SegmentInfo struct {
SegmentHash string
FragmentList []FragmentInfo
}
Click to show internal directories.
Click to hide internal directories.