go-fastdfs/breakpoint.html

736 lines
21 KiB
HTML
Raw Normal View History

2019-08-23 15:05:26 +08:00
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>断点续传"SDK" · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
2019-11-04 11:27:17 +08:00
<link rel="next" href="breakpoint.html" />
2019-08-23 15:05:26 +08:00
<link rel="prev" href="usage.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="./">
2019-11-04 11:27:17 +08:00
<a href="./#vision">
愿景
</a>
</li>
<li class="chapter " data-level="1.2" data-path="./">
2019-08-23 15:05:26 +08:00
<a href="./#background">
背景
</a>
<ul class="articles">
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.2.1" data-path="./">
2019-08-23 15:05:26 +08:00
<a href="./#what">
go-fastdfs是什么
</a>
</li>
</ul>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.3" data-path="./">
2019-08-23 15:05:26 +08:00
<a href="./#character">
特性
</a>
<ul class="articles">
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.3.1" data-path="./">
2019-08-23 15:05:26 +08:00
<a href="./#advantage">
go-fastdfs优点
</a>
</li>
</ul>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.4" data-path="install.html">
2019-08-23 15:05:26 +08:00
<a href="install.html">
安装
</a>
<ul class="articles">
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.4.1" data-path="install.html">
2019-08-23 15:05:26 +08:00
<a href="install.html#quick">
极速体验
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.4.2" data-path="install.html">
<a href="install.html#docker">
Docker体验
</a>
</li>
<li class="chapter " data-level="1.4.3" data-path="install.html">
2019-09-06 10:38:28 +08:00
2019-08-23 15:05:26 +08:00
<a href="install.html#compiler_install">
编译安装
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.4.4" data-path="install.html">
2019-08-23 15:05:26 +08:00
<a href="install.html#small-cluster">
小集群安装
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.4.5" data-path="install.html">
2019-08-23 15:05:26 +08:00
<a href="install.html#big-cluster">
2019-11-04 11:27:17 +08:00
海量集群安装(推荐)
2019-08-26 11:11:53 +08:00
</a>
</li>
</ul>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.5" data-path="authentication.html">
<a href="authentication.html">
认证
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="authentication.html">
<a href="authentication.html#fingerprint">
按文件指纹认证
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="authentication.html">
<a href="authentication.html#google">
按google认证码认证
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="authentication.html">
<a href="authentication.html#custom">
用户自定义认证
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="usage.html">
2019-08-23 15:05:26 +08:00
<a href="usage.html">
语言"SDK"
</a>
<ul class="articles">
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.6.1" data-path="usage.html">
<a href="usage.html#description">
统一说明(重要)
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="usage.html">
2019-09-24 11:09:15 +08:00
2019-08-23 15:05:26 +08:00
<a href="usage.html#cmdline">
命令行上传
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.6.3" data-path="usage.html">
2019-08-23 15:05:26 +08:00
<a href="usage.html#web">
浏览器上传
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.6.4" data-path="usage.html">
2019-08-23 15:05:26 +08:00
<a href="usage.html#python">
Python语言
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.6.5" data-path="usage.html">
2019-08-23 15:05:26 +08:00
<a href="usage.html#go">
GO使用
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.6.6" data-path="usage.html">
2019-08-23 15:05:26 +08:00
<a href="usage.html#java">
Java语言
</a>
2019-11-04 11:27:17 +08:00
<ul class="articles">
<li class="chapter " data-level="1.6.6.1" data-path="usage.html">
<a href="usage.html#java-stream">
Java流上传
</a>
</li>
</ul>
2019-08-29 11:48:02 +08:00
</li>
</ul>
2019-08-23 15:05:26 +08:00
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.7" data-path="breakpoint.html">
2019-08-23 15:05:26 +08:00
<a href="breakpoint.html#go">
断点续传"SDK"
</a>
2019-11-04 11:27:17 +08:00
<ul class="articles">
<li class="chapter " data-level="1.7.1" data-path="breakpoint.html">
<a href="breakpoint.html#go">
GO
</a>
2019-08-26 11:11:53 +08:00
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.7.2" data-path="breakpoint.html">
<a href="breakpoint.html#js">
Javascript
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.8" data-path="api.html">
2019-08-23 15:05:26 +08:00
<a href="api.html">
管理API
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.9" data-path="QA.html">
2019-08-23 15:05:26 +08:00
<a href="QA.html">
问题汇总
</a>
<ul class="articles">
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.9.1" data-path="QA.html">
2019-08-23 15:05:26 +08:00
<a href="QA.html">
常见问题
</a>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.9.2" data-path="QA.html">
2019-08-23 15:05:26 +08:00
<a href="QA.html">
维护问题
</a>
</li>
</ul>
</li>
2019-11-04 11:27:17 +08:00
<li class="chapter " data-level="1.10" data-path="upgrade.html">
<a href="upgrade.html">
更新历史
</a>
</li>
2019-08-23 15:05:26 +08:00
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >断点续传"SDK"</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="&#x65AD;&#x70B9;&#x7EED;&#x4F20;&#x793A;&#x4F8B;">&#x65AD;&#x70B9;&#x7EED;&#x4F20;&#x793A;&#x4F8B;</h1>
<h2 id="go">golang&#x7248;&#x672C;</h2>
<pre><code class="lang-go"><span class="hljs-keyword">package</span> main
<span class="hljs-keyword">import</span> (
<span class="hljs-string">&quot;os&quot;</span>
<span class="hljs-string">&quot;fmt&quot;</span>
<span class="hljs-string">&quot;github.com/eventials/go-tus&quot;</span>
)
<span class="hljs-keyword">func</span> main() {
f, err := os.Open(<span class="hljs-string">&quot;100m&quot;</span>)
<span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
<span class="hljs-built_in">panic</span>(err)
}
<span class="hljs-keyword">defer</span> f.Close()
<span class="hljs-comment">// create the tus client.</span>
client, err := tus.NewClient(<span class="hljs-string">&quot;http://10.1.5.9:8080/big/upload/&quot;</span>, <span class="hljs-literal">nil</span>)
fmt.Println(err)
<span class="hljs-comment">// create an upload from a file.</span>
upload, err := tus.NewUploadFromFile(f)
fmt.Println(err)
<span class="hljs-comment">// create the uploader.</span>
uploader, err := client.CreateUpload(upload)
fmt.Println(err)
<span class="hljs-comment">// start the uploading process.</span>
fmt.Println( uploader.Upload())
}
<span class="hljs-string">`
</span></code></pre>
2019-11-04 11:27:17 +08:00
<h2 id="js">javascript&#x7248;&#x672C; <a href="https://uppy.io/" target="_blank">&#x66F4;&#x591A;&#x8BF7;&#x67E5;&#x9605;</a></h2>
<pre><code class="lang-html">
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">&quot;utf-8&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>go-fastdfs<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="undefined">form { bargin } .form-line { display:block;height: 30px;margin:8px; } #stdUpload {background: #fafafa;border-radius: 10px;width: 745px; }</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;https://transloadit.edgly.net/releases/uppy/v0.30.0/dist/uppy.min.css&quot;</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">&quot;stylesheet&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>&#x65AD;&#x70B9;&#x7EED;&#x4F20;&#xFF08;&#x5982;&#x679C;&#x6587;&#x4EF6;&#x5F88;&#x5927;&#x65F6;&#x53EF;&#x4EE5;&#x8003;&#x8651;&#xFF09;<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;drag-drop-area&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;https://transloadit.edgly.net/releases/uppy/v0.30.0/dist/uppy.min.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="actionscript"><span class="hljs-keyword">var</span> uppy = Uppy.Core().use(Uppy.Dashboard, {
inline: <span class="hljs-literal">true</span>,
target: <span class="hljs-string">&apos;#drag-drop-area&apos;</span>
}).use(Uppy.Tus, {
endpoint: <span class="hljs-string">&apos;/big/upload/&apos;</span>
})
uppy.on(<span class="hljs-string">&apos;complete&apos;</span>, (result) =&gt; {
<span class="hljs-comment">// console.log(result) console.log(&apos;Upload complete! We&#x2019;ve uploaded these files:&apos;, result.successful)</span>
})
uppy.setMeta({ auth_token: <span class="hljs-string">&apos;xx&apos;</span>,callback_url:<span class="hljs-string">&apos;http://127.0.0.1/callback&apos;</span> })<span class="hljs-comment">//&#x8FD9;&#x91CC;&#x662F;&#x4F20;&#x9012;&#x4E0A;&#x4F20;&#x7684;&#x8BA4;&#x8BC1;&#x53C2;&#x6570;,callback_url&#x53C2;&#x6570;&#x4E2D; id&#x4E3A;&#x6587;&#x4EF6;&#x7684;ID,info &#x6587;&#x8F6C;&#x7684;&#x57FA;&#x672C;&#x4FE1;&#x606F;json</span>
</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
2019-08-23 15:05:26 +08:00
<p><a href="https://github.com/tus" target="_blank">&#x66F4;&#x591A;&#x5BA2;&#x6237;&#x7AEF;&#x8BF7;&#x53C2;&#x8003;</a></p>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
2019-11-04 11:27:17 +08:00
<a href="usage.html#java-stream" class="navigation navigation-prev " aria-label="Previous page: Java流上传">
2019-08-23 15:05:26 +08:00
<i class="fa fa-angle-left"></i>
</a>
2019-11-04 11:27:17 +08:00
<a href="breakpoint.html#go" class="navigation navigation-next " aria-label="Next page: GO">
2019-08-23 15:05:26 +08:00
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
2019-11-28 14:40:34 +08:00
gitbook.page.hasChanged({"page":{"title":"断点续传\"SDK\"","level":"1.7","depth":1,"next":{"title":"GO","level":"1.7.1","depth":2,"anchor":"#go","path":"breakpoint.md","ref":"breakpoint.md#go","articles":[]},"previous":{"title":"Java流上传","level":"1.6.6.1","depth":3,"anchor":"#java-stream","path":"usage.md","ref":"usage.md#java-stream","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"breakpoint.md","mtime":"2019-08-29T03:43:35.178Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-11-28T06:39:40.626Z"},"basePath":".","book":{"language":""}});
2019-08-23 15:05:26 +08:00
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
2019-10-18 17:53:23 +08:00
<script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
2019-08-23 15:05:26 +08:00
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>