models

package
v0.0.0-...-b465e2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Data  []byte
	Index int
}

Chunk data

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client box client

func NewClient

func NewClient(session *grequests.Session) *Client

NewClient creates a new client

func (*Client) DownloadFile

func (c *Client) DownloadFile(
	readToken string,
	versionID string,
	filename string,
	fileID string,
	sharedName string,
	resolution string,
	chunkNum int,
	threads int,
	docker bool,
) error

DownloadFile download file

func (*Client) GetContent

func (c *Client) GetContent(URL string) (string, error)

GetContent -

func (*Client) GetFileID

func (c *Client) GetFileID(content string) (string, error)

GetFileID get file id

func (*Client) GetInfo

func (c *Client) GetInfo(writeToken string, fileID string, sharedName string) (*Info, error)

GetInfo file info

func (*Client) GetManifest

func (c *Client) GetManifest(readToken string, versionID string, fileID string, sharedName string) (string, error)

GetManifest get manifest

func (*Client) GetRequestToken

func (c *Client) GetRequestToken(content string) (string, error)

GetRequestToken request token

func (*Client) GetTokens

func (c *Client) GetTokens(fileID string, requestToken string, sharedName string) (*Tokens, error)

GetTokens write read token

func (*Client) Login

func (c *Client) Login()

Login -

type FileVersion

type FileVersion struct {
	ID   string `json:"id"`
	Sha1 string `json:"sha1"`
	Type bool   `json:"type"`
}

FileVersion file version info

type Info

type Info struct {
	FileVersion              FileVersion `json:"file_version"`
	AuthenticatedDownloadURL string      `json:"authenticated_download_url"`
	IsDownloadAvailable      bool        `json:"is_download_available"`
	Name                     string      `json:"name"`
	ID                       string      `json:"id"`
	Etag                     string      `json:"etag"`
	Extension                string      `json:"extension"`
	Size                     int         `json:"size"`
	Type                     string      `json:"type"`
}

Info file info

type Tokens

type Tokens struct {
	Read  string `json:"read"`
	Write string `json:"write"`
}

Tokens to get file info

type WriteCounter

type WriteCounter struct {
	Total uint64
}

WriteCounter download size counter

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

PrintProgress prints the progress of a file write

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL