forked from TrueCloudLab/rclone
Switch to using the dep tool and update all the dependencies
This commit is contained in:
parent
5135ff73cb
commit
98c2d2c41b
5321 changed files with 4483201 additions and 5922 deletions
187
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/plugin.rb
generated
vendored
Normal file
187
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/plugin.rb
generated
vendored
Normal file
|
@ -0,0 +1,187 @@
|
|||
require 'yard'
|
||||
require 'yard-go'
|
||||
|
||||
module GoLinksHelper
|
||||
def signature(obj, link = true, show_extras = true, full_attr_name = true)
|
||||
case obj
|
||||
when YARDGo::CodeObjects::FuncObject
|
||||
if link && obj.has_tag?(:service_operation)
|
||||
ret = signature_types(obj, !link)
|
||||
args = obj.parameters.map {|m| m[0].split(/\s+/).last }.join(", ")
|
||||
line = "<strong>#{obj.name}</strong>(#{args}) #{ret}"
|
||||
return link ? linkify(obj, line) : line
|
||||
end
|
||||
end
|
||||
|
||||
super(obj, link, show_extras, full_attr_name)
|
||||
end
|
||||
|
||||
def html_syntax_highlight(source, type = nil)
|
||||
src = super(source, type || :go)
|
||||
object.has_tag?(:service_operation) ? link_types(src) : src
|
||||
end
|
||||
end
|
||||
|
||||
YARD::Templates::Helpers::HtmlHelper.send(:prepend, GoLinksHelper)
|
||||
YARD::Templates::Engine.register_template_path(File.dirname(__FILE__) + '/templates')
|
||||
|
||||
YARD::Parser::SourceParser.after_parse_list do
|
||||
YARD::Registry.all(:struct).each do |obj|
|
||||
if obj.file =~ /\/?service\/(.+?)\/(service|api)\.go$/
|
||||
obj.add_tag YARD::Tags::Tag.new(:service, $1)
|
||||
obj.groups = ["Constructor Functions", "Service Operations", "Request Methods", "Pagination Methods"]
|
||||
end
|
||||
end
|
||||
|
||||
YARD::Registry.all(:method).each do |obj|
|
||||
if obj.file =~ /service\/.+?\/api\.go$/ && obj.scope == :instance
|
||||
if obj.name.to_s =~ /Pages$/
|
||||
obj.group = "Pagination Methods"
|
||||
opname = obj.name.to_s.sub(/Pages$/, '')
|
||||
obj.docstring = <<-eof
|
||||
#{obj.name} iterates over the pages of a {#{opname} #{opname}()} operation, calling the `fn`
|
||||
function callback with the response data in each page. To stop iterating, return `false` from
|
||||
the function callback.
|
||||
|
||||
@note This operation can generate multiple requests to a service.
|
||||
@example Iterating over at most 3 pages of a #{opname} operation
|
||||
pageNum := 0
|
||||
err := client.#{obj.name}(params, func(page *#{obj.parent.parent.name}.#{obj.parameters[1][0].split("*").last}, lastPage bool) bool {
|
||||
pageNum++
|
||||
fmt.Println(page)
|
||||
return pageNum <= 3
|
||||
})
|
||||
@see #{opname}
|
||||
eof
|
||||
obj.add_tag YARD::Tags::Tag.new(:paginator, '')
|
||||
elsif obj.name.to_s =~ /Request$/
|
||||
obj.group = "Request Methods"
|
||||
obj.signature = obj.name.to_s
|
||||
obj.parameters = []
|
||||
opname = obj.name.to_s.sub(/Request$/, '')
|
||||
obj.docstring = <<-eof
|
||||
#{obj.name} generates a {aws/request.Request} object representing the client request for
|
||||
the {#{opname} #{opname}()} operation. The `output` return value can be used to capture
|
||||
response data after {aws/request.Request.Send Request.Send()} is called.
|
||||
|
||||
Creating a request object using this method should be used when you want to inject
|
||||
custom logic into the request lifecycle using a custom handler, or if you want to
|
||||
access properties on the request object before or after sending the request. If
|
||||
you just want the service response, call the {#{opname} service operation method}
|
||||
directly instead.
|
||||
|
||||
@note You must call the {aws/request.Request.Send Send()} method on the returned
|
||||
request object in order to execute the request.
|
||||
@example Sending a request using the #{obj.name}() method
|
||||
req, resp := client.#{obj.name}(params)
|
||||
err := req.Send()
|
||||
|
||||
if err == nil { // resp is now filled
|
||||
fmt.Println(resp)
|
||||
}
|
||||
eof
|
||||
obj.add_tag YARD::Tags::Tag.new(:request_method, '')
|
||||
else
|
||||
obj.group = "Service Operations"
|
||||
obj.add_tag YARD::Tags::Tag.new(:service_operation, '')
|
||||
if ex = obj.tag(:example)
|
||||
ex.name = "Calling the #{obj.name} operation"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
apply_docs
|
||||
end
|
||||
|
||||
def apply_docs
|
||||
svc_pkg = YARD::Registry.at('service')
|
||||
return if svc_pkg.nil?
|
||||
|
||||
pkgs = svc_pkg.children.select {|t| t.type == :package }
|
||||
pkgs.each do |pkg|
|
||||
svc = pkg.children.find {|t| t.has_tag?(:service) }
|
||||
ctor = P(svc, ".New")
|
||||
svc_name = ctor.source[/ServiceName:\s*"(.+?)",/, 1]
|
||||
api_ver = ctor.source[/APIVersion:\s*"(.+?)",/, 1]
|
||||
log.progress "Parsing service documentation for #{svc_name} (#{api_ver})"
|
||||
file = Dir.glob("models/apis/#{svc_name}/#{api_ver}/docs-2.json").sort.last
|
||||
next if file.nil?
|
||||
|
||||
next if svc.nil?
|
||||
exmeth = svc.children.find {|s| s.has_tag?(:service_operation) }
|
||||
pkg.docstring += <<-eof
|
||||
|
||||
@example Sending a request using the {#{svc.name}} client
|
||||
client := #{pkg.name}.New(nil)
|
||||
params := &#{pkg.name}.#{exmeth.parameters.first[0].split("*").last}{...}
|
||||
resp, err := client.#{exmeth.name}(params)
|
||||
@see #{svc.name}
|
||||
@version #{api_ver}
|
||||
eof
|
||||
|
||||
ctor.docstring += <<-eof
|
||||
|
||||
@example Constructing a client using default configuration
|
||||
client := #{pkg.name}.New(nil)
|
||||
|
||||
@example Constructing a client with custom configuration
|
||||
config := aws.NewConfig().WithRegion("us-west-2")
|
||||
client := #{pkg.name}.New(config)
|
||||
eof
|
||||
|
||||
json = JSON.parse(File.read(file))
|
||||
if svc
|
||||
apply_doc(svc, json["service"])
|
||||
end
|
||||
|
||||
json["operations"].each do |op, doc|
|
||||
if doc && obj = svc.children.find {|t| t.name.to_s.downcase == op.downcase }
|
||||
apply_doc(obj, doc)
|
||||
end
|
||||
end
|
||||
|
||||
json["shapes"].each do |shape, data|
|
||||
shape = shape_name(shape)
|
||||
if obj = pkg.children.find {|t| t.name.to_s.downcase == shape.downcase }
|
||||
apply_doc(obj, data["base"])
|
||||
end
|
||||
|
||||
data["refs"].each do |refname, doc|
|
||||
refshape, member = *refname.split("$")
|
||||
refshape = shape_name(refshape)
|
||||
if refobj = pkg.children.find {|t| t.name.to_s.downcase == refshape.downcase }
|
||||
if m = refobj.children.find {|t| t.name.to_s.downcase == member.downcase }
|
||||
apply_doc(m, doc || data["base"])
|
||||
end
|
||||
end
|
||||
end if data["refs"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def apply_doc(obj, doc)
|
||||
tags = obj.docstring.tags || []
|
||||
obj.docstring = clean_docstring(doc)
|
||||
tags.each {|t| obj.docstring.add_tag(t) }
|
||||
end
|
||||
|
||||
def shape_name(shape)
|
||||
shape.sub(/Request$/, "Input").sub(/Response$/, "Output")
|
||||
end
|
||||
|
||||
def clean_docstring(docs)
|
||||
return nil unless docs
|
||||
docs = docs.gsub(/<!--.*?-->/m, '')
|
||||
docs = docs.gsub(/<fullname>.+?<\/fullname?>/m, '')
|
||||
docs = docs.gsub(/<examples?>.+?<\/examples?>/m, '')
|
||||
docs = docs.gsub(/<note>\s*<\/note>/m, '')
|
||||
docs = docs.gsub(/<a>(.+?)<\/a>/, '\1')
|
||||
docs = docs.gsub(/<note>(.+?)<\/note>/m) do
|
||||
text = $1.gsub(/<\/?p>/, '')
|
||||
"<div class=\"note\"><strong>Note:</strong> #{text}</div>"
|
||||
end
|
||||
docs = docs.gsub(/\{(.+?)\}/, '`{\1}`')
|
||||
docs = docs.gsub(/\s+/, ' ').strip
|
||||
docs == '' ? nil : docs
|
||||
end
|
31
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/layout/html/footer.erb
generated
vendored
Normal file
31
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/layout/html/footer.erb
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<div id="footer">
|
||||
Generated on <%= Time.now.strftime("%c") %> by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
<%= YARD::VERSION %> (ruby-<%= RUBY_VERSION %>).
|
||||
</div>
|
||||
|
||||
<!-- BEGIN-SECTION -->
|
||||
<script type="text/javascript" src="https://media.amazonwebservices.com/amznUrchin.js"></script>
|
||||
<!-- SiteCatalyst code version: H.25.2. Copyright 1996-2012 Adobe, Inc. All Rights Reserved.
|
||||
More info available at http://www.omniture.com -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://media.amazonwebservices.com/js/sitecatalyst/s_code.min.js">
|
||||
</script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
s.prop66='AWS SDK for Go';
|
||||
s.eVar66='D=c66';
|
||||
s.prop65='API Reference';
|
||||
s.eVar65='D=c65';
|
||||
var s_code=s.t();if(s_code)document.write(s_code)
|
||||
//-->
|
||||
</script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<img src="http://amazonwebservices.d2.sc.omtrdc.net/b/ss/awsamazondev/1/H.25.2--NS/0" height="1" width="1" border="0" alt="">
|
||||
</noscript>
|
||||
<!--/DO NOT REMOVE/-->
|
||||
<!-- End SiteCatalyst code version: H.25.2. -->
|
||||
<!-- END-SECTION -->
|
4
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/module/html/client.erb
generated
vendored
Normal file
4
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/module/html/client.erb
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
<h2>Client Structure <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
||||
<ul class="summary">
|
||||
<%= yieldall :item => @client %>
|
||||
</ul>
|
28
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/module/html/item_summary.erb
generated
vendored
Normal file
28
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/module/html/item_summary.erb
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
<% if !@item.has_tag?(:paginator) %>
|
||||
<li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
|
||||
<span class="summary_signature"><%= signature(@item) %></span>
|
||||
<% if object != @item.namespace %>
|
||||
<span class="note title not_defined_here">
|
||||
<%= @item.namespace.type == :class ? 'inherited' : (@item.scope == :class ? 'extended' : 'included') %>
|
||||
from <%= linkify @item, object.relative_path(@item.namespace) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% if @item.type == :enum %><span class="note title writeonly">enum</span><% end %>
|
||||
<% if @item.type == :bare_struct || @item.type == :struct %><span class="note title readonly">struct</span><% end %>
|
||||
<% if @item.has_tag?(:service) %><span class="note title writeonly">client</span><% end %>
|
||||
<% if @item.has_tag?(:service_operation) %><span class="note title readonly">operation</span><% end %>
|
||||
<% if @item.type == :interface %><span class="note title interface">interface</span><% end %>
|
||||
<% if @item.has_tag?(:readonly) %><span class="note title readonly">readonly</span><% end %>
|
||||
<% if @item.has_tag?(:writeonly) %><span class="note title writeonly">writeonly</span><% end %>
|
||||
<% if @item.visibility != :public %><span class="note title <%= @item.visibility %>"><%= @item.visibility %></span><% end %>
|
||||
<% if @item.has_tag?(:abstract) %><span class="abstract note title">interface</span><% end %>
|
||||
<% if @item.has_tag?(:deprecated) %><span class="deprecated note title">deprecated</span><% end %>
|
||||
<% if @item.has_tag?(:api) && @item.tag(:api).text == 'private' %><span class="private note title">private</span><% end %>
|
||||
|
||||
<% if @item.has_tag?(:deprecated) %>
|
||||
<span class="summary_desc"><strong>Deprecated.</strong> <%= htmlify_line @item.tag(:deprecated).text %></span>
|
||||
<% else %>
|
||||
<span class="summary_desc"><%= htmlify_line docstring_summary(@item) %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
9
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/module/html/setup.rb
generated
vendored
Normal file
9
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/module/html/setup.rb
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
def init
|
||||
super
|
||||
sections.place(:client, [:item_summary]).before(:constant_summary)
|
||||
end
|
||||
|
||||
def client
|
||||
@client = object.children.find {|c| c.has_tag?(:service) }
|
||||
erb(:client) if @client
|
||||
end
|
8
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/package/html/setup.rb
generated
vendored
Normal file
8
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/package/html/setup.rb
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
def type_summary
|
||||
@items = object.children.
|
||||
select {|c| c.type == :bare_struct || c.type == :struct || c.type == :enum }.
|
||||
reject {|c| c.has_tag?(:service) }.
|
||||
sort_by {|c| c.name.to_s }
|
||||
@name = "Type"
|
||||
erb :list_summary
|
||||
end
|
4
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/struct/html/paginators.erb
generated
vendored
Normal file
4
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/struct/html/paginators.erb
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div id="paginators" class="inline-objects">
|
||||
<h2 class="paginators">Pagination Methods</h2>
|
||||
<p class="children"><%= @items.map {|pkg| link_object(pkg, pkg.name) }.join(" ") %></p>
|
||||
</div>
|
4
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/struct/html/request_methods.erb
generated
vendored
Normal file
4
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/struct/html/request_methods.erb
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div id="request_methods" class="inline-objects">
|
||||
<h2 class="request_methods">Request Methods</h2>
|
||||
<p class="children"><%= @items.map {|pkg| link_object(pkg, pkg.name) }.join(" ") %></p>
|
||||
</div>
|
20
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/struct/html/setup.rb
generated
vendored
Normal file
20
vendor/github.com/aws/aws-sdk-go/doc-src/plugin/templates/default/struct/html/setup.rb
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
def init
|
||||
super
|
||||
sections.place(:request_methods, :paginators).after(:method_summary)
|
||||
end
|
||||
|
||||
def groups(list, type = "Method")
|
||||
super(list.reject {|o| o.has_tag?(:paginator) || o.has_tag?(:request_method) }, type)
|
||||
end
|
||||
|
||||
def paginators
|
||||
@items = object.children.select {|o| o.has_tag?(:paginator) }
|
||||
return if @items.size == 0
|
||||
erb(:paginators)
|
||||
end
|
||||
|
||||
def request_methods
|
||||
@items = object.children.select {|o| o.has_tag?(:request_method) }
|
||||
return if @items.size == 0
|
||||
erb(:request_methods)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue