├── .circleci └── config.yml ├── .clang-format ├── .gitignore ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── Makefile ├── README.md ├── cmd └── clang-server │ └── main.go ├── compilationdatabase ├── compilationdatabase.go ├── compilationdatabase_test.go └── testdata │ ├── builddir │ └── build │ │ └── compile_commands.json │ ├── parent │ └── compile_commands.json │ ├── pathRange │ └── json │ │ └── compile_commands.json │ ├── root │ └── compile_commands.json │ └── specified_filename │ └── build │ └── specified_filename.json ├── docs ├── clang.md └── libclang.md ├── indexdb └── indexdb.go ├── internal ├── hashutil │ ├── benchmark_test.go │ ├── hashutil.go │ └── hashutil_test.go ├── log │ └── log.go ├── pathutil │ └── pathutil.go └── symbol │ ├── Caller.go │ ├── Clang_grpc.go │ ├── CodeCompleteResults.go │ ├── CompleteItem.go │ ├── File.go │ ├── Header.go │ ├── Info.go │ └── Location.go ├── mk └── static.mk ├── parser ├── builtinheader │ ├── bindata_3.9.1.go │ ├── bindata_4.0.0.go │ └── bindata_5.0.0.go ├── debug.go ├── parser.go ├── print.go └── worker.go ├── rpc └── rpc.go ├── symbol ├── id.go ├── schema.fbs ├── symbol.go └── type.go └── vendor ├── github.com ├── davecgh │ └── go-spew │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cov_report.sh │ │ ├── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── common_test.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── dump_test.go │ │ ├── dumpcgo_test.go │ │ ├── dumpnocgo_test.go │ │ ├── example_test.go │ │ ├── format.go │ │ ├── format_test.go │ │ ├── internal_test.go │ │ ├── internalunsafe_test.go │ │ ├── spew.go │ │ └── spew_test.go │ │ └── test_coverage.txt ├── go-clang │ └── v3.9 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ └── clang │ │ ├── accessspecifier_gen.go │ │ ├── availabilitykind_gen.go │ │ ├── callingconv_gen.go │ │ ├── cgoflags.go │ │ ├── cgoflags_dynamic.go │ │ ├── cgoflags_static.go │ │ ├── childvisitresult_gen.go │ │ ├── clang-c │ │ ├── BuildSystem.h │ │ ├── CXCompilationDatabase.h │ │ ├── CXErrorCode.h │ │ ├── CXString.h │ │ ├── Documentation.h │ │ ├── Index.h │ │ └── Platform.h │ │ ├── clang_gen.go │ │ ├── clang_test.go │ │ ├── clientdata_gen.go │ │ ├── codecomplete_flags_gen.go │ │ ├── codecompleteresults.go │ │ ├── codecompleteresults_gen.go │ │ ├── comment_gen.go │ │ ├── commentinlinecommandrenderkind_gen.go │ │ ├── commentkind_gen.go │ │ ├── commentparampassdirection_gen.go │ │ ├── compilationdatabase_error_gen.go │ │ ├── compilationdatabase_gen.go │ │ ├── compilationdatabase_test.go │ │ ├── compilecommand_gen.go │ │ ├── compilecommands_gen.go │ │ ├── completion_test.go │ │ ├── completionchunkkind_gen.go │ │ ├── completioncontext_gen.go │ │ ├── completionresult_gen.go │ │ ├── completionstring_gen.go │ │ ├── cursor.c │ │ ├── cursor.go │ │ ├── cursor_gen.go │ │ ├── cursorandrangevisitor_gen.go │ │ ├── cursorkind_gen.go │ │ ├── cursorset_gen.go │ │ ├── cxstring.go │ │ ├── declqualifierkind_gen.go │ │ ├── diagnostic_gen.go │ │ ├── diagnosticdisplayoptions_gen.go │ │ ├── diagnostics_test.go │ │ ├── diagnosticset_gen.go │ │ ├── diagnosticseverity_gen.go │ │ ├── doc.go │ │ ├── errorcode_gen.go │ │ ├── evalresult_gen.go │ │ ├── evalresultkind_gen.go │ │ ├── file_gen.go │ │ ├── fileuniqueid_gen.go │ │ ├── globaloptflags_gen.go │ │ ├── go-clang.h │ │ ├── idxattrinfo_gen.go │ │ ├── idxattrkind_gen.go │ │ ├── idxbaseclassinfo_gen.go │ │ ├── idxclientastfile_gen.go │ │ ├── idxclientcontainer_gen.go │ │ ├── idxcliententity_gen.go │ │ ├── idxclientfile_gen.go │ │ ├── idxcontainerinfo_gen.go │ │ ├── idxcxxclassdeclinfo_gen.go │ │ ├── idxdeclinfo_gen.go │ │ ├── idxdeclinfoflags_gen.go │ │ ├── idxentitycxxtemplatekind_gen.go │ │ ├── idxentityinfo_gen.go │ │ ├── idxentitykind_gen.go │ │ ├── idxentitylanguage_gen.go │ │ ├── idxentityrefinfo_gen.go │ │ ├── idxentityrefkind_gen.go │ │ ├── idxiboutletcollectionattrinfo_gen.go │ │ ├── idximportedastfileinfo_gen.go │ │ ├── idxincludedfileinfo_gen.go │ │ ├── idxloc_gen.go │ │ ├── idxobjccategorydeclinfo_gen.go │ │ ├── idxobjccontainerdeclinfo_gen.go │ │ ├── idxobjccontainerkind_gen.go │ │ ├── idxobjcinterfacedeclinfo_gen.go │ │ ├── idxobjcpropertydeclinfo_gen.go │ │ ├── idxobjcprotocolrefinfo_gen.go │ │ ├── idxobjcprotocolreflistinfo_gen.go │ │ ├── index_gen.go │ │ ├── indexaction_gen.go │ │ ├── indexercallbacks_gen.go │ │ ├── indexoptflags_gen.go │ │ ├── languagekind_gen.go │ │ ├── linkagekind_gen.go │ │ ├── loaddiag_error_gen.go │ │ ├── module_gen.go │ │ ├── modulemapdescriptor_gen.go │ │ ├── namerefflags_gen.go │ │ ├── platformavailability_gen.go │ │ ├── propertyattrkind_gen.go │ │ ├── refqualifierkind_gen.go │ │ ├── remapping_gen.go │ │ ├── reparse_flags_gen.go │ │ ├── result_gen.go │ │ ├── saveerror_gen.go │ │ ├── savetranslationunit_flags_gen.go │ │ ├── sourcelocation_gen.go │ │ ├── sourcerange_gen.go │ │ ├── sourcerangelist_gen.go │ │ ├── storageclass_gen.go │ │ ├── string_gen.go │ │ ├── stringset_gen.go │ │ ├── templateargumentkind_gen.go │ │ ├── token_gen.go │ │ ├── tokenkind_gen.go │ │ ├── translationunit.go │ │ ├── translationunit_flags_gen.go │ │ ├── translationunit_gen.go │ │ ├── turesourceusage_gen.go │ │ ├── turesourceusageentry_gen.go │ │ ├── turesourceusagekind_gen.go │ │ ├── type_gen.go │ │ ├── typekind_gen.go │ │ ├── typelayouterror_gen.go │ │ ├── unsavedfile.go │ │ ├── unsavedfile_gen.go │ │ ├── version_gen.go │ │ ├── virtualfileoverlay_gen.go │ │ ├── visibilitykind_gen.go │ │ └── visitorresult_gen.go ├── golang │ ├── protobuf │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Make.protobuf │ │ ├── Makefile │ │ ├── README.md │ │ ├── proto │ │ │ ├── Makefile │ │ │ ├── all_test.go │ │ │ ├── any_test.go │ │ │ ├── clone.go │ │ │ ├── clone_test.go │ │ │ ├── decode.go │ │ │ ├── decode_test.go │ │ │ ├── encode.go │ │ │ ├── encode_test.go │ │ │ ├── equal.go │ │ │ ├── equal_test.go │ │ │ ├── extensions.go │ │ │ ├── extensions_test.go │ │ │ ├── lib.go │ │ │ ├── map_test.go │ │ │ ├── message_set.go │ │ │ ├── message_set_test.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── proto3_test.go │ │ │ ├── size2_test.go │ │ │ ├── size_test.go │ │ │ ├── text.go │ │ │ ├── text_parser.go │ │ │ ├── text_parser_test.go │ │ │ └── text_test.go │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── any_test.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration_test.go │ │ │ ├── regen.sh │ │ │ ├── timestamp.go │ │ │ └── timestamp_test.go │ └── snappy │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ ├── golden_test.go │ │ ├── snappy.go │ │ └── snappy_test.go ├── google │ └── flatbuffers │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.txt │ │ ├── appveyor.yml │ │ ├── biicode.conf │ │ ├── composer.json │ │ ├── go │ │ ├── builder.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── grpc.go │ │ ├── lib.go │ │ ├── sizes.go │ │ ├── struct.go │ │ └── table.go │ │ ├── package.json │ │ ├── pom.xml │ │ └── readme.md ├── minio │ └── blake2b-simd │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── benchmarks_test.go │ │ ├── blake2b.go │ │ ├── blake2b_test.go │ │ ├── compressAvx2_amd64.go │ │ ├── compressAvx2_amd64.s │ │ ├── compressAvx_amd64.go │ │ ├── compressAvx_amd64.s │ │ ├── compressSse_amd64.go │ │ ├── compressSse_amd64.s │ │ ├── compress_amd64.go │ │ ├── compress_generic.go │ │ ├── compress_noasm.go │ │ ├── cpuid.go │ │ ├── cpuid_386.s │ │ └── cpuid_amd64.s ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── bench_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── example_test.go │ │ ├── format_test.go │ │ ├── stack.go │ │ └── stack_test.go ├── pkgutil │ ├── osutil │ │ ├── .appveyor.yml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── circle.yml │ │ ├── doc.go │ │ ├── osutil.go │ │ └── osutil_test.go │ └── stringsutil │ │ ├── .appveyor.yml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── circle.yml │ │ └── stringsutil.go ├── syndtr │ └── goleveldb │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── leveldb │ │ ├── batch.go │ │ ├── batch_test.go │ │ ├── bench_test.go │ │ ├── cache │ │ ├── bench_test.go │ │ ├── cache.go │ │ ├── cache_test.go │ │ └── lru.go │ │ ├── comparer.go │ │ ├── comparer │ │ ├── bytes_comparer.go │ │ └── comparer.go │ │ ├── corrupt_test.go │ │ ├── db.go │ │ ├── db_compaction.go │ │ ├── db_iter.go │ │ ├── db_snapshot.go │ │ ├── db_state.go │ │ ├── db_test.go │ │ ├── db_transaction.go │ │ ├── db_util.go │ │ ├── db_write.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── errors │ │ └── errors.go │ │ ├── external_test.go │ │ ├── filter.go │ │ ├── filter │ │ ├── bloom.go │ │ ├── bloom_test.go │ │ └── filter.go │ │ ├── iterator │ │ ├── array_iter.go │ │ ├── array_iter_test.go │ │ ├── indexed_iter.go │ │ ├── indexed_iter_test.go │ │ ├── iter.go │ │ ├── iter_suite_test.go │ │ ├── merged_iter.go │ │ └── merged_iter_test.go │ │ ├── journal │ │ ├── journal.go │ │ └── journal_test.go │ │ ├── key.go │ │ ├── key_test.go │ │ ├── leveldb_suite_test.go │ │ ├── memdb │ │ ├── bench_test.go │ │ ├── memdb.go │ │ ├── memdb_suite_test.go │ │ └── memdb_test.go │ │ ├── opt │ │ └── options.go │ │ ├── options.go │ │ ├── session.go │ │ ├── session_compaction.go │ │ ├── session_record.go │ │ ├── session_record_test.go │ │ ├── session_util.go │ │ ├── storage │ │ ├── file_storage.go │ │ ├── file_storage_nacl.go │ │ ├── file_storage_plan9.go │ │ ├── file_storage_solaris.go │ │ ├── file_storage_test.go │ │ ├── file_storage_unix.go │ │ ├── file_storage_windows.go │ │ ├── mem_storage.go │ │ ├── mem_storage_test.go │ │ └── storage.go │ │ ├── table.go │ │ ├── table │ │ ├── block_test.go │ │ ├── reader.go │ │ ├── table.go │ │ ├── table_suite_test.go │ │ ├── table_test.go │ │ └── writer.go │ │ ├── testutil_test.go │ │ ├── util.go │ │ ├── util │ │ ├── buffer.go │ │ ├── buffer_pool.go │ │ ├── buffer_test.go │ │ ├── crc32.go │ │ ├── hash.go │ │ ├── hash_test.go │ │ ├── range.go │ │ └── util.go │ │ ├── version.go │ │ └── version_test.go ├── tmthrgd │ ├── asm │ │ ├── LICENSE │ │ ├── asm.go │ │ ├── opcode.go │ │ └── opcode_gen.go │ └── go-hex │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── asm_gen.go │ │ ├── hex.go │ │ ├── hex_amd64.go │ │ ├── hex_decode_amd64.s │ │ ├── hex_encode_amd64.s │ │ ├── hex_other.go │ │ └── hex_test.go └── zchee │ └── go-xdgbasedir │ ├── .appveyor.yml │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── circle.yml │ ├── home │ ├── doc.go │ ├── home_test.go │ ├── home_unix.go │ └── home_windows.go │ ├── xdgbasedir.go │ ├── xdgbasedir_darwin.go │ ├── xdgbasedir_test.go │ ├── xdgbasedir_unix.go │ └── xdgbasedir_windows.go ├── golang.org └── x │ ├── net │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ ├── context │ │ ├── context.go │ │ ├── context_test.go │ │ ├── go17.go │ │ ├── pre_go17.go │ │ └── withtimeout_test.go │ ├── http2 │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README │ │ ├── ciphers.go │ │ ├── ciphers_test.go │ │ ├── client_conn_pool.go │ │ ├── configure_transport.go │ │ ├── databuffer.go │ │ ├── databuffer_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── flow.go │ │ ├── flow_test.go │ │ ├── frame.go │ │ ├── frame_test.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── go17_not18.go │ │ ├── go18.go │ │ ├── go18_test.go │ │ ├── go19.go │ │ ├── go19_test.go │ │ ├── gotrack.go │ │ ├── gotrack_test.go │ │ ├── headermap.go │ │ ├── hpack │ │ │ ├── encode.go │ │ │ ├── encode_test.go │ │ │ ├── hpack.go │ │ │ ├── hpack_test.go │ │ │ ├── huffman.go │ │ │ ├── tables.go │ │ │ └── tables_test.go │ │ ├── http2.go │ │ ├── http2_test.go │ │ ├── not_go16.go │ │ ├── not_go17.go │ │ ├── not_go18.go │ │ ├── not_go19.go │ │ ├── pipe.go │ │ ├── pipe_test.go │ │ ├── server.go │ │ ├── server_push_test.go │ │ ├── server_test.go │ │ ├── transport.go │ │ ├── transport_test.go │ │ ├── write.go │ │ ├── writesched.go │ │ ├── writesched_priority.go │ │ ├── writesched_priority_test.go │ │ ├── writesched_random.go │ │ ├── writesched_random_test.go │ │ ├── writesched_test.go │ │ └── z_spec_test.go │ ├── idna │ │ ├── example_test.go │ │ ├── idna.go │ │ ├── idna_test.go │ │ ├── punycode.go │ │ ├── punycode_test.go │ │ ├── tables.go │ │ ├── trie.go │ │ └── trieval.go │ ├── internal │ │ └── timeseries │ │ │ ├── timeseries.go │ │ │ └── timeseries_test.go │ ├── lex │ │ └── httplex │ │ │ ├── httplex.go │ │ │ └── httplex_test.go │ └── trace │ │ ├── events.go │ │ ├── histogram.go │ │ ├── histogram_test.go │ │ ├── trace.go │ │ ├── trace_go16.go │ │ ├── trace_go17.go │ │ └── trace_test.go │ └── text │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ ├── doc.go │ ├── gen.go │ ├── internal │ ├── gen.go │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── gen_test.go │ ├── internal.go │ ├── internal_test.go │ ├── match.go │ ├── match_test.go │ ├── tables.go │ ├── triegen │ │ ├── compact.go │ │ ├── data_test.go │ │ ├── example_compact_test.go │ │ ├── example_test.go │ │ ├── gen_test.go │ │ ├── print.go │ │ └── triegen.go │ └── ucd │ │ ├── example_test.go │ │ ├── ucd.go │ │ └── ucd_test.go │ ├── secure │ ├── bidirule │ │ ├── bench_test.go │ │ ├── bidirule.go │ │ └── bidirule_test.go │ └── doc.go │ ├── transform │ ├── examples_test.go │ ├── transform.go │ └── transform_test.go │ └── unicode │ ├── bidi │ ├── bidi.go │ ├── bracket.go │ ├── core.go │ ├── core_test.go │ ├── gen.go │ ├── gen_ranges.go │ ├── gen_trieval.go │ ├── prop.go │ ├── ranges_test.go │ ├── tables.go │ ├── tables_test.go │ └── trieval.go │ ├── cldr │ ├── base.go │ ├── cldr.go │ ├── cldr_test.go │ ├── collate.go │ ├── collate_test.go │ ├── data_test.go │ ├── decode.go │ ├── examples_test.go │ ├── makexml.go │ ├── resolve.go │ ├── resolve_test.go │ ├── slice.go │ ├── slice_test.go │ └── xml.go │ ├── doc.go │ ├── norm │ ├── composition.go │ ├── composition_test.go │ ├── example_iter_test.go │ ├── example_test.go │ ├── forminfo.go │ ├── forminfo_test.go │ ├── input.go │ ├── iter.go │ ├── iter_test.go │ ├── maketables.go │ ├── norm_test.go │ ├── normalize.go │ ├── normalize_test.go │ ├── readwriter.go │ ├── readwriter_test.go │ ├── tables.go │ ├── transform.go │ ├── transform_test.go │ ├── trie.go │ ├── triegen.go │ └── ucd_test.go │ └── rangetable │ ├── gen.go │ ├── merge.go │ ├── merge_test.go │ ├── rangetable.go │ ├── rangetable_test.go │ └── tables.go └── google.golang.org ├── genproto ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── googleapis │ └── rpc │ │ └── status │ │ └── status.pb.go ├── regen.go └── regen.sh └── grpc ├── .travis.yml ├── AUTHORS ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── backoff.go ├── backoff_test.go ├── balancer.go ├── balancer_test.go ├── call.go ├── call_test.go ├── clientconn.go ├── clientconn_test.go ├── codec.go ├── codec_benchmark_test.go ├── codec_test.go ├── codegen.sh ├── codes ├── code_string.go └── codes.go ├── coverage.sh ├── credentials ├── credentials.go ├── credentials_test.go ├── credentials_util_go17.go ├── credentials_util_go18.go └── credentials_util_pre_go17.go ├── doc.go ├── go16.go ├── go17.go ├── grpclb.go ├── grpclb ├── grpc_lb_v1 │ ├── grpclb.pb.go │ └── grpclb.proto ├── grpclb_server_generated.go └── grpclb_test.go ├── grpclog ├── grpclog.go ├── logger.go ├── loggerv2.go └── loggerv2_test.go ├── interceptor.go ├── internal └── internal.go ├── keepalive └── keepalive.go ├── metadata ├── metadata.go └── metadata_test.go ├── naming └── naming.go ├── peer └── peer.go ├── proxy.go ├── proxy_test.go ├── rpc_util.go ├── rpc_util_test.go ├── server.go ├── server_test.go ├── stats ├── handlers.go ├── stats.go └── stats_test.go ├── status ├── status.go └── status_test.go ├── stream.go ├── tap └── tap.go ├── trace.go └── transport ├── control.go ├── go16.go ├── go17.go ├── handler_server.go ├── handler_server_test.go ├── http2_client.go ├── http2_server.go ├── http_util.go ├── http_util_test.go ├── transport.go └── transport_test.go /.gitignore: -------------------------------------------------------------------------------- 1 | # github/gitignore/Go.gitignore 2 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 3 | *.o 4 | *.a 5 | *.so 6 | 7 | # Folders 8 | _obj 9 | _test 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | 27 | # Output of the go coverage tool, specifically when used with LiteIDE 28 | *.out 29 | 30 | # github/gitignore/C.gitignore 31 | # Prerequisites 32 | *.d 33 | 34 | # Object files 35 | *.o 36 | *.ko 37 | *.obj 38 | *.elf 39 | 40 | # Liker output 41 | *.ilk 42 | *.map 43 | *.exp 44 | 45 | # Precompiled Headers 46 | *.gch 47 | *.pch 48 | 49 | # Libraries 50 | *.lib 51 | *.a 52 | *.la 53 | *.lo 54 | 55 | # Shared objects (ic. Widows DLLs) 56 | *.dll 57 | *.so 58 | *.so.* 59 | *.dylib 60 | 61 | # Executables 62 | *.exe 63 | *.out 64 | *.app 65 | *.i*86 66 | *.x86_64 67 | *.hex 68 | 69 | # Debug files 70 | *.dSYM/ 71 | *.su 72 | *.idb 73 | *.pdb 74 | 75 | # Kerel Module Compile Results 76 | *.mod* 77 | *.cmd 78 | modules.order 79 | Module.symvers 80 | Mkfile.old 81 | dkms.cof 82 | 83 | # binary 84 | bin/* 85 | 86 | # clang builtin header 87 | parser/builtinheader/include 88 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | [[constraint]] 2 | branch = "master" 3 | name = "github.com/davecgh/go-spew" 4 | 5 | [[constraint]] 6 | branch = "master" 7 | name = "github.com/go-clang/v3.9" 8 | 9 | [[constraint]] 10 | branch = "master" 11 | name = "github.com/google/flatbuffers" 12 | 13 | [[constraint]] 14 | branch = "master" 15 | name = "github.com/minio/blake2b-simd" 16 | 17 | [[constraint]] 18 | branch = "master" 19 | name = "github.com/pkg/errors" 20 | 21 | [[constraint]] 22 | branch = "master" 23 | name = "github.com/pkgutil/osutil" 24 | 25 | [[constraint]] 26 | branch = "master" 27 | name = "github.com/pkgutil/stringsutil" 28 | 29 | [[constraint]] 30 | branch = "master" 31 | name = "github.com/syndtr/goleveldb" 32 | 33 | [[constraint]] 34 | branch = "master" 35 | name = "github.com/tmthrgd/go-hex" 36 | 37 | [[constraint]] 38 | branch = "master" 39 | name = "github.com/zchee/go-xdgbasedir" 40 | 41 | [[constraint]] 42 | branch = "master" 43 | name = "golang.org/x/net" 44 | 45 | [[constraint]] 46 | branch = "master" 47 | name = "google.golang.org/grpc" 48 | -------------------------------------------------------------------------------- /cmd/clang-server/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The clang-server 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 | "fmt" 10 | "os" 11 | 12 | "github.com/zchee/clang-server/parser" 13 | ) 14 | 15 | var ( 16 | root = flag.String("root", "", "parse project root directory.") 17 | path = flag.String("path", "", "parse project's compilation_database.json directory.") 18 | jobs = flag.Int("jobs", 0, "number of jobs") 19 | ) 20 | 21 | func main() { 22 | flag.Parse() 23 | if *path == "" { 24 | flag.PrintDefaults() 25 | os.Exit(1) 26 | } 27 | 28 | fmt.Printf("clang version: %s\n", parser.ClangVersion()) 29 | 30 | config := &parser.Config{ 31 | Root: *root, 32 | Jobs: *jobs, 33 | } 34 | p := parser.NewParser(*path, config) 35 | p.Parse() 36 | } 37 | -------------------------------------------------------------------------------- /compilationdatabase/testdata/builddir/build/compile_commands.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zchee/clang-server/53d10099a935081537062441d586ded381fe0e60/compilationdatabase/testdata/builddir/build/compile_commands.json -------------------------------------------------------------------------------- /compilationdatabase/testdata/parent/compile_commands.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zchee/clang-server/53d10099a935081537062441d586ded381fe0e60/compilationdatabase/testdata/parent/compile_commands.json -------------------------------------------------------------------------------- /compilationdatabase/testdata/pathRange/json/compile_commands.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zchee/clang-server/53d10099a935081537062441d586ded381fe0e60/compilationdatabase/testdata/pathRange/json/compile_commands.json -------------------------------------------------------------------------------- /compilationdatabase/testdata/root/compile_commands.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zchee/clang-server/53d10099a935081537062441d586ded381fe0e60/compilationdatabase/testdata/root/compile_commands.json -------------------------------------------------------------------------------- /compilationdatabase/testdata/specified_filename/build/specified_filename.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zchee/clang-server/53d10099a935081537062441d586ded381fe0e60/compilationdatabase/testdata/specified_filename/build/specified_filename.json -------------------------------------------------------------------------------- /internal/hashutil/hashutil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The clang-server 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 hashutil 6 | 7 | import ( 8 | "reflect" 9 | "unsafe" 10 | 11 | blake2b "github.com/minio/blake2b-simd" 12 | hex "github.com/tmthrgd/go-hex" 13 | ) 14 | 15 | // Size maximum digest size which same as blake2b.Size. 16 | const Size = blake2b.Size 17 | 18 | // NewHash converts the b to blake2b sum512 hash. 19 | func NewHash(b []byte) [Size]byte { 20 | return blake2b.Sum512(b) 21 | } 22 | 23 | // NewHashString converts the s to blake2b sum512 hash. 24 | func NewHashString(s string) [Size]byte { 25 | return blake2b.Sum512(stringToByteSlice(s)) 26 | } 27 | 28 | // EncodeToString returns the hexadecimal encoded string of blake2b hashed b. 29 | func EncodeToString(b []byte) string { 30 | return hex.EncodeToString(b) 31 | } 32 | 33 | // byteSliceToString converts the []byte to string without a heap allocation. 34 | func byteSliceToString(b []byte) string { 35 | return *(*string)(unsafe.Pointer(&reflect.StringHeader{ 36 | Data: uintptr(unsafe.Pointer(&b[0])), 37 | Len: len(b), 38 | })) 39 | } 40 | 41 | // stringToByteSlice converts the string to []byte without a heap allocation. 42 | func stringToByteSlice(s string) []byte { 43 | return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 44 | Len: len(s), 45 | Cap: len(s), 46 | Data: (*(*reflect.StringHeader)(unsafe.Pointer(&s))).Data, 47 | })) 48 | } 49 | -------------------------------------------------------------------------------- /parser/debug.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The clang-server 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 parser 6 | 7 | import ( 8 | "time" 9 | 10 | "github.com/zchee/clang-server/internal/log" 11 | ) 12 | 13 | func profile(start time.Time, name string) { 14 | elapsed := time.Since(start).Seconds() 15 | log.Debugf("%s: %fsec\n", name, elapsed) 16 | } 17 | -------------------------------------------------------------------------------- /symbol/id.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The clang-server 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 symbol 6 | 7 | import ( 8 | blake2b "github.com/minio/blake2b-simd" 9 | "github.com/zchee/clang-server/internal/hashutil" 10 | ) 11 | 12 | // ID id of cursor.USR with blake2b hash. 13 | type ID [blake2b.Size]byte 14 | 15 | func (id ID) String() string { 16 | return hashutil.EncodeToString(id[:]) 17 | } 18 | 19 | // Bytes reterun the ID byte slice. 20 | func (id ID) Bytes() []byte { 21 | return id[:] 22 | } 23 | 24 | // IsEmpty reports whether id is empty. 25 | func (id ID) IsEmpty() bool { 26 | return len(id) == 0 27 | } 28 | 29 | // FileID id of filename with blake2b hash. 30 | type FileID [blake2b.Size]byte 31 | 32 | func (id FileID) String() string { 33 | return hashutil.EncodeToString(id[:]) 34 | } 35 | 36 | // Bytes reterun the FileID byte slice. 37 | func (id FileID) Bytes() []byte { 38 | return id[:] 39 | } 40 | 41 | // IsEmpty reports whether id is empty. 42 | func (id FileID) IsEmpty() bool { 43 | return len(id) == 0 44 | } 45 | 46 | // ToID converts the string to blake2b sum512 hash. 47 | func ToID(s string) ID { 48 | return hashutil.NewHashString(s) 49 | } 50 | 51 | // ToFileID converts the string to blake2b sum512 hash. 52 | func ToFileID(s string) FileID { 53 | return hashutil.NewHashString(s) 54 | } 55 | -------------------------------------------------------------------------------- /symbol/symbol.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The clang-server 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 symbol 6 | 7 | import ( 8 | "github.com/go-clang/v3.9/clang" 9 | "github.com/zchee/clang-server/internal/symbol" 10 | "google.golang.org/grpc" 11 | ) 12 | 13 | // FromCursor return the location of symbol from cursor. 14 | func FromCursor(cursor clang.Cursor) Location { 15 | if cursor.IsNull() { 16 | return Location{} 17 | } 18 | 19 | usr := cursor.USR() 20 | if usr == "" && cursor.Kind() == clang.Cursor_MacroExpansion { 21 | usr = cursor.DisplayName() 22 | } 23 | 24 | file, line, col, offset := cursor.Location().FileLocation() 25 | 26 | return Location{ 27 | fileName: file.Name(), 28 | line: line, 29 | col: col, 30 | offset: offset, 31 | usr: usr, 32 | } 33 | } 34 | 35 | // NewClangClient retern the new symbol.ClangClient. 36 | func NewClangClient(cc *grpc.ClientConn) symbol.ClangClient { 37 | return symbol.NewClangClient(cc) 38 | } 39 | 40 | // RegisterClangServer register a service and its implementation to the gRPC server. 41 | func RegisterClangServer(s *grpc.Server, srv symbol.ClangServer) { 42 | symbol.RegisterClangServer(s, srv) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5.4 4 | - 1.6.3 5 | - 1.7 6 | install: 7 | - go get -v golang.org/x/tools/cmd/cover 8 | script: 9 | - go test -v -tags=safe ./spew 10 | - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov 11 | after_success: 12 | - go get -v github.com/mattn/goveralls 13 | - export PATH=$PATH:$HOME/gopath/bin 14 | - goveralls -coverprofile=profile.cov -service=travis-ci 15 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/cov_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script uses gocov to generate a test coverage report. 4 | # The gocov tool my be obtained with the following command: 5 | # go get github.com/axw/gocov/gocov 6 | # 7 | # It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. 8 | 9 | # Check for gocov. 10 | if ! type gocov >/dev/null 2>&1; then 11 | echo >&2 "This script requires the gocov tool." 12 | echo >&2 "You may obtain it with the following command:" 13 | echo >&2 "go get github.com/axw/gocov/gocov" 14 | exit 1 15 | fi 16 | 17 | # Only run the cgo tests if gcc is installed. 18 | if type gcc >/dev/null 2>&1; then 19 | (cd spew && gocov test -tags testcgo | gocov report) 20 | else 21 | (cd spew && gocov test | gocov report) 22 | fi 23 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when either cgo is not supported or "-tags testcgo" is not added to the go 17 | // test command line. This file intentionally does not setup any cgo tests in 18 | // this scenario. 19 | // +build !cgo !testcgo 20 | 21 | package spew_test 22 | 23 | func addCgoDumpTests() { 24 | // Don't add any tests for cgo since this file is only compiled when 25 | // there should not be any cgo tests. 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.7.1 4 | 5 | addons: 6 | apt: 7 | sources: 8 | - ubuntu-toolchain-r-test 9 | - llvm-toolchain-precise-3.9 10 | packages: 11 | - llvm-3.9 12 | - clang-3.9 13 | - libclang1-3.9 14 | - libclang-3.9-dev 15 | 16 | env: 17 | global: 18 | - CC=clang CXX=clang++ 19 | 20 | install: 21 | - mkdir -p /home/travis/bin 22 | - sudo ln -s /usr/bin/clang-3.9 /home/travis/bin/clang 23 | - sudo ln -s /usr/bin/llvm-config-3.9 /home/travis/bin/llvm-config 24 | - sudo ldconfig 25 | 26 | - llvm-config --version 27 | - llvm-config --includedir 28 | - llvm-config --libdir 29 | - clang --version 30 | 31 | - make install-dependencies 32 | - make install-tools 33 | 34 | script: 35 | # Install the project 36 | - make install 37 | 38 | # Test without any coverage 39 | - make test-full 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/AUTHORS: -------------------------------------------------------------------------------- 1 | See the go-clang AUTHORS file at https://github.com/go-clang/license/blob/master/AUTHORS. 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | See the go-clang CONTRIBUTORS file at https://github.com/go-clang/license/blob/master/CONTRIBUTORS. 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/LICENSE: -------------------------------------------------------------------------------- 1 | See the go-clang LICENSE file at https://github.com/go-clang/license/blob/master/LICENSE. 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all install install-dependencies install-tools test test-full test-verbose 2 | 3 | export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 4 | 5 | export CC := clang 6 | export CXX := clang++ 7 | 8 | ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) 9 | $(eval $(ARGS):;@:) # turn arguments into do-nothing targets 10 | export ARGS 11 | 12 | all: install test 13 | 14 | install: 15 | CGO_LDFLAGS="-L`llvm-config --libdir`" go install ./... 16 | install-dependencies: 17 | go get -u github.com/stretchr/testify/... 18 | install-tools: 19 | 20 | test: 21 | CGO_LDFLAGS="-L`llvm-config --libdir`" go test -timeout 60s ./... 22 | test-full: 23 | $(ROOT_DIR)/scripts/test-full.sh 24 | test-verbose: 25 | CGO_LDFLAGS="-L`llvm-config --libdir`" go test -timeout 60s -v ./... 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/accessspecifier_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Represents the C++ access control level to a base class for a cursor with kind CX_CXXBaseSpecifier. 9 | type AccessSpecifier uint32 10 | 11 | const ( 12 | AccessSpecifier_Invalid AccessSpecifier = C.CX_CXXInvalidAccessSpecifier 13 | AccessSpecifier_Public = C.CX_CXXPublic 14 | AccessSpecifier_Protected = C.CX_CXXProtected 15 | AccessSpecifier_Private = C.CX_CXXPrivate 16 | ) 17 | 18 | func (as AccessSpecifier) Spelling() string { 19 | switch as { 20 | case AccessSpecifier_Invalid: 21 | return "AccessSpecifier=Invalid" 22 | case AccessSpecifier_Public: 23 | return "AccessSpecifier=Public" 24 | case AccessSpecifier_Protected: 25 | return "AccessSpecifier=Protected" 26 | case AccessSpecifier_Private: 27 | return "AccessSpecifier=Private" 28 | } 29 | 30 | return fmt.Sprintf("AccessSpecifier unkown %d", int(as)) 31 | } 32 | 33 | func (as AccessSpecifier) String() string { 34 | return as.Spelling() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/availabilitykind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describes the availability of a particular entity, which indicates whether the use of this entity will result in a warning or error due to it being deprecated or unavailable. 9 | type AvailabilityKind uint32 10 | 11 | const ( 12 | // The entity is available. 13 | Availability_Available AvailabilityKind = C.CXAvailability_Available 14 | // The entity is available, but has been deprecated (and its use is not recommended). 15 | Availability_Deprecated = C.CXAvailability_Deprecated 16 | // The entity is not available; any use of it will be an error. 17 | Availability_NotAvailable = C.CXAvailability_NotAvailable 18 | // The entity is available, but not accessible; any use of it will be an error. 19 | Availability_NotAccessible = C.CXAvailability_NotAccessible 20 | ) 21 | 22 | func (ak AvailabilityKind) Spelling() string { 23 | switch ak { 24 | case Availability_Available: 25 | return "Availability=Available" 26 | case Availability_Deprecated: 27 | return "Availability=Deprecated" 28 | case Availability_NotAvailable: 29 | return "Availability=NotAvailable" 30 | case Availability_NotAccessible: 31 | return "Availability=NotAccessible" 32 | } 33 | 34 | return fmt.Sprintf("AvailabilityKind unkown %d", int(ak)) 35 | } 36 | 37 | func (ak AvailabilityKind) String() string { 38 | return ak.Spelling() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cgoflags.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #cgo CFLAGS: -I${SRCDIR} 4 | import "C" 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cgoflags_dynamic.go: -------------------------------------------------------------------------------- 1 | // +build !static 2 | 3 | package clang 4 | 5 | // #cgo LDFLAGS: -lclang 6 | import "C" 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cgoflags_static.go: -------------------------------------------------------------------------------- 1 | // +build static 2 | 3 | package clang 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/childvisitresult_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | /* 9 | Describes how the traversal of the children of a particular 10 | cursor should proceed after visiting a particular child cursor. 11 | 12 | A value of this enumeration type should be returned by each 13 | CXCursorVisitor to indicate how clang_visitChildren() proceed. 14 | */ 15 | type ChildVisitResult uint32 16 | 17 | const ( 18 | // Terminates the cursor traversal. 19 | ChildVisit_Break ChildVisitResult = C.CXChildVisit_Break 20 | // Continues the cursor traversal with the next sibling of the cursor just visited, without visiting its children. 21 | ChildVisit_Continue = C.CXChildVisit_Continue 22 | // Recursively traverse the children of this cursor, using the same visitor and client data. 23 | ChildVisit_Recurse = C.CXChildVisit_Recurse 24 | ) 25 | 26 | func (cvr ChildVisitResult) Spelling() string { 27 | switch cvr { 28 | case ChildVisit_Break: 29 | return "ChildVisit=Break" 30 | case ChildVisit_Continue: 31 | return "ChildVisit=Continue" 32 | case ChildVisit_Recurse: 33 | return "ChildVisit=Recurse" 34 | } 35 | 36 | return fmt.Sprintf("ChildVisitResult unkown %d", int(cvr)) 37 | } 38 | 39 | func (cvr ChildVisitResult) String() string { 40 | return cvr.Spelling() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/clientdata_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Opaque pointer representing client data that will be passed through to various callbacks and visitors. 8 | type ClientData struct { 9 | c C.CXClientData 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/codecomplete_flags_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | /* 9 | Flags that can be passed to clang_codeCompleteAt() to 10 | modify its behavior. 11 | 12 | The enumerators in this enumeration can be bitwise-OR'd together to 13 | provide multiple options to clang_codeCompleteAt(). 14 | */ 15 | type CodeComplete_Flags uint32 16 | 17 | const ( 18 | // Whether to include macros within the set of code completions returned. 19 | CodeComplete_IncludeMacros CodeComplete_Flags = C.CXCodeComplete_IncludeMacros 20 | // Whether to include code patterns for language constructs within the set of code completions, e.g., for loops. 21 | CodeComplete_IncludeCodePatterns = C.CXCodeComplete_IncludeCodePatterns 22 | // Whether to include brief documentation within the set of code completions returned. 23 | CodeComplete_IncludeBriefComments = C.CXCodeComplete_IncludeBriefComments 24 | ) 25 | 26 | func (ccf CodeComplete_Flags) Spelling() string { 27 | switch ccf { 28 | case CodeComplete_IncludeMacros: 29 | return "CodeComplete=IncludeMacros" 30 | case CodeComplete_IncludeCodePatterns: 31 | return "CodeComplete=IncludeCodePatterns" 32 | case CodeComplete_IncludeBriefComments: 33 | return "CodeComplete=IncludeBriefComments" 34 | } 35 | 36 | return fmt.Sprintf("CodeComplete_Flags unkown %d", int(ccf)) 37 | } 38 | 39 | func (ccf CodeComplete_Flags) String() string { 40 | return ccf.Spelling() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/codecompleteresults.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | func (ccr *CodeCompleteResults) Diagnostics() []Diagnostic { // TODO this can be generated https://github.com/go-clang/gen/issues/47 4 | s := make([]Diagnostic, ccr.NumDiagnostics()) 5 | 6 | for i := range s { 7 | s[i] = ccr.Diagnostic(uint32(i)) 8 | } 9 | 10 | return s 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/commentparampassdirection_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Documentation.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describes parameter passing direction for \Parameter or \\arg command. 9 | type CommentParamPassDirection uint32 10 | 11 | const ( 12 | // The parameter is an input parameter. 13 | CommentParamPassDirection_In CommentParamPassDirection = C.CXCommentParamPassDirection_In 14 | // The parameter is an output parameter. 15 | CommentParamPassDirection_Out = C.CXCommentParamPassDirection_Out 16 | // The parameter is an input and output parameter. 17 | CommentParamPassDirection_InOut = C.CXCommentParamPassDirection_InOut 18 | ) 19 | 20 | func (cppd CommentParamPassDirection) Spelling() string { 21 | switch cppd { 22 | case CommentParamPassDirection_In: 23 | return "CommentParamPassDirection=In" 24 | case CommentParamPassDirection_Out: 25 | return "CommentParamPassDirection=Out" 26 | case CommentParamPassDirection_InOut: 27 | return "CommentParamPassDirection=InOut" 28 | } 29 | 30 | return fmt.Sprintf("CommentParamPassDirection unkown %d", int(cppd)) 31 | } 32 | 33 | func (cppd CommentParamPassDirection) String() string { 34 | return cppd.Spelling() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/compilationdatabase_error_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/CXCompilationDatabase.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Error codes for Compilation Database 9 | type CompilationDatabase_Error int32 10 | 11 | const ( 12 | CompilationDatabase_NoError CompilationDatabase_Error = C.CXCompilationDatabase_NoError 13 | CompilationDatabase_CanNotLoadDatabase = C.CXCompilationDatabase_CanNotLoadDatabase 14 | ) 15 | 16 | func (cde CompilationDatabase_Error) Spelling() string { 17 | switch cde { 18 | case CompilationDatabase_NoError: 19 | return "CompilationDatabase=NoError" 20 | case CompilationDatabase_CanNotLoadDatabase: 21 | return "CompilationDatabase=CanNotLoadDatabase" 22 | } 23 | 24 | return fmt.Sprintf("CompilationDatabase_Error unkown %d", int(cde)) 25 | } 26 | 27 | func (cde CompilationDatabase_Error) String() string { 28 | return cde.Spelling() 29 | } 30 | 31 | func (cde CompilationDatabase_Error) Error() string { 32 | return cde.Spelling() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/compilecommand_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/CXCompilationDatabase.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Represents the command line invocation to compile a specific file. 8 | type CompileCommand struct { 9 | c C.CXCompileCommand 10 | } 11 | 12 | // Get the working directory where the CompileCommand was executed from 13 | func (cc CompileCommand) Directory() string { 14 | o := cxstring{C.clang_CompileCommand_getDirectory(cc.c)} 15 | defer o.Dispose() 16 | 17 | return o.String() 18 | } 19 | 20 | // Get the filename associated with the CompileCommand. 21 | func (cc CompileCommand) Filename() string { 22 | o := cxstring{C.clang_CompileCommand_getFilename(cc.c)} 23 | defer o.Dispose() 24 | 25 | return o.String() 26 | } 27 | 28 | // Get the number of arguments in the compiler invocation. 29 | func (cc CompileCommand) NumArgs() uint32 { 30 | return uint32(C.clang_CompileCommand_getNumArgs(cc.c)) 31 | } 32 | 33 | /* 34 | Get the I'th argument value in the compiler invocations 35 | 36 | Invariant : 37 | - argument 0 is the compiler executable 38 | */ 39 | func (cc CompileCommand) Arg(i uint32) string { 40 | o := cxstring{C.clang_CompileCommand_getArg(cc.c, C.uint(i))} 41 | defer o.Dispose() 42 | 43 | return o.String() 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/compilecommands_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/CXCompilationDatabase.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | /* 8 | Contains the results of a search in the compilation database 9 | 10 | When searching for the compile command for a file, the compilation db can 11 | return several commands, as the file may have been compiled with 12 | different options in different places of the project. This choice of compile 13 | commands is wrapped in this opaque data structure. It must be freed by 14 | clang_CompileCommands_dispose. 15 | */ 16 | type CompileCommands struct { 17 | c C.CXCompileCommands 18 | } 19 | 20 | // Free the given CompileCommands 21 | func (cc CompileCommands) Dispose() { 22 | C.clang_CompileCommands_dispose(cc.c) 23 | } 24 | 25 | // Get the number of CompileCommand we have for a file 26 | func (cc CompileCommands) Size() uint32 { 27 | return uint32(C.clang_CompileCommands_getSize(cc.c)) 28 | } 29 | 30 | /* 31 | Get the I'th CompileCommand for a file 32 | 33 | Note : 0 <= i < clang_CompileCommands_getSize(CXCompileCommands) 34 | */ 35 | func (cc CompileCommands) Command(i uint32) CompileCommand { 36 | return CompileCommand{C.clang_CompileCommands_getCommand(cc.c, C.uint(i))} 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/completion_test.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestCompletion(t *testing.T) { 11 | idx := NewIndex(0, 0) 12 | defer idx.Dispose() 13 | 14 | tu := idx.ParseTranslationUnit("cursor.c", nil, nil, 0) 15 | assert.True(t, tu.IsValid()) 16 | defer tu.Dispose() 17 | 18 | res := tu.CodeCompleteAt("cursor.c", 5, 18, nil, 0) 19 | assert.NotNil(t, res) 20 | defer res.Dispose() 21 | 22 | if n := len(res.Results()); n < 10 { 23 | t.Errorf("Expected more results than %d", n) 24 | } 25 | 26 | t.Logf("%+v", res) 27 | for _, r := range res.Results() { 28 | t.Logf("%+v", r) 29 | 30 | cs := r.CompletionString() 31 | 32 | for i := uint32(0); i < cs.NumChunks(); i++ { 33 | t.Logf("\t%s %s", cs.ChunkKind(i), cs.ChunkText(i)) 34 | } 35 | } 36 | 37 | diags := res.Diagnostics() 38 | defer func() { 39 | for _, d := range diags { 40 | d.Dispose() 41 | } 42 | }() 43 | 44 | ok := false 45 | for _, d := range diags { 46 | if strings.Contains(d.Spelling(), "_cgo_export.h") { 47 | ok = true 48 | } 49 | t.Log(d.Severity(), d.Spelling()) 50 | } 51 | assert.True(t, ok) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/completionresult_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import ( 7 | "reflect" 8 | "unsafe" 9 | ) 10 | 11 | // A single result of code completion. 12 | type CompletionResult struct { 13 | c C.CXCompletionResult 14 | } 15 | 16 | /* 17 | Sort the code-completion results in case-insensitive alphabetical 18 | order. 19 | 20 | Parameter Results The set of results to sort. 21 | Parameter NumResults The number of results in \p Results. 22 | */ 23 | func SortCodeCompletionResults(results []CompletionResult) { 24 | gos_results := (*reflect.SliceHeader)(unsafe.Pointer(&results)) 25 | cp_results := (*C.CXCompletionResult)(unsafe.Pointer(gos_results.Data)) 26 | 27 | C.clang_sortCodeCompletionResults(cp_results, C.uint(len(results))) 28 | } 29 | 30 | /* 31 | The kind of entity that this completion refers to. 32 | 33 | The cursor kind will be a macro, keyword, or a declaration (one of the 34 | *Decl cursor kinds), describing the entity that the completion is 35 | referring to. 36 | 37 | \todo In the future, we would like to provide a full cursor, to allow 38 | the client to extract additional information from declaration. 39 | */ 40 | func (cr CompletionResult) CursorKind() CursorKind { 41 | return CursorKind(cr.c.CursorKind) 42 | } 43 | 44 | // The code-completion string that describes how to insert this code-completion result into the editing buffer. 45 | func (cr CompletionResult) CompletionString() CompletionString { 46 | return CompletionString{cr.c.CompletionString} 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cursor.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | #include "go-clang.h" 3 | 4 | unsigned go_clang_visit_children(CXCursor c, void *fct) { 5 | return clang_visitChildren(c, (CXCursorVisitor)&GoClangCursorVisitor, fct); 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cursorandrangevisitor_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type CursorAndRangeVisitor struct { 8 | c C.CXCursorAndRangeVisitor 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cursorset_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // A fast container representing a set of CXCursors. 8 | type CursorSet struct { 9 | c C.CXCursorSet 10 | } 11 | 12 | // Creates an empty CXCursorSet. 13 | func NewCursorSet() CursorSet { 14 | return CursorSet{C.clang_createCXCursorSet()} 15 | } 16 | 17 | // Disposes a CXCursorSet and releases its associated memory. 18 | func (cs CursorSet) Dispose() { 19 | C.clang_disposeCXCursorSet(cs.c) 20 | } 21 | 22 | /* 23 | Queries a CXCursorSet to see if it contains a specific CXCursor. 24 | 25 | Returns non-zero if the set contains the specified cursor. 26 | */ 27 | func (cs CursorSet) Contains(cursor Cursor) uint32 { 28 | return uint32(C.clang_CXCursorSet_contains(cs.c, cursor.c)) 29 | } 30 | 31 | /* 32 | Inserts a CXCursor into a CXCursorSet. 33 | 34 | Returns zero if the CXCursor was already in the set, and non-zero otherwise. 35 | */ 36 | func (cs CursorSet) Insert(cursor Cursor) uint32 { 37 | return uint32(C.clang_CXCursorSet_insert(cs.c, cursor.c)) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/cxstring.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "go-clang.h" 4 | import "C" 5 | 6 | // A character string. The \c CXString type is used to return strings from the interface when the ownership of that string might different from one call to the next. Use \c clang_getCString() to retrieve the string data and, once finished with the string data, call \c clang_disposeString() to free the string. 7 | type cxstring struct { 8 | c C.CXString 9 | } 10 | 11 | // Retrieve the character data associated with the given string. 12 | func (c cxstring) String() string { 13 | cstr := C.clang_getCString(c.c) 14 | return C.GoString(cstr) 15 | } 16 | 17 | // Free the given string. 18 | func (c cxstring) Dispose() { 19 | C.clang_disposeString(c.c) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/declqualifierkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // 'Qualifiers' written next to the return and parameter types in Objective-C method declarations. 9 | type DeclQualifierKind uint32 10 | 11 | const ( 12 | DeclQualifier_None DeclQualifierKind = C.CXObjCDeclQualifier_None 13 | DeclQualifier_In = C.CXObjCDeclQualifier_In 14 | DeclQualifier_Inout = C.CXObjCDeclQualifier_Inout 15 | DeclQualifier_Out = C.CXObjCDeclQualifier_Out 16 | DeclQualifier_Bycopy = C.CXObjCDeclQualifier_Bycopy 17 | DeclQualifier_Byref = C.CXObjCDeclQualifier_Byref 18 | DeclQualifier_Oneway = C.CXObjCDeclQualifier_Oneway 19 | ) 20 | 21 | func (dqk DeclQualifierKind) Spelling() string { 22 | switch dqk { 23 | case DeclQualifier_None: 24 | return "DeclQualifier=None" 25 | case DeclQualifier_In: 26 | return "DeclQualifier=In" 27 | case DeclQualifier_Inout: 28 | return "DeclQualifier=Inout" 29 | case DeclQualifier_Out: 30 | return "DeclQualifier=Out" 31 | case DeclQualifier_Bycopy: 32 | return "DeclQualifier=Bycopy" 33 | case DeclQualifier_Byref: 34 | return "DeclQualifier=Byref" 35 | case DeclQualifier_Oneway: 36 | return "DeclQualifier=Oneway" 37 | } 38 | 39 | return fmt.Sprintf("DeclQualifierKind unkown %d", int(dqk)) 40 | } 41 | 42 | func (dqk DeclQualifierKind) String() string { 43 | return dqk.Spelling() 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/diagnostics_test.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestDiagnostics(t *testing.T) { 11 | idx := NewIndex(0, 0) 12 | defer idx.Dispose() 13 | 14 | tu := idx.ParseTranslationUnit("cursor.c", nil, nil, 0) 15 | assert.True(t, tu.IsValid()) 16 | defer tu.Dispose() 17 | 18 | diags := tu.Diagnostics() 19 | defer func() { 20 | for _, d := range diags { 21 | d.Dispose() 22 | } 23 | }() 24 | 25 | ok := false 26 | for _, d := range diags { 27 | if strings.Contains(d.Spelling(), "_cgo_export.h") { 28 | ok = true 29 | } 30 | t.Log(d) 31 | t.Log(d.Severity(), d.Spelling()) 32 | t.Log(d.FormatDiagnostic(uint32(Diagnostic_DisplayCategoryName | Diagnostic_DisplaySourceLocation))) 33 | } 34 | assert.True(t, ok) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/diagnosticseverity_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describes the severity of a particular diagnostic. 9 | type DiagnosticSeverity uint32 10 | 11 | const ( 12 | // A diagnostic that has been suppressed, e.g., by a command-line option. 13 | Diagnostic_Ignored DiagnosticSeverity = C.CXDiagnostic_Ignored 14 | // This diagnostic is a note that should be attached to the previous (non-note) diagnostic. 15 | Diagnostic_Note = C.CXDiagnostic_Note 16 | // This diagnostic indicates suspicious code that may not be wrong. 17 | Diagnostic_Warning = C.CXDiagnostic_Warning 18 | // This diagnostic indicates that the code is ill-formed. 19 | Diagnostic_Error = C.CXDiagnostic_Error 20 | // This diagnostic indicates that the code is ill-formed such that future parser recovery is unlikely to produce useful results. 21 | Diagnostic_Fatal = C.CXDiagnostic_Fatal 22 | ) 23 | 24 | func (ds DiagnosticSeverity) Spelling() string { 25 | switch ds { 26 | case Diagnostic_Ignored: 27 | return "Diagnostic=Ignored" 28 | case Diagnostic_Note: 29 | return "Diagnostic=Note" 30 | case Diagnostic_Warning: 31 | return "Diagnostic=Warning" 32 | case Diagnostic_Error: 33 | return "Diagnostic=Error" 34 | case Diagnostic_Fatal: 35 | return "Diagnostic=Fatal" 36 | } 37 | 38 | return fmt.Sprintf("DiagnosticSeverity unkown %d", int(ds)) 39 | } 40 | 41 | func (ds DiagnosticSeverity) String() string { 42 | return ds.Spelling() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/doc.go: -------------------------------------------------------------------------------- 1 | // package clang provides native bindings for the clang C API. 2 | package clang 3 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/errorcode_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/CXErrorCode.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | /* 9 | Error codes returned by libclang routines. 10 | 11 | Zero (CXError_Success) is the only error code indicating success. Other 12 | error codes, including not yet assigned non-zero values, indicate errors. 13 | */ 14 | type ErrorCode uint32 15 | 16 | const ( 17 | // No error. 18 | Error_Success ErrorCode = C.CXError_Success 19 | /* 20 | A generic error code, no further details are available. 21 | 22 | Errors of this kind can get their own specific error codes in future 23 | libclang versions. 24 | */ 25 | Error_Failure = C.CXError_Failure 26 | // libclang crashed while performing the requested operation. 27 | Error_Crashed = C.CXError_Crashed 28 | // The function detected that the arguments violate the function contract. 29 | Error_InvalidArguments = C.CXError_InvalidArguments 30 | // An AST deserialization error has occurred. 31 | Error_ASTReadError = C.CXError_ASTReadError 32 | ) 33 | 34 | func (ec ErrorCode) Spelling() string { 35 | switch ec { 36 | case Error_Success: 37 | return "Error=Success" 38 | case Error_Failure: 39 | return "Error=Failure" 40 | case Error_Crashed: 41 | return "Error=Crashed" 42 | case Error_InvalidArguments: 43 | return "Error=InvalidArguments" 44 | case Error_ASTReadError: 45 | return "Error=ASTReadError" 46 | } 47 | 48 | return fmt.Sprintf("ErrorCode unkown %d", int(ec)) 49 | } 50 | 51 | func (ec ErrorCode) String() string { 52 | return ec.Spelling() 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/evalresult_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Evaluation result of a cursor 8 | type EvalResult struct { 9 | c C.CXEvalResult 10 | } 11 | 12 | // Returns the kind of the evaluated result. 13 | func (er EvalResult) Kind() EvalResultKind { 14 | return EvalResultKind(C.clang_EvalResult_getKind(er.c)) 15 | } 16 | 17 | // Returns the evaluation result as integer if the kind is Int. 18 | func (er EvalResult) AsInt() int32 { 19 | return int32(C.clang_EvalResult_getAsInt(er.c)) 20 | } 21 | 22 | // Returns the evaluation result as double if the kind is double. 23 | func (er EvalResult) AsDouble() float64 { 24 | return float64(C.clang_EvalResult_getAsDouble(er.c)) 25 | } 26 | 27 | // Returns the evaluation result as a constant string if the kind is other than Int or float. User must not free this pointer, instead call clang_EvalResult_dispose on the CXEvalResult returned by clang_Cursor_Evaluate. 28 | func (er EvalResult) AsStr() string { 29 | return C.GoString(C.clang_EvalResult_getAsStr(er.c)) 30 | } 31 | 32 | // Disposes the created Eval memory. 33 | func (er EvalResult) Dispose() { 34 | C.clang_EvalResult_dispose(er.c) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/evalresultkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type EvalResultKind uint32 9 | 10 | const ( 11 | Eval_Int EvalResultKind = C.CXEval_Int 12 | Eval_Float = C.CXEval_Float 13 | Eval_ObjCStrLiteral = C.CXEval_ObjCStrLiteral 14 | Eval_StrLiteral = C.CXEval_StrLiteral 15 | Eval_CFStr = C.CXEval_CFStr 16 | Eval_Other = C.CXEval_Other 17 | Eval_UnExposed = C.CXEval_UnExposed 18 | ) 19 | 20 | func (erk EvalResultKind) Spelling() string { 21 | switch erk { 22 | case Eval_Int: 23 | return "Eval=Int" 24 | case Eval_Float: 25 | return "Eval=Float" 26 | case Eval_ObjCStrLiteral: 27 | return "Eval=ObjCStrLiteral" 28 | case Eval_StrLiteral: 29 | return "Eval=StrLiteral" 30 | case Eval_CFStr: 31 | return "Eval=CFStr" 32 | case Eval_Other: 33 | return "Eval=Other" 34 | case Eval_UnExposed: 35 | return "Eval=UnExposed" 36 | } 37 | 38 | return fmt.Sprintf("EvalResultKind unkown %d", int(erk)) 39 | } 40 | 41 | func (erk EvalResultKind) String() string { 42 | return erk.Spelling() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/file_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "time" 7 | 8 | // A particular source file that is part of a translation unit. 9 | type File struct { 10 | c C.CXFile 11 | } 12 | 13 | // Retrieve the complete file and path name of the given file. 14 | func (f File) Name() string { 15 | o := cxstring{C.clang_getFileName(f.c)} 16 | defer o.Dispose() 17 | 18 | return o.String() 19 | } 20 | 21 | // Retrieve the last modification time of the given file. 22 | func (f File) Time() time.Time { 23 | return time.Unix(int64(C.clang_getFileTime(f.c)), 0) 24 | } 25 | 26 | /* 27 | Retrieve the unique ID for the given file. 28 | 29 | Parameter file the file to get the ID for. 30 | Parameter outID stores the returned CXFileUniqueID. 31 | Returns If there was a failure getting the unique ID, returns non-zero, 32 | otherwise returns 0. 33 | */ 34 | func (f File) UniqueID() (FileUniqueID, int32) { 35 | var outID FileUniqueID 36 | 37 | o := int32(C.clang_getFileUniqueID(f.c, &outID.c)) 38 | 39 | return outID, o 40 | } 41 | 42 | // Returns non-zero if the file1 and file2 point to the same file, or they are both NULL. 43 | func (f File) IsEqual(file2 File) bool { 44 | o := C.clang_File_isEqual(f.c, file2.c) 45 | 46 | return o != C.int(0) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/fileuniqueid_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Uniquely identifies a CXFile, that refers to the same underlying file, across an indexing session. 8 | type FileUniqueID struct { 9 | c C.CXFileUniqueID 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/go-clang.h: -------------------------------------------------------------------------------- 1 | #ifndef GO_CLANG 2 | #define GO_CLANG 3 | 4 | #include 5 | 6 | #include "clang-c/Index.h" 7 | 8 | unsigned go_clang_visit_children(CXCursor c, void *fct); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxattrinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxAttrInfo struct { 8 | c *C.CXIdxAttrInfo 9 | } 10 | 11 | func (iai *IdxAttrInfo) IBOutletCollectionAttrInfo() *IdxIBOutletCollectionAttrInfo { 12 | o := C.clang_index_getIBOutletCollectionAttrInfo(iai.c) 13 | 14 | var gop_o *IdxIBOutletCollectionAttrInfo 15 | if o != nil { 16 | gop_o = &IdxIBOutletCollectionAttrInfo{*o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (iai IdxAttrInfo) Kind() IdxAttrKind { 23 | return IdxAttrKind(iai.c.kind) 24 | } 25 | 26 | func (iai IdxAttrInfo) Cursor() Cursor { 27 | return Cursor{iai.c.cursor} 28 | } 29 | 30 | func (iai IdxAttrInfo) Loc() IdxLoc { 31 | return IdxLoc{iai.c.loc} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxattrkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type IdxAttrKind uint32 9 | 10 | const ( 11 | IdxAttr_Unexposed IdxAttrKind = C.CXIdxAttr_Unexposed 12 | IdxAttr_IBAction = C.CXIdxAttr_IBAction 13 | IdxAttr_IBOutlet = C.CXIdxAttr_IBOutlet 14 | IdxAttr_IBOutletCollection = C.CXIdxAttr_IBOutletCollection 15 | ) 16 | 17 | func (iak IdxAttrKind) Spelling() string { 18 | switch iak { 19 | case IdxAttr_Unexposed: 20 | return "IdxAttr=Unexposed" 21 | case IdxAttr_IBAction: 22 | return "IdxAttr=IBAction" 23 | case IdxAttr_IBOutlet: 24 | return "IdxAttr=IBOutlet" 25 | case IdxAttr_IBOutletCollection: 26 | return "IdxAttr=IBOutletCollection" 27 | } 28 | 29 | return fmt.Sprintf("IdxAttrKind unkown %d", int(iak)) 30 | } 31 | 32 | func (iak IdxAttrKind) String() string { 33 | return iak.Spelling() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxbaseclassinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxBaseClassInfo struct { 8 | c C.CXIdxBaseClassInfo 9 | } 10 | 11 | func (ibci IdxBaseClassInfo) Base() *IdxEntityInfo { 12 | o := ibci.c.base 13 | 14 | var gop_o *IdxEntityInfo 15 | if o != nil { 16 | gop_o = &IdxEntityInfo{o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (ibci IdxBaseClassInfo) Cursor() Cursor { 23 | return Cursor{ibci.c.cursor} 24 | } 25 | 26 | func (ibci IdxBaseClassInfo) Loc() IdxLoc { 27 | return IdxLoc{ibci.c.loc} 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxclientastfile_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // The client's data object that is associated with an AST file (PCH or module). 8 | type IdxClientASTFile struct { 9 | c C.CXIdxClientASTFile 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxclientcontainer_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // The client's data object that is associated with a semantic container of entities. 8 | type IdxClientContainer struct { 9 | c C.CXIdxClientContainer 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxcliententity_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // The client's data object that is associated with a semantic entity. 8 | type IdxClientEntity struct { 9 | c C.CXIdxClientEntity 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxclientfile_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // The client's data object that is associated with a CXFile. 8 | type IdxClientFile struct { 9 | c C.CXIdxClientFile 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxcontainerinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxContainerInfo struct { 8 | c *C.CXIdxContainerInfo 9 | } 10 | 11 | // For retrieving a custom CXIdxClientContainer attached to a container. 12 | func (ici *IdxContainerInfo) ClientContainer() IdxClientContainer { 13 | return IdxClientContainer{C.clang_index_getClientContainer(ici.c)} 14 | } 15 | 16 | // For setting a custom CXIdxClientContainer attached to a container. 17 | func (ici *IdxContainerInfo) SetClientContainer(icc IdxClientContainer) { 18 | C.clang_index_setClientContainer(ici.c, icc.c) 19 | } 20 | 21 | func (ici IdxContainerInfo) Cursor() Cursor { 22 | return Cursor{ici.c.cursor} 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxcxxclassdeclinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import ( 7 | "reflect" 8 | "unsafe" 9 | ) 10 | 11 | type IdxCXXClassDeclInfo struct { 12 | c C.CXIdxCXXClassDeclInfo 13 | } 14 | 15 | func (icxxcdi IdxCXXClassDeclInfo) DeclInfo() *IdxDeclInfo { 16 | o := icxxcdi.c.declInfo 17 | 18 | var gop_o *IdxDeclInfo 19 | if o != nil { 20 | gop_o = &IdxDeclInfo{o} 21 | } 22 | 23 | return gop_o 24 | } 25 | 26 | func (icxxcdi IdxCXXClassDeclInfo) Bases() []*IdxBaseClassInfo { 27 | var s []*IdxBaseClassInfo 28 | gos_s := (*reflect.SliceHeader)(unsafe.Pointer(&s)) 29 | gos_s.Cap = int(icxxcdi.c.numBases) 30 | gos_s.Len = int(icxxcdi.c.numBases) 31 | gos_s.Data = uintptr(unsafe.Pointer(icxxcdi.c.bases)) 32 | 33 | return s 34 | } 35 | 36 | func (icxxcdi IdxCXXClassDeclInfo) NumBases() uint32 { 37 | return uint32(icxxcdi.c.numBases) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxdeclinfoflags_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type IdxDeclInfoFlags uint32 9 | 10 | const ( 11 | IdxDeclFlag_Skipped IdxDeclInfoFlags = C.CXIdxDeclFlag_Skipped 12 | ) 13 | 14 | func (idif IdxDeclInfoFlags) Spelling() string { 15 | switch idif { 16 | case IdxDeclFlag_Skipped: 17 | return "IdxDeclFlag=Skipped" 18 | } 19 | 20 | return fmt.Sprintf("IdxDeclInfoFlags unkown %d", int(idif)) 21 | } 22 | 23 | func (idif IdxDeclInfoFlags) String() string { 24 | return idif.Spelling() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxentitycxxtemplatekind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Extra C++ template information for an entity. This can apply to: CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias 9 | type IdxEntityCXXTemplateKind uint32 10 | 11 | const ( 12 | IdxEntity_NonTemplate IdxEntityCXXTemplateKind = C.CXIdxEntity_NonTemplate 13 | IdxEntity_Template = C.CXIdxEntity_Template 14 | IdxEntity_TemplatePartialSpecialization = C.CXIdxEntity_TemplatePartialSpecialization 15 | IdxEntity_TemplateSpecialization = C.CXIdxEntity_TemplateSpecialization 16 | ) 17 | 18 | func (iecxxtk IdxEntityCXXTemplateKind) Spelling() string { 19 | switch iecxxtk { 20 | case IdxEntity_NonTemplate: 21 | return "IdxEntity=NonTemplate" 22 | case IdxEntity_Template: 23 | return "IdxEntity=Template" 24 | case IdxEntity_TemplatePartialSpecialization: 25 | return "IdxEntity=TemplatePartialSpecialization" 26 | case IdxEntity_TemplateSpecialization: 27 | return "IdxEntity=TemplateSpecialization" 28 | } 29 | 30 | return fmt.Sprintf("IdxEntityCXXTemplateKind unkown %d", int(iecxxtk)) 31 | } 32 | 33 | func (iecxxtk IdxEntityCXXTemplateKind) String() string { 34 | return iecxxtk.Spelling() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxentitylanguage_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type IdxEntityLanguage uint32 9 | 10 | const ( 11 | IdxEntityLang_None IdxEntityLanguage = C.CXIdxEntityLang_None 12 | IdxEntityLang_C = C.CXIdxEntityLang_C 13 | IdxEntityLang_ObjC = C.CXIdxEntityLang_ObjC 14 | IdxEntityLang_CXX = C.CXIdxEntityLang_CXX 15 | ) 16 | 17 | func (iel IdxEntityLanguage) Spelling() string { 18 | switch iel { 19 | case IdxEntityLang_None: 20 | return "IdxEntityLang=None" 21 | case IdxEntityLang_C: 22 | return "IdxEntityLang=C" 23 | case IdxEntityLang_ObjC: 24 | return "IdxEntityLang=ObjC" 25 | case IdxEntityLang_CXX: 26 | return "IdxEntityLang=CXX" 27 | } 28 | 29 | return fmt.Sprintf("IdxEntityLanguage unkown %d", int(iel)) 30 | } 31 | 32 | func (iel IdxEntityLanguage) String() string { 33 | return iel.Spelling() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxentityrefkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Data for IndexerCallbacks#indexEntityReference. 9 | type IdxEntityRefKind uint32 10 | 11 | const ( 12 | // The entity is referenced directly in user's code. 13 | IdxEntityRef_Direct IdxEntityRefKind = C.CXIdxEntityRef_Direct 14 | // An implicit reference, e.g. a reference of an Objective-C method via the dot syntax. 15 | IdxEntityRef_Implicit = C.CXIdxEntityRef_Implicit 16 | ) 17 | 18 | func (ierk IdxEntityRefKind) Spelling() string { 19 | switch ierk { 20 | case IdxEntityRef_Direct: 21 | return "IdxEntityRef=Direct" 22 | case IdxEntityRef_Implicit: 23 | return "IdxEntityRef=Implicit" 24 | } 25 | 26 | return fmt.Sprintf("IdxEntityRefKind unkown %d", int(ierk)) 27 | } 28 | 29 | func (ierk IdxEntityRefKind) String() string { 30 | return ierk.Spelling() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxiboutletcollectionattrinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxIBOutletCollectionAttrInfo struct { 8 | c C.CXIdxIBOutletCollectionAttrInfo 9 | } 10 | 11 | func (iibocai IdxIBOutletCollectionAttrInfo) AttrInfo() *IdxAttrInfo { 12 | o := iibocai.c.attrInfo 13 | 14 | var gop_o *IdxAttrInfo 15 | if o != nil { 16 | gop_o = &IdxAttrInfo{o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (iibocai IdxIBOutletCollectionAttrInfo) ObjcClass() *IdxEntityInfo { 23 | o := iibocai.c.objcClass 24 | 25 | var gop_o *IdxEntityInfo 26 | if o != nil { 27 | gop_o = &IdxEntityInfo{o} 28 | } 29 | 30 | return gop_o 31 | } 32 | 33 | func (iibocai IdxIBOutletCollectionAttrInfo) ClassCursor() Cursor { 34 | return Cursor{iibocai.c.classCursor} 35 | } 36 | 37 | func (iibocai IdxIBOutletCollectionAttrInfo) ClassLoc() IdxLoc { 38 | return IdxLoc{iibocai.c.classLoc} 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idximportedastfileinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Data for IndexerCallbacks#importedASTFile. 8 | type IdxImportedASTFileInfo struct { 9 | c C.CXIdxImportedASTFileInfo 10 | } 11 | 12 | // Top level AST file containing the imported PCH, module or submodule. 13 | func (iiastfi IdxImportedASTFileInfo) File() File { 14 | return File{iiastfi.c.file} 15 | } 16 | 17 | // The imported module or NULL if the AST file is a PCH. 18 | func (iiastfi IdxImportedASTFileInfo) Module() Module { 19 | return Module{iiastfi.c.module} 20 | } 21 | 22 | // Location where the file is imported. Applicable only for modules. 23 | func (iiastfi IdxImportedASTFileInfo) Loc() IdxLoc { 24 | return IdxLoc{iiastfi.c.loc} 25 | } 26 | 27 | // Non-zero if an inclusion directive was automatically turned into a module import. Applicable only for modules. 28 | func (iiastfi IdxImportedASTFileInfo) IsImplicit() bool { 29 | o := iiastfi.c.isImplicit 30 | 31 | return o != C.int(0) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxincludedfileinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Data for ppIncludedFile callback. 8 | type IdxIncludedFileInfo struct { 9 | c C.CXIdxIncludedFileInfo 10 | } 11 | 12 | // Location of '#' in the \#include/\#import directive. 13 | func (iifi IdxIncludedFileInfo) HashLoc() IdxLoc { 14 | return IdxLoc{iifi.c.hashLoc} 15 | } 16 | 17 | // Filename as written in the \#include/\#import directive. 18 | func (iifi IdxIncludedFileInfo) Filename() string { 19 | return C.GoString(iifi.c.filename) 20 | } 21 | 22 | // The actual file that the \#include/\#import directive resolved to. 23 | func (iifi IdxIncludedFileInfo) File() File { 24 | return File{iifi.c.file} 25 | } 26 | 27 | func (iifi IdxIncludedFileInfo) IsImport() bool { 28 | o := iifi.c.isImport 29 | 30 | return o != C.int(0) 31 | } 32 | 33 | func (iifi IdxIncludedFileInfo) IsAngled() bool { 34 | o := iifi.c.isAngled 35 | 36 | return o != C.int(0) 37 | } 38 | 39 | // Non-zero if the directive was automatically turned into a module import. 40 | func (iifi IdxIncludedFileInfo) IsModuleImport() bool { 41 | o := iifi.c.isModuleImport 42 | 43 | return o != C.int(0) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxloc_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Source location passed to index callbacks. 8 | type IdxLoc struct { 9 | c C.CXIdxLoc 10 | } 11 | 12 | /* 13 | Retrieve the CXIdxFile, file, line, column, and offset represented by 14 | the given CXIdxLoc. 15 | 16 | If the location refers into a macro expansion, retrieves the 17 | location of the macro expansion and if it refers into a macro argument 18 | retrieves the location of the argument. 19 | */ 20 | func (il IdxLoc) FileLocation() (IdxClientFile, File, uint32, uint32, uint32) { 21 | var indexFile IdxClientFile 22 | var file File 23 | var line C.uint 24 | var column C.uint 25 | var offset C.uint 26 | 27 | C.clang_indexLoc_getFileLocation(il.c, &indexFile.c, &file.c, &line, &column, &offset) 28 | 29 | return indexFile, file, uint32(line), uint32(column), uint32(offset) 30 | } 31 | 32 | // Retrieve the CXSourceLocation represented by the given CXIdxLoc. 33 | func (il IdxLoc) SourceLocation() SourceLocation { 34 | return SourceLocation{C.clang_indexLoc_getCXSourceLocation(il.c)} 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjccategorydeclinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxObjCCategoryDeclInfo struct { 8 | c C.CXIdxObjCCategoryDeclInfo 9 | } 10 | 11 | func (ioccdi IdxObjCCategoryDeclInfo) ContainerInfo() *IdxObjCContainerDeclInfo { 12 | o := ioccdi.c.containerInfo 13 | 14 | var gop_o *IdxObjCContainerDeclInfo 15 | if o != nil { 16 | gop_o = &IdxObjCContainerDeclInfo{*o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (ioccdi IdxObjCCategoryDeclInfo) ObjcClass() *IdxEntityInfo { 23 | o := ioccdi.c.objcClass 24 | 25 | var gop_o *IdxEntityInfo 26 | if o != nil { 27 | gop_o = &IdxEntityInfo{o} 28 | } 29 | 30 | return gop_o 31 | } 32 | 33 | func (ioccdi IdxObjCCategoryDeclInfo) ClassCursor() Cursor { 34 | return Cursor{ioccdi.c.classCursor} 35 | } 36 | 37 | func (ioccdi IdxObjCCategoryDeclInfo) ClassLoc() IdxLoc { 38 | return IdxLoc{ioccdi.c.classLoc} 39 | } 40 | 41 | func (ioccdi IdxObjCCategoryDeclInfo) Protocols() *IdxObjCProtocolRefListInfo { 42 | o := ioccdi.c.protocols 43 | 44 | var gop_o *IdxObjCProtocolRefListInfo 45 | if o != nil { 46 | gop_o = &IdxObjCProtocolRefListInfo{*o} 47 | } 48 | 49 | return gop_o 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjccontainerdeclinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxObjCContainerDeclInfo struct { 8 | c C.CXIdxObjCContainerDeclInfo 9 | } 10 | 11 | func (ioccdi IdxObjCContainerDeclInfo) DeclInfo() *IdxDeclInfo { 12 | o := ioccdi.c.declInfo 13 | 14 | var gop_o *IdxDeclInfo 15 | if o != nil { 16 | gop_o = &IdxDeclInfo{o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (ioccdi IdxObjCContainerDeclInfo) Kind() IdxObjCContainerKind { 23 | return IdxObjCContainerKind(ioccdi.c.kind) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjccontainerkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type IdxObjCContainerKind uint32 9 | 10 | const ( 11 | IdxObjCContainer_ForwardRef IdxObjCContainerKind = C.CXIdxObjCContainer_ForwardRef 12 | IdxObjCContainer_Interface = C.CXIdxObjCContainer_Interface 13 | IdxObjCContainer_Implementation = C.CXIdxObjCContainer_Implementation 14 | ) 15 | 16 | func (iocck IdxObjCContainerKind) Spelling() string { 17 | switch iocck { 18 | case IdxObjCContainer_ForwardRef: 19 | return "IdxObjCContainer=ForwardRef" 20 | case IdxObjCContainer_Interface: 21 | return "IdxObjCContainer=Interface" 22 | case IdxObjCContainer_Implementation: 23 | return "IdxObjCContainer=Implementation" 24 | } 25 | 26 | return fmt.Sprintf("IdxObjCContainerKind unkown %d", int(iocck)) 27 | } 28 | 29 | func (iocck IdxObjCContainerKind) String() string { 30 | return iocck.Spelling() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjcinterfacedeclinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxObjCInterfaceDeclInfo struct { 8 | c C.CXIdxObjCInterfaceDeclInfo 9 | } 10 | 11 | func (iocidi IdxObjCInterfaceDeclInfo) ContainerInfo() *IdxObjCContainerDeclInfo { 12 | o := iocidi.c.containerInfo 13 | 14 | var gop_o *IdxObjCContainerDeclInfo 15 | if o != nil { 16 | gop_o = &IdxObjCContainerDeclInfo{*o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (iocidi IdxObjCInterfaceDeclInfo) SuperInfo() *IdxBaseClassInfo { 23 | o := iocidi.c.superInfo 24 | 25 | var gop_o *IdxBaseClassInfo 26 | if o != nil { 27 | gop_o = &IdxBaseClassInfo{*o} 28 | } 29 | 30 | return gop_o 31 | } 32 | 33 | func (iocidi IdxObjCInterfaceDeclInfo) Protocols() *IdxObjCProtocolRefListInfo { 34 | o := iocidi.c.protocols 35 | 36 | var gop_o *IdxObjCProtocolRefListInfo 37 | if o != nil { 38 | gop_o = &IdxObjCProtocolRefListInfo{*o} 39 | } 40 | 41 | return gop_o 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjcpropertydeclinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxObjCPropertyDeclInfo struct { 8 | c C.CXIdxObjCPropertyDeclInfo 9 | } 10 | 11 | func (iocpdi IdxObjCPropertyDeclInfo) DeclInfo() *IdxDeclInfo { 12 | o := iocpdi.c.declInfo 13 | 14 | var gop_o *IdxDeclInfo 15 | if o != nil { 16 | gop_o = &IdxDeclInfo{o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (iocpdi IdxObjCPropertyDeclInfo) Getter() *IdxEntityInfo { 23 | o := iocpdi.c.getter 24 | 25 | var gop_o *IdxEntityInfo 26 | if o != nil { 27 | gop_o = &IdxEntityInfo{o} 28 | } 29 | 30 | return gop_o 31 | } 32 | 33 | func (iocpdi IdxObjCPropertyDeclInfo) Setter() *IdxEntityInfo { 34 | o := iocpdi.c.setter 35 | 36 | var gop_o *IdxEntityInfo 37 | if o != nil { 38 | gop_o = &IdxEntityInfo{o} 39 | } 40 | 41 | return gop_o 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjcprotocolrefinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type IdxObjCProtocolRefInfo struct { 8 | c C.CXIdxObjCProtocolRefInfo 9 | } 10 | 11 | func (iocpri IdxObjCProtocolRefInfo) Protocol() *IdxEntityInfo { 12 | o := iocpri.c.protocol 13 | 14 | var gop_o *IdxEntityInfo 15 | if o != nil { 16 | gop_o = &IdxEntityInfo{o} 17 | } 18 | 19 | return gop_o 20 | } 21 | 22 | func (iocpri IdxObjCProtocolRefInfo) Cursor() Cursor { 23 | return Cursor{iocpri.c.cursor} 24 | } 25 | 26 | func (iocpri IdxObjCProtocolRefInfo) Loc() IdxLoc { 27 | return IdxLoc{iocpri.c.loc} 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/idxobjcprotocolreflistinfo_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import ( 7 | "reflect" 8 | "unsafe" 9 | ) 10 | 11 | type IdxObjCProtocolRefListInfo struct { 12 | c C.CXIdxObjCProtocolRefListInfo 13 | } 14 | 15 | func (iocprli IdxObjCProtocolRefListInfo) Protocols() []*IdxObjCProtocolRefInfo { 16 | var s []*IdxObjCProtocolRefInfo 17 | gos_s := (*reflect.SliceHeader)(unsafe.Pointer(&s)) 18 | gos_s.Cap = int(iocprli.c.numProtocols) 19 | gos_s.Len = int(iocprli.c.numProtocols) 20 | gos_s.Data = uintptr(unsafe.Pointer(iocprli.c.protocols)) 21 | 22 | return s 23 | } 24 | 25 | func (iocprli IdxObjCProtocolRefListInfo) NumProtocols() uint32 { 26 | return uint32(iocprli.c.numProtocols) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/indexercallbacks_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // A group of callbacks used by #clang_indexSourceFile and #clang_indexTranslationUnit. 8 | type IndexerCallbacks struct { 9 | c C.IndexerCallbacks 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/languagekind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describe the "language" of the entity referred to by a cursor. 9 | type LanguageKind uint32 10 | 11 | const ( 12 | Language_Invalid LanguageKind = C.CXLanguage_Invalid 13 | Language_C = C.CXLanguage_C 14 | Language_ObjC = C.CXLanguage_ObjC 15 | Language_CPlusPlus = C.CXLanguage_CPlusPlus 16 | ) 17 | 18 | func (lk LanguageKind) Spelling() string { 19 | switch lk { 20 | case Language_Invalid: 21 | return "Language=Invalid" 22 | case Language_C: 23 | return "Language=C" 24 | case Language_ObjC: 25 | return "Language=ObjC" 26 | case Language_CPlusPlus: 27 | return "Language=CPlusPlus" 28 | } 29 | 30 | return fmt.Sprintf("LanguageKind unkown %d", int(lk)) 31 | } 32 | 33 | func (lk LanguageKind) String() string { 34 | return lk.Spelling() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/linkagekind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describe the linkage of the entity referred to by a cursor. 9 | type LinkageKind uint32 10 | 11 | const ( 12 | // This value indicates that no linkage information is available for a provided CXCursor. 13 | Linkage_Invalid LinkageKind = C.CXLinkage_Invalid 14 | // This is the linkage for variables, parameters, and so on that have automatic storage. This covers normal (non-extern) local variables. 15 | Linkage_NoLinkage = C.CXLinkage_NoLinkage 16 | // This is the linkage for static variables and static functions. 17 | Linkage_Internal = C.CXLinkage_Internal 18 | // This is the linkage for entities with external linkage that live in C++ anonymous namespaces. 19 | Linkage_UniqueExternal = C.CXLinkage_UniqueExternal 20 | // This is the linkage for entities with true, external linkage. 21 | Linkage_External = C.CXLinkage_External 22 | ) 23 | 24 | func (lk LinkageKind) Spelling() string { 25 | switch lk { 26 | case Linkage_Invalid: 27 | return "Linkage=Invalid" 28 | case Linkage_NoLinkage: 29 | return "Linkage=NoLinkage" 30 | case Linkage_Internal: 31 | return "Linkage=Internal" 32 | case Linkage_UniqueExternal: 33 | return "Linkage=UniqueExternal" 34 | case Linkage_External: 35 | return "Linkage=External" 36 | } 37 | 38 | return fmt.Sprintf("LinkageKind unkown %d", int(lk)) 39 | } 40 | 41 | func (lk LinkageKind) String() string { 42 | return lk.Spelling() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/loaddiag_error_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describes the kind of error that occurred (if any) in a call to clang_loadDiagnostics. 9 | type LoadDiag_Error int32 10 | 11 | const ( 12 | // Indicates that no error occurred. 13 | LoadDiag_None LoadDiag_Error = C.CXLoadDiag_None 14 | // Indicates that an unknown error occurred while attempting to deserialize diagnostics. 15 | LoadDiag_Unknown = C.CXLoadDiag_Unknown 16 | // Indicates that the file containing the serialized diagnostics could not be opened. 17 | LoadDiag_CannotLoad = C.CXLoadDiag_CannotLoad 18 | // Indicates that the serialized diagnostics file is invalid or corrupt. 19 | LoadDiag_InvalidFile = C.CXLoadDiag_InvalidFile 20 | ) 21 | 22 | func (lde LoadDiag_Error) Spelling() string { 23 | switch lde { 24 | case LoadDiag_None: 25 | return "LoadDiag=None" 26 | case LoadDiag_Unknown: 27 | return "LoadDiag=Unknown" 28 | case LoadDiag_CannotLoad: 29 | return "LoadDiag=CannotLoad" 30 | case LoadDiag_InvalidFile: 31 | return "LoadDiag=InvalidFile" 32 | } 33 | 34 | return fmt.Sprintf("LoadDiag_Error unkown %d", int(lde)) 35 | } 36 | 37 | func (lde LoadDiag_Error) String() string { 38 | return lde.Spelling() 39 | } 40 | 41 | func (lde LoadDiag_Error) Error() string { 42 | return lde.Spelling() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/module_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type Module struct { 8 | c C.CXModule 9 | } 10 | 11 | /* 12 | Parameter Module a module object. 13 | 14 | Returns the module file where the provided module object came from. 15 | */ 16 | func (m Module) ASTFile() File { 17 | return File{C.clang_Module_getASTFile(m.c)} 18 | } 19 | 20 | /* 21 | Parameter Module a module object. 22 | 23 | Returns the parent of a sub-module or NULL if the given module is top-level, 24 | e.g. for 'std.vector' it will return the 'std' module. 25 | */ 26 | func (m Module) Parent() Module { 27 | return Module{C.clang_Module_getParent(m.c)} 28 | } 29 | 30 | /* 31 | Parameter Module a module object. 32 | 33 | Returns the name of the module, e.g. for the 'std.vector' sub-module it 34 | will return "vector". 35 | */ 36 | func (m Module) Name() string { 37 | o := cxstring{C.clang_Module_getName(m.c)} 38 | defer o.Dispose() 39 | 40 | return o.String() 41 | } 42 | 43 | /* 44 | Parameter Module a module object. 45 | 46 | Returns the full name of the module, e.g. "std.vector". 47 | */ 48 | func (m Module) FullName() string { 49 | o := cxstring{C.clang_Module_getFullName(m.c)} 50 | defer o.Dispose() 51 | 52 | return o.String() 53 | } 54 | 55 | /* 56 | Parameter Module a module object. 57 | 58 | Returns non-zero if the module is a system one. 59 | */ 60 | func (m Module) IsSystem() bool { 61 | o := C.clang_Module_isSystem(m.c) 62 | 63 | return o != C.int(0) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/namerefflags_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type NameRefFlags uint32 9 | 10 | const ( 11 | // Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range. 12 | NameRange_WantQualifier NameRefFlags = C.CXNameRange_WantQualifier 13 | // Include the explicit template arguments, e.g. \ in x.f, in the range. 14 | NameRange_WantTemplateArgs = C.CXNameRange_WantTemplateArgs 15 | /* 16 | If the name is non-contiguous, return the full spanning range. 17 | 18 | Non-contiguous names occur in Objective-C when a selector with two or more 19 | parameters is used, or in C++ when using an operator: 20 | \code 21 | [object doSomething:here withValue:there]; // Objective-C 22 | return some_vector[1]; // C++ 23 | \endcode 24 | */ 25 | NameRange_WantSinglePiece = C.CXNameRange_WantSinglePiece 26 | ) 27 | 28 | func (nrf NameRefFlags) Spelling() string { 29 | switch nrf { 30 | case NameRange_WantQualifier: 31 | return "NameRange=WantQualifier" 32 | case NameRange_WantTemplateArgs: 33 | return "NameRange=WantTemplateArgs" 34 | case NameRange_WantSinglePiece: 35 | return "NameRange=WantSinglePiece" 36 | } 37 | 38 | return fmt.Sprintf("NameRefFlags unkown %d", int(nrf)) 39 | } 40 | 41 | func (nrf NameRefFlags) String() string { 42 | return nrf.Spelling() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/refqualifierkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type RefQualifierKind uint32 9 | 10 | const ( 11 | // No ref-qualifier was provided. 12 | RefQualifier_None RefQualifierKind = C.CXRefQualifier_None 13 | // An lvalue ref-qualifier was provided (&). 14 | RefQualifier_LValue = C.CXRefQualifier_LValue 15 | // An rvalue ref-qualifier was provided (&&). 16 | RefQualifier_RValue = C.CXRefQualifier_RValue 17 | ) 18 | 19 | func (rqk RefQualifierKind) Spelling() string { 20 | switch rqk { 21 | case RefQualifier_None: 22 | return "RefQualifier=None" 23 | case RefQualifier_LValue: 24 | return "RefQualifier=LValue" 25 | case RefQualifier_RValue: 26 | return "RefQualifier=RValue" 27 | } 28 | 29 | return fmt.Sprintf("RefQualifierKind unkown %d", int(rqk)) 30 | } 31 | 32 | func (rqk RefQualifierKind) String() string { 33 | return rqk.Spelling() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/reparse_flags_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | /* 9 | Flags that control the reparsing of translation units. 10 | 11 | The enumerators in this enumeration type are meant to be bitwise 12 | ORed together to specify which options should be used when 13 | reparsing the translation unit. 14 | */ 15 | type Reparse_Flags uint32 16 | 17 | const ( 18 | // Used to indicate that no special reparsing options are needed. 19 | Reparse_None Reparse_Flags = C.CXReparse_None 20 | ) 21 | 22 | func (rf Reparse_Flags) Spelling() string { 23 | switch rf { 24 | case Reparse_None: 25 | return "Reparse=None" 26 | } 27 | 28 | return fmt.Sprintf("Reparse_Flags unkown %d", int(rf)) 29 | } 30 | 31 | func (rf Reparse_Flags) String() string { 32 | return rf.Spelling() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/result_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type Result uint32 9 | 10 | const ( 11 | // Function returned successfully. 12 | Result_Success Result = C.CXResult_Success 13 | // One of the parameters was invalid for the function. 14 | Result_Invalid = C.CXResult_Invalid 15 | // The function was terminated by a callback (e.g. it returned CXVisit_Break) 16 | Result_VisitBreak = C.CXResult_VisitBreak 17 | ) 18 | 19 | func (r Result) Spelling() string { 20 | switch r { 21 | case Result_Success: 22 | return "Result=Success" 23 | case Result_Invalid: 24 | return "Result=Invalid" 25 | case Result_VisitBreak: 26 | return "Result=VisitBreak" 27 | } 28 | 29 | return fmt.Sprintf("Result unkown %d", int(r)) 30 | } 31 | 32 | func (r Result) String() string { 33 | return r.Spelling() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/savetranslationunit_flags_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | /* 9 | Flags that control how translation units are saved. 10 | 11 | The enumerators in this enumeration type are meant to be bitwise 12 | ORed together to specify which options should be used when 13 | saving the translation unit. 14 | */ 15 | type SaveTranslationUnit_Flags uint32 16 | 17 | const ( 18 | // Used to indicate that no special saving options are needed. 19 | SaveTranslationUnit_None SaveTranslationUnit_Flags = C.CXSaveTranslationUnit_None 20 | ) 21 | 22 | func (stuf SaveTranslationUnit_Flags) Spelling() string { 23 | switch stuf { 24 | case SaveTranslationUnit_None: 25 | return "SaveTranslationUnit=None" 26 | } 27 | 28 | return fmt.Sprintf("SaveTranslationUnit_Flags unkown %d", int(stuf)) 29 | } 30 | 31 | func (stuf SaveTranslationUnit_Flags) String() string { 32 | return stuf.Spelling() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/sourcerange_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | /* 8 | Identifies a half-open character range in the source code. 9 | 10 | Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the 11 | starting and end locations from a source range, respectively. 12 | */ 13 | type SourceRange struct { 14 | c C.CXSourceRange 15 | } 16 | 17 | // Retrieve a NULL (invalid) source range. 18 | func NewNullRange() SourceRange { 19 | return SourceRange{C.clang_getNullRange()} 20 | } 21 | 22 | /* 23 | Determine whether two ranges are equivalent. 24 | 25 | Returns non-zero if the ranges are the same, zero if they differ. 26 | */ 27 | func (sr SourceRange) Equal(sr2 SourceRange) bool { 28 | o := C.clang_equalRanges(sr.c, sr2.c) 29 | 30 | return o != C.uint(0) 31 | } 32 | 33 | // Returns non-zero if \p range is null. 34 | func (sr SourceRange) IsNull() bool { 35 | o := C.clang_Range_isNull(sr.c) 36 | 37 | return o != C.int(0) 38 | } 39 | 40 | // Retrieve a source location representing the first character within a source range. 41 | func (sr SourceRange) Start() SourceLocation { 42 | return SourceLocation{C.clang_getRangeStart(sr.c)} 43 | } 44 | 45 | // Retrieve a source location representing the last character within a source range. 46 | func (sr SourceRange) End() SourceLocation { 47 | return SourceLocation{C.clang_getRangeEnd(sr.c)} 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/sourcerangelist_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import ( 7 | "reflect" 8 | "unsafe" 9 | ) 10 | 11 | // Identifies an array of ranges. 12 | type SourceRangeList struct { 13 | c C.CXSourceRangeList 14 | } 15 | 16 | // The number of ranges in the ranges array. 17 | func (srl SourceRangeList) Count() uint32 { 18 | return uint32(srl.c.count) 19 | } 20 | 21 | // An array of CXSourceRanges. 22 | func (srl SourceRangeList) Ranges() []SourceRange { 23 | var s []SourceRange 24 | gos_s := (*reflect.SliceHeader)(unsafe.Pointer(&s)) 25 | gos_s.Cap = int(srl.c.count) 26 | gos_s.Len = int(srl.c.count) 27 | gos_s.Data = uintptr(unsafe.Pointer(srl.c.ranges)) 28 | 29 | return s 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/storageclass_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Represents the storage classes as declared in the source. CX_SC_Invalid was added for the case that the passed cursor in not a declaration. 9 | type StorageClass uint32 10 | 11 | const ( 12 | SC_Invalid StorageClass = C.CX_SC_Invalid 13 | SC_None = C.CX_SC_None 14 | SC_Extern = C.CX_SC_Extern 15 | SC_Static = C.CX_SC_Static 16 | SC_PrivateExtern = C.CX_SC_PrivateExtern 17 | SC_OpenCLWorkGroupLocal = C.CX_SC_OpenCLWorkGroupLocal 18 | SC_Auto = C.CX_SC_Auto 19 | SC_Register = C.CX_SC_Register 20 | ) 21 | 22 | func (sc StorageClass) Spelling() string { 23 | switch sc { 24 | case SC_Invalid: 25 | return "SC=Invalid" 26 | case SC_None: 27 | return "SC=None" 28 | case SC_Extern: 29 | return "SC=Extern" 30 | case SC_Static: 31 | return "SC=Static" 32 | case SC_PrivateExtern: 33 | return "SC=PrivateExtern" 34 | case SC_OpenCLWorkGroupLocal: 35 | return "SC=OpenCLWorkGroupLocal" 36 | case SC_Auto: 37 | return "SC=Auto" 38 | case SC_Register: 39 | return "SC=Register" 40 | } 41 | 42 | return fmt.Sprintf("StorageClass unkown %d", int(sc)) 43 | } 44 | 45 | func (sc StorageClass) String() string { 46 | return sc.Spelling() 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/string_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/CXString.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | /* 8 | A character string. 9 | 10 | The CXString type is used to return strings from the interface when 11 | the ownership of that string might differ from one call to the next. 12 | Use clang_getCString() to retrieve the string data and, once finished 13 | with the string data, call clang_disposeString() to free the string. 14 | */ 15 | type String struct { 16 | c C.CXString 17 | } 18 | 19 | func (s String) Private_flags() uint32 { 20 | return uint32(s.c.private_flags) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/stringset_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/CXString.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import ( 7 | "reflect" 8 | "unsafe" 9 | ) 10 | 11 | type StringSet struct { 12 | c C.CXStringSet 13 | } 14 | 15 | func (ss StringSet) Strings() []cxstring { 16 | var s []cxstring 17 | gos_s := (*reflect.SliceHeader)(unsafe.Pointer(&s)) 18 | gos_s.Cap = int(ss.c.Count) 19 | gos_s.Len = int(ss.c.Count) 20 | gos_s.Data = uintptr(unsafe.Pointer(ss.c.Strings)) 21 | 22 | return s 23 | } 24 | 25 | func (ss StringSet) Count() uint32 { 26 | return uint32(ss.c.Count) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/token_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Describes a single preprocessing token. 8 | type Token struct { 9 | c C.CXToken 10 | } 11 | 12 | // Determine the kind of the given token. 13 | func (t Token) Kind() TokenKind { 14 | return TokenKind(C.clang_getTokenKind(t.c)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/tokenkind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | // Describes a kind of token. 9 | type TokenKind uint32 10 | 11 | const ( 12 | // A token that contains some kind of punctuation. 13 | Token_Punctuation TokenKind = C.CXToken_Punctuation 14 | // A language keyword. 15 | Token_Keyword = C.CXToken_Keyword 16 | // An identifier (that is not a keyword). 17 | Token_Identifier = C.CXToken_Identifier 18 | // A numeric, string, or character literal. 19 | Token_Literal = C.CXToken_Literal 20 | // A comment. 21 | Token_Comment = C.CXToken_Comment 22 | ) 23 | 24 | func (tk TokenKind) Spelling() string { 25 | switch tk { 26 | case Token_Punctuation: 27 | return "Token=Punctuation" 28 | case Token_Keyword: 29 | return "Token=Keyword" 30 | case Token_Identifier: 31 | return "Token=Identifier" 32 | case Token_Literal: 33 | return "Token=Literal" 34 | case Token_Comment: 35 | return "Token=Comment" 36 | } 37 | 38 | return fmt.Sprintf("TokenKind unkown %d", int(tk)) 39 | } 40 | 41 | func (tk TokenKind) String() string { 42 | return tk.Spelling() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/turesourceusage_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import ( 7 | "reflect" 8 | "unsafe" 9 | ) 10 | 11 | // The memory usage of a CXTranslationUnit, broken into categories. 12 | type TUResourceUsage struct { 13 | c C.CXTUResourceUsage 14 | } 15 | 16 | func (turu TUResourceUsage) Dispose() { 17 | C.clang_disposeCXTUResourceUsage(turu.c) 18 | } 19 | 20 | func (turu TUResourceUsage) NumEntries() uint32 { 21 | return uint32(turu.c.numEntries) 22 | } 23 | 24 | func (turu TUResourceUsage) Entries() []TUResourceUsageEntry { 25 | var s []TUResourceUsageEntry 26 | gos_s := (*reflect.SliceHeader)(unsafe.Pointer(&s)) 27 | gos_s.Cap = int(turu.c.numEntries) 28 | gos_s.Len = int(turu.c.numEntries) 29 | gos_s.Data = uintptr(unsafe.Pointer(turu.c.entries)) 30 | 31 | return s 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/turesourceusageentry_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | type TUResourceUsageEntry struct { 8 | c C.CXTUResourceUsageEntry 9 | } 10 | 11 | func (turue TUResourceUsageEntry) Kind() TUResourceUsageKind { 12 | return TUResourceUsageKind(turue.c.kind) 13 | } 14 | 15 | func (turue TUResourceUsageEntry) Amount() uint64 { 16 | return uint64(turue.c.amount) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/unsavedfile.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "go-clang.h" 4 | import "C" 5 | 6 | func NewUnsavedFile(filename string, contents string) UnsavedFile { 7 | return UnsavedFile{ 8 | C.struct_CXUnsavedFile{ 9 | Filename: C.CString(filename), 10 | Contents: C.CString(contents), 11 | Length: C.ulong(len(contents)), 12 | }, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/unsavedfile_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | /* 8 | Provides the contents of a file that has not yet been saved to disk. 9 | 10 | Each CXUnsavedFile instance provides the name of a file on the 11 | system along with the current contents of that file that have not 12 | yet been saved to disk. 13 | */ 14 | type UnsavedFile struct { 15 | c C.struct_CXUnsavedFile 16 | } 17 | 18 | /* 19 | The file whose contents have not yet been saved. 20 | 21 | This file must already exist in the file system. 22 | */ 23 | func (uf UnsavedFile) Filename() string { 24 | return C.GoString(uf.c.Filename) 25 | } 26 | 27 | // A buffer containing the unsaved contents of this file. 28 | func (uf UnsavedFile) Contents() string { 29 | return C.GoString(uf.c.Contents) 30 | } 31 | 32 | // The length of the unsaved contents of this buffer. 33 | func (uf UnsavedFile) Length() uint64 { 34 | return uint64(uf.c.Length) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/version_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | 7 | // Describes a version number of the form major.minor.subminor. 8 | type Version struct { 9 | c C.CXVersion 10 | } 11 | 12 | // The major version number, e.g., the '10' in '10.7.3'. A negative value indicates that there is no version number at all. 13 | func (v Version) Major() int32 { 14 | return int32(v.c.Major) 15 | } 16 | 17 | // The minor version number, e.g., the '7' in '10.7.3'. This value will be negative if no minor version number was provided, e.g., for version '10'. 18 | func (v Version) Minor() int32 { 19 | return int32(v.c.Minor) 20 | } 21 | 22 | // The subminor version number, e.g., the '3' in '10.7.3'. This value will be negative if no minor or subminor version number was provided, e.g., in version '10' or '10.7'. 23 | func (v Version) Subminor() int32 { 24 | return int32(v.c.Subminor) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/visibilitykind_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type VisibilityKind uint32 9 | 10 | const ( 11 | // This value indicates that no visibility information is available for a provided CXCursor. 12 | Visibility_Invalid VisibilityKind = C.CXVisibility_Invalid 13 | // Symbol not seen by the linker. 14 | Visibility_Hidden = C.CXVisibility_Hidden 15 | // Symbol seen by the linker but resolves to a symbol inside this object. 16 | Visibility_Protected = C.CXVisibility_Protected 17 | // Symbol seen by the linker and acts like a normal symbol. 18 | Visibility_Default = C.CXVisibility_Default 19 | ) 20 | 21 | func (vk VisibilityKind) Spelling() string { 22 | switch vk { 23 | case Visibility_Invalid: 24 | return "Visibility=Invalid" 25 | case Visibility_Hidden: 26 | return "Visibility=Hidden" 27 | case Visibility_Protected: 28 | return "Visibility=Protected" 29 | case Visibility_Default: 30 | return "Visibility=Default" 31 | } 32 | 33 | return fmt.Sprintf("VisibilityKind unkown %d", int(vk)) 34 | } 35 | 36 | func (vk VisibilityKind) String() string { 37 | return vk.Spelling() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/go-clang/v3.9/clang/visitorresult_gen.go: -------------------------------------------------------------------------------- 1 | package clang 2 | 3 | // #include "./clang-c/Index.h" 4 | // #include "go-clang.h" 5 | import "C" 6 | import "fmt" 7 | 8 | type VisitorResult uint32 9 | 10 | const ( 11 | Visit_Break VisitorResult = C.CXVisit_Break 12 | Visit_Continue = C.CXVisit_Continue 13 | ) 14 | 15 | func (vr VisitorResult) Spelling() string { 16 | switch vr { 17 | case Visit_Break: 18 | return "Visit=Break" 19 | case Visit_Continue: 20 | return "Visit=Continue" 21 | } 22 | 23 | return fmt.Sprintf("VisitorResult unkown %d", int(vr)) 24 | } 25 | 26 | func (vr VisitorResult) String() string { 27 | return vr.Spelling() 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.[568ao] 3 | *.ao 4 | *.so 5 | *.pyc 6 | ._* 7 | .nfs.* 8 | [568a].out 9 | *~ 10 | *.orig 11 | core 12 | _obj 13 | _test 14 | _testmain.go 15 | protoc-gen-go/testdata/multi/*.pb.go 16 | _conformance/_conformance 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.6.x 5 | - 1.7.x 6 | - 1.8.x 7 | 8 | install: 9 | - go get -v -d -t github.com/golang/protobuf/... 10 | - curl -L https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip -o /tmp/protoc.zip 11 | - unzip /tmp/protoc.zip -d $HOME/protoc 12 | 13 | env: 14 | - PATH=$HOME/protoc/bin:$PATH 15 | 16 | script: 17 | - make all test 18 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/map_test.go: -------------------------------------------------------------------------------- 1 | package proto_test 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/golang/protobuf/proto" 8 | ppb "github.com/golang/protobuf/proto/proto3_proto" 9 | ) 10 | 11 | func marshalled() []byte { 12 | m := &ppb.IntMaps{} 13 | for i := 0; i < 1000; i++ { 14 | m.Maps = append(m.Maps, &ppb.IntMap{ 15 | Rtt: map[int32]int32{1: 2}, 16 | }) 17 | } 18 | b, err := proto.Marshal(m) 19 | if err != nil { 20 | panic(fmt.Sprintf("Can't marshal %+v: %v", m, err)) 21 | } 22 | return b 23 | } 24 | 25 | func BenchmarkConcurrentMapUnmarshal(b *testing.B) { 26 | in := marshalled() 27 | b.RunParallel(func(pb *testing.PB) { 28 | for pb.Next() { 29 | var out ppb.IntMaps 30 | if err := proto.Unmarshal(in, &out); err != nil { 31 | b.Errorf("Can't unmarshal ppb.IntMaps: %v", err) 32 | } 33 | } 34 | }) 35 | } 36 | 37 | func BenchmarkSequentialMapUnmarshal(b *testing.B) { 38 | in := marshalled() 39 | b.ResetTimer() 40 | for i := 0; i < b.N; i++ { 41 | var out ppb.IntMaps 42 | if err := proto.Unmarshal(in, &out); err != nil { 43 | b.Errorf("Can't unmarshal ppb.IntMaps: %v", err) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/snappytool/snappytool 2 | testdata/bench 3 | 4 | # These explicitly listed benchmark data files are for an obsolete version of 5 | # snappy_test.go. 6 | testdata/alice29.txt 7 | testdata/asyoulik.txt 8 | testdata/fireworks.jpeg 9 | testdata/geo.protodata 10 | testdata/html 11 | testdata/html_x_4 12 | testdata/kppkn.gtb 13 | testdata/lcet10.txt 14 | testdata/paper-100k.pdf 15 | testdata/plrabn12.txt 16 | testdata/urls.10K 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who can contribute 2 | # (and typically have contributed) code to the Snappy-Go repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. For example, Google employees are listed here 5 | # but not in AUTHORS, because Google holds the copyright. 6 | # 7 | # The submission process automatically checks to make sure 8 | # that people submitting code are listed in this file (by email address). 9 | # 10 | # Names should be added to this file only after verifying that 11 | # the individual or the individual's organization has agreed to 12 | # the appropriate Contributor License Agreement, found here: 13 | # 14 | # http://code.google.com/legal/individual-cla-v1.0.html 15 | # http://code.google.com/legal/corporate-cla-v1.0.html 16 | # 17 | # The agreement for individuals can be filled out on the web. 18 | # 19 | # When adding J Random Contributor's name to this file, 20 | # either J's name or J's organization's name should be 21 | # added to the AUTHORS file, depending on whether the 22 | # individual or corporate CLA was used. 23 | 24 | # Names should be added to this file like so: 25 | # Name 26 | 27 | # Please keep the list sorted. 28 | 29 | Damian Gryski 30 | Jan Mercl <0xjnml@gmail.com> 31 | Kai Backman 32 | Marc-Antoine Ruel 33 | Nigel Tao 34 | Rob Pike 35 | Rodolfo Carvalho 36 | Russ Cox 37 | Sebastien Binet 38 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-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 !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-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 !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/.gitignore: -------------------------------------------------------------------------------- 1 | *_wire.txt 2 | *_wire.bin 3 | .DS_Store 4 | *.o 5 | *.o.d 6 | *.class 7 | *.a 8 | *~ 9 | *.vcxproj 10 | *.vcxproj.filters 11 | *.vcxproj.user 12 | *.sln 13 | *.suo 14 | *.keystore 15 | **/bin/** 16 | **/gen/** 17 | **/libs/** 18 | **/obj/** 19 | **/*.dir/** 20 | **/CMakeFiles/** 21 | **/cmake_install.cmake 22 | **/install_manifest.txt 23 | **/CMakeCache.txt 24 | **/CMakeTestfile.cmake 25 | **/Debug/** 26 | **/Release/** 27 | build.xml 28 | local.properties 29 | project.properties 30 | proguard-project.txt 31 | linklint_results 32 | Makefile 33 | flatc 34 | flatc.exe 35 | flathash 36 | flathash.exe 37 | flattests 38 | flattests.exe 39 | flatsamplebinary 40 | flatsamplebinary.exe 41 | flatsampletext 42 | flatsampletext.exe 43 | grpctest 44 | grpctest.exe 45 | snapshot.sh 46 | tests/go_gen 47 | tests/monsterdata_java_wire.mon 48 | tests/monsterdata_go_wire.mon 49 | tests/monsterdata_javascript_wire.mon 50 | tests/unicode_test.mon 51 | tests/ts/ 52 | CMakeLists.txt.user 53 | CMakeScripts/** 54 | CTestTestfile.cmake 55 | FlatBuffers.cbp 56 | build/Xcode/FlatBuffers.xcodeproj/project.xcworkspace/** 57 | build/Xcode/FlatBuffers.xcodeproj/xcuserdata/** 58 | FlatBuffers.xcodeproj/ 59 | java/.idea 60 | java/*.iml 61 | .idea 62 | *.iml 63 | target 64 | **/*.pyc 65 | build/VS2010/FlatBuffers.sdf 66 | build/VS2010/FlatBuffers.opensdf 67 | build/VS2010/ipch/**/*.ipch 68 | *.so 69 | Testing/Temporary 70 | .cproject 71 | .settings/ 72 | .project 73 | net/**/obj 74 | node_modules/ 75 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - linux 5 | - osx 6 | 7 | compiler: 8 | - gcc 9 | #- clang 10 | 11 | env: 12 | matrix: 13 | - BUILD_TYPE=Debug BIICODE=false 14 | - BUILD_TYPE=Release BIICODE=false 15 | # biicode .deb files no longer available. 16 | # - BUILD_TYPE=Release BIICODE=true 17 | # - BUILD_TYPE=Debug BIICODE=true 18 | global: 19 | - GCC_VERSION="4.9" 20 | 21 | before_install: 22 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi 23 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi 24 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi 25 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq gcc-$GCC_VERSION; fi 26 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi 27 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi 28 | 29 | script: 30 | - if [ "$BIICODE" == "false" ]; then cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE . && make && make test; fi 31 | - if [ "$BIICODE" == "true" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then ./biicode/support/bii-travis.sh $BUILD_TYPE; fi 32 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/biicode.conf: -------------------------------------------------------------------------------- 1 | # Biicode configuration file 2 | [paths] 3 | include 4 | [mains] 5 | !android/* 6 | [tests] 7 | tests/* 8 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "google/flatbuffers", 3 | "type": "library", 4 | "description": "FlatBuffers for PHP", 5 | "keywords": ["google", "flatbuffers", "serialization"], 6 | "homepage": "https://github.com/google/flatbuffers", 7 | "license": "Apache-2.0", 8 | "require": { 9 | "php": ">=5.4" 10 | }, 11 | "require-dev": { 12 | }, 13 | "autoload": { 14 | "psr-4": { 15 | "Google\\FlatBuffers\\": "php" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/go/doc.go: -------------------------------------------------------------------------------- 1 | // Package flatbuffers provides facilities to read and write flatbuffers 2 | // objects. 3 | package flatbuffers 4 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/go/grpc.go: -------------------------------------------------------------------------------- 1 | package flatbuffers 2 | 3 | // Codec implements gRPC-go Codec which is used to encode and decode messages. 4 | var Codec = "flatbuffers" 5 | 6 | type FlatbuffersCodec struct{} 7 | 8 | func (FlatbuffersCodec) Marshal(v interface{}) ([]byte, error) { 9 | return v.(*Builder).FinishedBytes(), nil 10 | } 11 | 12 | func (FlatbuffersCodec) Unmarshal(data []byte, v interface{}) error { 13 | v.(flatbuffersInit).Init(data, GetUOffsetT(data)) 14 | return nil 15 | } 16 | 17 | func (FlatbuffersCodec) String() string { 18 | return Codec 19 | } 20 | 21 | type flatbuffersInit interface { 22 | Init(data []byte, i UOffsetT) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/go/lib.go: -------------------------------------------------------------------------------- 1 | package flatbuffers 2 | 3 | // FlatBuffer is the interface that represents a flatbuffer. 4 | type FlatBuffer interface { 5 | Table() Table 6 | Init(buf []byte, i UOffsetT) 7 | } 8 | 9 | // GetRootAs is a generic helper to initialize a FlatBuffer with the provided buffer bytes and its data offset. 10 | func GetRootAs(buf []byte, offset UOffsetT, fb FlatBuffer) { 11 | n := GetUOffsetT(buf[offset:]) 12 | fb.Init(buf, n+offset) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/go/struct.go: -------------------------------------------------------------------------------- 1 | package flatbuffers 2 | 3 | // Struct wraps a byte slice and provides read access to its data. 4 | // 5 | // Structs do not have a vtable. 6 | type Struct struct { 7 | Table 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/google/flatbuffers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flatbuffers", 3 | "version": "1.7.0", 4 | "description": "Memory Efficient Serialization Library", 5 | "files": ["js/flatbuffers.js"], 6 | "main": "js/flatbuffers.js", 7 | "directories": { 8 | "doc": "docs", 9 | "test": "tests" 10 | }, 11 | "scripts": { 12 | "test": "tests/JavaScriptTest.sh" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/google/flatbuffers.git" 17 | }, 18 | "keywords": [ 19 | "flatbuffers" 20 | ], 21 | "author": "The FlatBuffers project", 22 | "license": "SEE LICENSE IN LICENSE.txt", 23 | "bugs": { 24 | "url": "https://github.com/google/flatbuffers/issues" 25 | }, 26 | "homepage": "https://google.github.io/flatbuffers/" 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/.gitignore: -------------------------------------------------------------------------------- 1 | *.test -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | language: go 4 | 5 | os: 6 | - linux 7 | - osx 8 | 9 | osx_image: xcode7.2 10 | 11 | go: 12 | - 1.6 13 | - 1.5 14 | 15 | env: 16 | - ARCH=x86_64 17 | - ARCH=i686 18 | 19 | script: 20 | - diff -au <(gofmt -d .) <(printf "") 21 | - go test -race -v ./... 22 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/appveyor.yml: -------------------------------------------------------------------------------- 1 | # version format 2 | version: "{build}" 3 | 4 | # Operating system (build VM template) 5 | os: Windows Server 2012 R2 6 | 7 | # Platform. 8 | platform: x64 9 | 10 | clone_folder: c:\gopath\src\github.com\minio\blake2b-simd 11 | 12 | # environment variables 13 | environment: 14 | GOPATH: c:\gopath 15 | GO15VENDOREXPERIMENT: 1 16 | 17 | # scripts that run after cloning repository 18 | install: 19 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 20 | - go version 21 | - go env 22 | 23 | # to run your custom scripts instead of automatic MSBuild 24 | build_script: 25 | - go test . 26 | - go test -race . 27 | 28 | # to disable automatic tests 29 | test: off 30 | 31 | # to disable deployment 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/compressAvx_amd64.go: -------------------------------------------------------------------------------- 1 | //+build !noasm 2 | //+build !appengine 3 | 4 | /* 5 | * Minio Cloud Storage, (C) 2016 Minio, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package blake2b 21 | 22 | //go:noescape 23 | func blockAVXLoop(p []uint8, in, iv, t, f, shffle, out []uint64) 24 | 25 | func compressAVX(d *digest, p []uint8) { 26 | var ( 27 | in [8]uint64 28 | out [8]uint64 29 | shffle [2]uint64 30 | ) 31 | 32 | // vector for PSHUFB instruction 33 | shffle[0] = 0x0201000706050403 34 | shffle[1] = 0x0a09080f0e0d0c0b 35 | 36 | in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7] = d.h[0], d.h[1], d.h[2], d.h[3], d.h[4], d.h[5], d.h[6], d.h[7] 37 | 38 | blockAVXLoop(p, in[:], iv[:], d.t[:], d.f[:], shffle[:], out[:]) 39 | 40 | d.h[0], d.h[1], d.h[2], d.h[3], d.h[4], d.h[5], d.h[6], d.h[7] = out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7] 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/compressSse_amd64.go: -------------------------------------------------------------------------------- 1 | //+build !noasm 2 | //+build !appengine 3 | 4 | /* 5 | * Minio Cloud Storage, (C) 2016 Minio, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package blake2b 21 | 22 | //go:noescape 23 | func blockSSELoop(p []uint8, in, iv, t, f, shffle, out []uint64) 24 | 25 | func compressSSE(d *digest, p []uint8) { 26 | var ( 27 | in [8]uint64 28 | out [8]uint64 29 | shffle [2]uint64 30 | ) 31 | 32 | // vector for PSHUFB instruction 33 | shffle[0] = 0x0201000706050403 34 | shffle[1] = 0x0a09080f0e0d0c0b 35 | 36 | in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7] = d.h[0], d.h[1], d.h[2], d.h[3], d.h[4], d.h[5], d.h[6], d.h[7] 37 | 38 | blockSSELoop(p, in[:], iv[:], d.t[:], d.f[:], shffle[:], out[:]) 39 | 40 | d.h[0], d.h[1], d.h[2], d.h[3], d.h[4], d.h[5], d.h[6], d.h[7] = out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7] 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/compress_amd64.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Cloud Storage, (C) 2016 Minio, Inc. 3 | * 4 | * Licensed under the Apache 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 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package blake2b 18 | 19 | func compress(d *digest, p []uint8) { 20 | // Verifies if AVX2 or AVX is available, use optimized code path. 21 | if avx2 { 22 | compressAVX2(d, p) 23 | } else if avx { 24 | compressAVX(d, p) 25 | } else if ssse3 { 26 | compressSSE(d, p) 27 | } else { 28 | compressGeneric(d, p) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/compress_noasm.go: -------------------------------------------------------------------------------- 1 | //+build !amd64 noasm appengine 2 | 3 | /* 4 | * Minio Cloud Storage, (C) 2016 Minio, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package blake2b 20 | 21 | func compress(d *digest, p []uint8) { 22 | compressGeneric(d, p) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/cpuid_386.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. 2 | 3 | // +build 386,!gccgo 4 | 5 | // func cpuid(op uint32) (eax, ebx, ecx, edx uint32) 6 | TEXT ·cpuid(SB), 7, $0 7 | XORL CX, CX 8 | MOVL op+0(FP), AX 9 | CPUID 10 | MOVL AX, eax+4(FP) 11 | MOVL BX, ebx+8(FP) 12 | MOVL CX, ecx+12(FP) 13 | MOVL DX, edx+16(FP) 14 | RET 15 | 16 | // func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) 17 | TEXT ·cpuidex(SB), 7, $0 18 | MOVL op+0(FP), AX 19 | MOVL op2+4(FP), CX 20 | CPUID 21 | MOVL AX, eax+8(FP) 22 | MOVL BX, ebx+12(FP) 23 | MOVL CX, ecx+16(FP) 24 | MOVL DX, edx+20(FP) 25 | RET 26 | 27 | // func xgetbv(index uint32) (eax, edx uint32) 28 | TEXT ·xgetbv(SB), 7, $0 29 | MOVL index+0(FP), CX 30 | BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV 31 | MOVL AX, eax+4(FP) 32 | MOVL DX, edx+8(FP) 33 | RET 34 | -------------------------------------------------------------------------------- /vendor/github.com/minio/blake2b-simd/cpuid_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. 2 | 3 | // +build amd64,!gccgo 4 | 5 | // func cpuid(op uint32) (eax, ebx, ecx, edx uint32) 6 | TEXT ·cpuid(SB), 7, $0 7 | XORQ CX, CX 8 | MOVL op+0(FP), AX 9 | CPUID 10 | MOVL AX, eax+8(FP) 11 | MOVL BX, ebx+12(FP) 12 | MOVL CX, ecx+16(FP) 13 | MOVL DX, edx+20(FP) 14 | RET 15 | 16 | 17 | // func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) 18 | TEXT ·cpuidex(SB), 7, $0 19 | MOVL op+0(FP), AX 20 | MOVL op2+4(FP), CX 21 | CPUID 22 | MOVL AX, eax+8(FP) 23 | MOVL BX, ebx+12(FP) 24 | MOVL CX, ecx+16(FP) 25 | MOVL DX, edx+20(FP) 26 | RET 27 | 28 | // func xgetbv(index uint32) (eax, edx uint32) 29 | TEXT ·xgetbv(SB), 7, $0 30 | MOVL index+0(FP), CX 31 | BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV 32 | MOVL AX, eax+8(FP) 33 | MOVL DX, edx+12(FP) 34 | RET 35 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - tip 10 | 11 | script: 12 | - go test -v ./... 13 | -------------------------------------------------------------------------------- /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/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/bench_test.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package errors 4 | 5 | import ( 6 | "fmt" 7 | "testing" 8 | 9 | stderrors "errors" 10 | ) 11 | 12 | func noErrors(at, depth int) error { 13 | if at >= depth { 14 | return stderrors.New("no error") 15 | } 16 | return noErrors(at+1, depth) 17 | } 18 | 19 | func yesErrors(at, depth int) error { 20 | if at >= depth { 21 | return New("ye error") 22 | } 23 | return yesErrors(at+1, depth) 24 | } 25 | 26 | // GlobalE is an exported global to store the result of benchmark results, 27 | // preventing the compiler from optimising the benchmark functions away. 28 | var GlobalE error 29 | 30 | func BenchmarkErrors(b *testing.B) { 31 | type run struct { 32 | stack int 33 | std bool 34 | } 35 | runs := []run{ 36 | {10, false}, 37 | {10, true}, 38 | {100, false}, 39 | {100, true}, 40 | {1000, false}, 41 | {1000, true}, 42 | } 43 | for _, r := range runs { 44 | part := "pkg/errors" 45 | if r.std { 46 | part = "errors" 47 | } 48 | name := fmt.Sprintf("%s-stack-%d", part, r.stack) 49 | b.Run(name, func(b *testing.B) { 50 | var err error 51 | f := yesErrors 52 | if r.std { 53 | f = noErrors 54 | } 55 | b.ReportAllocs() 56 | for i := 0; i < b.N; i++ { 57 | err = f(0, r.stack) 58 | } 59 | b.StopTimer() 60 | GlobalE = err 61 | }) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/osutil/.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | shallow_clone: true 4 | 5 | # Source Config 6 | clone_folder: c:\gopath\src\github.com\pkgutil\osutil 7 | 8 | # Build host 9 | environment: 10 | GOPATH: c:\gopath 11 | GOVERSION: 1.8 12 | 13 | init: 14 | - git config --global core.autocrlf input 15 | 16 | # Install 17 | install: 18 | # Install the specific Go version. 19 | - rmdir c:\go /s /q 20 | - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi 21 | - msiexec /i go%GOVERSION%.windows-amd64.msi /q 22 | - set Path=c:\go\bin;c:\gopath\bin;%Path% 23 | - go version 24 | - go env 25 | 26 | # Build 27 | build: false 28 | 29 | # Test 30 | before_test: 31 | - go get -u github.com/golang/lint/golint 32 | - go get -u github.com/haya14busa/goverage 33 | test_script: 34 | - goverage -v -race -coverprofile=coverage.txt -covermode=atomic ./... 35 | after_test: 36 | - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" 37 | - pip install -U codecov 38 | - codecov 39 | - gofmt -s -l -w . 40 | - golint ./... 41 | - go vet ./... 42 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/osutil/.gitignore: -------------------------------------------------------------------------------- 1 | # osutil project generated files to ignore 2 | # if you want to ignore files created by your editor/tools, 3 | # please consider a global .gitignore https://help.github.com/articles/ignoring-files 4 | # please do not open a pull request to add something created by your editor or tools 5 | # 6 | # github/gitignore/Go.gitignore 7 | # Binaries for programs and plugins 8 | *.exe 9 | *.dll 10 | *.so 11 | *.dylib 12 | 13 | # Test binary, build with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/osutil/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | dist: trusty 3 | 4 | language: go 5 | go: 6 | - 1.8 7 | - tip 8 | 9 | matrix: 10 | fast_finish: true 11 | allow_failures: 12 | - go: tip 13 | 14 | before_install: 15 | - uname -a 16 | - go version 17 | - go env 18 | install: 19 | - true 20 | 21 | before_script: 22 | - go get -u github.com/golang/lint/golint 23 | - go get -u github.com/haya14busa/goverage 24 | script: 25 | - goverage -v -race -coverprofile=coverage.txt -covermode=atomic ./... 26 | after_script: 27 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 28 | - test -z "$(golint ./... | tee /dev/stderr)" 29 | - go vet ./... 30 | 31 | after_success: 32 | - bash <(curl -s https://codecov.io/bash) 33 | 34 | notifications: 35 | email: false 36 | slack: 37 | on_success: never 38 | on_failure: always 39 | rooms: 40 | secure: gUHxPJTw1qapP93Hp0zQNesORAGLq/p6PPIRHOpaIG0lbgpYgcF63JUksjEm6CjPpe4IThKRbrXzMxilQlFUc5Y73P+Cje9tPXWNnjyQmtg3L1djK3CSI7YoR2aCt5DOZgWOU554jojLHekJXqmJG9UwDM22X2Xf7M7cbtPl3zLHbDxYbaR1G1WK3Plpv8piW+tehdUBvXL2RFs6F83lrkrvkJNgdC9XYa2n+PUk9Qec6K6+915eSKuJtTfiiay4ZgZVAZZljgtI/eFXmGWvNQg6nNY5S7rqZZPkgb0cJzwlKpkj4AOZj1+sx8mwAhZqwgiQNDEnHoEzHydhrKxQre5cj01oh5DSDKUvkfuP8Ej+Ti4R1n+TuwbNAj+XPb89h+7T77hCy21VKwFyg1ajuGNPx4wrYdj90FU3PniSPoah8N0jxMCoyB659gJV/ukH/Oz0xJo1+jFitdzt4fEZI8OGrwJpmzW2VOE4SEyJQ8CyuIdELzvyCK3GxBh4iHYZtd7foLBLdzR5wVvykRrhJBy3xi71jhMDsjI/yR7XfJT0ylrFglmz6lPRg6mHKD090x4DsoxiXMiIWmUx64Lx+xHhSIK8dWcJQSciAoDhgDMwKIVIf0ZXNcF6GCQrunnFGZQ5d2Dz0spARbUQZznC9oQ8Hvt5yYbDr0HBG9T2VD0= 41 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/osutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The pkgutil 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 osutil provides the operating system-specific path information utility functions. 6 | package osutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/osutil/osutil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The pkgutil 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 osutil 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | // IsExist reports whether the filename is exists. 12 | func IsExist(filename string) bool { 13 | _, err := os.Stat(filename) 14 | return err == nil 15 | } 16 | 17 | // IsNotExist reports whether the filename is not exists. 18 | func IsNotExist(filename string) bool { 19 | _, err := os.Stat(filename) 20 | return err != nil && os.IsNotExist(err) 21 | } 22 | 23 | // IsDirExist reports whether dir exists and which is directory. 24 | func IsDirExist(dir string) bool { 25 | fi, err := os.Stat(dir) 26 | return err == nil && fi.IsDir() 27 | } 28 | 29 | // MkdirAll checks whether the exist dir directory and create directory to dir filepath if not exist. 30 | func MkdirAll(dir string, perm os.FileMode) error { 31 | if !IsDirExist(dir) { 32 | if err := os.MkdirAll(dir, perm); err != nil { 33 | return err 34 | } 35 | } 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/stringsutil/.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | shallow_clone: true 4 | 5 | # Source Config 6 | clone_folder: c:\gopath\src\github.com\pkgutil\stringsutil 7 | 8 | # Build host 9 | environment: 10 | GOPATH: c:\gopath 11 | GOVERSION: 1.8 12 | 13 | init: 14 | - git config --global core.autocrlf input 15 | 16 | # Install 17 | install: 18 | # Install the specific Go version. 19 | - rmdir c:\go /s /q 20 | - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi 21 | - msiexec /i go%GOVERSION%.windows-amd64.msi /q 22 | - set Path=c:\go\bin;c:\gopath\bin;%Path% 23 | - go version 24 | - go env 25 | 26 | # Build 27 | build: false 28 | 29 | # Test 30 | before_test: 31 | - go get -u github.com/golang/lint/golint 32 | - go get -u github.com/haya14busa/goverage 33 | test_script: 34 | - goverage -v -race -coverprofile=coverage.txt -covermode=atomic ./... 35 | after_test: 36 | - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" 37 | - pip install -U codecov 38 | - codecov 39 | - gofmt -s -l -w . 40 | - golint ./... 41 | - go vet ./... 42 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/stringsutil/.gitignore: -------------------------------------------------------------------------------- 1 | # stringsutil project generated files to ignore 2 | # if you want to ignore files created by your editor/tools, 3 | # please consider a global .gitignore https://help.github.com/articles/ignoring-files 4 | # please do not open a pull request to add something created by your editor or tools 5 | # 6 | # github/gitignore/Go.gitignore 7 | # Binaries for programs and plugins 8 | *.exe 9 | *.dll 10 | *.so 11 | *.dylib 12 | 13 | # Test binary, build with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/stringsutil/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | dist: trusty 3 | 4 | language: go 5 | go: 6 | - 1.8 7 | - tip 8 | 9 | matrix: 10 | fast_finish: true 11 | allow_failures: 12 | - go: tip 13 | 14 | before_install: 15 | - uname -a 16 | - go version 17 | - go env 18 | install: 19 | - true 20 | 21 | before_script: 22 | - go get -u github.com/golang/lint/golint 23 | - go get -u github.com/haya14busa/goverage 24 | script: 25 | - goverage -v -race -coverprofile=coverage.txt -covermode=atomic ./... 26 | after_script: 27 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 28 | - test -z "$(golint ./... | tee /dev/stderr)" 29 | - go vet ./... 30 | 31 | after_success: 32 | - bash <(curl -s https://codecov.io/bash) 33 | 34 | notifications: 35 | email: false 36 | slack: 37 | on_success: never 38 | on_failure: always 39 | rooms: 40 | secure: gUHxPJTw1qapP93Hp0zQNesORAGLq/p6PPIRHOpaIG0lbgpYgcF63JUksjEm6CjPpe4IThKRbrXzMxilQlFUc5Y73P+Cje9tPXWNnjyQmtg3L1djK3CSI7YoR2aCt5DOZgWOU554jojLHekJXqmJG9UwDM22X2Xf7M7cbtPl3zLHbDxYbaR1G1WK3Plpv8piW+tehdUBvXL2RFs6F83lrkrvkJNgdC9XYa2n+PUk9Qec6K6+915eSKuJtTfiiay4ZgZVAZZljgtI/eFXmGWvNQg6nNY5S7rqZZPkgb0cJzwlKpkj4AOZj1+sx8mwAhZqwgiQNDEnHoEzHydhrKxQre5cj01oh5DSDKUvkfuP8Ej+Ti4R1n+TuwbNAj+XPb89h+7T77hCy21VKwFyg1ajuGNPx4wrYdj90FU3PniSPoah8N0jxMCoyB659gJV/ukH/Oz0xJo1+jFitdzt4fEZI8OGrwJpmzW2VOE4SEyJQ8CyuIdELzvyCK3GxBh4iHYZtd7foLBLdzR5wVvykRrhJBy3xi71jhMDsjI/yR7XfJT0ylrFglmz6lPRg6mHKD090x4DsoxiXMiIWmUx64Lx+xHhSIK8dWcJQSciAoDhgDMwKIVIf0ZXNcF6GCQrunnFGZQ5d2Dz0spARbUQZznC9oQ8Hvt5yYbDr0HBG9T2VD0= 41 | -------------------------------------------------------------------------------- /vendor/github.com/pkgutil/stringsutil/stringsutil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The pkgutil 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 stringsutil 6 | 7 | import ( 8 | "sort" 9 | "strings" 10 | ) 11 | 12 | // BinarySearch reports whether s is within a with binary search. 13 | func BinarySearch(a []string, s string) bool { 14 | sort.Strings(a) 15 | i := sort.SearchStrings(a, s) 16 | return i < len(a) && a[i] == s 17 | } 18 | 19 | // MapSearch reports whether s is within a with map search. 20 | func MapSearch(a []string, s string) bool { 21 | set := make(map[string]bool, len(a)) 22 | for _, v := range a { 23 | set[v] = true 24 | } 25 | 26 | return set[s] 27 | } 28 | 29 | // IndexSlice returns the index of the first instance of s in a slice, or -1 if s is not present in a slice. 30 | func IndexSlice(a []string, substr string) int { 31 | for i, s := range a { 32 | if s == substr { 33 | return i 34 | } 35 | } 36 | return -1 37 | } 38 | 39 | // IndexContainsSlice returns the index of the first instance of substr is within a slice, or -1 if s is not present in a slice. 40 | func IndexContainsSlice(a []string, substr string) int { 41 | for i, s := range a { 42 | if strings.Contains(s, substr) { 43 | return i 44 | } 45 | } 46 | return -1 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - 1.7 8 | - tip 9 | 10 | script: 11 | - go test -timeout 1h ./... 12 | - go test -timeout 30m -race -run "TestDB_(Concurrent|GoleveldbIssue74)" ./leveldb 13 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Suryandaru Triandana 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 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/cache/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package cache 8 | 9 | import ( 10 | "math/rand" 11 | "testing" 12 | "time" 13 | ) 14 | 15 | func BenchmarkLRUCache(b *testing.B) { 16 | c := NewCache(NewLRU(10000)) 17 | 18 | b.SetParallelism(10) 19 | b.RunParallel(func(pb *testing.PB) { 20 | r := rand.New(rand.NewSource(time.Now().UnixNano())) 21 | 22 | for pb.Next() { 23 | key := uint64(r.Intn(1000000)) 24 | c.Get(0, key, func() (int, Value) { 25 | return 1, key 26 | }).Release() 27 | } 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package comparer 8 | 9 | import "bytes" 10 | 11 | type bytesComparer struct{} 12 | 13 | func (bytesComparer) Compare(a, b []byte) int { 14 | return bytes.Compare(a, b) 15 | } 16 | 17 | func (bytesComparer) Name() string { 18 | return "leveldb.BytewiseComparator" 19 | } 20 | 21 | func (bytesComparer) Separator(dst, a, b []byte) []byte { 22 | i, n := 0, len(a) 23 | if n > len(b) { 24 | n = len(b) 25 | } 26 | for ; i < n && a[i] == b[i]; i++ { 27 | } 28 | if i >= n { 29 | // Do not shorten if one string is a prefix of the other 30 | } else if c := a[i]; c < 0xff && c+1 < b[i] { 31 | dst = append(dst, a[:i+1]...) 32 | dst[i]++ 33 | return dst 34 | } 35 | return nil 36 | } 37 | 38 | func (bytesComparer) Successor(dst, b []byte) []byte { 39 | for i, c := range b { 40 | if c != 0xff { 41 | dst = append(dst, b[:i+1]...) 42 | dst[i]++ 43 | return dst 44 | } 45 | } 46 | return nil 47 | } 48 | 49 | // DefaultComparer are default implementation of the Comparer interface. 50 | // It uses the natural ordering, consistent with bytes.Compare. 51 | var DefaultComparer = bytesComparer{} 52 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/errors" 11 | ) 12 | 13 | // Common errors. 14 | var ( 15 | ErrNotFound = errors.ErrNotFound 16 | ErrReadOnly = errors.New("leveldb: read-only mode") 17 | ErrSnapshotReleased = errors.New("leveldb: snapshot released") 18 | ErrIterReleased = errors.New("leveldb: iterator released") 19 | ErrClosed = errors.New("leveldb: closed") 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/filter" 11 | ) 12 | 13 | type iFilter struct { 14 | filter.Filter 15 | } 16 | 17 | func (f iFilter) Contains(filter, key []byte) bool { 18 | return f.Filter.Contains(filter, internalKey(key).ukey()) 19 | } 20 | 21 | func (f iFilter) NewGenerator() filter.FilterGenerator { 22 | return iFilterGenerator{f.Filter.NewGenerator()} 23 | } 24 | 25 | type iFilterGenerator struct { 26 | filter.FilterGenerator 27 | } 28 | 29 | func (g iFilterGenerator) Add(key []byte) { 30 | g.FilterGenerator.Add(internalKey(key).ukey()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package iterator_test 8 | 9 | import ( 10 | . "github.com/onsi/ginkgo" 11 | 12 | . "github.com/syndtr/goleveldb/leveldb/iterator" 13 | "github.com/syndtr/goleveldb/leveldb/testutil" 14 | ) 15 | 16 | var _ = testutil.Defer(func() { 17 | Describe("Array iterator", func() { 18 | It("Should iterates and seeks correctly", func() { 19 | // Build key/value. 20 | kv := testutil.KeyValue_Generate(nil, 70, 1, 1, 5, 3, 3) 21 | 22 | // Test the iterator. 23 | t := testutil.IteratorTesting{ 24 | KeyValue: kv.Clone(), 25 | Iter: NewArrayIterator(kv), 26 | } 27 | testutil.DoIteratorTesting(&t) 28 | }) 29 | }) 30 | }) 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter_suite_test.go: -------------------------------------------------------------------------------- 1 | package iterator_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestIterator(t *testing.T) { 10 | testutil.RunSuite(t, "Iterator Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/leveldb_suite_test.go: -------------------------------------------------------------------------------- 1 | package leveldb 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestLevelDB(t *testing.T) { 10 | testutil.RunSuite(t, "LevelDB Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_suite_test.go: -------------------------------------------------------------------------------- 1 | package memdb 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestMemDB(t *testing.T) { 10 | testutil.RunSuite(t, "MemDB Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_nacl.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | // +build nacl 8 | 9 | package storage 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 17 | return nil, syscall.ENOTSUP 18 | } 19 | 20 | func setFileLock(f *os.File, readOnly, lock bool) error { 21 | return syscall.ENOTSUP 22 | } 23 | 24 | func rename(oldpath, newpath string) error { 25 | return syscall.ENOTSUP 26 | } 27 | 28 | func isErrInvalid(err error) bool { 29 | return false 30 | } 31 | 32 | func syncDir(name string) error { 33 | return syscall.ENOTSUP 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package storage 8 | 9 | import ( 10 | "os" 11 | "path/filepath" 12 | ) 13 | 14 | type plan9FileLock struct { 15 | f *os.File 16 | } 17 | 18 | func (fl *plan9FileLock) release() error { 19 | return fl.f.Close() 20 | } 21 | 22 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 23 | var ( 24 | flag int 25 | perm os.FileMode 26 | ) 27 | if readOnly { 28 | flag = os.O_RDONLY 29 | } else { 30 | flag = os.O_RDWR 31 | perm = os.ModeExclusive 32 | } 33 | f, err := os.OpenFile(path, flag, perm) 34 | if os.IsNotExist(err) { 35 | f, err = os.OpenFile(path, flag|os.O_CREATE, perm|0644) 36 | } 37 | if err != nil { 38 | return 39 | } 40 | fl = &plan9FileLock{f: f} 41 | return 42 | } 43 | 44 | func rename(oldpath, newpath string) error { 45 | if _, err := os.Stat(newpath); err == nil { 46 | if err := os.Remove(newpath); err != nil { 47 | return err 48 | } 49 | } 50 | 51 | _, fname := filepath.Split(newpath) 52 | return os.Rename(oldpath, fname) 53 | } 54 | 55 | func syncDir(name string) error { 56 | f, err := os.Open(name) 57 | if err != nil { 58 | return err 59 | } 60 | defer f.Close() 61 | if err := f.Sync(); err != nil { 62 | return err 63 | } 64 | return nil 65 | } 66 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/table/table_suite_test.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestTable(t *testing.T) { 10 | testutil.RunSuite(t, "Table Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The LevelDB-Go Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package util 7 | 8 | import ( 9 | "hash/crc32" 10 | ) 11 | 12 | var table = crc32.MakeTable(crc32.Castagnoli) 13 | 14 | // CRC is a CRC-32 checksum computed using Castagnoli's polynomial. 15 | type CRC uint32 16 | 17 | // NewCRC creates a new crc based on the given bytes. 18 | func NewCRC(b []byte) CRC { 19 | return CRC(0).Update(b) 20 | } 21 | 22 | // Update updates the crc with the given bytes. 23 | func (c CRC) Update(b []byte) CRC { 24 | return CRC(crc32.Update(uint32(c), table, b)) 25 | } 26 | 27 | // Value returns a masked crc. 28 | func (c CRC) Value() uint32 { 29 | return uint32(c>>15|c<<17) + 0xa282ead8 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // Hash return hash of the given data. 14 | func Hash(data []byte, seed uint32) uint32 { 15 | // Similar to murmur hash 16 | const ( 17 | m = uint32(0xc6a4a793) 18 | r = uint32(24) 19 | ) 20 | var ( 21 | h = seed ^ (uint32(len(data)) * m) 22 | i int 23 | ) 24 | 25 | for n := len(data) - len(data)%4; i < n; i += 4 { 26 | h += binary.LittleEndian.Uint32(data[i:]) 27 | h *= m 28 | h ^= (h >> 16) 29 | } 30 | 31 | switch len(data) - i { 32 | default: 33 | panic("not reached") 34 | case 3: 35 | h += uint32(data[i+2]) << 16 36 | fallthrough 37 | case 2: 38 | h += uint32(data[i+1]) << 8 39 | fallthrough 40 | case 1: 41 | h += uint32(data[i]) 42 | h *= m 43 | h ^= (h >> r) 44 | case 0: 45 | } 46 | 47 | return h 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/hash_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "testing" 11 | ) 12 | 13 | var hashTests = []struct { 14 | data []byte 15 | seed uint32 16 | hash uint32 17 | }{ 18 | {nil, 0xbc9f1d34, 0xbc9f1d34}, 19 | {[]byte{0x62}, 0xbc9f1d34, 0xef1345c4}, 20 | {[]byte{0xc3, 0x97}, 0xbc9f1d34, 0x5b663814}, 21 | {[]byte{0xe2, 0x99, 0xa5}, 0xbc9f1d34, 0x323c078f}, 22 | {[]byte{0xe1, 0x80, 0xb9, 0x32}, 0xbc9f1d34, 0xed21633a}, 23 | {[]byte{ 24 | 0x01, 0xc0, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 28 | 0x14, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x04, 0x00, 30 | 0x00, 0x00, 0x00, 0x14, 31 | 0x00, 0x00, 0x00, 0x18, 32 | 0x28, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 34 | 0x02, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 36 | }, 0x12345678, 0xf333dabb}, 37 | } 38 | 39 | func TestHash(t *testing.T) { 40 | for i, x := range hashTests { 41 | h := Hash(x.data, x.seed) 42 | if h != x.hash { 43 | t.Fatalf("test-%d: invalid hash, %#x vs %#x", i, h, x.hash) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/range.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | // Range is a key range. 10 | type Range struct { 11 | // Start of the key range, include in the range. 12 | Start []byte 13 | 14 | // Limit of the key range, not include in the range. 15 | Limit []byte 16 | } 17 | 18 | // BytesPrefix returns key range that satisfy the given prefix. 19 | // This only applicable for the standard 'bytes comparer'. 20 | func BytesPrefix(prefix []byte) *Range { 21 | var limit []byte 22 | for i := len(prefix) - 1; i >= 0; i-- { 23 | c := prefix[i] 24 | if c < 0xff { 25 | limit = make([]byte, i+1) 26 | copy(limit, prefix) 27 | limit[i] = c + 1 28 | break 29 | } 30 | } 31 | return &Range{prefix, limit} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/tmthrgd/go-hex/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.8 4 | - tip 5 | matrix: 6 | fast_finish: true 7 | allow_failures: 8 | - go: tip 9 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | clone_folder: C:\gopath\src\github.com\zchee\go-xdgbasedir 4 | shallow_clone: true 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | GO_VERSION: 1.8.3 9 | PATH: C:\go\bin;C:\gopath\bin;%PATH%;%PYTHON%;%PYTHON%\Scripts 10 | 11 | install: 12 | - rmdir C:\go /s /q 13 | - appveyor DownloadFile https://storage.googleapis.com/golang/go%GO_VERSION%.windows-amd64.msi 14 | - msiexec /i go%GO_VERSION%.windows-amd64.msi /q 15 | - go version 16 | - go env 17 | 18 | build: false 19 | 20 | before_test: 21 | - go get -u github.com/golang/lint/golint 22 | test_script: 23 | - go test -v -race -cover -covermode=atomic -coverprofile=coverage.txt.tmp . 24 | - cat coverage.txt.tmp > coverage.txt 25 | - rm -f coverage.txt.tmp 26 | - go test -v -race -cover -covermode=atomic -coverprofile=coverage.txt.tmp ./home 27 | - cat coverage.txt.tmp >> coverage.txt 28 | - rm -f coverage.txt.tmp 29 | after_test: 30 | - pip install -U codecov 31 | - codecov -f coverage.txt 32 | 33 | on_success: 34 | - gofmt -s -l -w . 35 | - golint ./... 36 | - go vet ./... 37 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/.gitignore: -------------------------------------------------------------------------------- 1 | # xdg project generated files to ignore 2 | # if you want to ignore files created by your editor/tools, 3 | # please consider a global .gitignore https://help.github.com/articles/ignoring-files 4 | # please do not open a pull request to add something created by your editor or tools 5 | # 6 | # github/gitignore/Go.gitignore 7 | # Binaries for programs and plugins 8 | *.exe 9 | *.dll 10 | *.so 11 | *.dylib 12 | 13 | # Test binary, build with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/home/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-xdgbasedir 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 home implements a detecting the user home directory. 6 | package home 7 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/home/home_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-xdgbasedir 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 home 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | "path/filepath" 11 | "testing" 12 | ) 13 | 14 | func TestDir(t *testing.T) { 15 | u, err := user.Current() 16 | if err != nil { 17 | t.Fatal(err) 18 | } 19 | testHomeDir := u.HomeDir 20 | 21 | tests := []struct { 22 | name string 23 | env string 24 | want string 25 | }{ 26 | { 27 | name: "default usrHome", 28 | env: "", 29 | want: testHomeDir, 30 | }, 31 | { 32 | name: "set different $HOME env", 33 | env: filepath.FromSlash(filepath.Join("/tmp", "home")), 34 | want: filepath.FromSlash(filepath.Join("/tmp", "home")), 35 | }, 36 | { 37 | name: "empty $HOME env", 38 | env: "empty", 39 | want: testHomeDir, 40 | }, 41 | } 42 | 43 | for _, tt := range tests { 44 | switch tt.env { 45 | case "": 46 | // nothing to do 47 | case "empty": 48 | os.Unsetenv("HOME") 49 | default: 50 | os.Setenv("HOME", tt.env) 51 | } 52 | 53 | t.Run(tt.name, func(t *testing.T) { 54 | if got := Dir(); got != tt.want { 55 | t.Errorf("Dir() = %v, want %v", got, tt.want) 56 | } 57 | }) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/home/home_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-xdgbasedir 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 !windows 6 | 7 | package home 8 | 9 | import ( 10 | "bytes" 11 | "os" 12 | "os/exec" 13 | "strings" 14 | ) 15 | 16 | // Dir detects and returns the user home directory. 17 | func Dir() string { 18 | // At first, Check the $HOME environment variable 19 | usrHome := os.Getenv("HOME") 20 | if usrHome != "" { 21 | return usrHome 22 | } 23 | 24 | // Fallback with sh pwd commmand 25 | var stdout bytes.Buffer 26 | cmd := exec.Command("sh", "-c", "eval echo ~$USER") 27 | cmd.Stdout = &stdout 28 | if err := cmd.Run(); err != nil { 29 | return "" 30 | } 31 | usrHome = strings.TrimSpace(stdout.String()) 32 | 33 | return usrHome 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/home/home_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-xdgbasedir 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 windows 6 | 7 | package home 8 | 9 | import ( 10 | "os" 11 | "path/filepath" 12 | ) 13 | 14 | // Dir detects and returns the user home directory. 15 | func Dir() string { 16 | // At first, Check the $HOME environment variable 17 | usrHome := os.Getenv("HOME") 18 | if usrHome != "" { 19 | return filepath.FromSlash(usrHome) 20 | } 21 | 22 | // TODO(zchee): In Windows OS, which of $HOME and these checks has priority? 23 | // Respect the USERPROFILE environment variable because Go stdlib uses it for default GOPATH in the "go/build" package. 24 | if usrHome = os.Getenv("USERPROFILE"); usrHome == "" { 25 | usrHome = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH") 26 | } 27 | 28 | return filepath.FromSlash(usrHome) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/xdgbasedir_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-xdgbasedir 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 | // +build !windows 7 | 8 | package xdgbasedir 9 | 10 | import ( 11 | "os" 12 | "path/filepath" 13 | "strconv" 14 | 15 | "github.com/zchee/go-xdgbasedir/home" 16 | ) 17 | 18 | var ( 19 | defaultDataHome = filepath.Join(home.Dir(), ".local", "share") 20 | defaultConfigHome = filepath.Join(home.Dir(), ".config") 21 | defaultDataDirs = filepath.Join("/usr", "local", "share") + string(filepath.ListSeparator) + filepath.Join("/usr", "share") 22 | defaultConfigDirs = filepath.Join("/etc", "xdg") 23 | defaultCacheHome = filepath.Join(home.Dir(), ".cache") 24 | defaultRuntimeDir = filepath.Join("/run", "user", strconv.Itoa(os.Getuid())) 25 | ) 26 | 27 | func dataHome() string { 28 | return defaultDataHome 29 | } 30 | 31 | func configHome() string { 32 | return defaultConfigHome 33 | } 34 | 35 | func dataDirs() string { 36 | return defaultDataDirs 37 | } 38 | 39 | func configDirs() string { 40 | return defaultConfigDirs 41 | } 42 | 43 | func cacheHome() string { 44 | return defaultCacheHome 45 | } 46 | 47 | func runtimeDir() string { 48 | return defaultRuntimeDir 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/zchee/go-xdgbasedir/xdgbasedir_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-xdgbasedir 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 windows 6 | 7 | package xdgbasedir 8 | 9 | import ( 10 | "path/filepath" 11 | 12 | "github.com/zchee/go-xdgbasedir/home" 13 | ) 14 | 15 | var ( 16 | defaultPath = filepath.Join(home.Dir(), "AppData", "Local") 17 | defaultDataHome = defaultPath 18 | defaultConfigHome = defaultPath 19 | defaultDataDirs = defaultPath 20 | defaultConfigDirs = defaultPath 21 | defaultCacheHome = filepath.Join(defaultPath, "cache") 22 | defaultRuntimeDir = home.Dir() 23 | ) 24 | 25 | func dataHome() string { 26 | return defaultDataHome 27 | } 28 | 29 | func configHome() string { 30 | return defaultConfigHome 31 | } 32 | 33 | func dataDirs() string { 34 | return defaultDataDirs 35 | } 36 | 37 | func configDirs() string { 38 | return defaultConfigDirs 39 | } 40 | 41 | func cacheHome() string { 42 | return defaultCacheHome 43 | } 44 | 45 | func runtimeDir() string { 46 | return defaultRuntimeDir 47 | } 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 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/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/withtimeout_test.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 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | // This example passes a context with a timeout to tell a blocking function that 15 | // it should abandon its work after the timeout elapses. 16 | func ExampleWithTimeout() { 17 | // Pass a context with a timeout to tell a blocking function that it 18 | // should abandon its work after the timeout elapses. 19 | ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) 20 | defer cancel() 21 | 22 | select { 23 | case <-time.After(1 * time.Second): 24 | fmt.Println("overslept") 25 | case <-ctx.Done(): 26 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 27 | } 28 | 29 | // Output: 30 | // context deadline exceeded 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | h2i/h2i 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/errors_test.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 | package http2 6 | 7 | import "testing" 8 | 9 | func TestErrCodeString(t *testing.T) { 10 | tests := []struct { 11 | err ErrCode 12 | want string 13 | }{ 14 | {ErrCodeProtocol, "PROTOCOL_ERROR"}, 15 | {0xd, "HTTP_1_1_REQUIRED"}, 16 | {0xf, "unknown error code 0xf"}, 17 | } 18 | for i, tt := range tests { 19 | got := tt.err.String() 20 | if got != tt.want { 21 | t.Errorf("%d. Error = %q; want %q", i, got, tt.want) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/flow.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 | // Flow control 6 | 7 | package http2 8 | 9 | // flow is the flow control window's size. 10 | type flow struct { 11 | // n is the number of DATA bytes we're allowed to send. 12 | // A flow is kept both on a conn and a per-stream. 13 | n int32 14 | 15 | // conn points to the shared connection-level flow that is 16 | // shared by all streams on that conn. It is nil for the flow 17 | // that's on the conn directly. 18 | conn *flow 19 | } 20 | 21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf } 22 | 23 | func (f *flow) available() int32 { 24 | n := f.n 25 | if f.conn != nil && f.conn.n < n { 26 | n = f.conn.n 27 | } 28 | return n 29 | } 30 | 31 | func (f *flow) take(n int32) { 32 | if n > f.available() { 33 | panic("internal error: took too much") 34 | } 35 | f.n -= n 36 | if f.conn != nil { 37 | f.conn.n -= n 38 | } 39 | } 40 | 41 | // add adds n bytes (positive or negative) to the flow control window. 42 | // It returns false if the sum would exceed 2^31-1. 43 | func (f *flow) add(n int32) bool { 44 | remain := (1<<31 - 1) - f.n 45 | if n > remain { 46 | return false 47 | } 48 | f.n += n 49 | return true 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/flow_test.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 | package http2 6 | 7 | import "testing" 8 | 9 | func TestFlow(t *testing.T) { 10 | var st flow 11 | var conn flow 12 | st.add(3) 13 | conn.add(2) 14 | 15 | if got, want := st.available(), int32(3); got != want { 16 | t.Errorf("available = %d; want %d", got, want) 17 | } 18 | st.setConnFlow(&conn) 19 | if got, want := st.available(), int32(2); got != want { 20 | t.Errorf("after parent setup, available = %d; want %d", got, want) 21 | } 22 | 23 | st.take(2) 24 | if got, want := conn.available(), int32(0); got != want { 25 | t.Errorf("after taking 2, conn = %d; want %d", got, want) 26 | } 27 | if got, want := st.available(), int32(0); got != want { 28 | t.Errorf("after taking 2, stream = %d; want %d", got, want) 29 | } 30 | } 31 | 32 | func TestFlowAdd(t *testing.T) { 33 | var f flow 34 | if !f.add(1) { 35 | t.Fatal("failed to add 1") 36 | } 37 | if !f.add(-1) { 38 | t.Fatal("failed to add -1") 39 | } 40 | if got, want := f.available(), int32(0); got != want { 41 | t.Fatalf("size = %d; want %d", got, want) 42 | } 43 | if !f.add(1<<31 - 1) { 44 | t.Fatal("failed to add 2^31-1") 45 | } 46 | if got, want := f.available(), int32(1<<31-1); got != want { 47 | t.Fatalf("size = %d; want %d", got, want) 48 | } 49 | if f.add(1) { 50 | t.Fatal("adding 1 to max shouldn't be allowed") 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go16.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 | // +build go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 15 | return t1.ExpectContinueTimeout 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go17_not18.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 | // +build go1.7,!go1.8 6 | 7 | package http2 8 | 9 | import "crypto/tls" 10 | 11 | // temporary copy of Go 1.7's private tls.Config.clone: 12 | func cloneTLSConfig(c *tls.Config) *tls.Config { 13 | return &tls.Config{ 14 | Rand: c.Rand, 15 | Time: c.Time, 16 | Certificates: c.Certificates, 17 | NameToCertificate: c.NameToCertificate, 18 | GetCertificate: c.GetCertificate, 19 | RootCAs: c.RootCAs, 20 | NextProtos: c.NextProtos, 21 | ServerName: c.ServerName, 22 | ClientAuth: c.ClientAuth, 23 | ClientCAs: c.ClientCAs, 24 | InsecureSkipVerify: c.InsecureSkipVerify, 25 | CipherSuites: c.CipherSuites, 26 | PreferServerCipherSuites: c.PreferServerCipherSuites, 27 | SessionTicketsDisabled: c.SessionTicketsDisabled, 28 | SessionTicketKey: c.SessionTicketKey, 29 | ClientSessionCache: c.ClientSessionCache, 30 | MinVersion: c.MinVersion, 31 | MaxVersion: c.MaxVersion, 32 | CurvePreferences: c.CurvePreferences, 33 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, 34 | Renegotiation: c.Renegotiation, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go18.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 go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "crypto/tls" 11 | "io" 12 | "net/http" 13 | ) 14 | 15 | func cloneTLSConfig(c *tls.Config) *tls.Config { 16 | c2 := c.Clone() 17 | c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264 18 | return c2 19 | } 20 | 21 | var _ http.Pusher = (*responseWriter)(nil) 22 | 23 | // Push implements http.Pusher. 24 | func (w *responseWriter) Push(target string, opts *http.PushOptions) error { 25 | internalOpts := pushOptions{} 26 | if opts != nil { 27 | internalOpts.Method = opts.Method 28 | internalOpts.Header = opts.Header 29 | } 30 | return w.push(target, internalOpts) 31 | } 32 | 33 | func configureServer18(h1 *http.Server, h2 *Server) error { 34 | if h2.IdleTimeout == 0 { 35 | if h1.IdleTimeout != 0 { 36 | h2.IdleTimeout = h1.IdleTimeout 37 | } else { 38 | h2.IdleTimeout = h1.ReadTimeout 39 | } 40 | } 41 | return nil 42 | } 43 | 44 | func shouldLogPanic(panicValue interface{}) bool { 45 | return panicValue != nil && panicValue != http.ErrAbortHandler 46 | } 47 | 48 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 49 | return req.GetBody 50 | } 51 | 52 | func reqBodyIsNoBody(body io.ReadCloser) bool { 53 | return body == http.NoBody 54 | } 55 | 56 | func go18httpNoBody() io.ReadCloser { return http.NoBody } // for tests only 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go19.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 go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | s.RegisterOnShutdown(conf.state.startGracefulShutdown) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/gotrack_test.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 | package http2 6 | 7 | import ( 8 | "fmt" 9 | "strings" 10 | "testing" 11 | ) 12 | 13 | func TestGoroutineLock(t *testing.T) { 14 | oldDebug := DebugGoroutines 15 | DebugGoroutines = true 16 | defer func() { DebugGoroutines = oldDebug }() 17 | 18 | g := newGoroutineLock() 19 | g.check() 20 | 21 | sawPanic := make(chan interface{}) 22 | go func() { 23 | defer func() { sawPanic <- recover() }() 24 | g.check() // should panic 25 | }() 26 | e := <-sawPanic 27 | if e == nil { 28 | t.Fatal("did not see panic from check in other goroutine") 29 | } 30 | if !strings.Contains(fmt.Sprint(e), "wrong goroutine") { 31 | t.Errorf("expected on see panic about running on the wrong goroutine; got %v", e) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go16.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 !go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func configureTransport(t1 *http.Transport) (*Transport, error) { 15 | return nil, errTransportVersion 16 | } 17 | 18 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 19 | return 0 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go18.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 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | 29 | func go18httpNoBody() io.ReadCloser { return nil } // for tests only 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go19.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 | // +build !go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | // not supported prior to go1.9 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/writesched_random_test.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 http2 6 | 7 | import "testing" 8 | 9 | func TestRandomScheduler(t *testing.T) { 10 | ws := NewRandomWriteScheduler() 11 | ws.Push(makeWriteHeadersRequest(3)) 12 | ws.Push(makeWriteHeadersRequest(4)) 13 | ws.Push(makeWriteHeadersRequest(1)) 14 | ws.Push(makeWriteHeadersRequest(2)) 15 | ws.Push(makeWriteNonStreamRequest()) 16 | ws.Push(makeWriteNonStreamRequest()) 17 | 18 | // Pop all frames. Should get the non-stream requests first, 19 | // followed by the stream requests in any order. 20 | var order []FrameWriteRequest 21 | for { 22 | wr, ok := ws.Pop() 23 | if !ok { 24 | break 25 | } 26 | order = append(order, wr) 27 | } 28 | t.Logf("got frames: %v", order) 29 | if len(order) != 6 { 30 | t.Fatalf("got %d frames, expected 6", len(order)) 31 | } 32 | if order[0].StreamID() != 0 || order[1].StreamID() != 0 { 33 | t.Fatal("expected non-stream frames first", order[0], order[1]) 34 | } 35 | got := make(map[uint32]bool) 36 | for _, wr := range order[2:] { 37 | got[wr.StreamID()] = true 38 | } 39 | for id := uint32(1); id <= 4; id++ { 40 | if !got[id] { 41 | t.Errorf("frame not found for stream %d", id) 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/idna/idna_test.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 idna 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | var idnaTestCases = [...]struct { 12 | ascii, unicode string 13 | }{ 14 | // Labels. 15 | {"books", "books"}, 16 | {"xn--bcher-kva", "bücher"}, 17 | 18 | // Domains. 19 | {"foo--xn--bar.org", "foo--xn--bar.org"}, 20 | {"golang.org", "golang.org"}, 21 | {"example.xn--p1ai", "example.рф"}, 22 | {"xn--czrw28b.tw", "商業.tw"}, 23 | {"www.xn--mller-kva.de", "www.müller.de"}, 24 | } 25 | 26 | func TestIDNA(t *testing.T) { 27 | for _, tc := range idnaTestCases { 28 | if a, err := ToASCII(tc.unicode); err != nil { 29 | t.Errorf("ToASCII(%q): %v", tc.unicode, err) 30 | } else if a != tc.ascii { 31 | t.Errorf("ToASCII(%q): got %q, want %q", tc.unicode, a, tc.ascii) 32 | } 33 | 34 | if u, err := ToUnicode(tc.ascii); err != nil { 35 | t.Errorf("ToUnicode(%q): %v", tc.ascii, err) 36 | } else if u != tc.unicode { 37 | t.Errorf("ToUnicode(%q): got %q, want %q", tc.ascii, u, tc.unicode) 38 | } 39 | } 40 | } 41 | 42 | // TODO(nigeltao): test errors, once we've specified when ToASCII and ToUnicode 43 | // return errors. 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 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.7 6 | 7 | package trace 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 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.7 6 | 7 | package trace 8 | 9 | import "context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .gitignore except for files generated by the build. 2 | last-change 3 | /DATA 4 | # This file is rather large and the tests really only need to be run 5 | # after generation. 6 | /unicode/norm/data_test.go -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 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/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go libraries for text processing, many involving Unicode. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | 5 | To generate the tables in this repository (except for the encoding tables), 6 | run go generate from this directory. By default tables are generated for the 7 | Unicode version in core and the CLDR version defined in 8 | golang.org/x/text/unicode/cldr. 9 | 10 | Running go generate will as a side effect create a DATA subdirectory in this 11 | directory which holds all files that are used as a source for generating the 12 | tables. This directory will also serve as a cache. 13 | 14 | Run 15 | 16 | go test ./... 17 | 18 | from this directory to run all tests. Add the "-tags icu" flag to also run 19 | ICU conformance tests (if available). This requires that you have the correct 20 | ICU version installed on your system. 21 | 22 | TODO: 23 | - updating unversioned source files. -------------------------------------------------------------------------------- /vendor/golang.org/x/text/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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 | //go:generate go run gen.go 6 | 7 | // text is a repository of text-related packages related to internationalization 8 | // (i18n) and localization (l10n), such as character encodings, text 9 | // transformations, and locale-specific text handling. 10 | package text 11 | 12 | // TODO: more documentation on general concepts, such as Transformers, use 13 | // of normalization, etc. 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/gen.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 | import ( 10 | "log" 11 | 12 | "golang.org/x/text/internal/gen" 13 | "golang.org/x/text/language" 14 | "golang.org/x/text/unicode/cldr" 15 | ) 16 | 17 | func main() { 18 | r := gen.OpenCLDRCoreZip() 19 | defer r.Close() 20 | 21 | d := &cldr.Decoder{} 22 | data, err := d.DecodeZip(r) 23 | if err != nil { 24 | log.Fatalf("DecodeZip: %v", err) 25 | } 26 | 27 | w := gen.NewCodeWriter() 28 | defer w.WriteGoFile("tables.go", "internal") 29 | 30 | // Create parents table. 31 | parents := make([]uint16, language.NumCompactTags) 32 | for _, loc := range data.Locales() { 33 | tag := language.MustParse(loc) 34 | index, ok := language.CompactIndex(tag) 35 | if !ok { 36 | continue 37 | } 38 | parentIndex := 0 // und 39 | for p := tag.Parent(); p != language.Und; p = p.Parent() { 40 | if x, ok := language.CompactIndex(p); ok { 41 | parentIndex = x 42 | break 43 | } 44 | } 45 | parents[index] = uint16(parentIndex) 46 | } 47 | 48 | w.WriteComment(` 49 | Parent maps a compact index of a tag to the compact index of the parent of 50 | this tag.`) 51 | w.WriteVar("Parent", parents) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/gen_test.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 internal 6 | 7 | import ( 8 | "testing" 9 | 10 | "golang.org/x/text/language" 11 | ) 12 | 13 | func TestParents(t *testing.T) { 14 | testCases := []struct { 15 | tag, parent string 16 | }{ 17 | {"af", "und"}, 18 | {"en", "und"}, 19 | {"en-001", "en"}, 20 | {"en-AU", "en-001"}, 21 | {"en-US", "en"}, 22 | {"en-US-u-va-posix", "en-US"}, 23 | {"ca-ES-valencia", "ca-ES"}, 24 | } 25 | for _, tc := range testCases { 26 | tag, ok := language.CompactIndex(language.MustParse(tc.tag)) 27 | if !ok { 28 | t.Fatalf("Could not get index of flag %s", tc.tag) 29 | } 30 | want, ok := language.CompactIndex(language.MustParse(tc.parent)) 31 | if !ok { 32 | t.Fatalf("Could not get index of parent %s of tag %s", tc.parent, tc.tag) 33 | } 34 | if got := int(Parent[tag]); got != want { 35 | t.Errorf("Parent[%s] = %d; want %d (%s)", tc.tag, got, want, tc.parent) 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/internal.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 | //go:generate go run gen.go 6 | 7 | // Package internal contains non-exported functionality that are used by 8 | // packages in the text repository. 9 | package internal // import "golang.org/x/text/internal" 10 | 11 | import ( 12 | "sort" 13 | 14 | "golang.org/x/text/language" 15 | ) 16 | 17 | // SortTags sorts tags in place. 18 | func SortTags(tags []language.Tag) { 19 | sort.Sort(sorter(tags)) 20 | } 21 | 22 | type sorter []language.Tag 23 | 24 | func (s sorter) Len() int { 25 | return len(s) 26 | } 27 | 28 | func (s sorter) Swap(i, j int) { 29 | s[i], s[j] = s[j], s[i] 30 | } 31 | 32 | func (s sorter) Less(i, j int) bool { 33 | return s[i].String() < s[j].String() 34 | } 35 | 36 | // UniqueTags sorts and filters duplicate tags in place and returns a slice with 37 | // only unique tags. 38 | func UniqueTags(tags []language.Tag) []language.Tag { 39 | if len(tags) <= 1 { 40 | return tags 41 | } 42 | SortTags(tags) 43 | k := 0 44 | for i := 1; i < len(tags); i++ { 45 | if tags[k].String() < tags[i].String() { 46 | k++ 47 | tags[k] = tags[i] 48 | } 49 | } 50 | return tags[:k+1] 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/internal_test.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 internal 6 | 7 | import ( 8 | "fmt" 9 | "strings" 10 | "testing" 11 | 12 | "golang.org/x/text/language" 13 | ) 14 | 15 | func TestUnique(t *testing.T) { 16 | testCases := []struct { 17 | in, want string 18 | }{ 19 | {"", "[]"}, 20 | {"en", "[en]"}, 21 | {"en en", "[en]"}, 22 | {"en en en", "[en]"}, 23 | {"en-u-cu-eur en", "[en en-u-cu-eur]"}, 24 | {"nl en", "[en nl]"}, 25 | {"pt-Pt pt", "[pt pt-PT]"}, 26 | } 27 | for _, tc := range testCases { 28 | tags := []language.Tag{} 29 | for _, s := range strings.Split(tc.in, " ") { 30 | if s != "" { 31 | tags = append(tags, language.MustParse(s)) 32 | } 33 | } 34 | if got := fmt.Sprint(UniqueTags(tags)); got != tc.want { 35 | t.Errorf("Unique(%s) = %s; want %s", tc.in, got, tc.want) 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bench_test.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 bidirule 6 | 7 | import ( 8 | "testing" 9 | 10 | "golang.org/x/text/internal/testtext" 11 | ) 12 | 13 | var benchData = []struct{ name, data string }{ 14 | {"ascii", "Scheveningen"}, 15 | {"arabic", "دبي"}, 16 | {"hangul", "다음과"}, 17 | } 18 | 19 | func doBench(b *testing.B, fn func(b *testing.B, data string)) { 20 | for _, d := range benchData { 21 | testtext.Bench(b, d.name, func(b *testing.B) { fn(b, d.data) }) 22 | } 23 | } 24 | 25 | func BenchmarkSpan(b *testing.B) { 26 | r := New() 27 | doBench(b, func(b *testing.B, str string) { 28 | b.SetBytes(int64(len(str))) 29 | data := []byte(str) 30 | for i := 0; i < b.N; i++ { 31 | r.Reset() 32 | r.Span(data, true) 33 | } 34 | }) 35 | } 36 | 37 | func BenchmarkDirectionASCII(b *testing.B) { 38 | doBench(b, func(b *testing.B, str string) { 39 | b.SetBytes(int64(len(str))) 40 | data := []byte(str) 41 | for i := 0; i < b.N; i++ { 42 | Direction(data) 43 | } 44 | }) 45 | } 46 | 47 | func BenchmarkDirectionStringASCII(b *testing.B) { 48 | doBench(b, func(b *testing.B, str string) { 49 | b.SetBytes(int64(len(str))) 50 | for i := 0; i < b.N; i++ { 51 | DirectionString(str) 52 | } 53 | }) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/doc.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 | // secure is a repository of text security related packages. 6 | package secure // import "golang.org/x/text/secure" 7 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/transform/examples_test.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 transform_test 6 | 7 | import ( 8 | "fmt" 9 | "unicode" 10 | 11 | "golang.org/x/text/transform" 12 | "golang.org/x/text/unicode/norm" 13 | ) 14 | 15 | func ExampleRemoveFunc() { 16 | input := []byte(`tschüß; до свидания`) 17 | 18 | b := make([]byte, len(input)) 19 | 20 | t := transform.RemoveFunc(unicode.IsSpace) 21 | n, _, _ := t.Transform(b, input, true) 22 | fmt.Println(string(b[:n])) 23 | 24 | t = transform.RemoveFunc(func(r rune) bool { 25 | return !unicode.Is(unicode.Latin, r) 26 | }) 27 | n, _, _ = t.Transform(b, input, true) 28 | fmt.Println(string(b[:n])) 29 | 30 | n, _, _ = t.Transform(b, norm.NFD.Bytes(input), true) 31 | fmt.Println(string(b[:n])) 32 | 33 | // Output: 34 | // tschüß;досвидания 35 | // tschüß 36 | // tschuß 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/cldr/cldr_test.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 | package cldr 6 | 7 | import "testing" 8 | 9 | func TestParseDraft(t *testing.T) { 10 | tests := []struct { 11 | in string 12 | draft Draft 13 | err bool 14 | }{ 15 | {"unconfirmed", Unconfirmed, false}, 16 | {"provisional", Provisional, false}, 17 | {"contributed", Contributed, false}, 18 | {"approved", Approved, false}, 19 | {"", Approved, false}, 20 | {"foo", Approved, true}, 21 | } 22 | for _, tt := range tests { 23 | if d, err := ParseDraft(tt.in); d != tt.draft || (err != nil) != tt.err { 24 | t.Errorf("%q: was %v, %v; want %v, %v", tt.in, d, err != nil, tt.draft, tt.err) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/cldr/examples_test.go: -------------------------------------------------------------------------------- 1 | package cldr_test 2 | 3 | import ( 4 | "fmt" 5 | 6 | "golang.org/x/text/unicode/cldr" 7 | ) 8 | 9 | func ExampleSlice() { 10 | var dr *cldr.CLDR // assume this is initalized 11 | 12 | x, _ := dr.LDML("en") 13 | cs := x.Collations.Collation 14 | // remove all but the default 15 | cldr.MakeSlice(&cs).Filter(func(e cldr.Elem) bool { 16 | return e.GetCommon().Type != x.Collations.Default() 17 | }) 18 | for i, c := range cs { 19 | fmt.Println(i, c.Type) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/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 | // unicode holds packages with implementations of Unicode standards that are 6 | // mostly used as building blocks for other packages in golang.org/x/text, 7 | // layout engines, or are otherwise more low-level in nature. 8 | package unicode 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/example_test.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 norm_test 6 | 7 | import ( 8 | "fmt" 9 | 10 | "golang.org/x/text/unicode/norm" 11 | ) 12 | 13 | func ExampleForm_NextBoundary() { 14 | s := norm.NFD.String("Mêlée") 15 | 16 | for i := 0; i < len(s); { 17 | d := norm.NFC.NextBoundaryInString(s[i:], true) 18 | fmt.Printf("%[1]s: %+[1]q\n", s[i:i+d]) 19 | i += d 20 | } 21 | // Output: 22 | // M: "M" 23 | // ê: "e\u0302" 24 | // l: "l" 25 | // é: "e\u0301" 26 | // e: "e" 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/norm_test.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_test 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestPlaceHolder(t *testing.T) { 12 | // Does nothing, just allows the Makefile to be canonical 13 | // while waiting for the package itself to be written. 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/readwriter_test.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 | import ( 8 | "bytes" 9 | "fmt" 10 | "testing" 11 | ) 12 | 13 | var bufSizes = []int{1, 2, 3, 4, 5, 6, 7, 8, 100, 101, 102, 103, 4000, 4001, 4002, 4003} 14 | 15 | func readFunc(size int) appendFunc { 16 | return func(f Form, out []byte, s string) []byte { 17 | out = append(out, s...) 18 | r := f.Reader(bytes.NewBuffer(out)) 19 | buf := make([]byte, size) 20 | result := []byte{} 21 | for n, err := 0, error(nil); err == nil; { 22 | n, err = r.Read(buf) 23 | result = append(result, buf[:n]...) 24 | } 25 | return result 26 | } 27 | } 28 | 29 | func TestReader(t *testing.T) { 30 | for _, s := range bufSizes { 31 | name := fmt.Sprintf("TestReader%d", s) 32 | runNormTests(t, name, readFunc(s)) 33 | } 34 | } 35 | 36 | func writeFunc(size int) appendFunc { 37 | return func(f Form, out []byte, s string) []byte { 38 | in := append(out, s...) 39 | result := new(bytes.Buffer) 40 | w := f.Writer(result) 41 | buf := make([]byte, size) 42 | for n := 0; len(in) > 0; in = in[n:] { 43 | n = copy(buf, in) 44 | _, _ = w.Write(buf[:n]) 45 | } 46 | w.Close() 47 | return result.Bytes() 48 | } 49 | } 50 | 51 | func TestWriter(t *testing.T) { 52 | for _, s := range bufSizes { 53 | name := fmt.Sprintf("TestWriter%d", s) 54 | runNormTests(t, name, writeFunc(s)) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /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/unicode/rangetable/rangetable_test.go: -------------------------------------------------------------------------------- 1 | package rangetable 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | "unicode" 7 | ) 8 | 9 | var ( 10 | empty = &unicode.RangeTable{} 11 | many = &unicode.RangeTable{ 12 | R16: []unicode.Range16{{0, 0xffff, 5}}, 13 | R32: []unicode.Range32{{0x10004, 0x10009, 5}}, 14 | LatinOffset: 0, 15 | } 16 | ) 17 | 18 | func TestVisit(t *testing.T) { 19 | Visit(empty, func(got rune) { 20 | t.Error("call from empty RangeTable") 21 | }) 22 | 23 | var want rune 24 | Visit(many, func(got rune) { 25 | if got != want { 26 | t.Errorf("got %U; want %U", got, want) 27 | } 28 | want += 5 29 | }) 30 | if want -= 5; want != 0x10009 { 31 | t.Errorf("last run was %U; want U+10009", want) 32 | } 33 | } 34 | 35 | func TestNew(t *testing.T) { 36 | for i, rt := range []*unicode.RangeTable{ 37 | empty, 38 | unicode.Co, 39 | unicode.Letter, 40 | unicode.ASCII_Hex_Digit, 41 | many, 42 | maxRuneTable, 43 | } { 44 | var got, want []rune 45 | Visit(rt, func(r rune) { 46 | want = append(want, r) 47 | }) 48 | Visit(New(want...), func(r rune) { 49 | got = append(got, r) 50 | }) 51 | if !reflect.DeepEqual(got, want) { 52 | t.Errorf("%d:\ngot %v;\nwant %v", i, got, want) 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/google.golang.org/genproto/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.6 4 | - 1.7 5 | - 1.8 6 | go_import_path: google.golang.org/genproto 7 | 8 | script: 9 | - go test -v ./... 10 | - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then 11 | go get -u -v cloud.google.com/go/...; 12 | fi 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/genproto/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Want to contribute? Great! First, read this page (including the small print at the end). 2 | 3 | ### Before you contribute 4 | Before we can use your code, you must sign the 5 | [Google Individual Contributor License Agreement] 6 | (https://cla.developers.google.com/about/google-individual) 7 | (CLA), which you can do online. The CLA is necessary mainly because you own the 8 | copyright to your changes, even after your contribution becomes part of our 9 | codebase, so we need your permission to use and distribute your code. We also 10 | need to be sure of various other things—for instance that you'll tell us if you 11 | know that your code infringes on other people's patents. You don't have to sign 12 | the CLA until after you've submitted your code for review and a member has 13 | approved it, but you must do it before we can put your code into our codebase. 14 | Before you start working on a larger contribution, you should get in touch with 15 | us first through the issue tracker with your idea so that we can help out and 16 | possibly guide you. Coordinating up front makes it much easier to avoid 17 | frustration later on. 18 | 19 | ### Code reviews 20 | All submissions, including submissions by project members, require review. We 21 | use Github pull requests for this purpose. 22 | 23 | ### The small print 24 | Contributions made by corporations are covered by a different agreement than 25 | the one above, the 26 | [Software Grant and Corporate Contributor License Agreement] 27 | (https://cla.developers.google.com/about/google-corporate). 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/genproto/README.md: -------------------------------------------------------------------------------- 1 | Go generated proto packages 2 | =========================== 3 | 4 | [![Build Status](https://travis-ci.org/google/go-genproto.svg?branch=master)](https://travis-ci.org/google/go-genproto) 5 | [![GoDoc](https://godoc.org/google.golang.org/genproto?status.svg)](https://godoc.org/google.golang.org/genproto) 6 | 7 | > **IMPORTANT** This repository is currently experimental. The structure 8 | > of the contained packages is subject to change. Please see the original 9 | > source repositories (listed below) to find out the status of the each 10 | > protocol buffer's associated service. 11 | 12 | This repository contains the generated Go packages for common protocol buffer 13 | types, and the generated [gRPC][1] code necessary for interacting with Google's gRPC 14 | APIs. 15 | 16 | There are two sources for the proto files used in this repository: 17 | 18 | 1. [google/protobuf][2]: the code in the `protobuf` and `ptypes` subdirectories 19 | is derived from this repo. The messages in `protobuf` are used to describe 20 | protocol buffer messages themselves. The messages under `ptypes` define the 21 | common well-known types. 22 | 2. [googleapis/googleapis][3]: the code in the `googleapis` is derived from this 23 | repo. The packages here contain types specifically for interacting with Google 24 | APIs. 25 | 26 | [1]: http://grpc.io 27 | [2]: https://github.com/google/protobuf/ 28 | [3]: https://github.com/googleapis/googleapis/ 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6.x 5 | - 1.7.x 6 | - 1.8.x 7 | 8 | go_import_path: google.golang.org/grpc 9 | 10 | before_install: 11 | - if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then go get -u github.com/golang/lint/golint honnef.co/go/tools/cmd/staticcheck; fi 12 | - go get -u golang.org/x/tools/cmd/goimports github.com/axw/gocov/gocov github.com/mattn/goveralls golang.org/x/tools/cmd/cover 13 | 14 | script: 15 | - '! gofmt -s -d -l . 2>&1 | read' 16 | - '! goimports -l . | read' 17 | - 'if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then ! golint ./... | grep -vE "(_mock|_string|\.pb)\.go:"; fi' 18 | - 'if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then ! go tool vet -all . 2>&1 | grep -vF .pb.go:; fi' # https://github.com/golang/protobuf/issues/214 19 | - make test testrace 20 | - 'if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then staticcheck -ignore google.golang.org/grpc/transport/transport_test.go:SA2002 ./...; fi' # TODO(menghanl): fix these 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/Makefile: -------------------------------------------------------------------------------- 1 | all: test testrace 2 | 3 | deps: 4 | go get -d -v google.golang.org/grpc/... 5 | 6 | updatedeps: 7 | go get -d -v -u -f google.golang.org/grpc/... 8 | 9 | testdeps: 10 | go get -d -v -t google.golang.org/grpc/... 11 | 12 | updatetestdeps: 13 | go get -d -v -t -u -f google.golang.org/grpc/... 14 | 15 | build: deps 16 | go build google.golang.org/grpc/... 17 | 18 | proto: 19 | @ if ! which protoc > /dev/null; then \ 20 | echo "error: protoc not installed" >&2; \ 21 | exit 1; \ 22 | fi 23 | go get -u -v github.com/golang/protobuf/protoc-gen-go 24 | # use $$dir as the root for all proto files in the same directory 25 | for dir in $$(git ls-files '*.proto' | xargs -n1 dirname | uniq); do \ 26 | protoc -I $$dir --go_out=plugins=grpc:$$dir $$dir/*.proto; \ 27 | done 28 | 29 | test: testdeps 30 | go test -v -cpu 1,4 google.golang.org/grpc/... 31 | 32 | testrace: testdeps 33 | go test -v -race -cpu 1,4 google.golang.org/grpc/... 34 | 35 | clean: 36 | go clean -i google.golang.org/grpc/... 37 | 38 | coverage: testdeps 39 | ./coverage.sh --coveralls 40 | 41 | .PHONY: \ 42 | all \ 43 | deps \ 44 | updatedeps \ 45 | testdeps \ 46 | updatetestdeps \ 47 | build \ 48 | proto \ 49 | test \ 50 | testrace \ 51 | clean \ 52 | coverage 53 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/backoff_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package grpc 20 | 21 | import "testing" 22 | 23 | func TestBackoffConfigDefaults(t *testing.T) { 24 | b := BackoffConfig{} 25 | setDefaults(&b) 26 | if b != DefaultBackoffConfig { 27 | t.Fatalf("expected BackoffConfig to pickup default parameters: %v != %v", b, DefaultBackoffConfig) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codegen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as an example to demonstrate how to generate the gRPC-Go 4 | # interface and the related messages from .proto file. 5 | # 6 | # It assumes the installation of i) Google proto buffer compiler at 7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen 8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have 9 | # not, please install them first. 10 | # 11 | # We recommend running this script at $GOPATH/src. 12 | # 13 | # If this is not what you need, feel free to make your own scripts. Again, this 14 | # script is for demonstration purpose. 15 | # 16 | proto=$1 17 | protoc --go_out=plugins=grpc:. $proto 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Code; DO NOT EDIT 2 | 3 | package codes 4 | 5 | import "fmt" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i+1 >= Code(len(_Code_index)) { 13 | return fmt.Sprintf("Code(%d)", i) 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | set -e 5 | 6 | workdir=.cover 7 | profile="$workdir/cover.out" 8 | mode=set 9 | end2endtest="google.golang.org/grpc/test" 10 | 11 | generate_cover_data() { 12 | rm -rf "$workdir" 13 | mkdir "$workdir" 14 | 15 | for pkg in "$@"; do 16 | if [ $pkg == "google.golang.org/grpc" -o $pkg == "google.golang.org/grpc/transport" -o $pkg == "google.golang.org/grpc/metadata" -o $pkg == "google.golang.org/grpc/credentials" ] 17 | then 18 | f="$workdir/$(echo $pkg | tr / -)" 19 | go test -covermode="$mode" -coverprofile="$f.cover" "$pkg" 20 | go test -covermode="$mode" -coverpkg "$pkg" -coverprofile="$f.e2e.cover" "$end2endtest" 21 | fi 22 | done 23 | 24 | echo "mode: $mode" >"$profile" 25 | grep -h -v "^mode:" "$workdir"/*.cover >>"$profile" 26 | } 27 | 28 | show_cover_report() { 29 | go tool cover -${1}="$profile" 30 | } 31 | 32 | push_to_coveralls() { 33 | goveralls -coverprofile="$profile" 34 | } 35 | 36 | generate_cover_data $(go list ./...) 37 | show_cover_report func 38 | case "$1" in 39 | "") 40 | ;; 41 | --html) 42 | show_cover_report html ;; 43 | --coveralls) 44 | push_to_coveralls ;; 45 | *) 46 | echo >&2 "error: invalid option: $1" ;; 47 | esac 48 | rm -rf "$workdir" 49 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/credentials/credentials_util_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "crypto/tls" 25 | ) 26 | 27 | // cloneTLSConfig returns a shallow clone of the exported 28 | // fields of cfg, ignoring the unexported sync.Once, which 29 | // contains a mutex and must not be copied. 30 | // 31 | // If cfg is nil, a new zero tls.Config is returned. 32 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 33 | if cfg == nil { 34 | return &tls.Config{} 35 | } 36 | 37 | return cfg.Clone() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package grpc implements an RPC system called gRPC. 3 | 4 | See www.grpc.io for more information about gRPC. 5 | */ 6 | package grpc // import "google.golang.org/grpc" 7 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 3 | * 4 | * Licensed under the Apache 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 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | // Package internal contains gRPC-internal code for testing, to avoid polluting 19 | // the godoc of the top-level grpc package. 20 | package internal 21 | 22 | // TestingCloseConns closes all existing transports but keeps 23 | // grpcServer.lis accepting new connections. 24 | // 25 | // The provided grpcServer must be of type *grpc.Server. It is untyped 26 | // for circular dependency reasons. 27 | var TestingCloseConns func(grpcServer interface{}) 28 | 29 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. 30 | // It must be called before Serve and requires TLS credentials. 31 | // 32 | // The provided grpcServer must be of type *grpc.Server. It is untyped 33 | // for circular dependency reasons. 34 | var TestingUseHandlerImpl func(grpcServer interface{}) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/transport/go16.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.7 2 | 3 | /* 4 | * 5 | * Copyright 2016 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package transport 22 | 23 | import ( 24 | "net" 25 | 26 | "google.golang.org/grpc/codes" 27 | 28 | "golang.org/x/net/context" 29 | ) 30 | 31 | // dialContext connects to the address on the named network. 32 | func dialContext(ctx context.Context, network, address string) (net.Conn, error) { 33 | return (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address) 34 | } 35 | 36 | // ContextErr converts the error from context package into a StreamError. 37 | func ContextErr(err error) StreamError { 38 | switch err { 39 | case context.DeadlineExceeded: 40 | return streamErrorf(codes.DeadlineExceeded, "%v", err) 41 | case context.Canceled: 42 | return streamErrorf(codes.Canceled, "%v", err) 43 | } 44 | return streamErrorf(codes.Internal, "Unexpected error from context packet: %v", err) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/transport/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | /* 4 | * 5 | * Copyright 2016 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package transport 22 | 23 | import ( 24 | "context" 25 | "net" 26 | 27 | "google.golang.org/grpc/codes" 28 | 29 | netctx "golang.org/x/net/context" 30 | ) 31 | 32 | // dialContext connects to the address on the named network. 33 | func dialContext(ctx context.Context, network, address string) (net.Conn, error) { 34 | return (&net.Dialer{}).DialContext(ctx, network, address) 35 | } 36 | 37 | // ContextErr converts the error from context package into a StreamError. 38 | func ContextErr(err error) StreamError { 39 | switch err { 40 | case context.DeadlineExceeded, netctx.DeadlineExceeded: 41 | return streamErrorf(codes.DeadlineExceeded, "%v", err) 42 | case context.Canceled, netctx.Canceled: 43 | return streamErrorf(codes.Canceled, "%v", err) 44 | } 45 | return streamErrorf(codes.Internal, "Unexpected error from context packet: %v", err) 46 | } 47 | --------------------------------------------------------------------------------