├── .gitignore ├── README.md ├── handlebars.js ├── main.go ├── model.go ├── search.js ├── search.md └── vendor ├── github.com ├── BurntSushi │ └── toml │ │ ├── COPYING │ │ ├── cmd │ │ ├── toml-test-decoder │ │ │ └── main.go │ │ ├── toml-test-encoder │ │ │ └── main.go │ │ └── tomlv │ │ │ └── main.go │ │ ├── decode.go │ │ ├── decode_meta.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encoding_types.go │ │ ├── encoding_types_1.1.go │ │ ├── lex.go │ │ ├── parse.go │ │ ├── type_check.go │ │ └── type_fields.go ├── PuerkitoBio │ ├── purell │ │ ├── LICENSE │ │ └── purell.go │ └── urlesc │ │ ├── LICENSE │ │ └── urlesc.go ├── armon │ └── consul-api │ │ ├── LICENSE │ │ ├── acl.go │ │ ├── agent.go │ │ ├── api.go │ │ ├── catalog.go │ │ ├── event.go │ │ ├── health.go │ │ ├── kv.go │ │ ├── session.go │ │ └── status.go ├── bep │ └── inflect │ │ ├── LICENCE │ │ └── inflect.go ├── coreos │ └── go-etcd │ │ └── etcd │ │ ├── LICENSE │ │ ├── add_child.go │ │ ├── client.go │ │ ├── cluster.go │ │ ├── compare_and_delete.go │ │ ├── compare_and_swap.go │ │ ├── debug.go │ │ ├── delete.go │ │ ├── error.go │ │ ├── get.go │ │ ├── member.go │ │ ├── options.go │ │ ├── requests.go │ │ ├── response.generated.go │ │ ├── response.go │ │ ├── set_update_create.go │ │ ├── shuffle.go │ │ ├── version.go │ │ └── watch.go ├── cpuguy83 │ └── go-md2man │ │ ├── md2man │ │ ├── LICENSE.md │ │ ├── md2man.go │ │ └── roff.go │ │ └── vendor │ │ └── github.com │ │ ├── russross │ │ └── blackfriday │ │ │ ├── LICENSE.md │ │ │ ├── block.go │ │ │ ├── html.go │ │ │ ├── inline.go │ │ │ ├── latex.go │ │ │ ├── markdown.go │ │ │ └── smartypants.go │ │ └── shurcooL │ │ └── sanitized_anchor_name │ │ ├── LICENSE.md │ │ └── main.go ├── dchest │ └── cssmin │ │ ├── LICENSE │ │ └── cssmin.go ├── eknkc │ └── amber │ │ ├── amberc │ │ └── cli.go │ │ ├── compiler.go │ │ ├── doc.go │ │ ├── parser │ │ ├── nodes.go │ │ ├── parser.go │ │ └── scanner.go │ │ └── runtime.go ├── fsnotify │ └── fsnotify │ │ ├── LICENSE │ │ ├── fen.go │ │ ├── fsnotify.go │ │ ├── inotify.go │ │ ├── inotify_poller.go │ │ ├── kqueue.go │ │ ├── open_mode_bsd.go │ │ ├── open_mode_darwin.go │ │ └── windows.go ├── gorilla │ └── websocket │ │ ├── LICENSE │ │ ├── client.go │ │ ├── compression.go │ │ ├── conn.go │ │ ├── conn_read.go │ │ ├── conn_read_legacy.go │ │ ├── doc.go │ │ ├── examples │ │ ├── autobahn │ │ │ └── server.go │ │ ├── chat │ │ │ ├── client.go │ │ │ ├── hub.go │ │ │ └── main.go │ │ ├── command │ │ │ └── main.go │ │ ├── echo │ │ │ ├── client.go │ │ │ └── server.go │ │ └── filewatch │ │ │ └── main.go │ │ ├── json.go │ │ ├── server.go │ │ └── util.go ├── hashicorp │ └── hcl │ │ ├── LICENSE │ │ ├── decoder.go │ │ ├── hcl.go │ │ ├── hcl │ │ ├── ast │ │ │ ├── ast.go │ │ │ └── walk.go │ │ ├── fmtcmd │ │ │ └── fmtcmd.go │ │ ├── parser │ │ │ ├── error.go │ │ │ └── parser.go │ │ ├── printer │ │ │ ├── nodes.go │ │ │ └── printer.go │ │ ├── scanner │ │ │ └── scanner.go │ │ ├── strconv │ │ │ └── quote.go │ │ └── token │ │ │ ├── position.go │ │ │ └── token.go │ │ ├── json │ │ ├── parser │ │ │ ├── flatten.go │ │ │ └── parser.go │ │ ├── scanner │ │ │ └── scanner.go │ │ └── token │ │ │ ├── position.go │ │ │ └── token.go │ │ ├── lex.go │ │ ├── parse.go │ │ └── testhelper │ │ └── unix2dos.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── trap_others.go │ │ ├── trap_windows.go │ │ └── trap_windows_1.4.go ├── kardianos │ └── osext │ │ ├── LICENSE │ │ ├── osext.go │ │ ├── osext_plan9.go │ │ ├── osext_procfs.go │ │ ├── osext_sysctl.go │ │ └── osext_windows.go ├── kr │ └── fs │ │ ├── LICENSE │ │ ├── filesystem.go │ │ └── walk.go ├── kyokomi │ └── emoji │ │ ├── LICENSE │ │ ├── emoji.go │ │ ├── emoji_codemap.go │ │ └── example │ │ └── hello.go ├── magiconair │ └── properties │ │ ├── LICENSE │ │ ├── decode.go │ │ ├── doc.go │ │ ├── integrate.go │ │ ├── lex.go │ │ ├── load.go │ │ ├── parser.go │ │ ├── properties.go │ │ └── rangecheck.go ├── miekg │ └── mmark │ │ ├── COPYRIGHT │ │ ├── LICENSE │ │ ├── block.go │ │ ├── code.go │ │ ├── common_render.go │ │ ├── html.go │ │ ├── ial.go │ │ ├── inline.go │ │ ├── log.go │ │ ├── markdown.go │ │ ├── mmark │ │ ├── main.go │ │ └── titleblock.go │ │ ├── quote.go │ │ ├── rfc7328.go │ │ ├── smartypants.go │ │ ├── toml.go │ │ ├── xml2rfc.go │ │ ├── xml2rfcv2.go │ │ └── xml2rfcv3.go ├── mitchellh │ └── mapstructure │ │ ├── LICENSE │ │ ├── decode_hooks.go │ │ ├── error.go │ │ └── mapstructure.go ├── nicksnyder │ └── go-i18n │ │ └── i18n │ │ ├── bundle │ │ ├── LICENSE │ │ └── bundle.go │ │ ├── language │ │ ├── LICENSE │ │ ├── codegen │ │ │ ├── main.go │ │ │ └── xml.go │ │ ├── language.go │ │ ├── operands.go │ │ ├── plural.go │ │ ├── pluralspec.go │ │ └── pluralspec_gen.go │ │ └── translation │ │ ├── LICENSE │ │ ├── plural_translation.go │ │ ├── single_translation.go │ │ ├── template.go │ │ └── translation.go ├── pelletier │ ├── go-buffruneio │ │ └── buffruneio.go │ └── go-toml │ │ ├── LICENSE │ │ ├── cmd │ │ ├── test_program.go │ │ ├── tomljson │ │ │ └── main.go │ │ └── tomll │ │ │ └── main.go │ │ ├── doc.go │ │ ├── keysparsing.go │ │ ├── lexer.go │ │ ├── match.go │ │ ├── parser.go │ │ ├── position.go │ │ ├── query.go │ │ ├── querylexer.go │ │ ├── queryparser.go │ │ ├── token.go │ │ ├── toml.go │ │ └── tomltree_conversions.go ├── pkg │ ├── errors │ │ ├── LICENSE │ │ ├── errors.go │ │ └── stack.go │ └── sftp │ │ ├── LICENSE │ │ ├── attrs.go │ │ ├── attrs_stubs.go │ │ ├── attrs_unix.go │ │ ├── client.go │ │ ├── conn.go │ │ ├── debug.go │ │ ├── examples │ │ ├── buffered-read-benchmark │ │ │ └── main.go │ │ ├── buffered-write-benchmark │ │ │ └── main.go │ │ ├── sftp-server │ │ │ └── main.go │ │ ├── streaming-read-benchmark │ │ │ └── main.go │ │ └── streaming-write-benchmark │ │ │ └── main.go │ │ ├── packet.go │ │ ├── release.go │ │ ├── server.go │ │ ├── server_standalone │ │ └── main.go │ │ ├── server_statvfs_darwin.go │ │ ├── server_statvfs_impl.go │ │ ├── server_statvfs_linux.go │ │ ├── server_statvfs_stubs.go │ │ ├── server_stubs.go │ │ ├── server_unix.go │ │ └── sftp.go ├── russross │ └── blackfriday │ │ ├── LICENSE.txt │ │ ├── block.go │ │ ├── html.go │ │ ├── inline.go │ │ ├── latex.go │ │ ├── markdown.go │ │ └── smartypants.go ├── shurcooL │ └── sanitized_anchor_name │ │ ├── LICENSE │ │ └── main.go ├── spf13 │ ├── afero │ │ ├── LICENSE.txt │ │ ├── fs.go │ │ ├── httpFs.go │ │ ├── memfile.go │ │ ├── memmap.go │ │ ├── memradix.go │ │ └── os.go │ ├── cast │ │ ├── LICENSE │ │ ├── cast.go │ │ └── caste.go │ ├── cobra │ │ ├── LICENSE.txt │ │ ├── bash_completions.go │ │ ├── cobra.go │ │ ├── command.go │ │ └── md_docs.go │ ├── fsync │ │ ├── LICENSE │ │ └── fsync.go │ ├── hugo │ │ ├── LICENSE.md │ │ ├── bufferpool │ │ │ └── bufpool.go │ │ ├── commands │ │ │ ├── benchmark.go │ │ │ ├── check.go │ │ │ ├── convert.go │ │ │ ├── genautocomplete.go │ │ │ ├── gendoc.go │ │ │ ├── hugo.go │ │ │ ├── limit_darwin.go │ │ │ ├── limit_others.go │ │ │ ├── list.go │ │ │ ├── list_config.go │ │ │ ├── new.go │ │ │ ├── server.go │ │ │ ├── undraft.go │ │ │ └── version.go │ │ ├── create │ │ │ └── content.go │ │ ├── helpers │ │ │ ├── content.go │ │ │ ├── general.go │ │ │ ├── hugo.go │ │ │ ├── path.go │ │ │ ├── pygments.go │ │ │ └── url.go │ │ ├── hugofs │ │ │ └── fs.go │ │ ├── hugolib │ │ │ ├── author.go │ │ │ ├── handler_base.go │ │ │ ├── handler_file.go │ │ │ ├── handler_meta.go │ │ │ ├── handler_page.go │ │ │ ├── hugo.go │ │ │ ├── media.go │ │ │ ├── menu.go │ │ │ ├── node.go │ │ │ ├── page.go │ │ │ ├── pageGroup.go │ │ │ ├── pageSort.go │ │ │ ├── pagesPrevNext.go │ │ │ ├── pagination.go │ │ │ ├── permalinks.go │ │ │ ├── planner.go │ │ │ ├── scratch.go │ │ │ ├── shortcode.go │ │ │ ├── shortcodeparser.go │ │ │ ├── site.go │ │ │ ├── sitemap.go │ │ │ ├── summary.go │ │ │ └── taxonomy.go │ │ ├── livereload │ │ │ ├── connection.go │ │ │ ├── hub.go │ │ │ └── livereload.go │ │ ├── main.go │ │ ├── parser │ │ │ ├── frontmatter.go │ │ │ └── page.go │ │ ├── source │ │ │ ├── file.go │ │ │ ├── filesystem.go │ │ │ └── inmemory.go │ │ ├── target │ │ │ ├── file.go │ │ │ ├── htmlredirect.go │ │ │ ├── memory.go │ │ │ └── page.go │ │ ├── tpl │ │ │ ├── template.go │ │ │ ├── template_embedded.go │ │ │ ├── template_funcs.go │ │ │ └── template_resources.go │ │ ├── transform │ │ │ ├── absurl.go │ │ │ ├── absurlreplacer.go │ │ │ ├── chain.go │ │ │ └── livereloadinject.go │ │ ├── utils │ │ │ └── utils.go │ │ └── watcher │ │ │ └── batcher.go │ ├── jwalterweatherman │ │ ├── LICENSE │ │ └── thatswhyyoualwaysleaveanote.go │ ├── nitro │ │ ├── LICENSE.txt │ │ └── perf.go │ ├── pflag │ │ ├── LICENSE │ │ ├── bool.go │ │ ├── count.go │ │ ├── duration.go │ │ ├── flag.go │ │ ├── float32.go │ │ ├── float64.go │ │ ├── golangflag.go │ │ ├── int.go │ │ ├── int32.go │ │ ├── int64.go │ │ ├── int8.go │ │ ├── int_slice.go │ │ ├── ip.go │ │ ├── ipmask.go │ │ ├── ipnet.go │ │ ├── string.go │ │ ├── string_array.go │ │ ├── string_slice.go │ │ ├── uint.go │ │ ├── uint16.go │ │ ├── uint32.go │ │ ├── uint64.go │ │ └── uint8.go │ └── viper │ │ ├── LICENSE │ │ ├── util.go │ │ └── viper.go ├── ugorji │ └── go │ │ └── codec │ │ ├── 0doc.go │ │ ├── LICENSE │ │ ├── binc.go │ │ ├── cbor.go │ │ ├── codecgen │ │ ├── gen.go │ │ └── z.go │ │ ├── decode.go │ │ ├── decode_go.go │ │ ├── decode_go14.go │ │ ├── encode.go │ │ ├── fast-path.generated.go │ │ ├── fast-path.not.go │ │ ├── gen-helper.generated.go │ │ ├── gen.generated.go │ │ ├── gen.go │ │ ├── gen_15.go │ │ ├── gen_16.go │ │ ├── gen_17.go │ │ ├── helper.go │ │ ├── helper_internal.go │ │ ├── helper_not_unsafe.go │ │ ├── helper_unsafe.go │ │ ├── json.go │ │ ├── msgpack.go │ │ ├── noop.go │ │ ├── prebuild.go │ │ ├── rpc.go │ │ ├── simple.go │ │ └── time.go ├── xordataexchange │ └── crypt │ │ ├── backend │ │ ├── LICENSE │ │ ├── backend.go │ │ ├── consul │ │ │ └── consul.go │ │ ├── etcd │ │ │ └── etcd.go │ │ └── mock │ │ │ └── mock.go │ │ ├── config │ │ ├── LICENSE │ │ └── config.go │ │ └── encoding │ │ └── secconf │ │ ├── LICENSE │ │ └── secconf.go └── yosssi │ ├── ace-proxy │ ├── LICENSE │ ├── doc.go │ └── proxy.go │ ├── ace │ ├── LICENSE │ ├── ace.go │ ├── action.go │ ├── cmd │ │ └── ace │ │ │ └── main.go │ ├── comment.go │ ├── compile.go │ ├── doc.go │ ├── element.go │ ├── element_base.go │ ├── empty_element.go │ ├── examples │ │ ├── actions │ │ │ └── main.go │ │ ├── base_inner_template │ │ │ └── main.go │ │ ├── cache_options │ │ │ └── main.go │ │ ├── change_action_delimiter │ │ │ └── main.go │ │ ├── comments │ │ │ └── main.go │ │ ├── css_javascript_helper_method │ │ │ └── main.go │ │ ├── dynamic_reload │ │ │ └── main.go │ │ ├── external_css_and_js │ │ │ └── main.go │ │ ├── html_tags │ │ │ └── main.go │ │ ├── include_helper_method │ │ │ └── main.go │ │ ├── load_templates_from_binary_data │ │ │ ├── asset.go │ │ │ └── main.go │ │ ├── pass_pipeline_to_included_template │ │ │ └── main.go │ │ ├── plain_texts │ │ │ └── main.go │ │ ├── set_custom_functions │ │ │ └── main.go │ │ ├── set_default_value_to_the_yield_helper_method │ │ │ └── main.go │ │ └── single_template │ │ │ └── main.go │ ├── file.go │ ├── formatter.go │ ├── helper_method_conditional_comment.go │ ├── helper_method_content.go │ ├── helper_method_css.go │ ├── helper_method_doctype.go │ ├── helper_method_include.go │ ├── helper_method_javascript.go │ ├── helper_method_yield.go │ ├── html_comment.go │ ├── html_tag.go │ ├── line.go │ ├── options.go │ ├── parse.go │ ├── plain_text.go │ ├── plain_text_inner.go │ ├── read.go │ ├── result.go │ └── source.go │ └── gohtml │ ├── LICENSE │ ├── consts.go │ ├── doc.go │ ├── element.go │ ├── formatter.go │ ├── html_document.go │ ├── parser.go │ ├── tag_element.go │ ├── text_element.go │ ├── utils.go │ └── writer.go ├── golang.org └── x │ ├── crypto │ ├── cast5 │ │ ├── LICENSE │ │ └── cast5.go │ ├── curve25519 │ │ ├── LICENSE │ │ ├── const_amd64.s │ │ ├── cswap_amd64.s │ │ ├── curve25519.go │ │ ├── doc.go │ │ ├── freeze_amd64.s │ │ ├── ladderstep_amd64.s │ │ ├── mont25519_amd64.go │ │ ├── mul_amd64.s │ │ └── square_amd64.s │ ├── ed25519 │ │ ├── LICENSE │ │ ├── ed25519.go │ │ └── internal │ │ │ └── edwards25519 │ │ │ ├── const.go │ │ │ └── edwards25519.go │ ├── openpgp │ │ ├── LICENSE │ │ ├── armor │ │ │ ├── armor.go │ │ │ └── encode.go │ │ ├── canonical_text.go │ │ ├── clearsign │ │ │ └── clearsign.go │ │ ├── elgamal │ │ │ └── elgamal.go │ │ ├── errors │ │ │ └── errors.go │ │ ├── keys.go │ │ ├── packet │ │ │ ├── compressed.go │ │ │ ├── config.go │ │ │ ├── encrypted_key.go │ │ │ ├── literal.go │ │ │ ├── ocfb.go │ │ │ ├── one_pass_signature.go │ │ │ ├── opaque.go │ │ │ ├── packet.go │ │ │ ├── private_key.go │ │ │ ├── public_key.go │ │ │ ├── public_key_v3.go │ │ │ ├── reader.go │ │ │ ├── signature.go │ │ │ ├── signature_v3.go │ │ │ ├── symmetric_key_encrypted.go │ │ │ ├── symmetrically_encrypted.go │ │ │ ├── userattribute.go │ │ │ └── userid.go │ │ ├── read.go │ │ ├── s2k │ │ │ └── s2k.go │ │ └── write.go │ └── ssh │ │ ├── LICENSE │ │ ├── agent │ │ ├── client.go │ │ ├── forward.go │ │ ├── keyring.go │ │ └── server.go │ │ ├── buffer.go │ │ ├── certs.go │ │ ├── channel.go │ │ ├── cipher.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── common.go │ │ ├── connection.go │ │ ├── doc.go │ │ ├── handshake.go │ │ ├── kex.go │ │ ├── keys.go │ │ ├── mac.go │ │ ├── messages.go │ │ ├── mux.go │ │ ├── server.go │ │ ├── session.go │ │ ├── tcpip.go │ │ ├── terminal │ │ ├── terminal.go │ │ ├── util.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ └── util_windows.go │ │ ├── test │ │ └── doc.go │ │ └── transport.go │ ├── net │ ├── html │ │ ├── LICENSE │ │ ├── atom │ │ │ ├── atom.go │ │ │ ├── gen.go │ │ │ └── table.go │ │ ├── charset │ │ │ └── charset.go │ │ ├── const.go │ │ ├── doc.go │ │ ├── doctype.go │ │ ├── entity.go │ │ ├── escape.go │ │ ├── foreign.go │ │ ├── node.go │ │ ├── parse.go │ │ ├── render.go │ │ └── token.go │ └── idna │ │ ├── LICENSE │ │ ├── idna.go │ │ └── punycode.go │ ├── sys │ └── unix │ │ ├── LICENSE │ │ ├── asm.s │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── constants.go │ │ ├── env_unix.go │ │ ├── env_unset.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── mkpost.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_no_getwd.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_linux.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ └── ztypes_solaris_amd64.go │ └── text │ ├── cases │ ├── LICENSE │ ├── cases.go │ ├── context.go │ ├── fold.go │ ├── gen.go │ ├── gen_trieval.go │ ├── icu.go │ ├── info.go │ ├── map.go │ ├── tables.go │ └── trieval.go │ ├── encoding │ ├── LICENSE │ ├── charmap │ │ ├── charmap.go │ │ ├── maketables.go │ │ └── tables.go │ ├── encoding.go │ ├── htmlindex │ │ ├── gen.go │ │ ├── htmlindex.go │ │ ├── map.go │ │ └── tables.go │ ├── ianaindex │ │ └── ianaindex.go │ ├── internal │ │ ├── identifier │ │ │ ├── gen.go │ │ │ ├── identifier.go │ │ │ └── mib.go │ │ └── internal.go │ ├── japanese │ │ ├── all.go │ │ ├── eucjp.go │ │ ├── iso2022jp.go │ │ ├── maketables.go │ │ ├── shiftjis.go │ │ └── tables.go │ ├── korean │ │ ├── euckr.go │ │ ├── maketables.go │ │ └── tables.go │ ├── simplifiedchinese │ │ ├── all.go │ │ ├── gbk.go │ │ ├── hzgb2312.go │ │ ├── maketables.go │ │ └── tables.go │ ├── traditionalchinese │ │ ├── big5.go │ │ ├── maketables.go │ │ └── tables.go │ └── unicode │ │ ├── override.go │ │ ├── unicode.go │ │ └── utf32 │ │ └── utf32.go │ ├── internal │ ├── gen │ │ ├── LICENSE │ │ ├── code.go │ │ └── gen.go │ ├── tag │ │ ├── LICENSE │ │ └── tag.go │ ├── triegen │ │ ├── LICENSE │ │ ├── compact.go │ │ ├── print.go │ │ └── triegen.go │ ├── ucd │ │ ├── LICENSE │ │ └── ucd.go │ └── utf8internal │ │ ├── LICENSE │ │ └── utf8internal.go │ ├── language │ ├── LICENSE │ ├── common.go │ ├── coverage.go │ ├── display │ │ ├── dict.go │ │ ├── display.go │ │ ├── lookup.go │ │ ├── maketables.go │ │ └── tables.go │ ├── gen_common.go │ ├── gen_index.go │ ├── go1_1.go │ ├── go1_2.go │ ├── index.go │ ├── language.go │ ├── lookup.go │ ├── maketables.go │ ├── match.go │ ├── parse.go │ ├── tables.go │ └── tags.go │ ├── runes │ ├── LICENSE │ ├── cond.go │ └── runes.go │ ├── secure │ ├── bidirule │ │ ├── LICENSE │ │ └── bidirule.go │ └── precis │ │ ├── LICENSE │ │ ├── class.go │ │ ├── context.go │ │ ├── doc.go │ │ ├── gen.go │ │ ├── gen_trieval.go │ │ ├── nickname.go │ │ ├── options.go │ │ ├── profile.go │ │ ├── profiles.go │ │ ├── tables.go │ │ ├── transformer.go │ │ └── trieval.go │ ├── transform │ ├── LICENSE │ └── transform.go │ ├── unicode │ ├── bidi │ │ ├── LICENSE │ │ ├── bidi.go │ │ ├── bracket.go │ │ ├── core.go │ │ ├── gen.go │ │ ├── gen_ranges.go │ │ ├── gen_trieval.go │ │ ├── prop.go │ │ ├── tables.go │ │ └── trieval.go │ ├── cldr │ │ ├── LICENSE │ │ ├── base.go │ │ ├── cldr.go │ │ ├── collate.go │ │ ├── decode.go │ │ ├── makexml.go │ │ ├── resolve.go │ │ ├── slice.go │ │ └── xml.go │ ├── norm │ │ ├── LICENSE │ │ ├── composition.go │ │ ├── forminfo.go │ │ ├── input.go │ │ ├── iter.go │ │ ├── maketables.go │ │ ├── normalize.go │ │ ├── readwriter.go │ │ ├── tables.go │ │ ├── transform.go │ │ ├── trie.go │ │ └── triegen.go │ └── rangetable │ │ ├── LICENSE │ │ ├── gen.go │ │ ├── merge.go │ │ ├── rangetable.go │ │ └── tables.go │ └── width │ ├── LICENSE │ ├── gen.go │ ├── gen_common.go │ ├── gen_trieval.go │ ├── kind_string.go │ ├── tables.go │ ├── transform.go │ ├── trieval.go │ └── width.go ├── gopkg.in └── yaml.v2 │ ├── LICENSE │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── manifest /.gitignore: -------------------------------------------------------------------------------- 1 | #* 2 | *.sublime-* 3 | *~ 4 | .#* 5 | .project 6 | .settings 7 | .DS_Store 8 | /hugoidx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This project has been retired 2 | 3 | This project has been retired due to upstream API changes in Hugo. 4 | 5 | ## hugoidx 6 | 7 | 8 | 9 | An experimental application to build a [Bleve](http://www.blevesearch.com) index from the pages in your [Hugo](http://gohugo.io) site. 10 | -------------------------------------------------------------------------------- /model.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "strings" 5 | "time" 6 | 7 | "github.com/spf13/hugo/hugolib" 8 | ) 9 | 10 | type Page struct { 11 | Title string `json:"title"` 12 | Type string `json:"type"` 13 | Section string `json:"section"` 14 | Content string `json:"content"` 15 | WordCount float64 `json:"word_count"` 16 | ReadingTime float64 `json:"reading_time"` 17 | Keywords []string `json:"keywords"` 18 | Date time.Time `json:"date"` 19 | LastModified time.Time `json:"last_modified"` 20 | Author string `json:"author"` 21 | } 22 | 23 | func NewPageForIndex(page *hugolib.Page) *Page { 24 | var author string 25 | switch str := page.Params["author"].(type) { 26 | case string: 27 | author = str 28 | case []string: 29 | author = strings.Join(str, ", ") 30 | } 31 | return &Page{ 32 | Title: page.Title, 33 | Type: page.Type(), 34 | Section: page.Section(), 35 | Content: page.Plain(), 36 | WordCount: float64(page.WordCount), 37 | ReadingTime: float64(page.ReadingTime), 38 | Keywords: page.Keywords, 39 | Date: page.Date, 40 | LastModified: page.Lastmod, 41 | Author: author, 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go: -------------------------------------------------------------------------------- 1 | // Command tomlv validates TOML documents and prints each key's type. 2 | package main 3 | 4 | import ( 5 | "flag" 6 | "fmt" 7 | "log" 8 | "os" 9 | "path" 10 | "strings" 11 | "text/tabwriter" 12 | 13 | "github.com/BurntSushi/toml" 14 | ) 15 | 16 | var ( 17 | flagTypes = false 18 | ) 19 | 20 | func init() { 21 | log.SetFlags(0) 22 | 23 | flag.BoolVar(&flagTypes, "types", flagTypes, 24 | "When set, the types of every defined key will be shown.") 25 | 26 | flag.Usage = usage 27 | flag.Parse() 28 | } 29 | 30 | func usage() { 31 | log.Printf("Usage: %s toml-file [ toml-file ... ]\n", 32 | path.Base(os.Args[0])) 33 | flag.PrintDefaults() 34 | 35 | os.Exit(1) 36 | } 37 | 38 | func main() { 39 | if flag.NArg() < 1 { 40 | flag.Usage() 41 | } 42 | for _, f := range flag.Args() { 43 | var tmp interface{} 44 | md, err := toml.DecodeFile(f, &tmp) 45 | if err != nil { 46 | log.Fatalf("Error in '%s': %s", f, err) 47 | } 48 | if flagTypes { 49 | printTypes(md) 50 | } 51 | } 52 | } 53 | 54 | func printTypes(md toml.MetaData) { 55 | tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) 56 | for _, key := range md.Keys() { 57 | fmt.Fprintf(tabw, "%s%s\t%s\n", 58 | strings.Repeat(" ", len(key)-1), key, md.Type(key...)) 59 | } 60 | tabw.Flush() 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package toml provides facilities for decoding and encoding TOML configuration 3 | files via reflection. There is also support for delaying decoding with 4 | the Primitive type, and querying the set of keys in a TOML document with the 5 | MetaData type. 6 | 7 | The specification implemented: https://github.com/mojombo/toml 8 | 9 | The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify 10 | whether a file is a valid TOML document. It can also be used to print the 11 | type of each key in a TOML document. 12 | 13 | Testing 14 | 15 | There are two important types of tests used for this package. The first is 16 | contained inside '*_test.go' files and uses the standard Go unit testing 17 | framework. These tests are primarily devoted to holistically testing the 18 | decoder and encoder. 19 | 20 | The second type of testing is used to verify the implementation's adherence 21 | to the TOML specification. These tests have been factored into their own 22 | project: https://github.com/BurntSushi/toml-test 23 | 24 | The reason the tests are in a separate project is so that they can be used by 25 | any implementation of TOML. Namely, it is language agnostic. 26 | */ 27 | package toml 28 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/PuerkitoBio/purell/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Martin Angers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | -------------------------------------------------------------------------------- /vendor/github.com/armon/consul-api/status.go: -------------------------------------------------------------------------------- 1 | package consulapi 2 | 3 | // Status can be used to query the Status endpoints 4 | type Status struct { 5 | c *Client 6 | } 7 | 8 | // Status returns a handle to the status endpoints 9 | func (c *Client) Status() *Status { 10 | return &Status{c} 11 | } 12 | 13 | // Leader is used to query for a known leader 14 | func (s *Status) Leader() (string, error) { 15 | r := s.c.newRequest("GET", "/v1/status/leader") 16 | _, resp, err := requireOK(s.c.doRequest(r)) 17 | if err != nil { 18 | return "", err 19 | } 20 | defer resp.Body.Close() 21 | 22 | var leader string 23 | if err := decodeBody(resp, &leader); err != nil { 24 | return "", err 25 | } 26 | return leader, nil 27 | } 28 | 29 | // Peers is used to query for a known raft peers 30 | func (s *Status) Peers() ([]string, error) { 31 | r := s.c.newRequest("GET", "/v1/status/peers") 32 | _, resp, err := requireOK(s.c.doRequest(r)) 33 | if err != nil { 34 | return nil, err 35 | } 36 | defer resp.Body.Close() 37 | 38 | var peers []string 39 | if err := decodeBody(resp, &peers); err != nil { 40 | return nil, err 41 | } 42 | return peers, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/bep/inflect/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Chris Farmiloe 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/add_child.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | // Add a new directory with a random etcd-generated key under the given path. 4 | func (c *Client) AddChildDir(key string, ttl uint64) (*Response, error) { 5 | raw, err := c.post(key, "", ttl) 6 | 7 | if err != nil { 8 | return nil, err 9 | } 10 | 11 | return raw.Unmarshal() 12 | } 13 | 14 | // Add a new file with a random etcd-generated key under the given path. 15 | func (c *Client) AddChild(key string, value string, ttl uint64) (*Response, error) { 16 | raw, err := c.post(key, value, ttl) 17 | 18 | if err != nil { 19 | return nil, err 20 | } 21 | 22 | return raw.Unmarshal() 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/cluster.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import ( 4 | "math/rand" 5 | "strings" 6 | "sync" 7 | ) 8 | 9 | type Cluster struct { 10 | Leader string `json:"leader"` 11 | Machines []string `json:"machines"` 12 | picked int 13 | mu sync.RWMutex 14 | } 15 | 16 | func NewCluster(machines []string) *Cluster { 17 | // if an empty slice was sent in then just assume HTTP 4001 on localhost 18 | if len(machines) == 0 { 19 | machines = []string{"http://127.0.0.1:4001"} 20 | } 21 | 22 | machines = shuffleStringSlice(machines) 23 | logger.Debug("Shuffle cluster machines", machines) 24 | // default leader and machines 25 | return &Cluster{ 26 | Leader: "", 27 | Machines: machines, 28 | picked: rand.Intn(len(machines)), 29 | } 30 | } 31 | 32 | func (cl *Cluster) failure() { 33 | cl.mu.Lock() 34 | defer cl.mu.Unlock() 35 | cl.picked = (cl.picked + 1) % len(cl.Machines) 36 | } 37 | 38 | func (cl *Cluster) pick() string { 39 | cl.mu.Lock() 40 | defer cl.mu.Unlock() 41 | return cl.Machines[cl.picked] 42 | } 43 | 44 | func (cl *Cluster) updateFromStr(machines string) { 45 | cl.mu.Lock() 46 | defer cl.mu.Unlock() 47 | 48 | cl.Machines = strings.Split(machines, ",") 49 | for i := range cl.Machines { 50 | cl.Machines[i] = strings.TrimSpace(cl.Machines[i]) 51 | } 52 | cl.Machines = shuffleStringSlice(cl.Machines) 53 | cl.picked = rand.Intn(len(cl.Machines)) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/compare_and_delete.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import "fmt" 4 | 5 | func (c *Client) CompareAndDelete(key string, prevValue string, prevIndex uint64) (*Response, error) { 6 | raw, err := c.RawCompareAndDelete(key, prevValue, prevIndex) 7 | if err != nil { 8 | return nil, err 9 | } 10 | 11 | return raw.Unmarshal() 12 | } 13 | 14 | func (c *Client) RawCompareAndDelete(key string, prevValue string, prevIndex uint64) (*RawResponse, error) { 15 | if prevValue == "" && prevIndex == 0 { 16 | return nil, fmt.Errorf("You must give either prevValue or prevIndex.") 17 | } 18 | 19 | options := Options{} 20 | if prevValue != "" { 21 | options["prevValue"] = prevValue 22 | } 23 | if prevIndex != 0 { 24 | options["prevIndex"] = prevIndex 25 | } 26 | 27 | raw, err := c.delete(key, options) 28 | 29 | if err != nil { 30 | return nil, err 31 | } 32 | 33 | return raw, err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/compare_and_swap.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import "fmt" 4 | 5 | func (c *Client) CompareAndSwap(key string, value string, ttl uint64, 6 | prevValue string, prevIndex uint64) (*Response, error) { 7 | raw, err := c.RawCompareAndSwap(key, value, ttl, prevValue, prevIndex) 8 | if err != nil { 9 | return nil, err 10 | } 11 | 12 | return raw.Unmarshal() 13 | } 14 | 15 | func (c *Client) RawCompareAndSwap(key string, value string, ttl uint64, 16 | prevValue string, prevIndex uint64) (*RawResponse, error) { 17 | if prevValue == "" && prevIndex == 0 { 18 | return nil, fmt.Errorf("You must give either prevValue or prevIndex.") 19 | } 20 | 21 | options := Options{} 22 | if prevValue != "" { 23 | options["prevValue"] = prevValue 24 | } 25 | if prevIndex != 0 { 26 | options["prevIndex"] = prevIndex 27 | } 28 | 29 | raw, err := c.put(key, value, ttl, options) 30 | 31 | if err != nil { 32 | return nil, err 33 | } 34 | 35 | return raw, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/debug.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "log" 7 | "strings" 8 | ) 9 | 10 | var logger *etcdLogger 11 | 12 | func SetLogger(l *log.Logger) { 13 | logger = &etcdLogger{l} 14 | } 15 | 16 | func GetLogger() *log.Logger { 17 | return logger.log 18 | } 19 | 20 | type etcdLogger struct { 21 | log *log.Logger 22 | } 23 | 24 | func (p *etcdLogger) Debug(args ...interface{}) { 25 | msg := "DEBUG: " + fmt.Sprint(args...) 26 | p.log.Println(msg) 27 | } 28 | 29 | func (p *etcdLogger) Debugf(f string, args ...interface{}) { 30 | msg := "DEBUG: " + fmt.Sprintf(f, args...) 31 | // Append newline if necessary 32 | if !strings.HasSuffix(msg, "\n") { 33 | msg = msg + "\n" 34 | } 35 | p.log.Print(msg) 36 | } 37 | 38 | func (p *etcdLogger) Warning(args ...interface{}) { 39 | msg := "WARNING: " + fmt.Sprint(args...) 40 | p.log.Println(msg) 41 | } 42 | 43 | func (p *etcdLogger) Warningf(f string, args ...interface{}) { 44 | msg := "WARNING: " + fmt.Sprintf(f, args...) 45 | // Append newline if necessary 46 | if !strings.HasSuffix(msg, "\n") { 47 | msg = msg + "\n" 48 | } 49 | p.log.Print(msg) 50 | } 51 | 52 | func init() { 53 | // Default logger uses the go default log. 54 | SetLogger(log.New(ioutil.Discard, "go-etcd", log.LstdFlags)) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/delete.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | // Delete deletes the given key. 4 | // 5 | // When recursive set to false, if the key points to a 6 | // directory the method will fail. 7 | // 8 | // When recursive set to true, if the key points to a file, 9 | // the file will be deleted; if the key points to a directory, 10 | // then everything under the directory (including all child directories) 11 | // will be deleted. 12 | func (c *Client) Delete(key string, recursive bool) (*Response, error) { 13 | raw, err := c.RawDelete(key, recursive, false) 14 | 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return raw.Unmarshal() 20 | } 21 | 22 | // DeleteDir deletes an empty directory or a key value pair 23 | func (c *Client) DeleteDir(key string) (*Response, error) { 24 | raw, err := c.RawDelete(key, false, true) 25 | 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | return raw.Unmarshal() 31 | } 32 | 33 | func (c *Client) RawDelete(key string, recursive bool, dir bool) (*RawResponse, error) { 34 | ops := Options{ 35 | "recursive": recursive, 36 | "dir": dir, 37 | } 38 | 39 | return c.delete(key, ops) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/error.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | const ( 9 | ErrCodeEtcdNotReachable = 501 10 | ErrCodeUnhandledHTTPStatus = 502 11 | ) 12 | 13 | var ( 14 | errorMap = map[int]string{ 15 | ErrCodeEtcdNotReachable: "All the given peers are not reachable", 16 | } 17 | ) 18 | 19 | type EtcdError struct { 20 | ErrorCode int `json:"errorCode"` 21 | Message string `json:"message"` 22 | Cause string `json:"cause,omitempty"` 23 | Index uint64 `json:"index"` 24 | } 25 | 26 | func (e EtcdError) Error() string { 27 | return fmt.Sprintf("%v: %v (%v) [%v]", e.ErrorCode, e.Message, e.Cause, e.Index) 28 | } 29 | 30 | func newError(errorCode int, cause string, index uint64) *EtcdError { 31 | return &EtcdError{ 32 | ErrorCode: errorCode, 33 | Message: errorMap[errorCode], 34 | Cause: cause, 35 | Index: index, 36 | } 37 | } 38 | 39 | func handleError(b []byte) error { 40 | etcdErr := new(EtcdError) 41 | 42 | err := json.Unmarshal(b, etcdErr) 43 | if err != nil { 44 | logger.Warningf("cannot unmarshal etcd error: %v", err) 45 | return err 46 | } 47 | 48 | return etcdErr 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/get.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | // Get gets the file or directory associated with the given key. 4 | // If the key points to a directory, files and directories under 5 | // it will be returned in sorted or unsorted order, depending on 6 | // the sort flag. 7 | // If recursive is set to false, contents under child directories 8 | // will not be returned. 9 | // If recursive is set to true, all the contents will be returned. 10 | func (c *Client) Get(key string, sort, recursive bool) (*Response, error) { 11 | raw, err := c.RawGet(key, sort, recursive) 12 | 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | return raw.Unmarshal() 18 | } 19 | 20 | func (c *Client) RawGet(key string, sort, recursive bool) (*RawResponse, error) { 21 | var q bool 22 | if c.config.Consistency == STRONG_CONSISTENCY { 23 | q = true 24 | } 25 | ops := Options{ 26 | "recursive": recursive, 27 | "sorted": sort, 28 | "quorum": q, 29 | } 30 | 31 | return c.get(key, ops) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/member.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import "encoding/json" 4 | 5 | type Member struct { 6 | ID string `json:"id"` 7 | Name string `json:"name"` 8 | PeerURLs []string `json:"peerURLs"` 9 | ClientURLs []string `json:"clientURLs"` 10 | } 11 | 12 | type memberCollection []Member 13 | 14 | func (c *memberCollection) UnmarshalJSON(data []byte) error { 15 | d := struct { 16 | Members []Member 17 | }{} 18 | 19 | if err := json.Unmarshal(data, &d); err != nil { 20 | return err 21 | } 22 | 23 | if d.Members == nil { 24 | *c = make([]Member, 0) 25 | return nil 26 | } 27 | 28 | *c = d.Members 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/shuffle.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import ( 4 | "math/rand" 5 | ) 6 | 7 | func shuffleStringSlice(cards []string) []string { 8 | size := len(cards) 9 | //Do not need to copy if nothing changed 10 | if size <= 1 { 11 | return cards 12 | } 13 | shuffled := make([]string, size) 14 | index := rand.Perm(size) 15 | for i := range cards { 16 | shuffled[index[i]] = cards[i] 17 | } 18 | return shuffled 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-etcd/etcd/version.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | const ( 4 | version = "v2" 5 | packageVersion = "v2.0.0+git" 6 | ) 7 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/md2man/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Brian Goff 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "github.com/russross/blackfriday" 5 | ) 6 | 7 | func Render(doc []byte) []byte { 8 | renderer := RoffRenderer(0) 9 | extensions := 0 10 | extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS 11 | extensions |= blackfriday.EXTENSION_TABLES 12 | extensions |= blackfriday.EXTENSION_FENCED_CODE 13 | extensions |= blackfriday.EXTENSION_AUTOLINK 14 | extensions |= blackfriday.EXTENSION_SPACE_HEADERS 15 | extensions |= blackfriday.EXTENSION_FOOTNOTES 16 | extensions |= blackfriday.EXTENSION_TITLEBLOCK 17 | 18 | return blackfriday.Markdown(doc, renderer, extensions) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Brian Goff 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Brian Goff 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/vendor/github.com/shurcooL/sanitized_anchor_name/main.go: -------------------------------------------------------------------------------- 1 | // Package sanitized_anchor_name provides a func to create sanitized anchor names. 2 | // 3 | // Its logic can be reused by multiple packages to create interoperable anchor names 4 | // and links to those anchors. 5 | // 6 | // At this time, it does not try to ensure that generated anchor names 7 | // are unique, that responsibility falls on the caller. 8 | package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" 9 | 10 | import "unicode" 11 | 12 | // Create returns a sanitized anchor name for the given text. 13 | func Create(text string) string { 14 | var anchorName []rune 15 | var futureDash = false 16 | for _, r := range []rune(text) { 17 | switch { 18 | case unicode.IsLetter(r) || unicode.IsNumber(r): 19 | if futureDash && len(anchorName) > 0 { 20 | anchorName = append(anchorName, '-') 21 | } 22 | futureDash = false 23 | anchorName = append(anchorName, unicode.ToLower(r)) 24 | default: 25 | futureDash = true 26 | } 27 | } 28 | return string(anchorName) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/eknkc/amber/amberc/cli.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | amber "github.com/eknkc/amber" 7 | "os" 8 | ) 9 | 10 | var prettyPrint bool 11 | var lineNumbers bool 12 | 13 | func init() { 14 | flag.BoolVar(&prettyPrint, "prettyprint", true, "Use pretty indentation in output html.") 15 | flag.BoolVar(&prettyPrint, "pp", true, "Use pretty indentation in output html.") 16 | 17 | flag.BoolVar(&lineNumbers, "linenos", true, "Enable debugging information in output html.") 18 | flag.BoolVar(&lineNumbers, "ln", true, "Enable debugging information in output html.") 19 | 20 | flag.Parse() 21 | } 22 | 23 | func main() { 24 | input := flag.Arg(0) 25 | 26 | if len(input) == 0 { 27 | fmt.Fprintln(os.Stderr, "Please provide an input file. (amberc input.amber)") 28 | os.Exit(1) 29 | } 30 | 31 | cmp := amber.New() 32 | cmp.PrettyPrint = prettyPrint 33 | cmp.LineNumbers = lineNumbers 34 | 35 | err := cmp.ParseFile(input) 36 | 37 | if err != nil { 38 | fmt.Fprintln(os.Stderr, err) 39 | os.Exit(1) 40 | } 41 | 42 | err = cmp.CompileWriter(os.Stdout) 43 | 44 | if err != nil { 45 | fmt.Fprintln(os.Stderr, err) 46 | os.Exit(1) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/fen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build solaris 6 | 7 | package fsnotify 8 | 9 | import ( 10 | "errors" 11 | ) 12 | 13 | // Watcher watches a set of files, delivering events to a channel. 14 | type Watcher struct { 15 | Events chan Event 16 | Errors chan error 17 | } 18 | 19 | // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. 20 | func NewWatcher() (*Watcher, error) { 21 | return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") 22 | } 23 | 24 | // Close removes all watches and closes the events channel. 25 | func (w *Watcher) Close() error { 26 | return nil 27 | } 28 | 29 | // Add starts watching the named file or directory (non-recursively). 30 | func (w *Watcher) Add(name string) error { 31 | return nil 32 | } 33 | 34 | // Remove stops watching the the named file or directory (non-recursively). 35 | func (w *Watcher) Remove(name string) error { 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd dragonfly 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const openMode = unix.O_NONBLOCK | unix.O_RDONLY 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | // note: this constant is not defined on BSD 12 | const openMode = unix.O_EVTONLY 13 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | c.br.Discard(len(p)) 17 | return p, err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | if len(p) > 0 { 17 | // advance over the bytes just read 18 | io.ReadFull(c.br, p) 19 | } 20 | return p, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/examples/chat/hub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package main 6 | 7 | // hub maintains the set of active clients and broadcasts messages to the 8 | // clients. 9 | type Hub struct { 10 | // Registered clients. 11 | clients map[*Client]bool 12 | 13 | // Inbound messages from the clients. 14 | broadcast chan []byte 15 | 16 | // Register requests from the clients. 17 | register chan *Client 18 | 19 | // Unregister requests from clients. 20 | unregister chan *Client 21 | } 22 | 23 | func newHub() *Hub { 24 | return &Hub{ 25 | broadcast: make(chan []byte), 26 | register: make(chan *Client), 27 | unregister: make(chan *Client), 28 | clients: make(map[*Client]bool), 29 | } 30 | } 31 | 32 | func (h *Hub) run() { 33 | for { 34 | select { 35 | case client := <-h.register: 36 | h.clients[client] = true 37 | case client := <-h.unregister: 38 | if _, ok := h.clients[client]; ok { 39 | delete(h.clients, client) 40 | close(client.send) 41 | } 42 | case message := <-h.broadcast: 43 | for client := range h.clients { 44 | select { 45 | case client.send <- message: 46 | default: 47 | close(client.send) 48 | delete(h.clients, client) 49 | } 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/examples/chat/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package main 6 | 7 | import ( 8 | "flag" 9 | "log" 10 | "net/http" 11 | "text/template" 12 | ) 13 | 14 | var addr = flag.String("addr", ":8080", "http service address") 15 | var homeTemplate = template.Must(template.ParseFiles("home.html")) 16 | 17 | func serveHome(w http.ResponseWriter, r *http.Request) { 18 | log.Println(r.URL) 19 | if r.URL.Path != "/" { 20 | http.Error(w, "Not found", 404) 21 | return 22 | } 23 | if r.Method != "GET" { 24 | http.Error(w, "Method not allowed", 405) 25 | return 26 | } 27 | w.Header().Set("Content-Type", "text/html; charset=utf-8") 28 | homeTemplate.Execute(w, r.Host) 29 | } 30 | 31 | func main() { 32 | flag.Parse() 33 | hub := newHub() 34 | go hub.run() 35 | http.HandleFunc("/", serveHome) 36 | http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) { 37 | serveWs(hub, w, r) 38 | }) 39 | err := http.ListenAndServe(*addr, nil) 40 | if err != nil { 41 | log.Fatal("ListenAndServe: ", err) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl.go: -------------------------------------------------------------------------------- 1 | // Package hcl decodes HCL into usable Go structures. 2 | // 3 | // hcl input can come in either pure HCL format or JSON format. 4 | // It can be parsed into an AST, and then decoded into a structure, 5 | // or it can be decoded directly from a string into a structure. 6 | // 7 | // If you choose to parse HCL into a raw AST, the benefit is that you 8 | // can write custom visitor implementations to implement custom 9 | // semantic checks. By default, HCL does not perform any semantic 10 | // checks. 11 | package hcl 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/ast/walk.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import "fmt" 4 | 5 | // WalkFunc describes a function to be called for each node during a Walk. The 6 | // returned node can be used to rewrite the AST. Walking stops the returned 7 | // bool is false. 8 | type WalkFunc func(Node) (Node, bool) 9 | 10 | // Walk traverses an AST in depth-first order: It starts by calling fn(node); 11 | // node must not be nil. If fn returns true, Walk invokes fn recursively for 12 | // each of the non-nil children of node, followed by a call of fn(nil). The 13 | // returned node of fn can be used to rewrite the passed node to fn. 14 | func Walk(node Node, fn WalkFunc) Node { 15 | rewritten, ok := fn(node) 16 | if !ok { 17 | return rewritten 18 | } 19 | 20 | switch n := node.(type) { 21 | case *File: 22 | n.Node = Walk(n.Node, fn) 23 | case *ObjectList: 24 | for i, item := range n.Items { 25 | n.Items[i] = Walk(item, fn).(*ObjectItem) 26 | } 27 | case *ObjectKey: 28 | // nothing to do 29 | case *ObjectItem: 30 | for i, k := range n.Keys { 31 | n.Keys[i] = Walk(k, fn).(*ObjectKey) 32 | } 33 | 34 | if n.Val != nil { 35 | n.Val = Walk(n.Val, fn) 36 | } 37 | case *LiteralType: 38 | // nothing to do 39 | case *ListType: 40 | for i, l := range n.List { 41 | n.List[i] = Walk(l, fn) 42 | } 43 | case *ObjectType: 44 | n.List = Walk(n.List, fn).(*ObjectList) 45 | default: 46 | // should we panic here? 47 | fmt.Printf("unknown type: %T\n", n) 48 | } 49 | 50 | fn(nil) 51 | return rewritten 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/parser/error.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hcl/hcl/token" 7 | ) 8 | 9 | // PosError is a parse error that contains a position. 10 | type PosError struct { 11 | Pos token.Pos 12 | Err error 13 | } 14 | 15 | func (e *PosError) Error() string { 16 | return fmt.Sprintf("At %s: %s", e.Pos, e.Err) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/token/position.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import "fmt" 4 | 5 | // Pos describes an arbitrary source position 6 | // including the file, line, and column location. 7 | // A Position is valid if the line number is > 0. 8 | type Pos struct { 9 | Filename string // filename, if any 10 | Offset int // offset, starting at 0 11 | Line int // line number, starting at 1 12 | Column int // column number, starting at 1 (character count) 13 | } 14 | 15 | // IsValid returns true if the position is valid. 16 | func (p *Pos) IsValid() bool { return p.Line > 0 } 17 | 18 | // String returns a string in one of several forms: 19 | // 20 | // file:line:column valid position with file name 21 | // line:column valid position without file name 22 | // file invalid position with file name 23 | // - invalid position without file name 24 | func (p Pos) String() string { 25 | s := p.Filename 26 | if p.IsValid() { 27 | if s != "" { 28 | s += ":" 29 | } 30 | s += fmt.Sprintf("%d:%d", p.Line, p.Column) 31 | } 32 | if s == "" { 33 | s = "-" 34 | } 35 | return s 36 | } 37 | 38 | // Before reports whether the position p is before u. 39 | func (p Pos) Before(u Pos) bool { 40 | return u.Offset > p.Offset || u.Line > p.Line 41 | } 42 | 43 | // After reports whether the position p is after u. 44 | func (p Pos) After(u Pos) bool { 45 | return u.Offset < p.Offset || u.Line < p.Line 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/json/token/position.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import "fmt" 4 | 5 | // Pos describes an arbitrary source position 6 | // including the file, line, and column location. 7 | // A Position is valid if the line number is > 0. 8 | type Pos struct { 9 | Filename string // filename, if any 10 | Offset int // offset, starting at 0 11 | Line int // line number, starting at 1 12 | Column int // column number, starting at 1 (character count) 13 | } 14 | 15 | // IsValid returns true if the position is valid. 16 | func (p *Pos) IsValid() bool { return p.Line > 0 } 17 | 18 | // String returns a string in one of several forms: 19 | // 20 | // file:line:column valid position with file name 21 | // line:column valid position without file name 22 | // file invalid position with file name 23 | // - invalid position without file name 24 | func (p Pos) String() string { 25 | s := p.Filename 26 | if p.IsValid() { 27 | if s != "" { 28 | s += ":" 29 | } 30 | s += fmt.Sprintf("%d:%d", p.Line, p.Column) 31 | } 32 | if s == "" { 33 | s = "-" 34 | } 35 | return s 36 | } 37 | 38 | // Before reports whether the position p is before u. 39 | func (p Pos) Before(u Pos) bool { 40 | return u.Offset > p.Offset || u.Line > p.Line 41 | } 42 | 43 | // After reports whether the position p is after u. 44 | func (p Pos) After(u Pos) bool { 45 | return u.Offset < p.Offset || u.Line < p.Line 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/lex.go: -------------------------------------------------------------------------------- 1 | package hcl 2 | 3 | import ( 4 | "unicode" 5 | "unicode/utf8" 6 | ) 7 | 8 | type lexModeValue byte 9 | 10 | const ( 11 | lexModeUnknown lexModeValue = iota 12 | lexModeHcl 13 | lexModeJson 14 | ) 15 | 16 | // lexMode returns whether we're going to be parsing in JSON 17 | // mode or HCL mode. 18 | func lexMode(v []byte) lexModeValue { 19 | var ( 20 | r rune 21 | w int 22 | offset int 23 | ) 24 | 25 | for { 26 | r, w = utf8.DecodeRune(v[offset:]) 27 | offset += w 28 | if unicode.IsSpace(r) { 29 | continue 30 | } 31 | if r == '{' { 32 | return lexModeJson 33 | } 34 | break 35 | } 36 | 37 | return lexModeHcl 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/parse.go: -------------------------------------------------------------------------------- 1 | package hcl 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hcl/hcl/ast" 7 | hclParser "github.com/hashicorp/hcl/hcl/parser" 8 | jsonParser "github.com/hashicorp/hcl/json/parser" 9 | ) 10 | 11 | // ParseBytes accepts as input byte slice and returns ast tree. 12 | // 13 | // Input can be either JSON or HCL 14 | func ParseBytes(in []byte) (*ast.File, error) { 15 | return parse(in) 16 | } 17 | 18 | // ParseString accepts input as a string and returns ast tree. 19 | func ParseString(input string) (*ast.File, error) { 20 | return parse([]byte(input)) 21 | } 22 | 23 | func parse(in []byte) (*ast.File, error) { 24 | switch lexMode(in) { 25 | case lexModeHcl: 26 | return hclParser.Parse(in) 27 | case lexModeJson: 28 | return jsonParser.Parse(in) 29 | } 30 | 31 | return nil, fmt.Errorf("unknown config format") 32 | } 33 | 34 | // Parse parses the given input and returns the root object. 35 | // 36 | // The input format can be either HCL or JSON. 37 | func Parse(input string) (*ast.File, error) { 38 | return parse([]byte(input)) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/testhelper/unix2dos.go: -------------------------------------------------------------------------------- 1 | package testhelper 2 | 3 | import ( 4 | "runtime" 5 | "strings" 6 | ) 7 | 8 | // Converts the line endings when on Windows 9 | func Unix2dos(unix string) string { 10 | if runtime.GOOS != "windows" { 11 | return unix 12 | } 13 | 14 | return strings.Replace(unix, "\n", "\r\n", -1) 15 | } -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build go1.4 3 | 4 | package mousetrap 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { 13 | snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) 14 | if err != nil { 15 | return nil, err 16 | } 17 | defer syscall.CloseHandle(snapshot) 18 | var procEntry syscall.ProcessEntry32 19 | procEntry.Size = uint32(unsafe.Sizeof(procEntry)) 20 | if err = syscall.Process32First(snapshot, &procEntry); err != nil { 21 | return nil, err 22 | } 23 | for { 24 | if procEntry.ProcessID == uint32(pid) { 25 | return &procEntry, nil 26 | } 27 | err = syscall.Process32Next(snapshot, &procEntry) 28 | if err != nil { 29 | return nil, err 30 | } 31 | } 32 | } 33 | 34 | // StartedByExplorer returns true if the program was invoked by the user double-clicking 35 | // on the executable from explorer.exe 36 | // 37 | // It is conservative and returns false if any of the internal calls fail. 38 | // It does not guarantee that the program was run from a terminal. It only can tell you 39 | // whether it was launched from explorer.exe 40 | func StartedByExplorer() bool { 41 | pe, err := getProcessEntry(os.Getppid()) 42 | if err != nil { 43 | return false 44 | } 45 | return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Extensions to the standard "os" package. 6 | package osext // import "github.com/kardianos/osext" 7 | 8 | import "path/filepath" 9 | 10 | var cx, ce = executableClean() 11 | 12 | func executableClean() (string, error) { 13 | p, err := executable() 14 | return filepath.Clean(p), err 15 | } 16 | 17 | // Executable returns an absolute path that can be used to 18 | // re-invoke the current program. 19 | // It may not be valid after the current program exits. 20 | func Executable() (string, error) { 21 | return cx, ce 22 | } 23 | 24 | // Returns same path as Executable, returns just the folder 25 | // path. Excludes the executable name and any trailing slash. 26 | func ExecutableFolder() (string, error) { 27 | p, err := Executable() 28 | if err != nil { 29 | return "", err 30 | } 31 | 32 | return filepath.Dir(p), nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package osext 6 | 7 | import ( 8 | "os" 9 | "strconv" 10 | "syscall" 11 | ) 12 | 13 | func executable() (string, error) { 14 | f, err := os.Open("/proc/" + strconv.Itoa(os.Getpid()) + "/text") 15 | if err != nil { 16 | return "", err 17 | } 18 | defer f.Close() 19 | return syscall.Fd2path(int(f.Fd())) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_procfs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux netbsd solaris dragonfly 6 | 7 | package osext 8 | 9 | import ( 10 | "errors" 11 | "fmt" 12 | "os" 13 | "runtime" 14 | "strings" 15 | ) 16 | 17 | func executable() (string, error) { 18 | switch runtime.GOOS { 19 | case "linux": 20 | const deletedTag = " (deleted)" 21 | execpath, err := os.Readlink("/proc/self/exe") 22 | if err != nil { 23 | return execpath, err 24 | } 25 | execpath = strings.TrimSuffix(execpath, deletedTag) 26 | execpath = strings.TrimPrefix(execpath, deletedTag) 27 | return execpath, nil 28 | case "netbsd": 29 | return os.Readlink("/proc/curproc/exe") 30 | case "dragonfly": 31 | return os.Readlink("/proc/curproc/file") 32 | case "solaris": 33 | return os.Readlink(fmt.Sprintf("/proc/%d/path/a.out", os.Getpid())) 34 | } 35 | return "", errors.New("ExecPath not implemented for " + runtime.GOOS) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package osext 6 | 7 | import ( 8 | "syscall" 9 | "unicode/utf16" 10 | "unsafe" 11 | ) 12 | 13 | var ( 14 | kernel = syscall.MustLoadDLL("kernel32.dll") 15 | getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW") 16 | ) 17 | 18 | // GetModuleFileName() with hModule = NULL 19 | func executable() (exePath string, err error) { 20 | return getModuleFileName() 21 | } 22 | 23 | func getModuleFileName() (string, error) { 24 | var n uint32 25 | b := make([]uint16, syscall.MAX_PATH) 26 | size := uint32(len(b)) 27 | 28 | r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size)) 29 | n = uint32(r0) 30 | if n == 0 { 31 | return "", e1 32 | } 33 | return string(utf16.Decode(b[0:n])), nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/kr/fs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/kr/fs/filesystem.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "io/ioutil" 5 | "os" 6 | "path/filepath" 7 | ) 8 | 9 | // FileSystem defines the methods of an abstract filesystem. 10 | type FileSystem interface { 11 | 12 | // ReadDir reads the directory named by dirname and returns a 13 | // list of directory entries. 14 | ReadDir(dirname string) ([]os.FileInfo, error) 15 | 16 | // Lstat returns a FileInfo describing the named file. If the file is a 17 | // symbolic link, the returned FileInfo describes the symbolic link. Lstat 18 | // makes no attempt to follow the link. 19 | Lstat(name string) (os.FileInfo, error) 20 | 21 | // Join joins any number of path elements into a single path, adding a 22 | // separator if necessary. The result is Cleaned; in particular, all 23 | // empty strings are ignored. 24 | // 25 | // The separator is FileSystem specific. 26 | Join(elem ...string) string 27 | } 28 | 29 | // fs represents a FileSystem provided by the os package. 30 | type fs struct{} 31 | 32 | func (f *fs) ReadDir(dirname string) ([]os.FileInfo, error) { return ioutil.ReadDir(dirname) } 33 | 34 | func (f *fs) Lstat(name string) (os.FileInfo, error) { return os.Lstat(name) } 35 | 36 | func (f *fs) Join(elem ...string) string { return filepath.Join(elem...) } 37 | -------------------------------------------------------------------------------- /vendor/github.com/kyokomi/emoji/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 kyokomi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/kyokomi/emoji/example/hello.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/kyokomi/emoji" 7 | ) 8 | 9 | func main() { 10 | fmt.Println("Hello World Emoji!") 11 | 12 | emoji.Println(":beer: Beer!!!") 13 | 14 | pizzaMessage := emoji.Sprint("I like a :pizza: and :sushi:!!") 15 | fmt.Println(pizzaMessage) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/magiconair/properties/LICENSE: -------------------------------------------------------------------------------- 1 | goproperties - properties file decoder for Go 2 | 3 | Copyright (c) 2013-2014 - Frank Schroeder 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/github.com/magiconair/properties/integrate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Frank Schroeder. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package properties 6 | 7 | import "flag" 8 | 9 | // MustFlag sets flags that are skipped by dst.Parse when p contains 10 | // the respective key for flag.Flag.Name. 11 | // 12 | // It's use is recommended with command line arguments as in: 13 | // flag.Parse() 14 | // p.MustFlag(flag.CommandLine) 15 | func (p *Properties) MustFlag(dst *flag.FlagSet) { 16 | m := make(map[string]*flag.Flag) 17 | dst.VisitAll(func(f *flag.Flag) { 18 | m[f.Name] = f 19 | }) 20 | dst.Visit(func(f *flag.Flag) { 21 | delete(m, f.Name) // overridden 22 | }) 23 | 24 | for name, f := range m { 25 | v, ok := p.Get(name) 26 | if !ok { 27 | continue 28 | } 29 | 30 | if err := f.Value.Set(v); err != nil { 31 | ErrorHandler(err) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/magiconair/properties/rangecheck.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Frank Schroeder. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package properties 6 | 7 | import ( 8 | "fmt" 9 | "math" 10 | ) 11 | 12 | // make this a var to overwrite it in a test 13 | var is32Bit = ^uint(0) == math.MaxUint32 14 | 15 | // intRangeCheck checks if the value fits into the int type and 16 | // panics if it does not. 17 | func intRangeCheck(key string, v int64) int { 18 | if is32Bit && (v < math.MinInt32 || v > math.MaxInt32) { 19 | panic(fmt.Sprintf("Value %d for key %s out of range", v, key)) 20 | } 21 | return int(v) 22 | } 23 | 24 | // uintRangeCheck checks if the value fits into the uint type and 25 | // panics if it does not. 26 | func uintRangeCheck(key string, v uint64) uint { 27 | if is32Bit && v > math.MaxUint32 { 28 | panic(fmt.Sprintf("Value %d for key %s out of range", v, key)) 29 | } 30 | return uint(v) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/mmark/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Mmark Markdown Processor 2 | Available at http://github.com/miekg/mmark 3 | 4 | Copyright © 2014 Miek Gieben . 5 | Copyright © 2011 Russ Ross . 6 | Distributed under the Simplified BSD License. 7 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/mmark/LICENSE: -------------------------------------------------------------------------------- 1 | Mmark is distributed under the Simplified BSD License: 2 | 3 | > Copyright © 2014 Miek Gieben 4 | > Copyright © 2011 Russ Ross 5 | > All rights reserved. 6 | > 7 | > Redistribution and use in source and binary forms, with or without 8 | > modification, are permitted provided that the following conditions 9 | > are met: 10 | > 11 | > 1. Redistributions of source code must retain the above copyright 12 | > notice, this list of conditions and the following disclaimer. 13 | > 14 | > 2. Redistributions in binary form must reproduce the above 15 | > copyright notice, this list of conditions and the following 16 | > disclaimer in the documentation and/or other materials provided with 17 | > the distribution. 18 | > 19 | > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | > "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | > LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 22 | > FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 23 | > COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 24 | > INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 25 | > BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | > CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | > LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 29 | > ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | > POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/mmark/common_render.go: -------------------------------------------------------------------------------- 1 | // Common functions used in the render backends. 2 | 3 | package mmark 4 | 5 | import "bytes" 6 | 7 | // blockCodePrefix adds the prefix to each line of text and returns it as a byte slice. 8 | // If prefix is empty, text is returned as-is. 9 | func blockCodePrefix(prefix string, text []byte) []byte { 10 | if prefix == "" { 11 | return text 12 | } 13 | 14 | nl := bytes.Count(text, []byte{'\n'}) 15 | prefixText := bytes.Replace(text, []byte{'\n'}, []byte("\n"+prefix), nl-1) 16 | prefixText = append([]byte(prefix), prefixText...) 17 | return prefixText 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/mmark/log.go: -------------------------------------------------------------------------------- 1 | package mmark 2 | 3 | import "log" 4 | 5 | func printf(p *parser, format string, v ...interface{}) { 6 | if test { 7 | return 8 | } 9 | if p != nil { 10 | log.Printf("mmark: "+format, v...) 11 | return 12 | } 13 | log.Printf("mmark: "+format, v...) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/error.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | // Error implements the error interface and can represents multiple 11 | // errors that occur in the course of a single decode. 12 | type Error struct { 13 | Errors []string 14 | } 15 | 16 | func (e *Error) Error() string { 17 | points := make([]string, len(e.Errors)) 18 | for i, err := range e.Errors { 19 | points[i] = fmt.Sprintf("* %s", err) 20 | } 21 | 22 | sort.Strings(points) 23 | return fmt.Sprintf( 24 | "%d error(s) decoding:\n\n%s", 25 | len(e.Errors), strings.Join(points, "\n")) 26 | } 27 | 28 | // WrappedErrors implements the errwrap.Wrapper interface to make this 29 | // return value more useful with the errwrap and go-multierror libraries. 30 | func (e *Error) WrappedErrors() []error { 31 | if e == nil { 32 | return nil 33 | } 34 | 35 | result := make([]error, len(e.Errors)) 36 | for i, e := range e.Errors { 37 | result[i] = errors.New(e) 38 | } 39 | 40 | return result 41 | } 42 | 43 | func appendErrors(errors []string, err error) []string { 44 | switch e := err.(type) { 45 | case *Error: 46 | return append(errors, e.Errors...) 47 | default: 48 | return append(errors, e.Error()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/nicksnyder/go-i18n/i18n/bundle/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/nicksnyder/go-i18n/i18n/language/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/nicksnyder/go-i18n/i18n/language/plural.go: -------------------------------------------------------------------------------- 1 | package language 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Plural represents a language pluralization form as defined here: 8 | // http://cldr.unicode.org/index/cldr-spec/plural-rules 9 | type Plural string 10 | 11 | // All defined plural categories. 12 | const ( 13 | Invalid Plural = "invalid" 14 | Zero = "zero" 15 | One = "one" 16 | Two = "two" 17 | Few = "few" 18 | Many = "many" 19 | Other = "other" 20 | ) 21 | 22 | // NewPlural returns src as a Plural 23 | // or Invalid and a non-nil error if src is not a valid Plural. 24 | func NewPlural(src string) (Plural, error) { 25 | switch src { 26 | case "zero": 27 | return Zero, nil 28 | case "one": 29 | return One, nil 30 | case "two": 31 | return Two, nil 32 | case "few": 33 | return Few, nil 34 | case "many": 35 | return Many, nil 36 | case "other": 37 | return Other, nil 38 | } 39 | return Invalid, fmt.Errorf("invalid plural category %s", src) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/nicksnyder/go-i18n/i18n/translation/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go: -------------------------------------------------------------------------------- 1 | package translation 2 | 3 | import ( 4 | "github.com/nicksnyder/go-i18n/i18n/language" 5 | ) 6 | 7 | type singleTranslation struct { 8 | id string 9 | template *template 10 | } 11 | 12 | func (st *singleTranslation) MarshalInterface() interface{} { 13 | return map[string]interface{}{ 14 | "id": st.id, 15 | "translation": st.template, 16 | } 17 | } 18 | 19 | func (st *singleTranslation) ID() string { 20 | return st.id 21 | } 22 | 23 | func (st *singleTranslation) Template(pc language.Plural) *template { 24 | return st.template 25 | } 26 | 27 | func (st *singleTranslation) UntranslatedCopy() Translation { 28 | return &singleTranslation{st.id, mustNewTemplate("")} 29 | } 30 | 31 | func (st *singleTranslation) Normalize(language *language.Language) Translation { 32 | return st 33 | } 34 | 35 | func (st *singleTranslation) Backfill(src Translation) Translation { 36 | if st.template == nil || st.template.src == "" { 37 | st.template = src.Template(language.Other) 38 | } 39 | return st 40 | } 41 | 42 | func (st *singleTranslation) Merge(t Translation) Translation { 43 | other, ok := t.(*singleTranslation) 44 | if !ok || st.ID() != t.ID() { 45 | return t 46 | } 47 | if other.template != nil && other.template.src != "" { 48 | st.template = other.template 49 | } 50 | return st 51 | } 52 | 53 | func (st *singleTranslation) Incomplete(l *language.Language) bool { 54 | return st.template == nil || st.template.src == "" 55 | } 56 | 57 | var _ = Translation(&singleTranslation{}) 58 | -------------------------------------------------------------------------------- /vendor/github.com/nicksnyder/go-i18n/i18n/translation/template.go: -------------------------------------------------------------------------------- 1 | package translation 2 | 3 | import ( 4 | "bytes" 5 | "encoding" 6 | "strings" 7 | gotemplate "text/template" 8 | ) 9 | 10 | type template struct { 11 | tmpl *gotemplate.Template 12 | src string 13 | } 14 | 15 | func newTemplate(src string) (*template, error) { 16 | var tmpl template 17 | err := tmpl.parseTemplate(src) 18 | return &tmpl, err 19 | } 20 | 21 | func mustNewTemplate(src string) *template { 22 | t, err := newTemplate(src) 23 | if err != nil { 24 | panic(err) 25 | } 26 | return t 27 | } 28 | 29 | func (t *template) String() string { 30 | return t.src 31 | } 32 | 33 | func (t *template) Execute(args interface{}) string { 34 | if t.tmpl == nil { 35 | return t.src 36 | } 37 | var buf bytes.Buffer 38 | if err := t.tmpl.Execute(&buf, args); err != nil { 39 | return err.Error() 40 | } 41 | return buf.String() 42 | } 43 | 44 | func (t *template) MarshalText() ([]byte, error) { 45 | return []byte(t.src), nil 46 | } 47 | 48 | func (t *template) UnmarshalText(src []byte) error { 49 | return t.parseTemplate(string(src)) 50 | } 51 | 52 | func (t *template) parseTemplate(src string) (err error) { 53 | t.src = src 54 | if strings.Contains(src, "{{") { 55 | t.tmpl, err = gotemplate.New(src).Parse(src) 56 | } 57 | return 58 | } 59 | 60 | var _ = encoding.TextMarshaler(&template{}) 61 | var _ = encoding.TextUnmarshaler(&template{}) 62 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 - 2016 Thomas Pelletier, Eric Anderton 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/cmd/tomll/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "io" 7 | "io/ioutil" 8 | "os" 9 | 10 | "github.com/pelletier/go-toml" 11 | ) 12 | 13 | func main() { 14 | flag.Usage = func() { 15 | fmt.Fprintln(os.Stderr, `tomll can be used in two ways: 16 | Writing to STDIN and reading from STDOUT: 17 | cat file.toml | tomll > file.toml 18 | 19 | Reading and updating a list of files: 20 | tomll a.toml b.toml c.toml 21 | 22 | When given a list of files, tomll will modify all files in place without asking. 23 | `) 24 | } 25 | flag.Parse() 26 | // read from stdin and print to stdout 27 | if flag.NArg() == 0 { 28 | s, err := lintReader(os.Stdin) 29 | if err != nil { 30 | io.WriteString(os.Stderr, err.Error()) 31 | os.Exit(-1) 32 | } 33 | io.WriteString(os.Stdout, s) 34 | } else { 35 | // otherwise modify a list of files 36 | for _, filename := range flag.Args() { 37 | s, err := lintFile(filename) 38 | if err != nil { 39 | io.WriteString(os.Stderr, err.Error()) 40 | os.Exit(-1) 41 | } 42 | ioutil.WriteFile(filename, []byte(s), 0644) 43 | } 44 | } 45 | } 46 | 47 | func lintFile(filename string) (string, error) { 48 | tree, err := toml.LoadFile(filename) 49 | if err != nil { 50 | return "", err 51 | } 52 | return tree.String(), nil 53 | } 54 | 55 | func lintReader(r io.Reader) (string, error) { 56 | tree, err := toml.LoadReader(r) 57 | if err != nil { 58 | return "", err 59 | } 60 | return tree.String(), nil 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/position.go: -------------------------------------------------------------------------------- 1 | // Position support for go-toml 2 | 3 | package toml 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Position of a document element within a TOML document. 10 | // 11 | // Line and Col are both 1-indexed positions for the element's line number and 12 | // column number, respectively. Values of zero or less will cause Invalid(), 13 | // to return true. 14 | type Position struct { 15 | Line int // line within the document 16 | Col int // column within the line 17 | } 18 | 19 | // String representation of the position. 20 | // Displays 1-indexed line and column numbers. 21 | func (p Position) String() string { 22 | return fmt.Sprintf("(%d, %d)", p.Line, p.Col) 23 | } 24 | 25 | // Invalid returns whether or not the position is valid (i.e. with negative or 26 | // null values) 27 | func (p Position) Invalid() bool { 28 | return p.Line <= 0 || p.Col <= 0 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/attrs_stubs.go: -------------------------------------------------------------------------------- 1 | // +build !cgo,!plan9 windows android 2 | 3 | package sftp 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | func fileStatFromInfoOs(fi os.FileInfo, flags *uint32, fileStat *FileStat) { 10 | // todo 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/attrs_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris 2 | // +build cgo 3 | 4 | package sftp 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func fileStatFromInfoOs(fi os.FileInfo, flags *uint32, fileStat *FileStat) { 12 | if statt, ok := fi.Sys().(*syscall.Stat_t); ok { 13 | *flags |= ssh_FILEXFER_ATTR_UIDGID 14 | fileStat.UID = statt.Uid 15 | fileStat.GID = statt.Gid 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/debug.go: -------------------------------------------------------------------------------- 1 | // +build debug 2 | 3 | package sftp 4 | 5 | import "log" 6 | 7 | func debug(fmt string, args ...interface{}) { 8 | log.Printf(fmt, args...) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/release.go: -------------------------------------------------------------------------------- 1 | // +build !debug 2 | 3 | package sftp 4 | 5 | func debug(fmt string, args ...interface{}) {} 6 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/server_standalone/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // small wrapper around sftp server that allows it to be used as a separate process subsystem call by the ssh server. 4 | // in practice this will statically link; however this allows unit testing from the sftp client. 5 | 6 | import ( 7 | "flag" 8 | "fmt" 9 | "io" 10 | "io/ioutil" 11 | "os" 12 | 13 | "github.com/pkg/sftp" 14 | ) 15 | 16 | func main() { 17 | var ( 18 | readOnly bool 19 | debugStderr bool 20 | debugLevel string 21 | ) 22 | 23 | flag.BoolVar(&readOnly, "R", false, "read-only server") 24 | flag.BoolVar(&debugStderr, "e", false, "debug to stderr") 25 | flag.StringVar(&debugLevel, "l", "none", "debug level (ignored)") 26 | flag.Parse() 27 | 28 | debugStream := ioutil.Discard 29 | if debugStderr { 30 | debugStream = os.Stderr 31 | } 32 | 33 | svr, _ := sftp.NewServer( 34 | struct { 35 | io.Reader 36 | io.WriteCloser 37 | }{os.Stdin, 38 | os.Stdout, 39 | }, 40 | sftp.WithDebug(debugStream), 41 | sftp.ReadOnly(), 42 | ) 43 | if err := svr.Serve(); err != nil { 44 | fmt.Fprintf(debugStream, "sftp server completed with error: %v", err) 45 | os.Exit(1) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/server_statvfs_darwin.go: -------------------------------------------------------------------------------- 1 | package sftp 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | func statvfsFromStatfst(stat *syscall.Statfs_t) (*StatVFS, error) { 8 | return &StatVFS{ 9 | Bsize: uint64(stat.Bsize), 10 | Frsize: uint64(stat.Bsize), // fragment size is a linux thing; use block size here 11 | Blocks: stat.Blocks, 12 | Bfree: stat.Bfree, 13 | Bavail: stat.Bavail, 14 | Files: stat.Files, 15 | Ffree: stat.Ffree, 16 | Favail: stat.Ffree, // not sure how to calculate Favail 17 | Fsid: uint64(uint64(stat.Fsid.Val[1])<<32 | uint64(stat.Fsid.Val[0])), // endianness? 18 | Flag: uint64(stat.Flags), // assuming POSIX? 19 | Namemax: 1024, // man 2 statfs shows: #define MAXPATHLEN 1024 20 | }, nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/server_statvfs_impl.go: -------------------------------------------------------------------------------- 1 | // +build darwin linux,!gccgo 2 | 3 | // fill in statvfs structure with OS specific values 4 | // Statfs_t is different per-kernel, and only exists on some unixes (not Solaris for instance) 5 | 6 | package sftp 7 | 8 | import ( 9 | "syscall" 10 | ) 11 | 12 | func (p sshFxpExtendedPacketStatVFS) respond(svr *Server) error { 13 | stat := &syscall.Statfs_t{} 14 | if err := syscall.Statfs(p.Path, stat); err != nil { 15 | return svr.sendPacket(statusFromError(p, err)) 16 | } 17 | 18 | retPkt, err := statvfsFromStatfst(stat) 19 | if err != nil { 20 | return svr.sendPacket(statusFromError(p, err)) 21 | } 22 | retPkt.ID = p.ID 23 | 24 | return svr.sendPacket(retPkt) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/server_statvfs_linux.go: -------------------------------------------------------------------------------- 1 | // +build !gccgo,linux 2 | 3 | package sftp 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | func statvfsFromStatfst(stat *syscall.Statfs_t) (*StatVFS, error) { 10 | return &StatVFS{ 11 | Bsize: uint64(stat.Bsize), 12 | Frsize: uint64(stat.Frsize), 13 | Blocks: stat.Blocks, 14 | Bfree: stat.Bfree, 15 | Bavail: stat.Bavail, 16 | Files: stat.Files, 17 | Ffree: stat.Ffree, 18 | Favail: stat.Ffree, // not sure how to calculate Favail 19 | Fsid: uint64(uint64(stat.Fsid.X__val[1])<<32 | uint64(stat.Fsid.X__val[0])), // endianness? 20 | Flag: uint64(stat.Flags), // assuming POSIX? 21 | Namemax: uint64(stat.Namelen), 22 | }, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/server_statvfs_stubs.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux gccgo 2 | 3 | package sftp 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | func (p sshFxpExtendedPacketStatVFS) respond(svr *Server) error { 10 | return syscall.ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/sftp/server_stubs.go: -------------------------------------------------------------------------------- 1 | // +build !cgo,!plan9 windows android 2 | 3 | package sftp 4 | 5 | import ( 6 | "os" 7 | "path" 8 | ) 9 | 10 | func runLs(dirname string, dirent os.FileInfo) string { 11 | return path.Join(dirname, dirent.Name()) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Blackfriday is distributed under the Simplified BSD License: 2 | 3 | > Copyright © 2011 Russ Ross 4 | > All rights reserved. 5 | > 6 | > Redistribution and use in source and binary forms, with or without 7 | > modification, are permitted provided that the following conditions 8 | > are met: 9 | > 10 | > 1. Redistributions of source code must retain the above copyright 11 | > notice, this list of conditions and the following disclaimer. 12 | > 13 | > 2. Redistributions in binary form must reproduce the above 14 | > copyright notice, this list of conditions and the following 15 | > disclaimer in the documentation and/or other materials provided with 16 | > the distribution. 17 | > 18 | > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | > "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | > LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 | > FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 | > COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | > INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 | > BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | > CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | > LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 | > ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | > POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Dmitri Shuralyov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/main.go: -------------------------------------------------------------------------------- 1 | // Package sanitized_anchor_name provides a func to create sanitized anchor names. 2 | // 3 | // Its logic can be reused by multiple packages to create interoperable anchor names 4 | // and links to those anchors. 5 | // 6 | // At this time, it does not try to ensure that generated anchor names 7 | // are unique, that responsibility falls on the caller. 8 | package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" 9 | 10 | import "unicode" 11 | 12 | // Create returns a sanitized anchor name for the given text. 13 | func Create(text string) string { 14 | var anchorName []rune 15 | var futureDash = false 16 | for _, r := range []rune(text) { 17 | switch { 18 | case unicode.IsLetter(r) || unicode.IsNumber(r): 19 | if futureDash && len(anchorName) > 0 { 20 | anchorName = append(anchorName, '-') 21 | } 22 | futureDash = false 23 | anchorName = append(anchorName, unicode.ToLower(r)) 24 | default: 25 | futureDash = true 26 | } 27 | } 28 | return string(anchorName) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/memradix.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2014 Steve Francia . 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package afero 15 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cast/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/spf13/fsync/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 Mostafa Hajizadeh 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/bufferpool/bufpool.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2013-14 Steve Francia . 2 | // 3 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://opensource.org/licenses/Simple-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package bufferpool 15 | 16 | import ( 17 | "bytes" 18 | "sync" 19 | ) 20 | 21 | var bufferPool = &sync.Pool{ 22 | New: func() interface{} { 23 | return &bytes.Buffer{} 24 | }, 25 | } 26 | 27 | // GetBuffer returns a buffer from the pool. 28 | func GetBuffer() (buf *bytes.Buffer) { 29 | return bufferPool.Get().(*bytes.Buffer) 30 | } 31 | 32 | // PutBuffer returns a buffer to the pool. 33 | // The buffer is reset before it is put back into circulation. 34 | func PutBuffer(buf *bytes.Buffer) { 35 | buf.Reset() 36 | bufferPool.Put(buf) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/commands/check.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2013 Steve Francia . 2 | // 3 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://opensource.org/licenses/Simple-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package commands 15 | 16 | import ( 17 | "github.com/spf13/cobra" 18 | "github.com/spf13/hugo/hugolib" 19 | ) 20 | 21 | var check = &cobra.Command{ 22 | Use: "check", 23 | Short: "Check content in the source directory", 24 | Long: `Hugo will perform some basic analysis on the 25 | content provided and will give feedback.`, 26 | Run: func(cmd *cobra.Command, args []string) { 27 | InitializeConfig() 28 | site := hugolib.Site{} 29 | site.Analyze() 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/commands/limit_others.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | // Copyright © 2013 Steve Francia . 3 | // 4 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://opensource.org/licenses/Simple-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package commands 16 | 17 | func tweakLimit() { 18 | // nothing to do 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugofs/fs.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2013-14 Steve Francia . 2 | // 3 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://opensource.org/licenses/Simple-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package hugofs 15 | 16 | import "github.com/spf13/afero" 17 | 18 | var SourceFs afero.Fs = new(afero.OsFs) 19 | var DestinationFS afero.Fs = new(afero.OsFs) 20 | var OsFs afero.Fs = new(afero.OsFs) 21 | 22 | //var DestinationFS afero.Fs = new(afero.MemMapFs) 23 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugolib/author.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2013 Steve Francia . 2 | // 3 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://opensource.org/licenses/Simple-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package hugolib 15 | 16 | // AuthorList is a list of all authors and their metadata. 17 | type AuthorList map[string]Author 18 | 19 | // Author contains details about the author of a page. 20 | type Author struct { 21 | GivenName string 22 | FamilyName string 23 | DisplayName string 24 | Thumbnail string 25 | Image string 26 | ShortBio string 27 | LongBio string 28 | Email string 29 | Social AuthorSocial 30 | } 31 | 32 | // AuthorSocial is a place to put social details per author. These are the 33 | // standard keys that themes will expect to have available, but can be 34 | // expanded to any others on a per site basis 35 | // - website 36 | // - github 37 | // - facebook 38 | // - twitter 39 | // - googleplus 40 | // - pinterest 41 | // - instagram 42 | // - youtube 43 | // - linkedin 44 | // - skype 45 | type AuthorSocial map[string]string 46 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugolib/hugo.go: -------------------------------------------------------------------------------- 1 | package hugolib 2 | 3 | import ( 4 | "fmt" 5 | "github.com/spf13/hugo/helpers" 6 | "html/template" 7 | ) 8 | 9 | var ( 10 | CommitHash string 11 | BuildDate string 12 | ) 13 | 14 | var hugoInfo *HugoInfo 15 | 16 | // HugoInfo contains information about the current Hugo environment 17 | type HugoInfo struct { 18 | Version string 19 | Generator template.HTML 20 | CommitHash string 21 | BuildDate string 22 | } 23 | 24 | func init() { 25 | hugoInfo = &HugoInfo{ 26 | Version: helpers.HugoVersion(), 27 | CommitHash: CommitHash, 28 | BuildDate: BuildDate, 29 | Generator: template.HTML(fmt.Sprintf(``, helpers.HugoVersion())), 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugolib/pagesPrevNext.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2014 Steve Francia . 2 | // 3 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://opensource.org/licenses/Simple-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package hugolib 15 | 16 | func (p Pages) Prev(cur *Page) *Page { 17 | for x, c := range p { 18 | if c.UniqueID() == cur.UniqueID() { 19 | if x == 0 { 20 | return p[len(p)-1] 21 | } 22 | return p[x-1] 23 | } 24 | } 25 | return nil 26 | } 27 | 28 | func (p Pages) Next(cur *Page) *Page { 29 | for x, c := range p { 30 | if c.UniqueID() == cur.UniqueID() { 31 | if x < len(p)-1 { 32 | return p[x+1] 33 | } 34 | return p[0] 35 | } 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugolib/planner.go: -------------------------------------------------------------------------------- 1 | package hugolib 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | func (s *Site) ShowPlan(out io.Writer) (err error) { 9 | if s.Source == nil || len(s.Source.Files()) <= 0 { 10 | fmt.Fprintf(out, "No source files provided.\n") 11 | } 12 | 13 | for _, p := range s.Pages { 14 | fmt.Fprintf(out, "%s", p.Source.Path()) 15 | if p.IsRenderable() { 16 | fmt.Fprintf(out, " (renderer: markdown)") 17 | } else { 18 | fmt.Fprintf(out, " (renderer: n/a)") 19 | } 20 | if s.Tmpl != nil { 21 | for _, l := range p.Layout() { 22 | fmt.Fprintf(out, " (layout: %s, exists: %t)", l, s.Tmpl.Lookup(l) != nil) 23 | } 24 | } 25 | fmt.Fprintf(out, "\n") 26 | fmt.Fprintf(out, " canonical => ") 27 | if s.Targets.Page == nil { 28 | fmt.Fprintf(out, "%s\n\n", "!no target specified!") 29 | continue 30 | } 31 | 32 | trns, err := s.PageTarget().Translate(p.TargetPath()) 33 | if err != nil { 34 | return err 35 | } 36 | fmt.Fprintf(out, "%s\n", trns) 37 | 38 | if s.Targets.Alias == nil { 39 | continue 40 | } 41 | 42 | for _, alias := range p.Aliases { 43 | aliasTrans, err := s.AliasTarget().Translate(alias) 44 | if err != nil { 45 | return err 46 | } 47 | fmt.Fprintf(out, " %s => %s\n", alias, aliasTrans) 48 | } 49 | fmt.Fprintln(out) 50 | } 51 | return 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugolib/sitemap.go: -------------------------------------------------------------------------------- 1 | package hugolib 2 | 3 | import ( 4 | "github.com/spf13/cast" 5 | jww "github.com/spf13/jwalterweatherman" 6 | ) 7 | 8 | type Sitemap struct { 9 | ChangeFreq string 10 | Priority float64 11 | } 12 | 13 | func parseSitemap(input map[string]interface{}) Sitemap { 14 | sitemap := Sitemap{Priority: -1} 15 | 16 | for key, value := range input { 17 | switch key { 18 | case "changefreq": 19 | sitemap.ChangeFreq = cast.ToString(value) 20 | case "priority": 21 | sitemap.Priority = cast.ToFloat64(value) 22 | default: 23 | jww.WARN.Printf("Unknown Sitemap field: %s\n", key) 24 | } 25 | } 26 | 27 | return sitemap 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/hugolib/summary.go: -------------------------------------------------------------------------------- 1 | package hugolib 2 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/main.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2013-14 Steve Francia . 2 | // 3 | // Licensed under the Simple Public License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://opensource.org/licenses/Simple-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package main 15 | 16 | import ( 17 | "runtime" 18 | 19 | "github.com/spf13/hugo/commands" 20 | ) 21 | 22 | func main() { 23 | runtime.GOMAXPROCS(runtime.NumCPU()) 24 | commands.Execute() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/source/inmemory.go: -------------------------------------------------------------------------------- 1 | package source 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | type ByteSource struct { 9 | Name string 10 | Content []byte 11 | } 12 | 13 | func (b *ByteSource) String() string { 14 | return fmt.Sprintf("%s %s", b.Name, string(b.Content)) 15 | } 16 | 17 | type InMemorySource struct { 18 | ByteSource []ByteSource 19 | } 20 | 21 | func (i *InMemorySource) Files() (files []*File) { 22 | files = make([]*File, len(i.ByteSource)) 23 | for i, fake := range i.ByteSource { 24 | files[i] = NewFileWithContents(fake.Name, bytes.NewReader(fake.Content)) 25 | } 26 | return 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/target/file.go: -------------------------------------------------------------------------------- 1 | package target 2 | 3 | import ( 4 | "io" 5 | "path/filepath" 6 | 7 | "github.com/spf13/hugo/helpers" 8 | "github.com/spf13/hugo/hugofs" 9 | ) 10 | 11 | type Publisher interface { 12 | Publish(string, io.Reader) error 13 | } 14 | 15 | type Translator interface { 16 | Translate(string) (string, error) 17 | } 18 | 19 | // TODO(bep) consider other ways to solve this. 20 | type OptionalTranslator interface { 21 | TranslateRelative(string) (string, error) 22 | } 23 | 24 | type Output interface { 25 | Publisher 26 | Translator 27 | } 28 | 29 | type Filesystem struct { 30 | PublishDir string 31 | } 32 | 33 | func (fs *Filesystem) Publish(path string, r io.Reader) (err error) { 34 | translated, err := fs.Translate(path) 35 | if err != nil { 36 | return 37 | } 38 | 39 | return helpers.WriteToDisk(translated, r, hugofs.DestinationFS) 40 | } 41 | 42 | func (fs *Filesystem) Translate(src string) (dest string, err error) { 43 | return filepath.Join(fs.PublishDir, src), nil 44 | } 45 | 46 | func (fs *Filesystem) extension(ext string) string { 47 | return ext 48 | } 49 | 50 | func filename(f string) string { 51 | ext := filepath.Ext(f) 52 | if ext == "" { 53 | return f 54 | } 55 | 56 | return f[:len(f)-len(ext)] 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/target/memory.go: -------------------------------------------------------------------------------- 1 | package target 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | type InMemoryTarget struct { 9 | Files map[string][]byte 10 | } 11 | 12 | func (t *InMemoryTarget) Publish(label string, reader io.Reader) (err error) { 13 | if t.Files == nil { 14 | t.Files = make(map[string][]byte) 15 | } 16 | bytes := new(bytes.Buffer) 17 | bytes.ReadFrom(reader) 18 | t.Files[label] = bytes.Bytes() 19 | return 20 | } 21 | 22 | func (t *InMemoryTarget) Translate(label string) (dest string, err error) { 23 | return label, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/transform/absurl.go: -------------------------------------------------------------------------------- 1 | package transform 2 | 3 | var ar *absURLReplacer = newAbsURLReplacer() 4 | 5 | var AbsURL = func(ct contentTransformer) { 6 | ar.replaceInHTML(ct) 7 | } 8 | 9 | var AbsURLInXML = func(ct contentTransformer) { 10 | ar.replaceInXML(ct) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/hugo/transform/livereloadinject.go: -------------------------------------------------------------------------------- 1 | package transform 2 | 3 | import ( 4 | "bytes" 5 | "github.com/spf13/viper" 6 | ) 7 | 8 | func LiveReloadInject(ct contentTransformer) { 9 | match := []byte("") 10 | port := viper.GetString("port") 11 | replace := []byte(``) 15 | newcontent := bytes.Replace(ct.Content(), match, replace, -1) 16 | 17 | if len(newcontent) == len(ct.Content()) { 18 | match := []byte("") 19 | newcontent = bytes.Replace(ct.Content(), match, replace, -1) 20 | } 21 | 22 | ct.Write(newcontent) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/jwalterweatherman/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/spf13/viper/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2015 Ugorji Nwoke. 4 | All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/codecgen/z.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | const genCodecPath = "github.com/ugorji/go/codec" 4 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/decode_go.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(rvn reflect.Value) (rvn2 reflect.Value) { 13 | rvn2 = reflect.New(reflect.ArrayOf(rvn.Len(), intfTyp)).Elem() 14 | reflect.Copy(rvn2, rvn) 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/decode_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(rvn reflect.Value) (rvn2 reflect.Value) { 13 | panic("reflect.ArrayOf unsupported") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/fast-path.not.go: -------------------------------------------------------------------------------- 1 | // +build notfastpath 2 | 3 | package codec 4 | 5 | import "reflect" 6 | 7 | const fastpathEnabled = false 8 | 9 | // The generated fast-path code is very large, and adds a few seconds to the build time. 10 | // This causes test execution, execution of small tools which use codec, etc 11 | // to take a long time. 12 | // 13 | // To mitigate, we now support the notfastpath tag. 14 | // This tag disables fastpath during build, allowing for faster build, test execution, 15 | // short-program runs, etc. 16 | 17 | func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false } 18 | func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false } 19 | func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false } 20 | func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false } 21 | 22 | type fastpathT struct{} 23 | type fastpathE struct { 24 | rtid uintptr 25 | rt reflect.Type 26 | encfn func(*encFnInfo, reflect.Value) 27 | decfn func(*decFnInfo, reflect.Value) 28 | } 29 | type fastpathA [0]fastpathE 30 | 31 | func (x fastpathA) index(rtid uintptr) int { return -1 } 32 | 33 | var fastpathAV fastpathA 34 | var fastpathTV fastpathT 35 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/gen_15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | func init() { 11 | genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/gen_16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | func init() { 11 | genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/gen_17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | func init() { 9 | genCheckVendor = true 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/helper_not_unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !unsafe 2 | 3 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 4 | // Use of this source code is governed by a MIT license found in the LICENSE file. 5 | 6 | package codec 7 | 8 | // stringView returns a view of the []byte as a string. 9 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 10 | // In regular safe mode, it is an allocation and copy. 11 | func stringView(v []byte) string { 12 | return string(v) 13 | } 14 | 15 | // bytesView returns a view of the string as a []byte. 16 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 17 | // In regular safe mode, it is an allocation and copy. 18 | func bytesView(v string) []byte { 19 | return []byte(v) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/helper_unsafe.go: -------------------------------------------------------------------------------- 1 | // +build unsafe 2 | 3 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 4 | // Use of this source code is governed by a MIT license found in the LICENSE file. 5 | 6 | package codec 7 | 8 | import ( 9 | "unsafe" 10 | ) 11 | 12 | // This file has unsafe variants of some helper methods. 13 | 14 | type unsafeString struct { 15 | Data uintptr 16 | Len int 17 | } 18 | 19 | type unsafeSlice struct { 20 | Data uintptr 21 | Len int 22 | Cap int 23 | } 24 | 25 | // stringView returns a view of the []byte as a string. 26 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 27 | // In regular safe mode, it is an allocation and copy. 28 | func stringView(v []byte) string { 29 | if len(v) == 0 { 30 | return "" 31 | } 32 | 33 | bx := (*unsafeSlice)(unsafe.Pointer(&v)) 34 | sx := unsafeString{bx.Data, bx.Len} 35 | return *(*string)(unsafe.Pointer(&sx)) 36 | } 37 | 38 | // bytesView returns a view of the string as a []byte. 39 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 40 | // In regular safe mode, it is an allocation and copy. 41 | func bytesView(v string) []byte { 42 | if len(v) == 0 { 43 | return zeroByteSlice 44 | } 45 | 46 | sx := (*unsafeString)(unsafe.Pointer(&v)) 47 | bx := unsafeSlice{sx.Data, sx.Len, sx.Len} 48 | return *(*[]byte)(unsafe.Pointer(&bx)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/prebuild.go: -------------------------------------------------------------------------------- 1 | package codec 2 | 3 | //go:generate bash prebuild.sh 4 | -------------------------------------------------------------------------------- /vendor/github.com/xordataexchange/crypt/backend/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 XOR Data Exchange, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/xordataexchange/crypt/backend/backend.go: -------------------------------------------------------------------------------- 1 | // Package backend provides the K/V store interface for crypt backends. 2 | package backend 3 | 4 | // Response represents a response from a backend store. 5 | type Response struct { 6 | Value []byte 7 | Error error 8 | } 9 | 10 | // KVPair holds both a key and value when reading a list. 11 | type KVPair struct { 12 | Key string 13 | Value []byte 14 | } 15 | 16 | type KVPairs []*KVPair 17 | 18 | // A Store is a K/V store backend that retrieves and sets, and monitors 19 | // data in a K/V store. 20 | type Store interface { 21 | // Get retrieves a value from a K/V store for the provided key. 22 | Get(key string) ([]byte, error) 23 | 24 | // List retrieves all keys and values under a provided key. 25 | List(key string) (KVPairs, error) 26 | 27 | // Set sets the provided key to value. 28 | Set(key string, value []byte) error 29 | 30 | // Watch monitors a K/V store for changes to key. 31 | Watch(key string, stop chan bool) <-chan *Response 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/xordataexchange/crypt/backend/mock/mock.go: -------------------------------------------------------------------------------- 1 | package mock 2 | 3 | import ( 4 | "errors" 5 | "path" 6 | "strings" 7 | "time" 8 | 9 | "github.com/xordataexchange/crypt/backend" 10 | ) 11 | 12 | var mockedStore map[string][]byte 13 | 14 | type Client struct{} 15 | 16 | func New(machines []string) (*Client, error) { 17 | if mockedStore == nil { 18 | mockedStore = make(map[string][]byte, 2) 19 | } 20 | return &Client{}, nil 21 | } 22 | 23 | func (c *Client) Get(key string) ([]byte, error) { 24 | if v, ok := mockedStore[key]; ok { 25 | return v, nil 26 | } 27 | err := errors.New("Could not find key: " + key) 28 | return nil, err 29 | } 30 | 31 | func (c *Client) List(key string) (backend.KVPairs, error) { 32 | var list backend.KVPairs 33 | dir := path.Clean(key) + "/" 34 | for k, v := range mockedStore { 35 | if strings.HasPrefix(k, dir) { 36 | list = append(list, &backend.KVPair{Key: k, Value: v}) 37 | } 38 | } 39 | return list, nil 40 | } 41 | 42 | func (c *Client) Set(key string, value []byte) error { 43 | mockedStore[key] = value 44 | return nil 45 | } 46 | 47 | func (c *Client) Watch(key string, stop chan bool) <-chan *backend.Response { 48 | respChan := make(chan *backend.Response, 0) 49 | go func() { 50 | for { 51 | b, err := c.Get(key) 52 | if err != nil { 53 | respChan <- &backend.Response{nil, err} 54 | time.Sleep(time.Second * 5) 55 | continue 56 | } 57 | respChan <- &backend.Response{b, nil} 58 | } 59 | }() 60 | return respChan 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/xordataexchange/crypt/config/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 XOR Data Exchange, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/xordataexchange/crypt/encoding/secconf/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 XOR Data Exchange, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace-proxy/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Keiji Yoshida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace-proxy/doc.go: -------------------------------------------------------------------------------- 1 | // Package proxy provides a proxy for the Ace template engine. 2 | // The proxy caches the options for the Ace template engine 3 | // so that you don't have to specify them every time calling 4 | // the Ace APIs. 5 | package proxy 6 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace-proxy/proxy.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import ( 4 | "html/template" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | // Proxy represents a proxy for the Ace template engine. 10 | type Proxy struct { 11 | Opts *ace.Options 12 | } 13 | 14 | // Load calls the `Load` function of the Ace template engine. 15 | func (p *Proxy) Load(basePath, innerPath string, opts *ace.Options) (*template.Template, error) { 16 | var o *ace.Options 17 | 18 | if opts == nil { 19 | o = p.Opts 20 | } else { 21 | o = opts 22 | } 23 | 24 | return ace.Load(basePath, innerPath, o) 25 | } 26 | 27 | // New creates and returns a proxy. 28 | func New(opts *ace.Options) *Proxy { 29 | return &Proxy{ 30 | Opts: opts, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Keiji Yoshida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/action.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "strings" 7 | ) 8 | 9 | // action represents an action. 10 | type action struct { 11 | elementBase 12 | } 13 | 14 | // WriteTo writes data to w. 15 | func (e *action) WriteTo(w io.Writer) (int64, error) { 16 | var bf bytes.Buffer 17 | 18 | // Write the action 19 | bf.WriteString(strings.TrimSpace(e.ln.str)) 20 | 21 | // Write the children's HTML. 22 | if i, err := e.writeChildren(&bf); err != nil { 23 | return i, err 24 | } 25 | 26 | // Write the buffer. 27 | i, err := w.Write(bf.Bytes()) 28 | 29 | return int64(i), err 30 | 31 | } 32 | 33 | func (e *action) IsBlockElement() bool { 34 | return e.parent.IsBlockElement() 35 | } 36 | func (e *action) IsControlElement() bool { 37 | return true 38 | } 39 | 40 | // newAction creates and returns an action. 41 | func newAction(ln *line, rslt *result, src *source, parent element, opts *Options) *action { 42 | return &action{ 43 | elementBase: newElementBase(ln, rslt, src, parent, opts), 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/comment.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import "io" 4 | 5 | // comment represents a comment. 6 | type comment struct { 7 | elementBase 8 | } 9 | 10 | // Do nothing. 11 | func (e *comment) WriteTo(w io.Writer) (int64, error) { 12 | return 0, nil 13 | } 14 | 15 | // ContainPlainText returns true. 16 | func (e *comment) ContainPlainText() bool { 17 | return true 18 | } 19 | 20 | // newComment creates and returns a comment. 21 | func newComment(ln *line, rslt *result, src *source, parent element, opts *Options) *comment { 22 | return &comment{ 23 | elementBase: newElementBase(ln, rslt, src, parent, opts), 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/doc.go: -------------------------------------------------------------------------------- 1 | // Package ace provides an HTML template engine. 2 | package ace 3 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/empty_element.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import "io" 4 | 5 | // emptyElement represents an empty element. 6 | type emptyElement struct { 7 | elementBase 8 | } 9 | 10 | // Do nothing. 11 | func (e *emptyElement) WriteTo(w io.Writer) (int64, error) { 12 | return 0, nil 13 | } 14 | 15 | // CanHaveChildren returns false. 16 | func (e *emptyElement) CanHaveChildren() bool { 17 | return false 18 | } 19 | 20 | // newEmpty creates and returns an empty element. 21 | func newEmptyElement(ln *line, rslt *result, src *source, parent element, opts *Options) *emptyElement { 22 | return &emptyElement{ 23 | elementBase: newElementBase(ln, rslt, src, parent, opts), 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/actions/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | data := map[string]interface{}{ 16 | "Title": "Actions", 17 | "Msgs": []string{ 18 | "Message1", 19 | "Message2", 20 | "Message3", 21 | }, 22 | } 23 | if err := tpl.Execute(w, data); err != nil { 24 | http.Error(w, err.Error(), http.StatusInternalServerError) 25 | return 26 | } 27 | } 28 | 29 | func main() { 30 | http.HandleFunc("/", handler) 31 | http.ListenAndServe(":8080", nil) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/base_inner_template/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("base", "inner", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/cache_options/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | "github.com/yosssi/ace-proxy" 8 | ) 9 | 10 | var p = proxy.New(&ace.Options{BaseDir: "views", DynamicReload: true}) 11 | 12 | func handler(w http.ResponseWriter, r *http.Request) { 13 | tpl, err := p.Load("example", "", nil) 14 | if err != nil { 15 | http.Error(w, err.Error(), http.StatusInternalServerError) 16 | return 17 | } 18 | 19 | if err := tpl.Execute(w, nil); err != nil { 20 | http.Error(w, err.Error(), http.StatusInternalServerError) 21 | return 22 | } 23 | } 24 | 25 | func main() { 26 | http.HandleFunc("/", handler) 27 | http.ListenAndServe(":8080", nil) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/change_action_delimiter/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", &ace.Options{ 11 | DelimLeft: "<%", 12 | DelimRight: "%>", 13 | }) 14 | if err != nil { 15 | http.Error(w, err.Error(), http.StatusInternalServerError) 16 | return 17 | } 18 | data := map[string]interface{}{ 19 | "Msg": "Hello Ace", 20 | } 21 | if err := tpl.Execute(w, data); err != nil { 22 | http.Error(w, err.Error(), http.StatusInternalServerError) 23 | return 24 | } 25 | } 26 | 27 | func main() { 28 | http.HandleFunc("/", handler) 29 | http.ListenAndServe(":8080", nil) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/comments/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/css_javascript_helper_method/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/dynamic_reload/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", &ace.Options{DynamicReload: true}) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/external_css_and_js/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/html_tags/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/include_helper_method/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/load_templates_from_binary_data/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("views/example", "", &ace.Options{ 11 | Asset: Asset, 12 | }) 13 | if err != nil { 14 | http.Error(w, err.Error(), http.StatusInternalServerError) 15 | return 16 | } 17 | if err := tpl.Execute(w, nil); err != nil { 18 | http.Error(w, err.Error(), http.StatusInternalServerError) 19 | return 20 | } 21 | } 22 | 23 | func main() { 24 | http.HandleFunc("/", handler) 25 | http.ListenAndServe(":8080", nil) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/pass_pipeline_to_included_template/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | // Pet represents a pet. 10 | type Pet struct { 11 | Species string 12 | Name string 13 | Age int 14 | } 15 | 16 | func handler(w http.ResponseWriter, r *http.Request) { 17 | tpl, err := ace.Load("example", "", nil) 18 | if err != nil { 19 | http.Error(w, err.Error(), http.StatusInternalServerError) 20 | return 21 | } 22 | data := map[string]interface{}{ 23 | "Pets": []Pet{ 24 | Pet{Species: "Dog", Name: "Taro", Age: 5}, 25 | Pet{Species: "Cat", Name: "Hanako", Age: 10}, 26 | Pet{Species: "Rabbit", Name: "Jiro", Age: 1}, 27 | }, 28 | } 29 | if err := tpl.Execute(w, data); err != nil { 30 | http.Error(w, err.Error(), http.StatusInternalServerError) 31 | return 32 | } 33 | } 34 | 35 | func main() { 36 | http.HandleFunc("/", handler) 37 | http.ListenAndServe(":8080", nil) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/plain_texts/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/set_custom_functions/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "html/template" 5 | "net/http" 6 | 7 | "github.com/yosssi/ace" 8 | ) 9 | 10 | func handler(w http.ResponseWriter, r *http.Request) { 11 | funcMap := template.FuncMap{ 12 | "Greeting": func(s string) string { 13 | return "Hello " + s 14 | }, 15 | } 16 | tpl, err := ace.Load("example", "", &ace.Options{ 17 | FuncMap: funcMap, 18 | }) 19 | if err != nil { 20 | http.Error(w, err.Error(), http.StatusInternalServerError) 21 | return 22 | } 23 | if err := tpl.Execute(w, nil); err != nil { 24 | http.Error(w, err.Error(), http.StatusInternalServerError) 25 | return 26 | } 27 | } 28 | 29 | func main() { 30 | http.HandleFunc("/", handler) 31 | http.ListenAndServe(":8080", nil) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/set_default_value_to_the_yield_helper_method/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("base", "inner", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/examples/single_template/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/yosssi/ace" 7 | ) 8 | 9 | func handler(w http.ResponseWriter, r *http.Request) { 10 | tpl, err := ace.Load("example", "", nil) 11 | if err != nil { 12 | http.Error(w, err.Error(), http.StatusInternalServerError) 13 | return 14 | } 15 | if err := tpl.Execute(w, nil); err != nil { 16 | http.Error(w, err.Error(), http.StatusInternalServerError) 17 | return 18 | } 19 | } 20 | 21 | func main() { 22 | http.HandleFunc("/", handler) 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/file.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | // File represents a file. 4 | type File struct { 5 | path string 6 | data []byte 7 | } 8 | 9 | // NewFile creates and returns a file. 10 | func NewFile(path string, data []byte) *File { 11 | return &File{ 12 | path: path, 13 | data: data, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/formatter.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import "bytes" 4 | import "strings" 5 | 6 | // File represents a file. 7 | type outputFormatter interface { 8 | OpeningElement(*bytes.Buffer, element) (int, error) 9 | ClosingElement(*bytes.Buffer, element) (int, error) 10 | WritingTextValue(*bytes.Buffer, element) (int, error) 11 | } 12 | 13 | type Formatter struct { 14 | indent string 15 | } 16 | 17 | func newFormatter(indent string) outputFormatter { 18 | f := &Formatter{ 19 | indent: indent, 20 | } 21 | return f 22 | } 23 | 24 | func (f *Formatter) OpeningElement(bf *bytes.Buffer, e element) (int, error) { 25 | if e.IsControlElement() { 26 | return 0, nil 27 | } 28 | 29 | base := e.Base() 30 | if base.parent != nil && base.parent.IsBlockElement() { 31 | return f.writeIndent(bf, base.ln.indent) 32 | } 33 | return 0, nil 34 | } 35 | func (f *Formatter) ClosingElement(bf *bytes.Buffer, e element) (int, error) { 36 | if e.IsBlockElement() { 37 | return f.writeIndent(bf, e.Base().ln.indent) 38 | } 39 | return 0, nil 40 | } 41 | func (f *Formatter) WritingTextValue(bf *bytes.Buffer, e element) (int, error) { 42 | if e.IsBlockElement() { 43 | return f.writeIndent(bf, e.Base().ln.indent+1) 44 | } 45 | return 0, nil 46 | } 47 | 48 | func (f *Formatter) writeIndent(bf *bytes.Buffer, depth int) (int, error) { 49 | indent := "\n" + strings.Repeat(f.indent, depth) 50 | return bf.WriteString(indent) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/helper_method_css.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // helperMethodCSS represents a helper method css. 9 | type helperMethodCSS struct { 10 | elementBase 11 | } 12 | 13 | // WriteTo writes data to w. 14 | func (e *helperMethodCSS) WriteTo(w io.Writer) (int64, error) { 15 | var bf bytes.Buffer 16 | 17 | // Write an open tag. 18 | bf.WriteString(lt) 19 | bf.WriteString(`style type="text/css"`) 20 | bf.WriteString(gt) 21 | 22 | bf.WriteString(lf) 23 | 24 | // Write the children's HTML. 25 | if i, err := e.writeChildren(&bf); err != nil { 26 | return i, err 27 | } 28 | 29 | // Write an open tag. 30 | bf.WriteString(lt) 31 | bf.WriteString(slash) 32 | bf.WriteString("style") 33 | bf.WriteString(gt) 34 | 35 | // Write the buffer. 36 | i, err := w.Write(bf.Bytes()) 37 | 38 | return int64(i), err 39 | } 40 | 41 | // ContainPlainText returns true. 42 | func (e *helperMethodCSS) ContainPlainText() bool { 43 | return true 44 | } 45 | 46 | // helperMethodCSS creates and returns a helper method css. 47 | func newHelperMethodCSS(ln *line, rslt *result, src *source, parent element, opts *Options) *helperMethodCSS { 48 | return &helperMethodCSS{ 49 | elementBase: newElementBase(ln, rslt, src, parent, opts), 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/helper_method_include.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "strings" 7 | ) 8 | 9 | // helperMethodInclude represents a helper method include. 10 | type helperMethodInclude struct { 11 | elementBase 12 | templateName string 13 | pipeline string 14 | } 15 | 16 | // WriteTo writes data to w. 17 | func (e *helperMethodInclude) WriteTo(w io.Writer) (int64, error) { 18 | var s string 19 | 20 | if e.pipeline == "" { 21 | s = fmt.Sprintf(actionTemplate, e.opts.DelimLeft, e.templateName, e.opts.DelimRight) 22 | } else { 23 | s = fmt.Sprintf(actionTemplateWithPipeline, e.opts.DelimLeft, e.templateName, e.pipeline, e.opts.DelimRight) 24 | } 25 | 26 | i, err := w.Write([]byte(s)) 27 | 28 | return int64(i), err 29 | } 30 | 31 | // newHelperMethodInclude creates and returns a helper method include. 32 | func newHelperMethodInclude(ln *line, rslt *result, src *source, parent element, opts *Options) (*helperMethodInclude, error) { 33 | if len(ln.tokens) < 3 { 34 | return nil, fmt.Errorf("no template name is specified [file: %s][line: %d]", ln.fileName(), ln.no) 35 | } 36 | 37 | var pipeline string 38 | 39 | if len(ln.tokens) > 3 { 40 | pipeline = strings.Join(ln.tokens[3:], space) 41 | } 42 | 43 | e := &helperMethodInclude{ 44 | elementBase: newElementBase(ln, rslt, src, parent, opts), 45 | templateName: ln.tokens[2], 46 | pipeline: pipeline, 47 | } 48 | 49 | return e, nil 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/helper_method_javascript.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // helperMethodJavascript represents a helper method javascript. 9 | type helperMethodJavascript struct { 10 | elementBase 11 | } 12 | 13 | // WriteTo writes data to w. 14 | func (e *helperMethodJavascript) WriteTo(w io.Writer) (int64, error) { 15 | var bf bytes.Buffer 16 | 17 | // Write an open tag. 18 | bf.WriteString(lt) 19 | bf.WriteString(`script type="text/javascript"`) 20 | bf.WriteString(gt) 21 | 22 | bf.WriteString(lf) 23 | 24 | // Write the children's HTML. 25 | if i, err := e.writeChildren(&bf); err != nil { 26 | return i, err 27 | } 28 | 29 | // Write an open tag. 30 | bf.WriteString(lt) 31 | bf.WriteString(slash) 32 | bf.WriteString("script") 33 | bf.WriteString(gt) 34 | 35 | // Write the buffer. 36 | i, err := w.Write(bf.Bytes()) 37 | 38 | return int64(i), err 39 | } 40 | 41 | // ContainPlainText returns true. 42 | func (e *helperMethodJavascript) ContainPlainText() bool { 43 | return true 44 | } 45 | 46 | // helperMethodJavascript creates and returns a helper method javascript. 47 | func newHelperMethodJavascript(ln *line, rslt *result, src *source, parent element, opts *Options) *helperMethodJavascript { 48 | return &helperMethodJavascript{ 49 | elementBase: newElementBase(ln, rslt, src, parent, opts), 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/plain_text.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "strings" 7 | ) 8 | 9 | // plainText represents a plain text. 10 | type plainText struct { 11 | elementBase 12 | insertBr bool 13 | } 14 | 15 | // WriteTo writes data to w. 16 | func (e *plainText) WriteTo(w io.Writer) (int64, error) { 17 | var bf bytes.Buffer 18 | 19 | // Write the plain text. 20 | bf.WriteString(strings.Join(e.ln.tokens[1:], space)) 21 | 22 | if len(e.ln.tokens) > 1 && e.insertBr { 23 | bf.WriteString(htmlBr) 24 | } 25 | 26 | // Write the children's HTML. 27 | if len(e.children) > 0 { 28 | bf.WriteString(lf) 29 | 30 | if i, err := e.writeChildren(&bf); err != nil { 31 | return i, err 32 | } 33 | } 34 | 35 | // Write the buffer. 36 | i, err := w.Write(bf.Bytes()) 37 | 38 | return int64(i), err 39 | } 40 | 41 | // ContainPlainText returns true. 42 | func (e *plainText) ContainPlainText() bool { 43 | return true 44 | } 45 | 46 | // InsertBr returns true if the br tag is inserted to the line. 47 | func (e *plainText) InsertBr() bool { 48 | return e.insertBr 49 | } 50 | 51 | // newPlainText creates and returns a plain text. 52 | func newPlainText(ln *line, rslt *result, src *source, parent element, opts *Options) *plainText { 53 | return &plainText{ 54 | elementBase: newElementBase(ln, rslt, src, parent, opts), 55 | insertBr: ln.tokens[0] == doublePipe, 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/plain_text_inner.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | import "io" 4 | 5 | // HTML 6 | const ( 7 | htmlBr = "
" 8 | ) 9 | 10 | // plainTextInner represents a plain text inner. 11 | type plainTextInner struct { 12 | elementBase 13 | insertBr bool 14 | } 15 | 16 | // WriteTo writes data to w. 17 | func (e *plainTextInner) WriteTo(w io.Writer) (int64, error) { 18 | s := "" 19 | 20 | if (e.parent.Base().ln.indent+1)*2 <= len(e.ln.str) { 21 | s = e.ln.str[(e.parent.Base().ln.indent+1)*2:] 22 | } 23 | 24 | if e.insertBr && !e.lastChild { 25 | s += htmlBr 26 | } 27 | 28 | i, err := w.Write([]byte(s + lf)) 29 | 30 | return int64(i), err 31 | } 32 | 33 | // CanHaveChildren returns false. 34 | func (e *plainTextInner) CanHaveChildren() bool { 35 | return false 36 | } 37 | 38 | // newPlainTextInner creates and returns a plain text. 39 | func newPlainTextInner(ln *line, rslt *result, src *source, parent element, insertBr bool, opts *Options) *plainTextInner { 40 | return &plainTextInner{ 41 | elementBase: newElementBase(ln, rslt, src, parent, opts), 42 | insertBr: insertBr, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/result.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | // result represents a result of the parsing process. 4 | type result struct { 5 | base []element 6 | inner []element 7 | includes map[string][]element 8 | } 9 | 10 | // newResult creates and returns a result. 11 | func newResult(base []element, inner []element, includes map[string][]element) *result { 12 | return &result{ 13 | base: base, 14 | inner: inner, 15 | includes: includes, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/ace/source.go: -------------------------------------------------------------------------------- 1 | package ace 2 | 3 | // source represents source for the parsing process. 4 | type source struct { 5 | base *File 6 | inner *File 7 | includes []*File 8 | } 9 | 10 | // NewSource creates and returns source. 11 | func NewSource(base, inner *File, includes []*File) *source { 12 | return &source{ 13 | base: base, 14 | inner: inner, 15 | includes: includes, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Keiji Yoshida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/consts.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | const ( 4 | defaultIndentString = " " 5 | startIndent = 0 6 | defaultLastElement = "" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/doc.go: -------------------------------------------------------------------------------- 1 | // Package gohtml provides an HTML formatting function. 2 | package gohtml 3 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/element.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import "bytes" 4 | 5 | // An element represents an HTML element. 6 | type element interface { 7 | write(*bytes.Buffer, int) 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/formatter.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import ( 4 | "bytes" 5 | "strconv" 6 | "strings" 7 | ) 8 | 9 | // Format parses the input HTML string, formats it and returns the result. 10 | func Format(s string) string { 11 | return parse(s).html() 12 | } 13 | 14 | // Format parses the input HTML string, formats it and returns the result with line no. 15 | func FormatWithLineNo(s string) string { 16 | return AddLineNo(Format(s)) 17 | } 18 | 19 | func AddLineNo(s string) string { 20 | lines := strings.Split(s, "\n") 21 | maxLineNoStrLen := len(strconv.Itoa(len(lines))) 22 | bf := &bytes.Buffer{} 23 | for i, line := range lines { 24 | lineNoStr := strconv.Itoa(i + 1) 25 | if i > 0 { 26 | bf.WriteString("\n") 27 | } 28 | bf.WriteString(strings.Repeat(" ", maxLineNoStrLen-len(lineNoStr)) + lineNoStr + " " + line) 29 | } 30 | return bf.String() 31 | 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/html_document.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import "bytes" 4 | 5 | // An htmlDocument represents an HTML document. 6 | type htmlDocument struct { 7 | elements []element 8 | } 9 | 10 | // html generates an HTML source code and returns it. 11 | func (htmlDoc *htmlDocument) html() string { 12 | bf := &bytes.Buffer{} 13 | for _, e := range htmlDoc.elements { 14 | e.write(bf, startIndent) 15 | } 16 | return bf.String() 17 | } 18 | 19 | // append appends an element to the htmlDocument. 20 | func (htmlDoc *htmlDocument) append(e element) { 21 | htmlDoc.elements = append(htmlDoc.elements, e) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/tag_element.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import "bytes" 4 | 5 | // A tagElement represents a tag element of an HTML document. 6 | type tagElement struct { 7 | tagName string 8 | startTagRaw string 9 | endTagRaw string 10 | children []element 11 | } 12 | 13 | // write writes a tag to the buffer. 14 | func (e *tagElement) write(bf *bytes.Buffer, indent int) { 15 | writeLine(bf, e.startTagRaw, indent) 16 | for _, c := range e.children { 17 | var childIndent int 18 | if e.endTagRaw != "" { 19 | childIndent = indent + 1 20 | } else { 21 | childIndent = indent 22 | } 23 | c.write(bf, childIndent) 24 | } 25 | if e.endTagRaw != "" { 26 | writeLine(bf, e.endTagRaw, indent) 27 | } 28 | } 29 | 30 | // appendChild append an element to the element's children. 31 | func (e *tagElement) appendChild(child element) { 32 | e.children = append(e.children, child) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/text_element.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import ( 4 | "bytes" 5 | "strings" 6 | ) 7 | 8 | // A textElement represents a text element of an HTML document. 9 | type textElement struct { 10 | text string 11 | } 12 | 13 | // write writes a text to the buffer. 14 | func (e *textElement) write(bf *bytes.Buffer, indent int) { 15 | lines := strings.Split(strings.Trim(unifyLineFeed(e.text), "\n"), "\n") 16 | for _, line := range lines { 17 | writeLineFeed(bf) 18 | writeIndent(bf, indent) 19 | bf.WriteString(line) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/utils.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import ( 4 | "bytes" 5 | "strings" 6 | ) 7 | 8 | // writeLine writes an HTML line to the buffer. 9 | func writeLine(bf *bytes.Buffer, s string, indent int) { 10 | writeLineFeed(bf) 11 | writeIndent(bf, indent) 12 | bf.WriteString(s) 13 | } 14 | 15 | // writeLineFeed writes a line feed to the buffer. 16 | func writeLineFeed(bf *bytes.Buffer) { 17 | if bf.Len() > 0 { 18 | bf.WriteString("\n") 19 | } 20 | } 21 | 22 | // writeIndent writes indents to the buffer. 23 | func writeIndent(bf *bytes.Buffer, indent int) { 24 | bf.WriteString(strings.Repeat(defaultIndentString, indent)) 25 | } 26 | 27 | // unifyLineFeed unifies line feeds. 28 | func unifyLineFeed(s string) string { 29 | return strings.Replace(strings.Replace(s, "\r\n", "\n", -1), "\r", "\n", -1) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/yosssi/gohtml/writer.go: -------------------------------------------------------------------------------- 1 | package gohtml 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // A Writer represents a formatted HTML source codes writer. 9 | type Writer struct { 10 | writer io.Writer 11 | lastElement string 12 | bf *bytes.Buffer 13 | } 14 | 15 | // SetLastElement set the lastElement to the Writer. 16 | func (wr *Writer) SetLastElement(lastElement string) *Writer { 17 | wr.lastElement = lastElement 18 | return wr 19 | } 20 | 21 | // Write writes the parameter. 22 | func (wr *Writer) Write(p []byte) (n int, err error) { 23 | wr.bf.Write(p) 24 | if bytes.HasSuffix(p, []byte(wr.lastElement)) { 25 | return wr.writer.Write([]byte(Format(wr.bf.String()) + "\n")) 26 | } 27 | return 0, nil 28 | } 29 | 30 | // NewWriter generates a Writer and returns it. 31 | func NewWriter(wr io.Writer) *Writer { 32 | return &Writer{writer: wr, lastElement: defaultLastElement, bf: &bytes.Buffer{}} 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | DATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF 11 | GLOBL ·REDMASK51(SB), 8, $8 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html 7 | package curve25519 // import "golang.org/x/crypto/curve25519" 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/openpgp/canonical_text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package openpgp 6 | 7 | import "hash" 8 | 9 | // NewCanonicalTextHash reformats text written to it into the canonical 10 | // form and then applies the hash h. See RFC 4880, section 5.2.1. 11 | func NewCanonicalTextHash(h hash.Hash) hash.Hash { 12 | return &canonicalTextHash{h, 0} 13 | } 14 | 15 | type canonicalTextHash struct { 16 | h hash.Hash 17 | s int 18 | } 19 | 20 | var newline = []byte{'\r', '\n'} 21 | 22 | func (cth *canonicalTextHash) Write(buf []byte) (int, error) { 23 | start := 0 24 | 25 | for i, c := range buf { 26 | switch cth.s { 27 | case 0: 28 | if c == '\r' { 29 | cth.s = 1 30 | } else if c == '\n' { 31 | cth.h.Write(buf[start:i]) 32 | cth.h.Write(newline) 33 | start = i + 1 34 | } 35 | case 1: 36 | cth.s = 0 37 | } 38 | } 39 | 40 | cth.h.Write(buf[start:]) 41 | return len(buf), nil 42 | } 43 | 44 | func (cth *canonicalTextHash) Sum(in []byte) []byte { 45 | return cth.h.Sum(in) 46 | } 47 | 48 | func (cth *canonicalTextHash) Reset() { 49 | cth.h.Reset() 50 | cth.s = 0 51 | } 52 | 53 | func (cth *canonicalTextHash) Size() int { 54 | return cth.h.Size() 55 | } 56 | 57 | func (cth *canonicalTextHash) BlockSize() int { 58 | return cth.h.BlockSize() 59 | } 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | */ 18 | package ssh // import "golang.org/x/crypto/ssh" 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/mac.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | // Message authentication support 8 | 9 | import ( 10 | "crypto/hmac" 11 | "crypto/sha1" 12 | "crypto/sha256" 13 | "hash" 14 | ) 15 | 16 | type macMode struct { 17 | keySize int 18 | new func(key []byte) hash.Hash 19 | } 20 | 21 | // truncatingMAC wraps around a hash.Hash and truncates the output digest to 22 | // a given size. 23 | type truncatingMAC struct { 24 | length int 25 | hmac hash.Hash 26 | } 27 | 28 | func (t truncatingMAC) Write(data []byte) (int, error) { 29 | return t.hmac.Write(data) 30 | } 31 | 32 | func (t truncatingMAC) Sum(in []byte) []byte { 33 | out := t.hmac.Sum(in) 34 | return out[:len(in)+t.length] 35 | } 36 | 37 | func (t truncatingMAC) Reset() { 38 | t.hmac.Reset() 39 | } 40 | 41 | func (t truncatingMAC) Size() int { 42 | return t.length 43 | } 44 | 45 | func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } 46 | 47 | var macModes = map[string]*macMode{ 48 | "hmac-sha2-256": {32, func(key []byte) hash.Hash { 49 | return hmac.New(sha256.New, key) 50 | }}, 51 | "hmac-sha1": {20, func(key []byte) hash.Hash { 52 | return hmac.New(sha1.New, key) 53 | }}, 54 | "hmac-sha1-96": {20, func(key []byte) hash.Hash { 55 | return truncatingMAC{12, hmac.New(sha1.New, key)} 56 | }}, 57 | } 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "syscall" 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | const ioctlWriteTermios = syscall.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | // These constants are declared here, rather than importing 8 | // them from the syscall package as some syscall packages, even 9 | // on linux, for example gccgo, do not declare them. 10 | const ioctlReadTermios = 0x5401 // syscall.TCGETS 11 | const ioctlWriteTermios = 0x5402 // syscall.TCSETS 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This package contains integration tests for the 6 | // golang.org/x/crypto/ssh package. 7 | package test // import "golang.org/x/crypto/ssh/test" 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/cases/fold.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cases 6 | 7 | import "golang.org/x/text/transform" 8 | 9 | type caseFolder struct{ transform.NopResetter } 10 | 11 | // caseFolder implements the Transformer interface for doing case folding. 12 | func (t *caseFolder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { 13 | c := context{dst: dst, src: src, atEOF: atEOF} 14 | for c.next() { 15 | foldFull(&c) 16 | c.checkpoint() 17 | } 18 | return c.ret() 19 | } 20 | 21 | func (t *caseFolder) Span(src []byte, atEOF bool) (n int, err error) { 22 | c := context{src: src, atEOF: atEOF} 23 | for c.next() && isFoldFull(&c) { 24 | c.checkpoint() 25 | } 26 | return c.retSpan() 27 | } 28 | 29 | func makeFold(o options) transform.SpanningTransformer { 30 | // TODO: Special case folding, through option Language, Special/Turkic, or 31 | // both. 32 | // TODO: Implement Compact options. 33 | return &caseFolder{} 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/japanese/all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package japanese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{EUCJP, ISO2022JP, ShiftJIS} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/simplifiedchinese/all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package simplifiedchinese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{GB18030, GBK, HZGB2312} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/common.go: -------------------------------------------------------------------------------- 1 | // This file was generated by go generate; DO NOT EDIT 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // langAliasType is the type of an alias in langAliasMap. 8 | type langAliasType int8 9 | 10 | const ( 11 | langDeprecated langAliasType = iota 12 | langMacro 13 | langLegacy 14 | 15 | langAliasTypeUnknown langAliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/gen_common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | // This file contains code common to the maketables.go and the package code. 10 | 11 | // langAliasType is the type of an alias in langAliasMap. 12 | type langAliasType int8 13 | 14 | const ( 15 | langDeprecated langAliasType = iota 16 | langMacro 17 | langLegacy 18 | 19 | langAliasTypeUnknown langAliasType = -1 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/precis/class.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package precis 6 | 7 | import ( 8 | "unicode/utf8" 9 | ) 10 | 11 | // TODO: Add contextual character rules from Appendix A of RFC5892. 12 | 13 | // A class is a set of characters that match certain derived properties. The 14 | // PRECIS framework defines two classes: The Freeform class and the Identifier 15 | // class. The freeform class should be used for profiles where expressiveness is 16 | // prioritized over safety such as nicknames or passwords. The identifier class 17 | // should be used for profiles where safety is the first priority such as 18 | // addressable network labels and usernames. 19 | type class struct { 20 | validFrom property 21 | } 22 | 23 | // Contains satisfies the runes.Set interface and returns whether the given rune 24 | // is a member of the class. 25 | func (c class) Contains(r rune) bool { 26 | b := make([]byte, 4) 27 | n := utf8.EncodeRune(b, r) 28 | 29 | trieval, _ := dpTrie.lookup(b[:n]) 30 | return c.validFrom <= property(trieval) 31 | } 32 | 33 | var ( 34 | identifier = &class{validFrom: pValid} 35 | freeform = &class{validFrom: idDisOrFreePVal} 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/precis/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package precis contains types and functions for the preparation, 6 | // enforcement, and comparison of internationalized strings ("PRECIS") as 7 | // defined in RFC 7564. It also contains several pre-defined profiles for 8 | // passwords, nicknames, and usernames as defined in RFC 7613 and RFC 7700. 9 | // 10 | // BE ADVISED: This package is under construction and the API may change in 11 | // backwards incompatible ways and without notice. 12 | package precis // import "golang.org/x/text/secure/precis" 13 | 14 | //go:generate go run gen.go gen_trieval.go 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/precis/transformer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package precis 6 | 7 | import "golang.org/x/text/transform" 8 | 9 | // Transformer implements the transform.Transformer interface. 10 | type Transformer struct { 11 | t transform.Transformer 12 | } 13 | 14 | // Reset implements the transform.Transformer interface. 15 | func (t Transformer) Reset() { t.t.Reset() } 16 | 17 | // Transform implements the transform.Transformer interface. 18 | func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { 19 | return t.t.Transform(dst, src, atEOF) 20 | } 21 | 22 | // Bytes returns a new byte slice with the result of applying t to b. 23 | func (t Transformer) Bytes(b []byte) []byte { 24 | b, _, _ = transform.Bytes(t, b) 25 | return b 26 | } 27 | 28 | // String returns a string with the result of applying t to s. 29 | func (t Transformer) String(s string) string { 30 | s, _, _ = transform.String(t, s) 31 | return s 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/trie.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/gen_trieval.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | // elem is an entry of the width trie. The high byte is used to encode the type 10 | // of the rune. The low byte is used to store the index to a mapping entry in 11 | // the inverseData array. 12 | type elem uint16 13 | 14 | const ( 15 | tagNeutral elem = iota << typeShift 16 | tagAmbiguous 17 | tagWide 18 | tagNarrow 19 | tagFullwidth 20 | tagHalfwidth 21 | ) 22 | 23 | const ( 24 | numTypeBits = 3 25 | typeShift = 16 - numTypeBits 26 | 27 | // tagNeedsFold is true for all fullwidth and halfwidth runes except for 28 | // the Won sign U+20A9. 29 | tagNeedsFold = 0x1000 30 | 31 | // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide 32 | // variant. 33 | wonSign rune = 0x20A9 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/kind_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Kind"; DO NOT EDIT 2 | 3 | package width 4 | 5 | import "fmt" 6 | 7 | const _Kind_name = "NeutralEastAsianAmbiguousEastAsianWideEastAsianNarrowEastAsianFullwidthEastAsianHalfwidth" 8 | 9 | var _Kind_index = [...]uint8{0, 7, 25, 38, 53, 71, 89} 10 | 11 | func (i Kind) String() string { 12 | if i < 0 || i >= Kind(len(_Kind_index)-1) { 13 | return fmt.Sprintf("Kind(%d)", i) 14 | } 15 | return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/trieval.go: -------------------------------------------------------------------------------- 1 | // This file was generated by go generate; DO NOT EDIT 2 | 3 | package width 4 | 5 | // elem is an entry of the width trie. The high byte is used to encode the type 6 | // of the rune. The low byte is used to store the index to a mapping entry in 7 | // the inverseData array. 8 | type elem uint16 9 | 10 | const ( 11 | tagNeutral elem = iota << typeShift 12 | tagAmbiguous 13 | tagWide 14 | tagNarrow 15 | tagFullwidth 16 | tagHalfwidth 17 | ) 18 | 19 | const ( 20 | numTypeBits = 3 21 | typeShift = 16 - numTypeBits 22 | 23 | // tagNeedsFold is true for all fullwidth and halfwidth runes except for 24 | // the Won sign U+20A9. 25 | tagNeedsFold = 0x1000 26 | 27 | // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide 28 | // variant. 29 | wonSign rune = 0x20A9 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | --------------------------------------------------------------------------------