├── .gitignore ├── LICENSE ├── README.md ├── cache.go ├── cache_test.go ├── example └── main.go ├── file.go ├── file_test.go ├── go.mod ├── go.sum ├── ledis ├── ledis.go ├── ledis.goconvey └── ledis_test.go ├── memcache ├── memcache.go ├── memcache.goconvey └── memcache_test.go ├── memory.go ├── memory_test.go ├── mysql ├── mysql.go ├── mysql.goconvey └── mysql_test.go ├── nodb ├── nodb.go ├── nodb.goconvey └── nodb_test.go ├── postgresql ├── postgres.goconvey ├── postgres_test.go └── postgresql.go ├── redis ├── redis.go ├── redis.goconvey └── redis_test.go ├── utils.go └── vendor ├── github.com ├── BurntSushi │ └── toml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── COMPATIBLE │ │ ├── COPYING │ │ ├── Makefile │ │ ├── README.md │ │ ├── decode.go │ │ ├── decode_meta.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encoding_types.go │ │ ├── encoding_types_1.1.go │ │ ├── lex.go │ │ ├── parse.go │ │ ├── session.vim │ │ ├── type_check.go │ │ └── type_fields.go ├── Unknwon │ └── com │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cmd.go │ │ ├── convert.go │ │ ├── dir.go │ │ ├── file.go │ │ ├── html.go │ │ ├── http.go │ │ ├── math.go │ │ ├── path.go │ │ ├── regex.go │ │ ├── slice.go │ │ ├── string.go │ │ ├── time.go │ │ └── url.go ├── bradfitz │ └── gomemcache │ │ ├── LICENSE │ │ └── memcache │ │ ├── memcache.go │ │ └── selector.go ├── cupcake │ └── rdb │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENCE │ │ ├── README.md │ │ ├── crc64 │ │ └── crc64.go │ │ ├── decoder.go │ │ ├── encoder.go │ │ ├── nopdecoder │ │ └── nop_decoder.go │ │ └── slice_buffer.go ├── edsrzf │ └── mmap-go │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── mmap.go │ │ ├── mmap_unix.go │ │ └── mmap_windows.go ├── go-sql-driver │ └── mysql │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appengine.go │ │ ├── auth.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── connection_go18.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ ├── utils.go │ │ ├── utils_go17.go │ │ └── utils_go18.go ├── golang │ └── 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 │ │ └── snappy.go ├── gopherjs │ └── gopherjs │ │ ├── LICENSE │ │ └── js │ │ └── js.go ├── jtolds │ └── gls │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context.go │ │ ├── gen_sym.go │ │ ├── gid.go │ │ ├── id_pool.go │ │ ├── stack_tags.go │ │ ├── stack_tags_js.go │ │ └── stack_tags_main.go ├── lib │ └── pq │ │ ├── .gitignore │ │ ├── .travis.sh │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── TESTS.md │ │ ├── array.go │ │ ├── buf.go │ │ ├── conn.go │ │ ├── conn_go18.go │ │ ├── connector.go │ │ ├── copy.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── error.go │ │ ├── go.mod │ │ ├── notify.go │ │ ├── oid │ │ ├── doc.go │ │ └── types.go │ │ ├── rows.go │ │ ├── scram │ │ └── scram.go │ │ ├── ssl.go │ │ ├── ssl_permissions.go │ │ ├── ssl_windows.go │ │ ├── url.go │ │ ├── user_posix.go │ │ ├── user_windows.go │ │ └── uuid.go ├── lunny │ ├── log │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README_CN.md │ │ ├── dbwriter.go │ │ ├── filewriter.go │ │ └── logext.go │ └── nodb │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README_CN.md │ │ ├── batch.go │ │ ├── binlog.go │ │ ├── binlog_util.go │ │ ├── config │ │ ├── config.go │ │ └── config.toml │ │ ├── const.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── info.go │ │ ├── multi.go │ │ ├── nodb.go │ │ ├── nodb_db.go │ │ ├── replication.go │ │ ├── scan.go │ │ ├── store │ │ ├── db.go │ │ ├── driver │ │ │ ├── batch.go │ │ │ ├── driver.go │ │ │ └── store.go │ │ ├── goleveldb │ │ │ ├── batch.go │ │ │ ├── const.go │ │ │ ├── db.go │ │ │ ├── iterator.go │ │ │ └── snapshot.go │ │ ├── iterator.go │ │ ├── snapshot.go │ │ ├── store.go │ │ ├── tx.go │ │ └── writebatch.go │ │ ├── t_bit.go │ │ ├── t_hash.go │ │ ├── t_kv.go │ │ ├── t_list.go │ │ ├── t_set.go │ │ ├── t_ttl.go │ │ ├── t_zset.go │ │ ├── tx.go │ │ └── util.go ├── pelletier │ └── go-toml │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── CONTRIBUTING.md │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ ├── README.md │ │ ├── azure-pipelines.yml │ │ ├── benchmark.json │ │ ├── benchmark.sh │ │ ├── benchmark.toml │ │ ├── benchmark.yml │ │ ├── doc.go │ │ ├── example-crlf.toml │ │ ├── example.toml │ │ ├── fuzz.go │ │ ├── fuzz.sh │ │ ├── fuzzit.sh │ │ ├── go.mod │ │ ├── go.sum │ │ ├── keysparsing.go │ │ ├── lexer.go │ │ ├── marshal.go │ │ ├── marshal_OrderPreserve_test.toml │ │ ├── marshal_test.toml │ │ ├── parser.go │ │ ├── position.go │ │ ├── token.go │ │ ├── toml.go │ │ ├── tomltree_create.go │ │ └── tomltree_write.go ├── siddontang │ ├── go-snappy │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ └── snappy │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ └── snappy.go │ ├── go │ │ ├── LICENSE │ │ ├── filelock │ │ │ ├── LICENSE │ │ │ ├── file_lock_generic.go │ │ │ ├── file_lock_solaris.go │ │ │ ├── file_lock_unix.go │ │ │ └── file_lock_windows.go │ │ ├── hack │ │ │ └── hack.go │ │ ├── ioutil2 │ │ │ ├── ioutil.go │ │ │ └── sectionwriter.go │ │ ├── log │ │ │ ├── doc.go │ │ │ ├── filehandler.go │ │ │ ├── handler.go │ │ │ ├── log.go │ │ │ └── sockethandler.go │ │ ├── num │ │ │ ├── bytes.go │ │ │ ├── cmp.go │ │ │ └── str.go │ │ ├── snappy │ │ │ ├── LICENSE │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ └── snappy.go │ │ └── sync2 │ │ │ ├── atomic.go │ │ │ └── semaphore.go │ ├── ledisdb │ │ ├── LICENSE │ │ ├── config │ │ │ ├── config-docker.toml │ │ │ ├── config.go │ │ │ └── config.toml │ │ ├── ledis │ │ │ ├── batch.go │ │ │ ├── const.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── event.go │ │ │ ├── ledis.go │ │ │ ├── ledis_db.go │ │ │ ├── migrate.go │ │ │ ├── replication.go │ │ │ ├── scan.go │ │ │ ├── sort.go │ │ │ ├── t_hash.go │ │ │ ├── t_kv.go │ │ │ ├── t_list.go │ │ │ ├── t_set.go │ │ │ ├── t_ttl.go │ │ │ ├── t_zset.go │ │ │ └── util.go │ │ ├── rpl │ │ │ ├── file_io.go │ │ │ ├── file_store.go │ │ │ ├── file_table.go │ │ │ ├── goleveldb_store.go │ │ │ ├── log.go │ │ │ ├── rpl.go │ │ │ └── store.go │ │ └── store │ │ │ ├── db.go │ │ │ ├── driver │ │ │ ├── driver.go │ │ │ ├── slice.go │ │ │ └── store.go │ │ │ ├── goleveldb │ │ │ ├── batch.go │ │ │ ├── const.go │ │ │ ├── db.go │ │ │ ├── iterator.go │ │ │ └── snapshot.go │ │ │ ├── iterator.go │ │ │ ├── leveldb │ │ │ ├── batch.go │ │ │ ├── cache.go │ │ │ ├── const.go │ │ │ ├── db.go │ │ │ ├── filterpolicy.go │ │ │ ├── iterator.go │ │ │ ├── leveldb_ext.cc │ │ │ ├── leveldb_ext.h │ │ │ ├── levigo-license │ │ │ ├── options.go │ │ │ ├── slice.go │ │ │ ├── snapshot.go │ │ │ └── util.go │ │ │ ├── rocksdb │ │ │ ├── batch.go │ │ │ ├── cache.go │ │ │ ├── const.go │ │ │ ├── db.go │ │ │ ├── env.go │ │ │ ├── filterpolicy.go │ │ │ ├── iterator.go │ │ │ ├── options.go │ │ │ ├── rocksdb_ext.cc │ │ │ ├── rocksdb_ext.h │ │ │ ├── slice.go │ │ │ ├── snapshot.go │ │ │ └── util.go │ │ │ ├── slice.go │ │ │ ├── snapshot.go │ │ │ ├── stat.go │ │ │ ├── store.go │ │ │ └── writebatch.go │ └── rdb │ │ ├── LICENSE │ │ ├── README.md │ │ ├── decode.go │ │ ├── digest.go │ │ ├── encode.go │ │ ├── loader.go │ │ ├── reader.go │ │ └── wandoujia-license ├── smartystreets │ ├── assertions │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── collections.go │ │ ├── doc.go │ │ ├── equal_method.go │ │ ├── equality.go │ │ ├── filter.go │ │ ├── internal │ │ │ ├── go-render │ │ │ │ ├── LICENSE │ │ │ │ └── render │ │ │ │ │ └── render.go │ │ │ └── oglematchers │ │ │ │ ├── .gitignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── any_of.go │ │ │ │ ├── contains.go │ │ │ │ ├── deep_equals.go │ │ │ │ ├── equals.go │ │ │ │ ├── greater_or_equal.go │ │ │ │ ├── greater_than.go │ │ │ │ ├── less_or_equal.go │ │ │ │ ├── less_than.go │ │ │ │ ├── matcher.go │ │ │ │ ├── not.go │ │ │ │ └── transform_description.go │ │ ├── messages.go │ │ ├── panic.go │ │ ├── quantity.go │ │ ├── serializer.go │ │ ├── strings.go │ │ ├── time.go │ │ └── type.go │ └── goconvey │ │ ├── LICENSE.md │ │ └── convey │ │ ├── assertions.go │ │ ├── context.go │ │ ├── convey.goconvey │ │ ├── discovery.go │ │ ├── doc.go │ │ ├── gotest │ │ └── utils.go │ │ ├── init.go │ │ ├── nilReporter.go │ │ └── reporting │ │ ├── console.go │ │ ├── doc.go │ │ ├── dot.go │ │ ├── gotest.go │ │ ├── init.go │ │ ├── json.go │ │ ├── printer.go │ │ ├── problems.go │ │ ├── reporter.go │ │ ├── reporting.goconvey │ │ ├── reports.go │ │ ├── statistics.go │ │ └── story.go └── syndtr │ └── goleveldb │ ├── LICENSE │ └── leveldb │ ├── batch.go │ ├── cache │ ├── cache.go │ └── lru.go │ ├── comparer.go │ ├── comparer │ ├── bytes_comparer.go │ └── comparer.go │ ├── db.go │ ├── db_compaction.go │ ├── db_iter.go │ ├── db_snapshot.go │ ├── db_state.go │ ├── db_transaction.go │ ├── db_util.go │ ├── db_write.go │ ├── doc.go │ ├── errors.go │ ├── errors │ └── errors.go │ ├── filter.go │ ├── filter │ ├── bloom.go │ └── filter.go │ ├── iterator │ ├── array_iter.go │ ├── indexed_iter.go │ ├── iter.go │ └── merged_iter.go │ ├── journal │ └── journal.go │ ├── key.go │ ├── memdb │ └── memdb.go │ ├── opt │ └── options.go │ ├── options.go │ ├── session.go │ ├── session_compaction.go │ ├── session_record.go │ ├── session_util.go │ ├── storage.go │ ├── storage │ ├── file_storage.go │ ├── file_storage_nacl.go │ ├── file_storage_plan9.go │ ├── file_storage_solaris.go │ ├── file_storage_unix.go │ ├── file_storage_windows.go │ ├── mem_storage.go │ └── storage.go │ ├── table.go │ ├── table │ ├── reader.go │ ├── table.go │ └── writer.go │ ├── util.go │ ├── util │ ├── buffer.go │ ├── buffer_pool.go │ ├── crc32.go │ ├── hash.go │ ├── range.go │ └── util.go │ └── version.go ├── golang.org └── x │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── context │ │ ├── context.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ └── pre_go19.go │ └── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_freebsd_arm64.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_netbsd_arm64.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_openbsd_arm.s │ ├── asm_solaris_amd64.s │ ├── bluetooth_linux.go │ ├── cap_freebsd.go │ ├── constants.go │ ├── dev_aix_ppc.go │ ├── dev_aix_ppc64.go │ ├── dev_darwin.go │ ├── dev_dragonfly.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_netbsd.go │ ├── dev_openbsd.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ioctl.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mksysctl_openbsd.pl │ ├── openbsd_pledge.go │ ├── openbsd_unveil.go │ ├── pagesize_unix.go │ ├── race.go │ ├── race0.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── str.go │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.go │ ├── syscall_darwin_libSystem.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_freebsd_arm64.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_gc.go │ ├── syscall_linux_gc_386.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_riscv64.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_netbsd_arm64.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── timestruct.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_freebsd_arm64.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_riscv64.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_netbsd_arm64.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_solaris_amd64.go │ ├── zptrace386_linux.go │ ├── zptracearm_linux.go │ ├── zptracemips_linux.go │ ├── zptracemipsle_linux.go │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_386.1_11.go │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_386.s │ ├── zsyscall_darwin_amd64.1_11.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm.1_11.go │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm.s │ ├── zsyscall_darwin_arm64.1_11.go │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_darwin_arm64.s │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_freebsd_arm64.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_riscv64.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_netbsd_arm64.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_freebsd_arm64.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_riscv64.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_netbsd_arm64.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_freebsd_arm64.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_riscv64.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_netbsd_arm64.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ └── ztypes_solaris_amd64.go │ └── windows │ ├── aliases.go │ ├── asm_windows_386.s │ ├── asm_windows_amd64.s │ ├── asm_windows_arm.s │ ├── dll_windows.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ └── zsyscall_windows.go ├── google.golang.org └── appengine │ ├── LICENSE │ └── cloudsql │ ├── cloudsql.go │ ├── cloudsql_classic.go │ └── cloudsql_vm.go ├── gopkg.in ├── bufio.v1 │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── buffer.go │ └── bufio.go ├── ini.v1 │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── README_ZH.md │ ├── error.go │ ├── file.go │ ├── ini.go │ ├── key.go │ ├── parser.go │ ├── section.go │ └── struct.go └── redis.v2 │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── command.go │ ├── commands.go │ ├── doc.go │ ├── error.go │ ├── multi.go │ ├── parser.go │ ├── pipeline.go │ ├── pool.go │ ├── pubsub.go │ ├── rate_limit.go │ ├── redis.go │ ├── script.go │ └── sentinel.go └── modules.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea/ 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # go-cache 2 | This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql 3 | 4 | example 5 | ``` 6 | package main 7 | 8 | import ( 9 | "github.com/huntsman-li/go-cache" 10 | _ "github.com/huntsman-li/go-cache/redis" 11 | ) 12 | 13 | func main() { 14 | ca, err := cache.Cacher(cache.Options{ 15 | Adapter: "redis", 16 | AdapterConfig: "addr=127.0.0.1:6379", 17 | OccupyMode: true, 18 | }) 19 | 20 | if err != nil { 21 | panic(err) 22 | } 23 | 24 | ca.Put("liyan", "cache", 60) 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /example/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/huntsman-li/go-cache" 5 | _ "github.com/huntsman-li/go-cache/redis" 6 | ) 7 | 8 | func main() { 9 | ca, err := cache.Cacher(cache.Options{ 10 | Adapter: "redis", 11 | AdapterConfig: "addr=127.0.0.1:6379", 12 | OccupyMode: true, 13 | }) 14 | 15 | if err != nil { 16 | panic(err) 17 | } 18 | 19 | ca.Put("liyan", "cache", 60) 20 | } 21 | -------------------------------------------------------------------------------- /file_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The go-cache Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package cache 16 | 17 | import ( 18 | "os" 19 | "path" 20 | "testing" 21 | 22 | . "github.com/smartystreets/goconvey/convey" 23 | ) 24 | 25 | func Test_FileCacher(t *testing.T) { 26 | Convey("Test file cache adapter", t, func() { 27 | dir := path.Join(os.TempDir(), "data/caches") 28 | os.RemoveAll(dir) 29 | testAdapter(Options{ 30 | Adapter: "file", 31 | AdapterConfig: dir, 32 | Interval: 2, 33 | }) 34 | }) 35 | } -------------------------------------------------------------------------------- /ledis/ledis.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /memcache/memcache.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /memory_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The go-cache Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package cache 16 | 17 | import ( 18 | "testing" 19 | 20 | . "github.com/smartystreets/goconvey/convey" 21 | ) 22 | 23 | func Test_MemoryCacher(t *testing.T) { 24 | Convey("Test memory cache adapter", t, func() { 25 | testAdapter(Options{ 26 | Interval: 2, 27 | }) 28 | }) 29 | } -------------------------------------------------------------------------------- /mysql/mysql.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /nodb/nodb.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /postgresql/postgres.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /redis/redis.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/.gitignore: -------------------------------------------------------------------------------- 1 | TAGS 2 | tags 3 | .*.swp 4 | tomlcheck/tomlcheck 5 | toml.test 6 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.1 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - tip 10 | install: 11 | - go install ./... 12 | - go get github.com/BurntSushi/toml-test 13 | script: 14 | - export PATH="$PATH:$HOME/gopath/bin" 15 | - make test 16 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md) 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 TOML authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package toml provides facilities for decoding and encoding TOML configuration 3 | files via reflection. There is also support for delaying decoding with 4 | the Primitive type, and querying the set of keys in a TOML document with the 5 | MetaData type. 6 | 7 | The specification implemented: https://github.com/toml-lang/toml 8 | 9 | The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify 10 | whether a file is a valid TOML document. It can also be used to print the 11 | type of each key in a TOML document. 12 | 13 | Testing 14 | 15 | There are two important types of tests used for this package. The first is 16 | contained inside '*_test.go' files and uses the standard Go unit testing 17 | framework. These tests are primarily devoted to holistically testing the 18 | decoder and encoder. 19 | 20 | The second type of testing is used to verify the implementation's adherence 21 | to the TOML specification. These tests have been factored into their own 22 | project: https://github.com/BurntSushi/toml-test 23 | 24 | The reason the tests are in a separate project is so that they can be used by 25 | any implementation of TOML. Namely, it is language agnostic. 26 | */ 27 | package toml 28 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/.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 | .idea 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 | *.iml 25 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - tip 8 | 9 | install: go get -v -t 10 | 11 | notifications: 12 | email: 13 | - u@gogs.io -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/README.md: -------------------------------------------------------------------------------- 1 | Common Functions 2 | ================ 3 | 4 | [![Build Status](https://travis-ci.org/Unknwon/com.svg)](https://travis-ci.org/Unknwon/com) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/com) 5 | 6 | This is an open source project for commonly used functions for the Go programming language. 7 | 8 | This package need >= **go 1.2** 9 | 10 | Code Convention: based on [Go Code Convention](https://github.com/Unknwon/go-code-convention). 11 | 12 | ## Contribute 13 | 14 | Your contribute is welcome, but you have to check following steps after you added some functions and commit them: 15 | 16 | 1. Make sure you wrote user-friendly comments for **all functions** . 17 | 2. Make sure you wrote test cases with any possible condition for **all functions** in file `*_test.go`. 18 | 3. Make sure you wrote benchmarks for **all functions** in file `*_test.go`. 19 | 4. Make sure you wrote useful examples for **all functions** in file `example_test.go`. 20 | 5. Make sure you ran `go test` and got **PASS** . 21 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/math.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 com authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package com 16 | 17 | // PowInt is int type of math.Pow function. 18 | func PowInt(x int, y int) int { 19 | if y <= 0 { 20 | return 1 21 | } else { 22 | if y % 2 == 0 { 23 | sqrt := PowInt(x, y/2) 24 | return sqrt * sqrt 25 | } else { 26 | return PowInt(x, y-1) * x 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/url.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 com authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package com 16 | 17 | import ( 18 | "encoding/base64" 19 | "net/url" 20 | ) 21 | 22 | // url encode string, is + not %20 23 | func UrlEncode(str string) string { 24 | return url.QueryEscape(str) 25 | } 26 | 27 | // url decode string 28 | func UrlDecode(str string) (string, error) { 29 | return url.QueryUnescape(str) 30 | } 31 | 32 | // base64 encode 33 | func Base64Encode(str string) string { 34 | return base64.StdEncoding.EncodeToString([]byte(str)) 35 | } 36 | 37 | // base64 decode 38 | func Base64Decode(str string) (string, error) { 39 | s, e := base64.StdEncoding.DecodeString(str) 40 | return string(s), e 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/.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 | 24 | # Project-specific files 25 | diff 26 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.1 4 | - tip 5 | before_install: 6 | - go get gopkg.in/check.v1 7 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Jonathan Rudenberg 2 | Copyright (c) 2012 Sripathi Krishnan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/README.md: -------------------------------------------------------------------------------- 1 | # rdb [![Build Status](https://travis-ci.org/cupcake/rdb.png?branch=master)](https://travis-ci.org/cupcake/rdb) 2 | 3 | rdb is a Go package that implements parsing and encoding of the 4 | [Redis](http://redis.io) [RDB file 5 | format](https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_File_Format.textile). 6 | 7 | This package was heavily inspired by 8 | [redis-rdb-tools](https://github.com/sripathikrishnan/redis-rdb-tools) by 9 | [Sripathi Krishnan](https://github.com/sripathikrishnan). 10 | 11 | [**Documentation**](http://godoc.org/github.com/cupcake/rdb) 12 | 13 | ## Installation 14 | 15 | ``` 16 | go get github.com/cupcake/rdb 17 | ``` 18 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/slice_buffer.go: -------------------------------------------------------------------------------- 1 | package rdb 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | type sliceBuffer struct { 9 | s []byte 10 | i int 11 | } 12 | 13 | func newSliceBuffer(s []byte) *sliceBuffer { 14 | return &sliceBuffer{s, 0} 15 | } 16 | 17 | func (s *sliceBuffer) Slice(n int) ([]byte, error) { 18 | if s.i+n > len(s.s) { 19 | return nil, io.EOF 20 | } 21 | b := s.s[s.i : s.i+n] 22 | s.i += n 23 | return b, nil 24 | } 25 | 26 | func (s *sliceBuffer) ReadByte() (byte, error) { 27 | if s.i >= len(s.s) { 28 | return 0, io.EOF 29 | } 30 | b := s.s[s.i] 31 | s.i++ 32 | return b, nil 33 | } 34 | 35 | func (s *sliceBuffer) Read(b []byte) (int, error) { 36 | if len(b) == 0 { 37 | return 0, nil 38 | } 39 | if s.i >= len(s.s) { 40 | return 0, io.EOF 41 | } 42 | n := copy(b, s.s[s.i:]) 43 | s.i += n 44 | return n, nil 45 | } 46 | 47 | func (s *sliceBuffer) Seek(offset int64, whence int) (int64, error) { 48 | var abs int64 49 | switch whence { 50 | case 0: 51 | abs = offset 52 | case 1: 53 | abs = int64(s.i) + offset 54 | case 2: 55 | abs = int64(len(s.s)) + offset 56 | default: 57 | return 0, errors.New("invalid whence") 58 | } 59 | if abs < 0 { 60 | return 0, errors.New("negative position") 61 | } 62 | if abs >= 1<<31 { 63 | return 0, errors.New("position out of range") 64 | } 65 | s.i = int(abs) 66 | return abs, nil 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/edsrzf/mmap-go/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.5 3 | *.6 4 | *.8 5 | *.swp 6 | _obj 7 | _test 8 | testdata 9 | -------------------------------------------------------------------------------- /vendor/github.com/edsrzf/mmap-go/README.md: -------------------------------------------------------------------------------- 1 | mmap-go 2 | ======= 3 | 4 | mmap-go is a portable mmap package for the [Go programming language](http://golang.org). 5 | It has been tested on Linux (386, amd64), OS X, and Windows (386). It should also 6 | work on other Unix-like platforms, but hasn't been tested with them. I'm interested 7 | to hear about the results. 8 | 9 | I haven't been able to add more features without adding significant complexity, 10 | so mmap-go doesn't support mprotect, mincore, and maybe a few other things. 11 | If you're running on a Unix-like platform and need some of these features, 12 | I suggest Gustavo Niemeyer's [gommap](http://labix.org/gommap). 13 | -------------------------------------------------------------------------------- /vendor/github.com/edsrzf/mmap-go/mmap_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Evan Shaw. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux openbsd solaris netbsd 6 | 7 | package mmap 8 | 9 | import ( 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | func mmap(len int, inprot, inflags, fd uintptr, off int64) ([]byte, error) { 14 | flags := unix.MAP_SHARED 15 | prot := unix.PROT_READ 16 | switch { 17 | case inprot© != 0: 18 | prot |= unix.PROT_WRITE 19 | flags = unix.MAP_PRIVATE 20 | case inprot&RDWR != 0: 21 | prot |= unix.PROT_WRITE 22 | } 23 | if inprot&EXEC != 0 { 24 | prot |= unix.PROT_EXEC 25 | } 26 | if inflags&ANON != 0 { 27 | flags |= unix.MAP_ANON 28 | } 29 | 30 | b, err := unix.Mmap(int(fd), off, len, prot, flags) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return b, nil 35 | } 36 | 37 | func (m MMap) flush() error { 38 | return unix.Msync([]byte(m), unix.MS_SYNC) 39 | } 40 | 41 | func (m MMap) lock() error { 42 | return unix.Mlock([]byte(m)) 43 | } 44 | 45 | func (m MMap) unlock() error { 46 | return unix.Munlock([]byte(m)) 47 | } 48 | 49 | func (m MMap) unmap() error { 50 | return unix.Munmap([]byte(m)) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store? 3 | ._* 4 | .Spotlight-V100 5 | .Trashes 6 | Icon? 7 | ehthumbs.db 8 | Thumbs.db 9 | .idea 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Reporting Issues 4 | 5 | Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed). 6 | 7 | ## Contributing Code 8 | 9 | By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file. 10 | Don't forget to add yourself to the AUTHORS file. 11 | 12 | ### Code Review 13 | 14 | Everyone is invited to review and comment on pull requests. 15 | If it looks fine to you, comment with "LGTM" (Looks good to me). 16 | 17 | If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes. 18 | 19 | Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM". 20 | 21 | ## Development Ideas 22 | 23 | If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page. 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.IsSet() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.IsSet() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /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/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/gopherjs/gopherjs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Richard Musiol. 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 | 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 | OWNER 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/jtolds/gls/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Space Monkey, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /vendor/github.com/jtolds/gls/gen_sym.go: -------------------------------------------------------------------------------- 1 | package gls 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | var ( 8 | keyMtx sync.Mutex 9 | keyCounter uint64 10 | ) 11 | 12 | // ContextKey is a throwaway value you can use as a key to a ContextManager 13 | type ContextKey struct{ id uint64 } 14 | 15 | // GenSym will return a brand new, never-before-used ContextKey 16 | func GenSym() ContextKey { 17 | keyMtx.Lock() 18 | defer keyMtx.Unlock() 19 | keyCounter += 1 20 | return ContextKey{id: keyCounter} 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/jtolds/gls/gid.go: -------------------------------------------------------------------------------- 1 | package gls 2 | 3 | var ( 4 | stackTagPool = &idPool{} 5 | ) 6 | 7 | // Will return this goroutine's identifier if set. If you always need a 8 | // goroutine identifier, you should use EnsureGoroutineId which will make one 9 | // if there isn't one already. 10 | func GetGoroutineId() (gid uint, ok bool) { 11 | return readStackTag() 12 | } 13 | 14 | // Will call cb with the current goroutine identifier. If one hasn't already 15 | // been generated, one will be created and set first. The goroutine identifier 16 | // might be invalid after cb returns. 17 | func EnsureGoroutineId(cb func(gid uint)) { 18 | if gid, ok := readStackTag(); ok { 19 | cb(gid) 20 | return 21 | } 22 | gid := stackTagPool.Acquire() 23 | defer stackTagPool.Release(gid) 24 | addStackTag(gid, func() { cb(gid) }) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/jtolds/gls/id_pool.go: -------------------------------------------------------------------------------- 1 | package gls 2 | 3 | // though this could probably be better at keeping ids smaller, the goal of 4 | // this class is to keep a registry of the smallest unique integer ids 5 | // per-process possible 6 | 7 | import ( 8 | "sync" 9 | ) 10 | 11 | type idPool struct { 12 | mtx sync.Mutex 13 | released []uint 14 | max_id uint 15 | } 16 | 17 | func (p *idPool) Acquire() (id uint) { 18 | p.mtx.Lock() 19 | defer p.mtx.Unlock() 20 | if len(p.released) > 0 { 21 | id = p.released[len(p.released)-1] 22 | p.released = p.released[:len(p.released)-1] 23 | return id 24 | } 25 | id = p.max_id 26 | p.max_id++ 27 | return id 28 | } 29 | 30 | func (p *idPool) Release(id uint) { 31 | p.mtx.Lock() 32 | defer p.mtx.Unlock() 33 | p.released = append(p.released, id) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jtolds/gls/stack_tags_main.go: -------------------------------------------------------------------------------- 1 | // +build !js 2 | 3 | package gls 4 | 5 | // This file is used for standard Go builds, which have the expected runtime 6 | // support 7 | 8 | import ( 9 | "runtime" 10 | ) 11 | 12 | var ( 13 | findPtr = func() uintptr { 14 | var pc [1]uintptr 15 | n := runtime.Callers(4, pc[:]) 16 | if n != 1 { 17 | panic("failed to find function pointer") 18 | } 19 | return pc[0] 20 | } 21 | 22 | getStack = func(offset, amount int) (stack []uintptr, next_offset int) { 23 | stack = make([]uintptr, amount) 24 | stack = stack[:runtime.Callers(offset, stack)] 25 | if len(stack) < amount { 26 | return stack, 0 27 | } 28 | return stack, offset + len(stack) 29 | } 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - master 7 | 8 | sudo: true 9 | 10 | env: 11 | global: 12 | - PGUSER=postgres 13 | - PQGOSSLTESTS=1 14 | - PQSSLCERTTEST_PATH=$PWD/certs 15 | - PGHOST=127.0.0.1 16 | matrix: 17 | - PGVERSION=10 18 | - PGVERSION=9.6 19 | - PGVERSION=9.5 20 | - PGVERSION=9.4 21 | 22 | before_install: 23 | - ./.travis.sh postgresql_uninstall 24 | - ./.travis.sh pgdg_repository 25 | - ./.travis.sh postgresql_install 26 | - ./.travis.sh postgresql_configure 27 | - ./.travis.sh client_configure 28 | - go get golang.org/x/tools/cmd/goimports 29 | - go get golang.org/x/lint/golint 30 | - GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@2019.2.1 31 | 32 | before_script: 33 | - createdb pqgotest 34 | - createuser -DRS pqgossltest 35 | - createuser -DRS pqgosslcert 36 | 37 | script: 38 | - > 39 | goimports -d -e $(find -name '*.go') | awk '{ print } END { exit NR == 0 ? 0 : 1 }' 40 | - go vet ./... 41 | - staticcheck -go 1.11 ./... 42 | - golint ./... 43 | - PQTEST_BINARY_PARAMETERS=no go test -race -v ./... 44 | - PQTEST_BINARY_PARAMETERS=yes go test -race -v ./... 45 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to pq 2 | 3 | `pq` has a backlog of pull requests, but contributions are still very 4 | much welcome. You can help with patch review, submitting bug reports, 5 | or adding new functionality. There is no formal style guide, but 6 | please conform to the style of existing code and general Go formatting 7 | conventions when submitting patches. 8 | 9 | ### Patch review 10 | 11 | Help review existing open pull requests by commenting on the code or 12 | proposed functionality. 13 | 14 | ### Bug reports 15 | 16 | We appreciate any bug reports, but especially ones with self-contained 17 | (doesn't depend on code outside of pq), minimal (can't be simplified 18 | further) test cases. It's especially helpful if you can submit a pull 19 | request with just the failing test case (you'll probably want to 20 | pattern it after the tests in 21 | [conn_test.go](https://github.com/lib/pq/blob/master/conn_test.go). 22 | 23 | ### New functionality 24 | 25 | There are a number of pending patches for new functionality, so 26 | additional feature patches will take a while to merge. Still, patches 27 | are generally reviewed based on usefulness and complexity in addition 28 | to time-in-queue, so if you have a knockout idea, take a shot. Feel 29 | free to open an issue discussion your proposed patch beforehand. 30 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/TESTS.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | ## Running Tests 4 | 5 | `go test` is used for testing. A running PostgreSQL 6 | server is required, with the ability to log in. The 7 | database to connect to test with is "pqgotest," on 8 | "localhost" but these can be overridden using [environment 9 | variables](https://www.postgresql.org/docs/9.3/static/libpq-envars.html). 10 | 11 | Example: 12 | 13 | PGHOST=/run/postgresql go test 14 | 15 | ## Benchmarks 16 | 17 | A benchmark suite can be run as part of the tests: 18 | 19 | go test -bench . 20 | 21 | ## Example setup (Docker) 22 | 23 | Run a postgres container: 24 | 25 | ``` 26 | docker run --expose 5432:5432 postgres 27 | ``` 28 | 29 | Run tests: 30 | 31 | ``` 32 | PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test 33 | ``` 34 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lib/pq 2 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_permissions.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pq 4 | 5 | import "os" 6 | 7 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 8 | // The key file should have very little access. 9 | // 10 | // libpq does not check key file permissions on Windows. 11 | func sslKeyPermissions(sslkey string) error { 12 | info, err := os.Stat(sslkey) 13 | if err != nil { 14 | return err 15 | } 16 | if info.Mode().Perm()&0077 != 0 { 17 | return ErrSSLKeyHasWorldPermissions 18 | } 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pq 4 | 5 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 6 | // The key file should have very little access. 7 | // 8 | // libpq does not check key file permissions on Windows. 9 | func sslKeyPermissions(string) error { return nil } 10 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | ) 7 | 8 | // decodeUUIDBinary interprets the binary format of a uuid, returning it in text format. 9 | func decodeUUIDBinary(src []byte) ([]byte, error) { 10 | if len(src) != 16 { 11 | return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src)) 12 | } 13 | 14 | dst := make([]byte, 36) 15 | dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-' 16 | hex.Encode(dst[0:], src[0:4]) 17 | hex.Encode(dst[9:], src[4:6]) 18 | hex.Encode(dst[14:], src[6:8]) 19 | hex.Encode(dst[19:], src[8:10]) 20 | hex.Encode(dst[24:], src[10:16]) 21 | 22 | return dst, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/log/.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 | log.db 24 | *.log 25 | logs 26 | .vscode -------------------------------------------------------------------------------- /vendor/github.com/lunny/log/README.md: -------------------------------------------------------------------------------- 1 | ## log 2 | [![GoDoc](https://godoc.org/github.com/lunny/log?status.png)](https://godoc.org/github.com/lunny/log) 3 | 4 | [简体中文](https://github.com/lunny/log/blob/master/README_CN.md) 5 | 6 | # Installation 7 | 8 | ``` 9 | go get github.com/lunny/log 10 | ``` 11 | 12 | # Features 13 | 14 | * Add color support for unix console 15 | * Implemented dbwriter to save log to database 16 | * Implemented FileWriter to save log to file by date or time. 17 | * Location configuration 18 | 19 | # Example 20 | 21 | For Single File: 22 | ```Go 23 | f, _ := os.Create("my.log") 24 | log.Std.SetOutput(f) 25 | ``` 26 | 27 | For Multiple Writer: 28 | ```Go 29 | f, _ := os.Create("my.log") 30 | log.Std.SetOutput(io.MultiWriter(f, os.Stdout)) 31 | ``` 32 | 33 | For log files by date or time: 34 | ```Go 35 | w := log.NewFileWriter(log.FileOptions{ 36 | ByType:log.ByDay, 37 | Dir:"./logs", 38 | }) 39 | log.Std.SetOutput(w) 40 | ``` 41 | 42 | # About 43 | 44 | This repo is an extension of Golang log. 45 | 46 | # LICENSE 47 | 48 | BSD License 49 | [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) 50 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/log/README_CN.md: -------------------------------------------------------------------------------- 1 | ## log 2 | [![GoDoc](https://godoc.org/github.com/lunny/log?status.png)](https://godoc.org/github.com/lunny/log) 3 | 4 | [English](https://github.com/lunny/log/blob/master/README.md) 5 | 6 | # 安装 7 | 8 | ``` 9 | go get github.com/lunny/log 10 | ``` 11 | 12 | # 特性 13 | 14 | * 对unix增加控制台颜色支持 15 | * 实现了保存log到数据库支持 16 | * 实现了保存log到按日期的文件支持 17 | * 实现了设置日期的地区 18 | 19 | # 例子 20 | 21 | 保存到单个文件: 22 | 23 | ```Go 24 | f, _ := os.Create("my.log") 25 | log.Std.SetOutput(f) 26 | ``` 27 | 28 | 保存到数据库: 29 | 30 | ```Go 31 | f, _ := os.Create("my.log") 32 | log.Std.SetOutput(io.MultiWriter(f, os.Stdout)) 33 | ``` 34 | 35 | 保存到按时间分隔的文件: 36 | 37 | ```Go 38 | w := log.NewFileWriter(log.FileOptions{ 39 | ByType:log.ByDay, 40 | Dir:"./logs", 41 | }) 42 | log.Std.SetOutput(w) 43 | ``` 44 | 45 | # 关于 46 | 47 | 本 Log 是在 golang 的 log 之上的扩展 48 | 49 | # LICENSE 50 | 51 | BSD License 52 | [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) 53 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/log/dbwriter.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "database/sql" 5 | "time" 6 | ) 7 | 8 | type DBWriter struct { 9 | db *sql.DB 10 | stmt *sql.Stmt 11 | content chan []byte 12 | } 13 | 14 | func NewDBWriter(db *sql.DB) (*DBWriter, error) { 15 | _, err := db.Exec("CREATE TABLE IF NOT EXISTS log (id int, content text, created datetime)") 16 | if err != nil { 17 | return nil, err 18 | } 19 | stmt, err := db.Prepare("INSERT INTO log (content, created) values (?, ?)") 20 | if err != nil { 21 | return nil, err 22 | } 23 | return &DBWriter{db, stmt, make(chan []byte, 1000)}, nil 24 | } 25 | 26 | func (w *DBWriter) Write(p []byte) (n int, err error) { 27 | _, err = w.stmt.Exec(string(p), time.Now()) 28 | if err == nil { 29 | n = len(p) 30 | } 31 | return 32 | } 33 | 34 | func (w *DBWriter) Close() { 35 | w.stmt.Close() 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.pyc 3 | .DS_Store 4 | nohup.out 5 | build_config.mk 6 | var 7 | .vscode 8 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 siddontang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/config/config.toml: -------------------------------------------------------------------------------- 1 | # LedisDB configuration 2 | 3 | # Server listen address 4 | addr = "127.0.0.1:6380" 5 | 6 | # Server http listen address, set empty to disable 7 | http_addr = "127.0.0.1:11181" 8 | 9 | # Data store path, all ledisdb's data will be saved here 10 | data_dir = "/tmp/ledis_server" 11 | 12 | # Log server command, set empty to disable 13 | access_log = "" 14 | 15 | # Set slaveof to enable replication from master, empty, no replication 16 | slaveof = "" 17 | 18 | # Choose which backend storage to use, now support: 19 | # 20 | # leveldb 21 | # rocksdb 22 | # goleveldb 23 | # lmdb 24 | # boltdb 25 | # hyperleveldb 26 | # memory 27 | # 28 | db_name = "leveldb" 29 | 30 | [leveldb] 31 | compression = false 32 | block_size = 32768 33 | write_buffer_size = 67108864 34 | cache_size = 524288000 35 | max_open_files = 1024 36 | 37 | [lmdb] 38 | map_size = 524288000 39 | nosync = true 40 | 41 | [binlog] 42 | max_file_size = 0 43 | max_file_num = 0 44 | 45 | 46 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/info.go: -------------------------------------------------------------------------------- 1 | package nodb 2 | 3 | // todo, add info 4 | 5 | // type Keyspace struct { 6 | // Kvs int `json:"kvs"` 7 | // KvExpires int `json:"kv_expires"` 8 | 9 | // Lists int `json:"lists"` 10 | // ListExpires int `json:"list_expires"` 11 | 12 | // Bitmaps int `json:"bitmaps"` 13 | // BitmapExpires int `json:"bitmap_expires"` 14 | 15 | // ZSets int `json:"zsets"` 16 | // ZSetExpires int `json:"zset_expires"` 17 | 18 | // Hashes int `json:"hashes"` 19 | // HashExpires int `json:"hahsh_expires"` 20 | // } 21 | 22 | // type Info struct { 23 | // KeySpaces [MaxDBNumber]Keyspace 24 | // } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/driver/batch.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | type BatchPuter interface { 4 | BatchPut([]Write) error 5 | } 6 | 7 | type Write struct { 8 | Key []byte 9 | Value []byte 10 | } 11 | 12 | type WriteBatch struct { 13 | batch BatchPuter 14 | wb []Write 15 | } 16 | 17 | func (w *WriteBatch) Put(key, value []byte) { 18 | if value == nil { 19 | value = []byte{} 20 | } 21 | w.wb = append(w.wb, Write{key, value}) 22 | } 23 | 24 | func (w *WriteBatch) Delete(key []byte) { 25 | w.wb = append(w.wb, Write{key, nil}) 26 | } 27 | 28 | func (w *WriteBatch) Commit() error { 29 | return w.batch.BatchPut(w.wb) 30 | } 31 | 32 | func (w *WriteBatch) Rollback() error { 33 | w.wb = w.wb[0:0] 34 | return nil 35 | } 36 | 37 | func NewWriteBatch(puter BatchPuter) IWriteBatch { 38 | return &WriteBatch{puter, []Write{}} 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/driver/driver.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | ErrTxSupport = errors.New("transaction is not supported") 9 | ) 10 | 11 | type IDB interface { 12 | Close() error 13 | 14 | Get(key []byte) ([]byte, error) 15 | 16 | Put(key []byte, value []byte) error 17 | Delete(key []byte) error 18 | 19 | NewIterator() IIterator 20 | 21 | NewWriteBatch() IWriteBatch 22 | 23 | NewSnapshot() (ISnapshot, error) 24 | 25 | Begin() (Tx, error) 26 | } 27 | 28 | type ISnapshot interface { 29 | Get(key []byte) ([]byte, error) 30 | NewIterator() IIterator 31 | Close() 32 | } 33 | 34 | type IIterator interface { 35 | Close() error 36 | 37 | First() 38 | Last() 39 | Seek(key []byte) 40 | 41 | Next() 42 | Prev() 43 | 44 | Valid() bool 45 | 46 | Key() []byte 47 | Value() []byte 48 | } 49 | 50 | type IWriteBatch interface { 51 | Put(key []byte, value []byte) 52 | Delete(key []byte) 53 | Commit() error 54 | Rollback() error 55 | } 56 | 57 | type Tx interface { 58 | Get(key []byte) ([]byte, error) 59 | Put(key []byte, value []byte) error 60 | Delete(key []byte) error 61 | 62 | NewIterator() IIterator 63 | NewWriteBatch() IWriteBatch 64 | 65 | Commit() error 66 | Rollback() error 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/driver/store.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/lunny/nodb/config" 7 | ) 8 | 9 | type Store interface { 10 | String() string 11 | Open(path string, cfg *config.Config) (IDB, error) 12 | Repair(path string, cfg *config.Config) error 13 | } 14 | 15 | var dbs = map[string]Store{} 16 | 17 | func Register(s Store) { 18 | name := s.String() 19 | if _, ok := dbs[name]; ok { 20 | panic(fmt.Errorf("store %s is registered", s)) 21 | } 22 | 23 | dbs[name] = s 24 | } 25 | 26 | func ListStores() []string { 27 | s := []string{} 28 | for k, _ := range dbs { 29 | s = append(s, k) 30 | } 31 | 32 | return s 33 | } 34 | 35 | func GetStore(cfg *config.Config) (Store, error) { 36 | if len(cfg.DBName) == 0 { 37 | cfg.DBName = config.DefaultDBName 38 | } 39 | 40 | s, ok := dbs[cfg.DBName] 41 | if !ok { 42 | return nil, fmt.Errorf("store %s is not registered", cfg.DBName) 43 | } 44 | 45 | return s, nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/goleveldb/batch.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb" 5 | ) 6 | 7 | type WriteBatch struct { 8 | db *DB 9 | wbatch *leveldb.Batch 10 | } 11 | 12 | func (w *WriteBatch) Put(key, value []byte) { 13 | w.wbatch.Put(key, value) 14 | } 15 | 16 | func (w *WriteBatch) Delete(key []byte) { 17 | w.wbatch.Delete(key) 18 | } 19 | 20 | func (w *WriteBatch) Commit() error { 21 | return w.db.db.Write(w.wbatch, nil) 22 | } 23 | 24 | func (w *WriteBatch) Rollback() error { 25 | w.wbatch.Reset() 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/goleveldb/const.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | const DBName = "goleveldb" 4 | const MemDBName = "memory" 5 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/goleveldb/iterator.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb/iterator" 5 | ) 6 | 7 | type Iterator struct { 8 | it iterator.Iterator 9 | } 10 | 11 | func (it *Iterator) Key() []byte { 12 | return it.it.Key() 13 | } 14 | 15 | func (it *Iterator) Value() []byte { 16 | return it.it.Value() 17 | } 18 | 19 | func (it *Iterator) Close() error { 20 | if it.it != nil { 21 | it.it.Release() 22 | it.it = nil 23 | } 24 | return nil 25 | } 26 | 27 | func (it *Iterator) Valid() bool { 28 | return it.it.Valid() 29 | } 30 | 31 | func (it *Iterator) Next() { 32 | it.it.Next() 33 | } 34 | 35 | func (it *Iterator) Prev() { 36 | it.it.Prev() 37 | } 38 | 39 | func (it *Iterator) First() { 40 | it.it.First() 41 | } 42 | 43 | func (it *Iterator) Last() { 44 | it.it.Last() 45 | } 46 | 47 | func (it *Iterator) Seek(key []byte) { 48 | it.it.Seek(key) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/goleveldb/snapshot.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/lunny/nodb/store/driver" 5 | "github.com/syndtr/goleveldb/leveldb" 6 | ) 7 | 8 | type Snapshot struct { 9 | db *DB 10 | snp *leveldb.Snapshot 11 | } 12 | 13 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 14 | return s.snp.Get(key, s.db.iteratorOpts) 15 | } 16 | 17 | func (s *Snapshot) NewIterator() driver.IIterator { 18 | it := &Iterator{ 19 | s.snp.NewIterator(nil, s.db.iteratorOpts), 20 | } 21 | return it 22 | } 23 | 24 | func (s *Snapshot) Close() { 25 | s.snp.Release() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/snapshot.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/lunny/nodb/store/driver" 5 | ) 6 | 7 | type Snapshot struct { 8 | driver.ISnapshot 9 | } 10 | 11 | func (s *Snapshot) NewIterator() *Iterator { 12 | it := new(Iterator) 13 | it.it = s.ISnapshot.NewIterator() 14 | 15 | return it 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/store.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | "github.com/lunny/nodb/config" 8 | "github.com/lunny/nodb/store/driver" 9 | 10 | _ "github.com/lunny/nodb/store/goleveldb" 11 | ) 12 | 13 | func getStorePath(cfg *config.Config) string { 14 | return path.Join(cfg.DataDir, fmt.Sprintf("%s_data", cfg.DBName)) 15 | } 16 | 17 | func Open(cfg *config.Config) (*DB, error) { 18 | s, err := driver.GetStore(cfg) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | path := getStorePath(cfg) 24 | 25 | if err := os.MkdirAll(path, os.ModePerm); err != nil { 26 | return nil, err 27 | } 28 | 29 | idb, err := s.Open(path, cfg) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | db := &DB{idb} 35 | 36 | return db, nil 37 | } 38 | 39 | func Repair(cfg *config.Config) error { 40 | s, err := driver.GetStore(cfg) 41 | if err != nil { 42 | return err 43 | } 44 | 45 | path := getStorePath(cfg) 46 | 47 | return s.Repair(path, cfg) 48 | } 49 | 50 | func init() { 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/nodb/store/writebatch.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/lunny/nodb/store/driver" 5 | ) 6 | 7 | type WriteBatch interface { 8 | driver.IWriteBatch 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/.dockerignore: -------------------------------------------------------------------------------- 1 | cmd/tomll/tomll 2 | cmd/tomljson/tomljson 3 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/.gitignore: -------------------------------------------------------------------------------- 1 | test_program/test_program_bin 2 | fuzz/ 3 | cmd/tomll/tomll 4 | cmd/tomljson/tomljson 5 | cmd/tomltestgen/tomltestgen 6 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.12-alpine3.9 as builder 2 | WORKDIR /go/src/github.com/pelletier/go-toml 3 | COPY . . 4 | ENV CGO_ENABLED=0 5 | ENV GOOS=linux 6 | RUN go install ./... 7 | 8 | FROM scratch 9 | COPY --from=builder /go/bin/tomll /usr/bin/tomll 10 | COPY --from=builder /go/bin/tomljson /usr/bin/tomljson 11 | COPY --from=builder /go/bin/jsontoml /usr/bin/jsontoml 12 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 - 2017 Thomas Pelletier, Eric Anderton 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Issue:** add link to pelletier/go-toml issue here 2 | 3 | Explanation of what this pull request does. 4 | 5 | More detailed description of the decisions being made and the reasons why (if the patch is non-trivial). 6 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/benchmark.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | reference_ref=${1:-master} 6 | reference_git=${2:-.} 7 | 8 | if ! `hash benchstat 2>/dev/null`; then 9 | echo "Installing benchstat" 10 | go get golang.org/x/perf/cmd/benchstat 11 | fi 12 | 13 | tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX` 14 | ref_tempdir="${tempdir}/ref" 15 | ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt" 16 | local_benchmark="`pwd`/benchmark-local.txt" 17 | 18 | echo "=== ${reference_ref} (${ref_tempdir})" 19 | git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null 20 | pushd ${ref_tempdir} >/dev/null 21 | git checkout ${reference_ref} >/dev/null 2>/dev/null 22 | go test -bench=. -benchmem | tee ${ref_benchmark} 23 | popd >/dev/null 24 | 25 | echo "" 26 | echo "=== local" 27 | go test -bench=. -benchmem | tee ${local_benchmark} 28 | 29 | echo "" 30 | echo "=== diff" 31 | benchstat -delta-test=none ${ref_benchmark} ${local_benchmark} 32 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/doc.go: -------------------------------------------------------------------------------- 1 | // Package toml is a TOML parser and manipulation library. 2 | // 3 | // This version supports the specification as described in 4 | // https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md 5 | // 6 | // Marshaling 7 | // 8 | // Go-toml can marshal and unmarshal TOML documents from and to data 9 | // structures. 10 | // 11 | // TOML document as a tree 12 | // 13 | // Go-toml can operate on a TOML document as a tree. Use one of the Load* 14 | // functions to parse TOML data and obtain a Tree instance, then one of its 15 | // methods to manipulate the tree. 16 | // 17 | // JSONPath-like queries 18 | // 19 | // The package github.com/pelletier/go-toml/query implements a system 20 | // similar to JSONPath to quickly retrieve elements of a TOML document using a 21 | // single expression. See the package documentation for more information. 22 | // 23 | package toml 24 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/example-crlf.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML document. Boom. 2 | 3 | title = "TOML Example" 4 | 5 | [owner] 6 | name = "Tom Preston-Werner" 7 | organization = "GitHub" 8 | bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." 9 | dob = 1979-05-27T07:32:00Z # First class dates? Why not? 10 | 11 | [database] 12 | server = "192.168.1.1" 13 | ports = [ 8001, 8001, 8002 ] 14 | connection_max = 5000 15 | enabled = true 16 | 17 | [servers] 18 | 19 | # You can indent as you please. Tabs or spaces. TOML don't care. 20 | [servers.alpha] 21 | ip = "10.0.0.1" 22 | dc = "eqdc10" 23 | 24 | [servers.beta] 25 | ip = "10.0.0.2" 26 | dc = "eqdc10" 27 | 28 | [clients] 29 | data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it 30 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/example.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML document. Boom. 2 | 3 | title = "TOML Example" 4 | 5 | [owner] 6 | name = "Tom Preston-Werner" 7 | organization = "GitHub" 8 | bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." 9 | dob = 1979-05-27T07:32:00Z # First class dates? Why not? 10 | 11 | [database] 12 | server = "192.168.1.1" 13 | ports = [ 8001, 8001, 8002 ] 14 | connection_max = 5000 15 | enabled = true 16 | 17 | [servers] 18 | 19 | # You can indent as you please. Tabs or spaces. TOML don't care. 20 | [servers.alpha] 21 | ip = "10.0.0.1" 22 | dc = "eqdc10" 23 | 24 | [servers.beta] 25 | ip = "10.0.0.2" 26 | dc = "eqdc10" 27 | 28 | [clients] 29 | data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it 30 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package toml 4 | 5 | func Fuzz(data []byte) int { 6 | tree, err := LoadBytes(data) 7 | if err != nil { 8 | if tree != nil { 9 | panic("tree must be nil if there is an error") 10 | } 11 | return 0 12 | } 13 | 14 | str, err := tree.ToTomlString() 15 | if err != nil { 16 | if str != "" { 17 | panic(`str must be "" if there is an error`) 18 | } 19 | panic(err) 20 | } 21 | 22 | tree, err = Load(str) 23 | if err != nil { 24 | if tree != nil { 25 | panic("tree must be nil if there is an error") 26 | } 27 | return 0 28 | } 29 | 30 | return 1 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/fuzz.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -eu 3 | 4 | go get github.com/dvyukov/go-fuzz/go-fuzz 5 | go get github.com/dvyukov/go-fuzz/go-fuzz-build 6 | 7 | if [ ! -e toml-fuzz.zip ]; then 8 | go-fuzz-build github.com/pelletier/go-toml 9 | fi 10 | 11 | rm -fr fuzz 12 | mkdir -p fuzz/corpus 13 | cp *.toml fuzz/corpus 14 | 15 | go-fuzz -bin=toml-fuzz.zip -workdir=fuzz 16 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/fuzzit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -xe 3 | 4 | # go-fuzz doesn't support modules yet, so ensure we do everything 5 | # in the old style GOPATH way 6 | export GO111MODULE="off" 7 | 8 | # install go-fuzz 9 | go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build 10 | 11 | # target name can only contain lower-case letters (a-z), digits (0-9) and a dash (-) 12 | # to add another target, make sure to create it with `fuzzit create target` 13 | # before using `fuzzit create job` 14 | TARGET=toml-fuzzer 15 | 16 | go-fuzz-build -libfuzzer -o ${TARGET}.a github.com/pelletier/go-toml 17 | clang -fsanitize=fuzzer ${TARGET}.a -o ${TARGET} 18 | 19 | # install fuzzit for talking to fuzzit.dev service 20 | # or latest version: 21 | # https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_Linux_x86_64 22 | wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.52/fuzzit_Linux_x86_64 23 | chmod a+x fuzzit 24 | 25 | # TODO: change kkowalczyk to go-toml and create toml-fuzzer target there 26 | ./fuzzit create job --type $TYPE go-toml/${TARGET} ${TARGET} 27 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/pelletier/go-toml 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/BurntSushi/toml v0.3.1 7 | github.com/davecgh/go-spew v1.1.1 8 | gopkg.in/yaml.v2 v2.2.4 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/go.sum: -------------------------------------------------------------------------------- 1 | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 2 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 3 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 4 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 5 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 6 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 7 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 8 | gopkg.in/yaml.v2 v2.2.3 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI= 9 | gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 10 | gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= 11 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 12 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/marshal_OrderPreserve_test.toml: -------------------------------------------------------------------------------- 1 | title = "TOML Marshal Testing" 2 | 3 | [basic_lists] 4 | floats = [12.3,45.6,78.9] 5 | bools = [true,false,true] 6 | dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] 7 | ints = [8001,8001,8002] 8 | uints = [5002,5003] 9 | strings = ["One","Two","Three"] 10 | 11 | [[subdocptrs]] 12 | name = "Second" 13 | 14 | [basic_map] 15 | one = "one" 16 | two = "two" 17 | 18 | [subdoc] 19 | 20 | [subdoc.second] 21 | name = "Second" 22 | 23 | [subdoc.first] 24 | name = "First" 25 | 26 | [basic] 27 | uint = 5001 28 | bool = true 29 | float = 123.4 30 | float64 = 123.456782132399 31 | int = 5000 32 | string = "Bite me" 33 | date = 1979-05-27T07:32:00Z 34 | 35 | [[subdoclist]] 36 | name = "List.First" 37 | 38 | [[subdoclist]] 39 | name = "List.Second" 40 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/marshal_test.toml: -------------------------------------------------------------------------------- 1 | title = "TOML Marshal Testing" 2 | 3 | [basic] 4 | bool = true 5 | date = 1979-05-27T07:32:00Z 6 | float = 123.4 7 | float64 = 123.456782132399 8 | int = 5000 9 | string = "Bite me" 10 | uint = 5001 11 | 12 | [basic_lists] 13 | bools = [true,false,true] 14 | dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] 15 | floats = [12.3,45.6,78.9] 16 | ints = [8001,8001,8002] 17 | strings = ["One","Two","Three"] 18 | uints = [5002,5003] 19 | 20 | [basic_map] 21 | one = "one" 22 | two = "two" 23 | 24 | [subdoc] 25 | 26 | [subdoc.first] 27 | name = "First" 28 | 29 | [subdoc.second] 30 | name = "Second" 31 | 32 | [[subdoclist]] 33 | name = "List.First" 34 | 35 | [[subdoclist]] 36 | name = "List.Second" 37 | 38 | [[subdocptrs]] 39 | name = "Second" 40 | -------------------------------------------------------------------------------- /vendor/github.com/pelletier/go-toml/position.go: -------------------------------------------------------------------------------- 1 | // Position support for go-toml 2 | 3 | package toml 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Position of a document element within a TOML document. 10 | // 11 | // Line and Col are both 1-indexed positions for the element's line number and 12 | // column number, respectively. Values of zero or less will cause Invalid(), 13 | // to return true. 14 | type Position struct { 15 | Line int // line within the document 16 | Col int // column within the line 17 | } 18 | 19 | // String representation of the position. 20 | // Displays 1-indexed line and column numbers. 21 | func (p Position) String() string { 22 | return fmt.Sprintf("(%d, %d)", p.Line, p.Col) 23 | } 24 | 25 | // Invalid returns whether or not the position is valid (i.e. with negative or 26 | // null values) 27 | func (p Position) Invalid() bool { 28 | return p.Line <= 0 || p.Col <= 0 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go-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 | Google Inc. 12 | Jan Mercl <0xjnml@gmail.com> 13 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 siddontang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package filelock 8 | 9 | import ( 10 | "fmt" 11 | "io" 12 | "runtime" 13 | ) 14 | 15 | func Lock(name string) (io.Closer, error) { 16 | return nil, fmt.Errorf("leveldb/db: file locking is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build solaris 6 | 7 | package filelock 8 | 9 | import ( 10 | "io" 11 | "os" 12 | "syscall" 13 | ) 14 | 15 | // lockCloser hides all of an os.File's methods, except for Close. 16 | type lockCloser struct { 17 | f *os.File 18 | } 19 | 20 | func (l lockCloser) Close() error { 21 | return l.f.Close() 22 | } 23 | 24 | func Lock(name string) (io.Closer, error) { 25 | f, err := os.Create(name) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | spec := syscall.Flock_t{ 31 | Type: syscall.F_WRLCK, 32 | Whence: int16(os.SEEK_SET), 33 | Start: 0, 34 | Len: 0, // 0 means to lock the entire file. 35 | Pid: int32(os.Getpid()), 36 | } 37 | if err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &spec); err != nil { 38 | f.Close() 39 | return nil, err 40 | } 41 | 42 | return lockCloser{f}, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package filelock 8 | 9 | import ( 10 | "io" 11 | "os" 12 | "syscall" 13 | ) 14 | 15 | // lockCloser hides all of an os.File's methods, except for Close. 16 | type lockCloser struct { 17 | f *os.File 18 | } 19 | 20 | func (l lockCloser) Close() error { 21 | return l.f.Close() 22 | } 23 | 24 | func Lock(name string) (io.Closer, error) { 25 | f, err := os.Create(name) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | /* 31 | Some people tell me FcntlFlock does not exist, so use flock here 32 | */ 33 | if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil { 34 | f.Close() 35 | return nil, err 36 | } 37 | 38 | // spec := syscall.Flock_t{ 39 | // Type: syscall.F_WRLCK, 40 | // Whence: int16(os.SEEK_SET), 41 | // Start: 0, 42 | // Len: 0, // 0 means to lock the entire file. 43 | // Pid: int32(os.Getpid()), 44 | // } 45 | // if err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &spec); err != nil { 46 | // f.Close() 47 | // return nil, err 48 | // } 49 | 50 | return lockCloser{f}, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The LevelDB-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 filelock 6 | 7 | import ( 8 | "io" 9 | "syscall" 10 | ) 11 | 12 | // lockCloser hides all of an syscall.Handle's methods, except for Close. 13 | type lockCloser struct { 14 | fd syscall.Handle 15 | } 16 | 17 | func (l lockCloser) Close() error { 18 | return syscall.Close(l.fd) 19 | } 20 | 21 | func Lock(name string) (io.Closer, error) { 22 | p, err := syscall.UTF16PtrFromString(name) 23 | if err != nil { 24 | return nil, err 25 | } 26 | fd, err := syscall.CreateFile(p, 27 | syscall.GENERIC_READ|syscall.GENERIC_WRITE, 28 | 0, nil, syscall.CREATE_ALWAYS, 29 | syscall.FILE_ATTRIBUTE_NORMAL, 30 | 0, 31 | ) 32 | if err != nil { 33 | return nil, err 34 | } 35 | return lockCloser{fd: fd}, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/hack/hack.go: -------------------------------------------------------------------------------- 1 | package hack 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | // no copy to change slice to string 9 | // use your own risk 10 | func String(b []byte) (s string) { 11 | pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 12 | pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) 13 | pstring.Data = pbytes.Data 14 | pstring.Len = pbytes.Len 15 | return 16 | } 17 | 18 | // no copy to change string to slice 19 | // use your own risk 20 | func Slice(s string) (b []byte) { 21 | pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 22 | pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) 23 | pbytes.Data = pstring.Data 24 | pbytes.Len = pstring.Len 25 | pbytes.Cap = pstring.Len 26 | return 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/ioutil2/ioutil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Google Inc. 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 ioutil2 6 | 7 | import ( 8 | "io" 9 | "io/ioutil" 10 | "os" 11 | "path" 12 | ) 13 | 14 | // Write file to temp and atomically move when everything else succeeds. 15 | func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error { 16 | dir, name := path.Dir(filename), path.Base(filename) 17 | f, err := ioutil.TempFile(dir, name) 18 | if err != nil { 19 | return err 20 | } 21 | n, err := f.Write(data) 22 | f.Close() 23 | if err == nil && n < len(data) { 24 | err = io.ErrShortWrite 25 | } else { 26 | err = os.Chmod(f.Name(), perm) 27 | } 28 | if err != nil { 29 | os.Remove(f.Name()) 30 | return err 31 | } 32 | return os.Rename(f.Name(), filename) 33 | } 34 | 35 | // Check file exists or not 36 | func FileExists(name string) bool { 37 | _, err := os.Stat(name) 38 | return !os.IsNotExist(err) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/log/doc.go: -------------------------------------------------------------------------------- 1 | // log package supplies more advanced features than go orign log package. 2 | // 3 | // It supports log different level: trace, debug, info, warn, error, fatal. 4 | // 5 | // It also supports different log handlers which you can log to stdout, file, socket, etc... 6 | // 7 | // Use 8 | // 9 | // import "github.com/siddontang/go/log" 10 | // 11 | // //log with different level 12 | // log.Info("hello world") 13 | // log.Error("hello world") 14 | // 15 | // //create a logger with specified handler 16 | // h := NewStreamHandler(os.Stdout) 17 | // l := log.NewDefault(h) 18 | // l.Info("hello world") 19 | // l.Infof("%s %d", "hello", 123) 20 | // 21 | package log 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/log/handler.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | //Handler writes logs to somewhere 8 | type Handler interface { 9 | Write(p []byte) (n int, err error) 10 | Close() error 11 | } 12 | 13 | //StreamHandler writes logs to a specified io Writer, maybe stdout, stderr, etc... 14 | type StreamHandler struct { 15 | w io.Writer 16 | } 17 | 18 | func NewStreamHandler(w io.Writer) (*StreamHandler, error) { 19 | h := new(StreamHandler) 20 | 21 | h.w = w 22 | 23 | return h, nil 24 | } 25 | 26 | func (h *StreamHandler) Write(b []byte) (n int, err error) { 27 | return h.w.Write(b) 28 | } 29 | 30 | func (h *StreamHandler) Close() error { 31 | return nil 32 | } 33 | 34 | //NullHandler does nothing, it discards anything. 35 | type NullHandler struct { 36 | } 37 | 38 | func NewNullHandler() (*NullHandler, error) { 39 | return new(NullHandler), nil 40 | } 41 | 42 | func (h *NullHandler) Write(b []byte) (n int, err error) { 43 | return len(b), nil 44 | } 45 | 46 | func (h *NullHandler) Close() { 47 | 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 siddontang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/rpl/store.go: -------------------------------------------------------------------------------- 1 | package rpl 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | const ( 8 | InvalidLogID uint64 = 0 9 | ) 10 | 11 | var ( 12 | ErrLogNotFound = errors.New("log not found") 13 | ErrStoreLogID = errors.New("log id is less") 14 | ErrNoBehindLog = errors.New("no behind commit log") 15 | ErrCommitIDBehind = errors.New("commit id is behind last log id") 16 | ) 17 | 18 | type LogStore interface { 19 | GetLog(id uint64, log *Log) error 20 | 21 | FirstID() (uint64, error) 22 | LastID() (uint64, error) 23 | 24 | // if log id is less than current last id, return error 25 | StoreLog(log *Log) error 26 | 27 | // Delete logs before n seconds 28 | PurgeExpired(n int64) error 29 | 30 | Sync() error 31 | 32 | // Clear all logs 33 | Clear() error 34 | 35 | Close() error 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/driver/driver.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | type IDB interface { 4 | Close() error 5 | 6 | Get(key []byte) ([]byte, error) 7 | 8 | Put(key []byte, value []byte) error 9 | Delete(key []byte) error 10 | 11 | SyncPut(key []byte, value []byte) error 12 | SyncDelete(key []byte) error 13 | 14 | NewIterator() IIterator 15 | 16 | NewWriteBatch() IWriteBatch 17 | 18 | NewSnapshot() (ISnapshot, error) 19 | 20 | Compact() error 21 | } 22 | 23 | type ISnapshot interface { 24 | Get(key []byte) ([]byte, error) 25 | NewIterator() IIterator 26 | Close() 27 | } 28 | 29 | type IIterator interface { 30 | Close() error 31 | 32 | First() 33 | Last() 34 | Seek(key []byte) 35 | 36 | Next() 37 | Prev() 38 | 39 | Valid() bool 40 | 41 | Key() []byte 42 | Value() []byte 43 | } 44 | 45 | type IWriteBatch interface { 46 | Put(key []byte, value []byte) 47 | Delete(key []byte) 48 | Commit() error 49 | SyncCommit() error 50 | Rollback() error 51 | Data() []byte 52 | Close() 53 | } 54 | 55 | type ISliceGeter interface { 56 | GetSlice(key []byte) (ISlice, error) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/driver/slice.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | type ISlice interface { 4 | Data() []byte 5 | Size() int 6 | Free() 7 | } 8 | 9 | type GoSlice []byte 10 | 11 | func (s GoSlice) Data() []byte { 12 | return []byte(s) 13 | } 14 | 15 | func (s GoSlice) Size() int { 16 | return len(s) 17 | } 18 | 19 | func (s GoSlice) Free() { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/driver/store.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/siddontang/ledisdb/config" 7 | ) 8 | 9 | type Store interface { 10 | String() string 11 | Open(path string, cfg *config.Config) (IDB, error) 12 | Repair(path string, cfg *config.Config) error 13 | } 14 | 15 | var dbs = map[string]Store{} 16 | 17 | func Register(s Store) { 18 | name := s.String() 19 | if _, ok := dbs[name]; ok { 20 | panic(fmt.Errorf("store %s is registered", s)) 21 | } 22 | 23 | dbs[name] = s 24 | } 25 | 26 | func ListStores() []string { 27 | s := []string{} 28 | for k := range dbs { 29 | s = append(s, k) 30 | } 31 | 32 | return s 33 | } 34 | 35 | func GetStore(cfg *config.Config) (Store, error) { 36 | if len(cfg.DBName) == 0 { 37 | cfg.DBName = config.DefaultDBName 38 | } 39 | 40 | s, ok := dbs[cfg.DBName] 41 | if !ok { 42 | return nil, fmt.Errorf("store %s is not registered", cfg.DBName) 43 | } 44 | 45 | return s, nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/batch.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb" 5 | ) 6 | 7 | type WriteBatch struct { 8 | db *DB 9 | wbatch *leveldb.Batch 10 | } 11 | 12 | func (w *WriteBatch) Put(key, value []byte) { 13 | w.wbatch.Put(key, value) 14 | } 15 | 16 | func (w *WriteBatch) Delete(key []byte) { 17 | w.wbatch.Delete(key) 18 | } 19 | 20 | func (w *WriteBatch) Commit() error { 21 | return w.db.db.Write(w.wbatch, nil) 22 | } 23 | 24 | func (w *WriteBatch) SyncCommit() error { 25 | return w.db.db.Write(w.wbatch, w.db.syncOpts) 26 | } 27 | 28 | func (w *WriteBatch) Rollback() error { 29 | w.wbatch.Reset() 30 | return nil 31 | } 32 | 33 | func (w *WriteBatch) Close() { 34 | w.wbatch.Reset() 35 | } 36 | 37 | func (w *WriteBatch) Data() []byte { 38 | return w.wbatch.Dump() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/const.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | const DBName = "goleveldb" 4 | const MemDBName = "memory" 5 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/iterator.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb/iterator" 5 | ) 6 | 7 | type Iterator struct { 8 | it iterator.Iterator 9 | } 10 | 11 | func (it *Iterator) Key() []byte { 12 | return it.it.Key() 13 | } 14 | 15 | func (it *Iterator) Value() []byte { 16 | return it.it.Value() 17 | } 18 | 19 | func (it *Iterator) Close() error { 20 | if it.it != nil { 21 | it.it.Release() 22 | it.it = nil 23 | } 24 | return nil 25 | } 26 | 27 | func (it *Iterator) Valid() bool { 28 | return it.it.Valid() 29 | } 30 | 31 | func (it *Iterator) Next() { 32 | it.it.Next() 33 | } 34 | 35 | func (it *Iterator) Prev() { 36 | it.it.Prev() 37 | } 38 | 39 | func (it *Iterator) First() { 40 | it.it.First() 41 | } 42 | 43 | func (it *Iterator) Last() { 44 | it.it.Last() 45 | } 46 | 47 | func (it *Iterator) Seek(key []byte) { 48 | it.it.Seek(key) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/snapshot.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/siddontang/ledisdb/store/driver" 5 | "github.com/syndtr/goleveldb/leveldb" 6 | ) 7 | 8 | type Snapshot struct { 9 | db *DB 10 | snp *leveldb.Snapshot 11 | } 12 | 13 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 14 | return s.snp.Get(key, s.db.iteratorOpts) 15 | } 16 | 17 | func (s *Snapshot) NewIterator() driver.IIterator { 18 | it := &Iterator{ 19 | s.snp.NewIterator(nil, s.db.iteratorOpts), 20 | } 21 | return it 22 | } 23 | 24 | func (s *Snapshot) Close() { 25 | s.snp.Release() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/cache.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include 7 | // #include "leveldb/c.h" 8 | import "C" 9 | 10 | type Cache struct { 11 | Cache *C.leveldb_cache_t 12 | } 13 | 14 | func NewLRUCache(capacity int) *Cache { 15 | return &Cache{C.leveldb_cache_create_lru(C.size_t(capacity))} 16 | } 17 | 18 | func (c *Cache) Close() { 19 | C.leveldb_cache_destroy(c.Cache) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/const.go: -------------------------------------------------------------------------------- 1 | package leveldb 2 | 3 | const DBName = "leveldb" 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/filterpolicy.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include 7 | // #include "leveldb/c.h" 8 | import "C" 9 | 10 | type FilterPolicy struct { 11 | Policy *C.leveldb_filterpolicy_t 12 | } 13 | 14 | func NewBloomFilter(bitsPerKey int) *FilterPolicy { 15 | policy := C.leveldb_filterpolicy_create_bloom(C.int(bitsPerKey)) 16 | return &FilterPolicy{policy} 17 | } 18 | 19 | func (fp *FilterPolicy) Close() { 20 | C.leveldb_filterpolicy_destroy(fp.Policy) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/leveldb_ext.h: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | #ifndef LEVELDB_EXT_H 4 | #define LEVELDB_EXT_H 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include "leveldb/c.h" 11 | 12 | 13 | // /* Returns NULL if not found. Otherwise stores the value in **valptr. 14 | // Stores the length of the value in *vallen. 15 | // Returns a context must be later to free*/ 16 | // extern void* leveldb_get_ext( 17 | // leveldb_t* db, 18 | // const leveldb_readoptions_t* options, 19 | // const char* key, size_t keylen, 20 | // char** valptr, 21 | // size_t* vallen, 22 | // char** errptr); 23 | 24 | // // Free context returns by leveldb_get_ext 25 | // extern void leveldb_get_free_ext(void* context); 26 | 27 | 28 | // Below iterator functions like leveldb iterator but returns valid status for iterator 29 | extern unsigned char leveldb_iter_seek_to_first_ext(leveldb_iterator_t*); 30 | extern unsigned char leveldb_iter_seek_to_last_ext(leveldb_iterator_t*); 31 | extern unsigned char leveldb_iter_seek_ext(leveldb_iterator_t*, const char* k, size_t klen); 32 | extern unsigned char leveldb_iter_next_ext(leveldb_iterator_t*); 33 | extern unsigned char leveldb_iter_prev_ext(leveldb_iterator_t*); 34 | 35 | extern void leveldb_writebatch_iterate_ext(leveldb_writebatch_t*, void* p); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/levigo-license: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Jeffrey M Hodges 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/slice.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include "leveldb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | type CSlice struct { 15 | data unsafe.Pointer 16 | size int 17 | } 18 | 19 | func NewCSlice(p unsafe.Pointer, n int) *CSlice { 20 | return &CSlice{p, n} 21 | } 22 | 23 | func (s *CSlice) Data() []byte { 24 | var value []byte 25 | 26 | sH := (*reflect.SliceHeader)(unsafe.Pointer(&value)) 27 | sH.Cap = int(s.size) 28 | sH.Len = int(s.size) 29 | sH.Data = uintptr(s.data) 30 | 31 | return value 32 | } 33 | 34 | func (s *CSlice) Size() int { 35 | return int(s.size) 36 | } 37 | 38 | func (s *CSlice) Free() { 39 | C.leveldb_free(s.data) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/snapshot.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include "leveldb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "github.com/siddontang/ledisdb/store/driver" 11 | ) 12 | 13 | type Snapshot struct { 14 | db *DB 15 | snap *C.leveldb_snapshot_t 16 | readOpts *ReadOptions 17 | iteratorOpts *ReadOptions 18 | } 19 | 20 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 21 | return s.db.get(s.readOpts, key) 22 | } 23 | 24 | func (s *Snapshot) GetSlice(key []byte) (driver.ISlice, error) { 25 | return s.db.getSlice(s.readOpts, key) 26 | } 27 | 28 | func (s *Snapshot) NewIterator() driver.IIterator { 29 | it := new(Iterator) 30 | it.it = C.leveldb_create_iterator(s.db.db, s.db.iteratorOpts.Opt) 31 | return it 32 | 33 | } 34 | 35 | func (s *Snapshot) Close() { 36 | C.leveldb_release_snapshot(s.db.db, s.snap) 37 | s.iteratorOpts.Close() 38 | s.readOpts.Close() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/util.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #include "leveldb/c.h" 6 | import "C" 7 | 8 | import ( 9 | "fmt" 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | func boolToUchar(b bool) C.uchar { 15 | uc := C.uchar(0) 16 | if b { 17 | uc = C.uchar(1) 18 | } 19 | return uc 20 | } 21 | 22 | func ucharToBool(uc C.uchar) bool { 23 | if uc == C.uchar(0) { 24 | return false 25 | } 26 | return true 27 | } 28 | 29 | func saveError(errStr *C.char) error { 30 | if errStr != nil { 31 | gs := C.GoString(errStr) 32 | C.leveldb_free(unsafe.Pointer(errStr)) 33 | return fmt.Errorf(gs) 34 | } 35 | return nil 36 | } 37 | 38 | func slice(p unsafe.Pointer, n int) []byte { 39 | var b []byte 40 | pbyte := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 41 | pbyte.Data = uintptr(p) 42 | pbyte.Len = n 43 | pbyte.Cap = n 44 | return b 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/cache.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include 7 | // #include "rocksdb/c.h" 8 | import "C" 9 | 10 | type Cache struct { 11 | Cache *C.rocksdb_cache_t 12 | } 13 | 14 | func NewLRUCache(capacity int) *Cache { 15 | return &Cache{C.rocksdb_cache_create_lru(C.size_t(capacity))} 16 | } 17 | 18 | func (c *Cache) Close() { 19 | C.rocksdb_cache_destroy(c.Cache) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/const.go: -------------------------------------------------------------------------------- 1 | package rocksdb 2 | 3 | const DBName = "rocksdb" 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/env.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include "rocksdb/c.h" 7 | import "C" 8 | 9 | type Env struct { 10 | Env *C.rocksdb_env_t 11 | } 12 | 13 | func NewDefaultEnv() *Env { 14 | return &Env{C.rocksdb_create_default_env()} 15 | } 16 | 17 | func (env *Env) SetHighPriorityBackgroundThreads(n int) { 18 | C.rocksdb_env_set_high_priority_background_threads(env.Env, C.int(n)) 19 | } 20 | 21 | func (env *Env) SetBackgroundThreads(n int) { 22 | C.rocksdb_env_set_background_threads(env.Env, C.int(n)) 23 | } 24 | 25 | func (env *Env) Close() { 26 | C.rocksdb_env_destroy(env.Env) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/filterpolicy.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include 7 | // #include "rocksdb/c.h" 8 | import "C" 9 | 10 | type FilterPolicy struct { 11 | Policy *C.rocksdb_filterpolicy_t 12 | } 13 | 14 | func NewBloomFilter(bitsPerKey int) *FilterPolicy { 15 | policy := C.rocksdb_filterpolicy_create_bloom(C.int(bitsPerKey)) 16 | return &FilterPolicy{policy} 17 | } 18 | 19 | func (fp *FilterPolicy) Close() { 20 | C.rocksdb_filterpolicy_destroy(fp.Policy) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/rocksdb_ext.cc: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | #include "rocksdb_ext.h" 4 | 5 | #include 6 | #include 7 | 8 | extern "C" { 9 | 10 | unsigned char rocksdb_iter_seek_to_first_ext(rocksdb_iterator_t* iter) { 11 | rocksdb_iter_seek_to_first(iter); 12 | return rocksdb_iter_valid(iter); 13 | } 14 | 15 | unsigned char rocksdb_iter_seek_to_last_ext(rocksdb_iterator_t* iter) { 16 | rocksdb_iter_seek_to_last(iter); 17 | return rocksdb_iter_valid(iter); 18 | } 19 | 20 | unsigned char rocksdb_iter_seek_ext(rocksdb_iterator_t* iter, const char* k, size_t klen) { 21 | rocksdb_iter_seek(iter, k, klen); 22 | return rocksdb_iter_valid(iter); 23 | } 24 | 25 | unsigned char rocksdb_iter_next_ext(rocksdb_iterator_t* iter) { 26 | rocksdb_iter_next(iter); 27 | return rocksdb_iter_valid(iter); 28 | } 29 | 30 | unsigned char rocksdb_iter_prev_ext(rocksdb_iterator_t* iter) { 31 | rocksdb_iter_prev(iter); 32 | return rocksdb_iter_valid(iter); 33 | } 34 | 35 | void rocksdb_write_ext(rocksdb_t* db, 36 | const rocksdb_writeoptions_t* options, 37 | rocksdb_writebatch_t* batch, char** errptr) { 38 | rocksdb_write(db, options, batch, errptr); 39 | if(*errptr == NULL) { 40 | rocksdb_writebatch_clear(batch); 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/rocksdb_ext.h: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | #ifndef ROCKSDB_EXT_H 4 | #define ROCKSDB_EXT_H 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include "rocksdb/c.h" 11 | 12 | // Below iterator functions like rocksdb iterator but returns valid status for iterator 13 | extern unsigned char rocksdb_iter_seek_to_first_ext(rocksdb_iterator_t*); 14 | extern unsigned char rocksdb_iter_seek_to_last_ext(rocksdb_iterator_t*); 15 | extern unsigned char rocksdb_iter_seek_ext(rocksdb_iterator_t*, const char* k, size_t klen); 16 | extern unsigned char rocksdb_iter_next_ext(rocksdb_iterator_t*); 17 | extern unsigned char rocksdb_iter_prev_ext(rocksdb_iterator_t*); 18 | extern void rocksdb_write_ext(rocksdb_t* db, const rocksdb_writeoptions_t* options, rocksdb_writebatch_t* batch, char** errptr); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/slice.go: -------------------------------------------------------------------------------- 1 | //+build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include 7 | // #include 8 | import "C" 9 | 10 | import ( 11 | "reflect" 12 | "unsafe" 13 | ) 14 | 15 | type CSlice struct { 16 | data unsafe.Pointer 17 | size int 18 | } 19 | 20 | func NewCSlice(p unsafe.Pointer, n int) *CSlice { 21 | return &CSlice{p, n} 22 | } 23 | 24 | func (s *CSlice) Data() []byte { 25 | var value []byte 26 | 27 | sH := (*reflect.SliceHeader)(unsafe.Pointer(&value)) 28 | sH.Cap = int(s.size) 29 | sH.Len = int(s.size) 30 | sH.Data = uintptr(s.data) 31 | 32 | return value 33 | } 34 | 35 | func (s *CSlice) Size() int { 36 | return int(s.size) 37 | } 38 | 39 | func (s *CSlice) Free() { 40 | C.free(s.data) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/snapshot.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include "rocksdb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "github.com/siddontang/ledisdb/store/driver" 11 | ) 12 | 13 | type Snapshot struct { 14 | db *DB 15 | snap *C.rocksdb_snapshot_t 16 | readOpts *ReadOptions 17 | iteratorOpts *ReadOptions 18 | } 19 | 20 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 21 | return s.db.get(s.readOpts, key) 22 | } 23 | 24 | func (s *Snapshot) GetSlice(key []byte) (driver.ISlice, error) { 25 | return s.db.getSlice(s.readOpts, key) 26 | } 27 | 28 | func (s *Snapshot) NewIterator() driver.IIterator { 29 | it := new(Iterator) 30 | it.it = C.rocksdb_create_iterator(s.db.db, s.db.iteratorOpts.Opt) 31 | return it 32 | 33 | } 34 | 35 | func (s *Snapshot) Close() { 36 | C.rocksdb_release_snapshot(s.db.db, s.snap) 37 | s.iteratorOpts.Close() 38 | s.readOpts.Close() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/util.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #include 6 | // #include "rocksdb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "fmt" 11 | "reflect" 12 | "unsafe" 13 | ) 14 | 15 | func boolToUchar(b bool) C.uchar { 16 | uc := C.uchar(0) 17 | if b { 18 | uc = C.uchar(1) 19 | } 20 | return uc 21 | } 22 | 23 | func ucharToBool(uc C.uchar) bool { 24 | if uc == C.uchar(0) { 25 | return false 26 | } 27 | return true 28 | } 29 | 30 | func boolToInt(b bool) C.int { 31 | uc := C.int(0) 32 | if b { 33 | uc = C.int(1) 34 | } 35 | return uc 36 | } 37 | 38 | func saveError(errStr *C.char) error { 39 | if errStr != nil { 40 | gs := C.GoString(errStr) 41 | C.free(unsafe.Pointer(errStr)) 42 | return fmt.Errorf(gs) 43 | } 44 | return nil 45 | } 46 | 47 | func slice(p unsafe.Pointer, n int) []byte { 48 | var b []byte 49 | pbyte := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 50 | pbyte.Data = uintptr(p) 51 | pbyte.Len = n 52 | pbyte.Cap = n 53 | return b 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/slice.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/siddontang/ledisdb/store/driver" 5 | ) 6 | 7 | type Slice interface { 8 | driver.ISlice 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/snapshot.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/siddontang/ledisdb/store/driver" 5 | ) 6 | 7 | type Snapshot struct { 8 | driver.ISnapshot 9 | st *Stat 10 | } 11 | 12 | func (s *Snapshot) NewIterator() *Iterator { 13 | it := new(Iterator) 14 | it.it = s.ISnapshot.NewIterator() 15 | it.st = s.st 16 | 17 | s.st.IterNum.Add(1) 18 | 19 | return it 20 | } 21 | 22 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 23 | v, err := s.ISnapshot.Get(key) 24 | s.st.statGet(v, err) 25 | return v, err 26 | } 27 | 28 | func (s *Snapshot) GetSlice(key []byte) (Slice, error) { 29 | if d, ok := s.ISnapshot.(driver.ISliceGeter); ok { 30 | v, err := d.GetSlice(key) 31 | s.st.statGet(v, err) 32 | return v, err 33 | } else { 34 | v, err := s.Get(key) 35 | if err != nil { 36 | return nil, err 37 | } else if v == nil { 38 | return nil, nil 39 | } else { 40 | return driver.GoSlice(v), nil 41 | } 42 | } 43 | } 44 | 45 | func (s *Snapshot) Close() { 46 | s.st.SnapshotCloseNum.Add(1) 47 | s.ISnapshot.Close() 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/stat.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/siddontang/go/sync2" 5 | ) 6 | 7 | type Stat struct { 8 | GetNum sync2.AtomicInt64 9 | GetMissingNum sync2.AtomicInt64 10 | GetTotalTime sync2.AtomicDuration 11 | PutNum sync2.AtomicInt64 12 | DeleteNum sync2.AtomicInt64 13 | IterNum sync2.AtomicInt64 14 | IterSeekNum sync2.AtomicInt64 15 | IterCloseNum sync2.AtomicInt64 16 | SnapshotNum sync2.AtomicInt64 17 | SnapshotCloseNum sync2.AtomicInt64 18 | BatchNum sync2.AtomicInt64 19 | BatchCommitNum sync2.AtomicInt64 20 | BatchCommitTotalTime sync2.AtomicDuration 21 | TxNum sync2.AtomicInt64 22 | TxCommitNum sync2.AtomicInt64 23 | TxCloseNum sync2.AtomicInt64 24 | CompactNum sync2.AtomicInt64 25 | CompactTotalTime sync2.AtomicDuration 26 | } 27 | 28 | func (st *Stat) statGet(v interface{}, err error) { 29 | st.GetNum.Add(1) 30 | if v == nil && err == nil { 31 | st.GetMissingNum.Add(1) 32 | } 33 | } 34 | 35 | func (st *Stat) Reset() { 36 | *st = Stat{} 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/store.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | 8 | "github.com/siddontang/ledisdb/config" 9 | "github.com/siddontang/ledisdb/store/driver" 10 | 11 | _ "github.com/siddontang/ledisdb/store/goleveldb" 12 | _ "github.com/siddontang/ledisdb/store/leveldb" 13 | _ "github.com/siddontang/ledisdb/store/rocksdb" 14 | ) 15 | 16 | func getStorePath(cfg *config.Config) string { 17 | if len(cfg.DBPath) > 0 { 18 | return cfg.DBPath 19 | } else { 20 | return path.Join(cfg.DataDir, fmt.Sprintf("%s_data", cfg.DBName)) 21 | } 22 | } 23 | 24 | func Open(cfg *config.Config) (*DB, error) { 25 | s, err := driver.GetStore(cfg) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | path := getStorePath(cfg) 31 | 32 | if err := os.MkdirAll(path, 0755); err != nil { 33 | return nil, err 34 | } 35 | 36 | idb, err := s.Open(path, cfg) 37 | if err != nil { 38 | return nil, err 39 | } 40 | 41 | db := new(DB) 42 | db.db = idb 43 | db.name = s.String() 44 | db.st = &Stat{} 45 | db.cfg = cfg 46 | 47 | return db, nil 48 | } 49 | 50 | func Repair(cfg *config.Config) error { 51 | s, err := driver.GetStore(cfg) 52 | if err != nil { 53 | return err 54 | } 55 | 56 | path := getStorePath(cfg) 57 | 58 | return s.Repair(path, cfg) 59 | } 60 | 61 | func init() { 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 siddontang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/README.md: -------------------------------------------------------------------------------- 1 | # rdb 2 | 3 | Handling Redis RDB format. 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/encode.go: -------------------------------------------------------------------------------- 1 | package rdb 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "github.com/cupcake/rdb" 7 | ) 8 | 9 | func Dump(obj interface{}) ([]byte, error) { 10 | var buf bytes.Buffer 11 | 12 | e := rdb.NewEncoder(&buf) 13 | 14 | switch v := obj.(type) { 15 | case String: 16 | e.EncodeType(rdb.TypeString) 17 | e.EncodeString(v) 18 | case Hash: 19 | e.EncodeType(rdb.TypeHash) 20 | e.EncodeLength(uint32(len(v))) 21 | 22 | for i := 0; i < len(v); i++ { 23 | e.EncodeString(v[i].Field) 24 | e.EncodeString(v[i].Value) 25 | } 26 | case List: 27 | e.EncodeType(rdb.TypeList) 28 | e.EncodeLength(uint32(len(v))) 29 | for i := 0; i < len(v); i++ { 30 | e.EncodeString(v[i]) 31 | } 32 | case Set: 33 | e.EncodeType(rdb.TypeSet) 34 | e.EncodeLength(uint32(len(v))) 35 | for i := 0; i < len(v); i++ { 36 | e.EncodeString(v[i]) 37 | } 38 | case ZSet: 39 | e.EncodeType(rdb.TypeZSet) 40 | e.EncodeLength(uint32(len(v))) 41 | for i := 0; i < len(v); i++ { 42 | e.EncodeString(v[i].Member) 43 | e.EncodeFloat(v[i].Score) 44 | } 45 | default: 46 | return nil, fmt.Errorf("invalid dump type %T", obj) 47 | } 48 | 49 | e.EncodeDumpFooter() 50 | 51 | return buf.Bytes(), nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/wandoujia-license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Wandoujia Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/assertions/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Thumbs.db 3 | *.iml 4 | /.idea 5 | coverage.out 6 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/assertions/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | 6 | install: 7 | - go get -t ./... 8 | 9 | script: go test ./... -v 10 | 11 | sudo: false 12 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/assertions/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 SmartyStreets, LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | NOTE: Various optional and subordinate components carry their own licensing 22 | requirements and restrictions. Use of those components is subject to the terms 23 | and conditions outlined the respective license of each component. 24 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/assertions/filter.go: -------------------------------------------------------------------------------- 1 | package assertions 2 | 3 | import "fmt" 4 | 5 | const ( 6 | success = "" 7 | needExactValues = "This assertion requires exactly %d comparison values (you provided %d)." 8 | needNonEmptyCollection = "This assertion requires at least 1 comparison value (you provided 0)." 9 | needFewerValues = "This assertion allows %d or fewer comparison values (you provided %d)." 10 | ) 11 | 12 | func need(needed int, expected []interface{}) string { 13 | if len(expected) != needed { 14 | return fmt.Sprintf(needExactValues, needed, len(expected)) 15 | } 16 | return success 17 | } 18 | 19 | func atLeast(minimum int, expected []interface{}) string { 20 | if len(expected) < 1 { 21 | return needNonEmptyCollection 22 | } 23 | return success 24 | } 25 | 26 | func atMost(max int, expected []interface{}) string { 27 | if len(expected) > max { 28 | return fmt.Sprintf(needFewerValues, max, len(expected)) 29 | } 30 | return success 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/assertions/internal/oglematchers/.gitignore: -------------------------------------------------------------------------------- 1 | *.6 2 | 6.out 3 | _obj/ 4 | _test/ 5 | _testmain.go 6 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/assertions/internal/oglematchers/.travis.yml: -------------------------------------------------------------------------------- 1 | # Cf. http://docs.travis-ci.com/user/getting-started/ 2 | # Cf. http://docs.travis-ci.com/user/languages/go/ 3 | 4 | language: go 5 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 SmartyStreets, LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | NOTE: Various optional and subordinate components carry their own licensing 22 | requirements and restrictions. Use of those components is subject to the terms 23 | and conditions outlined the respective license of each component. 24 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/convey.goconvey: -------------------------------------------------------------------------------- 1 | #ignore 2 | -timeout=1s 3 | #-covermode=count 4 | #-coverpkg=github.com/smartystreets/goconvey/convey,github.com/smartystreets/goconvey/convey/gotest,github.com/smartystreets/goconvey/convey/reporting -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/gotest/utils.go: -------------------------------------------------------------------------------- 1 | // Package gotest contains internal functionality. Although this package 2 | // contains one or more exported names it is not intended for public 3 | // consumption. See the examples package for how to use this project. 4 | package gotest 5 | 6 | import ( 7 | "runtime" 8 | "strings" 9 | ) 10 | 11 | func ResolveExternalCaller() (file string, line int, name string) { 12 | var caller_id uintptr 13 | callers := runtime.Callers(0, callStack) 14 | 15 | for x := 0; x < callers; x++ { 16 | caller_id, file, line, _ = runtime.Caller(x) 17 | if strings.HasSuffix(file, "_test.go") || strings.HasSuffix(file, "_tests.go") { 18 | name = runtime.FuncForPC(caller_id).Name() 19 | return 20 | } 21 | } 22 | file, line, name = "", -1, "" 23 | return // panic? 24 | } 25 | 26 | const maxStackDepth = 100 // This had better be enough... 27 | 28 | var callStack []uintptr = make([]uintptr, maxStackDepth, maxStackDepth) 29 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/nilReporter.go: -------------------------------------------------------------------------------- 1 | package convey 2 | 3 | import ( 4 | "github.com/smartystreets/goconvey/convey/reporting" 5 | ) 6 | 7 | type nilReporter struct{} 8 | 9 | func (self *nilReporter) BeginStory(story *reporting.StoryReport) {} 10 | func (self *nilReporter) Enter(scope *reporting.ScopeReport) {} 11 | func (self *nilReporter) Report(report *reporting.AssertionResult) {} 12 | func (self *nilReporter) Exit() {} 13 | func (self *nilReporter) EndStory() {} 14 | func (self *nilReporter) Write(p []byte) (int, error) { return len(p), nil } 15 | func newNilReporter() *nilReporter { return &nilReporter{} } 16 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/reporting/console.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | type console struct{} 9 | 10 | func (self *console) Write(p []byte) (n int, err error) { 11 | return fmt.Print(string(p)) 12 | } 13 | 14 | func NewConsole() io.Writer { 15 | return new(console) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/reporting/doc.go: -------------------------------------------------------------------------------- 1 | // Package reporting contains internal functionality related 2 | // to console reporting and output. Although this package has 3 | // exported names is not intended for public consumption. See the 4 | // examples package for how to use this project. 5 | package reporting 6 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/reporting/dot.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import "fmt" 4 | 5 | type dot struct{ out *Printer } 6 | 7 | func (self *dot) BeginStory(story *StoryReport) {} 8 | 9 | func (self *dot) Enter(scope *ScopeReport) {} 10 | 11 | func (self *dot) Report(report *AssertionResult) { 12 | if report.Error != nil { 13 | fmt.Print(redColor) 14 | self.out.Insert(dotError) 15 | } else if report.Failure != "" { 16 | fmt.Print(yellowColor) 17 | self.out.Insert(dotFailure) 18 | } else if report.Skipped { 19 | fmt.Print(yellowColor) 20 | self.out.Insert(dotSkip) 21 | } else { 22 | fmt.Print(greenColor) 23 | self.out.Insert(dotSuccess) 24 | } 25 | fmt.Print(resetColor) 26 | } 27 | 28 | func (self *dot) Exit() {} 29 | 30 | func (self *dot) EndStory() {} 31 | 32 | func (self *dot) Write(content []byte) (written int, err error) { 33 | return len(content), nil // no-op 34 | } 35 | 36 | func NewDotReporter(out *Printer) *dot { 37 | self := new(dot) 38 | self.out = out 39 | return self 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/reporting/gotest.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | type gotestReporter struct{ test T } 4 | 5 | func (self *gotestReporter) BeginStory(story *StoryReport) { 6 | self.test = story.Test 7 | } 8 | 9 | func (self *gotestReporter) Enter(scope *ScopeReport) {} 10 | 11 | func (self *gotestReporter) Report(r *AssertionResult) { 12 | if !passed(r) { 13 | self.test.Fail() 14 | } 15 | } 16 | 17 | func (self *gotestReporter) Exit() {} 18 | 19 | func (self *gotestReporter) EndStory() { 20 | self.test = nil 21 | } 22 | 23 | func (self *gotestReporter) Write(content []byte) (written int, err error) { 24 | return len(content), nil // no-op 25 | } 26 | 27 | func NewGoTestReporter() *gotestReporter { 28 | return new(gotestReporter) 29 | } 30 | 31 | func passed(r *AssertionResult) bool { 32 | return r.Error == nil && r.Failure == "" 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/reporting/reporter.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import "io" 4 | 5 | type Reporter interface { 6 | BeginStory(story *StoryReport) 7 | Enter(scope *ScopeReport) 8 | Report(r *AssertionResult) 9 | Exit() 10 | EndStory() 11 | io.Writer 12 | } 13 | 14 | type reporters struct{ collection []Reporter } 15 | 16 | func (self *reporters) BeginStory(s *StoryReport) { self.foreach(func(r Reporter) { r.BeginStory(s) }) } 17 | func (self *reporters) Enter(s *ScopeReport) { self.foreach(func(r Reporter) { r.Enter(s) }) } 18 | func (self *reporters) Report(a *AssertionResult) { self.foreach(func(r Reporter) { r.Report(a) }) } 19 | func (self *reporters) Exit() { self.foreach(func(r Reporter) { r.Exit() }) } 20 | func (self *reporters) EndStory() { self.foreach(func(r Reporter) { r.EndStory() }) } 21 | 22 | func (self *reporters) Write(contents []byte) (written int, err error) { 23 | self.foreach(func(r Reporter) { 24 | written, err = r.Write(contents) 25 | }) 26 | return written, err 27 | } 28 | 29 | func (self *reporters) foreach(action func(Reporter)) { 30 | for _, r := range self.collection { 31 | action(r) 32 | } 33 | } 34 | 35 | func NewReporters(collection ...Reporter) *reporters { 36 | self := new(reporters) 37 | self.collection = collection 38 | return self 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/smartystreets/goconvey/convey/reporting/reporting.goconvey: -------------------------------------------------------------------------------- 1 | #ignore 2 | -timeout=1s 3 | -------------------------------------------------------------------------------- /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/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[len(dst)-1]++ 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[len(dst)-1]++ 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/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/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/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/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/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/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/context/go19.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.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/sys/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/sys/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/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R2 27 | MOVD a2+16(FP), R3 28 | MOVD a3+24(FP), R4 29 | MOVD $0, R5 30 | MOVD $0, R6 31 | MOVD $0, R7 32 | MOVD trap+0(FP), R1 // syscall entry 33 | SYSCALL 34 | MOVD R2, r1+32(FP) 35 | MOVD R3, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R2 47 | MOVD a2+16(FP), R3 48 | MOVD a3+24(FP), R4 49 | MOVD $0, R5 50 | MOVD $0, R6 51 | MOVD $0, R7 52 | MOVD trap+0(FP), R1 // syscall entry 53 | SYSCALL 54 | MOVD R2, r1+32(FP) 55 | MOVD R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.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 ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.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 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 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 unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ioctl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 12 | // 13 | // To change fd's window size, the req argument should be TIOCSWINSZ. 14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { 15 | // TODO: if we get the chance, remove the req parameter and 16 | // hardcode TIOCSWINSZ. 17 | err := ioctlSetWinsize(fd, req, value) 18 | runtime.KeepAlive(value) 19 | return err 20 | } 21 | 22 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 23 | // 24 | // The req value will usually be TCSETA or TIOCSETA. 25 | func IoctlSetTermios(fd int, req uint, value *Termios) error { 26 | // TODO: if we get the chance, remove the req parameter. 27 | err := ioctlSetTermios(fd, req, value) 28 | runtime.KeepAlive(value) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_unveil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 openbsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | // Unveil implements the unveil syscall. 15 | // For more information see unveil(2). 16 | // Note that the special case of blocking further 17 | // unveil calls is handled by UnveilBlock. 18 | func Unveil(path string, flags string) error { 19 | pathPtr, err := syscall.BytePtrFromString(path) 20 | if err != nil { 21 | return err 22 | } 23 | flagsPtr, err := syscall.BytePtrFromString(flags) 24 | if err != nil { 25 | return err 26 | } 27 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 28 | if e != 0 { 29 | return e 30 | } 31 | return nil 32 | } 33 | 34 | // UnveilBlock blocks future unveil calls. 35 | // For more information see unveil(2). 36 | func UnveilBlock() error { 37 | // Both pointers must be nil. 38 | var pathUnsafe, flagsUnsafe unsafe.Pointer 39 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 40 | if e != 0 { 41 | return e 42 | } 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc64 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: sec, Nsec: nsec} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.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 amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 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 arm64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.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 arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.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 darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracearm_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build arm arm64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsArm is the registers used by arm binaries. 11 | type PtraceRegsArm struct { 12 | Uregs [18]uint32 13 | } 14 | 15 | // PtraceGetRegsArm fetches the registers used by arm binaries. 16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 18 | } 19 | 20 | // PtraceSetRegsArm sets the registers used by arm binaries. 21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 23 | } 24 | 25 | // PtraceRegsArm64 is the registers used by arm64 binaries. 26 | type PtraceRegsArm64 struct { 27 | Regs [31]uint64 28 | Sp uint64 29 | Pc uint64 30 | Pstate uint64 31 | } 32 | 33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 36 | } 37 | 38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-16 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-12 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-24 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 | #include "textflag.h" 6 | 7 | TEXT ·getprocaddress(SB),NOSPLIT,$0 8 | B syscall·getprocaddress(SB) 9 | 10 | TEXT ·loadlibrary(SB),NOSPLIT,$0 11 | B syscall·loadlibrary(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.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 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "net" 11 | 12 | "appengine/cloudsql" 13 | ) 14 | 15 | func connect(instance string) (net.Conn, error) { 16 | return cloudsql.Dial(instance) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | ) 13 | 14 | func connect(instance string) (net.Conn, error) { 15 | return nil, errors.New(`cloudsql: not supported in App Engine "flexible environment"`) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bufio.v1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - tip 8 | 9 | install: 10 | - go get launchpad.net/gocheck 11 | - go get gopkg.in/bufio.v1 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bufio.v1/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test gopkg.in/bufio.v1 3 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bufio.v1/README.md: -------------------------------------------------------------------------------- 1 | bufio 2 | ===== 3 | 4 | This is a fork of the http://golang.org/pkg/bufio/ package. It adds `ReadN` method that allows reading next `n` bytes from the internal buffer without allocating intermediate buffer. This method works just like the [Buffer.Next](http://golang.org/pkg/bytes/#Buffer.Next) method, but has slightly different signature. 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/.gitignore: -------------------------------------------------------------------------------- 1 | testdata/conf_out.ini 2 | ini.sublime-project 3 | ini.sublime-workspace 4 | testdata/conf_reflect.ini 5 | .idea 6 | /.vscode 7 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.5.x 5 | - 1.6.x 6 | - 1.7.x 7 | - 1.8.x 8 | - 1.9.x 9 | 10 | script: 11 | - go get golang.org/x/tools/cmd/cover 12 | - go get github.com/smartystreets/goconvey 13 | - mkdir -p $HOME/gopath/src/gopkg.in 14 | - ln -s $HOME/gopath/src/github.com/go-ini/ini $HOME/gopath/src/gopkg.in/ini.v1 15 | - go test -v -cover -race 16 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet coverage 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -race -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | 14 | coverage: 15 | go test -coverprofile=c.out && go tool cover -html=c.out && rm c.out -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ErrDelimiterNotFound struct { 22 | Line string 23 | } 24 | 25 | func IsErrDelimiterNotFound(err error) bool { 26 | _, ok := err.(ErrDelimiterNotFound) 27 | return ok 28 | } 29 | 30 | func (err ErrDelimiterNotFound) Error() string { 31 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | services: 4 | - redis-server 5 | 6 | go: 7 | - 1.1 8 | - 1.2 9 | - 1.3 10 | - tip 11 | 12 | install: 13 | - go get gopkg.in/bufio.v1 14 | - go get gopkg.in/check.v1 15 | - mkdir -p $HOME/gopath/src/gopkg.in 16 | - ln -s `pwd` $HOME/gopath/src/gopkg.in/redis.v2 17 | 18 | before_script: 19 | - redis-server testdata/sentinel.conf --sentinel & 20 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test gopkg.in/redis.v2 -cpu=1,2,4 3 | go test gopkg.in/redis.v2 -short -race 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package redis implements a Redis client. 3 | */ 4 | package redis 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/error.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Redis nil reply. 8 | var Nil = errorf("redis: nil") 9 | 10 | // Redis transaction failed. 11 | var TxFailedErr = errorf("redis: transaction failed") 12 | 13 | type redisError struct { 14 | s string 15 | } 16 | 17 | func errorf(s string, args ...interface{}) redisError { 18 | return redisError{s: fmt.Sprintf(s, args...)} 19 | } 20 | 21 | func (err redisError) Error() string { 22 | return err.s 23 | } 24 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/rate_limit.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "sync/atomic" 5 | "time" 6 | ) 7 | 8 | type rateLimiter struct { 9 | v int64 10 | 11 | _closed int64 12 | } 13 | 14 | func newRateLimiter(limit time.Duration, bucketSize int) *rateLimiter { 15 | rl := &rateLimiter{ 16 | v: int64(bucketSize), 17 | } 18 | go rl.loop(limit, int64(bucketSize)) 19 | return rl 20 | } 21 | 22 | func (rl *rateLimiter) loop(limit time.Duration, bucketSize int64) { 23 | for { 24 | if rl.closed() { 25 | break 26 | } 27 | if v := atomic.LoadInt64(&rl.v); v < bucketSize { 28 | atomic.AddInt64(&rl.v, 1) 29 | } 30 | time.Sleep(limit) 31 | } 32 | } 33 | 34 | func (rl *rateLimiter) Check() bool { 35 | for { 36 | if v := atomic.LoadInt64(&rl.v); v > 0 { 37 | if atomic.CompareAndSwapInt64(&rl.v, v, v-1) { 38 | return true 39 | } 40 | } else { 41 | return false 42 | } 43 | } 44 | } 45 | 46 | func (rl *rateLimiter) Close() error { 47 | atomic.StoreInt64(&rl._closed, 1) 48 | return nil 49 | } 50 | 51 | func (rl *rateLimiter) closed() bool { 52 | return atomic.LoadInt64(&rl._closed) == 1 53 | } 54 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/script.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | "io" 7 | "strings" 8 | ) 9 | 10 | type scripter interface { 11 | Eval(script string, keys []string, args []string) *Cmd 12 | EvalSha(sha1 string, keys []string, args []string) *Cmd 13 | ScriptExists(scripts ...string) *BoolSliceCmd 14 | ScriptLoad(script string) *StringCmd 15 | } 16 | 17 | type Script struct { 18 | src, hash string 19 | } 20 | 21 | func NewScript(src string) *Script { 22 | h := sha1.New() 23 | io.WriteString(h, src) 24 | return &Script{ 25 | src: src, 26 | hash: hex.EncodeToString(h.Sum(nil)), 27 | } 28 | } 29 | 30 | func (s *Script) Load(c scripter) *StringCmd { 31 | return c.ScriptLoad(s.src) 32 | } 33 | 34 | func (s *Script) Exists(c scripter) *BoolSliceCmd { 35 | return c.ScriptExists(s.src) 36 | } 37 | 38 | func (s *Script) Eval(c scripter, keys []string, args []string) *Cmd { 39 | return c.Eval(s.src, keys, args) 40 | } 41 | 42 | func (s *Script) EvalSha(c scripter, keys []string, args []string) *Cmd { 43 | return c.EvalSha(s.hash, keys, args) 44 | } 45 | 46 | func (s *Script) Run(c *Client, keys []string, args []string) *Cmd { 47 | r := s.EvalSha(c, keys, args) 48 | if err := r.Err(); err != nil && strings.HasPrefix(err.Error(), "NOSCRIPT ") { 49 | return s.Eval(c, keys, args) 50 | } 51 | return r 52 | } 53 | --------------------------------------------------------------------------------