Documentation ¶
Index ¶
- Constants
- Variables
- func CalcAesCTRIV(iv []byte, off uint64) []byte
- func NewAesCTRStream(blk cipher.Block, iv []byte, off uint64) (ctr cipher.Stream)
- type ApiErr
- type Attribute
- type Client
- type Download
- type DownloadOption
- type EncryptedNode
- type FM
- type HttpStatusErr
- type Node
- type NodeInfo
- type NodeInfoReq
- type NodeInfoResp
- type NodeKey
- type NodeType
- type NodesReq
- type NodesResp
Constants ¶
View Source
const ( ApiURL = "https://g.api.mega.co.nz/cs" HandleLen = 8 FolderNodeKeyB64Len = 22 FileNodeKeyB64Len = 43 )
Variables ¶
View Source
var ErrDecryptAttr = errors.New("decrypt mega attribute failed")
View Source
var ErrInvalidKeyLen = errors.New("invalid mega key")
View Source
var ErrInvalidNodeType = errors.New("invalid mega node type")
Functions ¶
func CalcAesCTRIV ¶
Types ¶
type ApiErr ¶
type ApiErr int
const ( API_OK ApiErr = 0 API_EINTERNAL ApiErr = -1 // internal error API_EARGS ApiErr = -2 // bad arguments API_EAGAIN ApiErr = -3 // request failed retry with exponential backoff API_ERATELIMIT ApiErr = -4 // too many requests slow down API_EFAILED ApiErr = -5 // request failed permanently API_ETOOMANY ApiErr = -6 // too many requests for this resource API_ERANGE ApiErr = -7 // resource access out of rage API_EEXPIRED ApiErr = -8 // resource expired API_ENOENT ApiErr = -9 // resource does not exist API_ECIRCULAR ApiErr = -10 // circular linkage API_EACCESS ApiErr = -11 // access denied API_EEXIST ApiErr = -12 // resource already exists API_EINCOMPLETE ApiErr = -13 // request incomplete API_EKEY ApiErr = -14 // cryptographic error API_ESID ApiErr = -15 // bad session ID API_EBLOCKED ApiErr = -16 // resource administratively blocked API_EOVERQUOTA ApiErr = -17 // quote exceeded API_ETEMPUNAVAIL ApiErr = -18 // resource temporarily not available API_ETOOMANYCONNECTIONS ApiErr = -19 // too many connections on this resource API_EWRITE ApiErr = -20 // file could not be written to API_EREAD ApiErr = -21 // file could not be read from API_EAPPKEY ApiErr = -22 // invalid or missing application key API_ESSL ApiErr = -23 // SSL verification failed API_EGOINGOVERQUOTA ApiErr = -24 // Not enough quota API_EMFAREQUIRED ApiErr = -26 // Multi-factor authentication required )
from MEGA office sdk MError.h
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Download ¶
func (c *Client) Download(info *NodeInfo, opt DownloadOption) (dl *Download, err error)
func (*Client) GetPublicFileNodeInfo ¶
type Download ¶
type DownloadOption ¶
func NewDownloadOption ¶
func NewDownloadOption() DownloadOption
func (DownloadOption) HttpHeader ¶
func (d DownloadOption) HttpHeader(k, v string) DownloadOption
type EncryptedNode ¶
type HttpStatusErr ¶
type HttpStatusErr int
func (HttpStatusErr) Error ¶
func (e HttpStatusErr) Error() string
type Node ¶
type NodeInfoReq ¶
type NodeInfoResp ¶
type NodesReq ¶
type NodesReq struct { A string `json:"a"` C int `json:"c"` R int `json:"r"` //recursive? CA int `json:"ca"` //cache? }
from official web client mega.js treefetcher_fetch
type NodesResp ¶
type NodesResp struct { F []EncryptedNode `json:"f"` SN string `json:"sn"` }
Click to show internal directories.
Click to hide internal directories.