├── .gitignore ├── README.md ├── autorun.sh ├── common ├── com_definition.go └── common.go ├── config.json ├── config └── config.go ├── config_simple.json ├── core ├── errors │ ├── errors.go │ ├── errors_test.go │ ├── reporter.go │ └── reporter_test.go ├── jwt │ └── jwt.go └── mongo │ ├── Increment.go │ ├── db.go │ └── db_test.go ├── main.go ├── model ├── application.go ├── login.go ├── model_func.go ├── model_test.go ├── response.go ├── todo.go ├── user.go └── user_role.go ├── privatesources ├── private_key └── public_key.pub ├── remote_auto_push.sh ├── server ├── handler │ ├── index.go │ ├── para_model.go │ ├── router.go │ ├── todo_handler.go │ └── user_handler.go ├── middleware │ ├── authentication.go │ ├── cookie.go │ └── logger.go └── server.go ├── vendor ├── github.com │ ├── dgrijalva │ │ └── jwt-go │ │ │ ├── LICENSE │ │ │ ├── MIGRATION_GUIDE.md │ │ │ ├── README.md │ │ │ ├── VERSION_HISTORY.md │ │ │ ├── claims.go │ │ │ ├── doc.go │ │ │ ├── ecdsa.go │ │ │ ├── ecdsa_utils.go │ │ │ ├── errors.go │ │ │ ├── hmac.go │ │ │ ├── map_claims.go │ │ │ ├── none.go │ │ │ ├── parser.go │ │ │ ├── rsa.go │ │ │ ├── rsa_pss.go │ │ │ ├── rsa_utils.go │ │ │ ├── signing_method.go │ │ │ └── token.go │ ├── flywithbug │ │ └── log4go │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── config.go │ │ │ ├── console_writer.go │ │ │ ├── file_writer.go │ │ │ ├── log.go │ │ │ ├── log.json │ │ │ └── remote_auto_push.sh │ ├── gin-contrib │ │ ├── cors │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── config.go │ │ │ ├── cors.go │ │ │ └── utils.go │ │ └── sse │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── sse-decoder.go │ │ │ ├── sse-encoder.go │ │ │ └── writer.go │ ├── gin-gonic │ │ ├── contrib │ │ │ └── static │ │ │ │ ├── README.md │ │ │ │ └── static.go │ │ └── gin │ │ │ ├── AUTHORS.md │ │ │ ├── BENCHMARKS.md │ │ │ ├── CHANGELOG.md │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── binding │ │ │ ├── binding.go │ │ │ ├── default_validator.go │ │ │ ├── form.go │ │ │ ├── form_mapping.go │ │ │ ├── json.go │ │ │ ├── msgpack.go │ │ │ ├── protobuf.go │ │ │ ├── query.go │ │ │ ├── uri.go │ │ │ ├── xml.go │ │ │ └── yaml.go │ │ │ ├── codecov.yml │ │ │ ├── context.go │ │ │ ├── context_17.go │ │ │ ├── context_appengine.go │ │ │ ├── context_pre17.go │ │ │ ├── debug.go │ │ │ ├── deprecated.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── fs.go │ │ │ ├── gin.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── internal │ │ │ └── json │ │ │ │ ├── json.go │ │ │ │ └── jsoniter.go │ │ │ ├── logger.go │ │ │ ├── mode.go │ │ │ ├── path.go │ │ │ ├── recovery.go │ │ │ ├── render │ │ │ ├── data.go │ │ │ ├── html.go │ │ │ ├── json.go │ │ │ ├── json_17.go │ │ │ ├── msgpack.go │ │ │ ├── protobuf.go │ │ │ ├── reader.go │ │ │ ├── redirect.go │ │ │ ├── render.go │ │ │ ├── text.go │ │ │ ├── xml.go │ │ │ └── yaml.go │ │ │ ├── response_writer.go │ │ │ ├── response_writer_1.7.go │ │ │ ├── response_writer_1.8.go │ │ │ ├── routergroup.go │ │ │ ├── test_helpers.go │ │ │ ├── tools.go │ │ │ ├── tree.go │ │ │ ├── utils.go │ │ │ └── version.go │ ├── golang │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ └── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── deprecated.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 │ ├── mattn │ │ └── go-isatty │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── isatty_bsd.go │ │ │ ├── isatty_linux.go │ │ │ ├── isatty_linux_ppc64x.go │ │ │ ├── isatty_others.go │ │ │ ├── isatty_solaris.go │ │ │ └── isatty_windows.go │ ├── satori │ │ └── go.uuid │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── uuid.go │ └── ugorji │ │ └── go │ │ ├── LICENSE │ │ └── codec │ │ ├── 0doc.go │ │ ├── README.md │ │ ├── binc.go │ │ ├── build.sh │ │ ├── cbor.go │ │ ├── codecgen.go │ │ ├── decode.go │ │ ├── encode.go │ │ ├── fast-path.generated.go │ │ ├── fast-path.go.tmpl │ │ ├── fast-path.not.go │ │ ├── gen-dec-array.go.tmpl │ │ ├── gen-dec-map.go.tmpl │ │ ├── gen-enc-chan.go.tmpl │ │ ├── gen-helper.generated.go │ │ ├── gen-helper.go.tmpl │ │ ├── gen.generated.go │ │ ├── gen.go │ │ ├── go.mod │ │ ├── goversion_arrayof_gte_go15.go │ │ ├── goversion_arrayof_lt_go15.go │ │ ├── goversion_makemap_gte_go19.go │ │ ├── goversion_makemap_lt_go19.go │ │ ├── goversion_unexportedembeddedptr_gte_go110.go │ │ ├── goversion_unexportedembeddedptr_lt_go110.go │ │ ├── goversion_unsupported_lt_go14.go │ │ ├── goversion_vendor_eq_go15.go │ │ ├── goversion_vendor_eq_go16.go │ │ ├── goversion_vendor_gte_go17.go │ │ ├── goversion_vendor_lt_go15.go │ │ ├── helper.go │ │ ├── helper_internal.go │ │ ├── helper_not_unsafe.go │ │ ├── helper_unsafe.go │ │ ├── json.go │ │ ├── mammoth-test.go.tmpl │ │ ├── mammoth2-test.go.tmpl │ │ ├── msgpack.go │ │ ├── rpc.go │ │ ├── simple.go │ │ ├── test-cbor-goldens.json │ │ ├── test.py │ │ └── xml.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── acme │ │ │ ├── acme.go │ │ │ ├── autocert │ │ │ ├── autocert.go │ │ │ ├── cache.go │ │ │ ├── listener.go │ │ │ └── renewal.go │ │ │ ├── http.go │ │ │ ├── jws.go │ │ │ └── types.go │ │ └── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ ├── README.md │ │ ├── affinity_linux.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 │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.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_gccgo.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 │ │ ├── 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 ├── gopkg.in │ ├── go-playground │ │ └── validator.v8 │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── baked_in.go │ │ │ ├── cache.go │ │ │ ├── doc.go │ │ │ ├── logo.png │ │ │ ├── regexes.go │ │ │ ├── util.go │ │ │ └── validator.go │ ├── gomail.v2 │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── auth.go │ │ ├── doc.go │ │ ├── message.go │ │ ├── mime.go │ │ ├── mime_go14.go │ │ ├── send.go │ │ ├── smtp.go │ │ └── writeto.go │ ├── mgo.v2 │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── auth.go │ │ ├── bson │ │ │ ├── LICENSE │ │ │ ├── bson.go │ │ │ ├── decimal.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ └── json.go │ │ ├── bulk.go │ │ ├── cluster.go │ │ ├── doc.go │ │ ├── gridfs.go │ │ ├── internal │ │ │ ├── json │ │ │ │ ├── LICENSE │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── extension.go │ │ │ │ ├── fold.go │ │ │ │ ├── indent.go │ │ │ │ ├── scanner.go │ │ │ │ ├── stream.go │ │ │ │ └── tags.go │ │ │ ├── sasl │ │ │ │ ├── sasl.c │ │ │ │ ├── sasl.go │ │ │ │ ├── sasl_windows.c │ │ │ │ ├── sasl_windows.go │ │ │ │ ├── sasl_windows.h │ │ │ │ ├── sspi_windows.c │ │ │ │ └── sspi_windows.h │ │ │ └── scram │ │ │ │ └── scram.go │ │ ├── log.go │ │ ├── queue.go │ │ ├── raceoff.go │ │ ├── raceon.go │ │ ├── saslimpl.go │ │ ├── saslstub.go │ │ ├── server.go │ │ ├── session.go │ │ ├── socket.go │ │ └── stats.go │ └── yaml.v2 │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── go.mod │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go └── vendor.json └── web_client ├── .babelrc ├── .editorconfig ├── .postcssrc.js ├── README.md ├── build ├── build.js ├── check-versions.js ├── logo.png ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── dist ├── favicon.ico ├── index.html └── static │ ├── css │ ├── app.272263fe6876ee579588ef9d75ecf855.css │ └── app.272263fe6876ee579588ef9d75ecf855.css.map │ ├── favicon.ico │ └── js │ ├── app.9e48b91c9c749bac4c25.js │ ├── app.9e48b91c9c749bac4c25.js.map │ ├── manifest.2ae2e69a05c33dfc65f8.js │ ├── manifest.2ae2e69a05c33dfc65f8.js.map │ ├── vendor.c645eeffb098cfacafea.js │ └── vendor.c645eeffb098cfacafea.js.map ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ ├── HelloWorld.vue │ ├── TodoCheckAll.vue │ ├── TodoClearCompleted.vue │ ├── TodoFiltered.vue │ ├── TodoItem.vue │ ├── TodoItemRemaining.vue │ ├── TodoList.vue │ ├── auth │ │ ├── Login.vue │ │ ├── Logout.vue │ │ └── Register.vue │ ├── layouts │ │ └── Master.vue │ └── marketing │ │ ├── About.vue │ │ ├── LandingPage.vue │ │ └── TestTodosVariable.vue ├── main.js ├── router │ └── index.js └── store │ └── store.js └── static ├── .gitkeep └── favicon.ico /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | 3 | ### Go template 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | node_modules/ 12 | npm-debug.log* 13 | yarn-debug.log* 14 | yarn-error.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | 24 | # Test binary, build with `go test -c` 25 | *.test 26 | 27 | # Output of the go coverage tool, specifically when used with LiteIDE 28 | *.out 29 | 30 | log/* 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Vue-todo 2 | 3 | go: webServer 4 | vue: client 5 | 6 | 7 | 8 | 9 | ``` bash 10 | # govendor add dependencies 11 | go run main.go 12 | 13 | # serve with hot reload at localhost:6201 14 | open http://localhost:8090 15 | 16 | ``` -------------------------------------------------------------------------------- /autorun.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source ~/.bash_profile 4 | govendor add +e 5 | -------------------------------------------------------------------------------- /common/com_definition.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | ) 6 | 7 | const ( 8 | KeyUserToken = "Authorization" 9 | KeyJWTClaims = "_key_jwt_Claims" 10 | KeyUserId = "user_id" 11 | KeyUserAgent = "User-Agent" 12 | ) 13 | 14 | func UserToken(ctx *gin.Context) string { 15 | token := ctx.GetHeader(KeyUserToken) 16 | return token 17 | } 18 | -------------------------------------------------------------------------------- /common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "crypto/md5" 5 | "database/sql" 6 | "fmt" 7 | "io" 8 | "log" 9 | "net" 10 | "net/http" 11 | "strings" 12 | ) 13 | 14 | func Md5(text string) string { 15 | hashMd5 := md5.New() 16 | io.WriteString(hashMd5, text) 17 | return fmt.Sprintf("%x", hashMd5.Sum(nil)) 18 | } 19 | 20 | /* 21 | 获取IP 22 | */ 23 | func GetIp(r *http.Request) string { 24 | ip := net.ParseIP(strings.Split(r.RemoteAddr, ":")[0]).String() 25 | if ip == "" { 26 | ip = "127.0.0.1" 27 | } 28 | return ip 29 | } 30 | 31 | /* 32 | 组合数据 原转JSON(已修正不需要转JSON) 33 | */ 34 | //FIXME 此处方法名需要重新命名 否则会产生干扰 35 | func SaveMapData(key string, data interface{}) interface{} { 36 | dataMap := make(map[string]interface{}) 37 | dataMap[key] = data 38 | return dataMap 39 | } 40 | 41 | /* 42 | 把查询数据库的结果集转换成map 43 | */ 44 | func ResToMap(rows *sql.Rows) map[string]string { 45 | data := make(map[string]string) 46 | columns, err := rows.Columns() 47 | if err != nil { 48 | log.Println("获取结果集中列名数组错误:", err) 49 | } 50 | values := make([]sql.RawBytes, len(columns)) 51 | scanArgs := make([]interface{}, len(values)) 52 | for i := range values { 53 | scanArgs[i] = &values[i] 54 | } 55 | for rows.Next() { 56 | err = rows.Scan(scanArgs...) 57 | if err != nil { 58 | log.Println("扫描结果集中参数值错误:", err) 59 | } 60 | var value string 61 | for i, col := range values { 62 | if col == nil { 63 | value = "NULL" 64 | } else { 65 | value = string(col) 66 | } 67 | data[columns[i]] = value 68 | } 69 | 70 | } 71 | return data 72 | } 73 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_port":":8090", 3 | "static_path":"./web_client/dist/", 4 | "private_key_path":"./privatesources/private_key", 5 | "public_key_path":"./privatesources/public_key.pub", 6 | "db_config":{ 7 | "url": "127.0.0.1:27017", 8 | "db_name": "todo", 9 | "force_sync":true 10 | }, 11 | "router_prefix":"/api", 12 | "auth_prefix":"" 13 | } 14 | -------------------------------------------------------------------------------- /config_simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_port":":8090", 3 | "web_port":":8091", 4 | "static_path":"./web_client/dist/", 5 | "private_key_path":"./xx/private_key", 6 | "public_key_path":"./xx/public_key.pub", 7 | "db_config":{ 8 | "url": "127.0.0.1:27017", 9 | "db_name": "todo", 10 | "force_sync":true 11 | }, 12 | "router_prefix":"/api", 13 | "auth_prefix":"/todo" 14 | } 15 | -------------------------------------------------------------------------------- /core/errors/reporter_test.go: -------------------------------------------------------------------------------- 1 | // black-box testing 2 | package errors_test 3 | 4 | import ( 5 | "testing" 6 | 7 | "todo-go/core/errors" 8 | ) 9 | 10 | func TestReporterAdd(t *testing.T) { 11 | errors.Prefix = "" 12 | 13 | r := errors.NewReporter() 14 | 15 | tests := []string{"err1", "err3", "err4\nerr5"} 16 | for _, tt := range tests { 17 | r.Add(tt) 18 | } 19 | 20 | for i, e := range r.Stack() { 21 | tt := tests[i] 22 | if expected, got := tt, e.Error(); expected != got { 23 | t.Fatalf("[%d] expected %s but got %s", i, expected, got) 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/mongo/Increment.go: -------------------------------------------------------------------------------- 1 | package mongo 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/flywithbug/log4go" 7 | "gopkg.in/mgo.v2" 8 | "gopkg.in/mgo.v2/bson" 9 | ) 10 | 11 | const ( 12 | collectionsIncrementIds = "increment_ids" 13 | IncrementIdsStarValue = 10000 14 | ) 15 | 16 | var incrementDBName = "increment" 17 | 18 | func SetIncrementDBName(dbName string) { 19 | incrementDBName = dbName 20 | } 21 | 22 | func DBName() string { 23 | return incrementDBName 24 | } 25 | 26 | func makeIncrementName(incrementName string) string { 27 | return fmt.Sprintf("increment_%s", incrementName) 28 | } 29 | 30 | type incrementIds struct { 31 | Id string `json:"_id" bson:"_id"` //自增标记Id 32 | SequenceValue int64 `json:"sequence_value" bson:"sequence_value"` //自增 id值 33 | } 34 | 35 | func createIncrementIds(incrementName string) error { 36 | cou := incrementIds{ 37 | Id: incrementName, 38 | SequenceValue: IncrementIdsStarValue, 39 | } 40 | return Insert(incrementDBName, collectionsIncrementIds, cou) 41 | } 42 | 43 | func GetIncrementId(incrementName string) (int64, error) { 44 | incrementName = makeIncrementName(incrementName) 45 | increment := new(incrementIds) 46 | change := mgo.Change{ 47 | Update: bson.M{"$inc": bson.M{"sequence_value": 1}}, 48 | ReturnNew: true, 49 | } 50 | ms, c := connect(incrementDBName, collectionsIncrementIds) 51 | defer ms.Close() 52 | _, err := c.Find(bson.M{"_id": incrementName}).Apply(change, increment) 53 | if err != nil { 54 | err = createIncrementIds(incrementName) 55 | if err != nil { 56 | log4go.Error(err.Error()) 57 | return -1, err 58 | } 59 | increment.SequenceValue = IncrementIdsStarValue 60 | } 61 | return increment.SequenceValue, nil 62 | } 63 | -------------------------------------------------------------------------------- /core/mongo/db_test.go: -------------------------------------------------------------------------------- 1 | package mongo 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestIncrement(t *testing.T) { 9 | DialMgo("127.0.0.1:27017") 10 | count := 0 11 | for { 12 | if count >= 1000 { 13 | break 14 | } 15 | count++ 16 | inId, err := GetIncrementId("userId") 17 | if err != nil { 18 | fmt.Errorf(err.Error()) 19 | } 20 | fmt.Println("IncrementId:", inId) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "todo-go/config" 6 | "todo-go/core/jwt" 7 | "todo-go/core/mongo" 8 | "todo-go/model" 9 | "todo-go/server" 10 | 11 | log "github.com/flywithbug/log4go" 12 | ) 13 | 14 | //log 启动配置 15 | func SetLog() { 16 | w := log.NewFileWriter() 17 | w.SetPathPattern("./log/log-%Y%M%D.log") 18 | c := log.NewConsoleWriter() 19 | c.SetColor(true) 20 | log.Register(w) 21 | log.Register(c) 22 | log.SetLevel(1) 23 | log.SetLayout("2006-01-02 15:04:05") 24 | } 25 | 26 | func main() { 27 | //配置文件 28 | configPath := flag.String("config", "config.json", "Configuration file to use") 29 | flag.Parse() 30 | err := config.ReadConfig(*configPath) 31 | if err != nil { 32 | panic(err) 33 | } 34 | conf := config.Conf() 35 | 36 | //signingKey read 37 | jwt.ReadSigningKey(conf.PrivateKeyPath, conf.PublicKeyPath) 38 | 39 | SetLog() 40 | defer log.Close() 41 | model.SetDBName(conf.DBConfig.DBName) 42 | //mongodb启动连接 43 | mongo.DialMgo(conf.DBConfig.Url) 44 | //go func() { 45 | // //静态文件服务 46 | // server.StartWeb(conf.WebPort, conf.StaticPath) 47 | //}() 48 | //启动ApiServer服务 49 | server.StartServer(conf.ApiPort, conf.StaticPath, conf.RouterPrefix, conf.AuthPrefix) 50 | } 51 | -------------------------------------------------------------------------------- /model/application.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | const ( 4 | appCollection = "application" 5 | ) 6 | 7 | type Application struct { 8 | Title string //应用(组件)名称 9 | AppId string 10 | Code int 11 | Desc string //项目描述 12 | CreateTime int64 //创建时间 13 | ModifyTime int64 14 | ModifyUserId string 15 | } 16 | -------------------------------------------------------------------------------- /model/model_func.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import "todo-go/core/mongo" 4 | 5 | var db = "todo" 6 | 7 | func SetDBName(dbName string) { 8 | db = dbName 9 | mongo.SetIncrementDBName(dbName) 10 | } 11 | 12 | func init() { 13 | mongo.SetIncrementDBName(db) 14 | } 15 | 16 | func DBName() string { 17 | return db 18 | } 19 | 20 | type OperationModel interface { 21 | FindAll() ([]interface{}, error) 22 | Insert() error 23 | Update(id string) error 24 | Remove(id string) error 25 | FindById(id string) (interface{}, error) 26 | } 27 | -------------------------------------------------------------------------------- /model/model_test.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "testing" 7 | "todo-go/core/mongo" 8 | ) 9 | 10 | func TestTodo(t *testing.T) { 11 | mongo.DialMgo("127.0.0.1:27017") 12 | 13 | todo := new(Todo) 14 | todo.Title = "test" 15 | todo.Completed = false 16 | err := InsertTodo(todo) 17 | if err != nil { 18 | panic(err) 19 | } 20 | todos, err := FindAllTodos() 21 | if err != nil { 22 | panic(err) 23 | } 24 | tJson, _ := json.Marshal(todos) 25 | fmt.Println(string(tJson)) 26 | 27 | //todo, err = FindTodoById(2) 28 | //if err != nil { 29 | // panic(err) 30 | //} 31 | //fmt.Println(todo) 32 | } 33 | 34 | func TestUserFunctions(t *testing.T) { 35 | mongo.DialMgo("127.0.0.1:27017") 36 | 37 | user := new(User) 38 | user.RealName = "ori" 39 | user.Password = "pass" 40 | user.Account = "ori" 41 | user.Title = "CEO" 42 | user.Phone = "129" 43 | user.Mail = "admin@admin.com" 44 | user.Sex = 1 45 | 46 | err := user.Insert() 47 | if err != nil { 48 | panic(err) 49 | } 50 | fmt.Println(user) 51 | 52 | } 53 | -------------------------------------------------------------------------------- /model/response.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import "net/http" 4 | 5 | type Response struct { 6 | Data map[string]interface{} `json:"data"` 7 | Code int `json:"code"` 8 | Msg string `json:"msg"` 9 | } 10 | 11 | func NewResponse() *Response { 12 | res := new(Response) 13 | res.Code = http.StatusOK 14 | res.Data = make(map[string]interface{}) 15 | res.Msg = "" 16 | return res 17 | } 18 | 19 | func ErrorResponse(errno int, msg string) *Response { 20 | r := NewResponse() 21 | r.Code = errno 22 | r.SetErrorInfo(errno, msg) 23 | return r 24 | } 25 | 26 | func (s *Response) SetErrorInfo(errno int, msg string) { 27 | s.Code = errno 28 | s.Msg = msg 29 | //s.Data["msg"]=msg 30 | } 31 | func (s *Response) SetSuccessInfo(code int, msg string) { 32 | s.Code = code 33 | s.Msg = msg 34 | //s.Data["msg"]=msg 35 | } 36 | 37 | func (s *Response) SetResponseDataInfo(key string, value string) { 38 | s.Data[key] = value 39 | } 40 | 41 | func (s *Response) AddResponseInfo(key string, val interface{}) { 42 | s.Data[key] = val 43 | } 44 | -------------------------------------------------------------------------------- /model/user_role.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | const ( 4 | userRoleCollection = "user_role" 5 | ) 6 | 7 | type UserRole struct { 8 | UserId string 9 | RoleId string 10 | CreateUserId string 11 | CreateTime int64 //时间戳 12 | Role int //角色类型 (枚举表示) 13 | AppId string //所属应用 14 | ModifyUserId string 15 | } 16 | -------------------------------------------------------------------------------- /privatesources/private_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEA4w5xhil8YFSLptRxzQsiJgQm7DxfVx7nEFAndQDw/7a1VfIf 3 | hhzZlUYx6u+57kP4+JPhqLMl9hEPnJh2DMPV4wrQAOSe6pDK5UP/xZQx8ygy70lG 4 | fJ6MVo7mkXKaofKobOhkFIOhqtLU/6CrzFl+KdFIsD7pt+FxV6mMmPbnAvDN+hF5 5 | NwU6N61WGAZER8z7SSTgayGpuHdUKCdPwfuiUIEX3GxhskzV/ROiS+R/NbQZlsfm 6 | QqcBJ5FxhOtAVevi9s7x6LLTSQKopuuunSTTtu3ys/hs5m6AqNPPkLKqp6R8iXF1 7 | Lg0DMeQlFHYwEo3oRweMNhfYRzC3ukioSf+GuwIDAQABAoIBADlemeKLMujoE80Y 8 | WpSzXnJ6lBcWfgR2Q23EwuN2VG5YDONlZP+u5G8qKEyzO6hvNkYgn2DPuyS8VNR9 9 | VT6OcMmIHtxK57he01UwZDzY3/IPUydQvWWZbd4lBy7y5Q1MUbAK29avF7cgxD6+ 10 | qwncBtusDJCzpLwYU1oR9ftkTyRXl8WzHUQ+/QILNnSCDsTrP8JsVaVxbd6FhKKn 11 | 5sSyqM+dX7mtvVAOcj0OJSHZiit7fk5QG9Pi/5iP4pCdZf42sImsr++2GFOezfJd 12 | H5UU+ujTf+b4oGirnqgEDRrSr5IyykagWc07D2KJgyPzrkfFDxoB5C/ZC3C6C9AA 13 | Xwzd+GECgYEA5SPDfCMVBRFkYBoxKgbWEElquGiPMDSe+p6QSlX24UXFv8gzdtbT 14 | f33d27v2cpIOWYym3Er5JiSFq6oCr1cg9+mLP/tNc50sHrdHb8vRfn190nawFJHa 15 | eOe0b3ZePUtAxdd1HaZgq4bNnLYSbi//spdHuu6E1jZrzcmbvIm7PJECgYEA/awp 16 | rILMDvqHuGNlVr+kdcGfmFxA8y9Z1tZHLgqNjPQQlaOuyJn1cfYbIqghMLjk//Au 17 | VQ5gfKLc2abHQaVQ2dLqV846eNQvr+cnLQUrUqk41IZuN0HTMbvLHgOLkQNdsUMs 18 | 1TmmPeMxh9X9cLqp7mZoY5CeWeWFOe3EJA1dZIsCgYEAklbf3yUMpJrx7wprQbrx 19 | 9Z7dwH5OjGve6JJh9oemT0LfQ1dZvtj+ZBr/mPkXMR6keX6Bhol/S2Ph1ruSUWck 20 | 0A/gdfFKCr9jUQ6eWgDif5UnyUUxuUFZNQRN0S3Yi+7GpFOxIUmDzagfIqmJZcPT 21 | 2rwQ/IqeXayN9vR+ONABu3ECgYAECn4PdXXytyL6WPsASsU/6vmz36RZO2Pe/ELe 22 | BOUEXc7100mxgGJckmMURkFhGVDsktLqH/SBh8ak4PdDoHKNRcLd6zcbPaYU00XY 23 | fcCW7IMvP4T59F586FTwAXZztO4FKODJ9MUlLz1WwJ3s8cxLM+5tx5v+Kp3YsmTx 24 | fhUCyQKBgDCEkFexrqC2a1rHLh+pwTyvnE4JCVNt72FF8L51aEsG5tGGFvTvgUN6 25 | IlRCYASNhUK/3+hu337uOSolKXu0W+dFnp1/OLo6sUkuhxWGx3YLwGJygjSrOl5f 26 | 3wIikQ0U/RjRr+/pI0/yw/w3Xcr7iUjei6SBxkiIeZL/749EcLNB 27 | -----END RSA PRIVATE KEY----- -------------------------------------------------------------------------------- /privatesources/public_key.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4w5xhil8YFSLptRxzQsi 3 | JgQm7DxfVx7nEFAndQDw/7a1VfIfhhzZlUYx6u+57kP4+JPhqLMl9hEPnJh2DMPV 4 | 4wrQAOSe6pDK5UP/xZQx8ygy70lGfJ6MVo7mkXKaofKobOhkFIOhqtLU/6CrzFl+ 5 | KdFIsD7pt+FxV6mMmPbnAvDN+hF5NwU6N61WGAZER8z7SSTgayGpuHdUKCdPwfui 6 | UIEX3GxhskzV/ROiS+R/NbQZlsfmQqcBJ5FxhOtAVevi9s7x6LLTSQKopuuunSTT 7 | tu3ys/hs5m6AqNPPkLKqp6R8iXF1Lg0DMeQlFHYwEo3oRweMNhfYRzC3ukioSf+G 8 | uwIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /remote_auto_push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | info() { 4 | local green="\033[1;32m" 5 | local normal="\033[0m" 6 | echo -e "[${green}INFO${normal}] $1" 7 | } 8 | 9 | error() { 10 | local red="\033[1;31m" 11 | local normal="\033[0m" 12 | echo -e "[${red}ERROR${normal}] $1" 13 | } 14 | 15 | cur_date="`date +%Y-%m-%d-%H:%M:%S`" 16 | dif=$* 17 | if [ x"${dif}" = x ]; then 18 | error "请输入提交内容!" 19 | exit 1 20 | # dif=$cur_date 21 | else 22 | info "${dif}" 23 | fi 24 | 25 | git add . 26 | git commit -m "${dif}" 27 | git push 28 | -------------------------------------------------------------------------------- /server/handler/index.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "strings" 7 | "todo-go/common" 8 | "todo-go/model" 9 | 10 | "github.com/flywithbug/log4go" 11 | "github.com/gin-gonic/gin" 12 | ) 13 | 14 | var ( 15 | index = 0 16 | ) 17 | 18 | // 系统状态信息 19 | func IndexHandler(c *gin.Context) { 20 | aRes := model.NewResponse() 21 | defer func() { 22 | c.JSON(http.StatusOK, aRes) 23 | }() 24 | userId, _ := c.Get(common.KeyUserId) 25 | log4go.Info("index handler %s", userId) 26 | 27 | } 28 | 29 | func NoRoute(c *gin.Context) { 30 | path := strings.Split(c.Request.URL.Path, "/") 31 | fmt.Println(path) 32 | if (path[1] != "") && (path[1] == "api") { 33 | aRes := model.NewResponse() 34 | aRes.Code = http.StatusNotFound 35 | aRes.Msg = "no route" 36 | c.JSON(http.StatusNotFound, aRes) 37 | } else { 38 | c.HTML(http.StatusOK, "index.html", "") 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /server/handler/para_model.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | type parameterLoginModel struct { 4 | Account string `json:"account"` 5 | Password string `json:"password"` 6 | } 7 | 8 | type parameterTodoModel struct { 9 | Id int64 `json:"id""` 10 | Title string `json:"title"` 11 | Completed string `json:"completed"` 12 | } 13 | -------------------------------------------------------------------------------- /server/middleware/authentication.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "net/http" 5 | "todo-go/common" 6 | "todo-go/core/jwt" 7 | "todo-go/model" 8 | 9 | "github.com/gin-gonic/gin" 10 | ) 11 | 12 | //JWTAuthMiddleware 13 | func JWTAuthMiddleware() gin.HandlerFunc { 14 | return func(c *gin.Context) { 15 | aRes := model.NewResponse() 16 | token := c.GetHeader(common.KeyUserToken) 17 | if token == "" { 18 | aRes.SetErrorInfo(http.StatusUnauthorized, "请求未携带token,无权限访问") 19 | c.JSON(http.StatusUnauthorized, aRes) 20 | c.Abort() 21 | return 22 | } 23 | l, err := model.FindLoginByToken(token) 24 | if err != nil { 25 | aRes.SetErrorInfo(http.StatusUnauthorized, "未查询到Token,无权限访问") 26 | c.JSON(http.StatusUnauthorized, aRes) 27 | c.Abort() 28 | return 29 | } 30 | if l.Status != 1 { 31 | aRes.SetErrorInfo(http.StatusUnauthorized, "授权已失效") 32 | c.JSON(http.StatusUnauthorized, aRes) 33 | c.Abort() 34 | return 35 | } 36 | claims, err := jwt.ParseToken(token) 37 | if err != nil { 38 | model.UpdateLoginStatus(token, 0) 39 | if err == jwt.TokenExpired { 40 | aRes.SetErrorInfo(http.StatusUnauthorized, "授权已过期") 41 | c.JSON(http.StatusUnauthorized, aRes) 42 | c.Abort() 43 | return 44 | } 45 | aRes.SetErrorInfo(http.StatusUnauthorized, err.Error()) 46 | c.JSON(http.StatusUnauthorized, aRes) 47 | c.Abort() 48 | return 49 | } 50 | c.Set(common.KeyUserToken, token) 51 | c.Set(common.KeyUserId, claims.UserId) 52 | c.Set(common.KeyJWTClaims, claims) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /server/middleware/cookie.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | ) 6 | 7 | func CookieMiddleware() gin.HandlerFunc { 8 | return func(c *gin.Context) { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /server/server.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | "todo-go/server/handler" 7 | "todo-go/server/middleware" 8 | 9 | "github.com/gin-gonic/contrib/static" 10 | 11 | "github.com/gin-contrib/cors" 12 | "github.com/gin-gonic/gin" 13 | ) 14 | 15 | func StartServer(port, staticPath, rPrefix, authPrefix string) { 16 | r := gin.New() 17 | r.Use(middleware.Logger(), gin.Recovery()) 18 | r.Use(static.Serve("/", static.LocalFile(staticPath, true))) 19 | r.LoadHTMLGlob(staticPath + "/index.html") 20 | r.NoRoute(handler.NoRoute) 21 | cors.Default() 22 | r.Use(cors.New(cors.Config{ 23 | AllowAllOrigins: true, 24 | AllowMethods: []string{"GET", "PUT", "POST", "DELETE"}, 25 | AllowHeaders: []string{"Origin", "Authorization", "Content-Type", "Content-Length"}, 26 | ExposeHeaders: []string{}, 27 | MaxAge: 12 * time.Hour, 28 | AllowCredentials: false, 29 | })) 30 | r.Use(middleware.CookieMiddleware()) 31 | handler.RegisterRouters(r, rPrefix, authPrefix) 32 | err := r.Run(port) 33 | if err != nil { 34 | panic(fmt.Errorf("server启动失败 %s", err.Error())) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Dave Grijalva 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html 2 | // 3 | // See README.md for more info. 4 | package jwt 5 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | import ( 4 | "crypto/ecdsa" 5 | "crypto/x509" 6 | "encoding/pem" 7 | "errors" 8 | ) 9 | 10 | var ( 11 | ErrNotECPublicKey = errors.New("Key is not a valid ECDSA public key") 12 | ErrNotECPrivateKey = errors.New("Key is not a valid ECDSA private key") 13 | ) 14 | 15 | // Parse PEM encoded Elliptic Curve Private Key Structure 16 | func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) { 17 | var err error 18 | 19 | // Parse PEM block 20 | var block *pem.Block 21 | if block, _ = pem.Decode(key); block == nil { 22 | return nil, ErrKeyMustBePEMEncoded 23 | } 24 | 25 | // Parse the key 26 | var parsedKey interface{} 27 | if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil { 28 | return nil, err 29 | } 30 | 31 | var pkey *ecdsa.PrivateKey 32 | var ok bool 33 | if pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok { 34 | return nil, ErrNotECPrivateKey 35 | } 36 | 37 | return pkey, nil 38 | } 39 | 40 | // Parse PEM encoded PKCS1 or PKCS8 public key 41 | func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) { 42 | var err error 43 | 44 | // Parse PEM block 45 | var block *pem.Block 46 | if block, _ = pem.Decode(key); block == nil { 47 | return nil, ErrKeyMustBePEMEncoded 48 | } 49 | 50 | // Parse the key 51 | var parsedKey interface{} 52 | if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { 53 | if cert, err := x509.ParseCertificate(block.Bytes); err == nil { 54 | parsedKey = cert.PublicKey 55 | } else { 56 | return nil, err 57 | } 58 | } 59 | 60 | var pkey *ecdsa.PublicKey 61 | var ok bool 62 | if pkey, ok = parsedKey.(*ecdsa.PublicKey); !ok { 63 | return nil, ErrNotECPublicKey 64 | } 65 | 66 | return pkey, nil 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/none.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | // Implements the none signing method. This is required by the spec 4 | // but you probably should never use it. 5 | var SigningMethodNone *signingMethodNone 6 | 7 | const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed" 8 | 9 | var NoneSignatureTypeDisallowedError error 10 | 11 | type signingMethodNone struct{} 12 | type unsafeNoneMagicConstant string 13 | 14 | func init() { 15 | SigningMethodNone = &signingMethodNone{} 16 | NoneSignatureTypeDisallowedError = NewValidationError("'none' signature type is not allowed", ValidationErrorSignatureInvalid) 17 | 18 | RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod { 19 | return SigningMethodNone 20 | }) 21 | } 22 | 23 | func (m *signingMethodNone) Alg() string { 24 | return "none" 25 | } 26 | 27 | // Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key 28 | func (m *signingMethodNone) Verify(signingString, signature string, key interface{}) (err error) { 29 | // Key must be UnsafeAllowNoneSignatureType to prevent accidentally 30 | // accepting 'none' signing method 31 | if _, ok := key.(unsafeNoneMagicConstant); !ok { 32 | return NoneSignatureTypeDisallowedError 33 | } 34 | // If signing method is none, signature must be an empty string 35 | if signature != "" { 36 | return NewValidationError( 37 | "'none' signing method with non-empty signature", 38 | ValidationErrorSignatureInvalid, 39 | ) 40 | } 41 | 42 | // Accept 'none' signing method. 43 | return nil 44 | } 45 | 46 | // Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key 47 | func (m *signingMethodNone) Sign(signingString string, key interface{}) (string, error) { 48 | if _, ok := key.(unsafeNoneMagicConstant); ok { 49 | return "", nil 50 | } 51 | return "", NoneSignatureTypeDisallowedError 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/rsa_utils.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | import ( 4 | "crypto/rsa" 5 | "crypto/x509" 6 | "encoding/pem" 7 | "errors" 8 | ) 9 | 10 | var ( 11 | ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key") 12 | ErrNotRSAPrivateKey = errors.New("Key is not a valid RSA private key") 13 | ErrNotRSAPublicKey = errors.New("Key is not a valid RSA public key") 14 | ) 15 | 16 | // Parse PEM encoded PKCS1 or PKCS8 private key 17 | func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) { 18 | var err error 19 | 20 | // Parse PEM block 21 | var block *pem.Block 22 | if block, _ = pem.Decode(key); block == nil { 23 | return nil, ErrKeyMustBePEMEncoded 24 | } 25 | 26 | var parsedKey interface{} 27 | if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil { 28 | if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { 29 | return nil, err 30 | } 31 | } 32 | 33 | var pkey *rsa.PrivateKey 34 | var ok bool 35 | if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { 36 | return nil, ErrNotRSAPrivateKey 37 | } 38 | 39 | return pkey, nil 40 | } 41 | 42 | // Parse PEM encoded PKCS1 or PKCS8 public key 43 | func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) { 44 | var err error 45 | 46 | // Parse PEM block 47 | var block *pem.Block 48 | if block, _ = pem.Decode(key); block == nil { 49 | return nil, ErrKeyMustBePEMEncoded 50 | } 51 | 52 | // Parse the key 53 | var parsedKey interface{} 54 | if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { 55 | if cert, err := x509.ParseCertificate(block.Bytes); err == nil { 56 | parsedKey = cert.PublicKey 57 | } else { 58 | return nil, err 59 | } 60 | } 61 | 62 | var pkey *rsa.PublicKey 63 | var ok bool 64 | if pkey, ok = parsedKey.(*rsa.PublicKey); !ok { 65 | return nil, ErrNotRSAPublicKey 66 | } 67 | 68 | return pkey, nil 69 | } 70 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/signing_method.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | var signingMethods = map[string]func() SigningMethod{} 8 | var signingMethodLock = new(sync.RWMutex) 9 | 10 | // Implement SigningMethod to add new methods for signing or verifying tokens. 11 | type SigningMethod interface { 12 | Verify(signingString, signature string, key interface{}) error // Returns nil if signature is valid 13 | Sign(signingString string, key interface{}) (string, error) // Returns encoded signature or error 14 | Alg() string // returns the alg identifier for this method (example: 'HS256') 15 | } 16 | 17 | // Register the "alg" name and a factory function for signing method. 18 | // This is typically done during init() in the method's implementation 19 | func RegisterSigningMethod(alg string, f func() SigningMethod) { 20 | signingMethodLock.Lock() 21 | defer signingMethodLock.Unlock() 22 | 23 | signingMethods[alg] = f 24 | } 25 | 26 | // Get a signing method from an "alg" string 27 | func GetSigningMethod(alg string) (method SigningMethod) { 28 | signingMethodLock.RLock() 29 | defer signingMethodLock.RUnlock() 30 | 31 | if methodF, ok := signingMethods[alg]; ok { 32 | method = methodF() 33 | } 34 | return 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/flywithbug/log4go/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Nothing 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/flywithbug/log4go/README.md: -------------------------------------------------------------------------------- 1 | # log4go 2 | log4go 3 | 4 | ```go get github.com/flywithbug/log4go``` 5 | 6 | ``` 7 | func SetLog() { 8 | w := log.NewFileWriter() 9 | w.SetPathPattern("./log/log-%Y%M%D.log") 10 | c := log.NewConsoleWriter() 11 | c.SetColor(true) 12 | log.Register(w) 13 | log.Register(c) 14 | log.SetLevel(log.DEBUG) 15 | log.SetLayout("2006-01-02 15:04:05") 16 | } 17 | ``` 18 | 19 | ``` 20 | log4go.Warn(err.Error()) 21 | log4go.Info("info need log") 22 | 23 | ``` 24 | ![log4go](http://7xqjzu.com1.z0.glb.clouddn.com/1517409614395.jpg) 25 | 26 | -------------------------------------------------------------------------------- /vendor/github.com/flywithbug/log4go/config.go: -------------------------------------------------------------------------------- 1 | package log4go 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | "io/ioutil" 7 | "strings" 8 | ) 9 | 10 | type ConfFileWriter struct { 11 | LogPath string `json:"LogPath"` 12 | On bool `json:"On"` 13 | } 14 | 15 | type ConfConsoleWriter struct { 16 | On bool `json:"On"` 17 | Color bool `json:"Color"` 18 | } 19 | 20 | type LogConfig struct { 21 | Level string `json:"LogLevel"` 22 | FW ConfFileWriter `json:"FileWriter"` 23 | CW ConfConsoleWriter `json:"ConsoleWriter"` 24 | Layout string `json:"Layout"` 25 | } 26 | 27 | func SetupLogWithConf(file string) (err error) { 28 | var lc LogConfig 29 | 30 | cnt, err := ioutil.ReadFile(file) 31 | 32 | if err = json.Unmarshal(cnt, &lc); err != nil { 33 | return 34 | } 35 | 36 | if lc.FW.On { 37 | w := NewFileWriter() 38 | w.SetPathPattern(lc.FW.LogPath) 39 | Register(w) 40 | } 41 | 42 | if lc.CW.On { 43 | w := NewConsoleWriter() 44 | w.SetColor(lc.CW.Color) 45 | Register(w) 46 | } 47 | 48 | if len(lc.Layout) > 0 { 49 | SetLayout(lc.Layout) 50 | } 51 | 52 | switch strings.ToLower(lc.Level) { 53 | case "debug": 54 | SetLevel(DEBUG) 55 | 56 | case "info": 57 | SetLevel(INFO) 58 | 59 | case "infoo": 60 | SetLevel(INFOO) 61 | case "warning": 62 | SetLevel(WARNING) 63 | 64 | case "error": 65 | SetLevel(ERROR) 66 | 67 | case "fatal": 68 | SetLevel(FATAL) 69 | 70 | default: 71 | err = errors.New("Invalid log level") 72 | } 73 | return 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/flywithbug/log4go/log.json: -------------------------------------------------------------------------------- 1 | { 2 | "LogLevel" : "info", 3 | "Layout": "2006/01/02-15:04:05.999", 4 | "FileWriter" : { 5 | "LogPath" : "./log/log-%Y%M%D.log", 6 | "On": true 7 | 8 | }, 9 | 10 | "ConsoleWriter" : { 11 | "On" : true, 12 | "Color": true 13 | } 14 | } -------------------------------------------------------------------------------- /vendor/github.com/flywithbug/log4go/remote_auto_push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | info() { 4 | local green="\033[1;32m" 5 | local normal="\033[0m" 6 | echo -e "[${green}INFO${normal}] $1" 7 | } 8 | 9 | error() { 10 | local red="\033[1;31m" 11 | local normal="\033[0m" 12 | echo -e "[${red}ERROR${normal}] $1" 13 | } 14 | 15 | cur_date="`date +%Y-%m-%d-%H:%M:%S`" 16 | dif=$* 17 | if [ x"${dif}" = x ]; then 18 | error "请输入提交内容!" 19 | exit 1 20 | # dif=$cur_date 21 | else 22 | info "${dif}" 23 | fi 24 | 25 | git add . 26 | git commit -m "${dif}" 27 | git push 28 | -------------------------------------------------------------------------------- /vendor/github.com/gin-contrib/cors/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Gin-Gonic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-contrib/sse/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Martínez-Almeida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-contrib/sse/writer.go: -------------------------------------------------------------------------------- 1 | package sse 2 | 3 | import "io" 4 | 5 | type stringWriter interface { 6 | io.Writer 7 | WriteString(string) (int, error) 8 | } 9 | 10 | type stringWrapper struct { 11 | io.Writer 12 | } 13 | 14 | func (w stringWrapper) WriteString(str string) (int, error) { 15 | return w.Writer.Write([]byte(str)) 16 | } 17 | 18 | func checkWriter(writer io.Writer) stringWriter { 19 | if w, ok := writer.(stringWriter); ok { 20 | return w 21 | } else { 22 | return stringWrapper{writer} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/contrib/static/README.md: -------------------------------------------------------------------------------- 1 | # static 2 | 3 | ## EOL-warning 4 | 5 | **This package has been abandoned on 2016-12-13. Please use [gin-contrib/static](https://github.com/gin-contrib/static) instead.** 6 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/contrib/static/static.go: -------------------------------------------------------------------------------- 1 | package static 2 | 3 | import ( 4 | "net/http" 5 | "os" 6 | "path" 7 | "strings" 8 | 9 | "github.com/gin-gonic/gin" 10 | ) 11 | 12 | type ServeFileSystem interface { 13 | http.FileSystem 14 | Exists(prefix string, path string) bool 15 | } 16 | 17 | type localFileSystem struct { 18 | http.FileSystem 19 | root string 20 | indexes bool 21 | } 22 | 23 | func LocalFile(root string, indexes bool) *localFileSystem { 24 | return &localFileSystem{ 25 | FileSystem: gin.Dir(root, indexes), 26 | root: root, 27 | indexes: indexes, 28 | } 29 | } 30 | 31 | func (l *localFileSystem) Exists(prefix string, filepath string) bool { 32 | if p := strings.TrimPrefix(filepath, prefix); len(p) < len(filepath) { 33 | name := path.Join(l.root, p) 34 | stats, err := os.Stat(name) 35 | if err != nil { 36 | return false 37 | } 38 | if !l.indexes && stats.IsDir() { 39 | return false 40 | } 41 | return true 42 | } 43 | return false 44 | } 45 | 46 | func ServeRoot(urlPrefix, root string) gin.HandlerFunc { 47 | return Serve(urlPrefix, LocalFile(root, false)) 48 | } 49 | 50 | // Static returns a middleware handler that serves static files in the given directory. 51 | func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc { 52 | fileserver := http.FileServer(fs) 53 | if urlPrefix != "" { 54 | fileserver = http.StripPrefix(urlPrefix, fileserver) 55 | } 56 | return func(c *gin.Context) { 57 | if fs.Exists(urlPrefix, c.Request.URL.Path) { 58 | fileserver.ServeHTTP(c.Writer, c.Request) 59 | c.Abort() 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | - With issues: 4 | - Use the search tool before opening a new issue. 5 | - Please provide source code and commit sha if you found a bug. 6 | - Review existing issues and provide feedback or react to them. 7 | 8 | - With pull requests: 9 | - Open your pull request against `master` 10 | - Your pull request should have no more than two commits, if not you should squash them. 11 | - It should pass all tests in the available continuous integrations systems such as TravisCI. 12 | - You should add/modify tests to cover your proposed code changes. 13 | - If your pull request contains a new feature, please document it on the README. 14 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Martínez-Almeida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/default_validator.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "reflect" 9 | "sync" 10 | 11 | "gopkg.in/go-playground/validator.v8" 12 | ) 13 | 14 | type defaultValidator struct { 15 | once sync.Once 16 | validate *validator.Validate 17 | } 18 | 19 | var _ StructValidator = &defaultValidator{} 20 | 21 | // ValidateStruct receives any kind of type, but only performed struct or pointer to struct type. 22 | func (v *defaultValidator) ValidateStruct(obj interface{}) error { 23 | value := reflect.ValueOf(obj) 24 | valueType := value.Kind() 25 | if valueType == reflect.Ptr { 26 | valueType = value.Elem().Kind() 27 | } 28 | if valueType == reflect.Struct { 29 | v.lazyinit() 30 | if err := v.validate.Struct(obj); err != nil { 31 | return err 32 | } 33 | } 34 | return nil 35 | } 36 | 37 | // Engine returns the underlying validator engine which powers the default 38 | // Validator instance. This is useful if you want to register custom validations 39 | // or struct level validations. See validator GoDoc for more info - 40 | // https://godoc.org/gopkg.in/go-playground/validator.v8 41 | func (v *defaultValidator) Engine() interface{} { 42 | v.lazyinit() 43 | return v.validate 44 | } 45 | 46 | func (v *defaultValidator) lazyinit() { 47 | v.once.Do(func() { 48 | config := &validator.Config{TagName: "binding"} 49 | v.validate = validator.New(config) 50 | }) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/form.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | const defaultMemory = 32 * 1024 * 1024 10 | 11 | type formBinding struct{} 12 | type formPostBinding struct{} 13 | type formMultipartBinding struct{} 14 | 15 | func (formBinding) Name() string { 16 | return "form" 17 | } 18 | 19 | func (formBinding) Bind(req *http.Request, obj interface{}) error { 20 | if err := req.ParseForm(); err != nil { 21 | return err 22 | } 23 | req.ParseMultipartForm(defaultMemory) 24 | if err := mapForm(obj, req.Form); err != nil { 25 | return err 26 | } 27 | return validate(obj) 28 | } 29 | 30 | func (formPostBinding) Name() string { 31 | return "form-urlencoded" 32 | } 33 | 34 | func (formPostBinding) Bind(req *http.Request, obj interface{}) error { 35 | if err := req.ParseForm(); err != nil { 36 | return err 37 | } 38 | if err := mapForm(obj, req.PostForm); err != nil { 39 | return err 40 | } 41 | return validate(obj) 42 | } 43 | 44 | func (formMultipartBinding) Name() string { 45 | return "multipart/form-data" 46 | } 47 | 48 | func (formMultipartBinding) Bind(req *http.Request, obj interface{}) error { 49 | if err := req.ParseMultipartForm(defaultMemory); err != nil { 50 | return err 51 | } 52 | if err := mapForm(obj, req.MultipartForm.Value); err != nil { 53 | return err 54 | } 55 | return validate(obj) 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "fmt" 10 | "io" 11 | "net/http" 12 | 13 | "github.com/gin-gonic/gin/internal/json" 14 | ) 15 | 16 | // EnableDecoderUseNumber is used to call the UseNumber method on the JSON 17 | // Decoder instance. UseNumber causes the Decoder to unmarshal a number into an 18 | // interface{} as a Number instead of as a float64. 19 | var EnableDecoderUseNumber = false 20 | 21 | type jsonBinding struct{} 22 | 23 | func (jsonBinding) Name() string { 24 | return "json" 25 | } 26 | 27 | func (jsonBinding) Bind(req *http.Request, obj interface{}) error { 28 | if req == nil || req.Body == nil { 29 | return fmt.Errorf("invalid request") 30 | } 31 | return decodeJSON(req.Body, obj) 32 | } 33 | 34 | func (jsonBinding) BindBody(body []byte, obj interface{}) error { 35 | return decodeJSON(bytes.NewReader(body), obj) 36 | } 37 | 38 | func decodeJSON(r io.Reader, obj interface{}) error { 39 | decoder := json.NewDecoder(r) 40 | if EnableDecoderUseNumber { 41 | decoder.UseNumber() 42 | } 43 | if err := decoder.Decode(obj); err != nil { 44 | return err 45 | } 46 | return validate(obj) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | "net/http" 11 | 12 | "github.com/ugorji/go/codec" 13 | ) 14 | 15 | type msgpackBinding struct{} 16 | 17 | func (msgpackBinding) Name() string { 18 | return "msgpack" 19 | } 20 | 21 | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error { 22 | return decodeMsgPack(req.Body, obj) 23 | } 24 | 25 | func (msgpackBinding) BindBody(body []byte, obj interface{}) error { 26 | return decodeMsgPack(bytes.NewReader(body), obj) 27 | } 28 | 29 | func decodeMsgPack(r io.Reader, obj interface{}) error { 30 | cdc := new(codec.MsgpackHandle) 31 | if err := codec.NewDecoder(r, cdc).Decode(&obj); err != nil { 32 | return err 33 | } 34 | return validate(obj) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/protobuf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "io/ioutil" 9 | "net/http" 10 | 11 | "github.com/golang/protobuf/proto" 12 | ) 13 | 14 | type protobufBinding struct{} 15 | 16 | func (protobufBinding) Name() string { 17 | return "protobuf" 18 | } 19 | 20 | func (b protobufBinding) Bind(req *http.Request, obj interface{}) error { 21 | buf, err := ioutil.ReadAll(req.Body) 22 | if err != nil { 23 | return err 24 | } 25 | return b.BindBody(buf, obj) 26 | } 27 | 28 | func (protobufBinding) BindBody(body []byte, obj interface{}) error { 29 | if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil { 30 | return err 31 | } 32 | // Here it's same to return validate(obj), but util now we can't add 33 | // `binding:""` to the struct which automatically generate by gen-proto 34 | return nil 35 | // return validate(obj) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | type queryBinding struct{} 10 | 11 | func (queryBinding) Name() string { 12 | return "query" 13 | } 14 | 15 | func (queryBinding) Bind(req *http.Request, obj interface{}) error { 16 | values := req.URL.Query() 17 | if err := mapForm(obj, values); err != nil { 18 | return err 19 | } 20 | return validate(obj) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/uri.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | type uriBinding struct{} 8 | 9 | func (uriBinding) Name() string { 10 | return "uri" 11 | } 12 | 13 | func (uriBinding) BindUri(m map[string][]string, obj interface{}) error { 14 | if err := mapUri(obj, m); err != nil { 15 | return err 16 | } 17 | return validate(obj) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "encoding/xml" 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | type xmlBinding struct{} 15 | 16 | func (xmlBinding) Name() string { 17 | return "xml" 18 | } 19 | 20 | func (xmlBinding) Bind(req *http.Request, obj interface{}) error { 21 | return decodeXML(req.Body, obj) 22 | } 23 | 24 | func (xmlBinding) BindBody(body []byte, obj interface{}) error { 25 | return decodeXML(bytes.NewReader(body), obj) 26 | } 27 | func decodeXML(r io.Reader, obj interface{}) error { 28 | decoder := xml.NewDecoder(r) 29 | if err := decoder.Decode(obj); err != nil { 30 | return err 31 | } 32 | return validate(obj) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/yaml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | "net/http" 11 | 12 | "gopkg.in/yaml.v2" 13 | ) 14 | 15 | type yamlBinding struct{} 16 | 17 | func (yamlBinding) Name() string { 18 | return "yaml" 19 | } 20 | 21 | func (yamlBinding) Bind(req *http.Request, obj interface{}) error { 22 | return decodeYAML(req.Body, obj) 23 | } 24 | 25 | func (yamlBinding) BindBody(body []byte, obj interface{}) error { 26 | return decodeYAML(bytes.NewReader(body), obj) 27 | } 28 | 29 | func decodeYAML(r io.Reader, obj interface{}) error { 30 | decoder := yaml.NewDecoder(r) 31 | if err := decoder.Decode(obj); err != nil { 32 | return err 33 | } 34 | return validate(obj) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | notify: 3 | gitter: 4 | default: 5 | url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165 6 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/context_17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package gin 8 | 9 | import ( 10 | "time" 11 | 12 | "github.com/gin-gonic/gin/render" 13 | ) 14 | 15 | // PureJSON serializes the given struct as JSON into the response body. 16 | // PureJSON, unlike JSON, does not replace special html characters with their unicode entities. 17 | func (c *Context) PureJSON(code int, obj interface{}) { 18 | c.Render(code, render.PureJSON{Data: obj}) 19 | } 20 | 21 | /************************************/ 22 | /***** GOLANG.ORG/X/NET/CONTEXT *****/ 23 | /************************************/ 24 | 25 | // Deadline returns the time when work done on behalf of this context 26 | // should be canceled. Deadline returns ok==false when no deadline is 27 | // set. Successive calls to Deadline return the same results. 28 | func (c *Context) Deadline() (time.Time, bool) { 29 | return c.Request.Context().Deadline() 30 | } 31 | 32 | // Done returns a channel that's closed when work done on behalf of this 33 | // context should be canceled. Done may return nil if this context can 34 | // never be canceled. Successive calls to Done return the same value. 35 | func (c *Context) Done() <-chan struct{} { 36 | return c.Request.Context().Done() 37 | } 38 | 39 | // Err returns a non-nil error value after Done is closed, 40 | // successive calls to Err return the same error. 41 | // If Done is not yet closed, Err returns nil. 42 | // If Done is closed, Err returns a non-nil error explaining why: 43 | // Canceled if the context was canceled 44 | // or DeadlineExceeded if the context's deadline passed. 45 | func (c *Context) Err() error { 46 | return c.Request.Context().Err() 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/context_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | func init() { 10 | defaultAppEngine = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/context_pre17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package gin 8 | 9 | import ( 10 | "time" 11 | ) 12 | 13 | /************************************/ 14 | /***** GOLANG.ORG/X/NET/CONTEXT *****/ 15 | /************************************/ 16 | 17 | // Deadline returns the time when work done on behalf of this context 18 | // should be canceled. Deadline returns ok==false when no deadline is 19 | // set. Successive calls to Deadline return the same results. 20 | func (c *Context) Deadline() (deadline time.Time, ok bool) { 21 | return 22 | } 23 | 24 | // Done returns a channel that's closed when work done on behalf of this 25 | // context should be canceled. Done may return nil if this context can 26 | // never be canceled. Successive calls to Done return the same value. 27 | func (c *Context) Done() <-chan struct{} { 28 | return nil 29 | } 30 | 31 | // Err returns a non-nil error value after Done is closed, 32 | // successive calls to Err return the same error. 33 | // If Done is not yet closed, Err returns nil. 34 | // If Done is closed, Err returns a non-nil error explaining why: 35 | // Canceled if the context was canceled 36 | // or DeadlineExceeded if the context's deadline passed. 37 | func (c *Context) Err() error { 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/deprecated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "log" 9 | 10 | "github.com/gin-gonic/gin/binding" 11 | ) 12 | 13 | // BindWith binds the passed struct pointer using the specified binding engine. 14 | // See the binding package. 15 | func (c *Context) BindWith(obj interface{}, b binding.Binding) error { 16 | log.Println(`BindWith(\"interface{}, binding.Binding\") error is going to 17 | be deprecated, please check issue #662 and either use MustBindWith() if you 18 | want HTTP 400 to be automatically returned if any error occur, or use 19 | ShouldBindWith() if you need to manage the error.`) 20 | return c.MustBindWith(obj, b) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package gin implements a HTTP web framework called gin. 3 | 4 | See https://gin-gonic.github.io/gin/ for more information about gin. 5 | */ 6 | package gin // import "github.com/gin-gonic/gin" 7 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/fs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "net/http" 9 | "os" 10 | ) 11 | 12 | type onlyfilesFS struct { 13 | fs http.FileSystem 14 | } 15 | 16 | type neuteredReaddirFile struct { 17 | http.File 18 | } 19 | 20 | // Dir returns a http.Filesystem that can be used by http.FileServer(). It is used internally 21 | // in router.Static(). 22 | // if listDirectory == true, then it works the same as http.Dir() otherwise it returns 23 | // a filesystem that prevents http.FileServer() to list the directory files. 24 | func Dir(root string, listDirectory bool) http.FileSystem { 25 | fs := http.Dir(root) 26 | if listDirectory { 27 | return fs 28 | } 29 | return &onlyfilesFS{fs} 30 | } 31 | 32 | // Open conforms to http.Filesystem. 33 | func (fs onlyfilesFS) Open(name string) (http.File, error) { 34 | f, err := fs.fs.Open(name) 35 | if err != nil { 36 | return nil, err 37 | } 38 | return neuteredReaddirFile{f}, nil 39 | } 40 | 41 | // Readdir overrides the http.File default implementation. 42 | func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) { 43 | // this disables directory listing 44 | return nil, nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gin-gonic/gin 2 | 3 | require ( 4 | github.com/campoy/embedmd v0.0.0-20171205015432-c59ce00e0296 5 | github.com/client9/misspell v0.3.4 6 | github.com/davecgh/go-spew v1.1.1 // indirect 7 | github.com/dustin/go-broadcast v0.0.0-20171205050544-f664265f5a66 8 | github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 9 | github.com/gin-gonic/autotls v0.0.0-20180426091246-be87bd5ef97b 10 | github.com/golang/protobuf v1.2.0 11 | github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 12 | github.com/json-iterator/go v1.1.5 13 | github.com/manucorporat/stats v0.0.0-20180402194714-3ba42d56d227 14 | github.com/mattn/go-isatty v0.0.4 15 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 16 | github.com/modern-go/reflect2 v1.0.1 // indirect 17 | github.com/pmezard/go-difflib v1.0.0 // indirect 18 | github.com/stretchr/testify v1.2.2 19 | github.com/thinkerou/favicon v0.1.0 20 | github.com/ugorji/go v1.1.1 21 | golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e 22 | golang.org/x/lint v0.0.0-20181011164241-5906bd5c48cd 23 | golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1 24 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f 25 | golang.org/x/sys v0.0.0-20181011152604-fa43e7bc11ba // indirect 26 | google.golang.org/grpc v1.15.0 27 | gopkg.in/go-playground/assert.v1 v1.2.1 // indirect 28 | gopkg.in/go-playground/validator.v8 v8.18.2 29 | gopkg.in/yaml.v2 v2.2.1 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/internal/json/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !jsoniter 6 | 7 | package json 8 | 9 | import "encoding/json" 10 | 11 | var ( 12 | // Marshal is exported by gin/json package. 13 | Marshal = json.Marshal 14 | // MarshalIndent is exported by gin/json package. 15 | MarshalIndent = json.MarshalIndent 16 | // NewDecoder is exported by gin/json package. 17 | NewDecoder = json.NewDecoder 18 | // NewEncoder is exported by gin/json package. 19 | NewEncoder = json.NewEncoder 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/internal/json/jsoniter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build jsoniter 6 | 7 | package json 8 | 9 | import "github.com/json-iterator/go" 10 | 11 | var ( 12 | json = jsoniter.ConfigCompatibleWithStandardLibrary 13 | // Marshal is exported by gin/json package. 14 | Marshal = json.Marshal 15 | // MarshalIndent is exported by gin/json package. 16 | MarshalIndent = json.MarshalIndent 17 | // NewDecoder is exported by gin/json package. 18 | NewDecoder = json.NewDecoder 19 | // NewEncoder is exported by gin/json package. 20 | NewEncoder = json.NewEncoder 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/data.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | // Data contains ContentType and bytes data. 10 | type Data struct { 11 | ContentType string 12 | Data []byte 13 | } 14 | 15 | // Render (Data) writes data with custom ContentType. 16 | func (r Data) Render(w http.ResponseWriter) (err error) { 17 | r.WriteContentType(w) 18 | _, err = w.Write(r.Data) 19 | return 20 | } 21 | 22 | // WriteContentType (Data) writes custom ContentType. 23 | func (r Data) WriteContentType(w http.ResponseWriter) { 24 | writeContentType(w, []string{r.ContentType}) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/json_17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package render 8 | 9 | import ( 10 | "net/http" 11 | 12 | "github.com/gin-gonic/gin/internal/json" 13 | ) 14 | 15 | // PureJSON contains the given interface object. 16 | type PureJSON struct { 17 | Data interface{} 18 | } 19 | 20 | // Render (PureJSON) writes custom ContentType and encodes the given interface object. 21 | func (r PureJSON) Render(w http.ResponseWriter) error { 22 | r.WriteContentType(w) 23 | encoder := json.NewEncoder(w) 24 | encoder.SetEscapeHTML(false) 25 | return encoder.Encode(r.Data) 26 | } 27 | 28 | // WriteContentType (PureJSON) writes custom ContentType. 29 | func (r PureJSON) WriteContentType(w http.ResponseWriter) { 30 | writeContentType(w, jsonContentType) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "github.com/ugorji/go/codec" 11 | ) 12 | 13 | // MsgPack contains the given interface object. 14 | type MsgPack struct { 15 | Data interface{} 16 | } 17 | 18 | var msgpackContentType = []string{"application/msgpack; charset=utf-8"} 19 | 20 | // WriteContentType (MsgPack) writes MsgPack ContentType. 21 | func (r MsgPack) WriteContentType(w http.ResponseWriter) { 22 | writeContentType(w, msgpackContentType) 23 | } 24 | 25 | // Render (MsgPack) encodes the given interface object and writes data with custom ContentType. 26 | func (r MsgPack) Render(w http.ResponseWriter) error { 27 | return WriteMsgPack(w, r.Data) 28 | } 29 | 30 | // WriteMsgPack writes MsgPack ContentType and encodes the given interface object. 31 | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error { 32 | writeContentType(w, msgpackContentType) 33 | var mh codec.MsgpackHandle 34 | return codec.NewEncoder(w, &mh).Encode(obj) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/protobuf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "github.com/golang/protobuf/proto" 11 | ) 12 | 13 | // ProtoBuf contains the given interface object. 14 | type ProtoBuf struct { 15 | Data interface{} 16 | } 17 | 18 | var protobufContentType = []string{"application/x-protobuf"} 19 | 20 | // Render (ProtoBuf) marshals the given interface object and writes data with custom ContentType. 21 | func (r ProtoBuf) Render(w http.ResponseWriter) error { 22 | r.WriteContentType(w) 23 | 24 | bytes, err := proto.Marshal(r.Data.(proto.Message)) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | w.Write(bytes) 30 | return nil 31 | } 32 | 33 | // WriteContentType (ProtoBuf) writes ProtoBuf ContentType. 34 | func (r ProtoBuf) WriteContentType(w http.ResponseWriter) { 35 | writeContentType(w, protobufContentType) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/reader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "io" 9 | "net/http" 10 | "strconv" 11 | ) 12 | 13 | // Reader contains the IO reader and its length, and custom ContentType and other headers. 14 | type Reader struct { 15 | ContentType string 16 | ContentLength int64 17 | Reader io.Reader 18 | Headers map[string]string 19 | } 20 | 21 | // Render (Reader) writes data with custom ContentType and headers. 22 | func (r Reader) Render(w http.ResponseWriter) (err error) { 23 | r.WriteContentType(w) 24 | r.Headers["Content-Length"] = strconv.FormatInt(r.ContentLength, 10) 25 | r.writeHeaders(w, r.Headers) 26 | _, err = io.Copy(w, r.Reader) 27 | return 28 | } 29 | 30 | // WriteContentType (Reader) writes custom ContentType. 31 | func (r Reader) WriteContentType(w http.ResponseWriter) { 32 | writeContentType(w, []string{r.ContentType}) 33 | } 34 | 35 | // writeHeaders writes custom Header. 36 | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string]string) { 37 | header := w.Header() 38 | for k, v := range headers { 39 | if val := header[k]; len(val) == 0 { 40 | header[k] = []string{v} 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/redirect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | ) 11 | 12 | // Redirect contains the http request reference and redirects status code and location. 13 | type Redirect struct { 14 | Code int 15 | Request *http.Request 16 | Location string 17 | } 18 | 19 | // Render (Redirect) redirects the http request to new location and writes redirect response. 20 | func (r Redirect) Render(w http.ResponseWriter) error { 21 | // todo(thinkerou): go1.6 not support StatusPermanentRedirect(308) 22 | // when we upgrade go version we can use http.StatusPermanentRedirect 23 | if (r.Code < 300 || r.Code > 308) && r.Code != 201 { 24 | panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code)) 25 | } 26 | http.Redirect(w, r.Request, r.Location, r.Code) 27 | return nil 28 | } 29 | 30 | // WriteContentType (Redirect) don't write any ContentType. 31 | func (r Redirect) WriteContentType(http.ResponseWriter) {} 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | // Render interface is to be implemented by JSON, XML, HTML, YAML and so on. 10 | type Render interface { 11 | // Render writes data with custom ContentType. 12 | Render(http.ResponseWriter) error 13 | // WriteContentType writes custom ContentType. 14 | WriteContentType(w http.ResponseWriter) 15 | } 16 | 17 | var ( 18 | _ Render = JSON{} 19 | _ Render = IndentedJSON{} 20 | _ Render = SecureJSON{} 21 | _ Render = JsonpJSON{} 22 | _ Render = XML{} 23 | _ Render = String{} 24 | _ Render = Redirect{} 25 | _ Render = Data{} 26 | _ Render = HTML{} 27 | _ HTMLRender = HTMLDebug{} 28 | _ HTMLRender = HTMLProduction{} 29 | _ Render = YAML{} 30 | _ Render = MsgPack{} 31 | _ Render = Reader{} 32 | _ Render = AsciiJSON{} 33 | _ Render = ProtoBuf{} 34 | ) 35 | 36 | func writeContentType(w http.ResponseWriter, value []string) { 37 | header := w.Header() 38 | if val := header["Content-Type"]; len(val) == 0 { 39 | header["Content-Type"] = value 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | "net/http" 11 | ) 12 | 13 | // String contains the given interface object slice and its format. 14 | type String struct { 15 | Format string 16 | Data []interface{} 17 | } 18 | 19 | var plainContentType = []string{"text/plain; charset=utf-8"} 20 | 21 | // Render (String) writes data with custom ContentType. 22 | func (r String) Render(w http.ResponseWriter) error { 23 | WriteString(w, r.Format, r.Data) 24 | return nil 25 | } 26 | 27 | // WriteContentType (String) writes Plain ContentType. 28 | func (r String) WriteContentType(w http.ResponseWriter) { 29 | writeContentType(w, plainContentType) 30 | } 31 | 32 | // WriteString writes data according to its format and write custom ContentType. 33 | func WriteString(w http.ResponseWriter, format string, data []interface{}) { 34 | writeContentType(w, plainContentType) 35 | if len(data) > 0 { 36 | fmt.Fprintf(w, format, data...) 37 | return 38 | } 39 | io.WriteString(w, format) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | // XML contains the given interface object. 13 | type XML struct { 14 | Data interface{} 15 | } 16 | 17 | var xmlContentType = []string{"application/xml; charset=utf-8"} 18 | 19 | // Render (XML) encodes the given interface object and writes data with custom ContentType. 20 | func (r XML) Render(w http.ResponseWriter) error { 21 | r.WriteContentType(w) 22 | return xml.NewEncoder(w).Encode(r.Data) 23 | } 24 | 25 | // WriteContentType (XML) writes XML ContentType for response. 26 | func (r XML) WriteContentType(w http.ResponseWriter) { 27 | writeContentType(w, xmlContentType) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/yaml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "gopkg.in/yaml.v2" 11 | ) 12 | 13 | // YAML contains the given interface object. 14 | type YAML struct { 15 | Data interface{} 16 | } 17 | 18 | var yamlContentType = []string{"application/x-yaml; charset=utf-8"} 19 | 20 | // Render (YAML) marshals the given interface object and writes data with custom ContentType. 21 | func (r YAML) Render(w http.ResponseWriter) error { 22 | r.WriteContentType(w) 23 | 24 | bytes, err := yaml.Marshal(r.Data) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | w.Write(bytes) 30 | return nil 31 | } 32 | 33 | // WriteContentType (YAML) writes YAML ContentType for response. 34 | func (r YAML) WriteContentType(w http.ResponseWriter) { 35 | writeContentType(w, yamlContentType) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/response_writer_1.7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | // Copyright 2018 Gin Core Team. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | // ResponseWriter ... 10 | type ResponseWriter interface { 11 | responseWriterBase 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/response_writer_1.8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | // Copyright 2018 Gin Core Team. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | // ResponseWriter ... 14 | type ResponseWriter interface { 15 | responseWriterBase 16 | // get the http.Pusher for server push 17 | Pusher() http.Pusher 18 | } 19 | 20 | func (w *responseWriter) Pusher() (pusher http.Pusher) { 21 | if pusher, ok := w.ResponseWriter.(http.Pusher); ok { 22 | return pusher 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import "net/http" 8 | 9 | // CreateTestContext returns a fresh engine and context for testing purposes 10 | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) { 11 | r = New() 12 | c = r.allocateContext() 13 | c.reset() 14 | c.writermem.reset(w) 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/tools.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build tools 6 | 7 | // This file exists to cause `go mod` and `go get` to believe these tools 8 | // are dependencies, even though they are not runtime dependencies of any 9 | // gin package. This means they will appear in `go.mod` file, but will not 10 | // be a part of the build. 11 | 12 | package gin 13 | 14 | import ( 15 | _ "github.com/campoy/embedmd" 16 | _ "github.com/client9/misspell/cmd/misspell" 17 | _ "github.com/dustin/go-broadcast" 18 | _ "github.com/gin-gonic/autotls" 19 | _ "github.com/jessevdk/go-assets" 20 | _ "github.com/manucorporat/stats" 21 | _ "github.com/thinkerou/favicon" 22 | _ "golang.org/x/crypto/acme/autocert" 23 | _ "golang.org/x/lint/golint" 24 | _ "google.golang.org/grpc" 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gin Core Team. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | // Version is the current gin framework's version. 8 | const Version = "v1.4.0-dev" 9 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | 20 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 21 | // terminal. This is also always false on this environment. 22 | func IsCygwinTerminal(fd uintptr) bool { 23 | return false 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine,!ppc64,!ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | 20 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 21 | // terminal. This is also always false on this environment. 22 | func IsCygwinTerminal(fd uintptr) bool { 23 | return false 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build ppc64 ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "unsafe" 8 | 9 | syscall "golang.org/x/sys/unix" 10 | ) 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var termios syscall.Termios 17 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 18 | return err == 0 19 | } 20 | 21 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 22 | // terminal. This is also always false on this environment. 23 | func IsCygwinTerminal(fd uintptr) bool { 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build appengine js 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on js and appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | 18 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 | // terminal. This is also always false on this environment. 20 | func IsCygwinTerminal(fd uintptr) bool { 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2016 by Maxim Bublis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2015 Ugorji Nwoke. 4 | All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/codecgen.go: -------------------------------------------------------------------------------- 1 | // +build codecgen generated 2 | 3 | package codec 4 | 5 | // this file is here, to set the codecgen variable to true 6 | // when the build tag codecgen is set. 7 | // 8 | // this allows us do specific things e.g. skip missing fields tests, 9 | // when running in codecgen mode. 10 | 11 | func init() { 12 | codecgen = true 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/fast-path.not.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build notfastpath 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const fastpathEnabled = false 11 | 12 | // The generated fast-path code is very large, and adds a few seconds to the build time. 13 | // This causes test execution, execution of small tools which use codec, etc 14 | // to take a long time. 15 | // 16 | // To mitigate, we now support the notfastpath tag. 17 | // This tag disables fastpath during build, allowing for faster build, test execution, 18 | // short-program runs, etc. 19 | 20 | func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false } 21 | func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false } 22 | func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false } 23 | func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false } 24 | func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false } 25 | 26 | type fastpathT struct{} 27 | type fastpathE struct { 28 | rtid uintptr 29 | rt reflect.Type 30 | encfn func(*Encoder, *codecFnInfo, reflect.Value) 31 | decfn func(*Decoder, *codecFnInfo, reflect.Value) 32 | } 33 | type fastpathA [0]fastpathE 34 | 35 | func (x fastpathA) index(rtid uintptr) int { return -1 } 36 | 37 | func (_ fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) { 38 | fn := d.h.fn(uint8SliceTyp, true, true) 39 | d.kSlice(&fn.i, reflect.ValueOf(&v).Elem()) 40 | return v, true 41 | } 42 | 43 | var fastpathAV fastpathA 44 | var fastpathTV fastpathT 45 | 46 | // ---- 47 | type TestMammoth2Wrapper struct{} // to allow testMammoth work in notfastpath mode 48 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Label}}: 2 | switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { 3 | case timeout{{.Sfx}} == 0: // only consume available 4 | for { 5 | select { 6 | case b{{.Sfx}} := <-{{.Chan}}: 7 | {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) 8 | default: 9 | break {{.Label}} 10 | } 11 | } 12 | case timeout{{.Sfx}} > 0: // consume until timeout 13 | tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) 14 | for { 15 | select { 16 | case b{{.Sfx}} := <-{{.Chan}}: 17 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) 18 | case <-tt{{.Sfx}}.C: 19 | // close(tt.C) 20 | break {{.Label}} 21 | } 22 | } 23 | default: // consume until close 24 | for b{{.Sfx}} := range {{.Chan}} { 25 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ugorji/go/codec 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | return reflect.ArrayOf(count, elem) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | panic("codec: reflect.ArrayOf unsupported in this go version") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | if size < 0 { 12 | return reflect.MakeMapWithSize(t, 4) 13 | } 14 | return reflect.MakeMapWithSize(t, size) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | return reflect.MakeMap(t) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = false 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.4 5 | 6 | package codec 7 | 8 | // This codec package will only work for go1.4 and above. 9 | // This is for the following reasons: 10 | // - go 1.4 was released in 2014 11 | // - go runtime is written fully in go 12 | // - interface only holds pointers 13 | // - reflect.Value is stabilized as 3 words 14 | 15 | func init() { 16 | panic("codec: go 1.3 and below are not supported") 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6,!go1.7 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | const genCheckVendor = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | var genCheckVendor = false 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 14 | // instead of the glibc-specific "CALL 0x10(GS)". 15 | #define INVOKE_SYSCALL INT $0x80 16 | 17 | // Just jump to package syscall's implementation for all these functions. 18 | // The runtime may know about them. 19 | 20 | TEXT ·Syscall(SB),NOSPLIT,$0-28 21 | JMP syscall·Syscall(SB) 22 | 23 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·Syscall6(SB) 25 | 26 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 27 | CALL runtime·entersyscall(SB) 28 | MOVL trap+0(FP), AX // syscall entry 29 | MOVL a1+4(FP), BX 30 | MOVL a2+8(FP), CX 31 | MOVL a3+12(FP), DX 32 | MOVL $0, SI 33 | MOVL $0, DI 34 | INVOKE_SYSCALL 35 | MOVL AX, r1+16(FP) 36 | MOVL DX, r2+20(FP) 37 | CALL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVL trap+0(FP), AX // syscall entry 48 | MOVL a1+4(FP), BX 49 | MOVL a2+8(FP), CX 50 | MOVL a3+12(FP), DX 51 | MOVL $0, SI 52 | MOVL $0, DI 53 | INVOKE_SYSCALL 54 | MOVL AX, r1+16(FP) 55 | MOVL DX, r2+20(FP) 56 | RET 57 | 58 | TEXT ·socketcall(SB),NOSPLIT,$0-36 59 | JMP syscall·socketcall(SB) 60 | 61 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 62 | JMP syscall·rawsocketcall(SB) 63 | 64 | TEXT ·seek(SB),NOSPLIT,$0-28 65 | JMP syscall·seek(SB) 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | JAL runtime·entersyscall(SB) 26 | MOVV a1+8(FP), R4 27 | MOVV a2+16(FP), R5 28 | MOVV a3+24(FP), R6 29 | MOVV R0, R7 30 | MOVV R0, R8 31 | MOVV R0, R9 32 | MOVV trap+0(FP), R2 // syscall entry 33 | SYSCALL 34 | MOVV R2, r1+32(FP) 35 | MOVV R3, r2+40(FP) 36 | JAL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | JMP syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | JMP syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVV a1+8(FP), R4 47 | MOVV a2+16(FP), R5 48 | MOVV a3+24(FP), R6 49 | MOVV R0, R7 50 | MOVV R0, R8 51 | MOVV R0, R9 52 | MOVV trap+0(FP), R2 // syscall entry 53 | SYSCALL 54 | MOVV R2, r1+32(FP) 55 | MOVV R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 28 | JAL runtime·entersyscall(SB) 29 | MOVW a1+4(FP), R4 30 | MOVW a2+8(FP), R5 31 | MOVW a3+12(FP), R6 32 | MOVW R0, R7 33 | MOVW trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVW R2, r1+16(FP) // r1 36 | MOVW R3, r2+20(FP) // r2 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVW a1+4(FP), R4 48 | MOVW a2+8(FP), R5 49 | MOVW a3+12(FP), R6 50 | MOVW trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVW R2, r1+16(FP) 53 | MOVW R3, r2+20(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R3 27 | MOVD a2+16(FP), R4 28 | MOVD a3+24(FP), R5 29 | MOVD R0, R6 30 | MOVD R0, R7 31 | MOVD R0, R8 32 | MOVD trap+0(FP), R9 // syscall entry 33 | SYSCALL R9 34 | MOVD R3, r1+32(FP) 35 | MOVD R4, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R3 47 | MOVD a2+16(FP), R4 48 | MOVD a3+24(FP), R5 49 | MOVD R0, R6 50 | MOVD R0, R7 51 | MOVD R0, R8 52 | MOVD trap+0(FP), R9 // syscall entry 53 | SYSCALL R9 54 | MOVD R3, r1+32(FP) 55 | MOVD R4, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R2 27 | MOVD a2+16(FP), R3 28 | MOVD a3+24(FP), R4 29 | MOVD $0, R5 30 | MOVD $0, R6 31 | MOVD $0, R7 32 | MOVD trap+0(FP), R1 // syscall entry 33 | SYSCALL 34 | MOVD R2, r1+32(FP) 35 | MOVD R3, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R2 47 | MOVD a2+16(FP), R3 48 | MOVD a3+24(FP), R4 49 | MOVD $0, R5 50 | MOVD $0, R6 51 | MOVD $0, R7 52 | MOVD trap+0(FP), R1 // syscall entry 53 | SYSCALL 54 | MOVD R2, r1+32(FP) 55 | MOVD R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 16 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 17 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 18 | if errno == 0 { 19 | return nil 20 | } 21 | return errno 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | uintptr_t 35 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 36 | { 37 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 38 | } 39 | 40 | // Define the use function in C so that it is not inlined. 41 | 42 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 43 | 44 | void 45 | use(void *p __attribute__ ((unused))) 46 | { 47 | } 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '13' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: int32(usec)} 20 | } 21 | 22 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 23 | func Gettimeofday(tv *Timeval) (err error) { 24 | // The tv passed to gettimeofday must be non-nil 25 | // but is otherwise unused. The answers come back 26 | // in the two registers. 27 | sec, usec, err := gettimeofday(tv) 28 | tv.Sec = sec 29 | tv.Usec = usec 30 | return err 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint64(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint64(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var length = uint64(count) 53 | 54 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 55 | 56 | written = int(length) 57 | 58 | if e1 != 0 { 59 | err = e1 60 | } 61 | return 62 | } 63 | 64 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 65 | 66 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 67 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl. 68 | const SYS___SYSCTL = SYS_SYSCTL 69 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build gccgo 7 | // +build 386 arm 8 | 9 | package unix 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) { 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err = Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracearm_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build arm arm64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsArm is the registers used by arm binaries. 11 | type PtraceRegsArm struct { 12 | Uregs [18]uint32 13 | } 14 | 15 | // PtraceGetRegsArm fetches the registers used by arm binaries. 16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 18 | } 19 | 20 | // PtraceSetRegsArm sets the registers used by arm binaries. 21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 23 | } 24 | 25 | // PtraceRegsArm64 is the registers used by arm64 binaries. 26 | type PtraceRegsArm64 struct { 27 | Regs [31]uint64 28 | Sp uint64 29 | Pc uint64 30 | Pstate uint64 31 | } 32 | 33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 36 | } 37 | 38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracemips_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build mips mips64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsMips is the registers used by mips binaries. 11 | type PtraceRegsMips struct { 12 | Regs [32]uint64 13 | Lo uint64 14 | Hi uint64 15 | Epc uint64 16 | Badvaddr uint64 17 | Status uint64 18 | Cause uint64 19 | } 20 | 21 | // PtraceGetRegsMips fetches the registers used by mips binaries. 22 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 24 | } 25 | 26 | // PtraceSetRegsMips sets the registers used by mips binaries. 27 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 29 | } 30 | 31 | // PtraceRegsMips64 is the registers used by mips64 binaries. 32 | type PtraceRegsMips64 struct { 33 | Regs [32]uint64 34 | Lo uint64 35 | Hi uint64 36 | Epc uint64 37 | Badvaddr uint64 38 | Status uint64 39 | Cause uint64 40 | } 41 | 42 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 43 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 45 | } 46 | 47 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 48 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracemipsle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build mipsle mips64le 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsMipsle is the registers used by mipsle binaries. 11 | type PtraceRegsMipsle struct { 12 | Regs [32]uint64 13 | Lo uint64 14 | Hi uint64 15 | Epc uint64 16 | Badvaddr uint64 17 | Status uint64 18 | Cause uint64 19 | } 20 | 21 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 22 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 24 | } 25 | 26 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 27 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 29 | } 30 | 31 | // PtraceRegsMips64le is the registers used by mips64le binaries. 32 | type PtraceRegsMips64le struct { 33 | Regs [32]uint64 34 | Lo uint64 35 | Hi uint64 36 | Epc uint64 37 | Badvaddr uint64 38 | Status uint64 39 | Cause uint64 40 | } 41 | 42 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 43 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 45 | } 46 | 47 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 48 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/gopkg.in/go-playground/validator.v8/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dean Karn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/go-playground/validator.v8/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/vendor/gopkg.in/go-playground/validator.v8/logo.png -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## [2.0.0] - 2015-09-02 6 | 7 | - Mailer has been removed. It has been replaced by Dialer and Sender. 8 | - `File` type and the `CreateFile` and `OpenFile` functions have been removed. 9 | - `Message.Attach` and `Message.Embed` have a new signature. 10 | - `Message.GetBodyWriter` has been removed. Use `Message.AddAlternativeWriter` 11 | instead. 12 | - `Message.Export` has been removed. `Message.WriteTo` can be used instead. 13 | - `Message.DelHeader` has been removed. 14 | - The `Bcc` header field is no longer sent. It is far more simpler and 15 | efficient: the same message is sent to all recipients instead of sending a 16 | different email to each Bcc address. 17 | - LoginAuth has been removed. `NewPlainDialer` now implements the LOGIN 18 | authentication mechanism when needed. 19 | - Go 1.2 is now required instead of Go 1.3. No external dependency are used when 20 | using Go 1.5. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Thank you for contributing to Gomail! Here are a few guidelines: 2 | 3 | ## Bugs 4 | 5 | If you think you found a bug, create an issue and supply the minimum amount 6 | of code triggering the bug so it can be reproduced. 7 | 8 | 9 | ## Fixing a bug 10 | 11 | If you want to fix a bug, you can send a pull request. It should contains a 12 | new test or update an existing one to cover that bug. 13 | 14 | 15 | ## New feature proposal 16 | 17 | If you think Gomail lacks a feature, you can open an issue or send a pull 18 | request. I want to keep Gomail code and API as simple as possible so please 19 | describe your needs so we can discuss whether this feature should be added to 20 | Gomail or not. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alexandre Cesaro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/auth.go: -------------------------------------------------------------------------------- 1 | package gomail 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "fmt" 7 | "net/smtp" 8 | ) 9 | 10 | // loginAuth is an smtp.Auth that implements the LOGIN authentication mechanism. 11 | type loginAuth struct { 12 | username string 13 | password string 14 | host string 15 | } 16 | 17 | func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) { 18 | if !server.TLS { 19 | advertised := false 20 | for _, mechanism := range server.Auth { 21 | if mechanism == "LOGIN" { 22 | advertised = true 23 | break 24 | } 25 | } 26 | if !advertised { 27 | return "", nil, errors.New("gomail: unencrypted connection") 28 | } 29 | } 30 | if server.Name != a.host { 31 | return "", nil, errors.New("gomail: wrong host name") 32 | } 33 | return "LOGIN", nil, nil 34 | } 35 | 36 | func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) { 37 | if !more { 38 | return nil, nil 39 | } 40 | 41 | switch { 42 | case bytes.Equal(fromServer, []byte("Username:")): 43 | return []byte(a.username), nil 44 | case bytes.Equal(fromServer, []byte("Password:")): 45 | return []byte(a.password), nil 46 | default: 47 | return nil, fmt.Errorf("gomail: unexpected server challenge: %s", fromServer) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package gomail provides a simple interface to compose emails and to mail them 2 | // efficiently. 3 | // 4 | // More info on Github: https://github.com/go-gomail/gomail 5 | package gomail 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/mime.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package gomail 4 | 5 | import ( 6 | "mime" 7 | "mime/quotedprintable" 8 | "strings" 9 | ) 10 | 11 | var newQPWriter = quotedprintable.NewWriter 12 | 13 | type mimeEncoder struct { 14 | mime.WordEncoder 15 | } 16 | 17 | var ( 18 | bEncoding = mimeEncoder{mime.BEncoding} 19 | qEncoding = mimeEncoder{mime.QEncoding} 20 | lastIndexByte = strings.LastIndexByte 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/mime_go14.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package gomail 4 | 5 | import "gopkg.in/alexcesaro/quotedprintable.v3" 6 | 7 | var newQPWriter = quotedprintable.NewWriter 8 | 9 | type mimeEncoder struct { 10 | quotedprintable.WordEncoder 11 | } 12 | 13 | var ( 14 | bEncoding = mimeEncoder{quotedprintable.BEncoding} 15 | qEncoding = mimeEncoder{quotedprintable.QEncoding} 16 | lastIndexByte = func(s string, c byte) int { 17 | for i := len(s) - 1; i >= 0; i-- { 18 | 19 | if s[i] == c { 20 | return i 21 | } 22 | } 23 | return -1 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/LICENSE: -------------------------------------------------------------------------------- 1 | mgo - MongoDB driver for Go 2 | 3 | Copyright (c) 2010-2013 - Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/Makefile: -------------------------------------------------------------------------------- 1 | startdb: 2 | @harness/setup.sh start 3 | 4 | stopdb: 5 | @harness/setup.sh stop 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/README.md: -------------------------------------------------------------------------------- 1 | The MongoDB driver for Go 2 | ------------------------- 3 | 4 | Please go to [http://labix.org/mgo](http://labix.org/mgo) for all project details. 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/bson/LICENSE: -------------------------------------------------------------------------------- 1 | BSON library for Go 2 | 3 | Copyright (c) 2010-2012 - Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package mgo offers a rich MongoDB driver for Go. 2 | // 3 | // Details about the mgo project (pronounced as "mango") are found 4 | // in its web page: 5 | // 6 | // http://labix.org/mgo 7 | // 8 | // Usage of the driver revolves around the concept of sessions. To 9 | // get started, obtain a session using the Dial function: 10 | // 11 | // session, err := mgo.Dial(url) 12 | // 13 | // This will establish one or more connections with the cluster of 14 | // servers defined by the url parameter. From then on, the cluster 15 | // may be queried with multiple consistency rules (see SetMode) and 16 | // documents retrieved with statements such as: 17 | // 18 | // c := session.DB(database).C(collection) 19 | // err := c.Find(query).One(&result) 20 | // 21 | // New sessions are typically created by calling session.Copy on the 22 | // initial session obtained at dial time. These new sessions will share 23 | // the same cluster information and connection pool, and may be easily 24 | // handed into other methods and functions for organizing logic. 25 | // Every session created must have its Close method called at the end 26 | // of its life time, so its resources may be put back in the pool or 27 | // collected, depending on the case. 28 | // 29 | // For more details, see the documentation for the types and methods. 30 | // 31 | package mgo 32 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/json/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/json/tags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package json 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // tagOptions is the string following a comma in a struct field's "json" 12 | // tag, or the empty string. It does not include the leading comma. 13 | type tagOptions string 14 | 15 | // parseTag splits a struct field's json tag into its name and 16 | // comma-separated options. 17 | func parseTag(tag string) (string, tagOptions) { 18 | if idx := strings.Index(tag, ","); idx != -1 { 19 | return tag[:idx], tagOptions(tag[idx+1:]) 20 | } 21 | return tag, tagOptions("") 22 | } 23 | 24 | // Contains reports whether a comma-separated list of options 25 | // contains a particular substr flag. substr must be surrounded by a 26 | // string boundary or commas. 27 | func (o tagOptions) Contains(optionName string) bool { 28 | if len(o) == 0 { 29 | return false 30 | } 31 | s := string(o) 32 | for s != "" { 33 | var next string 34 | i := strings.Index(s, ",") 35 | if i >= 0 { 36 | s, next = s[:i], s[i+1:] 37 | } 38 | if s == optionName { 39 | return true 40 | } 41 | s = next 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/sasl/sasl.c: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static int mgo_sasl_simple(void *context, int id, const char **result, unsigned int *len) 9 | { 10 | if (!result) { 11 | return SASL_BADPARAM; 12 | } 13 | switch (id) { 14 | case SASL_CB_USER: 15 | *result = (char *)context; 16 | break; 17 | case SASL_CB_AUTHNAME: 18 | *result = (char *)context; 19 | break; 20 | case SASL_CB_LANGUAGE: 21 | *result = NULL; 22 | break; 23 | default: 24 | return SASL_BADPARAM; 25 | } 26 | if (len) { 27 | *len = *result ? strlen(*result) : 0; 28 | } 29 | return SASL_OK; 30 | } 31 | 32 | typedef int (*callback)(void); 33 | 34 | static int mgo_sasl_secret(sasl_conn_t *conn, void *context, int id, sasl_secret_t **result) 35 | { 36 | if (!conn || !result || id != SASL_CB_PASS) { 37 | return SASL_BADPARAM; 38 | } 39 | *result = (sasl_secret_t *)context; 40 | return SASL_OK; 41 | } 42 | 43 | sasl_callback_t *mgo_sasl_callbacks(const char *username, const char *password) 44 | { 45 | sasl_callback_t *cb = malloc(4 * sizeof(sasl_callback_t)); 46 | int n = 0; 47 | 48 | size_t len = strlen(password); 49 | sasl_secret_t *secret = (sasl_secret_t*)malloc(sizeof(sasl_secret_t) + len); 50 | if (!secret) { 51 | free(cb); 52 | return NULL; 53 | } 54 | strcpy((char *)secret->data, password); 55 | secret->len = len; 56 | 57 | cb[n].id = SASL_CB_PASS; 58 | cb[n].proc = (callback)&mgo_sasl_secret; 59 | cb[n].context = secret; 60 | n++; 61 | 62 | cb[n].id = SASL_CB_USER; 63 | cb[n].proc = (callback)&mgo_sasl_simple; 64 | cb[n].context = (char*)username; 65 | n++; 66 | 67 | cb[n].id = SASL_CB_AUTHNAME; 68 | cb[n].proc = (callback)&mgo_sasl_simple; 69 | cb[n].context = (char*)username; 70 | n++; 71 | 72 | cb[n].id = SASL_CB_LIST_END; 73 | cb[n].proc = NULL; 74 | cb[n].context = NULL; 75 | 76 | return cb; 77 | } 78 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sspi_windows.h" 4 | 5 | SECURITY_STATUS SEC_ENTRY sspi_acquire_credentials_handle(CredHandle* cred_handle, char* username, char* password, char* domain); 6 | int sspi_step(CredHandle* cred_handle, int has_context, CtxtHandle* context, PVOID buffer, ULONG buffer_length, PVOID* out_buffer, ULONG* out_buffer_length, char* target); 7 | int sspi_send_client_authz_id(CtxtHandle* context, PVOID* buffer, ULONG* buffer_length, char* user_plus_realm); 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceoff.go: -------------------------------------------------------------------------------- 1 | // +build !race 2 | 3 | package mgo 4 | 5 | const raceDetector = false 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceon.go: -------------------------------------------------------------------------------- 1 | // +build race 2 | 3 | package mgo 4 | 5 | const raceDetector = true 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/saslimpl.go: -------------------------------------------------------------------------------- 1 | //+build sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "gopkg.in/mgo.v2/internal/sasl" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return sasl.New(cred.Username, cred.Password, cred.Mechanism, cred.Service, host) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/saslstub.go: -------------------------------------------------------------------------------- 1 | //+build !sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return nil, fmt.Errorf("SASL support not enabled during build (-tags sasl)") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE.libyaml: -------------------------------------------------------------------------------- 1 | The following files were ported to Go from C files of libyaml, and thus 2 | are still covered by their original copyright and license: 3 | 4 | apic.go 5 | emitterc.go 6 | parserc.go 7 | readerc.go 8 | scannerc.go 9 | writerc.go 10 | yamlh.go 11 | yamlprivateh.go 12 | 13 | Copyright (c) 2006 Kirill Simonov 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 19 | of the Software, and to permit persons to whom the Software is furnished to do 20 | so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /web_client/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"] 12 | } 13 | -------------------------------------------------------------------------------- /web_client/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /web_client/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web_client/README.md: -------------------------------------------------------------------------------- 1 | # todo-vue 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | # vue-todo 23 | -------------------------------------------------------------------------------- /web_client/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /web_client/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /web_client/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/web_client/build/logo.png -------------------------------------------------------------------------------- /web_client/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /web_client/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /web_client/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /web_client/dist/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/web_client/dist/favicon.ico -------------------------------------------------------------------------------- /web_client/dist/index.html: -------------------------------------------------------------------------------- 1 | Todo
-------------------------------------------------------------------------------- /web_client/dist/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/web_client/dist/static/favicon.ico -------------------------------------------------------------------------------- /web_client/dist/static/js/manifest.2ae2e69a05c33dfc65f8.js: -------------------------------------------------------------------------------- 1 | !function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a 2 | 3 | 4 | 5 | 6 | 7 | Todo 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /web_client/src/App.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | 21 | 36 | -------------------------------------------------------------------------------- /web_client/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/web_client/src/assets/logo.png -------------------------------------------------------------------------------- /web_client/src/components/TodoCheckAll.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /web_client/src/components/TodoClearCompleted.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 21 | 22 | 25 | -------------------------------------------------------------------------------- /web_client/src/components/TodoFiltered.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 28 | 29 | 31 | -------------------------------------------------------------------------------- /web_client/src/components/TodoItemRemaining.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /web_client/src/components/auth/Login.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 41 | 42 | 46 | -------------------------------------------------------------------------------- /web_client/src/components/auth/Logout.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | 22 | 25 | -------------------------------------------------------------------------------- /web_client/src/components/auth/Register.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 52 | 53 | -------------------------------------------------------------------------------- /web_client/src/components/marketing/About.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /web_client/src/components/marketing/LandingPage.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /web_client/src/components/marketing/TestTodosVariable.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /web_client/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import router from './router/index' 3 | import {store} from './store/store' 4 | import Master from './components/layouts/Master' 5 | 6 | 7 | window.eventBus = new Vue() 8 | Vue.config.productionTip = false 9 | 10 | /* eslint-disable no-new */ 11 | new Vue({ 12 | el: '#app', 13 | store: store, 14 | router:router, 15 | components: { Master }, 16 | template: '' 17 | }) 18 | 19 | 20 | // 21 | router.beforeEach((to, from, next) => { 22 | if (to.matched.some(record => record.meta.requiresAuth)) { 23 | if (!store.getters.loggedIn) { 24 | next({ 25 | name: 'login', 26 | }) 27 | } else { 28 | next() 29 | } 30 | } else if (to.matched.some(record => record.meta.requiresVisitor)) { 31 | if (store.getters.loggedIn) { 32 | next({ 33 | name: 'todo', 34 | }) 35 | } else { 36 | next() 37 | } 38 | } else { 39 | next() 40 | } 41 | }) 42 | -------------------------------------------------------------------------------- /web_client/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import App from "../App"; 4 | import LandingPage from "../components/marketing/LandingPage"; 5 | import About from "../components/marketing/About"; 6 | import Login from "../components/auth/Login"; 7 | import Register from "../components/auth/Register"; 8 | import TestTodosVariable from "../components/marketing/TestTodosVariable"; 9 | import Logout from "../components/auth/Logout"; 10 | import {store} from "../store/store"; 11 | 12 | 13 | Vue.use(Router) 14 | 15 | export default new Router({ 16 | routes: [ 17 | { 18 | path:'/', 19 | name:'home', 20 | component:LandingPage 21 | }, 22 | { 23 | path:'/todo', 24 | name:'todo', 25 | component:App, 26 | meta: { 27 | requiresAuth: true, 28 | } 29 | }, 30 | { 31 | path:'/about', 32 | name:'about', 33 | component:About 34 | }, 35 | { 36 | path:'/login', 37 | name:'login', 38 | component:Login, 39 | meta: { 40 | requiresVisitor: true, 41 | } 42 | }, 43 | { 44 | path:'/register', 45 | name:'register', 46 | component:Register, 47 | meta: { 48 | requiresVisitor: true, 49 | } 50 | }, 51 | { 52 | path:'/logout', 53 | name:'logout', 54 | component:Logout 55 | }, 56 | { 57 | path:'/todo/item/:id', 58 | name:'item', 59 | component:TestTodosVariable 60 | } 61 | ], 62 | mode:'history' 63 | }) 64 | -------------------------------------------------------------------------------- /web_client/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/web_client/static/.gitkeep -------------------------------------------------------------------------------- /web_client/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flywithbug-vue/vue-todo/2e5f018dafe327fd7262b331da5ec5073013f1fb/web_client/static/favicon.ico --------------------------------------------------------------------------------