Copy disabled (too large)
Download .txt
Showing preview only (16,254K chars total). Download the full file to get everything.
Repository: namreg/godown
Branch: master
Commit: 80f65e5347a7
Files: 862
Total size: 15.3 MB
Directory structure:
gitextract_pxkin0nb/
├── .gitignore
├── .golang.ci.yaml
├── .goreleaser.yml
├── .travis.yml
├── Gopkg.toml
├── LICENSE
├── Makefile
├── README.md
├── client/
│ ├── client.go
│ ├── client_del_test.go
│ ├── client_expire_test.go
│ ├── client_get_test.go
│ ├── client_getbit_test.go
│ ├── client_hdel_test.go
│ ├── client_hget_test.go
│ ├── client_hkeys_test.go
│ ├── client_hset_test.go
│ ├── client_hvals_test.go
│ ├── client_keys_test.go
│ ├── client_lindex_test.go
│ ├── client_llen_test.go
│ ├── client_lpop_test.go
│ ├── client_lpush_test.go
│ ├── client_lrange_test.go
│ ├── client_lrem_test.go
│ ├── client_ping_test.go
│ ├── client_rpop_test.go
│ ├── client_rpush_test.go
│ ├── client_set_test.go
│ ├── client_setbit_test.go
│ ├── client_strlen_test.go
│ ├── client_ttl_test.go
│ ├── client_type_test.go
│ ├── executor_mock_test.go
│ ├── helpers_test.go
│ ├── result.go
│ └── result_test.go
├── cmd/
│ ├── godown-cli/
│ │ ├── Dockerfile
│ │ └── main.go
│ └── godown-server/
│ ├── Dockerfile
│ └── main.go
├── internal/
│ ├── api/
│ │ ├── Makefile
│ │ ├── api.pb.go
│ │ └── api.proto
│ ├── cli/
│ │ ├── cli.go
│ │ └── printer.go
│ ├── clock/
│ │ └── clock.go
│ ├── command/
│ │ ├── command.go
│ │ ├── command_clock_mock_test.go
│ │ ├── command_mock_test.go
│ │ ├── command_parser_mock_test.go
│ │ ├── command_test.go
│ │ ├── data_store_mock_test.go
│ │ ├── del.go
│ │ ├── del_test.go
│ │ ├── expire.go
│ │ ├── expire_test.go
│ │ ├── get.go
│ │ ├── get_test.go
│ │ ├── getbit.go
│ │ ├── getbit_test.go
│ │ ├── hdel.go
│ │ ├── hdel_test.go
│ │ ├── help.go
│ │ ├── help_test.go
│ │ ├── hget.go
│ │ ├── hget_test.go
│ │ ├── hkeys.go
│ │ ├── hkeys_test.go
│ │ ├── hset.go
│ │ ├── hset_test.go
│ │ ├── hvals.go
│ │ ├── hvals_test.go
│ │ ├── keys.go
│ │ ├── keys_test.go
│ │ ├── lindex.go
│ │ ├── lindex_test.go
│ │ ├── llen.go
│ │ ├── llen_test.go
│ │ ├── lpop.go
│ │ ├── lpop_test.go
│ │ ├── lpush.go
│ │ ├── lpush_test.go
│ │ ├── lrange.go
│ │ ├── lrange_test.go
│ │ ├── lrem.go
│ │ ├── lrem_test.go
│ │ ├── parser.go
│ │ ├── ping.go
│ │ ├── ping_test.go
│ │ ├── reply.go
│ │ ├── reply_test.go
│ │ ├── rpop.go
│ │ ├── rpop_test.go
│ │ ├── rpush.go
│ │ ├── rpush_test.go
│ │ ├── set.go
│ │ ├── set_test.go
│ │ ├── setbit.go
│ │ ├── setbit_test.go
│ │ ├── strlen.go
│ │ ├── strlen_test.go
│ │ ├── ttl.go
│ │ ├── ttl_test.go
│ │ ├── type.go
│ │ └── type_test.go
│ ├── server/
│ │ ├── data_store_mock_test.go
│ │ ├── fsm.go
│ │ ├── fsm_snapshot.go
│ │ ├── gc.go
│ │ ├── resp/
│ │ │ └── resp.go
│ │ ├── server.go
│ │ └── server_clock_mock_test.go
│ └── storage/
│ ├── marshaler.go
│ ├── marshaler_test.go
│ ├── memory/
│ │ ├── memory.go
│ │ └── memory_test.go
│ ├── storage.go
│ └── storage_test.go
└── vendor/
├── github.com/
│ ├── Bowery/
│ │ └── prompt/
│ │ ├── CONTRIBUTORS.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── ansi_unix.go
│ │ ├── ansi_windows.go
│ │ ├── buffer.go
│ │ ├── buffer_unix.go
│ │ ├── buffer_windows.go
│ │ ├── ioctl_bsd.go
│ │ ├── ioctl_linux.go
│ │ ├── ioctl_solaris.go
│ │ ├── ioctl_unix.go
│ │ ├── keys.go
│ │ ├── keys_unix.go
│ │ ├── keys_windows.go
│ │ ├── prompt.go
│ │ ├── term.go
│ │ ├── term_unix.go
│ │ └── term_windows.go
│ ├── armon/
│ │ └── go-metrics/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── const_unix.go
│ │ ├── const_windows.go
│ │ ├── inmem.go
│ │ ├── inmem_endpoint.go
│ │ ├── inmem_signal.go
│ │ ├── metrics.go
│ │ ├── sink.go
│ │ ├── start.go
│ │ ├── statsd.go
│ │ └── statsite.go
│ ├── boltdb/
│ │ └── bolt/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── bolt_386.go
│ │ ├── bolt_amd64.go
│ │ ├── bolt_arm.go
│ │ ├── bolt_arm64.go
│ │ ├── bolt_linux.go
│ │ ├── bolt_openbsd.go
│ │ ├── bolt_ppc.go
│ │ ├── bolt_ppc64.go
│ │ ├── bolt_ppc64le.go
│ │ ├── bolt_s390x.go
│ │ ├── bolt_unix.go
│ │ ├── bolt_unix_solaris.go
│ │ ├── bolt_windows.go
│ │ ├── boltsync_unix.go
│ │ ├── bucket.go
│ │ ├── cursor.go
│ │ ├── db.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── freelist.go
│ │ ├── node.go
│ │ ├── page.go
│ │ └── tx.go
│ ├── centrifugal/
│ │ └── centrifugo/
│ │ ├── LICENSE
│ │ └── libcentrifugo/
│ │ └── raw/
│ │ └── raw.go
│ ├── davecgh/
│ │ └── go-spew/
│ │ ├── LICENSE
│ │ └── spew/
│ │ ├── bypass.go
│ │ ├── bypasssafe.go
│ │ ├── common.go
│ │ ├── config.go
│ │ ├── doc.go
│ │ ├── dump.go
│ │ ├── format.go
│ │ └── spew.go
│ ├── fatih/
│ │ └── color/
│ │ ├── .travis.yml
│ │ ├── Gopkg.toml
│ │ ├── LICENSE.md
│ │ ├── README.md
│ │ ├── color.go
│ │ └── doc.go
│ ├── gogo/
│ │ └── protobuf/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── GOLANG_CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── gogoproto/
│ │ │ ├── Makefile
│ │ │ ├── doc.go
│ │ │ ├── gogo.pb.go
│ │ │ ├── gogo.pb.golden
│ │ │ ├── gogo.proto
│ │ │ └── helper.go
│ │ ├── proto/
│ │ │ ├── Makefile
│ │ │ ├── clone.go
│ │ │ ├── custom_gogo.go
│ │ │ ├── decode.go
│ │ │ ├── discard.go
│ │ │ ├── duration.go
│ │ │ ├── duration_gogo.go
│ │ │ ├── encode.go
│ │ │ ├── encode_gogo.go
│ │ │ ├── equal.go
│ │ │ ├── extensions.go
│ │ │ ├── extensions_gogo.go
│ │ │ ├── lib.go
│ │ │ ├── lib_gogo.go
│ │ │ ├── message_set.go
│ │ │ ├── pointer_reflect.go
│ │ │ ├── pointer_reflect_gogo.go
│ │ │ ├── pointer_unsafe.go
│ │ │ ├── pointer_unsafe_gogo.go
│ │ │ ├── properties.go
│ │ │ ├── properties_gogo.go
│ │ │ ├── skip_gogo.go
│ │ │ ├── table_marshal.go
│ │ │ ├── table_marshal_gogo.go
│ │ │ ├── table_merge.go
│ │ │ ├── table_unmarshal.go
│ │ │ ├── table_unmarshal_gogo.go
│ │ │ ├── text.go
│ │ │ ├── text_gogo.go
│ │ │ ├── text_parser.go
│ │ │ ├── timestamp.go
│ │ │ └── timestamp_gogo.go
│ │ └── protoc-gen-gogo/
│ │ └── descriptor/
│ │ ├── Makefile
│ │ ├── descriptor.go
│ │ ├── descriptor.pb.go
│ │ ├── descriptor_gostring.gen.go
│ │ └── helper.go
│ ├── gojuno/
│ │ └── minimock/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── camel_to_snake.go
│ │ ├── doc.go
│ │ └── mock_controller.go
│ ├── golang/
│ │ └── protobuf/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── proto/
│ │ │ ├── clone.go
│ │ │ ├── decode.go
│ │ │ ├── discard.go
│ │ │ ├── encode.go
│ │ │ ├── equal.go
│ │ │ ├── extensions.go
│ │ │ ├── lib.go
│ │ │ ├── message_set.go
│ │ │ ├── pointer_reflect.go
│ │ │ ├── pointer_unsafe.go
│ │ │ ├── properties.go
│ │ │ ├── table_marshal.go
│ │ │ ├── table_merge.go
│ │ │ ├── table_unmarshal.go
│ │ │ ├── text.go
│ │ │ └── text_parser.go
│ │ └── ptypes/
│ │ ├── any/
│ │ │ ├── any.pb.go
│ │ │ └── any.proto
│ │ ├── any.go
│ │ ├── doc.go
│ │ ├── duration/
│ │ │ ├── duration.pb.go
│ │ │ └── duration.proto
│ │ ├── duration.go
│ │ ├── timestamp/
│ │ │ ├── timestamp.pb.go
│ │ │ └── timestamp.proto
│ │ └── timestamp.go
│ ├── hashicorp/
│ │ ├── errwrap/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── errwrap.go
│ │ │ └── go.mod
│ │ ├── go-immutable-radix/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── edges.go
│ │ │ ├── iradix.go
│ │ │ ├── iter.go
│ │ │ ├── node.go
│ │ │ └── raw_iter.go
│ │ ├── go-msgpack/
│ │ │ ├── LICENSE
│ │ │ └── codec/
│ │ │ ├── 0doc.go
│ │ │ ├── README.md
│ │ │ ├── binc.go
│ │ │ ├── decode.go
│ │ │ ├── encode.go
│ │ │ ├── helper.go
│ │ │ ├── helper_internal.go
│ │ │ ├── msgpack.go
│ │ │ ├── msgpack_test.py
│ │ │ ├── rpc.go
│ │ │ ├── simple.go
│ │ │ └── time.go
│ │ ├── go-multierror/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── append.go
│ │ │ ├── flatten.go
│ │ │ ├── format.go
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── multierror.go
│ │ │ ├── prefix.go
│ │ │ └── sort.go
│ │ ├── golang-lru/
│ │ │ ├── LICENSE
│ │ │ └── simplelru/
│ │ │ ├── lru.go
│ │ │ └── lru_interface.go
│ │ ├── raft/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── api.go
│ │ │ ├── commands.go
│ │ │ ├── commitment.go
│ │ │ ├── config.go
│ │ │ ├── configuration.go
│ │ │ ├── discard_snapshot.go
│ │ │ ├── file_snapshot.go
│ │ │ ├── fsm.go
│ │ │ ├── future.go
│ │ │ ├── inmem_snapshot.go
│ │ │ ├── inmem_store.go
│ │ │ ├── inmem_transport.go
│ │ │ ├── log.go
│ │ │ ├── log_cache.go
│ │ │ ├── membership.md
│ │ │ ├── net_transport.go
│ │ │ ├── observer.go
│ │ │ ├── peersjson.go
│ │ │ ├── raft.go
│ │ │ ├── replication.go
│ │ │ ├── snapshot.go
│ │ │ ├── stable.go
│ │ │ ├── state.go
│ │ │ ├── tag.sh
│ │ │ ├── tcp_transport.go
│ │ │ ├── transport.go
│ │ │ └── util.go
│ │ └── raft-boltdb/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── bolt_store.go
│ │ └── util.go
│ ├── mattn/
│ │ ├── go-colorable/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── colorable_appengine.go
│ │ │ ├── colorable_others.go
│ │ │ ├── colorable_windows.go
│ │ │ └── noncolorable.go
│ │ └── go-isatty/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── isatty_appengine.go
│ │ ├── isatty_bsd.go
│ │ ├── isatty_linux.go
│ │ ├── isatty_linux_ppc64x.go
│ │ ├── isatty_others.go
│ │ ├── isatty_solaris.go
│ │ └── isatty_windows.go
│ ├── pkg/
│ │ └── errors/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── errors.go
│ │ └── stack.go
│ ├── pmezard/
│ │ └── go-difflib/
│ │ ├── LICENSE
│ │ └── difflib/
│ │ └── difflib.go
│ ├── stretchr/
│ │ └── testify/
│ │ ├── LICENSE
│ │ └── assert/
│ │ ├── assertion_format.go
│ │ ├── assertion_format.go.tmpl
│ │ ├── assertion_forward.go
│ │ ├── assertion_forward.go.tmpl
│ │ ├── assertions.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── forward_assertions.go
│ │ └── http_assertions.go
│ └── tidwall/
│ └── redcon/
│ ├── .travis.yml
│ ├── LICENSE
│ ├── README.md
│ ├── append.go
│ └── redcon.go
├── golang.org/
│ └── x/
│ ├── net/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── context/
│ │ │ ├── context.go
│ │ │ ├── go17.go
│ │ │ ├── go19.go
│ │ │ ├── pre_go17.go
│ │ │ └── pre_go19.go
│ │ ├── http/
│ │ │ └── httpguts/
│ │ │ ├── guts.go
│ │ │ └── httplex.go
│ │ ├── http2/
│ │ │ ├── .gitignore
│ │ │ ├── Dockerfile
│ │ │ ├── Makefile
│ │ │ ├── README
│ │ │ ├── ciphers.go
│ │ │ ├── client_conn_pool.go
│ │ │ ├── configure_transport.go
│ │ │ ├── databuffer.go
│ │ │ ├── errors.go
│ │ │ ├── flow.go
│ │ │ ├── frame.go
│ │ │ ├── go111.go
│ │ │ ├── go16.go
│ │ │ ├── go17.go
│ │ │ ├── go17_not18.go
│ │ │ ├── go18.go
│ │ │ ├── go19.go
│ │ │ ├── gotrack.go
│ │ │ ├── headermap.go
│ │ │ ├── hpack/
│ │ │ │ ├── encode.go
│ │ │ │ ├── hpack.go
│ │ │ │ ├── huffman.go
│ │ │ │ └── tables.go
│ │ │ ├── http2.go
│ │ │ ├── not_go111.go
│ │ │ ├── not_go16.go
│ │ │ ├── not_go17.go
│ │ │ ├── not_go18.go
│ │ │ ├── not_go19.go
│ │ │ ├── pipe.go
│ │ │ ├── server.go
│ │ │ ├── transport.go
│ │ │ ├── write.go
│ │ │ ├── writesched.go
│ │ │ ├── writesched_priority.go
│ │ │ └── writesched_random.go
│ │ ├── idna/
│ │ │ ├── idna.go
│ │ │ ├── punycode.go
│ │ │ ├── tables.go
│ │ │ ├── trie.go
│ │ │ └── trieval.go
│ │ ├── internal/
│ │ │ └── timeseries/
│ │ │ └── timeseries.go
│ │ └── trace/
│ │ ├── events.go
│ │ ├── histogram.go
│ │ ├── trace.go
│ │ ├── trace_go16.go
│ │ └── trace_go17.go
│ ├── sys/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ └── unix/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── affinity_linux.go
│ │ ├── aliases.go
│ │ ├── asm_darwin_386.s
│ │ ├── asm_darwin_amd64.s
│ │ ├── asm_darwin_arm.s
│ │ ├── asm_darwin_arm64.s
│ │ ├── asm_dragonfly_amd64.s
│ │ ├── asm_freebsd_386.s
│ │ ├── asm_freebsd_amd64.s
│ │ ├── asm_freebsd_arm.s
│ │ ├── asm_linux_386.s
│ │ ├── asm_linux_amd64.s
│ │ ├── asm_linux_arm.s
│ │ ├── asm_linux_arm64.s
│ │ ├── asm_linux_mips64x.s
│ │ ├── asm_linux_mipsx.s
│ │ ├── asm_linux_ppc64x.s
│ │ ├── asm_linux_s390x.s
│ │ ├── asm_netbsd_386.s
│ │ ├── asm_netbsd_amd64.s
│ │ ├── asm_netbsd_arm.s
│ │ ├── asm_openbsd_386.s
│ │ ├── asm_openbsd_amd64.s
│ │ ├── asm_openbsd_arm.s
│ │ ├── asm_solaris_amd64.s
│ │ ├── bluetooth_linux.go
│ │ ├── cap_freebsd.go
│ │ ├── constants.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_linux_32bit.go
│ │ ├── gccgo.go
│ │ ├── gccgo_c.c
│ │ ├── gccgo_linux_amd64.go
│ │ ├── ioctl.go
│ │ ├── mkall.sh
│ │ ├── mkerrors.sh
│ │ ├── mkpost.go
│ │ ├── mksyscall.pl
│ │ ├── mksyscall_solaris.pl
│ │ ├── mksysctl_openbsd.pl
│ │ ├── mksysnum_darwin.pl
│ │ ├── mksysnum_dragonfly.pl
│ │ ├── mksysnum_freebsd.pl
│ │ ├── mksysnum_netbsd.pl
│ │ ├── mksysnum_openbsd.pl
│ │ ├── openbsd_pledge.go
│ │ ├── pagesize_unix.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── sockcmsg_linux.go
│ │ ├── sockcmsg_unix.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_bsd.go
│ │ ├── syscall_darwin.go
│ │ ├── syscall_darwin_386.go
│ │ ├── syscall_darwin_amd64.go
│ │ ├── syscall_darwin_arm.go
│ │ ├── syscall_darwin_arm64.go
│ │ ├── syscall_dragonfly.go
│ │ ├── syscall_dragonfly_amd64.go
│ │ ├── syscall_freebsd.go
│ │ ├── syscall_freebsd_386.go
│ │ ├── syscall_freebsd_amd64.go
│ │ ├── syscall_freebsd_arm.go
│ │ ├── syscall_linux.go
│ │ ├── syscall_linux_386.go
│ │ ├── syscall_linux_amd64.go
│ │ ├── syscall_linux_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_s390x.go
│ │ ├── syscall_linux_sparc64.go
│ │ ├── syscall_netbsd.go
│ │ ├── syscall_netbsd_386.go
│ │ ├── syscall_netbsd_amd64.go
│ │ ├── syscall_netbsd_arm.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
│ │ ├── timestruct.go
│ │ ├── types_darwin.go
│ │ ├── types_dragonfly.go
│ │ ├── types_freebsd.go
│ │ ├── types_netbsd.go
│ │ ├── types_openbsd.go
│ │ ├── types_solaris.go
│ │ ├── xattr_bsd.go
│ │ ├── zerrors_darwin_386.go
│ │ ├── zerrors_darwin_amd64.go
│ │ ├── zerrors_darwin_arm.go
│ │ ├── zerrors_darwin_arm64.go
│ │ ├── zerrors_dragonfly_amd64.go
│ │ ├── zerrors_freebsd_386.go
│ │ ├── zerrors_freebsd_amd64.go
│ │ ├── zerrors_freebsd_arm.go
│ │ ├── zerrors_linux_386.go
│ │ ├── zerrors_linux_amd64.go
│ │ ├── zerrors_linux_arm.go
│ │ ├── zerrors_linux_arm64.go
│ │ ├── zerrors_linux_mips.go
│ │ ├── zerrors_linux_mips64.go
│ │ ├── zerrors_linux_mips64le.go
│ │ ├── zerrors_linux_mipsle.go
│ │ ├── zerrors_linux_ppc64.go
│ │ ├── zerrors_linux_ppc64le.go
│ │ ├── zerrors_linux_s390x.go
│ │ ├── zerrors_linux_sparc64.go
│ │ ├── zerrors_netbsd_386.go
│ │ ├── zerrors_netbsd_amd64.go
│ │ ├── zerrors_netbsd_arm.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_darwin_386.go
│ │ ├── zsyscall_darwin_amd64.go
│ │ ├── zsyscall_darwin_arm.go
│ │ ├── zsyscall_darwin_arm64.go
│ │ ├── zsyscall_dragonfly_amd64.go
│ │ ├── zsyscall_freebsd_386.go
│ │ ├── zsyscall_freebsd_amd64.go
│ │ ├── zsyscall_freebsd_arm.go
│ │ ├── zsyscall_linux_386.go
│ │ ├── zsyscall_linux_amd64.go
│ │ ├── zsyscall_linux_arm.go
│ │ ├── zsyscall_linux_arm64.go
│ │ ├── zsyscall_linux_mips.go
│ │ ├── zsyscall_linux_mips64.go
│ │ ├── zsyscall_linux_mips64le.go
│ │ ├── zsyscall_linux_mipsle.go
│ │ ├── zsyscall_linux_ppc64.go
│ │ ├── zsyscall_linux_ppc64le.go
│ │ ├── zsyscall_linux_s390x.go
│ │ ├── zsyscall_linux_sparc64.go
│ │ ├── zsyscall_netbsd_386.go
│ │ ├── zsyscall_netbsd_amd64.go
│ │ ├── zsyscall_netbsd_arm.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_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_s390x.go
│ │ ├── zsysnum_linux_sparc64.go
│ │ ├── zsysnum_netbsd_386.go
│ │ ├── zsysnum_netbsd_amd64.go
│ │ ├── zsysnum_netbsd_arm.go
│ │ ├── zsysnum_openbsd_386.go
│ │ ├── zsysnum_openbsd_amd64.go
│ │ ├── zsysnum_openbsd_arm.go
│ │ ├── ztypes_darwin_386.go
│ │ ├── ztypes_darwin_amd64.go
│ │ ├── ztypes_darwin_arm.go
│ │ ├── ztypes_darwin_arm64.go
│ │ ├── ztypes_dragonfly_amd64.go
│ │ ├── ztypes_freebsd_386.go
│ │ ├── ztypes_freebsd_amd64.go
│ │ ├── ztypes_freebsd_arm.go
│ │ ├── ztypes_linux_386.go
│ │ ├── ztypes_linux_amd64.go
│ │ ├── ztypes_linux_arm.go
│ │ ├── ztypes_linux_arm64.go
│ │ ├── ztypes_linux_mips.go
│ │ ├── ztypes_linux_mips64.go
│ │ ├── ztypes_linux_mips64le.go
│ │ ├── ztypes_linux_mipsle.go
│ │ ├── ztypes_linux_ppc64.go
│ │ ├── ztypes_linux_ppc64le.go
│ │ ├── ztypes_linux_s390x.go
│ │ ├── ztypes_linux_sparc64.go
│ │ ├── ztypes_netbsd_386.go
│ │ ├── ztypes_netbsd_amd64.go
│ │ ├── ztypes_netbsd_arm.go
│ │ ├── ztypes_openbsd_386.go
│ │ ├── ztypes_openbsd_amd64.go
│ │ ├── ztypes_openbsd_arm.go
│ │ └── ztypes_solaris_amd64.go
│ └── text/
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── collate/
│ │ ├── collate.go
│ │ ├── index.go
│ │ ├── maketables.go
│ │ ├── option.go
│ │ ├── sort.go
│ │ └── tables.go
│ ├── internal/
│ │ ├── colltab/
│ │ │ ├── collelem.go
│ │ │ ├── colltab.go
│ │ │ ├── contract.go
│ │ │ ├── iter.go
│ │ │ ├── numeric.go
│ │ │ ├── table.go
│ │ │ ├── trie.go
│ │ │ └── weighter.go
│ │ ├── gen/
│ │ │ ├── code.go
│ │ │ └── gen.go
│ │ ├── tag/
│ │ │ └── tag.go
│ │ ├── triegen/
│ │ │ ├── compact.go
│ │ │ ├── print.go
│ │ │ └── triegen.go
│ │ └── ucd/
│ │ └── ucd.go
│ ├── language/
│ │ ├── Makefile
│ │ ├── common.go
│ │ ├── coverage.go
│ │ ├── doc.go
│ │ ├── gen.go
│ │ ├── gen_common.go
│ │ ├── gen_index.go
│ │ ├── go1_1.go
│ │ ├── go1_2.go
│ │ ├── index.go
│ │ ├── language.go
│ │ ├── lookup.go
│ │ ├── match.go
│ │ ├── parse.go
│ │ ├── tables.go
│ │ └── tags.go
│ ├── secure/
│ │ └── bidirule/
│ │ ├── bidirule.go
│ │ ├── bidirule10.0.0.go
│ │ └── bidirule9.0.0.go
│ ├── transform/
│ │ └── transform.go
│ └── unicode/
│ ├── bidi/
│ │ ├── bidi.go
│ │ ├── bracket.go
│ │ ├── core.go
│ │ ├── gen.go
│ │ ├── gen_ranges.go
│ │ ├── gen_trieval.go
│ │ ├── prop.go
│ │ ├── tables10.0.0.go
│ │ ├── tables9.0.0.go
│ │ └── trieval.go
│ ├── cldr/
│ │ ├── base.go
│ │ ├── cldr.go
│ │ ├── collate.go
│ │ ├── decode.go
│ │ ├── makexml.go
│ │ ├── resolve.go
│ │ ├── slice.go
│ │ └── xml.go
│ ├── norm/
│ │ ├── composition.go
│ │ ├── forminfo.go
│ │ ├── input.go
│ │ ├── iter.go
│ │ ├── maketables.go
│ │ ├── normalize.go
│ │ ├── readwriter.go
│ │ ├── tables10.0.0.go
│ │ ├── tables9.0.0.go
│ │ ├── transform.go
│ │ ├── trie.go
│ │ └── triegen.go
│ └── rangetable/
│ ├── gen.go
│ ├── merge.go
│ ├── rangetable.go
│ ├── tables10.0.0.go
│ └── tables9.0.0.go
└── google.golang.org/
├── genproto/
│ ├── LICENSE
│ └── googleapis/
│ └── rpc/
│ └── status/
│ └── status.pb.go
└── grpc/
├── .travis.yml
├── AUTHORS
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── backoff.go
├── balancer/
│ ├── balancer.go
│ ├── base/
│ │ ├── balancer.go
│ │ └── base.go
│ └── roundrobin/
│ └── roundrobin.go
├── balancer.go
├── balancer_conn_wrappers.go
├── balancer_v1_wrapper.go
├── call.go
├── clientconn.go
├── codec.go
├── codegen.sh
├── codes/
│ ├── code_string.go
│ └── codes.go
├── connectivity/
│ └── connectivity.go
├── credentials/
│ ├── credentials.go
│ ├── go16.go
│ ├── go17.go
│ ├── go18.go
│ └── go19.go
├── dialoptions.go
├── doc.go
├── encoding/
│ ├── encoding.go
│ └── proto/
│ └── proto.go
├── go16.go
├── go17.go
├── grpclog/
│ ├── grpclog.go
│ ├── logger.go
│ └── loggerv2.go
├── install_gae.sh
├── interceptor.go
├── internal/
│ ├── backoff/
│ │ └── backoff.go
│ ├── channelz/
│ │ ├── funcs.go
│ │ ├── types.go
│ │ ├── types_linux.go
│ │ ├── types_nonlinux.go
│ │ ├── util_linux_go19.go
│ │ └── util_nonlinux_pre_go19.go
│ ├── envconfig/
│ │ └── envconfig.go
│ ├── grpcrand/
│ │ └── grpcrand.go
│ ├── internal.go
│ └── transport/
│ ├── bdp_estimator.go
│ ├── controlbuf.go
│ ├── defaults.go
│ ├── flowcontrol.go
│ ├── go16.go
│ ├── go17.go
│ ├── handler_server.go
│ ├── http2_client.go
│ ├── http2_server.go
│ ├── http_util.go
│ ├── log.go
│ └── transport.go
├── keepalive/
│ └── keepalive.go
├── metadata/
│ └── metadata.go
├── naming/
│ ├── dns_resolver.go
│ ├── go17.go
│ ├── go18.go
│ └── naming.go
├── peer/
│ └── peer.go
├── picker_wrapper.go
├── pickfirst.go
├── proxy.go
├── resolver/
│ ├── dns/
│ │ ├── dns_resolver.go
│ │ ├── go17.go
│ │ └── go18.go
│ ├── passthrough/
│ │ └── passthrough.go
│ └── resolver.go
├── resolver_conn_wrapper.go
├── rpc_util.go
├── server.go
├── service_config.go
├── stats/
│ ├── handlers.go
│ └── stats.go
├── status/
│ ├── go16.go
│ ├── go17.go
│ └── status.go
├── stream.go
├── tap/
│ └── tap.go
├── trace.go
├── version.go
└── vet.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
build
coverage.txt
================================================
FILE: .golang.ci.yaml
================================================
# available options https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 1m
# include test files or not, default is true
tests: false
# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- pb.go$
- vendor
# all available settings of specific linters
linters-settings:
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: US
linters:
enable-all: true
disable:
- dupl
- lll
================================================
FILE: .goreleaser.yml
================================================
project_name: godown
git:
short_hash: true
release:
name_template: "v{{ .Version }}"
prerelease: true
builds:
-
main: cmd/godown-cli/main.go
binary: godown-cli
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- 386
-
main: cmd/godown-server/main.go
binary: godown-server
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- 386
archive:
replacements:
darwin: Darwin
linux: Linux
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
dist: build/dist
changelog:
filters:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
dockers:
-
goos: linux
goarch: amd64
binary: godown-server
image: namreg/godown-server
dockerfile: cmd/godown-server/Dockerfile
tag_templates:
- "{{ .Tag }}"
- latest
================================================
FILE: .travis.yml
================================================
language: go
go:
- 1.x
script:
- make test
before_install:
- go get github.com/gojuno/minimock/cmd/minimock
- go get github.com/golang/dep/cmd/dep
after_success:
- bash <(curl -s https://codecov.io/bash)
================================================
FILE: Gopkg.toml
================================================
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[prune]
go-tests = true
unused-packages = true
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.1"
[[constraint]]
name = "github.com/golang/protobuf"
version = "1.1.0"
[[constraint]]
branch = "master"
name = "github.com/Bowery/prompt"
[[constraint]]
name = "github.com/gogo/protobuf"
version = "1.1.1"
[[constraint]]
name = "github.com/fatih/color"
version = "1.7.0"
[[constraint]]
name = "github.com/hashicorp/go-multierror"
version = "1.0.0"
[[constraint]]
name = "github.com/tidwall/redcon"
version = "0.9.0"
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Igor German
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.
================================================
FILE: Makefile
================================================
PACKAGE=github.com/namreg/godown
PKGS=$(shell go list ./... | grep -v vendor | grep -v cmd)
ARTIFACTS=./build
.PHONY: default
default: test
.PHONY: vendor
vendor:
@echo "======> vendoring dependencies"
@$(GOPATH)/bin/dep ensure
.PHONY: generate
generate:
@echo "======> generating code"
@go generate $(PKGS)
.PHONY: lint
lint:
@echo "======> start linter"
@docker run --rm -t -v $(GOPATH)/src/$(PACKAGE):/go/src/$(PACKAGE) -w /go/src/$(PACKAGE) roistat/golangci-lint -c .golang.ci.yaml
.PHONY: test
test: vendor generate
@echo "======> running tests"
@go test -cover -race -coverprofile=coverage.txt -covermode=atomic $(PKGS)
.PHONY: clear
clear:
@echo "======> clearing artifacts"
@rm -fR $(ARTIFACTS)
.PHONY: build
build: clear
go build -o $(ARTIFACTS)/godown-server ./cmd/godown-server
go build -o $(ARTIFACTS)/godown-cli ./cmd/godown-cli
.PHONY: release
release: test lint
@echo "======> starting a new release"
docker run --rm --privileged \
-v $(PWD):/go/src/$(PACKAGE) \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/$(PACKAGE) \
-e GITHUB_TOKEN \
-e DOCKER_USERNAME \
-e DOCKER_PASSWORD \
goreleaser/goreleaser release --rm-dist
================================================
FILE: README.md
================================================
## Godown
[](https://www.travis-ci.org/namreg/godown)
[](https://goreportcard.com/report/github.com/namreg/godown)
[](https://github.com/namreg/godown/blob/master/LICENSE)
[](https://codecov.io/gh/namreg/godown)
A simple, distributed, fault-tolerant key-value storage inspired by Redis. It uses [Raft](https://raft.github.io) protocotol as consensus algorithm.
It supports the following data structures: `String`, `Bitmap`, `Map`, `List`.
[](https://asciinema.org/a/lNp3lOJlnnp9WQW3kKnguL35e)
### How to install
#### Install via binaries
You can find binaries on the [Github releases page](https://github.com/namreg/godown/releases).
```bash
/application/godown/godown-server -dir=/application/godown/data01 -id=01 -listen=127.0.0.1:14001 -raft=127.0.0.1:24001
/application/godown/godown-server -dir=/application/godown/data02 -id=02 -listen=127.0.0.1:14002 -raft=127.0.0.1:24002 -join=127.0.0.1:14001
/application/godown/godown-server -dir=/application/godown/data03 -id=03 -listen=127.0.0.1:14003 -raft=127.0.0.1:24003 -join=127.0.0.1:14001
```
#### Install via docker
```bash
# creating a network
docker network create godown
# creating a volume
docker volume create godown
# bootstrap a cluster with a single node
docker run -it --rm -v godown:/var/lib/godown --name=godown_1 --net=godown -p 5000:5000 \
namreg/godown-server -id 1 -listen godown_1:5000 -raft godown_1:6000
# join the second node to the cluster
docker run -it --rm -v godown:/var/lib/godown --name=godown_2 --net=godown -p 5001:5001 \
namreg/godown-server -id 2 -listen godown_2:5001 -join godown_1:5000 -raft godown_2:6001
# join the third node to the cluster
docker run -it --rm -v godown:/var/lib/godown --name=godown_3 --net=godown -p 5002:5002 \
namreg/godown-server -id 3 -listen godown_3:5001 -join godown_1:5000 -raft godown_3:6002
```
Available options to run a server:
```bash
-dir string
Directory where data is stored.
-gc duration
Garbage collector interval.
-id string
Server unique id.
-join string
Server address to join.
-listen string
Server address to listen.
-raft string
Raft protocol listen address.
-resp string
Redis Serialization Protocol listen address.
-version
Show version.
```
### How to connect
You can connect to any godown node. All modifications will be replicated to all nodes.
#### Connect via any redis client
If you have specified `resp` address while starting a node, you can connect to the one by any redis client.
```go
package main
import (
"fmt"
"net"
"time"
"github.com/garyburd/redigo/redis"
)
const connectionTimeout = 100 * time.Millisecond
func main() {
conn, err := net.Dial("tcp", "6380")
if err != nil {
panic(err)
}
rconn := redis.NewConn(conn, connectionTimeout, connectionTimeout)
reply, err := rconn.Do("LRANGE", "list", 0, 100)
vals, err := redis.Strings(reply, err)
if err != nil {
panic(err)
}
fmt.Println(vals)
}
```
#### Connect via CLI
```bash
godown-cli
```
Available options:
```bash
-host string
Host to connect to a server (default "127.0.0.1")
-port string
Port to connect to a server (default "4000")
-version
Show godown version.
```
Supported commands:
| Command| Description |
|---|---|
| HELP command | Show the usage of the given command. |
| TYPE key | Returns the type stored at key. |
| KEYS pattern | Find all keys matching the given pattern. |
| PING [message] | Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk. |
| EXPIRE key seconds | Set a timeout on key. After the timeout has expired, the key will automatically be deleted. |
| TTL key | Returns the remaining time to live of a key. -1 returns if key does not have timeout. |
|---|---|---|
| SET key value | Set key to hold the string value. If key already holds a value, it is overwritten. |
| GET key | Get the value by key. If provided key does not exist NIL will be returned. |
| STRLEN key | Returns length of the given key. If key does not exists, 0 will be returned. |
| DEL key | Delete the given key. |
|---|---|---|
| SETBIT key offset value | Sets or clears the bit at offset in the string value stored at key. |
| GETBIT key offset | Returns the bit value at offset in the string value stored at key. |
|---|---|---|
| LPUSH key value [value ...] | Prepend one or multiple values to a list. |
| LPOP key | Removes and returns the first element of the list stored at key. |
| RPUSH key value [value ...] | Append one or multiple values to a list. |
| RPOP key | Removes and returns the last element of the list stored at key. |
| LLEN key | Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. |
| LINDEX key index | Returns the element at index index in the list stored at key. <br>The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. |
| LRANGE key start stop | Returns the specified elements of the list stored at key.<br> The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on. |
| LREM key value | Removes all occurrences of elements equal to value from the list stored at key. |
|---|---|---|
| HSET key field value | Sets field in the hash stored at key to value. |
| HGET key field | Returns the value associated with field in the hash stored at key. |
| HKEYS key | Returns all field names in the hash stored at key. Order of fields is not guaranteed. |
| HVALS key | Returns all values in the hash stored at key. |
| HDEL key field [field ...] | Removes the specified fields from the hash stored at key. Returns the number of fields that were removed. |
#### Connect via go client
```go
package main
import (
"fmt"
"github.com/namreg/godown/client"
)
func main() {
c, err := client.New("127.0.0.1:4000")
if err != nil {
panic(err)
}
defer c.Close()
res := c.Get("key")
if res.Err() != nil {
panic(res.Err())
}
if res.IsNil() {
fmt.Print("key does not exist")
} else {
fmt.Println(res.Int64())
}
}
```
Client documentation available at [godoc](https://godoc.org/github.com/namreg/godown/client)
### TODO
- [ ] Write more docs
- [ ] Write more tests
================================================
FILE: client/client.go
================================================
package client
import (
"context"
"fmt"
"strconv"
"strings"
"time"
"github.com/namreg/godown/internal/api"
"github.com/hashicorp/go-multierror"
"google.golang.org/grpc"
)
const connectTimeout = 100 * time.Millisecond
//go:generate minimock -i github.com/namreg/godown/client.executor -o ./
type executor interface {
ExecuteCommand(context.Context, *api.ExecuteCommandRequest, ...grpc.CallOption) (*api.ExecuteCommandResponse, error)
}
//Client is a client that communicates with a server.
type Client struct {
addrs []string
conn *grpc.ClientConn
executor executor
}
//New creates a new client with the given servet addresses.
func New(addr string, addrs ...string) (*Client, error) {
c := &Client{addrs: append([]string{addr}, addrs...)}
if err := c.tryConnect(); err != nil {
return nil, fmt.Errorf("could not connect to server: %v", err)
}
return c, nil
}
//Close closes the client.
func (c *Client) Close() error {
if c.conn != nil {
return c.conn.Close()
}
return nil
}
func (c *Client) tryConnect() error {
var (
result *multierror.Error
err error
conn *grpc.ClientConn
)
for addrs := c.addrs; len(addrs) > 0; addrs = addrs[1:] {
ctx, cancel := context.WithTimeout(context.Background(), connectTimeout)
defer cancel()
if conn, err = grpc.DialContext(ctx, addrs[0], grpc.WithInsecure(), grpc.WithBlock()); err == nil {
c.conn = conn
c.executor = api.NewGodownClient(c.conn)
return nil
}
result = multierror.Append(result, err)
}
return result.ErrorOrNil()
}
func (c *Client) newExecuteRequest(cmd string, args ...string) *api.ExecuteCommandRequest {
args = append([]string{cmd}, args...)
return &api.ExecuteCommandRequest{
Command: strings.Join(args, " "),
}
}
//Get gets a value at the given key.
func (c *Client) Get(key string) ScalarResult {
return c.get(context.Background(), key)
}
//GetWithContext similar to Get but with the context.
func (c *Client) GetWithContext(ctx context.Context, key string) ScalarResult {
return c.get(ctx, key)
}
func (c *Client) get(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("GET", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//Set sets a new value at the given key.
func (c *Client) Set(key, value string) StatusResult {
return c.set(context.Background(), key, value)
}
//SetWithContext similar to Set but with the context.
func (c *Client) SetWithContext(ctx context.Context, key, value string) StatusResult {
return c.set(ctx, key, value)
}
func (c *Client) set(ctx context.Context, key, value string) StatusResult {
req := c.newExecuteRequest("SET", key, value)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
//Del deletes the given key.
func (c *Client) Del(key string) StatusResult {
return c.del(context.Background(), key)
}
//DelWithContext similar to Del but with context.
func (c *Client) DelWithContext(ctx context.Context, key string) StatusResult {
return c.del(ctx, key)
}
func (c *Client) del(ctx context.Context, key string) StatusResult {
req := c.newExecuteRequest("DEL", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
//Expire sets expiration of the given key as `now + secs`.
func (c *Client) Expire(key string, secs int) StatusResult {
return c.expire(context.Background(), key, secs)
}
//ExpireWithContext similar to Expire but with context.
func (c *Client) ExpireWithContext(ctx context.Context, key string, secs int) StatusResult {
return c.expire(ctx, key, secs)
}
func (c *Client) expire(ctx context.Context, key string, secs int) StatusResult {
req := c.newExecuteRequest("EXPIRE", key, strconv.Itoa(secs))
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
//GetBit returns the bit value at the offset in the string stored at key.
func (c *Client) GetBit(key string, offset uint64) ScalarResult {
return c.getBit(context.Background(), key, offset)
}
//GetBitWithContext similar to GetBit but with context.
func (c *Client) GetBitWithContext(ctx context.Context, key string, offset uint64) ScalarResult {
return c.getBit(ctx, key, offset)
}
func (c *Client) getBit(ctx context.Context, key string, offset uint64) ScalarResult {
req := c.newExecuteRequest("GETBIT", key, strconv.FormatUint(offset, 10))
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//HGet returns the value associated with field in the hash stored at key.
func (c *Client) HGet(key, field string) ScalarResult {
return c.hget(context.Background(), key, field)
}
//HGetWithContext similar to HGet but with context.
func (c *Client) HGetWithContext(ctx context.Context, key, field string) ScalarResult {
return c.hget(ctx, key, field)
}
func (c *Client) hget(ctx context.Context, key, field string) ScalarResult {
req := c.newExecuteRequest("HGET", key, field)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//HKeys returns all keys of the map stored at the given key.
func (c *Client) HKeys(key string) ListResult {
return c.hkeys(context.Background(), key)
}
//HKeysWithContext similar to Hkeys by with context.
func (c *Client) HKeysWithContext(ctx context.Context, key string) ListResult {
return c.hkeys(ctx, key)
}
func (c *Client) hkeys(ctx context.Context, key string) ListResult {
req := c.newExecuteRequest("HKEYS", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ListResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newListResult(resp)
}
//HSet sets a field in hash at the given key.
func (c *Client) HSet(key, field, value string) StatusResult {
return c.hset(context.Background(), key, field, value)
}
//HSetWithContext similar to HSet but with context.
func (c *Client) HSetWithContext(ctx context.Context, key, field, value string) StatusResult {
return c.hset(ctx, key, field, value)
}
func (c *Client) hset(ctx context.Context, key, field, value string) StatusResult {
req := c.newExecuteRequest("HSET", key, field, value)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
//HVals returns values of a hash stored at the given key.
func (c *Client) HVals(key string) ListResult {
return c.hvals(context.Background(), key)
}
//HValsWithContext similar to HVals but with context.
func (c *Client) HValsWithContext(ctx context.Context, key string) ListResult {
return c.hvals(ctx, key)
}
func (c *Client) hvals(ctx context.Context, key string) ListResult {
req := c.newExecuteRequest("HVALS", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ListResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newListResult(resp)
}
//HDel deletes given fields from map stored at the given key.
func (c *Client) HDel(key string, field string, fields ...string) ScalarResult {
return c.hdel(context.Background(), key, field, fields...)
}
//HDelWithContext similar to HDel but with context.
func (c *Client) HDelWithContext(ctx context.Context, key, field string, fields ...string) ScalarResult {
return c.hdel(ctx, key, field, fields...)
}
func (c *Client) hdel(ctx context.Context, key, field string, fields ...string) ScalarResult {
args := append([]string{key, field}, fields...)
req := c.newExecuteRequest("HDEL", args...)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//Keys returns all keys that matched to the given pattern.
func (c *Client) Keys(pattern string) ListResult {
return c.keys(context.Background(), pattern)
}
//KeysWithContext similar to Keys but with context.
func (c *Client) KeysWithContext(ctx context.Context, pattern string) ListResult {
return c.keys(ctx, pattern)
}
func (c *Client) keys(ctx context.Context, pattern string) ListResult {
req := c.newExecuteRequest("KEYS", pattern)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ListResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newListResult(resp)
}
//LIndex returns a value at the index in the list stored at the given key.
func (c *Client) LIndex(key string, index int) ScalarResult {
return c.lindex(context.Background(), key, index)
}
//LIndexWithContext similar to LIndex but with context.
func (c *Client) LIndexWithContext(ctx context.Context, key string, index int) ScalarResult {
return c.lindex(ctx, key, index)
}
func (c *Client) lindex(ctx context.Context, key string, index int) ScalarResult {
req := c.newExecuteRequest("LINDEX", key, strconv.Itoa(index))
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//LLen returns a number of the elements in the list stored at the given key.
func (c *Client) LLen(key string) ScalarResult {
return c.llen(context.Background(), key)
}
//LLenWithContext similar to LLen but with context.
func (c *Client) LLenWithContext(ctx context.Context, key string) ScalarResult {
return c.llen(ctx, key)
}
func (c *Client) llen(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("LLEN", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//LPop removes and returns the first element of the list stored at the given key.
func (c *Client) LPop(key string) ScalarResult {
return c.lpop(context.Background(), key)
}
//LPopWithContext similar to LPop but with context.
func (c *Client) LPopWithContext(ctx context.Context, key string) ScalarResult {
return c.lpop(ctx, key)
}
func (c *Client) lpop(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("LPOP", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//LPush prepends a new value to the list stored at the given key.
func (c *Client) LPush(key, value string) StatusResult {
return c.lpush(context.Background(), key, value)
}
//LPushWithContext similar to LPush but with context.
func (c *Client) LPushWithContext(ctx context.Context, key, value string) StatusResult {
return c.lpush(ctx, key, value)
}
func (c *Client) lpush(ctx context.Context, key, value string) StatusResult {
req := c.newExecuteRequest("LPUSH", key, value)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
// RPush appends a new value(s) to the list stored at the given key.
func (c *Client) RPush(key, value string, values ...string) StatusResult {
return c.rpush(context.Background(), key, value, values...)
}
// RPushWithContext similar to RPush but with context.
func (c *Client) RPushWithContext(ctx context.Context, key, value string, values ...string) StatusResult {
return c.rpush(ctx, key, value, values...)
}
func (c *Client) rpush(ctx context.Context, key, value string, values ...string) StatusResult {
args := append([]string{key, value}, values...)
req := c.newExecuteRequest("RPUSH", args...)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
// RPop removes and returns the last element of the list stored at the given key.
func (c *Client) RPop(key string) ScalarResult {
return c.rpop(context.Background(), key)
}
// RPopWithContext similar to RPop but with context.
func (c *Client) RPopWithContext(ctx context.Context, key string) ScalarResult {
return c.rpop(ctx, key)
}
func (c *Client) rpop(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("RPOP", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//LRange returns elements from the list stored at the given key.
//Start and stop are zero-based indexes.
func (c *Client) LRange(key string, start, stop int) ListResult {
return c.lrange(context.Background(), key, start, stop)
}
//LRangeWithContext similar to LRange but with context.
func (c *Client) LRangeWithContext(ctx context.Context, key string, start, stop int) ListResult {
return c.lrange(ctx, key, start, stop)
}
func (c *Client) lrange(ctx context.Context, key string, start, stop int) ListResult {
req := c.newExecuteRequest("LRANGE", key, strconv.Itoa(start), strconv.Itoa(stop))
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ListResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newListResult(resp)
}
//LRem removes a given value from the list stored at the given key.
func (c *Client) LRem(key, value string) StatusResult {
return c.lrem(context.Background(), key, value)
}
//LRemWithContext similar to LRem but with context.
func (c *Client) LRemWithContext(ctx context.Context, key, value string) StatusResult {
return c.lrem(ctx, key, value)
}
func (c *Client) lrem(ctx context.Context, key, value string) StatusResult {
req := c.newExecuteRequest("LREM", key, value)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
//Ping returns PONG if no argument is provided, otherwise returns a copy of the argument as a bulk.
func (c *Client) Ping(args ...string) ScalarResult {
return c.ping(context.Background(), args...)
}
//PingWithContext similar to Ping but with context.
func (c *Client) PingWithContext(ctx context.Context, args ...string) ScalarResult {
return c.ping(ctx, args...)
}
func (c *Client) ping(ctx context.Context, args ...string) ScalarResult {
req := c.newExecuteRequest("PING", args...)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//SetBit sets or clears the bit at offset in the bitmap stored at key.
func (c *Client) SetBit(key string, offset, value uint64) StatusResult {
return c.setbit(context.Background(), key, offset, value)
}
//SetBitWithContext similar to SetBit but with context.
func (c *Client) SetBitWithContext(ctx context.Context, key string, offset, value uint64) StatusResult {
return c.setbit(ctx, key, offset, value)
}
func (c *Client) setbit(ctx context.Context, key string, offset, value uint64) StatusResult {
req := c.newExecuteRequest("SETBIT", key, strconv.FormatUint(offset, 10), strconv.FormatUint(value, 10))
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return StatusResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newStatusResult(resp)
}
//Strlen returns a length of the string stored at key.
func (c *Client) Strlen(key string) ScalarResult {
return c.strlen(context.Background(), key)
}
//StrlenWithContext similar to Strlen but with context.
func (c *Client) StrlenWithContext(ctx context.Context, key string) ScalarResult {
return c.strlen(ctx, key)
}
func (c *Client) strlen(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("STRLEN", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//TTL returns the remaining time to live of a key. -1 returns if key does not have timeout.
func (c *Client) TTL(key string) ScalarResult {
return c.ttl(context.Background(), key)
}
//TTLWithContext similar to TTL but with context.
func (c *Client) TTLWithContext(ctx context.Context, key string) ScalarResult {
return c.ttl(ctx, key)
}
func (c *Client) ttl(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("TTL", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
//Type returns a data type of a value stored at key.
func (c *Client) Type(key string) ScalarResult {
return c.getType(context.Background(), key)
}
//TypeWithContext similar to Type but with context.
func (c *Client) TypeWithContext(ctx context.Context, key string) ScalarResult {
return c.getType(ctx, key)
}
func (c *Client) getType(ctx context.Context, key string) ScalarResult {
req := c.newExecuteRequest("TYPE", key)
resp, err := c.executor.ExecuteCommand(ctx, req)
if err != nil {
return ScalarResult{err: fmt.Errorf("could not execute command: %v", err)}
}
return newScalarResult(resp)
}
================================================
FILE: client/client_del_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Del(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "DEL key",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
arg: "key",
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "raw string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: RAW_STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Del(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_DelWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "DEL key",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "raw string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: RAW_STRING")},
},
{
name: "with_custom_context",
args: args{ctx: contextWithValue("ctx_key", "ctx_value"), key: "key"},
expectCtx: contextWithValue("ctx_key", "ctx_value"),
expectCommand: "DEL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.DelWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_expire_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Expire(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
secs int
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", secs: 10},
expectCommand: "EXPIRE key 10",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{key: "key", secs: 10},
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", secs: 10},
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", secs: 10},
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "raw string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: RAW_STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Expire(tt.args.key, tt.args.secs)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_ExpireWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
secs int
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", secs: 10},
expectCtx: context.Background(),
expectCommand: "EXPIRE key 10",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", secs: 10},
expectCtx: context.Background(),
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", secs: 10},
expectCtx: context.Background(),
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", secs: 10},
expectCtx: context.Background(),
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "raw string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: RAW_STRING")},
},
{
name: "with_custom_context",
args: args{ctx: contextWithValue("ctx_key", "ctx_value"), key: "key", secs: 10},
expectCtx: contextWithValue("ctx_key", "ctx_value"),
expectCommand: "EXPIRE key 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.ExpireWithContext(tt.args.ctx, tt.args.key, tt.args.secs)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_get_test.go
================================================
package client
import (
"context"
"errors"
"testing"
"github.com/namreg/godown/internal/api"
"github.com/gojuno/minimock"
"github.com/stretchr/testify/assert"
)
func TestClient_Get(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
test := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "test_key",
expectCommand: "GET test_key",
mockErr: errors.New("server error"),
wantResult: ScalarResult{
err: errors.New("could not execute command: server error"),
},
},
{
name: "server_responds_with_error",
arg: "test_key",
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "something went wrong",
},
wantResult: ScalarResult{
err: errors.New("something went wrong"),
},
},
{
name: "server_responds_with_nil",
arg: "test_key",
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
arg: "test_key",
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "test_key",
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range test {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Get(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_GetWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
test := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{key: "test_key", ctx: context.Background()},
expectCtx: context.Background(),
expectCommand: "GET test_key",
mockErr: errors.New("server error"),
wantResult: ScalarResult{
err: errors.New("could not execute command: server error"),
},
},
{
name: "server_responds_with_error",
args: args{key: "test_key", ctx: context.Background()},
expectCtx: context.Background(),
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "something went wrong",
},
wantResult: ScalarResult{
err: errors.New("something went wrong"),
},
},
{
name: "server_responds_with_nil",
args: args{key: "test_key", ctx: context.Background()},
expectCtx: context.Background(),
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{key: "test_key", ctx: context.Background()},
expectCtx: context.Background(),
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "test_key", ctx: context.Background()},
expectCtx: context.Background(),
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("ctx_key", "ctx_value"), key: "test_key"},
expectCtx: contextWithValue("ctx_key", "ctx_value"),
expectCommand: "GET test_key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range test {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.args.ctx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.GetWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_getbit_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_GetBit(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
offset uint64
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", offset: 1},
expectCommand: "GETBIT key 1",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{key: "key", offset: 1},
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_int",
args: args{key: "key", offset: 1},
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "1",
},
wantResult: ScalarResult{val: stringToPtr("1")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", offset: 1},
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.GetBit(tt.args.key, tt.args.offset)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_GetBitWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
offset uint64
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", offset: 1},
expectCtx: context.Background(),
expectCommand: "GETBIT key 1",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", offset: 1},
expectCtx: context.Background(),
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_int",
args: args{ctx: context.Background(), key: "key", offset: 1},
expectCtx: context.Background(),
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "1",
},
wantResult: ScalarResult{val: stringToPtr("1")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", offset: 1},
expectCtx: context.Background(),
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
{
name: "with_custom_context",
args: args{ctx: contextWithValue("ctx_key", "ctx_value"), key: "key", offset: 1},
expectCtx: contextWithValue("ctx_key", "ctx_value"),
expectCommand: "GETBIT key 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "1",
},
wantResult: ScalarResult{val: stringToPtr("1")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.GetBitWithContext(tt.args.ctx, tt.args.key, tt.args.offset)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_hdel_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_HDel(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
fields []string
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", fields: []string{"field1", "field2"}},
expectCommand: "HDEL key field1 field2",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{key: "key", fields: []string{"field1", "field2"}},
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_int",
args: args{key: "key", fields: []string{"field1", "field2"}},
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "2",
},
wantResult: ScalarResult{val: stringToPtr("2")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", fields: []string{"field1", "field2"}},
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HDel(tt.args.key, tt.args.fields[0], tt.args.fields[1:]...)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_HDelWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
fields []string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", fields: []string{"field1", "field2"}},
expectCtx: context.Background(),
expectCommand: "HDEL key field1 field2",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", fields: []string{"field1", "field2"}},
expectCtx: context.Background(),
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_int",
args: args{ctx: context.Background(), key: "key", fields: []string{"field1", "field2"}},
expectCtx: context.Background(),
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "2",
},
wantResult: ScalarResult{val: stringToPtr("2")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key", fields: []string{"field1", "field2"}},
expectCtx: contextWithValue("key", "value"),
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "2",
},
wantResult: ScalarResult{val: stringToPtr("2")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", fields: []string{"field1", "field2"}},
expectCtx: context.Background(),
expectCommand: "HDEL key field1 field2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HDelWithContext(tt.args.ctx, tt.args.key, tt.args.fields[0], tt.args.fields[1:]...)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_hget_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_HGet(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key, field string
}
test := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", field: "field"},
expectCommand: "HGET key field",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{key: "key", field: "field"},
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{
err: errors.New("internal server error"),
},
},
{
name: "server_responds_with_nil",
args: args{key: "key", field: "field"},
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{key: "key", field: "field"},
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: ScalarResult{val: stringToPtr("string")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", field: "field"},
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range test {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HGet(tt.args.key, tt.args.field)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_HGetWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key, field string
}
test := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", field: "field"},
expectCtx: context.Background(),
expectCommand: "HGET key field",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", field: "field"},
expectCtx: context.Background(),
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{
err: errors.New("internal server error"),
},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key", field: "field"},
expectCtx: context.Background(),
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{ctx: context.Background(), key: "key", field: "field"},
expectCtx: context.Background(),
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: ScalarResult{val: stringToPtr("string")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", field: "field"},
expectCtx: context.Background(),
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
{
name: "custon_context",
args: args{ctx: contextWithValue("custom_key", "custom_value"), key: "key", field: "field"},
expectCtx: contextWithValue("custom_key", "custom_value"),
expectCommand: "HGET key field",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range test {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HGetWithContext(tt.args.ctx, tt.args.key, tt.args.field)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_hkeys_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_HKeys(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "HKEYS key",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{
err: errors.New("internal server error"),
},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ListResult{},
},
{
name: "server_responds_with_slice",
arg: "key",
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"string1", "string2"},
},
wantResult: ListResult{val: []string{"string1", "string2"}},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: ListResult{err: errors.New("unexpected reply: STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HKeys(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_HKeysWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HKEYS key",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{
err: errors.New("internal server error"),
},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ListResult{},
},
{
name: "server_responds_with_slice",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"string1", "string2"},
},
wantResult: ListResult{val: []string{"string1", "string2"}},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"string1", "string2"},
},
wantResult: ListResult{val: []string{"string1", "string2"}},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HKEYS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: ListResult{err: errors.New("unexpected reply: STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HKeysWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_hset_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_HSet(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key, field, value string
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", field: "field", value: "val"},
expectCommand: "HSET key field val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{key: "key", field: "field", value: "val"},
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", field: "field", value: "val"},
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", field: "field", value: "val"},
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "5",
},
wantResult: StatusResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HSet(tt.args.key, tt.args.field, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_HSetWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
field string
value string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", field: "field", value: "val"},
expectCtx: context.Background(),
expectCommand: "HSET key field val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", field: "field", value: "val"},
expectCtx: context.Background(),
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", field: "field", value: "val"},
expectCtx: context.Background(),
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key", field: "field", value: "val"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", field: "field", value: "val"},
expectCtx: context.Background(),
expectCommand: "HSET key field val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "5",
},
wantResult: StatusResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HSetWithContext(tt.args.ctx, tt.args.key, tt.args.field, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_hvals_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_HVals(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "HVALS key",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{
err: errors.New("internal server error"),
},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ListResult{},
},
{
name: "server_responds_with_slice",
arg: "key",
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"string1", "string2"},
},
wantResult: ListResult{val: []string{"string1", "string2"}},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ListResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HVals(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_HValsWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HVALS key",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{
err: errors.New("internal server error"),
},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ListResult{},
},
{
name: "server_responds_with_slice",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"string1", "string2"},
},
wantResult: ListResult{val: []string{"string1", "string2"}},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"string1", "string2"},
},
wantResult: ListResult{val: []string{"string1", "string2"}},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "HVALS key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ListResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.HValsWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_keys_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Keys(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
arg: "*",
expectCommand: "KEYS *",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "*",
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_slice",
arg: "*",
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"key1"},
},
wantResult: ListResult{val: []string{"key1"}},
},
{
name: "server_responds_with_unexpected_reply",
arg: "*",
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "1",
},
wantResult: ListResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Keys(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_KeysWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
pattern string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), pattern: "*"},
expectCtx: context.Background(),
expectCommand: "KEYS *",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), pattern: "*"},
expectCtx: context.Background(),
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_slice",
args: args{ctx: context.Background(), pattern: "*"},
expectCtx: context.Background(),
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"key1"},
},
wantResult: ListResult{val: []string{"key1"}},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), pattern: "*"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"key1"},
},
wantResult: ListResult{val: []string{"key1"}},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), pattern: "*"},
expectCtx: context.Background(),
expectCommand: "KEYS *",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "1",
},
wantResult: ListResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.KeysWithContext(tt.args.ctx, tt.args.pattern)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_lindex_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_LIndex(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
index int
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", index: 2},
expectCommand: "LINDEX key 2",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{key: "key", index: 2},
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{key: "key", index: 2},
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{key: "key", index: 2},
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", index: 2},
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LIndex(tt.args.key, tt.args.index)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_LIndexWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
index int
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", index: 2},
expectCtx: context.Background(),
expectCommand: "LINDEX key 2",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", index: 2},
expectCtx: context.Background(),
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key", index: 2},
expectCtx: context.Background(),
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{ctx: context.Background(), key: "key", index: 2},
expectCtx: context.Background(),
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key", index: 2},
expectCtx: contextWithValue("key", "value"),
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", index: 2},
expectCtx: context.Background(),
expectCommand: "LINDEX key 2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LIndexWithContext(tt.args.ctx, tt.args.key, tt.args.index)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_llen_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_LLen(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "LLEN key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_integer",
arg: "key",
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: ScalarResult{val: stringToPtr("10")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"10"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LLen(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_LLenWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LLEN key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_integer",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: ScalarResult{val: stringToPtr("10")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: ScalarResult{val: stringToPtr("10")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"10"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LLenWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_lpop_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_LPop(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "LPOP key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
arg: "key",
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LPop(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_LPopWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LPOP key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "LPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LPopWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_lpush_test.go
================================================
package client
import (
"context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_LPush(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key, value string
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", value: "val"},
expectCommand: "LPUSH key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{key: "key", value: "val"},
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", value: "val"},
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", value: "val"},
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LPush(tt.args.key, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_LPushWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
value string
ctx context.Context
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LPUSH key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key", value: "val"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LPushWithContext(tt.expectCtx, tt.args.key, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_lrange_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_LRange(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
start, stop int
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", start: 1, stop: 10},
expectCommand: "LRANGE key 1 10",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{key: "key", start: 1, stop: 10},
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{key: "key", start: 1, stop: 10},
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ListResult{},
},
{
name: "server_responds_with_slice",
args: args{key: "key", start: 1, stop: 10},
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"value 1", "value 2"},
},
wantResult: ListResult{val: []string{"value 1", "value 2"}},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", start: 1, stop: 10},
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "2",
},
wantResult: ListResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LRange(tt.args.key, tt.args.start, tt.args.stop)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_LRangeWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
start, stop int
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ListResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", start: 1, stop: 10},
expectCtx: context.Background(),
expectCommand: "LRANGE key 1 10",
mockErr: errors.New("something went wrong"),
wantResult: ListResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", start: 1, stop: 10},
expectCtx: context.Background(),
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ListResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key", start: 1, stop: 10},
expectCtx: context.Background(),
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ListResult{},
},
{
name: "server_responds_with_slice",
args: args{ctx: context.Background(), key: "key", start: 1, stop: 10},
expectCtx: context.Background(),
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"value 1", "value 2"},
},
wantResult: ListResult{val: []string{"value 1", "value 2"}},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("ctx_key", "value"), key: "key", start: 1, stop: 10},
expectCtx: contextWithValue("ctx_key", "value"),
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"value 1", "value 2"},
},
wantResult: ListResult{val: []string{"value 1", "value 2"}},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", start: 1, stop: 10},
expectCtx: context.Background(),
expectCommand: "LRANGE key 1 10",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "2",
},
wantResult: ListResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LRangeWithContext(tt.args.ctx, tt.args.key, tt.args.start, tt.args.stop)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_lrem_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_LRem(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key, value string
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", value: "val"},
expectCommand: "LREM key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{key: "key", value: "val"},
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", value: "val"},
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", value: "val"},
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: StatusResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LRem(tt.args.key, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_LRemWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key, value string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LREM key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key", value: "val"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "LREM key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: StatusResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.LRemWithContext(tt.expectCtx, tt.args.key, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_ping_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Ping(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
args []string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: []string{"hello", "world"},
expectCommand: "PING hello world",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: []string{"hello", "world"},
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_raw_string",
args: []string{"hello", "world"},
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "PONG hello world",
},
wantResult: ScalarResult{val: stringToPtr("PONG hello world")},
},
{
name: "server_responds_with_unexpected_reply",
args: []string{"hello", "world"},
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Ping(tt.args...)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_PingWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type arguments struct {
ctx context.Context
args []string
}
tests := []struct {
name string
args arguments
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: arguments{ctx: context.Background(), args: []string{"hello", "world"}},
expectCtx: context.Background(),
expectCommand: "PING hello world",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: arguments{ctx: context.Background(), args: []string{"hello", "world"}},
expectCtx: context.Background(),
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_raw_string",
args: arguments{ctx: context.Background(), args: []string{"hello", "world"}},
expectCtx: context.Background(),
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "PONG hello world",
},
wantResult: ScalarResult{val: stringToPtr("PONG hello world")},
},
{
name: "custom_context",
args: arguments{ctx: contextWithValue("key", "value"), args: []string{"hello", "world"}},
expectCtx: contextWithValue("key", "value"),
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.RawStringCommandReply,
Item: "PONG hello world",
},
wantResult: ScalarResult{val: stringToPtr("PONG hello world")},
},
{
name: "server_responds_with_unexpected_reply",
args: arguments{ctx: context.Background(), args: []string{"hello", "world"}},
expectCtx: context.Background(),
expectCommand: "PING hello world",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.PingWithContext(tt.args.ctx, tt.args.args...)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_rpop_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Rpop(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "RPOP key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
arg: "key",
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.RPop(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_RpopWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "RPOP key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "value",
},
wantResult: ScalarResult{val: stringToPtr("value")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "RPOP key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.RPopWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_rpush_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_RPush(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key, value string
values []string
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", value: "val"},
expectCommand: "RPUSH key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{key: "key", value: "val"},
expectCommand: "RPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", value: "val", values: []string{"val2"}},
expectCommand: "RPUSH key val val2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", value: "val"},
expectCommand: "RPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.RPush(tt.args.key, tt.args.value, tt.args.values...)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_RPushWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
value string
values []string
ctx context.Context
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "RPUSH key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "RPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", value: "val", values: []string{"val2"}},
expectCtx: context.Background(),
expectCommand: "RPUSH key val val2",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "value"), key: "key", value: "val"},
expectCtx: contextWithValue("key", "value"),
expectCommand: "RPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "RPUSH key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "string",
},
wantResult: StatusResult{err: errors.New("unexpected reply: STRING")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc)
mock.ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.RPushWithContext(tt.expectCtx, tt.args.key, tt.args.value, tt.args.values...)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_set_test.go
================================================
package client
import (
"context"
"errors"
"testing"
"github.com/namreg/godown/internal/api"
"github.com/gojuno/minimock"
"github.com/stretchr/testify/assert"
)
func TestClient_Set(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key, value string
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", value: "val"},
expectCommand: "SET key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{key: "key", value: "val"},
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", value: "val"},
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", value: "val"},
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: StatusResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Set(tt.args.key, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_SetWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key, value string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "SET key val",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", value: "val"},
expectCtx: context.Background(),
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: StatusResult{err: errors.New("unexpected reply: SLICE")},
},
{
name: "with_custom_context",
args: args{ctx: contextWithValue("ctx_key", "ctx_value"), key: "key", value: "val"},
expectCtx: contextWithValue("ctx_key", "ctx_value"),
expectCommand: "SET key val",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.SetWithContext(tt.args.ctx, tt.args.key, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_setbit_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_SetBit(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
key string
offset, value uint64
}
tests := []struct {
name string
args args
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{key: "key", offset: 1024, value: 1},
expectCommand: "SETBIT key 1024 1",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{key: "key", offset: 1024, value: 1},
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{key: "key", offset: 1024, value: 1},
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{key: "key", offset: 1024, value: 1},
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: StatusResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.SetBit(tt.args.key, tt.args.offset, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_SetBitWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
offset, value uint64
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult StatusResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key", offset: 1024, value: 1},
expectCtx: context.Background(),
expectCommand: "SETBIT key 1024 1",
mockErr: errors.New("something went wrong"),
wantResult: StatusResult{err: errors.New("could not execute command: something went wrong")},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key", offset: 1024, value: 1},
expectCtx: context.Background(),
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: StatusResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_ok",
args: args{ctx: context.Background(), key: "key", offset: 1024, value: 1},
expectCtx: context.Background(),
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "val"), key: "key", offset: 1024, value: 1},
expectCtx: contextWithValue("key", "val"),
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: StatusResult{},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key", offset: 1024, value: 1},
expectCtx: context.Background(),
expectCommand: "SETBIT key 1024 1",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "10",
},
wantResult: StatusResult{err: errors.New("unexpected reply: INT")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.SetBitWithContext(tt.args.ctx, tt.args.key, tt.args.offset, tt.args.value)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_strlen_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Strlen(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "STRLEN key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_int",
arg: "key",
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "5",
},
wantResult: ScalarResult{val: stringToPtr("5")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Strlen(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_StrlenWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "STRLEN key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_int",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "5",
},
wantResult: ScalarResult{val: stringToPtr("5")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "val"), key: "key"},
expectCtx: contextWithValue("key", "val"),
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "5",
},
wantResult: ScalarResult{val: stringToPtr("5")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "STRLEN key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.StrlenWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_ttl_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_TTL(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "TTL key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_int",
arg: "key",
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "-1",
},
wantResult: ScalarResult{val: stringToPtr("-1")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.TTL(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_TTLWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TTL key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_int",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "-1",
},
wantResult: ScalarResult{val: stringToPtr("-1")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("ctx_key", "ctx_value"), key: "key"},
expectCtx: contextWithValue("ctx_key", "ctx_value"),
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.IntCommandReply,
Item: "-1",
},
wantResult: ScalarResult{val: stringToPtr("-1")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TTL key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.OkCommandReply,
},
wantResult: ScalarResult{err: errors.New("unexpected reply: OK")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.TTLWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/client_type_test.go
================================================
package client
import (
context "context"
"errors"
"testing"
"github.com/gojuno/minimock"
"github.com/namreg/godown/internal/api"
"github.com/stretchr/testify/assert"
)
func TestClient_Type(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
tests := []struct {
name string
arg string
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
arg: "key",
expectCommand: "TYPE key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
arg: "key",
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
arg: "key",
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
arg: "key",
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "list",
},
wantResult: ScalarResult{val: stringToPtr("list")},
},
{
name: "server_responds_with_unexpected_reply",
arg: "key",
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(context.Background(), &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.Type(tt.arg)
assert.Equal(t, tt.wantResult, res)
})
}
}
func TestClient_TypeWithContext(t *testing.T) {
mc := minimock.NewController(t)
defer mc.Finish()
type args struct {
ctx context.Context
key string
}
tests := []struct {
name string
args args
expectCtx context.Context
expectCommand string
mockResponse *api.ExecuteCommandResponse
mockErr error
wantResult ScalarResult
}{
{
name: "could_not_execute_command",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TYPE key",
mockErr: errors.New("something went wrong"),
wantResult: ScalarResult{
err: errors.New("could not execute command: something went wrong"),
},
},
{
name: "server_responds_with_error",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.ErrCommandReply,
Item: "internal server error",
},
wantResult: ScalarResult{err: errors.New("internal server error")},
},
{
name: "server_responds_with_nil",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.NilCommandReply,
},
wantResult: ScalarResult{},
},
{
name: "server_responds_with_string",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "list",
},
wantResult: ScalarResult{val: stringToPtr("list")},
},
{
name: "custom_context",
args: args{ctx: contextWithValue("key", "val"), key: "key"},
expectCtx: contextWithValue("key", "val"),
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.StringCommandReply,
Item: "list",
},
wantResult: ScalarResult{val: stringToPtr("list")},
},
{
name: "server_responds_with_unexpected_reply",
args: args{ctx: context.Background(), key: "key"},
expectCtx: context.Background(),
expectCommand: "TYPE key",
mockResponse: &api.ExecuteCommandResponse{
Reply: api.SliceCommandReply,
Items: []string{"val"},
},
wantResult: ScalarResult{err: errors.New("unexpected reply: SLICE")},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mock := NewexecutorMock(mc).ExecuteCommandMock.
Expect(tt.expectCtx, &api.ExecuteCommandRequest{Command: tt.expectCommand}).
Return(tt.mockResponse, tt.mockErr)
cl := Client{executor: mock}
res := cl.TypeWithContext(tt.args.ctx, tt.args.key)
assert.Equal(t, tt.wantResult, res)
})
}
}
================================================
FILE: client/executor_mock_test.go
================================================
package client
/*
DO NOT EDIT!
This code was generated automatically using github.com/gojuno/minimock v1.9
The original interface "executor" can be found in github.com/namreg/godown/client
*/
import (
context "context"
"sync/atomic"
"time"
"github.com/gojuno/minimock"
api "github.com/namreg/godown/internal/api"
grpc "google.golang.org/grpc"
testify_assert "github.com/stretchr/testify/assert"
)
//executorMock implements github.com/namreg/godown/client.executor
type executorMock struct {
t minimock.Tester
ExecuteCommandFunc func(p context.Context, p1 *api.ExecuteCommandRequest, p2 ...grpc.CallOption) (r *api.ExecuteCommandResponse, r1 error)
ExecuteCommandCounter uint64
ExecuteCommandPreCounter uint64
ExecuteCommandMock mexecutorMockExecuteCommand
}
//NewexecutorMock returns a mock for github.com/namreg/godown/client.executor
func NewexecutorMock(t minimock.Tester) *executorMock {
m := &executorMock{t: t}
if controller, ok := t.(minimock.MockController); ok {
controller.RegisterMocker(m)
}
m.ExecuteCommandMock = mexecutorMockExecuteCommand{mock: m}
return m
}
type mexecutorMockExecuteCommand struct {
mock *executorMock
mockExpectations *executorMockExecuteCommandParams
}
//executorMockExecuteCommandParams represents input parameters of the executor.ExecuteCommand
type executorMockExecuteCommandParams struct {
p context.Context
p1 *api.ExecuteCommandRequest
p2 []grpc.CallOption
}
//Expect sets up expected params for the executor.ExecuteCommand
func (m *mexecutorMockExecuteCommand) Expect(p context.Context, p1 *api.ExecuteCommandRequest, p2 ...grpc.CallOption) *mexecutorMockExecuteCommand {
m.mockExpectations = &executorMockExecuteCommandParams{p, p1, p2}
return m
}
//Return sets up a mock for executor.ExecuteCommand to return Return's arguments
func (m *mexecutorMockExecuteCommand) Return(r *api.ExecuteCommandResponse, r1 error) *executorMock {
m.mock.ExecuteCommandFunc = func(p context.Context, p1 *api.ExecuteCommandRequest, p2 ...grpc.CallOption) (*api.ExecuteCommandResponse, error) {
return r, r1
}
return m.mock
}
//Set uses given function f as a mock of executor.ExecuteCommand method
func (m *mexecutorMockExecuteCommand) Set(f func(p context.Context, p1 *api.ExecuteCommandRequest, p2 ...grpc.CallOption) (r *api.ExecuteCommandResponse, r1 error)) *executorMock {
m.mock.ExecuteCommandFunc = f
m.mockExpectations = nil
return m.mock
}
//ExecuteCommand implements github.com/namreg/godown/client.executor interface
func (m *executorMock) ExecuteCommand(p context.Context, p1 *api.ExecuteCommandRequest, p2 ...grpc.CallOption) (r *api.ExecuteCommandResponse, r1 error) {
atomic.AddUint64(&m.ExecuteCommandPreCounter, 1)
defer atomic.AddUint64(&m.ExecuteCommandCounter, 1)
if m.ExecuteCommandMock.mockExpectations != nil {
testify_assert.Equal(m.t, *m.ExecuteCommandMock.mockExpectations, executorMockExecuteCommandParams{p, p1, p2},
"executor.ExecuteCommand got unexpected parameters")
if m.ExecuteCommandFunc == nil {
m.t.Fatal("No results are set for the executorMock.ExecuteCommand")
return
}
}
if m.ExecuteCommandFunc == nil {
m.t.Fatal("Unexpected call to executorMock.ExecuteCommand")
return
}
return m.ExecuteCommandFunc(p, p1, p2...)
}
//ExecuteCommandMinimockCounter returns a count of executorMock.ExecuteCommandFunc invocations
func (m *executorMock) ExecuteCommandMinimockCounter() uint64 {
return atomic.LoadUint64(&m.ExecuteCommandCounter)
}
//ExecuteCommandMinimockPreCounter returns the value of executorMock.ExecuteCommand invocations
func (m *executorMock) ExecuteCommandMinimockPreCounter() uint64 {
return atomic.LoadUint64(&m.ExecuteCommandPreCounter)
}
//ValidateCallCounters checks that all mocked methods of the interface have been called at least once
//Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller
func (m *executorMock) ValidateCallCounters() {
if m.ExecuteCommandFunc != nil && atomic.LoadUint64(&m.ExecuteCommandCounter) == 0 {
m.t.Fatal("Expected call to executorMock.ExecuteCommand")
}
}
//CheckMocksCalled checks that all mocked methods of the interface have been called at least once
//Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller
func (m *executorMock) CheckMocksCalled() {
m.Finish()
}
//Finish checks that all mocked methods of the interface have been called at least once
//Deprecated: please use MinimockFinish or use Finish method of minimock.Controller
func (m *executorMock) Finish() {
m.MinimockFinish()
}
//MinimockFinish checks that all mocked methods of the interface have been called at least once
func (m *executorMock) MinimockFinish() {
if m.ExecuteCommandFunc != nil && atomic.LoadUint64(&m.ExecuteCommandCounter) == 0 {
m.t.Fatal("Expected call to executorMock.ExecuteCommand")
}
}
//Wait waits for all mocked methods to be called at least once
//Deprecated: please use MinimockWait or use Wait method of minimock.Controller
func (m *executorMock) Wait(timeout time.Duration) {
m.MinimockWait(timeout)
}
//MinimockWait waits for all mocked methods to be called at least once
//this method is called by minimock.Controller
func (m *executorMock) MinimockWait(timeout time.Duration) {
timeoutCh := time.After(timeout)
for {
ok := true
ok = ok && (m.ExecuteCommandFunc == nil || atomic.LoadUint64(&m.ExecuteCommandCounter) > 0)
if ok {
return
}
select {
case <-timeoutCh:
if m.ExecuteCommandFunc != nil && atomic.LoadUint64(&m.ExecuteCommandCounter) == 0 {
m.t.Error("Expected call to executorMock.ExecuteCommand")
}
m.t.Fatalf("Some mocks were not called on time: %s", timeout)
return
default:
time.Sleep(time.Millisecond)
}
}
}
//AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled,
//it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())
func (m *executorMock) AllMocksCalled() bool {
if m.ExecuteCommandFunc != nil && atomic.LoadUint64(&m.ExecuteCommandCounter) == 0 {
return false
}
return true
}
================================================
FILE: client/helpers_test.go
================================================
package client
import context "context"
type ctxKey string
func contextWithValue(key string, value interface{}) context.Context {
return context.WithValue(context.Background(), ctxKey(key), value)
}
func stringToPtr(str string) *string {
return &str
}
================================================
FILE: client/result.go
================================================
package client
import (
"errors"
"fmt"
"strconv"
"github.com/namreg/godown/internal/api"
)
//ScalarResult is a scalar result like string, int, etc.
type ScalarResult struct {
val *string
err error
}
//Err returns an error.
func (sr ScalarResult) Err() error {
return sr.err
}
//IsNil returns true if the underlying value and error is empty.
func (sr ScalarResult) IsNil() bool {
return sr.val == nil && sr.err == nil
}
//Val returns a string representation.
func (sr ScalarResult) Val() (string, error) {
if sr.err != nil {
return "", sr.err
}
if sr.IsNil() {
return "", nil
}
return *sr.val, nil
}
//Int64 converts scalar value to the int64.
func (sr ScalarResult) Int64() (int64, error) {
if sr.err != nil {
return 0, sr.err
}
if sr.IsNil() {
return 0, nil
}
return strconv.ParseInt(*sr.val, 10, 64)
}
func newScalarResult(resp *api.ExecuteCommandResponse) ScalarResult {
res := ScalarResult{}
switch resp.GetReply() {
case api.NilCommandReply:
case api.ErrCommandReply:
res.err = errors.New(resp.Item)
case api.StringCommandReply, api.IntCommandReply, api.RawStringCommandReply:
res.val = &resp.Item
default:
res.err = fmt.Errorf("unexpected reply: %v", resp.GetReply())
}
return res
}
//StatusResult is used when a command can respond only with success or with error.
type StatusResult struct {
err error
}
//Err returns an error.
func (sr StatusResult) Err() error {
return sr.err
}
func newStatusResult(resp *api.ExecuteCommandResponse) StatusResult {
res := StatusResult{}
switch resp.GetReply() {
case api.OkCommandReply:
case api.ErrCommandReply:
res.err = errors.New(resp.Item)
default:
res.err = fmt.Errorf("unexpected reply: %v", resp.GetReply())
}
return res
}
//ListResult is used when command respond with slice.
type ListResult struct {
val []string
err error
}
//Err returns an error.
func (lr ListResult) Err() error {
return lr.err
}
//IsNil returns true if the underlaying value and error is empty.
func (lr ListResult) IsNil() bool {
return lr.err == nil && lr.val == nil
}
//Val returns the underlying slice if no error. Otherwise, the error will be returned.
func (lr ListResult) Val() ([]string, error) {
if err := lr.Err(); err != nil {
return nil, err
}
return lr.val, nil
}
func newListResult(resp *api.ExecuteCommandResponse) ListResult {
res := ListResult{}
switch resp.GetReply() {
case api.NilCommandReply:
case api.SliceCommandReply:
res.val = resp.GetItems()
case api.ErrCommandReply:
res.err = errors.New(resp.GetItem())
default:
res.err = fmt.Errorf("unexpected reply: %v", resp.GetReply())
}
return res
}
================================================
FILE: client/result_test.go
================================================
package client
import (
"errors"
"strconv"
"testing"
"github.com/stretchr/testify/assert"
)
func TestScalarResult_Err(t *testing.T) {
res := ScalarResult{err: errors.New("error")}
assert.Equal(t, errors.New("error"), res.Err())
}
func TestScalarResult_IsNil(t *testing.T) {
tests := []struct {
name string
result ScalarResult
want bool
}{
{"value_nil_and_err_nil", ScalarResult{}, true},
{"value_nil_and_err_not_nil", ScalarResult{err: errors.New("error")}, false},
{"value_not_nil_and_err_not_nil", ScalarResult{val: stringToPtr("vale"), err: errors.New("error")}, false},
{"value_not_nil_and_err_nil", ScalarResult{val: stringToPtr("vale")}, false},
}
for _, tt := range tests {
assert.Equal(t, tt.want, tt.result.IsNil())
}
}
func TestScalarResult_Val(t *testing.T) {
tests := []struct {
name string
result ScalarResult
wantVal string
wantErr error
}{
{"val_nil_and_err_not_nil", ScalarResult{err: errors.New("error")}, "", errors.New("error")},
{"val_nil_and_err_nil", ScalarResult{}, "", nil},
{"val_not_nil_and_err_nil", ScalarResult{val: stringToPtr("val")}, "val", nil},
}
for _, tt := range tests {
val, err := tt.result.Val()
assert.Equal(t, tt.wantVal, val)
assert.Equal(t, tt.wantErr, err)
}
}
func TestScalarResult_Int64(t *testing.T) {
tests := []struct {
name string
result ScalarResult
wantVal int64
wantErr error
}{
{"val_nil_and_err_not_nil", ScalarResult{err: errors.New("error")}, 0, errors.New("error")},
{"val_nil_and_err_nil", ScalarResult{}, 0, nil},
{"val_not_nil_and_err_nil", ScalarResult{val: stringToPtr("10")}, 10, nil},
{"val_is_not_int64", ScalarResult{val: stringToPtr("string")}, 0, &strconv.NumError{
Func: "ParseInt",
Num: "string",
Err: strconv.ErrSyntax,
}},
}
for _, tt := range tests {
ival, err := tt.result.Int64()
assert.Equal(t, tt.wantVal, ival)
assert.Equal(t, tt.wantErr, err)
}
}
func TestStatusResult_Err(t *testing.T) {
res := StatusResult{err: errors.New("error")}
assert.Equal(t, errors.New("error"), res.Err())
}
func TestListResult_Err(t *testing.T) {
res := ListResult{err: errors.New("error")}
assert.Equal(t, errors.New("error"), res.Err())
}
func TestListResult_IsNil(t *testing.T) {
tests := []struct {
name string
result ListResult
want bool
}{
{"value_nil_and_err_nil", ListResult{}, true},
{"value_nil_and_err_not_nil", ListResult{err: errors.New("error")}, false},
{"value_not_nil_and_err_not_nil", ListResult{val: []string{"val"}, err: errors.New("error")}, false},
{"value_not_nil_and_err_nil", ListResult{val: []string{"val"}}, false},
}
for _, tt := range tests {
assert.Equal(t, tt.want, tt.result.IsNil())
}
}
func TestListResult_Val(t *testing.T) {
tests := []struct {
name string
result ListResult
wantVal []string
wantErr error
}{
{"val_nil_and_err_not_nil", ListResult{err: errors.New("error")}, nil, errors.New("error")},
{"val_nil_and_err_nil", ListResult{}, nil, nil},
{"val_not_nil_and_err_nil", ListResult{val: []string{"val"}}, []string{"val"}, nil},
}
for _, tt := range tests {
val, err := tt.result.Val()
assert.Equal(t, tt.wantVal, val)
assert.Equal(t, tt.wantErr, err)
}
}
================================================
FILE: cmd/godown-cli/Dockerfile
================================================
FROM scratch
COPY godown-cli /
ENTRYPOINT ["/godown-cli"]
CMD ["-h"]
================================================
FILE: cmd/godown-cli/main.go
================================================
package main
import (
"flag"
"fmt"
"net"
"os"
"github.com/namreg/godown/internal/cli"
)
//Values populated by the Go linker.
var (
version = "unknown"
commit = "unknown"
date = "unknown"
)
var host = flag.String("host", "127.0.0.1", "Host to connect to a server")
var port = flag.String("port", "4000", "Port to connect to a server")
var showVersion = flag.Bool("version", false, "Show godown version.")
func main() {
flag.Parse()
if *showVersion {
fmt.Printf("version: %s\ncommit: %s\nbuildtime: %s", version, commit, date)
os.Exit(0)
}
hostPort := net.JoinHostPort(*host, *port)
if err := cli.Run(hostPort); err != nil {
fmt.Fprintf(os.Stderr, "could not run CLI: %v", err)
}
}
================================================
FILE: cmd/godown-server/Dockerfile
================================================
FROM scratch
COPY godown-server /
ENTRYPOINT ["/godown-server"]
CMD ["-h"]
================================================
FILE: cmd/godown-server/main.go
================================================
package main
import (
"flag"
"fmt"
"os"
"github.com/namreg/godown/internal/clock"
"github.com/namreg/godown/internal/command"
"github.com/namreg/godown/internal/server"
"github.com/namreg/godown/internal/storage/memory"
)
//Values populated by the Go linker.
var (
version = "unknown"
commit = "unknown"
date = "unknown"
)
func main() {
id := flag.String("id", "", "Server unique id.")
dir := flag.String("dir", "", "Directory where data is stored.")
listenAddr := flag.String("listen", "", "Server address to listen.")
raftAddr := flag.String("raft", "", "Raft protocol listen address.")
respAddr := flag.String("resp", "", "Redis Serialization Protocol listen address.")
joinAddr := flag.String("join", "", "Server address to join.")
gcInterval := flag.Duration("gc", 0, "Garbage collector interval.")
showVersion := flag.Bool("version", false, "Show version.")
flag.Parse()
if *showVersion {
fmt.Printf("version: %s\ncommit: %s\nbuildtime: %s", version, commit, date)
os.Exit(0)
}
opts := server.DefaultOptions()
opts.ID = *id
opts.RESPAddr = *respAddr
if *listenAddr != "" {
opts.ListenAddr = *listenAddr
}
if *raftAddr != "" {
opts.RaftAddr = *raftAddr
}
if *dir != "" {
opts.Dir = *dir
}
if *gcInterval != 0 {
opts.GCInterval = *gcInterval
}
clck := clock.New()
strg := memory.New(nil)
parser := command.NewParser(strg, clck)
srv := server.New(strg, strg, parser, opts)
var err error
if *joinAddr != "" {
err = srv.JoinCluster(*joinAddr)
} else {
err = srv.BootstrapCluster()
}
if err != nil {
fmt.Printf("%s\n", err.Error())
os.Exit(1)
}
}
================================================
FILE: internal/api/Makefile
================================================
PWD?=$(shell pwd)
gen:
@docker run --rm -v ${PWD}:${PWD} -w ${PWD} znly/protoc --gogofast_out=plugins=grpc:. -I. api.proto
================================================
FILE: internal/api/api.pb.go
================================================
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api.proto
/*
Package api is a generated protocol buffer package.
It is generated from these files:
api.proto
It has these top-level messages:
FSMCommand
UpdateMetadataRequest
UpdateMetadataResponse
ExecuteCommandRequest
ExecuteCommandResponse
AddToClusterRequest
AddToClusterResponse
*/
package api
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import github_com_centrifugal_centrifugo_libcentrifugo_raw "github.com/centrifugal/centrifugo/libcentrifugo/raw"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type FSMCommandType int32
const (
FSMApplyCommand FSMCommandType = 0
FSMApplyMetadata FSMCommandType = 1
)
var FSMCommandType_name = map[int32]string{
0: "APPLY_COMMAND",
1: "APPLY_METADATA",
}
var FSMCommandType_value = map[string]int32{
"APPLY_COMMAND": 0,
"APPLY_METADATA": 1,
}
func (x FSMCommandType) String() string {
return proto.EnumName(FSMCommandType_name, int32(x))
}
func (FSMCommandType) EnumDescriptor() ([]byte, []int) { return fileDescriptorApi, []int{0} }
// CommandExecutionReply describes all available replies.
type CommandExecutionReply int32
const (
NilCommandReply CommandExecutionReply = 0
OkCommandReply CommandExecutionReply = 1
RawStringCommandReply CommandExecutionReply = 2
StringCommandReply CommandExecutionReply = 3
IntCommandReply CommandExecutionReply = 4
SliceCommandReply CommandExecutionReply = 5
ErrCommandReply CommandExecutionReply = 6
)
var CommandExecutionReply_name = map[int32]string{
0: "NIL",
1: "OK",
2: "RAW_STRING",
3: "STRING",
4: "INT",
5: "SLICE",
6: "ERR",
}
var CommandExecutionReply_value = map[string]int32{
"NIL": 0,
"OK": 1,
"RAW_STRING": 2,
"STRING": 3,
"INT": 4,
"SLICE": 5,
"ERR": 6,
}
func (x CommandExecutionReply) String() string {
return proto.EnumName(CommandExecutionReply_name, int32(x))
}
func (CommandExecutionReply) EnumDescriptor() ([]byte, []int) { return fileDescriptorApi, []int{1} }
type FSMCommand struct {
Type FSMCommandType `protobuf:"varint,1,opt,name=type,proto3,enum=FSMCommandType" json:"type,omitempty"`
Command github_com_centrifugal_centrifugo_libcentrifugo_raw.Raw `protobuf:"bytes,2,opt,name=command,proto3,customtype=github.com/centrifugal/centrifugo/libcentrifugo/raw.Raw" json:"command"`
}
func (m *FSMCommand) Reset() { *m = FSMCommand{} }
func (m *FSMCommand) String() string { return proto.CompactTextString(m) }
func (*FSMCommand) ProtoMessage() {}
func (*FSMCommand) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{0} }
func (m *FSMCommand) GetType() FSMCommandType {
if m != nil {
return m.Type
}
return FSMApplyCommand
}
// UpdateMetadataRequest is used to update meta info in the raft FSM.
type UpdateMetadataRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *UpdateMetadataRequest) Reset() { *m = UpdateMetadataRequest{} }
func (m *UpdateMetadataRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateMetadataRequest) ProtoMessage() {}
func (*UpdateMetadataRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{1} }
func (m *UpdateMetadataRequest) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *UpdateMetadataRequest) GetValue() string {
if m != nil {
return m.Value
}
return ""
}
// UpdateMetadataResponse is a response on the UpdateMetadataRequest.
type UpdateMetadataResponse struct {
}
func (m *UpdateMetadataResponse) Reset() { *m = UpdateMetadataResponse{} }
func (m *UpdateMetadataResponse) String() string { return proto.CompactTextString(m) }
func (*UpdateMetadataResponse) ProtoMessage() {}
func (*UpdateMetadataResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{2} }
// ExecuteCommandRequest is a request to execute a command.
type ExecuteCommandRequest struct {
Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
}
func (m *ExecuteCommandRequest) Reset() { *m = ExecuteCommandRequest{} }
func (m *ExecuteCommandRequest) String() string { return proto.CompactTextString(m) }
func (*ExecuteCommandRequest) ProtoMessage() {}
func (*ExecuteCommandRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{3} }
func (m *ExecuteCommandRequest) GetCommand() string {
if m != nil {
return m.Command
}
return ""
}
// ExecuteCommandResponse is a response on the ExecuteCommandRequest.
type ExecuteCommandResponse struct {
Reply CommandExecutionReply `protobuf:"varint,1,opt,name=reply,proto3,enum=CommandExecutionReply" json:"reply,omitempty"`
Item string `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"`
Items []string `protobuf:"bytes,3,rep,name=items" json:"items,omitempty"`
}
func (m *ExecuteCommandResponse) Reset() { *m = ExecuteCommandResponse{} }
func (m *ExecuteCommandResponse) String() string { return proto.CompactTextString(m) }
func (*ExecuteCommandResponse) ProtoMessage() {}
func (*ExecuteCommandResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{4} }
func (m *ExecuteCommandResponse) GetReply() CommandExecutionReply {
if m != nil {
return m.Reply
}
return NilCommandReply
}
func (m *ExecuteCommandResponse) GetItem() string {
if m != nil {
return m.Item
}
return ""
}
func (m *ExecuteCommandResponse) GetItems() []string {
if m != nil {
return m.Items
}
return nil
}
// AddToClusterRequest is a request to add a new raft node to the cluster.
type AddToClusterRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
}
func (m *AddToClusterRequest) Reset() { *m = AddToClusterRequest{} }
func (m *AddToClusterRequest) String() string { return proto.CompactTextString(m) }
func (*AddToClusterRequest) ProtoMessage() {}
func (*AddToClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{5} }
func (m *AddToClusterRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *AddToClusterRequest) GetAddr() string {
if m != nil {
return m.Addr
}
return ""
}
// AddToClusterResponse is a reponse on the AddToClusterRequest.
type AddToClusterResponse struct {
}
func (m *AddToClusterResponse) Reset() { *m = AddToClusterResponse{} }
func (m *AddToClusterResponse) String() string { return proto.CompactTextString(m) }
func (*AddToClusterResponse) ProtoMessage() {}
func (*AddToClusterResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{6} }
func init() {
proto.RegisterType((*FSMCommand)(nil), "FSMCommand")
proto.RegisterType((*UpdateMetadataRequest)(nil), "UpdateMetadataRequest")
proto.RegisterType((*UpdateMetadataResponse)(nil), "UpdateMetadataResponse")
proto.RegisterType((*ExecuteCommandRequest)(nil), "ExecuteCommandRequest")
proto.RegisterType((*ExecuteCommandResponse)(nil), "ExecuteCommandResponse")
proto.RegisterType((*AddToClusterRequest)(nil), "AddToClusterRequest")
proto.RegisterType((*AddToClusterResponse)(nil), "AddToClusterResponse")
proto.RegisterEnum("FSMCommandType", FSMCommandType_name, FSMCommandType_value)
proto.RegisterEnum("CommandExecutionReply", CommandExecutionReply_name, CommandExecutionReply_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Godown service
type GodownClient interface {
ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error)
AddToCluster(ctx context.Context, in *AddToClusterRequest, opts ...grpc.CallOption) (*AddToClusterResponse, error)
}
type godownClient struct {
cc *grpc.ClientConn
}
func NewGodownClient(cc *grpc.ClientConn) GodownClient {
return &godownClient{cc}
}
func (c *godownClient) ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) {
out := new(ExecuteCommandResponse)
err := grpc.Invoke(ctx, "/Godown/ExecuteCommand", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *godownClient) AddToCluster(ctx context.Context, in *AddToClusterRequest, opts ...grpc.CallOption) (*AddToClusterResponse, error) {
out := new(AddToClusterResponse)
err := grpc.Invoke(ctx, "/Godown/AddToCluster", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Godown service
type GodownServer interface {
ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error)
AddToCluster(context.Context, *AddToClusterRequest) (*AddToClusterResponse, error)
}
func RegisterGodownServer(s *grpc.Server, srv GodownServer) {
s.RegisterService(&_Godown_serviceDesc, srv)
}
func _Godown_ExecuteCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExecuteCommandRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GodownServer).ExecuteCommand(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Godown/ExecuteCommand",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GodownServer).ExecuteCommand(ctx, req.(*ExecuteCommandRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Godown_AddToCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddToClusterRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GodownServer).AddToCluster(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Godown/AddToCluster",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GodownServer).AddToCluster(ctx, req.(*AddToClusterRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Godown_serviceDesc = grpc.ServiceDesc{
ServiceName: "Godown",
HandlerType: (*GodownServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ExecuteCommand",
Handler: _Godown_ExecuteCommand_Handler,
},
{
MethodName: "AddToCluster",
Handler: _Godown_AddToCluster_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}
func (m *FSMCommand) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *FSMCommand) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Type != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintApi(dAtA, i, uint64(m.Type))
}
dAtA[i] = 0x12
i++
i = encodeVarintApi(dAtA, i, uint64(m.Command.Size()))
n1, err := m.Command.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
return i, nil
}
func (m *UpdateMetadataRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *UpdateMetadataRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Key) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key)
}
if len(m.Value) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Value)))
i += copy(dAtA[i:], m.Value)
}
return i, nil
}
func (m *UpdateMetadataResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *UpdateMetadataResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func (m *ExecuteCommandRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ExecuteCommandRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Command) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Command)))
i += copy(dAtA[i:], m.Command)
}
return i, nil
}
func (m *ExecuteCommandResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ExecuteCommandResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Reply != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintApi(dAtA, i, uint64(m.Reply))
}
if len(m.Item) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Item)))
i += copy(dAtA[i:], m.Item)
}
if len(m.Items) > 0 {
for _, s := range m.Items {
dAtA[i] = 0x1a
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
return i, nil
}
func (m *AddToClusterRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AddToClusterRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Id) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Id)))
i += copy(dAtA[i:], m.Id)
}
if len(m.Addr) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.Addr)))
i += copy(dAtA[i:], m.Addr)
}
return i, nil
}
func (m *AddToClusterResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AddToClusterResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func encodeFixed64Api(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Api(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *FSMCommand) Size() (n int) {
var l int
_ = l
if m.Type != 0 {
n += 1 + sovApi(uint64(m.Type))
}
l = m.Command.Size()
n += 1 + l + sovApi(uint64(l))
return n
}
func (m *UpdateMetadataRequest) Size() (n int) {
var l int
_ = l
l = len(m.Key)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
l = len(m.Value)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
return n
}
func (m *UpdateMetadataResponse) Size() (n int) {
var l int
_ = l
return n
}
func (m *ExecuteCommandRequest) Size() (n int) {
var l int
_ = l
l = len(m.Command)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
return n
}
func (m *ExecuteCommandResponse) Size() (n int) {
var l int
_ = l
if m.Reply != 0 {
n += 1 + sovApi(uint64(m.Reply))
}
l = len(m.Item)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
if len(m.Items) > 0 {
for _, s := range m.Items {
l = len(s)
n += 1 + l + sovApi(uint64(l))
}
}
return n
}
func (m *AddToClusterRequest) Size() (n int) {
var l int
_ = l
l = len(m.Id)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
l = len(m.Addr)
if l > 0 {
n += 1 + l + sovApi(uint64(l))
}
return n
}
func (m *AddToClusterResponse) Size() (n int) {
var l int
_ = l
return n
}
func sovApi(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozApi(x uint64) (n int) {
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *FSMCommand) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: FSMCommand: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: FSMCommand: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
m.Type = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= (FSMCommandType(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + byteLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Command.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *UpdateMetadataRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: UpdateMetadataRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: UpdateMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Key = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Value = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *UpdateMetadataResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: UpdateMetadataResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: UpdateMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ExecuteCommandRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExecuteCommandRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExecuteCommandRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Command = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ExecuteCommandResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExecuteCommandResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExecuteCommandResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Reply", wireType)
}
m.Reply = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Reply |= (CommandExecutionReply(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Item", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Item = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Items = append(m.Items, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AddToClusterRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: AddToClusterRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AddToClusterRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Id = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthApi
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Addr = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipApi(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthApi
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AddToClusterResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApi
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: AddToClusterResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AddToClusterResponse: illegal tag %d (wire type %d)", fieldNum, wir
gitextract_pxkin0nb/
├── .gitignore
├── .golang.ci.yaml
├── .goreleaser.yml
├── .travis.yml
├── Gopkg.toml
├── LICENSE
├── Makefile
├── README.md
├── client/
│ ├── client.go
│ ├── client_del_test.go
│ ├── client_expire_test.go
│ ├── client_get_test.go
│ ├── client_getbit_test.go
│ ├── client_hdel_test.go
│ ├── client_hget_test.go
│ ├── client_hkeys_test.go
│ ├── client_hset_test.go
│ ├── client_hvals_test.go
│ ├── client_keys_test.go
│ ├── client_lindex_test.go
│ ├── client_llen_test.go
│ ├── client_lpop_test.go
│ ├── client_lpush_test.go
│ ├── client_lrange_test.go
│ ├── client_lrem_test.go
│ ├── client_ping_test.go
│ ├── client_rpop_test.go
│ ├── client_rpush_test.go
│ ├── client_set_test.go
│ ├── client_setbit_test.go
│ ├── client_strlen_test.go
│ ├── client_ttl_test.go
│ ├── client_type_test.go
│ ├── executor_mock_test.go
│ ├── helpers_test.go
│ ├── result.go
│ └── result_test.go
├── cmd/
│ ├── godown-cli/
│ │ ├── Dockerfile
│ │ └── main.go
│ └── godown-server/
│ ├── Dockerfile
│ └── main.go
├── internal/
│ ├── api/
│ │ ├── Makefile
│ │ ├── api.pb.go
│ │ └── api.proto
│ ├── cli/
│ │ ├── cli.go
│ │ └── printer.go
│ ├── clock/
│ │ └── clock.go
│ ├── command/
│ │ ├── command.go
│ │ ├── command_clock_mock_test.go
│ │ ├── command_mock_test.go
│ │ ├── command_parser_mock_test.go
│ │ ├── command_test.go
│ │ ├── data_store_mock_test.go
│ │ ├── del.go
│ │ ├── del_test.go
│ │ ├── expire.go
│ │ ├── expire_test.go
│ │ ├── get.go
│ │ ├── get_test.go
│ │ ├── getbit.go
│ │ ├── getbit_test.go
│ │ ├── hdel.go
│ │ ├── hdel_test.go
│ │ ├── help.go
│ │ ├── help_test.go
│ │ ├── hget.go
│ │ ├── hget_test.go
│ │ ├── hkeys.go
│ │ ├── hkeys_test.go
│ │ ├── hset.go
│ │ ├── hset_test.go
│ │ ├── hvals.go
│ │ ├── hvals_test.go
│ │ ├── keys.go
│ │ ├── keys_test.go
│ │ ├── lindex.go
│ │ ├── lindex_test.go
│ │ ├── llen.go
│ │ ├── llen_test.go
│ │ ├── lpop.go
│ │ ├── lpop_test.go
│ │ ├── lpush.go
│ │ ├── lpush_test.go
│ │ ├── lrange.go
│ │ ├── lrange_test.go
│ │ ├── lrem.go
│ │ ├── lrem_test.go
│ │ ├── parser.go
│ │ ├── ping.go
│ │ ├── ping_test.go
│ │ ├── reply.go
│ │ ├── reply_test.go
│ │ ├── rpop.go
│ │ ├── rpop_test.go
│ │ ├── rpush.go
│ │ ├── rpush_test.go
│ │ ├── set.go
│ │ ├── set_test.go
│ │ ├── setbit.go
│ │ ├── setbit_test.go
│ │ ├── strlen.go
│ │ ├── strlen_test.go
│ │ ├── ttl.go
│ │ ├── ttl_test.go
│ │ ├── type.go
│ │ └── type_test.go
│ ├── server/
│ │ ├── data_store_mock_test.go
│ │ ├── fsm.go
│ │ ├── fsm_snapshot.go
│ │ ├── gc.go
│ │ ├── resp/
│ │ │ └── resp.go
│ │ ├── server.go
│ │ └── server_clock_mock_test.go
│ └── storage/
│ ├── marshaler.go
│ ├── marshaler_test.go
│ ├── memory/
│ │ ├── memory.go
│ │ └── memory_test.go
│ ├── storage.go
│ └── storage_test.go
└── vendor/
├── github.com/
│ ├── Bowery/
│ │ └── prompt/
│ │ ├── CONTRIBUTORS.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── ansi_unix.go
│ │ ├── ansi_windows.go
│ │ ├── buffer.go
│ │ ├── buffer_unix.go
│ │ ├── buffer_windows.go
│ │ ├── ioctl_bsd.go
│ │ ├── ioctl_linux.go
│ │ ├── ioctl_solaris.go
│ │ ├── ioctl_unix.go
│ │ ├── keys.go
│ │ ├── keys_unix.go
│ │ ├── keys_windows.go
│ │ ├── prompt.go
│ │ ├── term.go
│ │ ├── term_unix.go
│ │ └── term_windows.go
│ ├── armon/
│ │ └── go-metrics/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── const_unix.go
│ │ ├── const_windows.go
│ │ ├── inmem.go
│ │ ├── inmem_endpoint.go
│ │ ├── inmem_signal.go
│ │ ├── metrics.go
│ │ ├── sink.go
│ │ ├── start.go
│ │ ├── statsd.go
│ │ └── statsite.go
│ ├── boltdb/
│ │ └── bolt/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── bolt_386.go
│ │ ├── bolt_amd64.go
│ │ ├── bolt_arm.go
│ │ ├── bolt_arm64.go
│ │ ├── bolt_linux.go
│ │ ├── bolt_openbsd.go
│ │ ├── bolt_ppc.go
│ │ ├── bolt_ppc64.go
│ │ ├── bolt_ppc64le.go
│ │ ├── bolt_s390x.go
│ │ ├── bolt_unix.go
│ │ ├── bolt_unix_solaris.go
│ │ ├── bolt_windows.go
│ │ ├── boltsync_unix.go
│ │ ├── bucket.go
│ │ ├── cursor.go
│ │ ├── db.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── freelist.go
│ │ ├── node.go
│ │ ├── page.go
│ │ └── tx.go
│ ├── centrifugal/
│ │ └── centrifugo/
│ │ ├── LICENSE
│ │ └── libcentrifugo/
│ │ └── raw/
│ │ └── raw.go
│ ├── davecgh/
│ │ └── go-spew/
│ │ ├── LICENSE
│ │ └── spew/
│ │ ├── bypass.go
│ │ ├── bypasssafe.go
│ │ ├── common.go
│ │ ├── config.go
│ │ ├── doc.go
│ │ ├── dump.go
│ │ ├── format.go
│ │ └── spew.go
│ ├── fatih/
│ │ └── color/
│ │ ├── .travis.yml
│ │ ├── Gopkg.toml
│ │ ├── LICENSE.md
│ │ ├── README.md
│ │ ├── color.go
│ │ └── doc.go
│ ├── gogo/
│ │ └── protobuf/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── GOLANG_CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── gogoproto/
│ │ │ ├── Makefile
│ │ │ ├── doc.go
│ │ │ ├── gogo.pb.go
│ │ │ ├── gogo.pb.golden
│ │ │ ├── gogo.proto
│ │ │ └── helper.go
│ │ ├── proto/
│ │ │ ├── Makefile
│ │ │ ├── clone.go
│ │ │ ├── custom_gogo.go
│ │ │ ├── decode.go
│ │ │ ├── discard.go
│ │ │ ├── duration.go
│ │ │ ├── duration_gogo.go
│ │ │ ├── encode.go
│ │ │ ├── encode_gogo.go
│ │ │ ├── equal.go
│ │ │ ├── extensions.go
│ │ │ ├── extensions_gogo.go
│ │ │ ├── lib.go
│ │ │ ├── lib_gogo.go
│ │ │ ├── message_set.go
│ │ │ ├── pointer_reflect.go
│ │ │ ├── pointer_reflect_gogo.go
│ │ │ ├── pointer_unsafe.go
│ │ │ ├── pointer_unsafe_gogo.go
│ │ │ ├── properties.go
│ │ │ ├── properties_gogo.go
│ │ │ ├── skip_gogo.go
│ │ │ ├── table_marshal.go
│ │ │ ├── table_marshal_gogo.go
│ │ │ ├── table_merge.go
│ │ │ ├── table_unmarshal.go
│ │ │ ├── table_unmarshal_gogo.go
│ │ │ ├── text.go
│ │ │ ├── text_gogo.go
│ │ │ ├── text_parser.go
│ │ │ ├── timestamp.go
│ │ │ └── timestamp_gogo.go
│ │ └── protoc-gen-gogo/
│ │ └── descriptor/
│ │ ├── Makefile
│ │ ├── descriptor.go
│ │ ├── descriptor.pb.go
│ │ ├── descriptor_gostring.gen.go
│ │ └── helper.go
│ ├── gojuno/
│ │ └── minimock/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── camel_to_snake.go
│ │ ├── doc.go
│ │ └── mock_controller.go
│ ├── golang/
│ │ └── protobuf/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── proto/
│ │ │ ├── clone.go
│ │ │ ├── decode.go
│ │ │ ├── discard.go
│ │ │ ├── encode.go
│ │ │ ├── equal.go
│ │ │ ├── extensions.go
│ │ │ ├── lib.go
│ │ │ ├── message_set.go
│ │ │ ├── pointer_reflect.go
│ │ │ ├── pointer_unsafe.go
│ │ │ ├── properties.go
│ │ │ ├── table_marshal.go
│ │ │ ├── table_merge.go
│ │ │ ├── table_unmarshal.go
│ │ │ ├── text.go
│ │ │ └── text_parser.go
│ │ └── ptypes/
│ │ ├── any/
│ │ │ ├── any.pb.go
│ │ │ └── any.proto
│ │ ├── any.go
│ │ ├── doc.go
│ │ ├── duration/
│ │ │ ├── duration.pb.go
│ │ │ └── duration.proto
│ │ ├── duration.go
│ │ ├── timestamp/
│ │ │ ├── timestamp.pb.go
│ │ │ └── timestamp.proto
│ │ └── timestamp.go
│ ├── hashicorp/
│ │ ├── errwrap/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── errwrap.go
│ │ │ └── go.mod
│ │ ├── go-immutable-radix/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── edges.go
│ │ │ ├── iradix.go
│ │ │ ├── iter.go
│ │ │ ├── node.go
│ │ │ └── raw_iter.go
│ │ ├── go-msgpack/
│ │ │ ├── LICENSE
│ │ │ └── codec/
│ │ │ ├── 0doc.go
│ │ │ ├── README.md
│ │ │ ├── binc.go
│ │ │ ├── decode.go
│ │ │ ├── encode.go
│ │ │ ├── helper.go
│ │ │ ├── helper_internal.go
│ │ │ ├── msgpack.go
│ │ │ ├── msgpack_test.py
│ │ │ ├── rpc.go
│ │ │ ├── simple.go
│ │ │ └── time.go
│ │ ├── go-multierror/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── append.go
│ │ │ ├── flatten.go
│ │ │ ├── format.go
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── multierror.go
│ │ │ ├── prefix.go
│ │ │ └── sort.go
│ │ ├── golang-lru/
│ │ │ ├── LICENSE
│ │ │ └── simplelru/
│ │ │ ├── lru.go
│ │ │ └── lru_interface.go
│ │ ├── raft/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── api.go
│ │ │ ├── commands.go
│ │ │ ├── commitment.go
│ │ │ ├── config.go
│ │ │ ├── configuration.go
│ │ │ ├── discard_snapshot.go
│ │ │ ├── file_snapshot.go
│ │ │ ├── fsm.go
│ │ │ ├── future.go
│ │ │ ├── inmem_snapshot.go
│ │ │ ├── inmem_store.go
│ │ │ ├── inmem_transport.go
│ │ │ ├── log.go
│ │ │ ├── log_cache.go
│ │ │ ├── membership.md
│ │ │ ├── net_transport.go
│ │ │ ├── observer.go
│ │ │ ├── peersjson.go
│ │ │ ├── raft.go
│ │ │ ├── replication.go
│ │ │ ├── snapshot.go
│ │ │ ├── stable.go
│ │ │ ├── state.go
│ │ │ ├── tag.sh
│ │ │ ├── tcp_transport.go
│ │ │ ├── transport.go
│ │ │ └── util.go
│ │ └── raft-boltdb/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── bolt_store.go
│ │ └── util.go
│ ├── mattn/
│ │ ├── go-colorable/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── colorable_appengine.go
│ │ │ ├── colorable_others.go
│ │ │ ├── colorable_windows.go
│ │ │ └── noncolorable.go
│ │ └── go-isatty/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── isatty_appengine.go
│ │ ├── isatty_bsd.go
│ │ ├── isatty_linux.go
│ │ ├── isatty_linux_ppc64x.go
│ │ ├── isatty_others.go
│ │ ├── isatty_solaris.go
│ │ └── isatty_windows.go
│ ├── pkg/
│ │ └── errors/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── errors.go
│ │ └── stack.go
│ ├── pmezard/
│ │ └── go-difflib/
│ │ ├── LICENSE
│ │ └── difflib/
│ │ └── difflib.go
│ ├── stretchr/
│ │ └── testify/
│ │ ├── LICENSE
│ │ └── assert/
│ │ ├── assertion_format.go
│ │ ├── assertion_format.go.tmpl
│ │ ├── assertion_forward.go
│ │ ├── assertion_forward.go.tmpl
│ │ ├── assertions.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── forward_assertions.go
│ │ └── http_assertions.go
│ └── tidwall/
│ └── redcon/
│ ├── .travis.yml
│ ├── LICENSE
│ ├── README.md
│ ├── append.go
│ └── redcon.go
├── golang.org/
│ └── x/
│ ├── net/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── context/
│ │ │ ├── context.go
│ │ │ ├── go17.go
│ │ │ ├── go19.go
│ │ │ ├── pre_go17.go
│ │ │ └── pre_go19.go
│ │ ├── http/
│ │ │ └── httpguts/
│ │ │ ├── guts.go
│ │ │ └── httplex.go
│ │ ├── http2/
│ │ │ ├── .gitignore
│ │ │ ├── Dockerfile
│ │ │ ├── Makefile
│ │ │ ├── README
│ │ │ ├── ciphers.go
│ │ │ ├── client_conn_pool.go
│ │ │ ├── configure_transport.go
│ │ │ ├── databuffer.go
│ │ │ ├── errors.go
│ │ │ ├── flow.go
│ │ │ ├── frame.go
│ │ │ ├── go111.go
│ │ │ ├── go16.go
│ │ │ ├── go17.go
│ │ │ ├── go17_not18.go
│ │ │ ├── go18.go
│ │ │ ├── go19.go
│ │ │ ├── gotrack.go
│ │ │ ├── headermap.go
│ │ │ ├── hpack/
│ │ │ │ ├── encode.go
│ │ │ │ ├── hpack.go
│ │ │ │ ├── huffman.go
│ │ │ │ └── tables.go
│ │ │ ├── http2.go
│ │ │ ├── not_go111.go
│ │ │ ├── not_go16.go
│ │ │ ├── not_go17.go
│ │ │ ├── not_go18.go
│ │ │ ├── not_go19.go
│ │ │ ├── pipe.go
│ │ │ ├── server.go
│ │ │ ├── transport.go
│ │ │ ├── write.go
│ │ │ ├── writesched.go
│ │ │ ├── writesched_priority.go
│ │ │ └── writesched_random.go
│ │ ├── idna/
│ │ │ ├── idna.go
│ │ │ ├── punycode.go
│ │ │ ├── tables.go
│ │ │ ├── trie.go
│ │ │ └── trieval.go
│ │ ├── internal/
│ │ │ └── timeseries/
│ │ │ └── timeseries.go
│ │ └── trace/
│ │ ├── events.go
│ │ ├── histogram.go
│ │ ├── trace.go
│ │ ├── trace_go16.go
│ │ └── trace_go17.go
│ ├── sys/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ └── unix/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── affinity_linux.go
│ │ ├── aliases.go
│ │ ├── asm_darwin_386.s
│ │ ├── asm_darwin_amd64.s
│ │ ├── asm_darwin_arm.s
│ │ ├── asm_darwin_arm64.s
│ │ ├── asm_dragonfly_amd64.s
│ │ ├── asm_freebsd_386.s
│ │ ├── asm_freebsd_amd64.s
│ │ ├── asm_freebsd_arm.s
│ │ ├── asm_linux_386.s
│ │ ├── asm_linux_amd64.s
│ │ ├── asm_linux_arm.s
│ │ ├── asm_linux_arm64.s
│ │ ├── asm_linux_mips64x.s
│ │ ├── asm_linux_mipsx.s
│ │ ├── asm_linux_ppc64x.s
│ │ ├── asm_linux_s390x.s
│ │ ├── asm_netbsd_386.s
│ │ ├── asm_netbsd_amd64.s
│ │ ├── asm_netbsd_arm.s
│ │ ├── asm_openbsd_386.s
│ │ ├── asm_openbsd_amd64.s
│ │ ├── asm_openbsd_arm.s
│ │ ├── asm_solaris_amd64.s
│ │ ├── bluetooth_linux.go
│ │ ├── cap_freebsd.go
│ │ ├── constants.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_linux_32bit.go
│ │ ├── gccgo.go
│ │ ├── gccgo_c.c
│ │ ├── gccgo_linux_amd64.go
│ │ ├── ioctl.go
│ │ ├── mkall.sh
│ │ ├── mkerrors.sh
│ │ ├── mkpost.go
│ │ ├── mksyscall.pl
│ │ ├── mksyscall_solaris.pl
│ │ ├── mksysctl_openbsd.pl
│ │ ├── mksysnum_darwin.pl
│ │ ├── mksysnum_dragonfly.pl
│ │ ├── mksysnum_freebsd.pl
│ │ ├── mksysnum_netbsd.pl
│ │ ├── mksysnum_openbsd.pl
│ │ ├── openbsd_pledge.go
│ │ ├── pagesize_unix.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── sockcmsg_linux.go
│ │ ├── sockcmsg_unix.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_bsd.go
│ │ ├── syscall_darwin.go
│ │ ├── syscall_darwin_386.go
│ │ ├── syscall_darwin_amd64.go
│ │ ├── syscall_darwin_arm.go
│ │ ├── syscall_darwin_arm64.go
│ │ ├── syscall_dragonfly.go
│ │ ├── syscall_dragonfly_amd64.go
│ │ ├── syscall_freebsd.go
│ │ ├── syscall_freebsd_386.go
│ │ ├── syscall_freebsd_amd64.go
│ │ ├── syscall_freebsd_arm.go
│ │ ├── syscall_linux.go
│ │ ├── syscall_linux_386.go
│ │ ├── syscall_linux_amd64.go
│ │ ├── syscall_linux_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_s390x.go
│ │ ├── syscall_linux_sparc64.go
│ │ ├── syscall_netbsd.go
│ │ ├── syscall_netbsd_386.go
│ │ ├── syscall_netbsd_amd64.go
│ │ ├── syscall_netbsd_arm.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
│ │ ├── timestruct.go
│ │ ├── types_darwin.go
│ │ ├── types_dragonfly.go
│ │ ├── types_freebsd.go
│ │ ├── types_netbsd.go
│ │ ├── types_openbsd.go
│ │ ├── types_solaris.go
│ │ ├── xattr_bsd.go
│ │ ├── zerrors_darwin_386.go
│ │ ├── zerrors_darwin_amd64.go
│ │ ├── zerrors_darwin_arm.go
│ │ ├── zerrors_darwin_arm64.go
│ │ ├── zerrors_dragonfly_amd64.go
│ │ ├── zerrors_freebsd_386.go
│ │ ├── zerrors_freebsd_amd64.go
│ │ ├── zerrors_freebsd_arm.go
│ │ ├── zerrors_linux_386.go
│ │ ├── zerrors_linux_amd64.go
│ │ ├── zerrors_linux_arm.go
│ │ ├── zerrors_linux_arm64.go
│ │ ├── zerrors_linux_mips.go
│ │ ├── zerrors_linux_mips64.go
│ │ ├── zerrors_linux_mips64le.go
│ │ ├── zerrors_linux_mipsle.go
│ │ ├── zerrors_linux_ppc64.go
│ │ ├── zerrors_linux_ppc64le.go
│ │ ├── zerrors_linux_s390x.go
│ │ ├── zerrors_linux_sparc64.go
│ │ ├── zerrors_netbsd_386.go
│ │ ├── zerrors_netbsd_amd64.go
│ │ ├── zerrors_netbsd_arm.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_darwin_386.go
│ │ ├── zsyscall_darwin_amd64.go
│ │ ├── zsyscall_darwin_arm.go
│ │ ├── zsyscall_darwin_arm64.go
│ │ ├── zsyscall_dragonfly_amd64.go
│ │ ├── zsyscall_freebsd_386.go
│ │ ├── zsyscall_freebsd_amd64.go
│ │ ├── zsyscall_freebsd_arm.go
│ │ ├── zsyscall_linux_386.go
│ │ ├── zsyscall_linux_amd64.go
│ │ ├── zsyscall_linux_arm.go
│ │ ├── zsyscall_linux_arm64.go
│ │ ├── zsyscall_linux_mips.go
│ │ ├── zsyscall_linux_mips64.go
│ │ ├── zsyscall_linux_mips64le.go
│ │ ├── zsyscall_linux_mipsle.go
│ │ ├── zsyscall_linux_ppc64.go
│ │ ├── zsyscall_linux_ppc64le.go
│ │ ├── zsyscall_linux_s390x.go
│ │ ├── zsyscall_linux_sparc64.go
│ │ ├── zsyscall_netbsd_386.go
│ │ ├── zsyscall_netbsd_amd64.go
│ │ ├── zsyscall_netbsd_arm.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_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_s390x.go
│ │ ├── zsysnum_linux_sparc64.go
│ │ ├── zsysnum_netbsd_386.go
│ │ ├── zsysnum_netbsd_amd64.go
│ │ ├── zsysnum_netbsd_arm.go
│ │ ├── zsysnum_openbsd_386.go
│ │ ├── zsysnum_openbsd_amd64.go
│ │ ├── zsysnum_openbsd_arm.go
│ │ ├── ztypes_darwin_386.go
│ │ ├── ztypes_darwin_amd64.go
│ │ ├── ztypes_darwin_arm.go
│ │ ├── ztypes_darwin_arm64.go
│ │ ├── ztypes_dragonfly_amd64.go
│ │ ├── ztypes_freebsd_386.go
│ │ ├── ztypes_freebsd_amd64.go
│ │ ├── ztypes_freebsd_arm.go
│ │ ├── ztypes_linux_386.go
│ │ ├── ztypes_linux_amd64.go
│ │ ├── ztypes_linux_arm.go
│ │ ├── ztypes_linux_arm64.go
│ │ ├── ztypes_linux_mips.go
│ │ ├── ztypes_linux_mips64.go
│ │ ├── ztypes_linux_mips64le.go
│ │ ├── ztypes_linux_mipsle.go
│ │ ├── ztypes_linux_ppc64.go
│ │ ├── ztypes_linux_ppc64le.go
│ │ ├── ztypes_linux_s390x.go
│ │ ├── ztypes_linux_sparc64.go
│ │ ├── ztypes_netbsd_386.go
│ │ ├── ztypes_netbsd_amd64.go
│ │ ├── ztypes_netbsd_arm.go
│ │ ├── ztypes_openbsd_386.go
│ │ ├── ztypes_openbsd_amd64.go
│ │ ├── ztypes_openbsd_arm.go
│ │ └── ztypes_solaris_amd64.go
│ └── text/
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── collate/
│ │ ├── collate.go
│ │ ├── index.go
│ │ ├── maketables.go
│ │ ├── option.go
│ │ ├── sort.go
│ │ └── tables.go
│ ├── internal/
│ │ ├── colltab/
│ │ │ ├── collelem.go
│ │ │ ├── colltab.go
│ │ │ ├── contract.go
│ │ │ ├── iter.go
│ │ │ ├── numeric.go
│ │ │ ├── table.go
│ │ │ ├── trie.go
│ │ │ └── weighter.go
│ │ ├── gen/
│ │ │ ├── code.go
│ │ │ └── gen.go
│ │ ├── tag/
│ │ │ └── tag.go
│ │ ├── triegen/
│ │ │ ├── compact.go
│ │ │ ├── print.go
│ │ │ └── triegen.go
│ │ └── ucd/
│ │ └── ucd.go
│ ├── language/
│ │ ├── Makefile
│ │ ├── common.go
│ │ ├── coverage.go
│ │ ├── doc.go
│ │ ├── gen.go
│ │ ├── gen_common.go
│ │ ├── gen_index.go
│ │ ├── go1_1.go
│ │ ├── go1_2.go
│ │ ├── index.go
│ │ ├── language.go
│ │ ├── lookup.go
│ │ ├── match.go
│ │ ├── parse.go
│ │ ├── tables.go
│ │ └── tags.go
│ ├── secure/
│ │ └── bidirule/
│ │ ├── bidirule.go
│ │ ├── bidirule10.0.0.go
│ │ └── bidirule9.0.0.go
│ ├── transform/
│ │ └── transform.go
│ └── unicode/
│ ├── bidi/
│ │ ├── bidi.go
│ │ ├── bracket.go
│ │ ├── core.go
│ │ ├── gen.go
│ │ ├── gen_ranges.go
│ │ ├── gen_trieval.go
│ │ ├── prop.go
│ │ ├── tables10.0.0.go
│ │ ├── tables9.0.0.go
│ │ └── trieval.go
│ ├── cldr/
│ │ ├── base.go
│ │ ├── cldr.go
│ │ ├── collate.go
│ │ ├── decode.go
│ │ ├── makexml.go
│ │ ├── resolve.go
│ │ ├── slice.go
│ │ └── xml.go
│ ├── norm/
│ │ ├── composition.go
│ │ ├── forminfo.go
│ │ ├── input.go
│ │ ├── iter.go
│ │ ├── maketables.go
│ │ ├── normalize.go
│ │ ├── readwriter.go
│ │ ├── tables10.0.0.go
│ │ ├── tables9.0.0.go
│ │ ├── transform.go
│ │ ├── trie.go
│ │ └── triegen.go
│ └── rangetable/
│ ├── gen.go
│ ├── merge.go
│ ├── rangetable.go
│ ├── tables10.0.0.go
│ └── tables9.0.0.go
└── google.golang.org/
├── genproto/
│ ├── LICENSE
│ └── googleapis/
│ └── rpc/
│ └── status/
│ └── status.pb.go
└── grpc/
├── .travis.yml
├── AUTHORS
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── backoff.go
├── balancer/
│ ├── balancer.go
│ ├── base/
│ │ ├── balancer.go
│ │ └── base.go
│ └── roundrobin/
│ └── roundrobin.go
├── balancer.go
├── balancer_conn_wrappers.go
├── balancer_v1_wrapper.go
├── call.go
├── clientconn.go
├── codec.go
├── codegen.sh
├── codes/
│ ├── code_string.go
│ └── codes.go
├── connectivity/
│ └── connectivity.go
├── credentials/
│ ├── credentials.go
│ ├── go16.go
│ ├── go17.go
│ ├── go18.go
│ └── go19.go
├── dialoptions.go
├── doc.go
├── encoding/
│ ├── encoding.go
│ └── proto/
│ └── proto.go
├── go16.go
├── go17.go
├── grpclog/
│ ├── grpclog.go
│ ├── logger.go
│ └── loggerv2.go
├── install_gae.sh
├── interceptor.go
├── internal/
│ ├── backoff/
│ │ └── backoff.go
│ ├── channelz/
│ │ ├── funcs.go
│ │ ├── types.go
│ │ ├── types_linux.go
│ │ ├── types_nonlinux.go
│ │ ├── util_linux_go19.go
│ │ └── util_nonlinux_pre_go19.go
│ ├── envconfig/
│ │ └── envconfig.go
│ ├── grpcrand/
│ │ └── grpcrand.go
│ ├── internal.go
│ └── transport/
│ ├── bdp_estimator.go
│ ├── controlbuf.go
│ ├── defaults.go
│ ├── flowcontrol.go
│ ├── go16.go
│ ├── go17.go
│ ├── handler_server.go
│ ├── http2_client.go
│ ├── http2_server.go
│ ├── http_util.go
│ ├── log.go
│ └── transport.go
├── keepalive/
│ └── keepalive.go
├── metadata/
│ └── metadata.go
├── naming/
│ ├── dns_resolver.go
│ ├── go17.go
│ ├── go18.go
│ └── naming.go
├── peer/
│ └── peer.go
├── picker_wrapper.go
├── pickfirst.go
├── proxy.go
├── resolver/
│ ├── dns/
│ │ ├── dns_resolver.go
│ │ ├── go17.go
│ │ └── go18.go
│ ├── passthrough/
│ │ └── passthrough.go
│ └── resolver.go
├── resolver_conn_wrapper.go
├── rpc_util.go
├── server.go
├── service_config.go
├── stats/
│ ├── handlers.go
│ └── stats.go
├── status/
│ ├── go16.go
│ ├── go17.go
│ └── status.go
├── stream.go
├── tap/
│ └── tap.go
├── trace.go
├── version.go
└── vet.sh
Showing preview only (6,962K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (88179 symbols across 682 files)
FILE: client/client.go
constant connectTimeout (line 16) | connectTimeout = 100 * time.Millisecond
type executor (line 19) | type executor interface
type Client (line 24) | type Client struct
method Close (line 40) | func (c *Client) Close() error {
method tryConnect (line 47) | func (c *Client) tryConnect() error {
method newExecuteRequest (line 68) | func (c *Client) newExecuteRequest(cmd string, args ...string) *api.Ex...
method Get (line 76) | func (c *Client) Get(key string) ScalarResult {
method GetWithContext (line 81) | func (c *Client) GetWithContext(ctx context.Context, key string) Scala...
method get (line 85) | func (c *Client) get(ctx context.Context, key string) ScalarResult {
method Set (line 95) | func (c *Client) Set(key, value string) StatusResult {
method SetWithContext (line 100) | func (c *Client) SetWithContext(ctx context.Context, key, value string...
method set (line 104) | func (c *Client) set(ctx context.Context, key, value string) StatusRes...
method Del (line 114) | func (c *Client) Del(key string) StatusResult {
method DelWithContext (line 119) | func (c *Client) DelWithContext(ctx context.Context, key string) Statu...
method del (line 123) | func (c *Client) del(ctx context.Context, key string) StatusResult {
method Expire (line 133) | func (c *Client) Expire(key string, secs int) StatusResult {
method ExpireWithContext (line 138) | func (c *Client) ExpireWithContext(ctx context.Context, key string, se...
method expire (line 142) | func (c *Client) expire(ctx context.Context, key string, secs int) Sta...
method GetBit (line 152) | func (c *Client) GetBit(key string, offset uint64) ScalarResult {
method GetBitWithContext (line 157) | func (c *Client) GetBitWithContext(ctx context.Context, key string, of...
method getBit (line 161) | func (c *Client) getBit(ctx context.Context, key string, offset uint64...
method HGet (line 171) | func (c *Client) HGet(key, field string) ScalarResult {
method HGetWithContext (line 176) | func (c *Client) HGetWithContext(ctx context.Context, key, field strin...
method hget (line 180) | func (c *Client) hget(ctx context.Context, key, field string) ScalarRe...
method HKeys (line 190) | func (c *Client) HKeys(key string) ListResult {
method HKeysWithContext (line 195) | func (c *Client) HKeysWithContext(ctx context.Context, key string) Lis...
method hkeys (line 199) | func (c *Client) hkeys(ctx context.Context, key string) ListResult {
method HSet (line 209) | func (c *Client) HSet(key, field, value string) StatusResult {
method HSetWithContext (line 214) | func (c *Client) HSetWithContext(ctx context.Context, key, field, valu...
method hset (line 218) | func (c *Client) hset(ctx context.Context, key, field, value string) S...
method HVals (line 228) | func (c *Client) HVals(key string) ListResult {
method HValsWithContext (line 233) | func (c *Client) HValsWithContext(ctx context.Context, key string) Lis...
method hvals (line 237) | func (c *Client) hvals(ctx context.Context, key string) ListResult {
method HDel (line 247) | func (c *Client) HDel(key string, field string, fields ...string) Scal...
method HDelWithContext (line 252) | func (c *Client) HDelWithContext(ctx context.Context, key, field strin...
method hdel (line 256) | func (c *Client) hdel(ctx context.Context, key, field string, fields ....
method Keys (line 267) | func (c *Client) Keys(pattern string) ListResult {
method KeysWithContext (line 272) | func (c *Client) KeysWithContext(ctx context.Context, pattern string) ...
method keys (line 276) | func (c *Client) keys(ctx context.Context, pattern string) ListResult {
method LIndex (line 286) | func (c *Client) LIndex(key string, index int) ScalarResult {
method LIndexWithContext (line 291) | func (c *Client) LIndexWithContext(ctx context.Context, key string, in...
method lindex (line 295) | func (c *Client) lindex(ctx context.Context, key string, index int) Sc...
method LLen (line 305) | func (c *Client) LLen(key string) ScalarResult {
method LLenWithContext (line 310) | func (c *Client) LLenWithContext(ctx context.Context, key string) Scal...
method llen (line 314) | func (c *Client) llen(ctx context.Context, key string) ScalarResult {
method LPop (line 324) | func (c *Client) LPop(key string) ScalarResult {
method LPopWithContext (line 329) | func (c *Client) LPopWithContext(ctx context.Context, key string) Scal...
method lpop (line 333) | func (c *Client) lpop(ctx context.Context, key string) ScalarResult {
method LPush (line 343) | func (c *Client) LPush(key, value string) StatusResult {
method LPushWithContext (line 348) | func (c *Client) LPushWithContext(ctx context.Context, key, value stri...
method lpush (line 352) | func (c *Client) lpush(ctx context.Context, key, value string) StatusR...
method RPush (line 362) | func (c *Client) RPush(key, value string, values ...string) StatusResu...
method RPushWithContext (line 367) | func (c *Client) RPushWithContext(ctx context.Context, key, value stri...
method rpush (line 371) | func (c *Client) rpush(ctx context.Context, key, value string, values ...
method RPop (line 382) | func (c *Client) RPop(key string) ScalarResult {
method RPopWithContext (line 387) | func (c *Client) RPopWithContext(ctx context.Context, key string) Scal...
method rpop (line 391) | func (c *Client) rpop(ctx context.Context, key string) ScalarResult {
method LRange (line 402) | func (c *Client) LRange(key string, start, stop int) ListResult {
method LRangeWithContext (line 407) | func (c *Client) LRangeWithContext(ctx context.Context, key string, st...
method lrange (line 411) | func (c *Client) lrange(ctx context.Context, key string, start, stop i...
method LRem (line 421) | func (c *Client) LRem(key, value string) StatusResult {
method LRemWithContext (line 426) | func (c *Client) LRemWithContext(ctx context.Context, key, value strin...
method lrem (line 430) | func (c *Client) lrem(ctx context.Context, key, value string) StatusRe...
method Ping (line 440) | func (c *Client) Ping(args ...string) ScalarResult {
method PingWithContext (line 445) | func (c *Client) PingWithContext(ctx context.Context, args ...string) ...
method ping (line 449) | func (c *Client) ping(ctx context.Context, args ...string) ScalarResult {
method SetBit (line 459) | func (c *Client) SetBit(key string, offset, value uint64) StatusResult {
method SetBitWithContext (line 464) | func (c *Client) SetBitWithContext(ctx context.Context, key string, of...
method setbit (line 468) | func (c *Client) setbit(ctx context.Context, key string, offset, value...
method Strlen (line 478) | func (c *Client) Strlen(key string) ScalarResult {
method StrlenWithContext (line 483) | func (c *Client) StrlenWithContext(ctx context.Context, key string) Sc...
method strlen (line 487) | func (c *Client) strlen(ctx context.Context, key string) ScalarResult {
method TTL (line 497) | func (c *Client) TTL(key string) ScalarResult {
method TTLWithContext (line 502) | func (c *Client) TTLWithContext(ctx context.Context, key string) Scala...
method ttl (line 506) | func (c *Client) ttl(ctx context.Context, key string) ScalarResult {
method Type (line 516) | func (c *Client) Type(key string) ScalarResult {
method TypeWithContext (line 521) | func (c *Client) TypeWithContext(ctx context.Context, key string) Scal...
method getType (line 525) | func (c *Client) getType(ctx context.Context, key string) ScalarResult {
function New (line 31) | func New(addr string, addrs ...string) (*Client, error) {
FILE: client/client_del_test.go
function TestClient_Del (line 13) | func TestClient_Del(t *testing.T) {
function TestClient_DelWithContext (line 78) | func TestClient_DelWithContext(t *testing.T) {
FILE: client/client_expire_test.go
function TestClient_Expire (line 13) | func TestClient_Expire(t *testing.T) {
function TestClient_ExpireWithContext (line 83) | func TestClient_ExpireWithContext(t *testing.T) {
FILE: client/client_get_test.go
function TestClient_Get (line 14) | func TestClient_Get(t *testing.T) {
function TestClient_GetWithContext (line 93) | func TestClient_GetWithContext(t *testing.T) {
FILE: client/client_getbit_test.go
function TestClient_GetBit (line 13) | func TestClient_GetBit(t *testing.T) {
function TestClient_GetBitWithContext (line 84) | func TestClient_GetBitWithContext(t *testing.T) {
FILE: client/client_hdel_test.go
function TestClient_HDel (line 13) | func TestClient_HDel(t *testing.T) {
function TestClient_HDelWithContext (line 82) | func TestClient_HDelWithContext(t *testing.T) {
FILE: client/client_hget_test.go
function TestClient_HGet (line 13) | func TestClient_HGet(t *testing.T) {
function TestClient_HGetWithContext (line 96) | func TestClient_HGetWithContext(t *testing.T) {
FILE: client/client_hkeys_test.go
function TestClient_HKeys (line 13) | func TestClient_HKeys(t *testing.T) {
function TestClient_HKeysWithContext (line 92) | func TestClient_HKeysWithContext(t *testing.T) {
FILE: client/client_hset_test.go
function TestClient_HSet (line 13) | func TestClient_HSet(t *testing.T) {
function TestClient_HSetWithContext (line 81) | func TestClient_HSetWithContext(t *testing.T) {
FILE: client/client_hvals_test.go
function TestClient_HVals (line 13) | func TestClient_HVals(t *testing.T) {
function TestClient_HValsWithContext (line 91) | func TestClient_HValsWithContext(t *testing.T) {
FILE: client/client_keys_test.go
function TestClient_Keys (line 13) | func TestClient_Keys(t *testing.T) {
function TestClient_KeysWithContext (line 81) | func TestClient_KeysWithContext(t *testing.T) {
FILE: client/client_lindex_test.go
function TestClient_LIndex (line 13) | func TestClient_LIndex(t *testing.T) {
function TestClient_LIndexWithContext (line 95) | func TestClient_LIndexWithContext(t *testing.T) {
FILE: client/client_llen_test.go
function TestClient_LLen (line 13) | func TestClient_LLen(t *testing.T) {
function TestClient_LLenWithContext (line 90) | func TestClient_LLenWithContext(t *testing.T) {
FILE: client/client_lpop_test.go
function TestClient_LPop (line 13) | func TestClient_LPop(t *testing.T) {
function TestClient_LPopWithContext (line 89) | func TestClient_LPopWithContext(t *testing.T) {
FILE: client/client_lpush_test.go
function TestClient_LPush (line 13) | func TestClient_LPush(t *testing.T) {
function TestClient_LPushWithContext (line 84) | func TestClient_LPushWithContext(t *testing.T) {
FILE: client/client_lrange_test.go
function TestClient_LRange (line 13) | func TestClient_LRange(t *testing.T) {
function TestClient_LRangeWithContext (line 94) | func TestClient_LRangeWithContext(t *testing.T) {
FILE: client/client_lrem_test.go
function TestClient_LRem (line 13) | func TestClient_LRem(t *testing.T) {
function TestClient_LRemWithContext (line 85) | func TestClient_LRemWithContext(t *testing.T) {
FILE: client/client_ping_test.go
function TestClient_Ping (line 13) | func TestClient_Ping(t *testing.T) {
function TestClient_PingWithContext (line 79) | func TestClient_PingWithContext(t *testing.T) {
FILE: client/client_rpop_test.go
function TestClient_Rpop (line 13) | func TestClient_Rpop(t *testing.T) {
function TestClient_RpopWithContext (line 89) | func TestClient_RpopWithContext(t *testing.T) {
FILE: client/client_rpush_test.go
function TestClient_RPush (line 13) | func TestClient_RPush(t *testing.T) {
function TestClient_RPushWithContext (line 85) | func TestClient_RPushWithContext(t *testing.T) {
FILE: client/client_set_test.go
function TestClient_Set (line 14) | func TestClient_Set(t *testing.T) {
function TestClient_SetWithContext (line 82) | func TestClient_SetWithContext(t *testing.T) {
FILE: client/client_setbit_test.go
function TestClient_SetBit (line 13) | func TestClient_SetBit(t *testing.T) {
function TestClient_SetBitWithContext (line 81) | func TestClient_SetBitWithContext(t *testing.T) {
FILE: client/client_strlen_test.go
function TestClient_Strlen (line 13) | func TestClient_Strlen(t *testing.T) {
function TestClient_StrlenWithContext (line 79) | func TestClient_StrlenWithContext(t *testing.T) {
FILE: client/client_ttl_test.go
function TestClient_TTL (line 13) | func TestClient_TTL(t *testing.T) {
function TestClient_TTLWithContext (line 88) | func TestClient_TTLWithContext(t *testing.T) {
FILE: client/client_type_test.go
function TestClient_Type (line 13) | func TestClient_Type(t *testing.T) {
function TestClient_TypeWithContext (line 88) | func TestClient_TypeWithContext(t *testing.T) {
FILE: client/executor_mock_test.go
type executorMock (line 21) | type executorMock struct
method ExecuteCommand (line 77) | func (m *executorMock) ExecuteCommand(p context.Context, p1 *api.Execu...
method ExecuteCommandMinimockCounter (line 102) | func (m *executorMock) ExecuteCommandMinimockCounter() uint64 {
method ExecuteCommandMinimockPreCounter (line 107) | func (m *executorMock) ExecuteCommandMinimockPreCounter() uint64 {
method ValidateCallCounters (line 113) | func (m *executorMock) ValidateCallCounters() {
method CheckMocksCalled (line 123) | func (m *executorMock) CheckMocksCalled() {
method Finish (line 129) | func (m *executorMock) Finish() {
method MinimockFinish (line 134) | func (m *executorMock) MinimockFinish() {
method Wait (line 144) | func (m *executorMock) Wait(timeout time.Duration) {
method MinimockWait (line 150) | func (m *executorMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 177) | func (m *executorMock) AllMocksCalled() bool {
function NewexecutorMock (line 31) | func NewexecutorMock(t minimock.Tester) *executorMock {
type mexecutorMockExecuteCommand (line 43) | type mexecutorMockExecuteCommand struct
method Expect (line 56) | func (m *mexecutorMockExecuteCommand) Expect(p context.Context, p1 *ap...
method Return (line 62) | func (m *mexecutorMockExecuteCommand) Return(r *api.ExecuteCommandResp...
method Set (line 70) | func (m *mexecutorMockExecuteCommand) Set(f func(p context.Context, p1...
type executorMockExecuteCommandParams (line 49) | type executorMockExecuteCommandParams struct
FILE: client/helpers_test.go
type ctxKey (line 5) | type ctxKey
function contextWithValue (line 7) | func contextWithValue(key string, value interface{}) context.Context {
function stringToPtr (line 11) | func stringToPtr(str string) *string {
FILE: client/result.go
type ScalarResult (line 12) | type ScalarResult struct
method Err (line 18) | func (sr ScalarResult) Err() error {
method IsNil (line 23) | func (sr ScalarResult) IsNil() bool {
method Val (line 28) | func (sr ScalarResult) Val() (string, error) {
method Int64 (line 39) | func (sr ScalarResult) Int64() (int64, error) {
function newScalarResult (line 49) | func newScalarResult(resp *api.ExecuteCommandResponse) ScalarResult {
type StatusResult (line 64) | type StatusResult struct
method Err (line 69) | func (sr StatusResult) Err() error {
function newStatusResult (line 73) | func newStatusResult(resp *api.ExecuteCommandResponse) StatusResult {
type ListResult (line 86) | type ListResult struct
method Err (line 92) | func (lr ListResult) Err() error {
method IsNil (line 97) | func (lr ListResult) IsNil() bool {
method Val (line 102) | func (lr ListResult) Val() ([]string, error) {
function newListResult (line 109) | func newListResult(resp *api.ExecuteCommandResponse) ListResult {
FILE: client/result_test.go
function TestScalarResult_Err (line 11) | func TestScalarResult_Err(t *testing.T) {
function TestScalarResult_IsNil (line 16) | func TestScalarResult_IsNil(t *testing.T) {
function TestScalarResult_Val (line 33) | func TestScalarResult_Val(t *testing.T) {
function TestScalarResult_Int64 (line 52) | func TestScalarResult_Int64(t *testing.T) {
function TestStatusResult_Err (line 76) | func TestStatusResult_Err(t *testing.T) {
function TestListResult_Err (line 81) | func TestListResult_Err(t *testing.T) {
function TestListResult_IsNil (line 86) | func TestListResult_IsNil(t *testing.T) {
function TestListResult_Val (line 103) | func TestListResult_Val(t *testing.T) {
FILE: cmd/godown-cli/main.go
function main (line 23) | func main() {
FILE: cmd/godown-server/main.go
function main (line 21) | func main() {
FILE: internal/api/api.pb.go
constant _ (line 44) | _ = proto.GoGoProtoPackageIsVersion2
type FSMCommandType (line 46) | type FSMCommandType
method String (line 62) | func (x FSMCommandType) String() string {
method EnumDescriptor (line 65) | func (FSMCommandType) EnumDescriptor() ([]byte, []int) { return fileDe...
constant FSMApplyCommand (line 49) | FSMApplyCommand FSMCommandType = 0
constant FSMApplyMetadata (line 50) | FSMApplyMetadata FSMCommandType = 1
type CommandExecutionReply (line 68) | type CommandExecutionReply
method String (line 99) | func (x CommandExecutionReply) String() string {
method EnumDescriptor (line 102) | func (CommandExecutionReply) EnumDescriptor() ([]byte, []int) { return...
constant NilCommandReply (line 71) | NilCommandReply CommandExecutionReply = 0
constant OkCommandReply (line 72) | OkCommandReply CommandExecutionReply = 1
constant RawStringCommandReply (line 73) | RawStringCommandReply CommandExecutionReply = 2
constant StringCommandReply (line 74) | StringCommandReply CommandExecutionReply = 3
constant IntCommandReply (line 75) | IntCommandReply CommandExecutionReply = 4
constant SliceCommandReply (line 76) | SliceCommandReply CommandExecutionReply = 5
constant ErrCommandReply (line 77) | ErrCommandReply CommandExecutionReply = 6
type FSMCommand (line 104) | type FSMCommand struct
method Reset (line 109) | func (m *FSMCommand) Reset() { *m = FSMCommand{} }
method String (line 110) | func (m *FSMCommand) String() string { return proto.Compact...
method ProtoMessage (line 111) | func (*FSMCommand) ProtoMessage() {}
method Descriptor (line 112) | func (*FSMCommand) Descriptor() ([]byte, []int) { return fileDescripto...
method GetType (line 114) | func (m *FSMCommand) GetType() FSMCommandType {
method Marshal (line 356) | func (m *FSMCommand) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 366) | func (m *FSMCommand) MarshalTo(dAtA []byte) (int, error) {
method Size (line 578) | func (m *FSMCommand) Size() (n int) {
method Unmarshal (line 671) | func (m *FSMCommand) Unmarshal(dAtA []byte) error {
type UpdateMetadataRequest (line 122) | type UpdateMetadataRequest struct
method Reset (line 127) | func (m *UpdateMetadataRequest) Reset() { *m = Upda...
method String (line 128) | func (m *UpdateMetadataRequest) String() string { return pr...
method ProtoMessage (line 129) | func (*UpdateMetadataRequest) ProtoMessage() {}
method Descriptor (line 130) | func (*UpdateMetadataRequest) Descriptor() ([]byte, []int) { return fi...
method GetKey (line 132) | func (m *UpdateMetadataRequest) GetKey() string {
method GetValue (line 139) | func (m *UpdateMetadataRequest) GetValue() string {
method Marshal (line 387) | func (m *UpdateMetadataRequest) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 397) | func (m *UpdateMetadataRequest) MarshalTo(dAtA []byte) (int, error) {
method Size (line 589) | func (m *UpdateMetadataRequest) Size() (n int) {
method Unmarshal (line 770) | func (m *UpdateMetadataRequest) Unmarshal(dAtA []byte) error {
type UpdateMetadataResponse (line 147) | type UpdateMetadataResponse struct
method Reset (line 150) | func (m *UpdateMetadataResponse) Reset() { *m = Upd...
method String (line 151) | func (m *UpdateMetadataResponse) String() string { return p...
method ProtoMessage (line 152) | func (*UpdateMetadataResponse) ProtoMessage() {}
method Descriptor (line 153) | func (*UpdateMetadataResponse) Descriptor() ([]byte, []int) { return f...
method Marshal (line 417) | func (m *UpdateMetadataResponse) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 427) | func (m *UpdateMetadataResponse) MarshalTo(dAtA []byte) (int, error) {
method Size (line 603) | func (m *UpdateMetadataResponse) Size() (n int) {
method Unmarshal (line 878) | func (m *UpdateMetadataResponse) Unmarshal(dAtA []byte) error {
type ExecuteCommandRequest (line 156) | type ExecuteCommandRequest struct
method Reset (line 160) | func (m *ExecuteCommandRequest) Reset() { *m = Exec...
method String (line 161) | func (m *ExecuteCommandRequest) String() string { return pr...
method ProtoMessage (line 162) | func (*ExecuteCommandRequest) ProtoMessage() {}
method Descriptor (line 163) | func (*ExecuteCommandRequest) Descriptor() ([]byte, []int) { return fi...
method GetCommand (line 165) | func (m *ExecuteCommandRequest) GetCommand() string {
method Marshal (line 435) | func (m *ExecuteCommandRequest) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 445) | func (m *ExecuteCommandRequest) MarshalTo(dAtA []byte) (int, error) {
method Size (line 609) | func (m *ExecuteCommandRequest) Size() (n int) {
method Unmarshal (line 928) | func (m *ExecuteCommandRequest) Unmarshal(dAtA []byte) error {
type ExecuteCommandResponse (line 173) | type ExecuteCommandResponse struct
method Reset (line 179) | func (m *ExecuteCommandResponse) Reset() { *m = Exe...
method String (line 180) | func (m *ExecuteCommandResponse) String() string { return p...
method ProtoMessage (line 181) | func (*ExecuteCommandResponse) ProtoMessage() {}
method Descriptor (line 182) | func (*ExecuteCommandResponse) Descriptor() ([]byte, []int) { return f...
method GetReply (line 184) | func (m *ExecuteCommandResponse) GetReply() CommandExecutionReply {
method GetItem (line 191) | func (m *ExecuteCommandResponse) GetItem() string {
method GetItems (line 198) | func (m *ExecuteCommandResponse) GetItems() []string {
method Marshal (line 459) | func (m *ExecuteCommandResponse) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 469) | func (m *ExecuteCommandResponse) MarshalTo(dAtA []byte) (int, error) {
method Size (line 619) | func (m *ExecuteCommandResponse) Size() (n int) {
method Unmarshal (line 1007) | func (m *ExecuteCommandResponse) Unmarshal(dAtA []byte) error {
type AddToClusterRequest (line 206) | type AddToClusterRequest struct
method Reset (line 211) | func (m *AddToClusterRequest) Reset() { *m = AddToC...
method String (line 212) | func (m *AddToClusterRequest) String() string { return prot...
method ProtoMessage (line 213) | func (*AddToClusterRequest) ProtoMessage() {}
method Descriptor (line 214) | func (*AddToClusterRequest) Descriptor() ([]byte, []int) { return file...
method GetId (line 216) | func (m *AddToClusterRequest) GetId() string {
method GetAddr (line 223) | func (m *AddToClusterRequest) GetAddr() string {
method Marshal (line 503) | func (m *AddToClusterRequest) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 513) | func (m *AddToClusterRequest) MarshalTo(dAtA []byte) (int, error) {
method Size (line 638) | func (m *AddToClusterRequest) Size() (n int) {
method Unmarshal (line 1134) | func (m *AddToClusterRequest) Unmarshal(dAtA []byte) error {
type AddToClusterResponse (line 231) | type AddToClusterResponse struct
method Reset (line 234) | func (m *AddToClusterResponse) Reset() { *m = AddTo...
method String (line 235) | func (m *AddToClusterResponse) String() string { return pro...
method ProtoMessage (line 236) | func (*AddToClusterResponse) ProtoMessage() {}
method Descriptor (line 237) | func (*AddToClusterResponse) Descriptor() ([]byte, []int) { return fil...
method Marshal (line 533) | func (m *AddToClusterResponse) Marshal() (dAtA []byte, err error) {
method MarshalTo (line 543) | func (m *AddToClusterResponse) MarshalTo(dAtA []byte) (int, error) {
method Size (line 652) | func (m *AddToClusterResponse) Size() (n int) {
method Unmarshal (line 1242) | func (m *AddToClusterResponse) Unmarshal(dAtA []byte) error {
function init (line 239) | func init() {
constant _ (line 257) | _ = grpc.SupportPackageIsVersion4
type GodownClient (line 261) | type GodownClient interface
type godownClient (line 266) | type godownClient struct
method ExecuteCommand (line 274) | func (c *godownClient) ExecuteCommand(ctx context.Context, in *Execute...
method AddToCluster (line 283) | func (c *godownClient) AddToCluster(ctx context.Context, in *AddToClus...
function NewGodownClient (line 270) | func NewGodownClient(cc *grpc.ClientConn) GodownClient {
type GodownServer (line 294) | type GodownServer interface
function RegisterGodownServer (line 299) | func RegisterGodownServer(s *grpc.Server, srv GodownServer) {
function _Godown_ExecuteCommand_Handler (line 303) | func _Godown_ExecuteCommand_Handler(srv interface{}, ctx context.Context...
function _Godown_AddToCluster_Handler (line 321) | func _Godown_AddToCluster_Handler(srv interface{}, ctx context.Context, ...
function encodeFixed64Api (line 551) | func encodeFixed64Api(dAtA []byte, offset int, v uint64) int {
function encodeFixed32Api (line 562) | func encodeFixed32Api(dAtA []byte, offset int, v uint32) int {
function encodeVarintApi (line 569) | func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
function sovApi (line 658) | func sovApi(x uint64) (n int) {
function sozApi (line 668) | func sozApi(x uint64) (n int) {
function skipApi (line 1292) | func skipApi(dAtA []byte) (n int, err error) {
function init (line 1397) | func init() { proto.RegisterFile("api.proto", fileDescriptorApi) }
FILE: internal/cli/cli.go
constant connectTimeout (line 15) | connectTimeout = 200 * time.Millisecond
constant prefix (line 17) | prefix = "godown >"
type CLI (line 22) | type CLI struct
method Close (line 63) | func (c *CLI) Close() error {
method run (line 73) | func (c *CLI) run() {
function Run (line 30) | func Run(hostPort string) (err error) {
FILE: internal/cli/printer.go
constant okString (line 15) | okString = "OK"
constant nilString (line 16) | nilString = "(nil)"
constant logo (line 19) | logo = `
type printer (line 29) | type printer struct
method Close (line 46) | func (p *printer) Close() error {
method printLogo (line 53) | func (p *printer) printLogo() {
method println (line 59) | func (p *printer) println(str string) {
method printError (line 63) | func (p *printer) printError(err error) {
method printResponse (line 67) | func (p *printer) printResponse(resp *api.ExecuteCommandResponse) {
function newPrinter (line 36) | func newPrinter(out io.Writer) *printer {
FILE: internal/clock/clock.go
type Clock (line 6) | type Clock struct
method Now (line 9) | func (c *Clock) Now() time.Time {
function New (line 14) | func New() *Clock {
FILE: internal/command/command.go
type Command (line 19) | type Command interface
type dataStore (line 29) | type dataStore interface
type commandParser (line 41) | type commandParser interface
type commandClock (line 46) | type commandClock interface
FILE: internal/command/command_clock_mock_test.go
type commandClockMock (line 16) | type commandClockMock struct
method Now (line 58) | func (m *commandClockMock) Now() (r time.Time) {
method NowMinimockCounter (line 71) | func (m *commandClockMock) NowMinimockCounter() uint64 {
method NowMinimockPreCounter (line 76) | func (m *commandClockMock) NowMinimockPreCounter() uint64 {
method ValidateCallCounters (line 82) | func (m *commandClockMock) ValidateCallCounters() {
method CheckMocksCalled (line 92) | func (m *commandClockMock) CheckMocksCalled() {
method Finish (line 98) | func (m *commandClockMock) Finish() {
method MinimockFinish (line 103) | func (m *commandClockMock) MinimockFinish() {
method Wait (line 113) | func (m *commandClockMock) Wait(timeout time.Duration) {
method MinimockWait (line 119) | func (m *commandClockMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 146) | func (m *commandClockMock) AllMocksCalled() bool {
function NewcommandClockMock (line 26) | func NewcommandClockMock(t minimock.Tester) *commandClockMock {
type mcommandClockMockNow (line 38) | type mcommandClockMockNow struct
method Return (line 43) | func (m *mcommandClockMockNow) Return(r time.Time) *commandClockMock {
method Set (line 51) | func (m *mcommandClockMockNow) Set(f func() (r time.Time)) *commandClo...
FILE: internal/command/command_mock_test.go
type CommandMock (line 17) | type CommandMock struct
method Execute (line 83) | func (m *CommandMock) Execute(p ...string) (r Reply) {
method ExecuteMinimockCounter (line 108) | func (m *CommandMock) ExecuteMinimockCounter() uint64 {
method ExecuteMinimockPreCounter (line 113) | func (m *CommandMock) ExecuteMinimockPreCounter() uint64 {
method Help (line 137) | func (m *CommandMock) Help() (r string) {
method HelpMinimockCounter (line 150) | func (m *CommandMock) HelpMinimockCounter() uint64 {
method HelpMinimockPreCounter (line 155) | func (m *CommandMock) HelpMinimockPreCounter() uint64 {
method Name (line 179) | func (m *CommandMock) Name() (r string) {
method NameMinimockCounter (line 192) | func (m *CommandMock) NameMinimockCounter() uint64 {
method NameMinimockPreCounter (line 197) | func (m *CommandMock) NameMinimockPreCounter() uint64 {
method ValidateCallCounters (line 203) | func (m *CommandMock) ValidateCallCounters() {
method CheckMocksCalled (line 221) | func (m *CommandMock) CheckMocksCalled() {
method Finish (line 227) | func (m *CommandMock) Finish() {
method MinimockFinish (line 232) | func (m *CommandMock) MinimockFinish() {
method Wait (line 250) | func (m *CommandMock) Wait(timeout time.Duration) {
method MinimockWait (line 256) | func (m *CommandMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 293) | func (m *CommandMock) AllMocksCalled() bool {
function NewCommandMock (line 37) | func NewCommandMock(t minimock.Tester) *CommandMock {
type mCommandMockExecute (line 51) | type mCommandMockExecute struct
method Expect (line 62) | func (m *mCommandMockExecute) Expect(p ...string) *mCommandMockExecute {
method Return (line 68) | func (m *mCommandMockExecute) Return(r Reply) *CommandMock {
method Set (line 76) | func (m *mCommandMockExecute) Set(f func(p ...string) (r Reply)) *Comm...
type CommandMockExecuteParams (line 57) | type CommandMockExecuteParams struct
type mCommandMockHelp (line 117) | type mCommandMockHelp struct
method Return (line 122) | func (m *mCommandMockHelp) Return(r string) *CommandMock {
method Set (line 130) | func (m *mCommandMockHelp) Set(f func() (r string)) *CommandMock {
type mCommandMockName (line 159) | type mCommandMockName struct
method Return (line 164) | func (m *mCommandMockName) Return(r string) *CommandMock {
method Set (line 172) | func (m *mCommandMockName) Set(f func() (r string)) *CommandMock {
FILE: internal/command/command_parser_mock_test.go
type commandParserMock (line 17) | type commandParserMock struct
method Parse (line 71) | func (m *commandParserMock) Parse(p string) (r Command, r1 []string, r...
method ParseMinimockCounter (line 96) | func (m *commandParserMock) ParseMinimockCounter() uint64 {
method ParseMinimockPreCounter (line 101) | func (m *commandParserMock) ParseMinimockPreCounter() uint64 {
method ValidateCallCounters (line 107) | func (m *commandParserMock) ValidateCallCounters() {
method CheckMocksCalled (line 117) | func (m *commandParserMock) CheckMocksCalled() {
method Finish (line 123) | func (m *commandParserMock) Finish() {
method MinimockFinish (line 128) | func (m *commandParserMock) MinimockFinish() {
method Wait (line 138) | func (m *commandParserMock) Wait(timeout time.Duration) {
method MinimockWait (line 144) | func (m *commandParserMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 171) | func (m *commandParserMock) AllMocksCalled() bool {
function NewcommandParserMock (line 27) | func NewcommandParserMock(t minimock.Tester) *commandParserMock {
type mcommandParserMockParse (line 39) | type mcommandParserMockParse struct
method Expect (line 50) | func (m *mcommandParserMockParse) Expect(p string) *mcommandParserMock...
method Return (line 56) | func (m *mcommandParserMockParse) Return(r Command, r1 []string, r2 er...
method Set (line 64) | func (m *mcommandParserMockParse) Set(f func(p string) (r Command, r1 ...
type commandParserMockParseParams (line 45) | type commandParserMockParseParams struct
FILE: internal/command/command_test.go
function TestParser_Parse (line 9) | func TestParser_Parse(t *testing.T) {
FILE: internal/command/data_store_mock_test.go
type dataStoreMock (line 19) | type dataStoreMock struct
method Del (line 91) | func (m *dataStoreMock) Del(p storage.Key) (r error) {
method DelMinimockCounter (line 116) | func (m *dataStoreMock) DelMinimockCounter() uint64 {
method DelMinimockPreCounter (line 121) | func (m *dataStoreMock) DelMinimockPreCounter() uint64 {
method Get (line 157) | func (m *dataStoreMock) Get(p storage.Key) (r *storage.Value, r1 error) {
method GetMinimockCounter (line 182) | func (m *dataStoreMock) GetMinimockCounter() uint64 {
method GetMinimockPreCounter (line 187) | func (m *dataStoreMock) GetMinimockPreCounter() uint64 {
method Keys (line 211) | func (m *dataStoreMock) Keys() (r []storage.Key, r1 error) {
method KeysMinimockCounter (line 224) | func (m *dataStoreMock) KeysMinimockCounter() uint64 {
method KeysMinimockPreCounter (line 229) | func (m *dataStoreMock) KeysMinimockPreCounter() uint64 {
method Put (line 266) | func (m *dataStoreMock) Put(p storage.Key, p1 storage.ValueSetter) (r ...
method PutMinimockCounter (line 291) | func (m *dataStoreMock) PutMinimockCounter() uint64 {
method PutMinimockPreCounter (line 296) | func (m *dataStoreMock) PutMinimockPreCounter() uint64 {
method ValidateCallCounters (line 302) | func (m *dataStoreMock) ValidateCallCounters() {
method CheckMocksCalled (line 324) | func (m *dataStoreMock) CheckMocksCalled() {
method Finish (line 330) | func (m *dataStoreMock) Finish() {
method MinimockFinish (line 335) | func (m *dataStoreMock) MinimockFinish() {
method Wait (line 357) | func (m *dataStoreMock) Wait(timeout time.Duration) {
method MinimockWait (line 363) | func (m *dataStoreMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 405) | func (m *dataStoreMock) AllMocksCalled() bool {
function NewdataStoreMock (line 44) | func NewdataStoreMock(t minimock.Tester) *dataStoreMock {
type mdataStoreMockDel (line 59) | type mdataStoreMockDel struct
method Expect (line 70) | func (m *mdataStoreMockDel) Expect(p storage.Key) *mdataStoreMockDel {
method Return (line 76) | func (m *mdataStoreMockDel) Return(r error) *dataStoreMock {
method Set (line 84) | func (m *mdataStoreMockDel) Set(f func(p storage.Key) (r error)) *data...
type dataStoreMockDelParams (line 65) | type dataStoreMockDelParams struct
type mdataStoreMockGet (line 125) | type mdataStoreMockGet struct
method Expect (line 136) | func (m *mdataStoreMockGet) Expect(p storage.Key) *mdataStoreMockGet {
method Return (line 142) | func (m *mdataStoreMockGet) Return(r *storage.Value, r1 error) *dataSt...
method Set (line 150) | func (m *mdataStoreMockGet) Set(f func(p storage.Key) (r *storage.Valu...
type dataStoreMockGetParams (line 131) | type dataStoreMockGetParams struct
type mdataStoreMockKeys (line 191) | type mdataStoreMockKeys struct
method Return (line 196) | func (m *mdataStoreMockKeys) Return(r []storage.Key, r1 error) *dataSt...
method Set (line 204) | func (m *mdataStoreMockKeys) Set(f func() (r []storage.Key, r1 error))...
type mdataStoreMockPut (line 233) | type mdataStoreMockPut struct
method Expect (line 245) | func (m *mdataStoreMockPut) Expect(p storage.Key, p1 storage.ValueSett...
method Return (line 251) | func (m *mdataStoreMockPut) Return(r error) *dataStoreMock {
method Set (line 259) | func (m *mdataStoreMockPut) Set(f func(p storage.Key, p1 storage.Value...
type dataStoreMockPutParams (line 239) | type dataStoreMockPutParams struct
FILE: internal/command/del.go
type Del (line 8) | type Del struct
method Name (line 13) | func (c *Del) Name() string {
method Help (line 18) | func (c *Del) Help() string {
method Execute (line 24) | func (c *Del) Execute(args ...string) Reply {
FILE: internal/command/del_test.go
function TestDel_Name (line 14) | func TestDel_Name(t *testing.T) {
function TestDel_Help (line 19) | func TestDel_Help(t *testing.T) {
function TestDel_Execute (line 27) | func TestDel_Execute(t *testing.T) {
function TestDel_Execute_StorageErr (line 52) | func TestDel_Execute_StorageErr(t *testing.T) {
FILE: internal/command/expire.go
type Expire (line 12) | type Expire struct
method Name (line 18) | func (c *Expire) Name() string {
method Help (line 23) | func (c *Expire) Help() string {
method Execute (line 29) | func (c *Expire) Execute(args ...string) Reply {
FILE: internal/command/expire_test.go
function TestExpire_Name (line 16) | func TestExpire_Name(t *testing.T) {
function TestExpire_Help (line 21) | func TestExpire_Help(t *testing.T) {
function TestExpire_Execute (line 29) | func TestExpire_Execute(t *testing.T) {
function TestExpire_Execute_StorageErr (line 54) | func TestExpire_Execute_StorageErr(t *testing.T) {
function TestExpire_Execute_WhiteBox (line 71) | func TestExpire_Execute_WhiteBox(t *testing.T) {
FILE: internal/command/get.go
type Get (line 8) | type Get struct
method Name (line 13) | func (c *Get) Name() string {
method Help (line 18) | func (c *Get) Help() string {
method Execute (line 25) | func (c *Get) Execute(args ...string) Reply {
FILE: internal/command/get_test.go
function TestGet_Name (line 14) | func TestGet_Name(t *testing.T) {
function TestGet_Help (line 19) | func TestGet_Help(t *testing.T) {
function TestGet_Execute (line 27) | func TestGet_Execute(t *testing.T) {
function TestGet_Execute_StorageErr (line 59) | func TestGet_Execute_StorageErr(t *testing.T) {
FILE: internal/command/getbit.go
type GetBit (line 11) | type GetBit struct
method Name (line 16) | func (c *GetBit) Name() string {
method Help (line 21) | func (c *GetBit) Help() string {
method Execute (line 27) | func (c *GetBit) Execute(args ...string) Reply {
method parseOffset (line 62) | func (c *GetBit) parseOffset(args []string) (uint64, error) {
method resolveIndex (line 70) | func (c *GetBit) resolveIndex(offset uint64) uint64 {
FILE: internal/command/getbit_test.go
function TestGetBit_Name (line 14) | func TestGetBit_Name(t *testing.T) {
function TestGetBit_Help (line 19) | func TestGetBit_Help(t *testing.T) {
function TestGetBit_Execute (line 26) | func TestGetBit_Execute(t *testing.T) {
function TestGetBit_Execute_StorageErr (line 66) | func TestGetBit_Execute_StorageErr(t *testing.T) {
FILE: internal/command/hdel.go
type Hdel (line 8) | type Hdel struct
method Name (line 13) | func (c *Hdel) Name() string {
method Help (line 18) | func (c *Hdel) Help() string {
method Execute (line 25) | func (c *Hdel) Execute(args ...string) Reply {
FILE: internal/command/hdel_test.go
function TestHdel_Name (line 15) | func TestHdel_Name(t *testing.T) {
function TestHdel_Help (line 20) | func TestHdel_Help(t *testing.T) {
function TestHdel_Execute (line 28) | func TestHdel_Execute(t *testing.T) {
function TestHdel_Execute_DeleteKeyWhenAllFieldsDeleted (line 58) | func TestHdel_Execute_DeleteKeyWhenAllFieldsDeleted(t *testing.T) {
function TestHdel_Execute_StorageErr (line 74) | func TestHdel_Execute_StorageErr(t *testing.T) {
FILE: internal/command/help.go
type Help (line 8) | type Help struct
method Name (line 13) | func (c *Help) Name() string {
method Help (line 18) | func (c *Help) Help() string {
method Execute (line 24) | func (c *Help) Execute(args ...string) Reply {
FILE: internal/command/help_test.go
function TestHelp_Name (line 12) | func TestHelp_Name(t *testing.T) {
function TestHelp_Help (line 17) | func TestHelp_Help(t *testing.T) {
function TestHelp_Execute (line 24) | func TestHelp_Execute(t *testing.T) {
FILE: internal/command/hget.go
type Hget (line 8) | type Hget struct
method Name (line 13) | func (c *Hget) Name() string {
method Help (line 18) | func (c *Hget) Help() string {
method Execute (line 24) | func (c *Hget) Execute(args ...string) Reply {
FILE: internal/command/hget_test.go
function TestHget_Name (line 15) | func TestHget_Name(t *testing.T) {
function TestHget_Help (line 20) | func TestHget_Help(t *testing.T) {
function TestHget_Execute (line 27) | func TestHget_Execute(t *testing.T) {
function TestHget_Execute_StorageErr (line 60) | func TestHget_Execute_StorageErr(t *testing.T) {
FILE: internal/command/hkeys.go
type Hkeys (line 8) | type Hkeys struct
method Name (line 13) | func (c *Hkeys) Name() string {
method Help (line 18) | func (c *Hkeys) Help() string {
method Execute (line 24) | func (c *Hkeys) Execute(args ...string) Reply {
FILE: internal/command/hkeys_test.go
function TestHkeys_Name (line 16) | func TestHkeys_Name(t *testing.T) {
function TestHkeys_Help (line 21) | func TestHkeys_Help(t *testing.T) {
function TestHkeys_Execute (line 28) | func TestHkeys_Execute(t *testing.T) {
function TestHkeys_Execute_StorageErr (line 70) | func TestHkeys_Execute_StorageErr(t *testing.T) {
FILE: internal/command/hset.go
type Hset (line 8) | type Hset struct
method Name (line 13) | func (c *Hset) Name() string {
method Help (line 18) | func (c *Hset) Help() string {
method Execute (line 24) | func (c *Hset) Execute(args ...string) Reply {
FILE: internal/command/hset_test.go
function TestHset_Name (line 14) | func TestHset_Name(t *testing.T) {
function TestHset_Help (line 19) | func TestHset_Help(t *testing.T) {
function TestHset_Execute (line 26) | func TestHset_Execute(t *testing.T) {
function TestHset_Execute_WhiteBox (line 49) | func TestHset_Execute_WhiteBox(t *testing.T) {
function TestHset_Execute_StorageErr (line 121) | func TestHset_Execute_StorageErr(t *testing.T) {
FILE: internal/command/hvals.go
type Hvals (line 8) | type Hvals struct
method Name (line 13) | func (c *Hvals) Name() string {
method Help (line 18) | func (c *Hvals) Help() string {
method Execute (line 24) | func (c *Hvals) Execute(args ...string) Reply {
FILE: internal/command/hvals_test.go
function TestHvals_Name (line 15) | func TestHvals_Name(t *testing.T) {
function TestHvals_Help (line 20) | func TestHvals_Help(t *testing.T) {
function TestHvals_Execute (line 27) | func TestHvals_Execute(t *testing.T) {
function TestHvals_Execute_StorageErr (line 68) | func TestHvals_Execute_StorageErr(t *testing.T) {
FILE: internal/command/keys.go
type Keys (line 10) | type Keys struct
method Name (line 15) | func (c *Keys) Name() string {
method Help (line 20) | func (c *Keys) Help() string {
method Execute (line 26) | func (c *Keys) Execute(args ...string) Reply {
method compilePattern (line 51) | func (c *Keys) compilePattern(input string) (*regexp.Regexp, error) {
FILE: internal/command/keys_test.go
function TestKeys_Name (line 15) | func TestKeys_Name(t *testing.T) {
function TestKeys_Help (line 20) | func TestKeys_Help(t *testing.T) {
function TestKeys_Execute (line 27) | func TestKeys_Execute(t *testing.T) {
function TestKeys_Execute_StorageErr (line 68) | func TestKeys_Execute_StorageErr(t *testing.T) {
FILE: internal/command/lindex.go
type Lindex (line 11) | type Lindex struct
method Name (line 16) | func (c *Lindex) Name() string {
method Help (line 21) | func (c *Lindex) Help() string {
method Execute (line 29) | func (c *Lindex) Execute(args ...string) Reply {
method parseIndex (line 59) | func (c *Lindex) parseIndex(list []string, index string) (int, error) {
FILE: internal/command/lindex_test.go
function TestLindex_Name (line 15) | func TestLindex_Name(t *testing.T) {
function TestLindex_Help (line 20) | func TestLindex_Help(t *testing.T) {
function TestLindex_Execute (line 29) | func TestLindex_Execute(t *testing.T) {
function TestLindex_Execute_StorageErr (line 65) | func TestLindex_Execute_StorageErr(t *testing.T) {
FILE: internal/command/llen.go
type Llen (line 8) | type Llen struct
method Name (line 13) | func (c *Llen) Name() string {
method Help (line 18) | func (c *Llen) Help() string {
method Execute (line 25) | func (c *Llen) Execute(args ...string) Reply {
FILE: internal/command/llen_test.go
function TestLlen_Name (line 14) | func TestLlen_Name(t *testing.T) {
function TestLlen_Help (line 19) | func TestLlen_Help(t *testing.T) {
function TestLlen_Execute (line 27) | func TestLlen_Execute(t *testing.T) {
function TestLlen_Execute_StorageErr (line 58) | func TestLlen_Execute_StorageErr(t *testing.T) {
FILE: internal/command/lpop.go
type Lpop (line 8) | type Lpop struct
method Name (line 13) | func (c *Lpop) Name() string {
method Help (line 18) | func (c *Lpop) Help() string {
method Execute (line 24) | func (c *Lpop) Execute(args ...string) Reply {
FILE: internal/command/lpop_test.go
function TestLpop_Name (line 15) | func TestLpop_Name(t *testing.T) {
function TestLpop_Help (line 20) | func TestLpop_Help(t *testing.T) {
function TestLpop_Execute (line 27) | func TestLpop_Execute(t *testing.T) {
function TestLpop_Execute_StorageErr (line 58) | func TestLpop_Execute_StorageErr(t *testing.T) {
function TestLpop_Execute_DelEmptyList (line 73) | func TestLpop_Execute_DelEmptyList(t *testing.T) {
FILE: internal/command/lpush.go
type Lpush (line 8) | type Lpush struct
method Name (line 13) | func (c *Lpush) Name() string {
method Help (line 18) | func (c *Lpush) Help() string {
method Execute (line 24) | func (c *Lpush) Execute(args ...string) Reply {
FILE: internal/command/lpush_test.go
function TestLpush_Name (line 15) | func TestLpush_Name(t *testing.T) {
function TestLpush_Help (line 20) | func TestLpush_Help(t *testing.T) {
function TestLpush_Execute (line 27) | func TestLpush_Execute(t *testing.T) {
function TestLpush_Execute_WhiteBox (line 52) | func TestLpush_Execute_WhiteBox(t *testing.T) {
function TestLpush_Execute_StorageErr (line 120) | func TestLpush_Execute_StorageErr(t *testing.T) {
FILE: internal/command/lrange.go
type Lrange (line 13) | type Lrange struct
method Name (line 18) | func (c *Lrange) Name() string {
method Help (line 23) | func (c *Lrange) Help() string {
method Execute (line 31) | func (c *Lrange) Execute(args ...string) Reply {
method extractStartStopIndexes (line 66) | func (c *Lrange) extractStartStopIndexes(len int, args []string) (int,...
FILE: internal/command/lrange_test.go
function TestLrange_Name (line 15) | func TestLrange_Name(t *testing.T) {
function TestLrange_Help (line 20) | func TestLrange_Help(t *testing.T) {
function TestLrange_Execute (line 29) | func TestLrange_Execute(t *testing.T) {
function TestLrange_Execute_StorageErr (line 69) | func TestLrange_Execute_StorageErr(t *testing.T) {
FILE: internal/command/lrem.go
type Lrem (line 8) | type Lrem struct
method Name (line 13) | func (c *Lrem) Name() string {
method Help (line 18) | func (c *Lrem) Help() string {
method Execute (line 24) | func (c *Lrem) Execute(args ...string) Reply {
FILE: internal/command/lrem_test.go
function TestLrem_Name (line 15) | func TestLrem_Name(t *testing.T) {
function TestLrem_Help (line 20) | func TestLrem_Help(t *testing.T) {
function TestLrem_Execute (line 27) | func TestLrem_Execute(t *testing.T) {
function TestLrem_Execute_WhiteBox (line 57) | func TestLrem_Execute_WhiteBox(t *testing.T) {
function TestLrem_Execute_StorageErr (line 107) | func TestLrem_Execute_StorageErr(t *testing.T) {
FILE: internal/command/parser.go
type Parser (line 14) | type Parser struct
method Parse (line 25) | func (p *Parser) Parse(str string) (Command, []string, error) {
method extractArgs (line 85) | func (p *Parser) extractArgs(val string) []string {
function NewParser (line 20) | func NewParser(strg dataStore, clck commandClock) *Parser {
FILE: internal/command/ping.go
constant pong (line 7) | pong = "PONG"
type Ping (line 10) | type Ping struct
method Name (line 13) | func (c *Ping) Name() string {
method Help (line 18) | func (c *Ping) Help() string {
method Execute (line 24) | func (c *Ping) Execute(args ...string) Reply {
FILE: internal/command/ping_test.go
function TestPing_Name (line 9) | func TestPing_Name(t *testing.T) {
function TestPing_Help (line 14) | func TestPing_Help(t *testing.T) {
function TestPing_Execute (line 21) | func TestPing_Execute(t *testing.T) {
FILE: internal/command/reply.go
type Reply (line 4) | type Reply interface
type OkReply (line 9) | type OkReply struct
method Val (line 12) | func (or OkReply) Val() interface{} {
type ErrReply (line 17) | type ErrReply struct
method Val (line 22) | func (er ErrReply) Val() interface{} {
type NilReply (line 27) | type NilReply struct
method Val (line 30) | func (nr NilReply) Val() interface{} {
type RawStringReply (line 35) | type RawStringReply struct
method Val (line 40) | func (ur RawStringReply) Val() interface{} {
type StringReply (line 45) | type StringReply struct
method Val (line 50) | func (sr StringReply) Val() interface{} {
type IntReply (line 55) | type IntReply struct
method Val (line 60) | func (ir IntReply) Val() interface{} {
type SliceReply (line 65) | type SliceReply struct
method Val (line 70) | func (sr SliceReply) Val() interface{} {
FILE: internal/command/reply_test.go
function TestOkReply_Val (line 10) | func TestOkReply_Val(t *testing.T) {
function TestErrReply_Val (line 15) | func TestErrReply_Val(t *testing.T) {
function TestNilReply_Val (line 22) | func TestNilReply_Val(t *testing.T) {
function TestRawStringReply_Val (line 27) | func TestRawStringReply_Val(t *testing.T) {
function TestStringReply_Val (line 32) | func TestStringReply_Val(t *testing.T) {
function TestIntReply_Val (line 37) | func TestIntReply_Val(t *testing.T) {
function TestSliceReply_Val (line 42) | func TestSliceReply_Val(t *testing.T) {
FILE: internal/command/rpop.go
type Rpop (line 6) | type Rpop struct
method Name (line 12) | func (c *Rpop) Name() string {
method Help (line 18) | func (c *Rpop) Help() string {
method Execute (line 25) | func (c *Rpop) Execute(args ...string) Reply {
FILE: internal/command/rpop_test.go
function TestRpop_Name (line 15) | func TestRpop_Name(t *testing.T) {
function TestRpop_Help (line 20) | func TestRpop_Help(t *testing.T) {
function TestRpop_Execute (line 27) | func TestRpop_Execute(t *testing.T) {
function TestRpop_Execute_StorageErr (line 58) | func TestRpop_Execute_StorageErr(t *testing.T) {
function TestRpop_Execute_DelEmptyList (line 73) | func TestRpop_Execute_DelEmptyList(t *testing.T) {
FILE: internal/command/rpush.go
type Rpush (line 6) | type Rpush struct
method Name (line 12) | func (c *Rpush) Name() string {
method Help (line 18) | func (c *Rpush) Help() string {
method Execute (line 25) | func (c *Rpush) Execute(args ...string) Reply {
FILE: internal/command/rpush_test.go
function TestRpush_Name (line 15) | func TestRpush_Name(t *testing.T) {
function TestRpush_Help (line 20) | func TestRpush_Help(t *testing.T) {
function TestRpush_Execute (line 27) | func TestRpush_Execute(t *testing.T) {
function TestRpush_Execute_WhiteBox (line 52) | func TestRpush_Execute_WhiteBox(t *testing.T) {
function TestRpush_Execute_StorageErr (line 120) | func TestRpush_Execute_StorageErr(t *testing.T) {
FILE: internal/command/set.go
type Set (line 10) | type Set struct
method Name (line 15) | func (c *Set) Name() string {
method Help (line 20) | func (c *Set) Help() string {
method Execute (line 27) | func (c *Set) Execute(args ...string) Reply {
FILE: internal/command/set_test.go
function TestSet_Name (line 13) | func TestSet_Name(t *testing.T) {
function TestSet_Help (line 18) | func TestSet_Help(t *testing.T) {
function TestSet_Execute (line 26) | func TestSet_Execute(t *testing.T) {
function TestSet_Execute_WhiteBox (line 45) | func TestSet_Execute_WhiteBox(t *testing.T) {
function TestSet_Execute_StorageErr (line 61) | func TestSet_Execute_StorageErr(t *testing.T) {
FILE: internal/command/setbit.go
type SetBit (line 11) | type SetBit struct
method Name (line 16) | func (c *SetBit) Name() string {
method Help (line 21) | func (c *SetBit) Help() string {
method Execute (line 27) | func (c *SetBit) Execute(args ...string) Reply {
method resolveIndex (line 71) | func (c *SetBit) resolveIndex(offset uint64) uint64 {
method growSlice (line 83) | func (c *SetBit) growSlice(sl []uint64, offset uint64) []uint64 {
method isZeroSlice (line 101) | func (c *SetBit) isZeroSlice(sl []uint64) bool {
method parseOffset (line 109) | func (c *SetBit) parseOffset(args []string) (uint64, error) {
method parseValue (line 117) | func (c *SetBit) parseValue(args []string) (uint64, error) {
FILE: internal/command/setbit_test.go
function TestSetBit_Name (line 13) | func TestSetBit_Name(t *testing.T) {
function TestSetBit_Help (line 18) | func TestSetBit_Help(t *testing.T) {
function TestSetBit_Execute (line 25) | func TestSetBit_Execute(t *testing.T) {
function TestSetBit_Execute_WhiteBox (line 53) | func TestSetBit_Execute_WhiteBox(t *testing.T) {
function TestSetBit_growSlice (line 118) | func TestSetBit_growSlice(t *testing.T) {
function TestSetBit_Execute_StorageErr (line 142) | func TestSetBit_Execute_StorageErr(t *testing.T) {
FILE: internal/command/strlen.go
type Strlen (line 10) | type Strlen struct
method Name (line 15) | func (c *Strlen) Name() string {
method Help (line 20) | func (c *Strlen) Help() string {
method Execute (line 27) | func (c *Strlen) Execute(args ...string) Reply {
FILE: internal/command/strlen_test.go
function TestStrlen_Name (line 15) | func TestStrlen_Name(t *testing.T) {
function TestStrlen_Help (line 20) | func TestStrlen_Help(t *testing.T) {
function TestStrlen_Execute (line 28) | func TestStrlen_Execute(t *testing.T) {
function TestStrlen_Execute_StorageErr (line 61) | func TestStrlen_Execute_StorageErr(t *testing.T) {
FILE: internal/command/ttl.go
type TTL (line 10) | type TTL struct
method Name (line 16) | func (c *TTL) Name() string {
method Help (line 21) | func (c *TTL) Help() string {
method Execute (line 27) | func (c *TTL) Execute(args ...string) Reply {
FILE: internal/command/ttl_test.go
function TestTTL_Name (line 14) | func TestTTL_Name(t *testing.T) {
function TestTTL_Help (line 19) | func TestTTL_Help(t *testing.T) {
function TestTTL_Execute (line 26) | func TestTTL_Execute(t *testing.T) {
function TestTTL_Execute_StorageErr (line 74) | func TestTTL_Execute_StorageErr(t *testing.T) {
FILE: internal/command/type.go
type Type (line 8) | type Type struct
method Name (line 13) | func (c *Type) Name() string {
method Help (line 18) | func (c *Type) Help() string {
method Execute (line 24) | func (c *Type) Execute(args ...string) Reply {
FILE: internal/command/type_test.go
function TestType_Name (line 14) | func TestType_Name(t *testing.T) {
function TestType_Help (line 19) | func TestType_Help(t *testing.T) {
function TestType_Execute (line 26) | func TestType_Execute(t *testing.T) {
function TestType_Execute_StorageErr (line 57) | func TestType_Execute_StorageErr(t *testing.T) {
FILE: internal/server/data_store_mock_test.go
type dataStoreMock (line 19) | type dataStoreMock struct
method All (line 79) | func (m *dataStoreMock) All() (r map[storage.Key]*storage.Value, r1 er...
method AllMinimockCounter (line 92) | func (m *dataStoreMock) AllMinimockCounter() uint64 {
method AllMinimockPreCounter (line 97) | func (m *dataStoreMock) AllMinimockPreCounter() uint64 {
method AllWithTTL (line 121) | func (m *dataStoreMock) AllWithTTL() (r map[storage.Key]*storage.Value...
method AllWithTTLMinimockCounter (line 134) | func (m *dataStoreMock) AllWithTTLMinimockCounter() uint64 {
method AllWithTTLMinimockPreCounter (line 139) | func (m *dataStoreMock) AllWithTTLMinimockPreCounter() uint64 {
method Del (line 175) | func (m *dataStoreMock) Del(p storage.Key) (r error) {
method DelMinimockCounter (line 200) | func (m *dataStoreMock) DelMinimockCounter() uint64 {
method DelMinimockPreCounter (line 205) | func (m *dataStoreMock) DelMinimockPreCounter() uint64 {
method Restore (line 241) | func (m *dataStoreMock) Restore(p map[storage.Key]*storage.Value) (r e...
method RestoreMinimockCounter (line 266) | func (m *dataStoreMock) RestoreMinimockCounter() uint64 {
method RestoreMinimockPreCounter (line 271) | func (m *dataStoreMock) RestoreMinimockPreCounter() uint64 {
method ValidateCallCounters (line 277) | func (m *dataStoreMock) ValidateCallCounters() {
method CheckMocksCalled (line 299) | func (m *dataStoreMock) CheckMocksCalled() {
method Finish (line 305) | func (m *dataStoreMock) Finish() {
method MinimockFinish (line 310) | func (m *dataStoreMock) MinimockFinish() {
method Wait (line 332) | func (m *dataStoreMock) Wait(timeout time.Duration) {
method MinimockWait (line 338) | func (m *dataStoreMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 380) | func (m *dataStoreMock) AllMocksCalled() bool {
function NewdataStoreMock (line 44) | func NewdataStoreMock(t minimock.Tester) *dataStoreMock {
type mdataStoreMockAll (line 59) | type mdataStoreMockAll struct
method Return (line 64) | func (m *mdataStoreMockAll) Return(r map[storage.Key]*storage.Value, r...
method Set (line 72) | func (m *mdataStoreMockAll) Set(f func() (r map[storage.Key]*storage.V...
type mdataStoreMockAllWithTTL (line 101) | type mdataStoreMockAllWithTTL struct
method Return (line 106) | func (m *mdataStoreMockAllWithTTL) Return(r map[storage.Key]*storage.V...
method Set (line 114) | func (m *mdataStoreMockAllWithTTL) Set(f func() (r map[storage.Key]*st...
type mdataStoreMockDel (line 143) | type mdataStoreMockDel struct
method Expect (line 154) | func (m *mdataStoreMockDel) Expect(p storage.Key) *mdataStoreMockDel {
method Return (line 160) | func (m *mdataStoreMockDel) Return(r error) *dataStoreMock {
method Set (line 168) | func (m *mdataStoreMockDel) Set(f func(p storage.Key) (r error)) *data...
type dataStoreMockDelParams (line 149) | type dataStoreMockDelParams struct
type mdataStoreMockRestore (line 209) | type mdataStoreMockRestore struct
method Expect (line 220) | func (m *mdataStoreMockRestore) Expect(p map[storage.Key]*storage.Valu...
method Return (line 226) | func (m *mdataStoreMockRestore) Return(r error) *dataStoreMock {
method Set (line 234) | func (m *mdataStoreMockRestore) Set(f func(p map[storage.Key]*storage....
type dataStoreMockRestoreParams (line 215) | type dataStoreMockRestoreParams struct
FILE: internal/server/fsm.go
type fsm (line 18) | type fsm struct
method Apply (line 27) | func (f *fsm) Apply(entry *raft.Log) interface{} {
method Snapshot (line 67) | func (f *fsm) Snapshot() (raft.FSMSnapshot, error) {
method Restore (line 92) | func (f *fsm) Restore(rc io.ReadCloser) error {
function newFsm (line 22) | func newFsm(s *Server) *fsm {
function newApplyMetadataFSMCommand (line 139) | func newApplyMetadataFSMCommand(key, value string) (*api.FSMCommand, err...
function newExecuteFSMCommand (line 143) | func newExecuteFSMCommand(command string) (*api.FSMCommand, error) {
function newFSMCommand (line 147) | func newFSMCommand(t api.FSMCommandType, req proto.Message) (*api.FSMCom...
FILE: internal/server/fsm_snapshot.go
type fsmSnapshot (line 10) | type fsmSnapshot struct
method Persist (line 17) | func (fs *fsmSnapshot) Persist(sink raft.SnapshotSink) (err error) {
method Release (line 41) | func (fs *fsmSnapshot) Release() {
type length (line 15) | type length
FILE: internal/server/gc.go
type gc (line 13) | type gc struct
method start (line 38) | func (g *gc) start() {
method stop (line 46) | func (g *gc) stop() {
method deleteExpired (line 52) | func (g *gc) deleteExpired() {
function newGc (line 22) | func newGc(
FILE: internal/server/resp/resp.go
type commandExecutor (line 15) | type commandExecutor interface
type Server (line 21) | type Server struct
method Start (line 31) | func (s *Server) Start(hostPort string) error {
method handle (line 35) | func (s *Server) handle(conn redcon.Conn, cmd redcon.Command) {
method writeResponse (line 54) | func (s *Server) writeResponse(conn redcon.Conn, resp *api.ExecuteComm...
function New (line 26) | func New(e commandExecutor) *Server {
FILE: internal/server/server.go
constant defaultListenAddr (line 29) | defaultListenAddr = "127.0.0.1:4000"
constant defaultRaftAddr (line 30) | defaultRaftAddr = "127.0.0.1:4001"
constant defaultDir (line 31) | defaultDir = "../../data"
constant defaultGCInterval (line 32) | defaultGCInterval = 500 * time.Millisecond
constant raftApplyTimeout (line 36) | raftApplyTimeout = 500 * time.Millisecond
constant raftLogCacheSize (line 37) | raftLogCacheSize = 512
constant raftMaxPoolSize (line 38) | raftMaxPoolSize = 3
constant raftTransportTimeout (line 39) | raftTransportTimeout = 10 * time.Second
constant raftSnapshotsRetain (line 40) | raftSnapshotsRetain = 3
constant raftDBFile (line 41) | raftDBFile = "raft.db"
constant leaderIPMetaKey (line 44) | leaderIPMetaKey = "leader_ip"
type commandParser (line 47) | type commandParser interface
type metaStore (line 52) | type metaStore interface
type dataStore (line 65) | type dataStore interface
type serverClock (line 77) | type serverClock interface
type Options (line 82) | type Options struct
function DefaultOptions (line 94) | func DefaultOptions() Options {
type Server (line 106) | type Server struct
method BootstrapCluster (line 133) | func (s *Server) BootstrapCluster() error {
method JoinCluster (line 151) | func (s *Server) JoinCluster(joinAddr string) error {
method setupRaft (line 179) | func (s *Server) setupRaft() error {
method start (line 229) | func (s *Server) start(hostPort string) error {
method Stop (line 255) | func (s *Server) Stop() error {
method whenLeaderChanged (line 264) | func (s *Server) whenLeaderChanged(funcs ...func(isLeader bool) error) {
method updateLeaderIP (line 280) | func (s *Server) updateLeaderIP(isLeader bool) error {
method controlGC (line 306) | func (s *Server) controlGC(isLeader bool) error {
method controlLeaderConn (line 318) | func (s *Server) controlLeaderConn(isLeader bool) error {
method leaderConn (line 335) | func (s *Server) leaderConn() (*grpc.ClientConn, error) {
method ExecuteCommand (line 363) | func (s *Server) ExecuteCommand(ctx context.Context, req *api.ExecuteC...
method AddToCluster (line 421) | func (s *Server) AddToCluster(ctx context.Context, req *api.AddToClust...
method createResponse (line 454) | func (s *Server) createResponse(res command.Reply) (*api.ExecuteComman...
method isCommandModifiesState (line 484) | func (s *Server) isCommandModifiesState(cmd command.Command) bool {
method handleSetMetaValueRequest (line 494) | func (s *Server) handleSetMetaValueRequest(req *api.UpdateMetadataRequ...
method handleExecuteCommandRequest (line 503) | func (s *Server) handleExecuteCommandRequest(req *api.ExecuteCommandRe...
method isLeader (line 516) | func (s *Server) isLeader() bool {
function New (line 121) | func New(meta metaStore, data dataStore, parser commandParser, opts Opti...
FILE: internal/server/server_clock_mock_test.go
type serverClockMock (line 16) | type serverClockMock struct
method Now (line 58) | func (m *serverClockMock) Now() (r time.Time) {
method NowMinimockCounter (line 71) | func (m *serverClockMock) NowMinimockCounter() uint64 {
method NowMinimockPreCounter (line 76) | func (m *serverClockMock) NowMinimockPreCounter() uint64 {
method ValidateCallCounters (line 82) | func (m *serverClockMock) ValidateCallCounters() {
method CheckMocksCalled (line 92) | func (m *serverClockMock) CheckMocksCalled() {
method Finish (line 98) | func (m *serverClockMock) Finish() {
method MinimockFinish (line 103) | func (m *serverClockMock) MinimockFinish() {
method Wait (line 113) | func (m *serverClockMock) Wait(timeout time.Duration) {
method MinimockWait (line 119) | func (m *serverClockMock) MinimockWait(timeout time.Duration) {
method AllMocksCalled (line 146) | func (m *serverClockMock) AllMocksCalled() bool {
function NewserverClockMock (line 26) | func NewserverClockMock(t minimock.Tester) *serverClockMock {
type mserverClockMockNow (line 38) | type mserverClockMockNow struct
method Return (line 43) | func (m *mserverClockMockNow) Return(r time.Time) *serverClockMock {
method Set (line 51) | func (m *mserverClockMockNow) Set(f func() (r time.Time)) *serverClock...
FILE: internal/storage/marshaler.go
constant ttlJSONField (line 11) | ttlJSONField = "ttl"
constant typeJSONField (line 12) | typeJSONField = "type"
constant valueJSONField (line 13) | valueJSONField = "value"
method UnmarshalJSON (line 17) | func (v *Value) UnmarshalJSON(j []byte) error {
method MarshalJSON (line 88) | func (v *Value) MarshalJSON() ([]byte, error) {
FILE: internal/storage/marshaler_test.go
function TestMarshaler_MarshalJSON (line 8) | func TestMarshaler_MarshalJSON(t *testing.T) {
function TestValue_MarshalJSON_ShouldPanic (line 90) | func TestValue_MarshalJSON_ShouldPanic(t *testing.T) {
function assertPanic (line 132) | func assertPanic(t *testing.T, f func()) {
function BenchmarkMarshaler_MarshalJSON (line 141) | func BenchmarkMarshaler_MarshalJSON(b *testing.B) {
FILE: internal/storage/memory/memory.go
type memoryClock (line 11) | type memoryClock interface
type Storage (line 16) | type Storage struct
method setItems (line 52) | func (strg *Storage) setItems(items map[storage.Key]*storage.Value) {
method Put (line 75) | func (strg *Storage) Put(key storage.Key, setter storage.ValueSetter) ...
method Get (line 104) | func (strg *Storage) Get(key storage.Key) (*storage.Value, error) {
method Del (line 115) | func (strg *Storage) Del(key storage.Key) error {
method Keys (line 124) | func (strg *Storage) Keys() ([]storage.Key, error) {
method All (line 138) | func (strg *Storage) All() (map[storage.Key]*storage.Value, error) {
method Restore (line 145) | func (strg *Storage) Restore(m map[storage.Key]*storage.Value) error {
method AllWithTTL (line 151) | func (strg *Storage) AllWithTTL() (map[storage.Key]*storage.Value, err...
method AllMeta (line 158) | func (strg *Storage) AllMeta() (map[storage.MetaKey]storage.MetaValue,...
method PutMeta (line 166) | func (strg *Storage) PutMeta(key storage.MetaKey, value storage.MetaVa...
method GetMeta (line 174) | func (strg *Storage) GetMeta(key storage.MetaKey) (storage.MetaValue, ...
method RestoreMeta (line 185) | func (strg *Storage) RestoreMeta(m map[storage.MetaKey]storage.MetaVal...
function WithClock (line 28) | func WithClock(clck memoryClock) func(*Storage) {
function New (line 35) | func New(items map[storage.Key]*storage.Value, opts ...func(*Storage)) *...
FILE: internal/storage/memory/memory_test.go
function TestNew (line 15) | func TestNew(t *testing.T) {
function TestStorage_Put_WhenValueShouldBeDeleted (line 53) | func TestStorage_Put_WhenValueShouldBeDeleted(t *testing.T) {
function TestStorage_Put_WhenValueShouldBeAdded (line 73) | func TestStorage_Put_WhenValueShouldBeAdded(t *testing.T) {
function TestStorage_Put_ExpiredKey (line 93) | func TestStorage_Put_ExpiredKey(t *testing.T) {
function TestStorage_Get (line 110) | func TestStorage_Get(t *testing.T) {
function TestStorage_Del (line 161) | func TestStorage_Del(t *testing.T) {
function TestStorage_Keys (line 190) | func TestStorage_Keys(t *testing.T) {
function TestStorage_All (line 210) | func TestStorage_All(t *testing.T) {
function TestStorage_AllWithTTL (line 228) | func TestStorage_AllWithTTL(t *testing.T) {
function assertKeysEquals (line 248) | func assertKeysEquals(t *testing.T, a, b []storage.Key) bool {
FILE: internal/storage/storage.go
type DataType (line 14) | type DataType
method String (line 28) | func (dt DataType) String() string {
constant StringDataType (line 18) | StringDataType DataType = "string"
constant BitMapDataType (line 20) | BitMapDataType DataType = "bitmap"
constant ListDataType (line 22) | ListDataType DataType = "list"
constant MapDataType (line 24) | MapDataType DataType = "map"
type Key (line 33) | type Key
type Value (line 36) | type Value struct
method Data (line 52) | func (v *Value) Data() interface{} {
method Type (line 57) | func (v *Value) Type() DataType {
method IsExpired (line 62) | func (v *Value) IsExpired(till time.Time) bool {
method SetTTL (line 70) | func (v *Value) SetTTL(at time.Time) {
method TTL (line 75) | func (v *Value) TTL() int64 {
type MetaKey (line 43) | type MetaKey
type MetaValue (line 46) | type MetaValue
type ValueSetter (line 49) | type ValueSetter
function NewString (line 80) | func NewString(str string) *Value {
function NewBitMap (line 89) | func NewBitMap(value []uint64) *Value {
function NewList (line 98) | func NewList(data []string) *Value {
function NewMap (line 107) | func NewMap(val map[string]string) *Value {
FILE: internal/storage/storage_test.go
function TestDataType_String (line 12) | func TestDataType_String(t *testing.T) {
function TestValue_Data_And_Value_Type (line 32) | func TestValue_Data_And_Value_Type(t *testing.T) {
function TestValue_IsExpired (line 63) | func TestValue_IsExpired(t *testing.T) {
function TestValue_SetTTL (line 83) | func TestValue_SetTTL(t *testing.T) {
function TestValue_TTL (line 95) | func TestValue_TTL(t *testing.T) {
function TestNewStringValue (line 106) | func TestNewStringValue(t *testing.T) {
function TestNewBitMapValue (line 113) | func TestNewBitMapValue(t *testing.T) {
function TestNewListValue (line 120) | func TestNewListValue(t *testing.T) {
function TestNewMapValue (line 127) | func TestNewMapValue(t *testing.T) {
FILE: vendor/github.com/Bowery/prompt/ansi_unix.go
type AnsiReader (line 12) | type AnsiReader struct
method Read (line 22) | func (ar *AnsiReader) Read(b []byte) (int, error) {
function NewAnsiReader (line 17) | func NewAnsiReader(in *os.File) *AnsiReader {
type AnsiWriter (line 27) | type AnsiWriter struct
method Write (line 37) | func (aw *AnsiWriter) Write(b []byte) (int, error) {
function NewAnsiWriter (line 32) | func NewAnsiWriter(out *os.File) *AnsiWriter {
FILE: vendor/github.com/Bowery/prompt/ansi_windows.go
constant keyEventType (line 13) | keyEventType = 0x0001
type inputRecord (line 20) | type inputRecord struct
type keyEventRecord (line 29) | type keyEventRecord struct
type AnsiReader (line 40) | type AnsiReader struct
method Read (line 52) | func (ar *AnsiReader) Read(b []byte) (int, error) {
method shortFunction (line 206) | func (ar *AnsiReader) shortFunction(ident string, shift, ctrl, alt boo...
method longFunction (line 221) | func (ar *AnsiReader) longFunction(ident string, shift, ctrl, alt bool...
method arrow (line 237) | func (ar *AnsiReader) arrow(ident string, shift, ctrl, alt bool) string {
function NewAnsiReader (line 46) | func NewAnsiReader(in *os.File) *AnsiReader {
type AnsiWriter (line 253) | type AnsiWriter struct
method Write (line 266) | func (aw *AnsiWriter) Write(b []byte) (int, error) {
method finish (line 501) | func (aw *AnsiWriter) finish(parse func([]byte) error) error {
function NewAnsiWriter (line 259) | func NewAnsiWriter(out *os.File) *AnsiWriter {
FILE: vendor/github.com/Bowery/prompt/buffer.go
type Buffer (line 11) | type Buffer struct
method String (line 31) | func (buf *Buffer) String() string {
method Insert (line 36) | func (buf *Buffer) Insert(rs ...rune) error {
method Set (line 59) | func (buf *Buffer) Set(rs ...rune) error {
method Start (line 69) | func (buf *Buffer) Start() error {
method End (line 79) | func (buf *Buffer) End() error {
method Left (line 89) | func (buf *Buffer) Left() error {
method Right (line 99) | func (buf *Buffer) Right() error {
method Del (line 109) | func (buf *Buffer) Del() error {
method DelLeft (line 122) | func (buf *Buffer) DelLeft() error {
method EndLine (line 136) | func (buf *Buffer) EndLine() error {
function NewBuffer (line 22) | func NewBuffer(prompt string, out *os.File, echo bool) *Buffer {
function toBytes (line 142) | func toBytes(runes []rune) []byte {
FILE: vendor/github.com/Bowery/prompt/buffer_unix.go
method Refresh (line 12) | func (buf *Buffer) Refresh() error {
method ClsScreen (line 69) | func (buf *Buffer) ClsScreen() error {
FILE: vendor/github.com/Bowery/prompt/buffer_windows.go
method Refresh (line 15) | func (buf *Buffer) Refresh() error {
method ClsScreen (line 78) | func (buf *Buffer) ClsScreen() error {
method delLine (line 110) | func (buf *Buffer) delLine(csbi *consoleScreenBufferInfo) error {
method mvLeftEdge (line 126) | func (buf *Buffer) mvLeftEdge(csbi *consoleScreenBufferInfo) error {
method mvToCol (line 140) | func (buf *Buffer) mvToCol(csbi *consoleScreenBufferInfo, x int) error {
FILE: vendor/github.com/Bowery/prompt/ioctl_bsd.go
constant tcgets (line 12) | tcgets = unix.TIOCGETA
constant tcsets (line 13) | tcsets = unix.TIOCSETA
constant tcsetsf (line 14) | tcsetsf = unix.TIOCSETAF
FILE: vendor/github.com/Bowery/prompt/ioctl_linux.go
constant tcgets (line 10) | tcgets = unix.TCGETS
constant tcsets (line 11) | tcsets = unix.TCSETS
constant tcsetsf (line 12) | tcsetsf = unix.TCSETSF
FILE: vendor/github.com/Bowery/prompt/ioctl_solaris.go
constant tcgets (line 12) | tcgets = unix.TCGETS
constant tcsetsf (line 13) | tcsetsf = unix.TCSETSF
constant tcsets (line 14) | tcsets = unix.TCSETS
function terminalSize (line 18) | func terminalSize(out *os.File) (int, int, error) {
function getTermios (line 28) | func getTermios(fd uintptr) (*unix.Termios, error) {
function setTermios (line 34) | func setTermios(fd uintptr, flush bool, mode *unix.Termios) error {
FILE: vendor/github.com/Bowery/prompt/ioctl_unix.go
type winsize (line 15) | type winsize struct
function terminalSize (line 22) | func terminalSize(out *os.File) (int, int, error) {
function getTermios (line 35) | func getTermios(fd uintptr) (*unix.Termios, error) {
function setTermios (line 49) | func setTermios(fd uintptr, flush bool, mode *unix.Termios) error {
FILE: vendor/github.com/Bowery/prompt/keys.go
constant backKey (line 9) | backKey = '\u007f'
constant escKey (line 10) | escKey = '\u001B'
constant spaceKey (line 11) | spaceKey = '\u0020'
constant ctrlA (line 15) | ctrlA = iota + 1
constant ctrlB (line 16) | ctrlB
constant ctrlC (line 17) | ctrlC
constant ctrlD (line 18) | ctrlD
constant ctrlE (line 19) | ctrlE
constant ctrlF (line 20) | ctrlF
constant ctrlG (line 21) | ctrlG
constant ctrlH (line 22) | ctrlH
constant tabKey (line 23) | tabKey
constant ctrlJ (line 24) | ctrlJ
constant ctrlK (line 25) | ctrlK
constant ctrlL (line 26) | ctrlL
constant returnKey (line 27) | returnKey
constant ctrlN (line 28) | ctrlN
constant ctrlO (line 29) | ctrlO
constant ctrlP (line 30) | ctrlP
constant ctrlQ (line 31) | ctrlQ
constant ctrlR (line 32) | ctrlR
constant ctrlS (line 33) | ctrlS
constant ctrlT (line 34) | ctrlT
constant ctrlU (line 35) | ctrlU
constant ctrlV (line 36) | ctrlV
constant ctrlW (line 37) | ctrlW
constant ctrlX (line 38) | ctrlX
constant ctrlY (line 39) | ctrlY
constant ctrlZ (line 40) | ctrlZ
FILE: vendor/github.com/Bowery/prompt/keys_unix.go
constant mvToCol (line 7) | mvToCol = "\u001b[0G\u001b[%dC"
FILE: vendor/github.com/Bowery/prompt/keys_windows.go
constant f1Key (line 6) | f1Key = 0x70 + iota
constant f2Key (line 7) | f2Key
constant f3Key (line 8) | f3Key
constant f4Key (line 9) | f4Key
constant f5Key (line 10) | f5Key
constant f6Key (line 11) | f6Key
constant f7Key (line 12) | f7Key
constant f8Key (line 13) | f8Key
constant f9Key (line 14) | f9Key
constant f10Key (line 15) | f10Key
constant f11Key (line 16) | f11Key
constant f12Key (line 17) | f12Key
constant homeKey (line 19) | homeKey = 0x24
constant endKey (line 20) | endKey = 0x23
constant upKey (line 21) | upKey = 0x26
constant downKey (line 22) | downKey = 0x28
constant rightKey (line 23) | rightKey = 0x27
constant leftKey (line 24) | leftKey = 0x25
constant insertKey (line 25) | insertKey = 0x2d
constant pgupKey (line 26) | pgupKey = 0x21
constant pgdownKey (line 27) | pgdownKey = 0x22
constant deleteKey (line 28) | deleteKey = 0x2e
constant leftAltKey (line 29) | leftAltKey = 0x2
constant rightAltKey (line 30) | rightAltKey = 0x1
constant leftCtrlKey (line 31) | leftCtrlKey = 0x8
constant rightCtrlKey (line 32) | rightCtrlKey = 0x4
constant shiftKey (line 33) | shiftKey = 0x10
FILE: vendor/github.com/Bowery/prompt/prompt.go
function Basic (line 33) | func Basic(prefix string, required bool) (string, error) {
function BasicDefault (line 44) | func BasicDefault(prefix, def string) (string, error) {
function Ask (line 55) | func Ask(question string) (bool, error) {
function Custom (line 66) | func Custom(prefix string, test func(string) (string, bool)) (string, er...
function Password (line 77) | func Password(prefix string) (string, error) {
FILE: vendor/github.com/Bowery/prompt/term.go
constant evChar (line 22) | evChar = iota
constant evSkip (line 23) | evSkip
constant evReturn (line 24) | evReturn
constant evEOF (line 25) | evEOF
constant evCtrlC (line 26) | evCtrlC
constant evBack (line 27) | evBack
constant evClear (line 28) | evClear
constant evHome (line 29) | evHome
constant evEnd (line 30) | evEnd
constant evUp (line 31) | evUp
constant evDown (line 32) | evDown
constant evRight (line 33) | evRight
constant evLeft (line 34) | evLeft
constant evDel (line 35) | evDel
function IsNotTerminal (line 39) | func IsNotTerminal(err error) bool {
function TerminalSize (line 44) | func TerminalSize(out *os.File) (int, int, error) {
type Terminal (line 49) | type Terminal struct
method Basic (line 77) | func (term *Terminal) Basic(prefix string, required bool) (string, err...
method BasicDefault (line 88) | func (term *Terminal) BasicDefault(prefix, def string) (string, error) {
method Ask (line 100) | func (term *Terminal) Ask(question string) (bool, error) {
method Custom (line 124) | func (term *Terminal) Custom(prefix string, test func(string) (string,...
method Password (line 142) | func (term *Terminal) Password(prefix string) (string, error) {
method GetPrompt (line 157) | func (term *Terminal) GetPrompt(prefix string) (string, error) {
method GetPassword (line 169) | func (term *Terminal) GetPassword(prefix string) (string, error) {
method Close (line 181) | func (term *Terminal) Close() error {
method Reopen (line 186) | func (term *Terminal) Reopen() error {
method simplePrompt (line 199) | func (term *Terminal) simplePrompt(prefix string) (string, error) {
method setup (line 217) | func (term *Terminal) setup(buf *Buffer, in io.Reader) (*bufio.Reader,...
method read (line 235) | func (term *Terminal) read(in *bufio.Reader) (int, rune, error) {
method prompt (line 330) | func (term *Terminal) prompt(buf *Buffer, in io.Reader) (string, error) {
method password (line 452) | func (term *Terminal) password(buf *Buffer, in io.Reader) (string, err...
function NewTerminal (line 59) | func NewTerminal() (*Terminal, error) {
FILE: vendor/github.com/Bowery/prompt/term_unix.go
function supportsEditing (line 17) | func supportsEditing() bool {
function isNotTerminal (line 30) | func isNotTerminal(err error) bool {
type terminal (line 35) | type terminal struct
method Close (line 87) | func (term *terminal) Close() error {
function newTerminal (line 42) | func newTerminal(in *os.File) (*terminal, error) {
FILE: vendor/github.com/Bowery/prompt/term_windows.go
constant echoInputFlag (line 13) | echoInputFlag = 0x0004
constant insertModeFlag (line 14) | insertModeFlag = 0x0020
constant lineInputFlag (line 15) | lineInputFlag = 0x0002
constant mouseInputFlag (line 16) | mouseInputFlag = 0x0010
constant processedInputFlag (line 17) | processedInputFlag = 0x0001
constant windowInputFlag (line 18) | windowInputFlag = 0x0008
constant errnoInvalidHandle (line 22) | errnoInvalidHandle = 0x6
type consoleScreenBufferInfo (line 31) | type consoleScreenBufferInfo struct
type coord (line 40) | type coord struct
type smallRect (line 46) | type smallRect struct
function terminalSize (line 54) | func terminalSize(out *os.File) (int, int, error) {
function isNotTerminal (line 70) | func isNotTerminal(err error) bool {
type terminal (line 77) | type terminal struct
method Close (line 107) | func (term *terminal) Close() error {
function newTerminal (line 84) | func newTerminal(in *os.File) (*terminal, error) {
FILE: vendor/github.com/armon/go-metrics/const_unix.go
constant DefaultSignal (line 11) | DefaultSignal = syscall.SIGUSR1
FILE: vendor/github.com/armon/go-metrics/const_windows.go
constant DefaultSignal (line 12) | DefaultSignal = syscall.Signal(21)
FILE: vendor/github.com/armon/go-metrics/inmem.go
type InmemSink (line 16) | type InmemSink struct
method SetGauge (line 157) | func (i *InmemSink) SetGauge(key []string, val float32) {
method SetGaugeWithLabels (line 161) | func (i *InmemSink) SetGaugeWithLabels(key []string, val float32, labe...
method EmitKey (line 170) | func (i *InmemSink) EmitKey(key []string, val float32) {
method IncrCounter (line 180) | func (i *InmemSink) IncrCounter(key []string, val float32) {
method IncrCounterWithLabels (line 184) | func (i *InmemSink) IncrCounterWithLabels(key []string, val float32, l...
method AddSample (line 203) | func (i *InmemSink) AddSample(key []string, val float32) {
method AddSampleWithLabels (line 207) | func (i *InmemSink) AddSampleWithLabels(key []string, val float32, lab...
method Data (line 228) | func (i *InmemSink) Data() []*IntervalMetrics {
method getExistingInterval (line 269) | func (i *InmemSink) getExistingInterval(intv time.Time) *IntervalMetri...
method createInterval (line 280) | func (i *InmemSink) createInterval(intv time.Time) *IntervalMetrics {
method getInterval (line 304) | func (i *InmemSink) getInterval() *IntervalMetrics {
method flattenKey (line 313) | func (i *InmemSink) flattenKey(parts []string) string {
method flattenKeyLabels (line 329) | func (i *InmemSink) flattenKeyLabels(parts []string, labels []Label) (...
type IntervalMetrics (line 36) | type IntervalMetrics struct
function NewIntervalMetrics (line 59) | func NewIntervalMetrics(intv time.Time) *IntervalMetrics {
type AggregateSample (line 71) | type AggregateSample struct
method Stddev (line 82) | func (a *AggregateSample) Stddev() float64 {
method Mean (line 92) | func (a *AggregateSample) Mean() float64 {
method Ingest (line 100) | func (a *AggregateSample) Ingest(v float64, rateDenom float64) {
method String (line 114) | func (a *AggregateSample) String() string {
function NewInmemSinkFromURL (line 127) | func NewInmemSinkFromURL(u *url.URL) (MetricSink, error) {
function NewInmemSink (line 145) | func NewInmemSink(interval, retain time.Duration) *InmemSink {
FILE: vendor/github.com/armon/go-metrics/inmem_endpoint.go
type MetricsSummary (line 11) | type MetricsSummary struct
type GaugeValue (line 19) | type GaugeValue struct
type PointValue (line 28) | type PointValue struct
type SampledValue (line 33) | type SampledValue struct
method DisplayMetrics (line 45) | func (i *InmemSink) DisplayMetrics(resp http.ResponseWriter, req *http.R...
function formatSamples (line 96) | func formatSamples(source map[string]SampledValue) []SampledValue {
FILE: vendor/github.com/armon/go-metrics/inmem_signal.go
type InmemSignal (line 16) | type InmemSignal struct
method Stop (line 49) | func (i *InmemSignal) Stop() {
method run (line 62) | func (i *InmemSignal) run() {
method dumpStats (line 74) | func (i *InmemSignal) dumpStats() {
method flattenLabels (line 107) | func (i *InmemSignal) flattenLabels(name string, labels []Label) string {
function NewInmemSignal (line 29) | func NewInmemSignal(inmem *InmemSink, sig syscall.Signal, w io.Writer) *...
function DefaultInmemSignal (line 44) | func DefaultInmemSignal(inmem *InmemSink) *InmemSignal {
FILE: vendor/github.com/armon/go-metrics/metrics.go
type Label (line 11) | type Label struct
method SetGauge (line 16) | func (m *Metrics) SetGauge(key []string, val float32) {
method SetGaugeWithLabels (line 20) | func (m *Metrics) SetGaugeWithLabels(key []string, val float32, labels [...
method EmitKey (line 45) | func (m *Metrics) EmitKey(key []string, val float32) {
method IncrCounter (line 59) | func (m *Metrics) IncrCounter(key []string, val float32) {
method IncrCounterWithLabels (line 63) | func (m *Metrics) IncrCounterWithLabels(key []string, val float32, label...
method AddSample (line 84) | func (m *Metrics) AddSample(key []string, val float32) {
method AddSampleWithLabels (line 88) | func (m *Metrics) AddSampleWithLabels(key []string, val float32, labels ...
method MeasureSince (line 109) | func (m *Metrics) MeasureSince(key []string, start time.Time) {
method MeasureSinceWithLabels (line 113) | func (m *Metrics) MeasureSinceWithLabels(key []string, start time.Time, ...
method UpdateFilter (line 138) | func (m *Metrics) UpdateFilter(allow, block []string) {
method UpdateFilterAndLabels (line 143) | func (m *Metrics) UpdateFilterAndLabels(allow, block, allowedLabels, blo...
method labelIsAllowed (line 177) | func (m *Metrics) labelIsAllowed(label *Label) bool {
method filterLabels (line 196) | func (m *Metrics) filterLabels(labels []Label) []Label {
method allowMetric (line 211) | func (m *Metrics) allowMetric(key []string, labels []Label) (bool, []Lab...
method collectStats (line 228) | func (m *Metrics) collectStats() {
method emitRuntimeStats (line 236) | func (m *Metrics) emitRuntimeStats() {
function insert (line 273) | func insert(i int, v string, s []string) []string {
FILE: vendor/github.com/armon/go-metrics/sink.go
type MetricSink (line 10) | type MetricSink interface
type BlackholeSink (line 28) | type BlackholeSink struct
method SetGauge (line 30) | func (*BlackholeSink) SetGauge(key []string, val float32) ...
method SetGaugeWithLabels (line 31) | func (*BlackholeSink) SetGaugeWithLabels(key []string, val float32, la...
method EmitKey (line 32) | func (*BlackholeSink) EmitKey(key []string, val float32) ...
method IncrCounter (line 33) | func (*BlackholeSink) IncrCounter(key []string, val float32) ...
method IncrCounterWithLabels (line 34) | func (*BlackholeSink) IncrCounterWithLabels(key []string, val float32,...
method AddSample (line 35) | func (*BlackholeSink) AddSample(key []string, val float32) ...
method AddSampleWithLabels (line 36) | func (*BlackholeSink) AddSampleWithLabels(key []string, val float32, l...
type FanoutSink (line 39) | type FanoutSink
method SetGauge (line 41) | func (fh FanoutSink) SetGauge(key []string, val float32) {
method SetGaugeWithLabels (line 45) | func (fh FanoutSink) SetGaugeWithLabels(key []string, val float32, lab...
method EmitKey (line 51) | func (fh FanoutSink) EmitKey(key []string, val float32) {
method IncrCounter (line 57) | func (fh FanoutSink) IncrCounter(key []string, val float32) {
method IncrCounterWithLabels (line 61) | func (fh FanoutSink) IncrCounterWithLabels(key []string, val float32, ...
method AddSample (line 67) | func (fh FanoutSink) AddSample(key []string, val float32) {
method AddSampleWithLabels (line 71) | func (fh FanoutSink) AddSampleWithLabels(key []string, val float32, la...
type sinkURLFactoryFunc (line 79) | type sinkURLFactoryFunc
function NewMetricSinkFromURL (line 102) | func NewMetricSinkFromURL(urlStr string) (MetricSink, error) {
FILE: vendor/github.com/armon/go-metrics/start.go
type Config (line 13) | type Config struct
type Metrics (line 33) | type Metrics struct
function init (line 46) | func init() {
function DefaultConfig (line 52) | func DefaultConfig(serviceName string) *Config {
function New (line 71) | func New(conf *Config, sink MetricSink) (*Metrics, error) {
function NewGlobal (line 86) | func NewGlobal(conf *Config, sink MetricSink) (*Metrics, error) {
function SetGauge (line 95) | func SetGauge(key []string, val float32) {
function SetGaugeWithLabels (line 99) | func SetGaugeWithLabels(key []string, val float32, labels []Label) {
function EmitKey (line 103) | func EmitKey(key []string, val float32) {
function IncrCounter (line 107) | func IncrCounter(key []string, val float32) {
function IncrCounterWithLabels (line 111) | func IncrCounterWithLabels(key []string, val float32, labels []Label) {
function AddSample (line 115) | func AddSample(key []string, val float32) {
function AddSampleWithLabels (line 119) | func AddSampleWithLabels(key []string, val float32, labels []Label) {
function MeasureSince (line 123) | func MeasureSince(key []string, start time.Time) {
function MeasureSinceWithLabels (line 127) | func MeasureSinceWithLabels(key []string, start time.Time, labels []Labe...
function UpdateFilter (line 131) | func UpdateFilter(allow, block []string) {
function UpdateFilterAndLabels (line 139) | func UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels []...
FILE: vendor/github.com/armon/go-metrics/statsd.go
constant statsdMaxLen (line 16) | statsdMaxLen = 1400
type StatsdSink (line 22) | type StatsdSink struct
method Shutdown (line 44) | func (s *StatsdSink) Shutdown() {
method SetGauge (line 48) | func (s *StatsdSink) SetGauge(key []string, val float32) {
method SetGaugeWithLabels (line 53) | func (s *StatsdSink) SetGaugeWithLabels(key []string, val float32, lab...
method EmitKey (line 58) | func (s *StatsdSink) EmitKey(key []string, val float32) {
method IncrCounter (line 63) | func (s *StatsdSink) IncrCounter(key []string, val float32) {
method IncrCounterWithLabels (line 68) | func (s *StatsdSink) IncrCounterWithLabels(key []string, val float32, ...
method AddSample (line 73) | func (s *StatsdSink) AddSample(key []string, val float32) {
method AddSampleWithLabels (line 78) | func (s *StatsdSink) AddSampleWithLabels(key []string, val float32, la...
method flattenKey (line 84) | func (s *StatsdSink) flattenKey(parts []string) string {
method flattenKeyLabels (line 99) | func (s *StatsdSink) flattenKeyLabels(parts []string, labels []Label) ...
method pushMetric (line 107) | func (s *StatsdSink) pushMetric(m string) {
method flushMetrics (line 115) | func (s *StatsdSink) flushMetrics() {
function NewStatsdSinkFromURL (line 29) | func NewStatsdSinkFromURL(u *url.URL) (MetricSink, error) {
function NewStatsdSink (line 34) | func NewStatsdSink(addr string) (*StatsdSink, error) {
FILE: vendor/github.com/armon/go-metrics/statsite.go
constant flushInterval (line 17) | flushInterval = 100 * time.Millisecond
function NewStatsiteSinkFromURL (line 22) | func NewStatsiteSinkFromURL(u *url.URL) (MetricSink, error) {
type StatsiteSink (line 28) | type StatsiteSink struct
method Shutdown (line 44) | func (s *StatsiteSink) Shutdown() {
method SetGauge (line 48) | func (s *StatsiteSink) SetGauge(key []string, val float32) {
method SetGaugeWithLabels (line 53) | func (s *StatsiteSink) SetGaugeWithLabels(key []string, val float32, l...
method EmitKey (line 58) | func (s *StatsiteSink) EmitKey(key []string, val float32) {
method IncrCounter (line 63) | func (s *StatsiteSink) IncrCounter(key []string, val float32) {
method IncrCounterWithLabels (line 68) | func (s *StatsiteSink) IncrCounterWithLabels(key []string, val float32...
method AddSample (line 73) | func (s *StatsiteSink) AddSample(key []string, val float32) {
method AddSampleWithLabels (line 78) | func (s *StatsiteSink) AddSampleWithLabels(key []string, val float32, ...
method flattenKey (line 84) | func (s *StatsiteSink) flattenKey(parts []string) string {
method flattenKeyLabels (line 99) | func (s *StatsiteSink) flattenKeyLabels(parts []string, labels []Label...
method pushMetric (line 107) | func (s *StatsiteSink) pushMetric(m string) {
method flushMetrics (line 115) | func (s *StatsiteSink) flushMetrics() {
function NewStatsiteSink (line 34) | func NewStatsiteSink(addr string) (*StatsiteSink, error) {
FILE: vendor/github.com/boltdb/bolt/bolt_386.go
constant maxMapSize (line 4) | maxMapSize = 0x7FFFFFFF
constant maxAllocSize (line 7) | maxAllocSize = 0xFFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_amd64.go
constant maxMapSize (line 4) | maxMapSize = 0xFFFFFFFFFFFF
constant maxAllocSize (line 7) | maxAllocSize = 0x7FFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_arm.go
constant maxMapSize (line 6) | maxMapSize = 0x7FFFFFFF
constant maxAllocSize (line 9) | maxAllocSize = 0xFFFFFFF
function init (line 14) | func init() {
FILE: vendor/github.com/boltdb/bolt/bolt_arm64.go
constant maxMapSize (line 6) | maxMapSize = 0xFFFFFFFFFFFF
constant maxAllocSize (line 9) | maxAllocSize = 0x7FFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_linux.go
function fdatasync (line 8) | func fdatasync(db *DB) error {
FILE: vendor/github.com/boltdb/bolt/bolt_openbsd.go
constant msAsync (line 9) | msAsync = 1 << iota
constant msSync (line 10) | msSync
constant msInvalidate (line 11) | msInvalidate
function msync (line 14) | func msync(db *DB) error {
function fdatasync (line 22) | func fdatasync(db *DB) error {
FILE: vendor/github.com/boltdb/bolt/bolt_ppc.go
constant maxMapSize (line 6) | maxMapSize = 0x7FFFFFFF
constant maxAllocSize (line 9) | maxAllocSize = 0xFFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_ppc64.go
constant maxMapSize (line 6) | maxMapSize = 0xFFFFFFFFFFFF
constant maxAllocSize (line 9) | maxAllocSize = 0x7FFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_ppc64le.go
constant maxMapSize (line 6) | maxMapSize = 0xFFFFFFFFFFFF
constant maxAllocSize (line 9) | maxAllocSize = 0x7FFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_s390x.go
constant maxMapSize (line 6) | maxMapSize = 0xFFFFFFFFFFFF
constant maxAllocSize (line 9) | maxAllocSize = 0x7FFFFFFF
FILE: vendor/github.com/boltdb/bolt/bolt_unix.go
function flock (line 14) | func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Durati...
function funlock (line 43) | func funlock(db *DB) error {
function mmap (line 48) | func mmap(db *DB, sz int) error {
function munmap (line 68) | func munmap(db *DB) error {
function madvise (line 83) | func madvise(b []byte, advice int) (err error) {
FILE: vendor/github.com/boltdb/bolt/bolt_unix_solaris.go
function flock (line 14) | func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Durati...
function funlock (line 48) | func funlock(db *DB) error {
function mmap (line 58) | func mmap(db *DB, sz int) error {
function munmap (line 78) | func munmap(db *DB) error {
FILE: vendor/github.com/boltdb/bolt/bolt_windows.go
constant lockExt (line 19) | lockExt = ".lock"
constant flagLockExclusive (line 22) | flagLockExclusive = 2
constant flagLockFailImmediately (line 23) | flagLockFailImmediately = 1
constant errLockViolation (line 26) | errLockViolation syscall.Errno = 0x21
function lockFileEx (line 29) | func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uin...
function unlockFileEx (line 37) | func unlockFileEx(h syscall.Handle, reserved, locklow, lockhigh uint32, ...
function fdatasync (line 46) | func fdatasync(db *DB) error {
function flock (line 51) | func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Durati...
function funlock (line 89) | func funlock(db *DB) error {
function mmap (line 98) | func mmap(db *DB, sz int) error {
function munmap (line 134) | func munmap(db *DB) error {
FILE: vendor/github.com/boltdb/bolt/boltsync_unix.go
function fdatasync (line 6) | func fdatasync(db *DB) error {
FILE: vendor/github.com/boltdb/bolt/bucket.go
constant MaxKeySize (line 11) | MaxKeySize = 32768
constant MaxValueSize (line 14) | MaxValueSize = (1 << 31) - 2
constant maxUint (line 18) | maxUint = ^uint(0)
constant minUint (line 19) | minUint = 0
constant maxInt (line 20) | maxInt = int(^uint(0) >> 1)
constant minInt (line 21) | minInt = -maxInt - 1
constant bucketHeaderSize (line 24) | bucketHeaderSize = int(unsafe.Sizeof(bucket{}))
constant minFillPercent (line 27) | minFillPercent = 0.1
constant maxFillPercent (line 28) | maxFillPercent = 1.0
constant DefaultFillPercent (line 33) | DefaultFillPercent = 0.5
type Bucket (line 36) | type Bucket struct
method Tx (line 72) | func (b *Bucket) Tx() *Tx {
method Root (line 77) | func (b *Bucket) Root() pgid {
method Writable (line 82) | func (b *Bucket) Writable() bool {
method Cursor (line 89) | func (b *Bucket) Cursor() *Cursor {
method Bucket (line 103) | func (b *Bucket) Bucket(name []byte) *Bucket {
method openBucket (line 130) | func (b *Bucket) openBucket(value []byte) *Bucket {
method CreateBucket (line 161) | func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
method CreateBucketIfNotExists (line 205) | func (b *Bucket) CreateBucketIfNotExists(key []byte) (*Bucket, error) {
method DeleteBucket (line 217) | func (b *Bucket) DeleteBucket(key []byte) error {
method Get (line 266) | func (b *Bucket) Get(key []byte) []byte {
method Put (line 285) | func (b *Bucket) Put(key []byte, value []byte) error {
method Delete (line 317) | func (b *Bucket) Delete(key []byte) error {
method Sequence (line 340) | func (b *Bucket) Sequence() uint64 { return b.bucket.sequence }
method SetSequence (line 343) | func (b *Bucket) SetSequence(v uint64) error {
method NextSequence (line 362) | func (b *Bucket) NextSequence() (uint64, error) {
method ForEach (line 384) | func (b *Bucket) ForEach(fn func(k, v []byte) error) error {
method Stats (line 398) | func (b *Bucket) Stats() BucketStats {
method forEachPage (line 480) | func (b *Bucket) forEachPage(fn func(*page, int)) {
method forEachPageNode (line 493) | func (b *Bucket) forEachPageNode(fn func(*page, *node, int)) {
method _forEachPageNode (line 502) | func (b *Bucket) _forEachPageNode(pgid pgid, depth int, fn func(*page,...
method spill (line 526) | func (b *Bucket) spill() error {
method inlineable (line 586) | func (b *Bucket) inlineable() bool {
method maxInlineBucketSize (line 611) | func (b *Bucket) maxInlineBucketSize() int {
method write (line 616) | func (b *Bucket) write() []byte {
method rebalance (line 633) | func (b *Bucket) rebalance() {
method node (line 643) | func (b *Bucket) node(pgid pgid, parent *node) *node {
method free (line 676) | func (b *Bucket) free() {
method dereference (line 693) | func (b *Bucket) dereference() {
method pageNode (line 705) | func (b *Bucket) pageNode(id pgid) (*page, *node) {
type bucket (line 56) | type bucket struct
function newBucket (line 62) | func newBucket(tx *Tx) Bucket {
type BucketStats (line 730) | type BucketStats struct
method Add (line 753) | func (s *BucketStats) Add(other BucketStats) {
function cloneBytes (line 773) | func cloneBytes(v []byte) []byte {
FILE: vendor/github.com/boltdb/bolt/cursor.go
type Cursor (line 18) | type Cursor struct
method Bucket (line 24) | func (c *Cursor) Bucket() *Bucket {
method First (line 31) | func (c *Cursor) First() (key []byte, value []byte) {
method Last (line 55) | func (c *Cursor) Last() (key []byte, value []byte) {
method Next (line 73) | func (c *Cursor) Next() (key []byte, value []byte) {
method Prev (line 85) | func (c *Cursor) Prev() (key []byte, value []byte) {
method Seek (line 117) | func (c *Cursor) Seek(seek []byte) (key []byte, value []byte) {
method Delete (line 135) | func (c *Cursor) Delete() error {
method seek (line 154) | func (c *Cursor) seek(seek []byte) (key []byte, value []byte, flags ui...
method first (line 172) | func (c *Cursor) first() {
method last (line 193) | func (c *Cursor) last() {
method next (line 218) | func (c *Cursor) next() (key []byte, value []byte, flags uint32) {
method search (line 253) | func (c *Cursor) search(key []byte, pgid pgid) {
method searchNode (line 274) | func (c *Cursor) searchNode(key []byte, n *node) {
method searchPage (line 294) | func (c *Cursor) searchPage(key []byte, p *page) {
method nsearch (line 318) | func (c *Cursor) nsearch(key []byte) {
method keyValue (line 340) | func (c *Cursor) keyValue() ([]byte, []byte, uint32) {
method node (line 358) | func (c *Cursor) node() *node {
type elemRef (line 380) | type elemRef struct
method isLeaf (line 387) | func (r *elemRef) isLeaf() bool {
method count (line 395) | func (r *elemRef) count() int {
FILE: vendor/github.com/boltdb/bolt/db.go
constant maxMmapStep (line 18) | maxMmapStep = 1 << 30
constant version (line 21) | version = 2
constant magic (line 24) | magic uint32 = 0xED0CDAED
constant IgnoreNoSync (line 30) | IgnoreNoSync = runtime.GOOS == "openbsd"
constant DefaultMaxBatchSize (line 34) | DefaultMaxBatchSize int = 1000
constant DefaultMaxBatchDelay (line 35) | DefaultMaxBatchDelay = 10 * time.Millisecond
constant DefaultAllocSize (line 36) | DefaultAllocSize = 16 * 1024 * 1024
type DB (line 45) | type DB struct
method Path (line 133) | func (db *DB) Path() string {
method GoString (line 138) | func (db *DB) GoString() string {
method String (line 143) | func (db *DB) String() string {
method mmap (line 245) | func (db *DB) mmap(minsz int) error {
method munmap (line 298) | func (db *DB) munmap() error {
method mmapSize (line 308) | func (db *DB) mmapSize(size int) (int, error) {
method init (line 343) | func (db *DB) init() error {
method Close (line 391) | func (db *DB) Close() error {
method close (line 404) | func (db *DB) close() error {
method Begin (line 459) | func (db *DB) Begin(writable bool) (*Tx, error) {
method beginTx (line 466) | func (db *DB) beginTx() (*Tx, error) {
method beginRWTx (line 504) | func (db *DB) beginRWTx() (*Tx, error) {
method removeTx (line 545) | func (db *DB) removeTx(tx *Tx) {
method Update (line 581) | func (db *DB) Update(fn func(*Tx) error) error {
method View (line 612) | func (db *DB) View(fn func(*Tx) error) error {
method Batch (line 660) | func (db *DB) Batch(fn func(*Tx) error) error {
method Sync (line 777) | func (db *DB) Sync() error { return fdatasync(db) }
method Stats (line 781) | func (db *DB) Stats() Stats {
method Info (line 789) | func (db *DB) Info() *Info {
method page (line 794) | func (db *DB) page(id pgid) *page {
method pageInBuffer (line 800) | func (db *DB) pageInBuffer(b []byte, id pgid) *page {
method meta (line 805) | func (db *DB) meta() *meta {
method allocate (line 829) | func (db *DB) allocate(count int) (*page, error) {
method grow (line 861) | func (db *DB) grow(sz int) error {
method IsReadOnly (line 892) | func (db *DB) IsReadOnly() bool {
function Open (line 150) | func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
type call (line 685) | type call struct
type batch (line 690) | type batch struct
method trigger (line 698) | func (b *batch) trigger() {
method run (line 704) | func (b *batch) run() {
type panicked (line 753) | type panicked struct
method Error (line 757) | func (p panicked) Error() string {
function safelyCall (line 764) | func safelyCall(fn func(*Tx) error, tx *Tx) (err error) {
type Options (line 897) | type Options struct
type Stats (line 932) | type Stats struct
method Sub (line 949) | func (s *Stats) Sub(other *Stats) Stats {
method add (line 963) | func (s *Stats) add(other *Stats) {
type Info (line 967) | type Info struct
type meta (line 972) | type meta struct
method validate (line 985) | func (m *meta) validate() error {
method copy (line 997) | func (m *meta) copy(dest *meta) {
method write (line 1002) | func (m *meta) write(p *page) {
method sum64 (line 1020) | func (m *meta) sum64() uint64 {
function _assert (line 1027) | func _assert(condition bool, msg string, v ...interface{}) {
function warn (line 1033) | func warn(v ...interface{}) { fmt.Fprintln(os.Stderr, v...) }
function warnf (line 1034) | func warnf(msg string, v ...interface{}) { fmt.Fprintf(os.Stderr, msg+"\...
function printstack (line 1036) | func printstack() {
FILE: vendor/github.com/boltdb/bolt/freelist.go
type freelist (line 11) | type freelist struct
method size (line 26) | func (f *freelist) size() int {
method count (line 36) | func (f *freelist) count() int {
method free_count (line 41) | func (f *freelist) free_count() int {
method pending_count (line 46) | func (f *freelist) pending_count() int {
method copyall (line 56) | func (f *freelist) copyall(dst []pgid) {
method allocate (line 67) | func (f *freelist) allocate(n int) pgid {
method free (line 111) | func (f *freelist) free(txid txid, p *page) {
method release (line 132) | func (f *freelist) release(txid txid) {
method rollback (line 147) | func (f *freelist) rollback(txid txid) {
method freed (line 158) | func (f *freelist) freed(pgid pgid) bool {
method read (line 163) | func (f *freelist) read(p *page) {
method write (line 191) | func (f *freelist) write(p *page) error {
method reload (line 215) | func (f *freelist) reload(p *page) {
method reindex (line 242) | func (f *freelist) reindex() {
function newFreelist (line 18) | func newFreelist() *freelist {
FILE: vendor/github.com/boltdb/bolt/node.go
type node (line 11) | type node struct
method root (line 24) | func (n *node) root() *node {
method minKeys (line 32) | func (n *node) minKeys() int {
method size (line 40) | func (n *node) size() int {
method sizeLessThan (line 52) | func (n *node) sizeLessThan(v int) bool {
method pageElementSize (line 65) | func (n *node) pageElementSize() int {
method childAt (line 73) | func (n *node) childAt(index int) *node {
method childIndex (line 81) | func (n *node) childIndex(child *node) int {
method numChildren (line 87) | func (n *node) numChildren() int {
method nextSibling (line 92) | func (n *node) nextSibling() *node {
method prevSibling (line 104) | func (n *node) prevSibling() *node {
method put (line 116) | func (n *node) put(oldKey, newKey, value []byte, pgid pgid, flags uint...
method del (line 144) | func (n *node) del(key []byte) {
method read (line 161) | func (n *node) read(p *page) {
method write (line 191) | func (n *node) write(p *page) {
method split (line 250) | func (n *node) split(pageSize int) []*node {
method splitTwo (line 273) | func (n *node) splitTwo(pageSize int) (*node, *node) {
method splitIndex (line 315) | func (n *node) splitIndex(threshold int) (index, sz int) {
method spill (line 339) | func (n *node) spill() error {
method rebalance (line 409) | func (n *node) rebalance() {
method removeChild (line 512) | func (n *node) removeChild(target *node) {
method dereference (line 523) | func (n *node) dereference() {
method free (line 554) | func (n *node) free() {
type nodes (line 588) | type nodes
method Len (line 590) | func (s nodes) Len() int { return len(s) }
method Swap (line 591) | func (s nodes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
method Less (line 592) | func (s nodes) Less(i, j int) bool { return bytes.Compare(s[i].inodes[...
type inode (line 597) | type inode struct
type inodes (line 604) | type inodes
FILE: vendor/github.com/boltdb/bolt/page.go
constant pageHeaderSize (line 10) | pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr))
constant minKeysPerPage (line 12) | minKeysPerPage = 2
constant branchPageElementSize (line 14) | branchPageElementSize = int(unsafe.Sizeof(branchPageElement{}))
constant leafPageElementSize (line 15) | leafPageElementSize = int(unsafe.Sizeof(leafPageElement{}))
constant branchPageFlag (line 18) | branchPageFlag = 0x01
constant leafPageFlag (line 19) | leafPageFlag = 0x02
constant metaPageFlag (line 20) | metaPageFlag = 0x04
constant freelistPageFlag (line 21) | freelistPageFlag = 0x10
constant bucketLeafFlag (line 25) | bucketLeafFlag = 0x01
type pgid (line 28) | type pgid
type page (line 30) | type page struct
method typ (line 39) | func (p *page) typ() string {
method meta (line 53) | func (p *page) meta() *meta {
method leafPageElement (line 58) | func (p *page) leafPageElement(index uint16) *leafPageElement {
method leafPageElements (line 64) | func (p *page) leafPageElements() []leafPageElement {
method branchPageElement (line 72) | func (p *page) branchPageElement(index uint16) *branchPageElement {
method branchPageElements (line 77) | func (p *page) branchPageElements() []branchPageElement {
method hexdump (line 85) | func (p *page) hexdump(n int) {
type pages (line 90) | type pages
method Len (line 92) | func (s pages) Len() int { return len(s) }
method Swap (line 93) | func (s pages) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
method Less (line 94) | func (s pages) Less(i, j int) bool { return s[i].id < s[j].id }
type branchPageElement (line 97) | type branchPageElement struct
method key (line 104) | func (n *branchPageElement) key() []byte {
type leafPageElement (line 110) | type leafPageElement struct
method key (line 118) | func (n *leafPageElement) key() []byte {
method value (line 124) | func (n *leafPageElement) value() []byte {
type PageInfo (line 130) | type PageInfo struct
type pgids (line 137) | type pgids
method Len (line 139) | func (s pgids) Len() int { return len(s) }
method Swap (line 140) | func (s pgids) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
method Less (line 141) | func (s pgids) Less(i, j int) bool { return s[i] < s[j] }
method merge (line 144) | func (a pgids) merge(b pgids) pgids {
function mergepgids (line 159) | func mergepgids(dst, a, b pgids) {
FILE: vendor/github.com/boltdb/bolt/tx.go
type txid (line 14) | type txid
type Tx (line 24) | type Tx struct
method init (line 44) | func (tx *Tx) init(db *DB) {
method ID (line 65) | func (tx *Tx) ID() int {
method DB (line 70) | func (tx *Tx) DB() *DB {
method Size (line 75) | func (tx *Tx) Size() int64 {
method Writable (line 80) | func (tx *Tx) Writable() bool {
method Cursor (line 88) | func (tx *Tx) Cursor() *Cursor {
method Stats (line 93) | func (tx *Tx) Stats() TxStats {
method Bucket (line 100) | func (tx *Tx) Bucket(name []byte) *Bucket {
method CreateBucket (line 107) | func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) {
method CreateBucketIfNotExists (line 114) | func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error) {
method DeleteBucket (line 120) | func (tx *Tx) DeleteBucket(name []byte) error {
method ForEach (line 127) | func (tx *Tx) ForEach(fn func(name []byte, b *Bucket) error) error {
method OnCommit (line 137) | func (tx *Tx) OnCommit(fn func()) {
method Commit (line 144) | func (tx *Tx) Commit() error {
method Rollback (line 240) | func (tx *Tx) Rollback() error {
method rollback (line 249) | func (tx *Tx) rollback() {
method close (line 260) | func (tx *Tx) close() {
method Copy (line 295) | func (tx *Tx) Copy(w io.Writer) error {
method WriteTo (line 302) | func (tx *Tx) WriteTo(w io.Writer) (n int64, err error) {
method CopyFile (line 353) | func (tx *Tx) CopyFile(path string, mode os.FileMode) error {
method Check (line 375) | func (tx *Tx) Check() <-chan error {
method check (line 381) | func (tx *Tx) check(ch chan error) {
method checkBucket (line 416) | func (tx *Tx) checkBucket(b *Bucket, reachable map[pgid]*page, freed m...
method allocate (line 455) | func (tx *Tx) allocate(count int) (*page, error) {
method write (line 472) | func (tx *Tx) write() error {
method writeMeta (line 545) | func (tx *Tx) writeMeta() error {
method page (line 569) | func (tx *Tx) page(id pgid) *page {
method forEachPage (line 582) | func (tx *Tx) forEachPage(pgid pgid, depth int, fn func(*page, int)) {
method Page (line 599) | func (tx *Tx) Page(id int) (*PageInfo, error) {
type TxStats (line 625) | type TxStats struct
method add (line 651) | func (s *TxStats) add(other *TxStats) {
method Sub (line 669) | func (s *TxStats) Sub(other *TxStats) TxStats {
FILE: vendor/github.com/centrifugal/centrifugo/libcentrifugo/raw/raw.go
type Raw (line 13) | type Raw
method Marshal (line 16) | func (r Raw) Marshal() ([]byte, error) {
method MarshalTo (line 24) | func (r Raw) MarshalTo(data []byte) (n int, err error) {
method Unmarshal (line 33) | func (r *Raw) Unmarshal(data []byte) error {
method Size (line 45) | func (r *Raw) Size() int {
method MarshalJSON (line 53) | func (r Raw) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 58) | func (r *Raw) UnmarshalJSON(data []byte) error {
method Equal (line 67) | func (r Raw) Equal(other Raw) bool {
method Compare (line 72) | func (r Raw) Compare(other Raw) int {
type intn (line 76) | type intn interface
function NewPopulatedRaw (line 81) | func NewPopulatedRaw(r intn) *Raw {
FILE: vendor/github.com/davecgh/go-spew/spew/bypass.go
constant UnsafeDisabled (line 31) | UnsafeDisabled = false
constant ptrSize (line 34) | ptrSize = unsafe.Sizeof((*byte)(nil))
function init (line 66) | func init() {
function unsafeReflectValue (line 122) | func unsafeReflectValue(v reflect.Value) (rv reflect.Value) {
FILE: vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
constant UnsafeDisabled (line 28) | UnsafeDisabled = true
function unsafeReflectValue (line 36) | func unsafeReflectValue(v reflect.Value) reflect.Value {
FILE: vendor/github.com/davecgh/go-spew/spew/common.go
function catchPanic (line 72) | func catchPanic(w io.Writer, v reflect.Value) {
function handleMethods (line 85) | func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handl...
function printBool (line 144) | func printBool(w io.Writer, val bool) {
function printInt (line 153) | func printInt(w io.Writer, val int64, base int) {
function printUint (line 158) | func printUint(w io.Writer, val uint64, base int) {
function printFloat (line 164) | func printFloat(w io.Writer, val float64, precision int) {
function printComplex (line 170) | func printComplex(w io.Writer, c complex128, floatPrecision int) {
function printHexPtr (line 185) | func printHexPtr(w io.Writer, p uintptr) {
type valuesSorter (line 219) | type valuesSorter struct
method Len (line 279) | func (s *valuesSorter) Len() int {
method Swap (line 285) | func (s *valuesSorter) Swap(i, j int) {
method Less (line 326) | func (s *valuesSorter) Less(i, j int) bool {
function newValuesSorter (line 228) | func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Inter...
function canSortSimply (line 256) | func canSortSimply(kind reflect.Kind) bool {
function valueSortLess (line 295) | func valueSortLess(a, b reflect.Value) bool {
function sortValues (line 336) | func sortValues(values []reflect.Value, cs *ConfigState) {
FILE: vendor/github.com/davecgh/go-spew/spew/config.go
type ConfigState (line 37) | type ConfigState struct
method Errorf (line 115) | func (c *ConfigState) Errorf(format string, a ...interface{}) (err err...
method Fprint (line 127) | func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, er...
method Fprintf (line 139) | func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interfa...
method Fprintln (line 150) | func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, ...
method Print (line 162) | func (c *ConfigState) Print(a ...interface{}) (n int, err error) {
method Printf (line 174) | func (c *ConfigState) Printf(format string, a ...interface{}) (n int, ...
method Println (line 186) | func (c *ConfigState) Println(a ...interface{}) (n int, err error) {
method Sprint (line 197) | func (c *ConfigState) Sprint(a ...interface{}) string {
method Sprintf (line 208) | func (c *ConfigState) Sprintf(format string, a ...interface{}) string {
method Sprintln (line 219) | func (c *ConfigState) Sprintln(a ...interface{}) string {
method NewFormatter (line 240) | func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter {
method Fdump (line 246) | func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) {
method Dump (line 273) | func (c *ConfigState) Dump(a ...interface{}) {
method Sdump (line 279) | func (c *ConfigState) Sdump(a ...interface{}) string {
method convertArgs (line 288) | func (c *ConfigState) convertArgs(args []interface{}) (formatters []in...
function NewDefaultConfig (line 304) | func NewDefaultConfig() *ConfigState {
FILE: vendor/github.com/davecgh/go-spew/spew/dump.go
type dumpState (line 51) | type dumpState struct
method indent (line 62) | func (d *dumpState) indent() {
method unpackValue (line 73) | func (d *dumpState) unpackValue(v reflect.Value) reflect.Value {
method dumpPtr (line 81) | func (d *dumpState) dumpPtr(v reflect.Value) {
method dumpSlice (line 161) | func (d *dumpState) dumpSlice(v reflect.Value) {
method dump (line 251) | func (d *dumpState) dump(v reflect.Value) {
function fdump (line 453) | func fdump(cs *ConfigState, w io.Writer, a ...interface{}) {
function Fdump (line 472) | func Fdump(w io.Writer, a ...interface{}) {
function Sdump (line 478) | func Sdump(a ...interface{}) string {
function Dump (line 507) | func Dump(a ...interface{}) {
FILE: vendor/github.com/davecgh/go-spew/spew/format.go
constant supportedFlags (line 28) | supportedFlags = "0-+# "
type formatState (line 34) | type formatState struct
method buildDefaultFormat (line 47) | func (f *formatState) buildDefaultFormat() (format string) {
method constructOrigFormat (line 65) | func (f *formatState) constructOrigFormat(verb rune) (format string) {
method unpackValue (line 94) | func (f *formatState) unpackValue(v reflect.Value) reflect.Value {
method formatPtr (line 105) | func (f *formatState) formatPtr(v reflect.Value) {
method format (line 201) | func (f *formatState) format(v reflect.Value) {
method Format (line 371) | func (f *formatState) Format(fs fmt.State, verb rune) {
function newFormatter (line 394) | func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter {
function NewFormatter (line 417) | func NewFormatter(v interface{}) fmt.Formatter {
FILE: vendor/github.com/davecgh/go-spew/spew/spew.go
function Errorf (line 32) | func Errorf(format string, a ...interface{}) (err error) {
function Fprint (line 44) | func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
function Fprintf (line 56) | func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err e...
function Fprintln (line 67) | func Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
function Print (line 79) | func Print(a ...interface{}) (n int, err error) {
function Printf (line 91) | func Printf(format string, a ...interface{}) (n int, err error) {
function Println (line 103) | func Println(a ...interface{}) (n int, err error) {
function Sprint (line 114) | func Sprint(a ...interface{}) string {
function Sprintf (line 125) | func Sprintf(format string, a ...interface{}) string {
function Sprintln (line 136) | func Sprintln(a ...interface{}) string {
function convertArgs (line 142) | func convertArgs(args []interface{}) (formatters []interface{}) {
FILE: vendor/github.com/fatih/color/color.go
type Color (line 37) | type Color struct
method Set (line 135) | func (c *Color) Set() *Color {
method unset (line 144) | func (c *Color) unset() {
method setWriter (line 152) | func (c *Color) setWriter(w io.Writer) *Color {
method unsetWriter (line 161) | func (c *Color) unsetWriter(w io.Writer) {
method Add (line 175) | func (c *Color) Add(value ...Attribute) *Color {
method prepend (line 180) | func (c *Color) prepend(value Attribute) {
method Fprint (line 191) | func (c *Color) Fprint(w io.Writer, a ...interface{}) (n int, err erro...
method Print (line 203) | func (c *Color) Print(a ...interface{}) (n int, err error) {
method Fprintf (line 214) | func (c *Color) Fprintf(w io.Writer, format string, a ...interface{}) ...
method Printf (line 224) | func (c *Color) Printf(format string, a ...interface{}) (n int, err er...
method Fprintln (line 235) | func (c *Color) Fprintln(w io.Writer, a ...interface{}) (n int, err er...
method Println (line 247) | func (c *Color) Println(a ...interface{}) (n int, err error) {
method Sprint (line 255) | func (c *Color) Sprint(a ...interface{}) string {
method Sprintln (line 260) | func (c *Color) Sprintln(a ...interface{}) string {
method Sprintf (line 265) | func (c *Color) Sprintf(format string, a ...interface{}) string {
method FprintFunc (line 271) | func (c *Color) FprintFunc() func(w io.Writer, a ...interface{}) {
method PrintFunc (line 279) | func (c *Color) PrintFunc() func(a ...interface{}) {
method FprintfFunc (line 287) | func (c *Color) FprintfFunc() func(w io.Writer, format string, a ...in...
method PrintfFunc (line 295) | func (c *Color) PrintfFunc() func(format string, a ...interface{}) {
method FprintlnFunc (line 303) | func (c *Color) FprintlnFunc() func(w io.Writer, a ...interface{}) {
method PrintlnFunc (line 311) | func (c *Color) PrintlnFunc() func(a ...interface{}) {
method SprintFunc (line 323) | func (c *Color) SprintFunc() func(a ...interface{}) string {
method SprintfFunc (line 332) | func (c *Color) SprintfFunc() func(format string, a ...interface{}) st...
method SprintlnFunc (line 341) | func (c *Color) SprintlnFunc() func(a ...interface{}) string {
method sequence (line 349) | func (c *Color) sequence() string {
method wrap (line 360) | func (c *Color) wrap(s string) string {
method format (line 368) | func (c *Color) format() string {
method unformat (line 372) | func (c *Color) unformat() string {
method DisableColor (line 379) | func (c *Color) DisableColor() {
method EnableColor (line 385) | func (c *Color) EnableColor() {
method isNoColorSet (line 389) | func (c *Color) isNoColorSet() bool {
method Equals (line 400) | func (c *Color) Equals(c2 *Color) bool {
method attrExists (line 414) | func (c *Color) attrExists(a Attribute) bool {
type Attribute (line 43) | type Attribute
constant escape (line 45) | escape = "\x1b"
constant Reset (line 49) | Reset Attribute = iota
constant Bold (line 50) | Bold
constant Faint (line 51) | Faint
constant Italic (line 52) | Italic
constant Underline (line 53) | Underline
constant BlinkSlow (line 54) | BlinkSlow
constant BlinkRapid (line 55) | BlinkRapid
constant ReverseVideo (line 56) | ReverseVideo
constant Concealed (line 57) | Concealed
constant CrossedOut (line 58) | CrossedOut
constant FgBlack (line 63) | FgBlack Attribute = iota + 30
constant FgRed (line 64) | FgRed
constant FgGreen (line 65) | FgGreen
constant FgYellow (line 66) | FgYellow
constant FgBlue (line 67) | FgBlue
constant FgMagenta (line 68) | FgMagenta
constant FgCyan (line 69) | FgCyan
constant FgWhite (line 70) | FgWhite
constant FgHiBlack (line 75) | FgHiBlack Attribute = iota + 90
constant FgHiRed (line 76) | FgHiRed
constant FgHiGreen (line 77) | FgHiGreen
constant FgHiYellow (line 78) | FgHiYellow
constant FgHiBlue (line 79) | FgHiBlue
constant FgHiMagenta (line 80) | FgHiMagenta
constant FgHiCyan (line 81) | FgHiCyan
constant FgHiWhite (line 82) | FgHiWhite
constant BgBlack (line 87) | BgBlack Attribute = iota + 40
constant BgRed (line 88) | BgRed
constant BgGreen (line 89) | BgGreen
constant BgYellow (line 90) | BgYellow
constant BgBlue (line 91) | BgBlue
constant BgMagenta (line 92) | BgMagenta
constant BgCyan (line 93) | BgCyan
constant BgWhite (line 94) | BgWhite
constant BgHiBlack (line 99) | BgHiBlack Attribute = iota + 100
constant BgHiRed (line 100) | BgHiRed
constant BgHiGreen (line 101) | BgHiGreen
constant BgHiYellow (line 102) | BgHiYellow
constant BgHiBlue (line 103) | BgHiBlue
constant BgHiMagenta (line 104) | BgHiMagenta
constant BgHiCyan (line 105) | BgHiCyan
constant BgHiWhite (line 106) | BgHiWhite
function New (line 110) | func New(value ...Attribute) *Color {
function Set (line 118) | func Set(p ...Attribute) *Color {
function Unset (line 126) | func Unset() {
function boolPtr (line 424) | func boolPtr(v bool) *bool {
function getCachedColor (line 428) | func getCachedColor(p Attribute) *Color {
function colorPrint (line 441) | func colorPrint(format string, p Attribute, a ...interface{}) {
function colorString (line 455) | func colorString(format string, p Attribute, a ...interface{}) string {
function Black (line 467) | func Black(format string, a ...interface{}) { colorPrint(format, FgBlack...
function Red (line 471) | func Red(format string, a ...interface{}) { colorPrint(format, FgRed, a....
function Green (line 475) | func Green(format string, a ...interface{}) { colorPrint(format, FgGreen...
function Yellow (line 479) | func Yellow(format string, a ...interface{}) { colorPrint(format, FgYell...
function Blue (line 483) | func Blue(format string, a ...interface{}) { colorPrint(format, FgBlue, ...
function Magenta (line 487) | func Magenta(format string, a ...interface{}) { colorPrint(format, FgMag...
function Cyan (line 491) | func Cyan(format string, a ...interface{}) { colorPrint(format, FgCyan, ...
function White (line 495) | func White(format string, a ...interface{}) { colorPrint(format, FgWhite...
function BlackString (line 499) | func BlackString(format string, a ...interface{}) string { return colorS...
function RedString (line 503) | func RedString(format string, a ...interface{}) string { return colorStr...
function GreenString (line 507) | func GreenString(format string, a ...interface{}) string { return colorS...
function YellowString (line 511) | func YellowString(format string, a ...interface{}) string { return color...
function BlueString (line 515) | func BlueString(format string, a ...interface{}) string { return colorSt...
function MagentaString (line 519) | func MagentaString(format string, a ...interface{}) string {
function CyanString (line 525) | func CyanString(format string, a ...interface{}) string { return colorSt...
function WhiteString (line 529) | func WhiteString(format string, a ...interface{}) string { return colorS...
function HiBlack (line 533) | func HiBlack(format string, a ...interface{}) { colorPrint(format, FgHiB...
function HiRed (line 537) | func HiRed(format string, a ...interface{}) { colorPrint(format, FgHiRed...
function HiGreen (line 541) | func HiGreen(format string, a ...interface{}) { colorPrint(format, FgHiG...
function HiYellow (line 545) | func HiYellow(format string, a ...interface{}) { colorPrint(format, FgHi...
function HiBlue (line 549) | func HiBlue(format string, a ...interface{}) { colorPrint(format, FgHiBl...
function HiMagenta (line 553) | func HiMagenta(format string, a ...interface{}) { colorPrint(format, FgH...
function HiCyan (line 557) | func HiCyan(format string, a ...interface{}) { colorPrint(format, FgHiCy...
function HiWhite (line 561) | func HiWhite(format string, a ...interface{}) { colorPrint(format, FgHiW...
function HiBlackString (line 565) | func HiBlackString(format string, a ...interface{}) string {
function HiRedString (line 571) | func HiRedString(format string, a ...interface{}) string { return colorS...
function HiGreenString (line 575) | func HiGreenString(format string, a ...interface{}) string {
function HiYellowString (line 581) | func HiYellowString(format string, a ...interface{}) string {
function HiBlueString (line 587) | func HiBlueString(format string, a ...interface{}) string { return color...
function HiMagentaString (line 591) | func HiMagentaString(format string, a ...interface{}) string {
function HiCyanString (line 597) | func HiCyanString(format string, a ...interface{}) string { return color...
function HiWhiteString (line 601) | func HiWhiteString(format string, a ...interface{}) string {
FILE: vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
constant _ (line 20) | _ = proto.GoGoProtoPackageIsVersion2
function init (line 661) | func init() {
function init (line 735) | func init() { proto.RegisterFile("gogo.proto", fileDescriptor_gogo_68790...
FILE: vendor/github.com/gogo/protobuf/gogoproto/helper.go
function IsEmbed (line 34) | func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool {
function IsNullable (line 38) | func IsNullable(field *google_protobuf.FieldDescriptorProto) bool {
function IsStdTime (line 42) | func IsStdTime(field *google_protobuf.FieldDescriptorProto) bool {
function IsStdDuration (line 46) | func IsStdDuration(field *google_protobuf.FieldDescriptorProto) bool {
function NeedsNilCheck (line 50) | func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorPr...
function IsCustomType (line 61) | func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool {
function IsCastType (line 69) | func IsCastType(field *google_protobuf.FieldDescriptorProto) bool {
function IsCastKey (line 77) | func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool {
function IsCastValue (line 85) | func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool {
function HasEnumDecl (line 93) | func HasEnumDecl(file *google_protobuf.FileDescriptorProto, enum *google...
function HasTypeDecl (line 97) | func HasTypeDecl(file *google_protobuf.FileDescriptorProto, message *goo...
function GetCustomType (line 101) | func GetCustomType(field *google_protobuf.FieldDescriptorProto) string {
function GetCastType (line 114) | func GetCastType(field *google_protobuf.FieldDescriptorProto) string {
function GetCastKey (line 127) | func GetCastKey(field *google_protobuf.FieldDescriptorProto) string {
function GetCastValue (line 140) | func GetCastValue(field *google_protobuf.FieldDescriptorProto) string {
function IsCustomName (line 153) | func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool {
function IsEnumCustomName (line 161) | func IsEnumCustomName(field *google_protobuf.EnumDescriptorProto) bool {
function IsEnumValueCustomName (line 169) | func IsEnumValueCustomName(field *google_protobuf.EnumValueDescriptorPro...
function GetCustomName (line 177) | func GetCustomName(field *google_protobuf.FieldDescriptorProto) string {
function GetEnumCustomName (line 190) | func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string {
function GetEnumValueCustomName (line 203) | func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorPr...
function GetJsonTag (line 216) | func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string {
function GetMoreTags (line 229) | func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string {
type EnableFunc (line 242) | type EnableFunc
function EnabledGoEnumPrefix (line 244) | func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum...
function EnabledGoStringer (line 248) | func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, messag...
function HasGoGetters (line 252) | func HasGoGetters(file *google_protobuf.FileDescriptorProto, message *go...
function IsUnion (line 256) | func IsUnion(file *google_protobuf.FileDescriptorProto, message *google_...
function HasGoString (line 260) | func HasGoString(file *google_protobuf.FileDescriptorProto, message *goo...
function HasEqual (line 264) | func HasEqual(file *google_protobuf.FileDescriptorProto, message *google...
function HasVerboseEqual (line 268) | func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, message ...
function IsStringer (line 272) | func IsStringer(file *google_protobuf.FileDescriptorProto, message *goog...
function IsFace (line 276) | func IsFace(file *google_protobuf.FileDescriptorProto, message *google_p...
function HasDescription (line 280) | func HasDescription(file *google_protobuf.FileDescriptorProto, message *...
function HasPopulate (line 284) | func HasPopulate(file *google_protobuf.FileDescriptorProto, message *goo...
function HasTestGen (line 288) | func HasTestGen(file *google_protobuf.FileDescriptorProto, message *goog...
function HasBenchGen (line 292) | func HasBenchGen(file *google_protobuf.FileDescriptorProto, message *goo...
function IsMarshaler (line 296) | func IsMarshaler(file *google_protobuf.FileDescriptorProto, message *goo...
function IsUnmarshaler (line 300) | func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, message *g...
function IsStableMarshaler (line 304) | func IsStableMarshaler(file *google_protobuf.FileDescriptorProto, messag...
function IsSizer (line 308) | func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_...
function IsProtoSizer (line 312) | func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *go...
function IsGoEnumStringer (line 316) | func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *g...
function IsEnumStringer (line 320) | func IsEnumStringer(file *google_protobuf.FileDescriptorProto, enum *goo...
function IsUnsafeMarshaler (line 324) | func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, messag...
function IsUnsafeUnmarshaler (line 328) | func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, mess...
function HasExtensionsMap (line 332) | func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message...
function HasUnrecognized (line 336) | func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message ...
function IsProto3 (line 340) | func IsProto3(file *google_protobuf.FileDescriptorProto) bool {
function ImportsGoGoProto (line 344) | func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool {
function HasCompare (line 348) | func HasCompare(file *google_protobuf.FileDescriptorProto, message *goog...
function RegistersGolangProto (line 352) | func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool {
function HasMessageName (line 356) | func HasMessageName(file *google_protobuf.FileDescriptorProto, message *...
FILE: vendor/github.com/gogo/protobuf/proto/clone.go
function Clone (line 45) | func Clone(src Message) Message {
type Merger (line 57) | type Merger interface
type generatedMerger (line 69) | type generatedMerger interface
function Merge (line 77) | func Merge(dst, src Message) {
function mergeStruct (line 101) | func mergeStruct(out, in reflect.Value) {
function mergeAny (line 140) | func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) {
function mergeExtension (line 243) | func mergeExtension(out, in map[int32]Extension) {
FILE: vendor/github.com/gogo/protobuf/proto/custom_gogo.go
type custom (line 33) | type custom interface
FILE: vendor/github.com/gogo/protobuf/proto/decode.go
function DecodeVarint (line 57) | func DecodeVarint(buf []byte) (x uint64, n int) {
method decodeVarintSlow (line 74) | func (p *Buffer) decodeVarintSlow() (x uint64, err error) {
method DecodeVarint (line 101) | func (p *Buffer) DecodeVarint() (x uint64, err error) {
method DecodeFixed64 (line 201) | func (p *Buffer) DecodeFixed64() (x uint64, err error) {
method DecodeFixed32 (line 224) | func (p *Buffer) DecodeFixed32() (x uint64, err error) {
method DecodeZigzag64 (line 243) | func (p *Buffer) DecodeZigzag64() (x uint64, err error) {
method DecodeZigzag32 (line 255) | func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
method DecodeRawBytes (line 267) | func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) {
method DecodeStringBytes (line 297) | func (p *Buffer) DecodeStringBytes() (s string, err error) {
type Unmarshaler (line 313) | type Unmarshaler interface
type newUnmarshaler (line 324) | type newUnmarshaler interface
function Unmarshal (line 335) | func Unmarshal(buf []byte, pb Message) error {
function UnmarshalMerge (line 352) | func UnmarshalMerge(buf []byte, pb Message) error {
method DecodeMessage (line 369) | func (p *Buffer) DecodeMessage(pb Message) error {
method DecodeGroup (line 380) | func (p *Buffer) DecodeGroup(pb Message) error {
method Unmarshal (line 397) | func (p *Buffer) Unmarshal(pb Message) error {
FILE: vendor/github.com/gogo/protobuf/proto/discard.go
type generatedDiscarder (line 42) | type generatedDiscarder interface
function DiscardUnknown (line 57) | func DiscardUnknown(m Message) {
method DiscardUnknown (line 69) | func (a *InternalMessageInfo) DiscardUnknown(m Message) {
type discardInfo (line 78) | type discardInfo struct
method discard (line 109) | func (di *discardInfo) discard(src pointer) {
method computeDiscardInfo (line 140) | func (di *discardInfo) computeDiscardInfo() {
type discardFieldInfo (line 88) | type discardFieldInfo struct
function getDiscardInfo (line 98) | func getDiscardInfo(t reflect.Type) *discardInfo {
function discardLegacy (line 254) | func discardLegacy(m Message) {
FILE: vendor/github.com/gogo/protobuf/proto/duration.go
constant maxSeconds (line 46) | maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60)
constant minSeconds (line 47) | minSeconds = -maxSeconds
function validateDuration (line 54) | func validateDuration(d *duration) error {
function durationFromProto (line 74) | func durationFromProto(p *duration) (time.Duration, error) {
function durationProto (line 92) | func durationProto(d time.Duration) *duration {
FILE: vendor/github.com/gogo/protobuf/proto/duration_gogo.go
type duration (line 38) | type duration struct
method Reset (line 43) | func (m *duration) Reset() { *m = duration{} }
method ProtoMessage (line 44) | func (*duration) ProtoMessage() {}
method String (line 45) | func (*duration) String() string { return "duration<string>" }
function init (line 47) | func init() {
FILE: vendor/github.com/gogo/protobuf/proto/encode.go
type RequiredNotSetError (line 53) | type RequiredNotSetError struct
method Error (line 57) | func (e *RequiredNotSetError) Error() string {
constant maxVarintBytes (line 82) | maxVarintBytes = 10
function EncodeVarint (line 90) | func EncodeVarint(x uint64) []byte {
method EncodeVarint (line 106) | func (p *Buffer) EncodeVarint(x uint64) error {
function SizeVarint (line 116) | func SizeVarint(x uint64) int {
method EncodeFixed64 (line 143) | func (p *Buffer) EncodeFixed64(x uint64) error {
method EncodeFixed32 (line 159) | func (p *Buffer) EncodeFixed32(x uint64) error {
method EncodeZigzag64 (line 171) | func (p *Buffer) EncodeZigzag64(x uint64) error {
method EncodeZigzag32 (line 179) | func (p *Buffer) EncodeZigzag32(x uint64) error {
method EncodeRawBytes (line 187) | func (p *Buffer) EncodeRawBytes(b []byte) error {
method EncodeStringBytes (line 195) | func (p *Buffer) EncodeStringBytes(s string) error {
type Marshaler (line 202) | type Marshaler interface
method EncodeMessage (line 208) | func (p *Buffer) EncodeMessage(pb Message) error {
function isNil (line 215) | func isNil(v reflect.Value) bool {
FILE: vendor/github.com/gogo/protobuf/proto/encode_gogo.go
function NewRequiredNotSetError (line 31) | func NewRequiredNotSetError(field string) *RequiredNotSetError {
FILE: vendor/github.com/gogo/protobuf/proto/equal.go
function Equal (line 72) | func Equal(a, b Message) bool {
function equalStruct (line 96) | func equalStruct(v1, v2 reflect.Value) bool {
function equalAny (line 145) | func equalAny(v1, v2 reflect.Value, prop *Properties) bool {
function equalExtensions (line 232) | func equalExtensions(base reflect.Type, x1, x2 XXX_InternalExtensions) b...
function equalExtMap (line 238) | func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
FILE: vendor/github.com/gogo/protobuf/proto/extensions.go
type ExtensionRange (line 52) | type ExtensionRange struct
type extendableProto (line 58) | type extendableProto interface
type extendableProtoV1 (line 67) | type extendableProtoV1 interface
type extensionAdapter (line 74) | type extensionAdapter struct
method extensionsWrite (line 78) | func (e extensionAdapter) extensionsWrite() map[int32]Extension {
method extensionsRead (line 82) | func (e extensionAdapter) extensionsRead() (map[int32]Extension, sync....
type notLocker (line 87) | type notLocker struct
method Lock (line 89) | func (n notLocker) Lock() {}
method Unlock (line 90) | func (n notLocker) Unlock() {}
function extendable (line 95) | func extendable(p interface{}) (extendableProto, error) {
function isNilPtr (line 117) | func isNilPtr(x interface{}) bool {
type XXX_InternalExtensions (line 129) | type XXX_InternalExtensions struct
method extensionsWrite (line 144) | func (e *XXX_InternalExtensions) extensionsWrite() map[int32]Extension {
method extensionsRead (line 157) | func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension...
type ExtensionDesc (line 166) | type ExtensionDesc struct
method repeated (line 175) | func (ed *ExtensionDesc) repeated() bool {
type Extension (line 181) | type Extension struct
function SetRawExtension (line 196) | func SetRawExtension(base Message, id int32, b []byte) {
function isExtensionField (line 212) | func isExtensionField(pb extendableProto, field int32) bool {
function checkExtensionTypes (line 222) | func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) e...
type extPropKey (line 242) | type extPropKey struct
function extensionProperties (line 254) | func extensionProperties(ed *ExtensionDesc) *Properties {
function HasExtension (line 278) | func HasExtension(pb Message, extension *ExtensionDesc) bool {
function ClearExtension (line 315) | func ClearExtension(pb Message, extension *ExtensionDesc) {
function clearExtension (line 319) | func clearExtension(pb Message, fieldNum int32) {
function GetExtension (line 345) | func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, er...
function defaultExtensionValue (line 408) | func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
function decodeExtension (line 447) | func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, e...
function GetExtensions (line 478) | func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interf...
function ExtensionDescs (line 499) | func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
function SetExtension (line 528) | func SetExtension(pb Message, extension *ExtensionDesc, value interface{...
function ClearAllExtensions (line 564) | func ClearAllExtensions(pb Message) {
function RegisterExtension (line 586) | func RegisterExtension(desc *ExtensionDesc) {
function RegisteredExtensions (line 602) | func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {
FILE: vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
type extensionsBytes (line 42) | type extensionsBytes interface
type slowExtensionAdapter (line 48) | type slowExtensionAdapter struct
method extensionsWrite (line 52) | func (s slowExtensionAdapter) extensionsWrite() map[int32]Extension {
method extensionsRead (line 56) | func (s slowExtensionAdapter) extensionsRead() (map[int32]Extension, s...
function GetBoolExtension (line 65) | func GetBoolExtension(pb Message, extension *ExtensionDesc, ifnotset boo...
method Equal (line 82) | func (this *Extension) Equal(that *Extension) bool {
method Compare (line 92) | func (this *Extension) Compare(that *Extension) int {
function SizeOfInternalExtension (line 102) | func SizeOfInternalExtension(m extendableProto) (n int) {
type sortableMapElem (line 107) | type sortableMapElem struct
function newSortableExtensionsFromMap (line 112) | func newSortableExtensionsFromMap(m map[int32]Extension) sortableExtensi...
type sortableExtensions (line 120) | type sortableExtensions
method Len (line 122) | func (this sortableExtensions) Len() int { return len(this) }
method Swap (line 124) | func (this sortableExtensions) Swap(i, j int) { this[i], this[j] = thi...
method Less (line 126) | func (this sortableExtensions) Less(i, j int) bool { return this[i].fi...
method String (line 128) | func (this sortableExtensions) String() string {
function StringFromInternalExtension (line 137) | func StringFromInternalExtension(m extendableProto) string {
function StringFromExtensionsMap (line 141) | func StringFromExtensionsMap(m map[int32]Extension) string {
function StringFromExtensionsBytes (line 145) | func StringFromExtensionsBytes(ext []byte) string {
function EncodeInternalExtension (line 153) | func EncodeInternalExtension(m extendableProto, data []byte) (n int, err...
function EncodeExtensionMap (line 157) | func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err ...
function GetRawExtension (line 172) | func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
function size (line 180) | func size(buf []byte, wire int) (int, error) {
function BytesToExtensionsMap (line 211) | func BytesToExtensionsMap(buf []byte) (map[int32]Extension, error) {
function NewExtension (line 232) | func NewExtension(e []byte) Extension {
function AppendExtension (line 238) | func AppendExtension(e Message, tag int32, buf []byte) {
function encodeExtension (line 252) | func encodeExtension(extension *ExtensionDesc, value interface{}) ([]byt...
function decodeExtensionFromBytes (line 262) | func decodeExtensionFromBytes(extension *ExtensionDesc, buf []byte) (int...
method Encode (line 290) | func (this *Extension) Encode() error {
method GoString (line 301) | func (this Extension) GoString() string {
function SetUnsafeExtension (line 308) | func SetUnsafeExtension(pb Message, fieldNum int32, value interface{}) e...
function GetUnsafeExtension (line 321) | func GetUnsafeExtension(pb Message, fieldNum int32) (interface{}, error) {
function NewUnsafeXXX_InternalExtensions (line 334) | func NewUnsafeXXX_InternalExtensions(m map[int32]Extension) XXX_Internal...
function GetUnsafeExtensionsMap (line 345) | func GetUnsafeExtensionsMap(extendable Message) map[int32]Extension {
function deleteExtension (line 350) | func deleteExtension(pb extensionsBytes, theFieldNum int32, offset int) ...
FILE: vendor/github.com/gogo/protobuf/proto/lib.go
type Message (line 280) | type Message interface
type Stats (line 288) | type Stats struct
constant collectStats (line 299) | collectStats = false
function GetStats (line 304) | func GetStats() Stats { return stats }
type Buffer (line 311) | type Buffer struct
method Reset (line 325) | func (p *Buffer) Reset() {
method SetBuf (line 332) | func (p *Buffer) SetBuf(s []byte) {
method Bytes (line 338) | func (p *Buffer) Bytes() []byte { return p.buf }
method SetDeterministic (line 360) | func (p *Buffer) SetDeterministic(deterministic bool) {
method DebugPrint (line 464) | func (p *Buffer) DebugPrint(s string, b []byte) {
function NewBuffer (line 320) | func NewBuffer(e []byte) *Buffer {
function Bool (line 370) | func Bool(v bool) *bool {
function Int32 (line 376) | func Int32(v int32) *int32 {
function Int (line 383) | func Int(v int) *int32 {
function Int64 (line 391) | func Int64(v int64) *int64 {
function Float32 (line 397) | func Float32(v float32) *float32 {
function Float64 (line 403) | func Float64(v float64) *float64 {
function Uint32 (line 409) | func Uint32(v uint32) *uint32 {
function Uint64 (line 415) | func Uint64(v uint64) *uint64 {
function String (line 421) | func String(v string) *string {
function EnumName (line 427) | func EnumName(m map[int32]string, v int32) string {
function UnmarshalJSONEnum (line 441) | func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string)...
function SetDefaults (line 569) | func SetDefaults(pb Message) {
function setDefaults (line 574) | func setDefaults(v reflect.Value, recur, zeros bool) {
type defaultMessage (line 716) | type defaultMessage struct
type scalarField (line 721) | type scalarField struct
function buildDefaultMessage (line 728) | func buildDefaultMessage(t reflect.Type) (dm defaultMessage) {
function fieldDefault (line 757) | func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, n...
function mapKeys (line 854) | func mapKeys(vs []reflect.Value) sort.Interface {
type mapKeySorter (line 877) | type mapKeySorter struct
method Len (line 882) | func (s mapKeySorter) Len() int { return len(s.vs) }
method Swap (line 883) | func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.v...
method Less (line 884) | func (s mapKeySorter) Less(i, j int) bool {
function isProto3Zero (line 889) | func isProto3Zero(v reflect.Value) bool {
constant GoGoProtoPackageIsVersion2 (line 907) | GoGoProtoPackageIsVersion2 = true
constant GoGoProtoPackageIsVersion1 (line 911) | GoGoProtoPackageIsVersion1 = true
type InternalMessageInfo (line 916) | type InternalMessageInfo struct
FILE: vendor/github.com/gogo/protobuf/proto/lib_gogo.go
type Sizer (line 36) | type Sizer interface
type ProtoSizer (line 40) | type ProtoSizer interface
function MarshalJSONEnum (line 44) | func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) {
FILE: vendor/github.com/gogo/protobuf/proto/message_set.go
type _MessageSet_Item (line 63) | type _MessageSet_Item struct
type messageSet (line 68) | type messageSet struct
method find (line 83) | func (ms *messageSet) find(pb Message) *_MessageSet_Item {
method Has (line 97) | func (ms *messageSet) Has(pb Message) bool {
method Unmarshal (line 101) | func (ms *messageSet) Unmarshal(pb Message) error {
method Marshal (line 111) | func (ms *messageSet) Marshal(pb Message) error {
method Reset (line 135) | func (ms *messageSet) Reset() { *ms = messageSet{} }
method String (line 136) | func (ms *messageSet) String() string { return CompactTextString(ms) }
method ProtoMessage (line 137) | func (*messageSet) ProtoMessage() {}
type messageTypeIder (line 79) | type messageTypeIder interface
function skipVarint (line 141) | func skipVarint(buf []byte) []byte {
function MarshalMessageSet (line 150) | func MarshalMessageSet(exts interface{}) ([]byte, error) {
function marshalMessageSet (line 155) | func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, er...
function UnmarshalMessageSet (line 187) | func UnmarshalMessageSet(buf []byte, exts interface{}) error {
function MarshalMessageSetJSON (line 228) | func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
function UnmarshalMessageSetJSON (line 289) | func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error {
type messageSetDesc (line 303) | type messageSetDesc struct
function RegisterMessageSetType (line 309) | func RegisterMessageSetType(m Message, fieldNum int32, name string) {
FILE: vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
constant unsafeAllowed (line 45) | unsafeAllowed = false
type field (line 50) | type field
method IsValid (line 64) | func (f field) IsValid() bool { return f != nil }
function toField (line 53) | func toField(f *reflect.StructField) field {
type pointer (line 70) | type pointer struct
method offset (line 96) | func (p pointer) offset(f field) pointer {
method isNil (line 100) | func (p pointer) isNil() bool {
method toInt64 (line 117) | func (p pointer) toInt64() *int64 {
method toInt64Ptr (line 120) | func (p pointer) toInt64Ptr() **int64 {
method toInt64Slice (line 123) | func (p pointer) toInt64Slice() *[]int64 {
method toInt32 (line 129) | func (p pointer) toInt32() *int32 {
method getInt32Ptr (line 143) | func (p pointer) getInt32Ptr() *int32 {
method setInt32Ptr (line 151) | func (p pointer) setInt32Ptr(v int32) {
method getInt32Slice (line 161) | func (p pointer) getInt32Slice() []int32 {
method setInt32Slice (line 179) | func (p pointer) setInt32Slice(v []int32) {
method appendInt32Slice (line 194) | func (p pointer) appendInt32Slice(v int32) {
method toUint64 (line 198) | func (p pointer) toUint64() *uint64 {
method toUint64Ptr (line 201) | func (p pointer) toUint64Ptr() **uint64 {
method toUint64Slice (line 204) | func (p pointer) toUint64Slice() *[]uint64 {
method toUint32 (line 207) | func (p pointer) toUint32() *uint32 {
method toUint32Ptr (line 210) | func (p pointer) toUint32Ptr() **uint32 {
method toUint32Slice (line 213) | func (p pointer) toUint32Slice() *[]uint32 {
method toBool (line 216) | func (p pointer) toBool() *bool {
method toBoolPtr (line 219) | func (p pointer) toBoolPtr() **bool {
method toBoolSlice (line 222) | func (p pointer) toBoolSlice() *[]bool {
method toFloat64 (line 225) | func (p pointer) toFloat64() *float64 {
method toFloat64Ptr (line 228) | func (p pointer) toFloat64Ptr() **float64 {
method toFloat64Slice (line 231) | func (p pointer) toFloat64Slice() *[]float64 {
method toFloat32 (line 234) | func (p pointer) toFloat32() *float32 {
method toFloat32Ptr (line 237) | func (p pointer) toFloat32Ptr() **float32 {
method toFloat32Slice (line 240) | func (p pointer) toFloat32Slice() *[]float32 {
method toString (line 243) | func (p pointer) toString() *string {
method toStringPtr (line 246) | func (p pointer) toStringPtr() **string {
method toStringSlice (line 249) | func (p pointer) toStringSlice() *[]string {
method toBytes (line 252) | func (p pointer) toBytes() *[]byte {
method toBytesSlice (line 255) | func (p pointer) toBytesSlice() *[][]byte {
method toExtensions (line 258) | func (p pointer) toExtensions() *XXX_InternalExtensions {
method toOldExtensions (line 261) | func (p pointer) toOldExtensions() *map[int32]Extension {
method getPointer (line 264) | func (p pointer) getPointer() pointer {
method setPointer (line 267) | func (p pointer) setPointer(q pointer) {
method appendPointer (line 270) | func (p pointer) appendPointer(q pointer) {
method getPointerSlice (line 276) | func (p pointer) getPointerSlice() []pointer {
method setPointerSlice (line 290) | func (p pointer) setPointerSlice(v []pointer) {
method getInterfacePointer (line 304) | func (p pointer) getInterfacePointer() pointer {
method asPointerTo (line 311) | func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
function toPointer (line 76) | func toPointer(i *Message) pointer {
function toAddrPointer (line 82) | func toAddrPointer(i *interface{}, isptr bool) pointer {
function valToPointer (line 90) | func valToPointer(v reflect.Value) pointer {
function grow (line 107) | func grow(s reflect.Value) reflect.Value {
function atomicLoadUnmarshalInfo (line 316) | func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
function atomicStoreUnmarshalInfo (line 321) | func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
function atomicLoadMarshalInfo (line 326) | func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
function atomicStoreMarshalInfo (line 331) | func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
function atomicLoadMergeInfo (line 336) | func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
function atomicStoreMergeInfo (line 341) | func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
function atomicLoadDiscardInfo (line 346) | func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
function atomicStoreDiscardInfo (line 351) | func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
FILE: vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
method getRef (line 43) | func (p pointer) getRef() pointer {
method appendRef (line 47) | func (p pointer) appendRef(v pointer, typ reflect.Type) {
method getSlice (line 54) | func (p pointer) getSlice(typ reflect.Type) reflect.Value {
FILE: vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
constant unsafeAllowed (line 44) | unsafeAllowed = true
type field (line 48) | type field
method IsValid (line 62) | func (f field) IsValid() bool {
function toField (line 51) | func toField(f *reflect.StructField) field {
constant invalidField (line 56) | invalidField = ^field(0)
constant zeroField (line 59) | zeroField = field(0)
type pointer (line 70) | type pointer struct
method offset (line 107) | func (p pointer) offset(f field) pointer {
method isNil (line 118) | func (p pointer) isNil() bool {
method toInt64 (line 122) | func (p pointer) toInt64() *int64 {
method toInt64Ptr (line 125) | func (p pointer) toInt64Ptr() **int64 {
method toInt64Slice (line 128) | func (p pointer) toInt64Slice() *[]int64 {
method toInt32 (line 131) | func (p pointer) toInt32() *int32 {
method getInt32Ptr (line 144) | func (p pointer) getInt32Ptr() *int32 {
method setInt32Ptr (line 147) | func (p pointer) setInt32Ptr(v int32) {
method getInt32Slice (line 154) | func (p pointer) getInt32Slice() []int32 {
method setInt32Slice (line 161) | func (p pointer) setInt32Slice(v []int32) {
method appendInt32Slice (line 166) | func (p pointer) appendInt32Slice(v int32) {
method toUint64 (line 171) | func (p pointer) toUint64() *uint64 {
method toUint64Ptr (line 174) | func (p pointer) toUint64Ptr() **uint64 {
method toUint64Slice (line 177) | func (p pointer) toUint64Slice() *[]uint64 {
method toUint32 (line 180) | func (p pointer) toUint32() *uint32 {
method toUint32Ptr (line 183) | func (p pointer) toUint32Ptr() **uint32 {
method toUint32Slice (line 186) | func (p pointer) toUint32Slice() *[]uint32 {
method toBool (line 189) | func (p pointer) toBool() *bool {
method toBoolPtr (line 192) | func (p pointer) toBoolPtr() **bool {
method toBoolSlice (line 195) | func (p pointer) toBoolSlice() *[]bool {
method toFloat64 (line 198) | func (p pointer) toFloat64() *float64 {
method toFloat64Ptr (line 201) | func (p pointer) toFloat64Ptr() **float64 {
method toFloat64Slice (line 204) | func (p pointer) toFloat64Slice() *[]float64 {
method toFloat32 (line 207) | func (p pointer) toFloat32() *float32 {
method toFloat32Ptr (line 210) | func (p pointer) toFloat32Ptr() **float32 {
method toFloat32Slice (line 213) | func (p pointer) toFloat32Slice() *[]float32 {
method toString (line 216) | func (p pointer) toString() *string {
method toStringPtr (line 219) | func (p pointer) toStringPtr() **string {
method toStringSlice (line 222) | func (p pointer) toStringSlice() *[]string {
method toBytes (line 225) | func (p pointer) toBytes() *[]byte {
method toBytesSlice (line 228) | func (p pointer) toBytesSlice() *[][]byte {
method toExtensions (line 231) | func (p pointer) toExtensions() *XXX_InternalExtensions {
method toOldExtensions (line 234) | func (p pointer) toOldExtensions() *map[int32]Extension {
method getPointerSlice (line 241) | func (p pointer) getPointerSlice() []pointer {
method setPointerSlice (line 250) | func (p pointer) setPointerSlice(v []pointer) {
method getPointer (line 257) | func (p pointer) getPointer() pointer {
method setPointer (line 262) | func (p pointer) setPointer(q pointer) {
method appendPointer (line 267) | func (p pointer) appendPointer(q pointer) {
method getInterfacePointer (line 274) | func (p pointer) getInterfacePointer() pointer {
method asPointerTo (line 281) | func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
function toPointer (line 79) | func toPointer(i *Message) pointer {
function toAddrPointer (line 88) | func toAddrPointer(i *interface{}, isptr bool) pointer {
function valToPointer (line 101) | func valToPointer(v reflect.Value) pointer {
function atomicLoadUnmarshalInfo (line 285) | func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
function atomicStoreUnmarshalInfo (line 288) | func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
function atomicLoadMarshalInfo (line 291) | func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
function atomicStoreMarshalInfo (line 294) | func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
function atomicLoadMergeInfo (line 297) | func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
function atomicStoreMergeInfo (line 300) | func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
function atomicLoadDiscardInfo (line 303) | func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
function atomicStoreDiscardInfo (line 306) | func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
FILE: vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
method getRef (line 40) | func (p pointer) getRef() pointer {
method appendRef (line 44) | func (p pointer) appendRef(v pointer, typ reflect.Type) {
method getSlice (line 51) | func (p pointer) getSlice(typ reflect.Type) reflect.Value {
FILE: vendor/github.com/gogo/protobuf/proto/properties.go
constant debug (line 54) | debug bool = false
constant WireVarint (line 58) | WireVarint = 0
constant WireFixed64 (line 59) | WireFixed64 = 1
constant WireBytes (line 60) | WireBytes = 2
constant WireStartGroup (line 61) | WireStartGroup = 3
constant WireEndGroup (line 62) | WireEndGroup = 4
constant WireFixed32 (line 63) | WireFixed32 = 5
type tagMap (line 69) | type tagMap struct
method get (line 78) | func (p *tagMap) get(t int) (int, bool) {
method put (line 90) | func (p *tagMap) put(t int, fi int) {
constant tagMapFastLimit (line 76) | tagMapFastLimit = 1024
type StructProperties (line 106) | type StructProperties struct
method Len (line 128) | func (sp *StructProperties) Len() int { return len(sp.order) }
method Less (line 129) | func (sp *StructProperties) Less(i, j int) bool {
method Swap (line 132) | func (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] ...
type OneofProperties (line 119) | type OneofProperties struct
type Properties (line 135) | type Properties struct
method String (line 167) | func (p *Properties) String() string {
method Parse (line 203) | func (p *Properties) Parse(s string) {
method setFieldProps (line 284) | func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.Struct...
method setTag (line 338) | func (p *Properties) setTag(lockGetProp bool) {
method Init (line 353) | func (p *Properties) Init(typ reflect.Type, name, tag string, f *refle...
method init (line 357) | func (p *Properties) init(typ reflect.Type, name, tag string, f *refle...
function GetProperties (line 375) | func GetProperties(t reflect.Type) *StructProperties {
function getPropertiesLocked (line 399) | func getPropertiesLocked(t reflect.Type) *StructProperties {
function RegisterEnum (line 508) | func RegisterEnum(typeName string, unusedNameMap map[int32]string, value...
function EnumValueMap (line 521) | func EnumValueMap(enumType string) map[string]int32 {
function RegisterType (line 535) | func RegisterType(x Message, name string) {
function RegisterMapType (line 554) | func RegisterMapType(x interface{}, name string) {
function MessageName (line 568) | func MessageName(x Message) string {
function MessageType (line 581) | func MessageType(name string) reflect.Type {
function RegisterFile (line 595) | func RegisterFile(filename string, fileDescriptor []byte) {
function FileDescriptor (line 600) | func FileDescriptor(filename string) []byte { return protoFiles[filename] }
FILE: vendor/github.com/gogo/protobuf/proto/skip_gogo.go
function Skip (line 36) | func Skip(data []byte) (n int, err error) {
FILE: vendor/github.com/gogo/protobuf/proto/table_marshal.go
type sizer (line 49) | type sizer
type marshaler (line 53) | type marshaler
type marshalInfo (line 56) | type marshalInfo struct
method size (line 168) | func (u *marshalInfo) size(ptr pointer) int {
method cachedsize (line 230) | func (u *marshalInfo) cachedsize(ptr pointer) int {
method marshal (line 241) | func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic boo...
method computeMarshalInfo (line 319) | func (u *marshalInfo) computeMarshalInfo() {
method getExtElemInfo (line 429) | func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElem...
method sizeExtensions (line 2416) | func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int {
method appendExtensions (line 2444) | func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExte...
method sizeMessageSet (line 2520) | func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int {
method appendMessageSet (line 2555) | func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExte...
method sizeV1Extensions (line 2637) | func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int {
method appendV1Extensions (line 2663) | func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extensi...
type marshalFieldInfo (line 76) | type marshalFieldInfo struct
method computeMarshalFieldInfo (line 465) | func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructF...
method computeOneofFieldInfo (line 484) | func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructFie...
method setTag (line 536) | func (fi *marshalFieldInfo) setTag(f *reflect.StructField, tag int, wt...
method setMarshaler (line 543) | func (fi *marshalFieldInfo) setMarshaler(f *reflect.StructField, tags ...
type marshalElemInfo (line 89) | type marshalElemInfo struct
function getMarshalInfo (line 105) | func getMarshalInfo(t reflect.Type) *marshalInfo {
method Size (line 120) | func (a *InternalMessageInfo) Size(msg Message) int {
method Marshal (line 136) | func (a *InternalMessageInfo) Marshal(b []byte, msg Message, determinist...
function getMessageMarshalInfo (line 148) | func getMessageMarshalInfo(msg interface{}, a *InternalMessageInfo) *mar...
type byTag (line 421) | type byTag
method Len (line 423) | func (a byTag) Len() int { return len(a) }
method Swap (line 424) | func (a byTag) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
method Less (line 425) | func (a byTag) Less(i, j int) bool { return a[i].wiretag < a[j].wiretag }
type oneofMessage (line 514) | type oneofMessage interface
function wiretype (line 519) | func wiretype(encoding string) uint64 {
function typeMarshaler (line 561) | func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (s...
function sizeFixed32Value (line 889) | func sizeFixed32Value(_ pointer, tagsize int) int {
function sizeFixed32ValueNoZero (line 892) | func sizeFixed32ValueNoZero(ptr pointer, tagsize int) int {
function sizeFixed32Ptr (line 899) | func sizeFixed32Ptr(ptr pointer, tagsize int) int {
function sizeFixed32Slice (line 906) | func sizeFixed32Slice(ptr pointer, tagsize int) int {
function sizeFixed32PackedSlice (line 910) | func sizeFixed32PackedSlice(ptr pointer, tagsize int) int {
function sizeFixedS32Value (line 917) | func sizeFixedS32Value(_ pointer, tagsize int) int {
function sizeFixedS32ValueNoZero (line 920) | func sizeFixedS32ValueNoZero(ptr pointer, tagsize int) int {
function sizeFixedS32Ptr (line 927) | func sizeFixedS32Ptr(ptr pointer, tagsize int) int {
function sizeFixedS32Slice (line 934) | func sizeFixedS32Slice(ptr pointer, tagsize int) int {
function sizeFixedS32PackedSlice (line 938) | func sizeFixedS32PackedSlice(ptr pointer, tagsize int) int {
function sizeFloat32Value (line 945) | func sizeFloat32Value(_ pointer, tagsize int) int {
function sizeFloat32ValueNoZero (line 948) | func sizeFloat32ValueNoZero(ptr pointer, tagsize int) int {
function sizeFloat32Ptr (line 955) | func sizeFloat32Ptr(ptr pointer, tagsize int) int {
function sizeFloat32Slice (line 962) | func sizeFloat32Slice(ptr pointer, tagsize int) int {
function sizeFloat32PackedSlice (line 966) | func sizeFloat32PackedSlice(ptr pointer, tagsize int) int {
function sizeFixed64Value (line 973) | func sizeFixed64Value(_ pointer, tagsize int) int {
function sizeFixed64ValueNoZero (line 976) | func sizeFixed64ValueNoZero(ptr pointer, tagsize int) int {
function sizeFixed64Ptr (line 983) | func sizeFixed64Ptr(ptr pointer, tagsize int) int {
function sizeFixed64Slice (line 990) | func sizeFixed64Slice(ptr pointer, tagsize int) int {
function sizeFixed64PackedSlice (line 994) | func sizeFixed64PackedSlice(ptr pointer, tagsize int) int {
function sizeFixedS64Value (line 1001) | func sizeFixedS64Value(_ pointer, tagsize int) int {
function sizeFixedS64ValueNoZero (line 1004) | func sizeFixedS64ValueNoZero(ptr pointer, tagsize int) int {
function sizeFixedS64Ptr (line 1011) | func sizeFixedS64Ptr(ptr pointer, tagsize int) int {
function sizeFixedS64Slice (line 1018) | func sizeFixedS64Slice(ptr pointer, tagsize int) int {
function sizeFixedS64PackedSlice (line 1022) | func sizeFixedS64PackedSlice(ptr pointer, tagsize int) int {
function sizeFloat64Value (line 1029) | func sizeFloat64Value(_ pointer, tagsize int) int {
function sizeFloat64ValueNoZero (line 1032) | func sizeFloat64ValueNoZero(ptr pointer, tagsize int) int {
function sizeFloat64Ptr (line 1039) | func sizeFloat64Ptr(ptr pointer, tagsize int) int {
function sizeFloat64Slice (line 1046) | func sizeFloat64Slice(ptr pointer, tagsize int) int {
function sizeFloat64PackedSlice (line 1050) | func sizeFloat64PackedSlice(ptr pointer, tagsize int) int {
function sizeVarint32Value (line 1057) | func sizeVarint32Value(ptr pointer, tagsize int) int {
function sizeVarint32ValueNoZero (line 1061) | func sizeVarint32ValueNoZero(ptr pointer, tagsize int) int {
function sizeVarint32Ptr (line 1068) | func sizeVarint32Ptr(ptr pointer, tagsize int) int {
function sizeVarint32Slice (line 1075) | func sizeVarint32Slice(ptr pointer, tagsize int) int {
function sizeVarint32PackedSlice (line 1083) | func sizeVarint32PackedSlice(ptr pointer, tagsize int) int {
function sizeVarintS32Value (line 1094) | func sizeVarintS32Value(ptr pointer, tagsize int) int {
function sizeVarintS32ValueNoZero (line 1098) | func sizeVarintS32ValueNoZero(ptr pointer, tagsize int) int {
function sizeVarintS32Ptr (line 1105) | func sizeVarintS32Ptr(ptr pointer, tagsize int) int {
function sizeVarintS32Slice (line 1112) | func sizeVarintS32Slice(ptr pointer, tagsize int) int {
function sizeVarintS32PackedSlice (line 1120) | func sizeVarintS32PackedSlice(ptr pointer, tagsize int) int {
function sizeVarint64Value (line 1131) | func sizeVarint64Value(ptr pointer, tagsize int) int {
function sizeVarint64ValueNoZero (line 1135) | func sizeVarint64ValueNoZero(ptr pointer, tagsize int) int {
function sizeVarint64Ptr (line 1142) | func sizeVarint64Ptr(ptr pointer, tagsize int) int {
function sizeVarint64Slice (line 1149) | func sizeVarint64Slice(ptr pointer, tagsize int) int {
function sizeVarint64PackedSlice (line 1157) | func sizeVarint64PackedSlice(ptr pointer, tagsize int) int {
function sizeVarintS64Value (line 1168) | func sizeVarintS64Value(ptr pointer, tagsize int) int {
function sizeVarintS64ValueNoZero (line 1172) | func sizeVarintS64ValueNoZero(ptr pointer, tagsize int) int {
function sizeVarintS64Ptr (line 1179) | func sizeVarintS64Ptr(ptr pointer, tagsize int) int {
function sizeVarintS64Slice (line 1186) | func sizeVarintS64Slice(ptr pointer, tagsize int) int {
function sizeVarintS64PackedSlice (line 1194) | func sizeVarintS64PackedSlice(ptr pointer, tagsize int) int {
function sizeZigzag32Value (line 1205) | func sizeZigzag32Value(ptr pointer, tagsize int) int {
function sizeZigzag32ValueNoZero (line 1209) | func sizeZigzag32ValueNoZero(ptr pointer, tagsize int) int {
function sizeZigzag32Ptr (line 1216) | func sizeZigzag32Ptr(ptr pointer, tagsize int) int {
function sizeZigzag32Slice (line 1224) | func sizeZigzag32Slice(ptr pointer, tagsize int) int {
function sizeZigzag32PackedSlice (line 1232) | func sizeZigzag32PackedSlice(ptr pointer, tagsize int) int {
function sizeZigzag64Value (line 1243) | func sizeZigzag64Value(ptr pointer, tagsize int) int {
function sizeZigzag64ValueNoZero (line 1247) | func sizeZigzag64ValueNoZero(ptr pointer, tagsize int) int {
function sizeZigzag64Ptr (line 1254) | func sizeZigzag64Ptr(ptr pointer, tagsize int) int {
function sizeZigzag64Slice (line 1262) | func sizeZigzag64Slice(ptr pointer, tagsize int) int {
function sizeZigzag64PackedSlice (line 1270) | func sizeZigzag64PackedSlice(ptr pointer, tagsize int) int {
function sizeBoolValue (line 1281) | func sizeBoolValue(_ pointer, tagsize int) int {
function sizeBoolValueNoZero (line 1284) | func sizeBoolValueNoZero(ptr pointer, tagsize int) int {
function sizeBoolPtr (line 1291) | func sizeBoolPtr(ptr pointer, tagsize int) int {
function sizeBoolSlice (line 1298) | func sizeBoolSlice(ptr pointer, tagsize int) int {
function sizeBoolPackedSlice (line 1302) | func sizeBoolPackedSlice(ptr pointer, tagsize int) int {
function sizeStringValue (line 1309) | func sizeStringValue(ptr pointer, tagsize int) int {
function sizeStringValueNoZero (line 1313) | func sizeStringValueNoZero(ptr pointer, tagsize int) int {
function sizeStringPtr (line 1320) | func sizeStringPtr(ptr pointer, tagsize int) int {
function sizeStringSlice (line 1328) | func sizeStringSlice(ptr pointer, tagsize int) int {
function sizeBytes (line 1336) | func sizeBytes(ptr pointer, tagsize int) int {
function sizeBytes3 (line 1343) | func sizeBytes3(ptr pointer, tagsize int) int {
function sizeBytesOneof (line 1350) | func sizeBytesOneof(ptr pointer, tagsize int) int {
function sizeBytesSlice (line 1354) | func sizeBytesSlice(ptr pointer, tagsize int) int {
function appendFixed32 (line 1364) | func appendFixed32(b []byte, v uint32) []byte {
function appendFixed64 (line 1374) | func appendFixed64(b []byte, v uint64) []byte {
function appendVarint (line 1388) | func appendVarint(b []byte, v uint64) []byte {
function appendFixed32Value (line 1470) | func appendFixed32Value(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFixed32ValueNoZero (line 1476) | func appendFixed32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFixed32Ptr (line 1485) | func appendFixed32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]...
function appendFixed32Slice (line 1494) | func appendFixed32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFixed32PackedSlice (line 1502) | func appendFixed32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFixedS32Value (line 1514) | func appendFixedS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendFixedS32ValueNoZero (line 1520) | func appendFixedS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ ...
function appendFixedS32Ptr (line 1529) | func appendFixedS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendFixedS32Slice (line 1538) | func appendFixedS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendFixedS32PackedSlice (line 1546) | func appendFixedS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ ...
function appendFloat32Value (line 1558) | func appendFloat32Value(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFloat32ValueNoZero (line 1564) | func appendFloat32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFloat32Ptr (line 1573) | func appendFloat32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]...
function appendFloat32Slice (line 1582) | func appendFloat32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFloat32PackedSlice (line 1590) | func appendFloat32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFixed64Value (line 1602) | func appendFixed64Value(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFixed64ValueNoZero (line 1608) | func appendFixed64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFixed64Ptr (line 1617) | func appendFixed64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]...
function appendFixed64Slice (line 1626) | func appendFixed64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFixed64PackedSlice (line 1634) | func appendFixed64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFixedS64Value (line 1646) | func appendFixedS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendFixedS64ValueNoZero (line 1652) | func appendFixedS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ ...
function appendFixedS64Ptr (line 1661) | func appendFixedS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendFixedS64Slice (line 1670) | func appendFixedS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendFixedS64PackedSlice (line 1678) | func appendFixedS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ ...
function appendFloat64Value (line 1690) | func appendFloat64Value(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFloat64ValueNoZero (line 1696) | func appendFloat64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ b...
function appendFloat64Ptr (line 1705) | func appendFloat64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]...
function appendFloat64Slice (line 1714) | func appendFloat64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendFloat64PackedSlice (line 1722) | func appendFloat64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ b...
function appendVarint32Value (line 1734) | func appendVarint32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendVarint32ValueNoZero (line 1740) | func appendVarint32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ ...
function appendVarint32Ptr (line 1749) | func appendVarint32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendVarint32Slice (line 1758) | func appendVarint32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendVarint32PackedSlice (line 1766) | func appendVarint32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ ...
function appendVarintS32Value (line 1783) | func appendVarintS32Value(b []byte, ptr pointer, wiretag uint64, _ bool)...
function appendVarintS32ValueNoZero (line 1789) | func appendVarintS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _...
function appendVarintS32Ptr (line 1798) | func appendVarintS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendVarintS32Slice (line 1807) | func appendVarintS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool)...
function appendVarintS32PackedSlice (line 1815) | func appendVarintS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _...
function appendVarint64Value (line 1832) | func appendVarint64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendVarint64ValueNoZero (line 1838) | func appendVarint64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ ...
function appendVarint64Ptr (line 1847) | func appendVarint64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendVarint64Slice (line 1856) | func appendVarint64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendVarint64PackedSlice (line 1864) | func appendVarint64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ ...
function appendVarintS64Value (line 1881) | func appendVarintS64Value(b []byte, ptr pointer, wiretag uint64, _ bool)...
function appendVarintS64ValueNoZero (line 1887) | func appendVarintS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _...
function appendVarintS64Ptr (line 1896) | func appendVarintS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) (...
function appendVarintS64Slice (line 1905) | func appendVarintS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool)...
function appendVarintS64PackedSlice (line 1913) | func appendVarintS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _...
function appendZigzag32Value (line 1930) | func appendZigzag32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendZigzag32ValueNoZero (line 1936) | func appendZigzag32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ ...
function appendZigzag32Ptr (line 1945) | func appendZigzag32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendZigzag32Slice (line 1955) | func appendZigzag32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendZigzag32PackedSlice (line 1963) | func appendZigzag32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ ...
function appendZigzag64Value (line 1980) | func appendZigzag64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendZigzag64ValueNoZero (line 1986) | func appendZigzag64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ ...
function appendZigzag64Ptr (line 1995) | func appendZigzag64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendZigzag64Slice (line 2005) | func appendZigzag64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ...
function appendZigzag64PackedSlice (line 2013) | func appendZigzag64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ ...
function appendBoolValue (line 2030) | func appendBoolValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]b...
function appendBoolValueNoZero (line 2040) | func appendBoolValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool...
function appendBoolPtr (line 2050) | func appendBoolPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byt...
function appendBoolSlice (line 2063) | func appendBoolSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]b...
function appendBoolPackedSlice (line 2075) | func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool...
function appendStringValue (line 2091) | func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendStringValueNoZero (line 2101) | func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bo...
function appendStringPtr (line 2114) | func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]b...
function appendStringSlice (line 2128) | func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([...
function appendBytes (line 2140) | func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte,...
function appendBytes3 (line 2150) | func appendBytes3(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte...
function appendBytesOneof (line 2160) | func appendBytesOneof(b []byte, ptr pointer, wiretag uint64, _ bool) ([]...
function appendBytesSlice (line 2167) | func appendBytesSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]...
function makeGroupMarshaler (line 2179) | func makeGroupMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeGroupSliceMarshaler (line 2202) | func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeMessageMarshaler (line 2245) | func makeMessageMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeMessageSliceMarshaler (line 2268) | func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeMapMarshaler (line 2313) | func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
function makeOneOfMarshaler (line 2387) | func makeOneOfMarshaler(fi *marshalFieldInfo, f *reflect.StructField) (s...
type newMarshaler (line 2705) | type newMarshaler interface
function Size (line 2712) | func Size(pb Message) int {
function Marshal (line 2733) | func Marshal(pb Message) ([]byte, error) {
method Marshal (line 2759) | func (p *Buffer) Marshal(pb Message) error {
method grow (line 2789) | func (p *Buffer) grow(n int) {
FILE: vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
function makeMessageRefMarshaler (line 38) | func makeMessageRefMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeMessageRefSliceMarshaler (line 53) | func makeMessageRefSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeCustomPtrMarshaler (line 98) | func makeCustomPtrMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeCustomMarshaler (line 123) | func makeCustomMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeTimeMarshaler (line 142) | func makeTimeMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeTimePtrMarshaler (line 168) | func makeTimePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeTimeSliceMarshaler (line 200) | func makeTimeSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeTimePtrSliceMarshaler (line 239) | func makeTimePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeDurationMarshaler (line 278) | func makeDurationMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeDurationPtrMarshaler (line 298) | func makeDurationPtrMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeDurationSliceMarshaler (line 324) | func makeDurationSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
function makeDurationPtrSliceMarshaler (line 357) | func makeDurationPtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
FILE: vendor/github.com/gogo/protobuf/proto/table_merge.go
method Merge (line 44) | func (a *InternalMessageInfo) Merge(dst, src Message) {
type mergeInfo (line 53) | type mergeInfo struct
method merge (line 104) | func (mi *mergeInfo) merge(dst, src pointer) {
method computeMergeInfo (line 163) | func (mi *mergeInfo) computeMergeInfo() {
type mergeFieldInfo (line 63) | type mergeFieldInfo struct
function getMergeInfo (line 92) | func getMergeInfo(t reflect.Type) *mergeInfo {
FILE: vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
method Unmarshal (line 53) | func (a *InternalMessageInfo) Unmarshal(msg Message, b []byte) error {
type unmarshalInfo (line 67) | type unmarshalInfo struct
method unmarshal (line 134) | func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
method computeUnmarshalInfo (line 265) | func (u *unmarshalInfo) computeUnmarshalInfo() {
method setTag (line 426) | func (u *unmarshalInfo) setTag(tag int, field field, unmarshal unmarsh...
type unmarshaler (line 91) | type unmarshaler
type unmarshalFieldInfo (line 93) | type unmarshalFieldInfo struct
function getUnmarshalInfo (line 112) | func getUnmarshalInfo(t reflect.Type) *unmarshalInfo {
function fieldUnmarshaler (line 443) | func fieldUnmarshaler(f *reflect.StructField) unmarshaler {
function typeUnmarshaler (line 451) | func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
function unmarshalInt64Value (line 695) | func unmarshalInt64Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalInt64Ptr (line 709) | func unmarshalInt64Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalInt64Slice (line 723) | func unmarshalInt64Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalSint64Value (line 761) | func unmarshalSint64Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalSint64Ptr (line 775) | func unmarshalSint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalSint64Slice (line 789) | func unmarshalSint64Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalUint64Value (line 827) | func unmarshalUint64Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalUint64Ptr (line 841) | func unmarshalUint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalUint64Slice (line 855) | func unmarshalUint64Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalInt32Value (line 893) | func unmarshalInt32Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalInt32Ptr (line 907) | func unmarshalInt32Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalInt32Slice (line 921) | func unmarshalInt32Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalSint32Value (line 957) | func unmarshalSint32Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalSint32Ptr (line 971) | func unmarshalSint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalSint32Slice (line 985) | func unmarshalSint32Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalUint32Value (line 1021) | func unmarshalUint32Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalUint32Ptr (line 1035) | func unmarshalUint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalUint32Slice (line 1049) | func unmarshalUint32Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixed64Value (line 1087) | func unmarshalFixed64Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixed64Ptr (line 1099) | func unmarshalFixed64Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixed64Slice (line 1111) | func unmarshalFixed64Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixedS64Value (line 1146) | func unmarshalFixedS64Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixedS64Ptr (line 1158) | func unmarshalFixedS64Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixedS64Slice (line 1170) | func unmarshalFixedS64Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixed32Value (line 1205) | func unmarshalFixed32Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixed32Ptr (line 1217) | func unmarshalFixed32Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixed32Slice (line 1229) | func unmarshalFixed32Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixedS32Value (line 1264) | func unmarshalFixedS32Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixedS32Ptr (line 1276) | func unmarshalFixedS32Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFixedS32Slice (line 1288) | func unmarshalFixedS32Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalBoolValue (line 1321) | func unmarshalBoolValue(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalBoolPtr (line 1338) | func unmarshalBoolPtr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalBoolSlice (line 1351) | func unmarshalBoolSlice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFloat64Value (line 1388) | func unmarshalFloat64Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFloat64Ptr (line 1400) | func unmarshalFloat64Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFloat64Slice (line 1412) | func unmarshalFloat64Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFloat32Value (line 1447) | func unmarshalFloat32Value(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFloat32Ptr (line 1459) | func unmarshalFloat32Ptr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalFloat32Slice (line 1471) | func unmarshalFloat32Slice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalStringValue (line 1506) | func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalStringPtr (line 1526) | func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalStringSlice (line 1546) | func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalBytesValue (line 1569) | func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
function unmarshalBytesSlice (line 1590) | func unmarshalBytesSlice(b []byte, f pointer, w int) ([]byte, error) {
function makeUnmarshalMessagePtr (line 1608) | func makeUnmarshalMessagePtr(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalMessageSlicePtr (line 1642) | func makeUnmarshalMessageSlicePtr(sub *unmarshalInfo, name string) unmar...
function makeUnmarshalGroupPtr (line 1669) | func makeUnmarshalGroupPtr(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalGroupSlicePtr (line 1695) | func makeUnmarshalGroupSlicePtr(sub *unmarshalInfo, name string) unmarsh...
function makeUnmarshalMap (line 1718) | func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
function makeUnmarshalOneof (line 1817) | func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) u...
function skipField (line 1843) | func skipField(b []byte, wire int) ([]byte, error) {
function findEndGroup (line 1884) | func findEndGroup(b []byte) (int, int) {
function encodeVarint (line 1935) | func encodeVarint(b []byte, x uint64) []byte {
function decodeVarint (line 1946) | func decodeVarint(b []byte) (uint64, int) {
FILE: vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
function makeUnmarshalMessage (line 36) | func makeUnmarshalMessage(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalMessageSlice (line 70) | func makeUnmarshalMessageSlice(sub *unmarshalInfo, name string) unmarsha...
function makeUnmarshalCustomPtr (line 97) | func makeUnmarshalCustomPtr(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalCustomSlice (line 121) | func makeUnmarshalCustomSlice(sub *unmarshalInfo, name string) unmarshal...
function makeUnmarshalCustom (line 145) | func makeUnmarshalCustom(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalTime (line 167) | func makeUnmarshalTime(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalTimePtr (line 194) | func makeUnmarshalTimePtr(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalTimePtrSlice (line 221) | func makeUnmarshalTimePtrSlice(sub *unmarshalInfo, name string) unmarsha...
function makeUnmarshalTimeSlice (line 249) | func makeUnmarshalTimeSlice(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalDurationPtr (line 277) | func makeUnmarshalDurationPtr(sub *unmarshalInfo, name string) unmarshal...
function makeUnmarshalDuration (line 304) | func makeUnmarshalDuration(sub *unmarshalInfo, name string) unmarshaler {
function makeUnmarshalDurationPtrSlice (line 331) | func makeUnmarshalDurationPtrSlice(sub *unmarshalInfo, name string) unma...
function makeUnmarshalDurationSlice (line 359) | func makeUnmarshalDurationSlice(sub *unmarshalInfo, name string) unmarsh...
FILE: vendor/github.com/gogo/protobuf/proto/text.go
type writer (line 71) | type writer interface
type textWriter (line 77) | type textWriter struct
method WriteString (line 84) | func (w *textWriter) WriteString(s string) (n int, err error) {
method Write (line 98) | func (w *textWriter) Write(p []byte) (n int, err error) {
method WriteByte (line 147) | func (w *textWriter) WriteByte(c byte) error {
method indent (line 159) | func (w *textWriter) indent() { w.ind++ }
method unindent (line 161) | func (w *textWriter) unindent() {
method writeIndent (line 837) | func (w *textWriter) writeIndent() {
function writeName (line 169) | func writeName(w *textWriter, props *Properties) error {
function requiresQuotes (line 179) | func requiresQuotes(u string) bool {
function isAny (line 199) | func isAny(sv reflect.Value) bool {
function isprint (line 620) | func isprint(c byte) bool {
function writeString (line 629) | func writeString(w *textWriter, s string) error {
function writeUnknownStruct (line 665) | func writeUnknownStruct(w *textWriter, data []byte) (err error) {
function writeUnknownInt (line 732) | func writeUnknownInt(w *textWriter, x uint64, err error) error {
type int32Slice (line 741) | type int32Slice
method Len (line 743) | func (s int32Slice) Len() int { return len(s) }
method Less (line 744) | func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }
method Swap (line 745) | func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
type TextMarshaler (line 854) | type TextMarshaler struct
method writeProto3Any (line 214) | func (tm *TextMarshaler) writeProto3Any(w *textWriter, sv reflect.Valu...
method writeStruct (line 260) | func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) ...
method writeAny (line 480) | func (tm *TextMarshaler) writeAny(w *textWr
Copy disabled (too large)
Download .json
Condensed preview — 862 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (17,044K chars).
[
{
"path": ".gitignore",
"chars": 18,
"preview": "build\ncoverage.txt"
},
{
"path": ".golang.ci.yaml",
"chars": 925,
"preview": "# available options https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml\nrun:\n # timeout for ana"
},
{
"path": ".goreleaser.yml",
"chars": 926,
"preview": "project_name: godown\ngit:\n short_hash: true\nrelease:\n name_template: \"v{{ .Version }}\"\n prerelease: true \nbuilds:\n -"
},
{
"path": ".travis.yml",
"chars": 217,
"preview": "language: go\n\ngo:\n - 1.x\n\nscript:\n - make test\n\nbefore_install:\n - go get github.com/gojuno/minimock/cmd/minimock\n -"
},
{
"path": "Gopkg.toml",
"chars": 1241,
"preview": "# Gopkg.toml example\n#\n# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html\n# for detailed Gopkg.toml documentat"
},
{
"path": "LICENSE",
"chars": 1067,
"preview": "MIT License\n\nCopyright (c) 2018 Igor German\n\nPermission is hereby granted, free of charge, to any person obtaining a cop"
},
{
"path": "Makefile",
"chars": 1178,
"preview": "PACKAGE=github.com/namreg/godown\nPKGS=$(shell go list ./... | grep -v vendor | grep -v cmd)\nARTIFACTS=./build\n\n.PHONY: d"
},
{
"path": "README.md",
"chars": 6987,
"preview": "## Godown\n\n[](https://www.travis-ci.org/namreg"
},
{
"path": "client/client.go",
"chars": 17657,
"preview": "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/api\"\n\n\t\"gi"
},
{
"path": "client/client_del_test.go",
"chars": 4442,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_expire_test.go",
"chars": 4735,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_get_test.go",
"chars": 5226,
"preview": "package client\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/namreg/godown/internal/api\"\n\n\t\"github.com/gojuno/"
},
{
"path": "client/client_getbit_test.go",
"chars": 4859,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_hdel_test.go",
"chars": 5135,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_hget_test.go",
"chars": 5579,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_hkeys_test.go",
"chars": 5212,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_hset_test.go",
"chars": 4926,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_hvals_test.go",
"chars": 5154,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_keys_test.go",
"chars": 4543,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_lindex_test.go",
"chars": 5436,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_llen_test.go",
"chars": 5092,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_lpop_test.go",
"chars": 4686,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_lpush_test.go",
"chars": 4734,
"preview": "package client\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/inter"
},
{
"path": "client/client_lrange_test.go",
"chars": 5679,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_lrem_test.go",
"chars": 4706,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_ping_test.go",
"chars": 4905,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_rpop_test.go",
"chars": 4686,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_rpush_test.go",
"chars": 4885,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_set_test.go",
"chars": 4704,
"preview": "package client\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/namreg/godown/internal/api\"\n\n\t\"github.com/gojuno/"
},
{
"path": "client/client_setbit_test.go",
"chars": 4897,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_strlen_test.go",
"chars": 4490,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_ttl_test.go",
"chars": 5003,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/client_type_test.go",
"chars": 5091,
"preview": "package client\n\nimport (\n\tcontext \"context\"\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godo"
},
{
"path": "client/executor_mock_test.go",
"chars": 6133,
"preview": "package client\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe original"
},
{
"path": "client/helpers_test.go",
"chars": 258,
"preview": "package client\n\nimport context \"context\"\n\ntype ctxKey string\n\nfunc contextWithValue(key string, value interface{}) conte"
},
{
"path": "client/result.go",
"chars": 2633,
"preview": "package client\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/namreg/godown/internal/api\"\n)\n\n//ScalarResult is a sc"
},
{
"path": "client/result_test.go",
"chars": 3234,
"preview": "package client\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestScalarResult"
},
{
"path": "cmd/godown-cli/Dockerfile",
"chars": 68,
"preview": "FROM scratch\nCOPY godown-cli /\nENTRYPOINT [\"/godown-cli\"]\nCMD [\"-h\"]"
},
{
"path": "cmd/godown-cli/main.go",
"chars": 712,
"preview": "package main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\n\t\"github.com/namreg/godown/internal/cli\"\n)\n\n//Values populated by th"
},
{
"path": "cmd/godown-server/Dockerfile",
"chars": 74,
"preview": "FROM scratch\nCOPY godown-server /\nENTRYPOINT [\"/godown-server\"]\nCMD [\"-h\"]"
},
{
"path": "cmd/godown-server/main.go",
"chars": 1628,
"preview": "package main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/namreg/godown/internal/clock\"\n\t\"github.com/namreg/godown/inter"
},
{
"path": "internal/api/Makefile",
"chars": 124,
"preview": "PWD?=$(shell pwd)\n\ngen:\n\t@docker run --rm -v ${PWD}:${PWD} -w ${PWD} znly/protoc --gogofast_out=plugins=grpc:. -I. api.p"
},
{
"path": "internal/api/api.pb.go",
"chars": 36738,
"preview": "// Code generated by protoc-gen-gogo. DO NOT EDIT.\n// source: api.proto\n\n/*\n\tPackage api is a generated protocol buffer "
},
{
"path": "internal/api/api.proto",
"chars": 2349,
"preview": "syntax = \"proto3\";\n\nimport \"github.com/gogo/protobuf/gogoproto/gogo.proto\";\n\n//FSMCommandType describes all available co"
},
{
"path": "internal/cli/cli.go",
"chars": 1776,
"preview": "package cli\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/Bowery/prompt\"\n\t\"github.com/namreg/godown/internal/a"
},
{
"path": "internal/cli/printer.go",
"chars": 2199,
"preview": "package cli\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/fatih/color\"\n\t\"github.com/namreg/godown/"
},
{
"path": "internal/clock/clock.go",
"chars": 227,
"preview": "package clock\n\nimport \"time\"\n\n//Clock is the system clock\ntype Clock struct{}\n\n//Now returns current time\nfunc (c *Clock"
},
{
"path": "internal/command/command.go",
"chars": 1547,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\nvar (\n\t//ErrWrongArgsNumber"
},
{
"path": "internal/command/command_clock_mock_test.go",
"chars": 4326,
"preview": "package command\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe origina"
},
{
"path": "internal/command/command_mock_test.go",
"chars": 8611,
"preview": "package command\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe origina"
},
{
"path": "internal/command/command_parser_mock_test.go",
"chars": 5370,
"preview": "package command\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe origina"
},
{
"path": "internal/command/command_test.go",
"chars": 839,
"preview": "package command\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestParser_Parse(t *testing.T) {\n\tte"
},
{
"path": "internal/command/data_store_mock_test.go",
"chars": 12124,
"preview": "package command\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe origina"
},
{
"path": "internal/command/del.go",
"chars": 626,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Del is the DEL command\ntype Del struct {\n\tst"
},
{
"path": "internal/command/del_test.go",
"chars": 1413,
"preview": "package command\n\nimport (\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/namreg/godown"
},
{
"path": "internal/command/expire.go",
"chars": 1199,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Expire is the "
},
{
"path": "internal/command/expire_test.go",
"chars": 2500,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/clock\"\n\t\"github.com/namreg/g"
},
{
"path": "internal/command/get.go",
"chars": 871,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Get is the GET command\ntype Get struct {\n\tst"
},
{
"path": "internal/command/get_test.go",
"chars": 1846,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/internal/storage\""
},
{
"path": "internal/command/getbit.go",
"chars": 1528,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//GetBit is the GetBit c"
},
{
"path": "internal/command/getbit_test.go",
"chars": 2531,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/interna"
},
{
"path": "internal/command/hdel.go",
"chars": 1191,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Hdel is the Hdel command\ntype Hdel struct {\n"
},
{
"path": "internal/command/hdel_test.go",
"chars": 2329,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/intern"
},
{
"path": "internal/command/help.go",
"chars": 774,
"preview": "package command\n\nimport (\n\t\"fmt\"\n)\n\n//Help is the Help command\ntype Help struct {\n\tparser commandParser\n}\n\n//Name implem"
},
{
"path": "internal/command/help_test.go",
"chars": 1356,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\n"
},
{
"path": "internal/command/hget.go",
"chars": 947,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Hget is the HGET command\ntype Hget struct {\n"
},
{
"path": "internal/command/hget_test.go",
"chars": 1961,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/intern"
},
{
"path": "internal/command/hkeys.go",
"chars": 1001,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Hkeys is the HKEYS command\ntype Hkeys struct"
},
{
"path": "internal/command/hkeys_test.go",
"chars": 2131,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godow"
},
{
"path": "internal/command/hset.go",
"chars": 1040,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Hset is the HSET command\ntype Hset struct {\n"
},
{
"path": "internal/command/hset_test.go",
"chars": 3108,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/internal/stora"
},
{
"path": "internal/command/hvals.go",
"chars": 962,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Hvals is the HVALS command\ntype Hvals struct"
},
{
"path": "internal/command/hvals_test.go",
"chars": 2066,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown"
},
{
"path": "internal/command/keys.go",
"chars": 1131,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n//Keys is the Keys command\ntype Keys struct {\n\tstrg dataStor"
},
{
"path": "internal/command/keys_test.go",
"chars": 2049,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown"
},
{
"path": "internal/command/lindex.go",
"chars": 1495,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Lindex is the LINDEX c"
},
{
"path": "internal/command/lindex_test.go",
"chars": 2385,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/intern"
},
{
"path": "internal/command/llen.go",
"chars": 954,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Llen is the LLEN command\ntype Llen struct {\n"
},
{
"path": "internal/command/llen_test.go",
"chars": 1859,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/internal/storage\""
},
{
"path": "internal/command/lpop.go",
"chars": 1102,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Lpop is the LPOP command\ntype Lpop struct {\n"
},
{
"path": "internal/command/lpop_test.go",
"chars": 2099,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/intern"
},
{
"path": "internal/command/lpush.go",
"chars": 1234,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Lpush is the LPUSH command\ntype Lpush struct"
},
{
"path": "internal/command/lpush_test.go",
"chars": 3132,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/namre"
},
{
"path": "internal/command/lrange.go",
"chars": 2026,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\nvar errListOutOfRange = "
},
{
"path": "internal/command/lrange_test.go",
"chars": 2794,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/intern"
},
{
"path": "internal/command/lrem.go",
"chars": 1130,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Lrem is the LREM command\ntype Lrem struct {\n"
},
{
"path": "internal/command/lrem_test.go",
"chars": 2963,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/namre"
},
{
"path": "internal/command/parser.go",
"chars": 2240,
"preview": "package command\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"strings\"\n\t\"unicode\"\n)\n\n//ErrCommandNotFound means that command could not "
},
{
"path": "internal/command/ping.go",
"chars": 585,
"preview": "package command\n\nimport (\n\t\"strings\"\n)\n\nconst pong = \"PONG\"\n\n//Ping is a PING command.\ntype Ping struct{}\n\n//Name return"
},
{
"path": "internal/command/ping_test.go",
"chars": 810,
"preview": "package command\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestPing_Name(t *testing.T) {\n\tcmd :"
},
{
"path": "internal/command/reply.go",
"chars": 1339,
"preview": "package command\n\n//Reply contains the result of the command execution.\ntype Reply interface {\n\tVal() interface{}\n}\n\n//Ok"
},
{
"path": "internal/command/reply_test.go",
"chars": 920,
"preview": "package command\n\nimport (\n\t\"testing\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestOkReply"
},
{
"path": "internal/command/rpop.go",
"chars": 1260,
"preview": "package command\n\nimport \"github.com/namreg/godown/internal/storage\"\n\n// Rpop is a RPOP command.\ntype Rpop struct {\n\tstrg"
},
{
"path": "internal/command/rpop_test.go",
"chars": 2098,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\n\t\"github.com/namreg/godown/intern"
},
{
"path": "internal/command/rpush.go",
"chars": 1161,
"preview": "package command\n\nimport \"github.com/namreg/godown/internal/storage\"\n\n// Rpush is a RPUSH command.\ntype Rpush struct {\n\ts"
},
{
"path": "internal/command/rpush_test.go",
"chars": 3131,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/namre"
},
{
"path": "internal/command/set.go",
"chars": 859,
"preview": "package command\n\nimport (\n\t\"strings\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Set is the SET command\ntype Set "
},
{
"path": "internal/command/set_test.go",
"chars": 1700,
"preview": "package command\n\nimport (\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/internal/storage\"\n\t\"githu"
},
{
"path": "internal/command/setbit.go",
"chars": 2402,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//SetBit is the SetBit c"
},
{
"path": "internal/command/setbit_test.go",
"chars": 4007,
"preview": "package command\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/internal/storag"
},
{
"path": "internal/command/strlen.go",
"chars": 963,
"preview": "package command\n\nimport (\n\t\"unicode/utf8\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Strlen is the Strlen comman"
},
{
"path": "internal/command/strlen_test.go",
"chars": 1952,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/namre"
},
{
"path": "internal/command/ttl.go",
"chars": 926,
"preview": "package command\n\nimport (\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//TTL is the TTL command\ntype TTL str"
},
{
"path": "internal/command/ttl_test.go",
"chars": 2149,
"preview": "package command\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/namreg/godown/internal/storage\""
},
{
"path": "internal/command/type.go",
"chars": 747,
"preview": "package command\n\nimport (\n\t\"github.com/namreg/godown/internal/storage\"\n)\n\n//Type is the Type command\ntype Type struct {\n"
},
{
"path": "internal/command/type_test.go",
"chars": 1788,
"preview": "package command\n\nimport (\n\t\"testing\"\n\n\t\"github.com/gojuno/minimock\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/namreg/godown"
},
{
"path": "internal/server/data_store_mock_test.go",
"chars": 11994,
"preview": "package server\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe original"
},
{
"path": "internal/server/fsm.go",
"chars": 4014,
"preview": "package server\n\nimport (\n\t\"encoding/binary\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/centrifugal/centrifugo/libcentri"
},
{
"path": "internal/server/fsm_snapshot.go",
"chars": 955,
"preview": "package server\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\n\t\"github.com/hashicorp/raft\"\n)\n\ntype fsmSnapshot struct {\n\tmeta []by"
},
{
"path": "internal/server/gc.go",
"chars": 1304,
"preview": "package server\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/api\"\n\tcontext \"golang.org/x/net/cont"
},
{
"path": "internal/server/resp/resp.go",
"chars": 1961,
"preview": "package resp\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/tidwall/redcon\"\n\n\t\"github.com/namreg/godown/i"
},
{
"path": "internal/server/server.go",
"chars": 13752,
"preview": "package server\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/"
},
{
"path": "internal/server/server_clock_mock_test.go",
"chars": 4285,
"preview": "package server\n\n/*\nDO NOT EDIT!\nThis code was generated automatically using github.com/gojuno/minimock v1.9\nThe original"
},
{
"path": "internal/storage/marshaler.go",
"chars": 3250,
"preview": "package storage\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\nconst (\n\tttlJSONField = \"ttl\"\n\ttypeJSONField "
},
{
"path": "internal/storage/marshaler_test.go",
"chars": 4901,
"preview": "package storage\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestMarshaler_MarshalJSON(t *testing.T) {\n\ttestCases := []struct"
},
{
"path": "internal/storage/memory/memory.go",
"chars": 4308,
"preview": "package memory\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/clock\"\n\t\"github.com/namreg/godown/internal"
},
{
"path": "internal/storage/memory/memory_test.go",
"chars": 6679,
"preview": "package memory\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/clock\"\n\n\t\"github.com"
},
{
"path": "internal/storage/storage.go",
"chars": 2495,
"preview": "package storage\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\nvar (\n\t//ErrKeyNotExists means that key does not exist. Returns by GetKey"
},
{
"path": "internal/storage/storage_test.go",
"chars": 3467,
"preview": "package storage\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/namreg/godown/internal/clock\"\n\t\"github.com/stretch"
},
{
"path": "vendor/github.com/Bowery/prompt/CONTRIBUTORS.md",
"chars": 395,
"preview": "- [Larz Conwell](https://github.com/larzconwell)\n- [Steve Kaliski](https://github.com/sjkaliski)\n- [NHOrus](https://gith"
},
{
"path": "vendor/github.com/Bowery/prompt/LICENSE",
"chars": 1084,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013-2015 Bowery, Inc.\n\nPermission is hereby granted, free of charge, to any person"
},
{
"path": "vendor/github.com/Bowery/prompt/README.md",
"chars": 1587,
"preview": "# Prompt\n\n[](https://circleci.com/gh/Bowe"
},
{
"path": "vendor/github.com/Bowery/prompt/ansi_unix.go",
"chars": 876,
"preview": "// +build linux darwin freebsd openbsd netbsd dragonfly solaris\n\n// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nim"
},
{
"path": "vendor/github.com/Bowery/prompt/ansi_windows.go",
"chars": 10735,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"unicode/utf8\"\n\t\"unsafe\"\n)\n\n// keyEventTyp"
},
{
"path": "vendor/github.com/Bowery/prompt/buffer.go",
"chars": 2792,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"os\"\n\t\"unicode/utf8\"\n)\n\n// Buffer contains state for line"
},
{
"path": "vendor/github.com/Bowery/prompt/buffer_unix.go",
"chars": 1277,
"preview": "// +build linux darwin freebsd openbsd netbsd dragonfly solaris\n\n// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nim"
},
{
"path": "vendor/github.com/Bowery/prompt/buffer_windows.go",
"chars": 3322,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"unsafe\"\n)\n\nvar (\n\tfillConsoleOutputCharacter = kernel.Ne"
},
{
"path": "vendor/github.com/Bowery/prompt/ioctl_bsd.go",
"chars": 227,
"preview": "// +build darwin freebsd openbsd netbsd dragonfly\n\n// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"golan"
},
{
"path": "vendor/github.com/Bowery/prompt/ioctl_linux.go",
"chars": 170,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\ttcgets = unix.TCGETS"
},
{
"path": "vendor/github.com/Bowery/prompt/ioctl_solaris.go",
"chars": 918,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst (\n\ttcgets = unix"
},
{
"path": "vendor/github.com/Bowery/prompt/ioctl_unix.go",
"chars": 1312,
"preview": "// +build linux darwin freebsd openbsd netbsd dragonfly\n\n// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t"
},
{
"path": "vendor/github.com/Bowery/prompt/keys.go",
"chars": 390,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\n// Line ending in raw mode.\nvar crlf = []byte(\"\\r\\n\")\n\nconst (\n\tbac"
},
{
"path": "vendor/github.com/Bowery/prompt/keys_unix.go",
"chars": 275,
"preview": "// +build linux darwin freebsd openbsd netbsd dragonfly solaris\n\n// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nco"
},
{
"path": "vendor/github.com/Bowery/prompt/keys_windows.go",
"chars": 476,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nconst (\n\tf1Key = 0x70 + iota\n\tf2Key\n\tf3Key\n\tf4Key\n\tf5Key\n\tf6Key\n\tf7"
},
{
"path": "vendor/github.com/Bowery/prompt/prompt.go",
"chars": 2287,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\n// Package prompt implements a cross platform line-editing prompt. It also\n// provi"
},
{
"path": "vendor/github.com/Bowery/prompt/term.go",
"chars": 9966,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\t// Err"
},
{
"path": "vendor/github.com/Bowery/prompt/term_unix.go",
"chars": 1944,
"preview": "// +build linux darwin freebsd openbsd netbsd dragonfly solaris\n\n// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nim"
},
{
"path": "vendor/github.com/Bowery/prompt/term_windows.go",
"chars": 2698,
"preview": "// Copyright 2013-2015 Bowery, Inc.\n\npackage prompt\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Flags to control the term"
},
{
"path": "vendor/github.com/armon/go-metrics/.gitignore",
"chars": 266,
"preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
},
{
"path": "vendor/github.com/armon/go-metrics/LICENSE",
"chars": 1079,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013 Armon Dadgar\n\nPermission is hereby granted, free of charge, to any person obta"
},
{
"path": "vendor/github.com/armon/go-metrics/README.md",
"chars": 3572,
"preview": "go-metrics\n==========\n\nThis library provides a `metrics` package which can be used to instrument code,\nexpose applicatio"
},
{
"path": "vendor/github.com/armon/go-metrics/const_unix.go",
"chars": 153,
"preview": "// +build !windows\n\npackage metrics\n\nimport (\n\t\"syscall\"\n)\n\nconst (\n\t// DefaultSignal is used with DefaultInmemSignal\n\tD"
},
{
"path": "vendor/github.com/armon/go-metrics/const_windows.go",
"chars": 196,
"preview": "// +build windows\n\npackage metrics\n\nimport (\n\t\"syscall\"\n)\n\nconst (\n\t// DefaultSignal is used with DefaultInmemSignal\n\t//"
},
{
"path": "vendor/github.com/armon/go-metrics/inmem.go",
"chars": 9032,
"preview": "package metrics\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"math\"\n\t\"net/url\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\n// InmemSink provides a Metri"
},
{
"path": "vendor/github.com/armon/go-metrics/inmem_endpoint.go",
"chars": 3029,
"preview": "package metrics\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"sort\"\n\t\"time\"\n)\n\n// MetricsSummary holds a roll-up of metrics info for a "
},
{
"path": "vendor/github.com/armon/go-metrics/inmem_signal.go",
"chars": 2823,
"preview": "package metrics\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n)\n\n// InmemSignal is us"
},
{
"path": "vendor/github.com/armon/go-metrics/metrics.go",
"chars": 7303,
"preview": "package metrics\n\nimport (\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/hashicorp/go-immutable-radix\"\n)\n\ntype Label struct"
},
{
"path": "vendor/github.com/armon/go-metrics/sink.go",
"chars": 3828,
"preview": "package metrics\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// The MetricSink interface is used to transmit metrics information\n// to"
},
{
"path": "vendor/github.com/armon/go-metrics/start.go",
"chars": 5059,
"preview": "package metrics\n\nimport (\n\t\"os\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/hashicorp/go-immutable-radix\"\n)\n\n// Config "
},
{
"path": "vendor/github.com/armon/go-metrics/statsd.go",
"chars": 4123,
"preview": "package metrics\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n)\n\nconst (\n\t// statsdMaxLen is the"
},
{
"path": "vendor/github.com/armon/go-metrics/statsite.go",
"chars": 4024,
"preview": "package metrics\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n)\n\nconst (\n\t// We force flush the "
},
{
"path": "vendor/github.com/boltdb/bolt/.gitignore",
"chars": 26,
"preview": "*.prof\n*.test\n*.swp\n/bin/\n"
},
{
"path": "vendor/github.com/boltdb/bolt/LICENSE",
"chars": 1078,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013 Ben Johnson\n\nPermission is hereby granted, free of charge, to any person obtai"
},
{
"path": "vendor/github.com/boltdb/bolt/Makefile",
"chars": 410,
"preview": "BRANCH=`git rev-parse --abbrev-ref HEAD`\nCOMMIT=`git rev-parse --short HEAD`\nGOLDFLAGS=\"-X main.branch $(BRANCH) -X main"
},
{
"path": "vendor/github.com/boltdb/bolt/README.md",
"chars": 35556,
"preview": "Bolt [](https://coveralls.io/r/boltdb/"
},
{
"path": "vendor/github.com/boltdb/bolt/appveyor.yml",
"chars": 262,
"preview": "version: \"{build}\"\n\nos: Windows Server 2012 R2\n\nclone_folder: c:\\gopath\\src\\github.com\\boltdb\\bolt\n\nenvironment:\n GOPAT"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_386.go",
"chars": 291,
"preview": "package bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0x7FFFFFFF // 2GB\n\n//"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_amd64.go",
"chars": 298,
"preview": "package bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0xFFFFFFFFFFFF // 256"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_arm.go",
"chars": 831,
"preview": "package bolt\n\nimport \"unsafe\"\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0x7F"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_arm64.go",
"chars": 315,
"preview": "// +build arm64\n\npackage bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0xFF"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_linux.go",
"chars": 171,
"preview": "package bolt\n\nimport (\n\t\"syscall\"\n)\n\n// fdatasync flushes written data to a file descriptor.\nfunc fdatasync(db *DB) erro"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_openbsd.go",
"chars": 518,
"preview": "package bolt\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tmsAsync = 1 << iota // perform asynchronous writes\n\tmsSync "
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_ppc.go",
"chars": 227,
"preview": "// +build ppc\n\npackage bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0x7FFF"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_ppc64.go",
"chars": 315,
"preview": "// +build ppc64\n\npackage bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0xFF"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_ppc64le.go",
"chars": 317,
"preview": "// +build ppc64le\n\npackage bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0x"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_s390x.go",
"chars": 315,
"preview": "// +build s390x\n\npackage bolt\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0xFF"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_unix.go",
"chars": 2168,
"preview": "// +build !windows,!plan9,!solaris\n\npackage bolt\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\n// flock acquire"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_unix_solaris.go",
"chars": 2059,
"preview": "package bolt\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// flock acquires an advis"
},
{
"path": "vendor/github.com/boltdb/bolt/bolt_windows.go",
"chars": 3930,
"preview": "package bolt\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\n// LockFileEx code derived from golang build filemut"
},
{
"path": "vendor/github.com/boltdb/bolt/boltsync_unix.go",
"chars": 169,
"preview": "// +build !windows,!plan9,!linux,!openbsd\n\npackage bolt\n\n// fdatasync flushes written data to a file descriptor.\nfunc fd"
},
{
"path": "vendor/github.com/boltdb/bolt/bucket.go",
"chars": 21334,
"preview": "package bolt\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"unsafe\"\n)\n\nconst (\n\t// MaxKeySize is the maximum length of a key, in bytes.\n\tMa"
},
{
"path": "vendor/github.com/boltdb/bolt/cursor.go",
"chars": 11359,
"preview": "package bolt\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"sort\"\n)\n\n// Cursor represents an iterator that can traverse over all key/value "
},
{
"path": "vendor/github.com/boltdb/bolt/db.go",
"chars": 28271,
"preview": "package bolt\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"hash/fnv\"\n\t\"log\"\n\t\"os\"\n\t\"runtime\"\n\t\"runtime/debug\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n"
},
{
"path": "vendor/github.com/boltdb/bolt/doc.go",
"chars": 1781,
"preview": "/*\nPackage bolt implements a low-level key/value store in pure Go. It supports\nfully serializable transactions, ACID sem"
},
{
"path": "vendor/github.com/boltdb/bolt/errors.go",
"chars": 2743,
"preview": "package bolt\n\nimport \"errors\"\n\n// These errors can be returned when opening or calling methods on a DB.\nvar (\n\t// ErrDat"
},
{
"path": "vendor/github.com/boltdb/bolt/freelist.go",
"chars": 6694,
"preview": "package bolt\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"unsafe\"\n)\n\n// freelist represents a list of all pages that are available for all"
},
{
"path": "vendor/github.com/boltdb/bolt/node.go",
"chars": 16157,
"preview": "package bolt\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"sort\"\n\t\"unsafe\"\n)\n\n// node represents an in-memory, deserialized page.\ntype nod"
},
{
"path": "vendor/github.com/boltdb/bolt/page.go",
"chars": 4889,
"preview": "package bolt\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"unsafe\"\n)\n\nconst pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr))"
},
{
"path": "vendor/github.com/boltdb/bolt/tx.go",
"chars": 18665,
"preview": "package bolt\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\t\"unsafe\"\n)\n\n// txid represents the internal transa"
},
{
"path": "vendor/github.com/centrifugal/centrifugo/LICENSE",
"chars": 1101,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015, Alexandr Emelin, frvzmb@gmail.com\n\nPermission is hereby granted, free of char"
},
{
"path": "vendor/github.com/centrifugal/centrifugo/libcentrifugo/raw/raw.go",
"chars": 2104,
"preview": "// Package raw contains Raw type (alias to slice of bytes).\npackage raw\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n)\n\n// Raw type used"
},
{
"path": "vendor/github.com/davecgh/go-spew/LICENSE",
"chars": 763,
"preview": "ISC License\n\nCopyright (c) 2012-2016 Dave Collins <dave@davec.name>\n\nPermission to use, copy, modify, and distribute thi"
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/bypass.go",
"chars": 5789,
"preview": "// Copyright (c) 2015-2016 Dave Collins <dave@davec.name>\n//\n// Permission to use, copy, modify, and distribute this sof"
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/bypasssafe.go",
"chars": 1734,
"preview": "// Copyright (c) 2015-2016 Dave Collins <dave@davec.name>\n//\n// Permission to use, copy, modify, and distribute this sof"
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/common.go",
"chars": 10364,
"preview": "/*\n * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this "
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/config.go",
"chars": 12842,
"preview": "/*\n * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this "
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/doc.go",
"chars": 8527,
"preview": "/*\n * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this "
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/dump.go",
"chars": 13813,
"preview": "/*\n * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this "
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/format.go",
"chars": 11330,
"preview": "/*\n * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this "
},
{
"path": "vendor/github.com/davecgh/go-spew/spew/spew.go",
"chars": 5969,
"preview": "/*\n * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this "
},
{
"path": "vendor/github.com/fatih/color/.travis.yml",
"chars": 35,
"preview": "language: go\ngo: \n - 1.8.x\n - tip\n\n"
},
{
"path": "vendor/github.com/fatih/color/Gopkg.toml",
"chars": 686,
"preview": "\n# Gopkg.toml example\n#\n# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md\n# for detailed Gopkg.tom"
},
{
"path": "vendor/github.com/fatih/color/LICENSE.md",
"chars": 1079,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013 Fatih Arslan\n\nPermission is hereby granted, free of charge, to any person obta"
},
{
"path": "vendor/github.com/fatih/color/README.md",
"chars": 4790,
"preview": "# Color [](https://godoc.org/github.com/fatih/color) [![Bui"
},
{
"path": "vendor/github.com/fatih/color/color.go",
"chars": 18321,
"preview": "package color\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/mattn/go-colorable\"\n\t\"github.com/"
},
{
"path": "vendor/github.com/fatih/color/doc.go",
"chars": 4397,
"preview": "/*\nPackage color is an ANSI color package to output colorized or SGR defined\noutput to the standard output. The API can "
},
{
"path": "vendor/github.com/gogo/protobuf/AUTHORS",
"chars": 562,
"preview": "# This is the official list of GoGo authors for copyright purposes.\n# This file is distinct from the CONTRIBUTORS file, "
},
{
"path": "vendor/github.com/gogo/protobuf/CONTRIBUTORS",
"chars": 845,
"preview": "Anton Povarov <anton.povarov@gmail.com>\nBrian Goff <cpuguy83@gmail.com>\nClayton Coleman <ccoleman@redhat.com>\nDenis Smir"
},
{
"path": "vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS",
"chars": 218,
"preview": "The contributors to the Go protobuf repository:\n\n# This source code was written by the Go contributors.\n# The master lis"
},
{
"path": "vendor/github.com/gogo/protobuf/LICENSE",
"chars": 1713,
"preview": "Protocol Buffers for Go with Gadgets\n\nCopyright (c) 2013, The GoGo Authors. All rights reserved.\nhttp://github.com/gogo/"
}
]
// ... and 662 more files (download for full content)
About this extraction
This page contains the full source code of the namreg/godown GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 862 files (15.3 MB), approximately 4.1M tokens, and a symbol index with 88179 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.