rclone: github.com/ncw/rclone/backend/mailru/api Index | Files

package api

import "github.com/ncw/rclone/backend/mailru/api"


Package Files

bin.go helpers.go m1.go


const (
    BinContentType    = "application/x-www-form-urlencoded"
    TreeIDLength      = 12
    DunnoNodeIDLength = 16

BIN protocol constants

const (
    OperationAddFile           = 103 // 0x67
    OperationRename            = 105 // 0x69
    OperationCreateFolder      = 106 // 0x6A
    OperationFolderList        = 117 // 0x75
    OperationSharedFoldersList = 121 // 0x79
    // TODO investigate opcodes below
    Operation154MaybeItemInfo = 154 // 0x9A
    Operation102MaybeAbout    = 102 // 0x66
    Operation104MaybeDelete   = 104 // 0x68

Operations in binary protocol

const (
    MkdirResultOK                  = 0
    MkdirResultSourceNotExists     = 1
    MkdirResultAlreadyExists       = 4
    MkdirResultExistsDifferentCase = 9
    MkdirResultInvalidName         = 10
    MkdirResultFailed254           = 254

CreateDir protocol constants

const (
    MoveResultOK              = 0
    MoveResultSourceNotExists = 1
    MoveResultFailed002       = 2
    MoveResultAlreadyExists   = 4
    MoveResultFailed005       = 5
    MoveResultFailed254       = 254

Move result codes

const (
    AddResultOK          = 0
    AddResultError01     = 1
    AddResultDunno04     = 4
    AddResultWrongPath   = 5
    AddResultNoFreeSpace = 7
    AddResultDunno09     = 9
    AddResultInvalidName = 10
    AddResultNotModified = 12
    AddResultFailedA     = 253
    AddResultFailedB     = 254

AddFile result codes

const (
    ListOptTotalSpace  = 1
    ListOptDelete      = 2
    ListOptFingerprint = 4
    ListOptUnknown8    = 8
    ListOptUnknown16   = 16
    ListOptFolderSize  = 32
    ListOptUsedSpace   = 64
    ListOptUnknown128  = 128
    ListOptUnknown256  = 256

List request options

const (
    ListParseDone      = 0
    ListParseReadItem  = 1
    ListParsePin       = 2
    ListParsePinUpper  = 3
    ListParseUnknown15 = 15

List parse flags

const (
    ListResultOK              = 0
    ListResultNotExists       = 1
    ListResultDunno02         = 2
    ListResultDunno03         = 3
    ListResultAlreadyExists04 = 4
    ListResultDunno05         = 5
    ListResultDunno06         = 6
    ListResultDunno07         = 7
    ListResultDunno08         = 8
    ListResultAlreadyExists09 = 9
    ListResultDunno10         = 10
    ListResultDunno11         = 11
    ListResultDunno12         = 12
    ListResultFailedB         = 253
    ListResultFailedA         = 254

List operation results

const (
    ListItemMountPoint   = 0
    ListItemFile         = 1
    ListItemFolder       = 2
    ListItemSharedFolder = 3

Directory item types

const (
    APIServerURL      = "https://cloud.mail.ru"
    PublicLinkURL     = "https://cloud.mail.ru/public/"
    DispatchServerURL = "https://dispatcher.cloud.mail.ru"
    OAuthURL          = "https://o2.mail.ru/token"
    OAuthClientID     = "cloud-win"

M1 protocol constants and structures

const ListOptDefaults = ListOptUnknown128 | ListOptUnknown256 | ListOptFolderSize | ListOptTotalSpace | ListOptUsedSpace

ListOptDefaults ...


var (
    ErrorPrematureEOF  = errors.New("Premature EOF")
    ErrorInvalidLength = errors.New("Invalid length")
    ErrorZeroTerminate = errors.New("String must end with zero")

protocol errors

type BinReader Uses

type BinReader struct {
    // contains filtered or unexported fields

BinReader is a binary protocol reader helper

func NewBinReader Uses

func NewBinReader(reader io.Reader) *BinReader

NewBinReader creates a binary protocol reader helper

func (*BinReader) Count Uses

func (r *BinReader) Count() uint64

Count returns number of bytes read

func (*BinReader) Error Uses

func (r *BinReader) Error() error

Error returns first encountered error or nil

func (*BinReader) ReadByteAsInt Uses

func (r *BinReader) ReadByteAsInt() int

ReadByteAsInt reads a single byte as uint32, returns -1 for EOF or errors

func (*BinReader) ReadByteAsShort Uses

func (r *BinReader) ReadByteAsShort() int16

ReadByteAsShort reads a single byte as uint16, returns -1 for EOF or errors

func (*BinReader) ReadBytesByLength Uses

func (r *BinReader) ReadBytesByLength() []byte

ReadBytesByLength reads buffer length and its bytes

func (*BinReader) ReadDate Uses

func (r *BinReader) ReadDate() time.Time

ReadDate reads a Unix encoded time

func (*BinReader) ReadIntSpl Uses

func (r *BinReader) ReadIntSpl() int

ReadIntSpl reads two bytes as little-endian uint16, returns -1 for EOF or errors

func (*BinReader) ReadNBytes Uses

func (r *BinReader) ReadNBytes(len int) []byte

ReadNBytes reads given number of bytes, returns invalid data for EOF or errors

func (*BinReader) ReadPu32 Uses

func (r *BinReader) ReadPu32() int64

ReadPu32 returns -1 for EOF or errors

func (*BinReader) ReadString Uses

func (r *BinReader) ReadString() string

ReadString reads a zero-terminated string with length

func (*BinReader) ReadULong Uses

func (r *BinReader) ReadULong() uint64

ReadULong returns uint64 equivalent of -1 for EOF or errors

type BinWriter Uses

type BinWriter struct {
    // contains filtered or unexported fields

BinWriter is a binary protocol writer

func NewBinWriter Uses

func NewBinWriter() *BinWriter

NewBinWriter creates a binary protocol helper

func (*BinWriter) Bytes Uses

func (w *BinWriter) Bytes() []byte

Bytes returns binary data

func (*BinWriter) Reader Uses

func (w *BinWriter) Reader() io.Reader

Reader returns io.Reader with binary data

func (*BinWriter) Write Uses

func (w *BinWriter) Write(buf []byte)

Write writes a byte buffer

func (*BinWriter) WritePu16 Uses

func (w *BinWriter) WritePu16(val int)

WritePu16 writes a short as unsigned varint

func (*BinWriter) WritePu32 Uses

func (w *BinWriter) WritePu32(val int64)

WritePu32 writes a signed long as unsigned varint

func (*BinWriter) WritePu64 Uses

func (w *BinWriter) WritePu64(val int64)

WritePu64 writes an unsigned (actually, signed) long as unsigned varint

func (*BinWriter) WriteString Uses

func (w *BinWriter) WriteString(str string)

WriteString writes a zero-terminated string

func (*BinWriter) WriteWithLength Uses

func (w *BinWriter) WriteWithLength(buf []byte)

WriteWithLength writes a byte buffer prepended with its length as varint

type CleanupResponse Uses

type CleanupResponse struct {
    Email     string `json:"email"`
    Time      int64  `json:"time"`
    StatusStr string `json:"status"`

CleanupResponse ...

type FileErrorResponse Uses

type FileErrorResponse struct {
    Body struct {
        Home struct {
            Value string `json:"value"`
            Error string `json:"error"`
        } `json:"home"`
    }   `json:"body"`
    Status  int    `json:"status"`
    Account string `json:"email,omitempty"`
    Time    int64  `json:"time,omitempty"`
    Message string // non-json, calculated field

FileErrorResponse represents erroneous API response for a file

func (*FileErrorResponse) Error Uses

func (e *FileErrorResponse) Error() string

type FolderInfoResponse Uses

type FolderInfoResponse struct {
    Body struct {
        Count struct {
            Folders int `json:"folders"`
            Files   int `json:"files"`
        }   `json:"count"`
        Tree string `json:"tree"`
        Name string `json:"name"`
        Grev int    `json:"grev"`
        Size int64  `json:"size"`
        Sort struct {
            Order string `json:"order"`
            Type  string `json:"type"`
        }   `json:"sort"`
        Kind string     `json:"kind"`
        Rev  int        `json:"rev"`
        Type string     `json:"type"`
        Home string     `json:"home"`
        List []ListItem `json:"list"`
    }   `json:"body,omitempty"`
    Time   int64  `json:"time"`
    Status int    `json:"status"`
    Email  string `json:"email"`

FolderInfoResponse ...

type GenericBodyResponse Uses

type GenericBodyResponse struct {
    Email  string `json:"email"`
    Body   string `json:"body"`
    Time   int64  `json:"time"`
    Status int    `json:"status"`

GenericBodyResponse ...

type GenericResponse Uses

type GenericResponse struct {
    Email  string `json:"email"`
    Time   int64  `json:"time"`
    Status int    `json:"status"`

GenericResponse ...

type ItemInfoResponse Uses

type ItemInfoResponse struct {
    Email  string   `json:"email"`
    Body   ListItem `json:"body"`
    Time   int64    `json:"time"`
    Status int      `json:"status"`

ItemInfoResponse ...

type ListItem Uses

type ListItem struct {
    Count struct {
        Folders int `json:"folders"`
        Files   int `json:"files"`
    }   `json:"count,omitempty"`
    Kind      string `json:"kind"`
    Type      string `json:"type"`
    Name      string `json:"name"`
    Home      string `json:"home"`
    Size      int64  `json:"size"`
    Mtime     int64  `json:"mtime,omitempty"`
    Hash      string `json:"hash,omitempty"`
    VirusScan string `json:"virus_scan,omitempty"`
    Tree      string `json:"tree,omitempty"`
    Grev      int    `json:"grev,omitempty"`
    Rev       int    `json:"rev,omitempty"`

ListItem ...

type ServerErrorResponse Uses

type ServerErrorResponse struct {
    Message string `json:"body"`
    Time    int64  `json:"time"`
    Status  int    `json:"status"`

ServerErrorResponse represents erroneous API response.

func (*ServerErrorResponse) Error Uses

func (e *ServerErrorResponse) Error() string

type ShardInfoResponse Uses

type ShardInfoResponse struct {
    Email string `json:"email"`
    Body  struct {
        Video []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"video"`
        ViewDirect []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"view_direct"`
        WeblinkView []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"weblink_view"`
        WeblinkVideo []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"weblink_video"`
        WeblinkGet []struct {
            Count int    `json:"count"`
            URL   string `json:"url"`
        }   `json:"weblink_get"`
        Stock []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"stock"`
        WeblinkThumbnails []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"weblink_thumbnails"`
        PublicUpload []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"public_upload"`
        Auth []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"auth"`
        Web []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"web"`
        View []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"view"`
        Upload []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"upload"`
        Get []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"get"`
        Thumbnails []struct {
            Count string `json:"count"`
            URL   string `json:"url"`
        }   `json:"thumbnails"`
    }   `json:"body"`
    Time   int64 `json:"time"`
    Status int   `json:"status"`

ShardInfoResponse ...

type UserInfoResponse Uses

type UserInfoResponse struct {
    Body struct {
        AccountType     string `json:"account_type"`
        AccountVerified bool   `json:"account_verified"`
        Cloud           struct {
            Beta struct {
                Allowed bool `json:"allowed"`
                Asked   bool `json:"asked"`
            }   `json:"beta"`
            Billing struct {
                ActiveCostID string `json:"active_cost_id"`
                ActiveRateID string `json:"active_rate_id"`
                AutoProlong  bool   `json:"auto_prolong"`
                Basequota    int64  `json:"basequota"`
                Enabled      bool   `json:"enabled"`
                Expires      int    `json:"expires"`
                Prolong      bool   `json:"prolong"`
                Promocodes   struct {
                }   `json:"promocodes"`
                Subscription []interface{} `json:"subscription"`
                Version      string        `json:"version"`
            }   `json:"billing"`
            Bonuses struct {
                CameraUpload bool `json:"camera_upload"`
                Complete     bool `json:"complete"`
                Desktop      bool `json:"desktop"`
                Feedback     bool `json:"feedback"`
                Links        bool `json:"links"`
                Mobile       bool `json:"mobile"`
                Registration bool `json:"registration"`
            }   `json:"bonuses"`
            Enable struct {
                Sharing bool `json:"sharing"`
            }   `json:"enable"`
            FileSizeLimit int64 `json:"file_size_limit"`
            Space         struct {
                BytesTotal int64 `json:"bytes_total"`
                BytesUsed  int   `json:"bytes_used"`
                Overquota  bool  `json:"overquota"`
            }   `json:"space"`
        }   `json:"cloud"`
        Cloudflags struct {
            Exists bool `json:"exists"`
        }   `json:"cloudflags"`
        Domain string `json:"domain"`
        Login  string `json:"login"`
        Newbie bool   `json:"newbie"`
        UI     struct {
            ExpandLoader bool   `json:"expand_loader"`
            Kind         string `json:"kind"`
            Sidebar      bool   `json:"sidebar"`
            Sort         struct {
                Order string `json:"order"`
                Type  string `json:"type"`
            }   `json:"sort"`
            Thumbs bool `json:"thumbs"`
        }   `json:"ui"`
    }   `json:"body"`
    Email  string `json:"email"`
    Status int    `json:"status"`
    Time   int64  `json:"time"`

UserInfoResponse contains account metadata

Package api imports 9 packages (graph). Updated 2019-09-12. Refresh now. Tools for package owners.