2017-01-24 15:09:23 +00:00
|
|
|
{% import (
|
|
|
|
"sort"
|
|
|
|
|
2017-01-26 07:28:34 +00:00
|
|
|
"github.com/knq/chromedp/cmd/chromedp-gen/internal"
|
2017-01-24 15:09:23 +00:00
|
|
|
) %}
|
|
|
|
|
|
|
|
// FileHeader is the file header template.
|
2017-01-26 07:28:34 +00:00
|
|
|
{% func FileHeader(pkgName string, d *internal.Domain) %}
|
2017-01-24 15:09:23 +00:00
|
|
|
{% if d != nil %}// Package {%s= d.PackageName() %} provides the Chrome Debugging Protocol
|
2017-02-12 04:59:33 +00:00
|
|
|
// commands, types, and events for the {%s= d.String() %} domain.
|
2017-01-24 15:09:23 +00:00
|
|
|
// {% if desc := d.Description; desc != "" %}
|
|
|
|
{%s= formatComment(desc, "", "") %}
|
|
|
|
//{% endif %}
|
|
|
|
// Generated by the chromedp-gen command.{% end %}
|
|
|
|
package {%s= pkgName %}
|
|
|
|
|
|
|
|
// AUTOGENERATED. DO NOT EDIT.
|
|
|
|
{% endfunc %}
|
|
|
|
|
|
|
|
// FileImportTemplate is a general import template.
|
|
|
|
{% func FileImportTemplate(m map[string]string) %}{% code
|
|
|
|
var keys []string
|
|
|
|
for k, _ := range m {
|
|
|
|
keys = append(keys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(keys)
|
|
|
|
%}
|
|
|
|
import ({% for _, k := range keys %}{% code
|
|
|
|
v := m[k]
|
|
|
|
%}
|
|
|
|
{% if k != v %}{%s= v %} {% end %}"{%s= k %}"{% endfor %}
|
|
|
|
)
|
|
|
|
{% endfunc %}
|
|
|
|
|
|
|
|
// FileVarTemplate is a template for a single variable declaration.
|
|
|
|
{% func FileVarTemplate(name, value, desc string) %}
|
2017-01-26 07:28:34 +00:00
|
|
|
{%s= formatComment(desc, "", name+" ") %}
|
2017-01-24 15:09:23 +00:00
|
|
|
var {%s= name %} = {%s= value %}
|
|
|
|
{% endfunc %}
|