├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── custom.md
│ └── feature_request.md
└── workflows
│ └── makefile.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── api
├── engine_handler.go
└── router.go
├── cmd
└── risk_engine
│ ├── config.yaml
│ └── engine.go
├── configs
├── config.go
└── const.go
├── core
├── abtest.go
├── common.go
├── conditional.go
├── dsl.go
├── end.go
├── feature.go
├── feature_test.go
├── flow.go
├── inode.go
├── kernel.go
├── matrix.go
├── pipeline.go
├── ruleset.go
├── scorecard.go
├── start.go
├── tree.go
└── udf
│ ├── avg.go
│ ├── max.go
│ ├── min.go
│ ├── sum.go
│ └── udf_test.go
├── demo
├── flow_abtest.yaml
├── flow_conditional.yaml
├── flow_matrix.yaml
├── flow_multifeature.yaml
├── flow_ruleset.yaml
├── flow_scorecard.yaml
├── flow_simple.yaml
└── flow_tree.yaml
├── docs
├── abtest1.png
├── api.md
├── arch.png
├── arch1.png
├── conditional1.png
├── demo.md
├── dsl.md
├── matrix1.png
├── matrix2.png
├── passing.svg
├── ruleset1.png
└── ruleset2.jpg
├── global
├── config.go
├── strategy.go
└── udf.go
├── go.mod
├── go.sum
├── internal
├── dto
│ └── engine.go
├── errcode
│ ├── common_error.go
│ ├── dsl_error.go
│ ├── error.go
│ └── parse_error.go
├── log
│ ├── default_logger.go
│ ├── logger.go
│ └── logger_test.go
├── operator
│ ├── array_op.go
│ ├── compare.go
│ ├── eval.go
│ ├── logic.go
│ └── operator_test.go
├── udf
│ └── udf.go
└── util
│ ├── time_util.go
│ ├── time_util_test.go
│ ├── type_util.go
│ └── type_util_test.go
├── service
└── service.go
└── vendor
├── github.com
├── Knetic
│ └── govaluate
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTORS
│ │ ├── EvaluableExpression.go
│ │ ├── EvaluableExpression_sql.go
│ │ ├── ExpressionToken.go
│ │ ├── LICENSE
│ │ ├── MANUAL.md
│ │ ├── OperatorSymbol.go
│ │ ├── README.md
│ │ ├── TokenKind.go
│ │ ├── evaluationStage.go
│ │ ├── expressionFunctions.go
│ │ ├── expressionOutputStream.go
│ │ ├── lexerState.go
│ │ ├── lexerStream.go
│ │ ├── parameters.go
│ │ ├── parsing.go
│ │ ├── sanitizedParameters.go
│ │ ├── stagePlanner.go
│ │ ├── test.sh
│ │ └── tokenStream.go
├── gin-contrib
│ └── sse
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── sse-decoder.go
│ │ ├── sse-encoder.go
│ │ └── writer.go
├── gin-gonic
│ └── gin
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS.md
│ │ ├── BENCHMARKS.md
│ │ ├── CHANGELOG.md
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── auth.go
│ │ ├── binding
│ │ ├── binding.go
│ │ ├── binding_nomsgpack.go
│ │ ├── default_validator.go
│ │ ├── form.go
│ │ ├── form_mapping.go
│ │ ├── header.go
│ │ ├── json.go
│ │ ├── msgpack.go
│ │ ├── multipart_form_mapping.go
│ │ ├── protobuf.go
│ │ ├── query.go
│ │ ├── uri.go
│ │ ├── xml.go
│ │ └── yaml.go
│ │ ├── codecov.yml
│ │ ├── context.go
│ │ ├── context_appengine.go
│ │ ├── debug.go
│ │ ├── deprecated.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── fs.go
│ │ ├── gin.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── internal
│ │ ├── bytesconv
│ │ │ └── bytesconv.go
│ │ └── json
│ │ │ ├── json.go
│ │ │ └── jsoniter.go
│ │ ├── logger.go
│ │ ├── mode.go
│ │ ├── path.go
│ │ ├── recovery.go
│ │ ├── render
│ │ ├── data.go
│ │ ├── html.go
│ │ ├── json.go
│ │ ├── msgpack.go
│ │ ├── protobuf.go
│ │ ├── reader.go
│ │ ├── redirect.go
│ │ ├── render.go
│ │ ├── text.go
│ │ ├── xml.go
│ │ └── yaml.go
│ │ ├── response_writer.go
│ │ ├── routergroup.go
│ │ ├── test_helpers.go
│ │ ├── tree.go
│ │ ├── utils.go
│ │ └── version.go
├── go-playground
│ ├── locales
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── currency
│ │ │ └── currency.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── logo.png
│ │ └── rules.go
│ ├── universal-translator
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── errors.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── import_export.go
│ │ ├── logo.png
│ │ ├── translator.go
│ │ └── universal_translator.go
│ └── validator
│ │ └── v10
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── baked_in.go
│ │ ├── cache.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── field_level.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── logo.png
│ │ ├── regexes.go
│ │ ├── struct_level.go
│ │ ├── translations.go
│ │ ├── util.go
│ │ ├── validator.go
│ │ └── validator_instance.go
├── golang
│ └── protobuf
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── 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
├── json-iterator
│ └── go
│ │ ├── .codecov.yml
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── Gopkg.lock
│ │ ├── Gopkg.toml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── adapter.go
│ │ ├── any.go
│ │ ├── any_array.go
│ │ ├── any_bool.go
│ │ ├── any_float.go
│ │ ├── any_int32.go
│ │ ├── any_int64.go
│ │ ├── any_invalid.go
│ │ ├── any_nil.go
│ │ ├── any_number.go
│ │ ├── any_object.go
│ │ ├── any_str.go
│ │ ├── any_uint32.go
│ │ ├── any_uint64.go
│ │ ├── build.sh
│ │ ├── config.go
│ │ ├── fuzzy_mode_convert_table.md
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── iter.go
│ │ ├── iter_array.go
│ │ ├── iter_float.go
│ │ ├── iter_int.go
│ │ ├── iter_object.go
│ │ ├── iter_skip.go
│ │ ├── iter_skip_sloppy.go
│ │ ├── iter_skip_strict.go
│ │ ├── iter_str.go
│ │ ├── jsoniter.go
│ │ ├── pool.go
│ │ ├── reflect.go
│ │ ├── reflect_array.go
│ │ ├── reflect_dynamic.go
│ │ ├── reflect_extension.go
│ │ ├── reflect_json_number.go
│ │ ├── reflect_json_raw_message.go
│ │ ├── reflect_map.go
│ │ ├── reflect_marshaler.go
│ │ ├── reflect_native.go
│ │ ├── reflect_optional.go
│ │ ├── reflect_slice.go
│ │ ├── reflect_struct_decoder.go
│ │ ├── reflect_struct_encoder.go
│ │ ├── stream.go
│ │ ├── stream_float.go
│ │ ├── stream_int.go
│ │ ├── stream_str.go
│ │ └── test.sh
├── leodido
│ └── go-urn
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── machine.go
│ │ ├── machine.go.rl
│ │ ├── makefile
│ │ └── urn.go
├── mattn
│ └── go-isatty
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── go.test.sh
│ │ ├── isatty_bsd.go
│ │ ├── isatty_others.go
│ │ ├── isatty_plan9.go
│ │ ├── isatty_solaris.go
│ │ ├── isatty_tcgets.go
│ │ ├── isatty_windows.go
│ │ └── renovate.json
├── modern-go
│ ├── concurrent
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── executor.go
│ │ ├── go_above_19.go
│ │ ├── go_below_19.go
│ │ └── unbounded_executor.go
│ └── reflect2
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── Gopkg.lock
│ │ ├── Gopkg.toml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── go_above_17.go
│ │ ├── go_above_19.go
│ │ ├── go_below_17.go
│ │ ├── go_below_19.go
│ │ ├── reflect2.go
│ │ ├── reflect2_amd64.s
│ │ ├── reflect2_kind.go
│ │ ├── relfect2_386.s
│ │ ├── relfect2_amd64p32.s
│ │ ├── relfect2_arm.s
│ │ ├── relfect2_arm64.s
│ │ ├── relfect2_mips64x.s
│ │ ├── relfect2_mipsx.s
│ │ ├── relfect2_ppc64x.s
│ │ ├── relfect2_s390x.s
│ │ ├── safe_field.go
│ │ ├── safe_map.go
│ │ ├── safe_slice.go
│ │ ├── safe_struct.go
│ │ ├── safe_type.go
│ │ ├── test.sh
│ │ ├── type_map.go
│ │ ├── unsafe_array.go
│ │ ├── unsafe_eface.go
│ │ ├── unsafe_field.go
│ │ ├── unsafe_iface.go
│ │ ├── unsafe_link.go
│ │ ├── unsafe_map.go
│ │ ├── unsafe_ptr.go
│ │ ├── unsafe_slice.go
│ │ ├── unsafe_struct.go
│ │ └── unsafe_type.go
└── ugorji
│ └── go
│ └── codec
│ ├── 0_importpath.go
│ ├── LICENSE
│ ├── binc.go
│ ├── build.sh
│ ├── cbor.go
│ ├── codecgen.go
│ ├── decode.go
│ ├── doc.go
│ ├── encode.go
│ ├── fast-path.generated.go
│ ├── fast-path.go.tmpl
│ ├── fast-path.not.go
│ ├── float.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_fmt_time_gte_go15.go
│ ├── goversion_fmt_time_lt_go15.go
│ ├── goversion_makemap_gte_go19.go
│ ├── goversion_makemap_lt_go19.go
│ ├── goversion_maprange_gte_go112.go
│ ├── goversion_maprange_lt_go112.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.s
│ ├── helper_internal.go
│ ├── helper_not_unsafe.go
│ ├── helper_unsafe.go
│ ├── json.go
│ ├── mammoth-test.go.tmpl
│ ├── mammoth2-test.go.tmpl
│ ├── msgpack.go
│ ├── prebuild.go
│ ├── reader.go
│ ├── register_ext.go
│ ├── rpc.go
│ ├── simple.go
│ ├── sort-slice.generated.go
│ ├── sort-slice.go.tmpl
│ ├── test-cbor-goldens.json
│ ├── test.py
│ └── writer.go
├── golang.org
└── x
│ └── sys
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ └── unix
│ ├── .gitignore
│ ├── README.md
│ ├── affinity_linux.go
│ ├── aliases.go
│ ├── asm_aix_ppc64.s
│ ├── asm_darwin_386.s
│ ├── asm_darwin_amd64.s
│ ├── asm_darwin_arm.s
│ ├── asm_darwin_arm64.s
│ ├── asm_dragonfly_amd64.s
│ ├── asm_freebsd_386.s
│ ├── asm_freebsd_amd64.s
│ ├── asm_freebsd_arm.s
│ ├── asm_freebsd_arm64.s
│ ├── asm_linux_386.s
│ ├── asm_linux_amd64.s
│ ├── asm_linux_arm.s
│ ├── asm_linux_arm64.s
│ ├── asm_linux_mips64x.s
│ ├── asm_linux_mipsx.s
│ ├── asm_linux_ppc64x.s
│ ├── asm_linux_riscv64.s
│ ├── asm_linux_s390x.s
│ ├── asm_netbsd_386.s
│ ├── asm_netbsd_amd64.s
│ ├── asm_netbsd_arm.s
│ ├── asm_netbsd_arm64.s
│ ├── asm_openbsd_386.s
│ ├── asm_openbsd_amd64.s
│ ├── asm_openbsd_arm.s
│ ├── asm_openbsd_arm64.s
│ ├── asm_solaris_amd64.s
│ ├── bluetooth_linux.go
│ ├── cap_freebsd.go
│ ├── constants.go
│ ├── dev_aix_ppc.go
│ ├── dev_aix_ppc64.go
│ ├── dev_darwin.go
│ ├── dev_dragonfly.go
│ ├── dev_freebsd.go
│ ├── dev_linux.go
│ ├── dev_netbsd.go
│ ├── dev_openbsd.go
│ ├── dirent.go
│ ├── endian_big.go
│ ├── endian_little.go
│ ├── env_unix.go
│ ├── errors_freebsd_386.go
│ ├── errors_freebsd_amd64.go
│ ├── errors_freebsd_arm.go
│ ├── fcntl.go
│ ├── fcntl_darwin.go
│ ├── fcntl_linux_32bit.go
│ ├── fdset.go
│ ├── gccgo.go
│ ├── gccgo_c.c
│ ├── gccgo_linux_amd64.go
│ ├── ioctl.go
│ ├── mkall.sh
│ ├── mkerrors.sh
│ ├── pagesize_unix.go
│ ├── pledge_openbsd.go
│ ├── race.go
│ ├── race0.go
│ ├── readdirent_getdents.go
│ ├── readdirent_getdirentries.go
│ ├── sockcmsg_dragonfly.go
│ ├── sockcmsg_linux.go
│ ├── sockcmsg_unix.go
│ ├── sockcmsg_unix_other.go
│ ├── str.go
│ ├── syscall.go
│ ├── syscall_aix.go
│ ├── syscall_aix_ppc.go
│ ├── syscall_aix_ppc64.go
│ ├── syscall_bsd.go
│ ├── syscall_darwin.1_12.go
│ ├── syscall_darwin.1_13.go
│ ├── syscall_darwin.go
│ ├── syscall_darwin_386.1_11.go
│ ├── syscall_darwin_386.go
│ ├── syscall_darwin_amd64.1_11.go
│ ├── syscall_darwin_amd64.go
│ ├── syscall_darwin_arm.1_11.go
│ ├── syscall_darwin_arm.go
│ ├── syscall_darwin_arm64.1_11.go
│ ├── syscall_darwin_arm64.go
│ ├── syscall_darwin_libSystem.go
│ ├── syscall_dragonfly.go
│ ├── syscall_dragonfly_amd64.go
│ ├── syscall_freebsd.go
│ ├── syscall_freebsd_386.go
│ ├── syscall_freebsd_amd64.go
│ ├── syscall_freebsd_arm.go
│ ├── syscall_freebsd_arm64.go
│ ├── syscall_linux.go
│ ├── syscall_linux_386.go
│ ├── syscall_linux_amd64.go
│ ├── syscall_linux_amd64_gc.go
│ ├── syscall_linux_arm.go
│ ├── syscall_linux_arm64.go
│ ├── syscall_linux_gc.go
│ ├── syscall_linux_gc_386.go
│ ├── syscall_linux_gccgo_386.go
│ ├── syscall_linux_gccgo_arm.go
│ ├── syscall_linux_mips64x.go
│ ├── syscall_linux_mipsx.go
│ ├── syscall_linux_ppc64x.go
│ ├── syscall_linux_riscv64.go
│ ├── syscall_linux_s390x.go
│ ├── syscall_linux_sparc64.go
│ ├── syscall_netbsd.go
│ ├── syscall_netbsd_386.go
│ ├── syscall_netbsd_amd64.go
│ ├── syscall_netbsd_arm.go
│ ├── syscall_netbsd_arm64.go
│ ├── syscall_openbsd.go
│ ├── syscall_openbsd_386.go
│ ├── syscall_openbsd_amd64.go
│ ├── syscall_openbsd_arm.go
│ ├── syscall_openbsd_arm64.go
│ ├── syscall_solaris.go
│ ├── syscall_solaris_amd64.go
│ ├── syscall_unix.go
│ ├── syscall_unix_gc.go
│ ├── syscall_unix_gc_ppc64x.go
│ ├── timestruct.go
│ ├── unveil_openbsd.go
│ ├── xattr_bsd.go
│ ├── zerrors_aix_ppc.go
│ ├── zerrors_aix_ppc64.go
│ ├── zerrors_darwin_386.go
│ ├── zerrors_darwin_amd64.go
│ ├── zerrors_darwin_arm.go
│ ├── zerrors_darwin_arm64.go
│ ├── zerrors_dragonfly_amd64.go
│ ├── zerrors_freebsd_386.go
│ ├── zerrors_freebsd_amd64.go
│ ├── zerrors_freebsd_arm.go
│ ├── zerrors_freebsd_arm64.go
│ ├── zerrors_linux_386.go
│ ├── zerrors_linux_amd64.go
│ ├── zerrors_linux_arm.go
│ ├── zerrors_linux_arm64.go
│ ├── zerrors_linux_mips.go
│ ├── zerrors_linux_mips64.go
│ ├── zerrors_linux_mips64le.go
│ ├── zerrors_linux_mipsle.go
│ ├── zerrors_linux_ppc64.go
│ ├── zerrors_linux_ppc64le.go
│ ├── zerrors_linux_riscv64.go
│ ├── zerrors_linux_s390x.go
│ ├── zerrors_linux_sparc64.go
│ ├── zerrors_netbsd_386.go
│ ├── zerrors_netbsd_amd64.go
│ ├── zerrors_netbsd_arm.go
│ ├── zerrors_netbsd_arm64.go
│ ├── zerrors_openbsd_386.go
│ ├── zerrors_openbsd_amd64.go
│ ├── zerrors_openbsd_arm.go
│ ├── zerrors_openbsd_arm64.go
│ ├── zerrors_solaris_amd64.go
│ ├── zptrace_armnn_linux.go
│ ├── zptrace_linux_arm64.go
│ ├── zptrace_mipsnn_linux.go
│ ├── zptrace_mipsnnle_linux.go
│ ├── zptrace_x86_linux.go
│ ├── zsyscall_aix_ppc.go
│ ├── zsyscall_aix_ppc64.go
│ ├── zsyscall_aix_ppc64_gc.go
│ ├── zsyscall_aix_ppc64_gccgo.go
│ ├── zsyscall_darwin_386.1_11.go
│ ├── zsyscall_darwin_386.1_13.go
│ ├── zsyscall_darwin_386.1_13.s
│ ├── zsyscall_darwin_386.go
│ ├── zsyscall_darwin_386.s
│ ├── zsyscall_darwin_amd64.1_11.go
│ ├── zsyscall_darwin_amd64.1_13.go
│ ├── zsyscall_darwin_amd64.1_13.s
│ ├── zsyscall_darwin_amd64.go
│ ├── zsyscall_darwin_amd64.s
│ ├── zsyscall_darwin_arm.1_11.go
│ ├── zsyscall_darwin_arm.1_13.go
│ ├── zsyscall_darwin_arm.1_13.s
│ ├── zsyscall_darwin_arm.go
│ ├── zsyscall_darwin_arm.s
│ ├── zsyscall_darwin_arm64.1_11.go
│ ├── zsyscall_darwin_arm64.1_13.go
│ ├── zsyscall_darwin_arm64.1_13.s
│ ├── zsyscall_darwin_arm64.go
│ ├── zsyscall_darwin_arm64.s
│ ├── zsyscall_dragonfly_amd64.go
│ ├── zsyscall_freebsd_386.go
│ ├── zsyscall_freebsd_amd64.go
│ ├── zsyscall_freebsd_arm.go
│ ├── zsyscall_freebsd_arm64.go
│ ├── zsyscall_linux_386.go
│ ├── zsyscall_linux_amd64.go
│ ├── zsyscall_linux_arm.go
│ ├── zsyscall_linux_arm64.go
│ ├── zsyscall_linux_mips.go
│ ├── zsyscall_linux_mips64.go
│ ├── zsyscall_linux_mips64le.go
│ ├── zsyscall_linux_mipsle.go
│ ├── zsyscall_linux_ppc64.go
│ ├── zsyscall_linux_ppc64le.go
│ ├── zsyscall_linux_riscv64.go
│ ├── zsyscall_linux_s390x.go
│ ├── zsyscall_linux_sparc64.go
│ ├── zsyscall_netbsd_386.go
│ ├── zsyscall_netbsd_amd64.go
│ ├── zsyscall_netbsd_arm.go
│ ├── zsyscall_netbsd_arm64.go
│ ├── zsyscall_openbsd_386.go
│ ├── zsyscall_openbsd_amd64.go
│ ├── zsyscall_openbsd_arm.go
│ ├── zsyscall_openbsd_arm64.go
│ ├── zsyscall_solaris_amd64.go
│ ├── zsysctl_openbsd_386.go
│ ├── zsysctl_openbsd_amd64.go
│ ├── zsysctl_openbsd_arm.go
│ ├── zsysctl_openbsd_arm64.go
│ ├── zsysnum_darwin_386.go
│ ├── zsysnum_darwin_amd64.go
│ ├── zsysnum_darwin_arm.go
│ ├── zsysnum_darwin_arm64.go
│ ├── zsysnum_dragonfly_amd64.go
│ ├── zsysnum_freebsd_386.go
│ ├── zsysnum_freebsd_amd64.go
│ ├── zsysnum_freebsd_arm.go
│ ├── zsysnum_freebsd_arm64.go
│ ├── zsysnum_linux_386.go
│ ├── zsysnum_linux_amd64.go
│ ├── zsysnum_linux_arm.go
│ ├── zsysnum_linux_arm64.go
│ ├── zsysnum_linux_mips.go
│ ├── zsysnum_linux_mips64.go
│ ├── zsysnum_linux_mips64le.go
│ ├── zsysnum_linux_mipsle.go
│ ├── zsysnum_linux_ppc64.go
│ ├── zsysnum_linux_ppc64le.go
│ ├── zsysnum_linux_riscv64.go
│ ├── zsysnum_linux_s390x.go
│ ├── zsysnum_linux_sparc64.go
│ ├── zsysnum_netbsd_386.go
│ ├── zsysnum_netbsd_amd64.go
│ ├── zsysnum_netbsd_arm.go
│ ├── zsysnum_netbsd_arm64.go
│ ├── zsysnum_openbsd_386.go
│ ├── zsysnum_openbsd_amd64.go
│ ├── zsysnum_openbsd_arm.go
│ ├── zsysnum_openbsd_arm64.go
│ ├── ztypes_aix_ppc.go
│ ├── ztypes_aix_ppc64.go
│ ├── ztypes_darwin_386.go
│ ├── ztypes_darwin_amd64.go
│ ├── ztypes_darwin_arm.go
│ ├── ztypes_darwin_arm64.go
│ ├── ztypes_dragonfly_amd64.go
│ ├── ztypes_freebsd_386.go
│ ├── ztypes_freebsd_amd64.go
│ ├── ztypes_freebsd_arm.go
│ ├── ztypes_freebsd_arm64.go
│ ├── ztypes_linux_386.go
│ ├── ztypes_linux_amd64.go
│ ├── ztypes_linux_arm.go
│ ├── ztypes_linux_arm64.go
│ ├── ztypes_linux_mips.go
│ ├── ztypes_linux_mips64.go
│ ├── ztypes_linux_mips64le.go
│ ├── ztypes_linux_mipsle.go
│ ├── ztypes_linux_ppc64.go
│ ├── ztypes_linux_ppc64le.go
│ ├── ztypes_linux_riscv64.go
│ ├── ztypes_linux_s390x.go
│ ├── ztypes_linux_sparc64.go
│ ├── ztypes_netbsd_386.go
│ ├── ztypes_netbsd_amd64.go
│ ├── ztypes_netbsd_arm.go
│ ├── ztypes_netbsd_arm64.go
│ ├── ztypes_openbsd_386.go
│ ├── ztypes_openbsd_amd64.go
│ ├── ztypes_openbsd_arm.go
│ ├── ztypes_openbsd_arm64.go
│ └── ztypes_solaris_amd64.go
├── gopkg.in
└── yaml.v2
│ ├── .travis.yml
│ ├── 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
└── modules.txt
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/makefile.yml:
--------------------------------------------------------------------------------
1 | name: risk_engine make
2 |
3 | on:
4 | push:
5 | branches: [ "master" ]
6 | pull_request:
7 | branches: [ "master" ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/setup-go@v2
16 | with:
17 | go-version: 1.18.x
18 |
19 | - name: test
20 | run: |
21 | echo test111
22 |
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | tags
2 | dist/
3 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # go build
2 | FROM golang:1.12.16 as build
3 | RUN mkdir -p /app/building
4 | WORKDIR /app/building
5 | ADD . /app/building
6 | ENV GOPROXY https://goproxy.cn
7 | RUN make build
8 |
9 | # copy & run
10 | FROM alpine:3.9.5
11 | COPY --from=build /app/building/dist/bin/risk_engine /app/bin/
12 | COPY --from=build /app/building/dist/conf/config.yaml /app/conf/
13 | COPY --from=build /app/building/dist/demo /app/demo
14 | EXPOSE 8889
15 | WORKDIR /app/
16 | CMD bin/risk_engine -c conf/config.yaml
17 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | GOCMD=GO111MODULE=on CGO_ENABLED=0 go
2 | GOBUILD=$(GOCMD) build
3 |
4 | all: build
5 | build:
6 | rm -rf dist/
7 | mkdir -p dist/conf dist/bin
8 | cp cmd/risk_engine/config.yaml dist/conf
9 | cp demo dist/demo -r
10 | $(GOBUILD) -o dist/bin/risk_engine cmd/risk_engine/engine.go
11 |
12 | clean:
13 | rm -rf dist/
14 |
15 | run:
16 | cd dist/; nohup bin/risk_engine -c conf/config.yaml >nohup.out 2>nohup.out &
17 |
18 | stop:
19 | pkill -f bin/risk_engine
20 |
--------------------------------------------------------------------------------
/api/router.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package api
14 |
15 | import (
16 | "fmt"
17 | "github.com/gin-gonic/gin"
18 | "github.com/skyhackvip/risk_engine/core"
19 | "github.com/skyhackvip/risk_engine/global"
20 | "github.com/skyhackvip/risk_engine/internal/log"
21 | )
22 |
23 | func Init() { //conf
24 | kernel := core.NewKernel()
25 | kernel.LoadDsl(global.AppConf.DslLoadMethod, global.AppConf.DslLoadPath)
26 |
27 | engineHandler := NewEngineHandler(kernel)
28 |
29 | router := gin.Default()
30 | router.POST("/engine/run", engineHandler.Run)
31 | router.GET("/engine/list", engineHandler.List)
32 |
33 | router.Run(fmt.Sprintf(":%d", global.ServerConf.Port)) //conf
34 |
35 | log.Infof("[HTTP] Listening on %d", global.ServerConf.Port)
36 | }
37 |
--------------------------------------------------------------------------------
/cmd/risk_engine/config.yaml:
--------------------------------------------------------------------------------
1 | Server:
2 | Env: dev
3 | Port: 8889
4 | ReadTimeout: 10
5 | WriteTimeout: 10
6 | App:
7 | LogMethod: console
8 | LogPath: ./log/risk_engine.log
9 | DslLoadMethod: file
10 | DslLoadPath: demo/ #注意实际放置目录
11 |
--------------------------------------------------------------------------------
/core/end.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package core
14 |
15 | import (
16 | "github.com/skyhackvip/risk_engine/internal/log"
17 | )
18 |
19 | type EndNode struct {
20 | Info NodeInfo
21 | }
22 |
23 | func NewEndNode(name string) *EndNode {
24 | return &EndNode{
25 | Info: NodeInfo{Name: name, Kind: TypeEnd.String()},
26 | }
27 | }
28 |
29 | func (node EndNode) GetName() string {
30 | return node.Info.Name
31 | }
32 |
33 | func (node EndNode) GetType() NodeType {
34 | return GetNodeType(node.Info.Kind)
35 | }
36 |
37 | func (node EndNode) GetInfo() NodeInfo {
38 | return node.Info
39 | }
40 |
41 | func (node EndNode) BeforeParse(ctx *PipelineContext) error {
42 | return nil
43 | }
44 |
45 | func (node EndNode) AfterParse(ctx *PipelineContext, result *NodeResult) error {
46 | return nil
47 | }
48 |
49 | func (node EndNode) Parse(ctx *PipelineContext) (*NodeResult, error) {
50 | log.Info("======[trace] End======")
51 | info := node.GetInfo()
52 | nodeResult := &NodeResult{Id: info.Id, Name: info.Name, Kind: node.GetType(), Tag: info.Tag, Label: info.Label, IsBlock: true}
53 | return nodeResult, nil
54 | }
55 |
--------------------------------------------------------------------------------
/core/udf/avg.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package udf
14 |
--------------------------------------------------------------------------------
/core/udf/max.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package udf
14 |
--------------------------------------------------------------------------------
/core/udf/min.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package udf
14 |
--------------------------------------------------------------------------------
/core/udf/udf_test.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package udf
14 |
15 | import (
16 | "testing"
17 | )
18 |
19 | func TestSum(t *testing.T) {
20 | t.Log(Sum(100))
21 | t.Log(Sum(100.5))
22 | t.Log(Sum([]interface{}{3.3, 100, 5.0, 8}))
23 | t.Log(Sum([]interface{}{3.3, 100, 5.0, 8, "88"}))
24 | t.Log(Sum([]interface{}{3.3, 100, 5.0, 8, true}))
25 | t.Log(Sum([]interface{}{3.3, 100, 5.0, 8, "8ab"}))
26 | t.Log(Sum([3]int{3, 4, 5}))
27 | t.Log(Sum([3]float32{3.0, 4.1, 5}))
28 | t.Log(Sum([3]string{"3.0", "4.1", "5"}))
29 | t.Log(Sum([3]string{"3.a", "b.1", "5"}))
30 | }
31 |
--------------------------------------------------------------------------------
/docs/abtest1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/abtest1.png
--------------------------------------------------------------------------------
/docs/arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/arch.png
--------------------------------------------------------------------------------
/docs/arch1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/arch1.png
--------------------------------------------------------------------------------
/docs/conditional1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/conditional1.png
--------------------------------------------------------------------------------
/docs/matrix1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/matrix1.png
--------------------------------------------------------------------------------
/docs/matrix2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/matrix2.png
--------------------------------------------------------------------------------
/docs/passing.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/ruleset1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/ruleset1.png
--------------------------------------------------------------------------------
/docs/ruleset2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/docs/ruleset2.jpg
--------------------------------------------------------------------------------
/global/config.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package global
14 |
15 | import (
16 | "github.com/skyhackvip/risk_engine/configs"
17 | )
18 |
19 | var (
20 | ServerConf *configs.ServerConf
21 | AppConf *configs.AppConf
22 | )
23 |
--------------------------------------------------------------------------------
/global/strategy.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package global
14 |
15 | import (
16 | "github.com/skyhackvip/risk_engine/configs"
17 | )
18 |
19 | //from configs
20 | var Strategys = map[string]configs.Strategy{
21 | "reject": {"reject", 9, 100},
22 | "approve": {"approve", 5, 5},
23 | "record": {"record", 1, 1},
24 | }
25 |
--------------------------------------------------------------------------------
/global/udf.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package global
14 |
15 | import (
16 | "github.com/skyhackvip/risk_engine/internal/udf"
17 | "sync"
18 | )
19 |
20 | var udfMap map[string]udf.Udf = make(map[string]udf.Udf)
21 | var mu sync.RWMutex
22 |
23 | func RegisterUdf(key string, fn udf.Udf) {
24 | mu.Lock()
25 | defer mu.Unlock()
26 | udfMap[key] = fn //override if exists
27 | }
28 |
29 | func GetUdf(key string) udf.Udf {
30 | mu.RLock()
31 | defer mu.RUnlock()
32 | return udfMap[key]
33 | }
34 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/skyhackvip/risk_engine
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/Knetic/govaluate v3.0.0+incompatible
7 | github.com/gin-gonic/gin v1.6.3
8 | gopkg.in/natefinch/lumberjack.v2 v2.0.0
9 | gopkg.in/yaml.v2 v2.3.0
10 | )
11 |
--------------------------------------------------------------------------------
/internal/errcode/common_error.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package errcode
14 |
15 | var (
16 | ErrorFeatureTypeUnknow = NewError(2000001, "feature type support int,float,bool,string,date,array,map")
17 | ErrorTypeConvert = NewError(2000002, "type convert error")
18 | ErrorNotSupportOperator = NewError(2000003, "not support operator")
19 | ErrorNotANumber = NewError(2000004, "not a number")
20 | ErrorBooleanValEmpty = NewError(2000005, "boolean operator value is empty")
21 | ErrorBooleanValLack = NewError(2000006, "boolean operator value lack")
22 | )
23 |
--------------------------------------------------------------------------------
/internal/errcode/dsl_error.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package errcode
14 |
15 | var DslErrorNotFound = NewError(404, "dsl not found error")
16 |
--------------------------------------------------------------------------------
/internal/errcode/error.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package errcode
14 |
15 | import "fmt"
16 |
17 | type Error struct {
18 | code int `json:"code"`
19 | msg string `json:"msg"`
20 | details []string `json:"details"`
21 | }
22 |
23 | var codes = map[int]string{}
24 |
25 | func NewError(code int, msg string) *Error {
26 | if _, ok := codes[code]; ok {
27 | panic(fmt.Sprintf("code %d exists!", code))
28 | }
29 | codes[code] = msg
30 | return &Error{code: code, msg: msg}
31 | }
32 |
33 | func (e *Error) Error() string {
34 | return fmt.Sprintf("code: %d, error info: %s", e.code, e.msg)
35 | }
36 |
--------------------------------------------------------------------------------
/internal/errcode/parse_error.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package errcode
14 |
15 | var (
16 | ParseErrorNoBranchMatch = NewError(1000005, "flow error, no branch match")
17 | ParseErrorRulesetOutputEmpty = NewError(1000011, "ruleset output is empty")
18 | ParseErrorTreeNotMatch = NewError(1000021, "tree not match error")
19 | ParseErrorTreeOutputEmpty = NewError(1000022, "tree output is empty")
20 | ParseErrorMatrixNotMatch = NewError(1000031, "matrix not match error")
21 | ParseErrorMatrixOutputEmpty = NewError(1000032, "matrix output is empty")
22 | ParseErrorBlockNotMatch = NewError(1000041, "block not match error")
23 |
24 | ParseErrorNotSupportOperator = NewError(1000101, "not support operator")
25 | ParseErrorTargetMustBeArray = NewError(1000102, "target must be array, check yaml first")
26 | ParseErrorTargetNotSupport = NewError(1000103, "target not support error")
27 | ParseErrorFeatureTypeNotMatch = NewError(1000104, "feature type is not match")
28 | ParseErrorFeatureSetValue = NewError(1000105, "the type of date is not match")
29 | )
30 |
--------------------------------------------------------------------------------
/internal/log/logger_test.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package log
14 |
15 | import (
16 | "testing"
17 | )
18 |
19 | func TestLog(t *testing.T) {
20 | //InitLogger("console", "")
21 | InitLogger("file", "./out")
22 | Errorf("this is error %s", "aa")
23 | Error("this is error!")
24 | Debug("this is debug!")
25 | Warn("this is warn!")
26 | Info("this is info!")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/operator/array_op.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package operator
14 |
15 | // jundge val in arr
16 | func InArray(arr []interface{}, val interface{}) bool {
17 | if len(arr) == 0 {
18 | return false
19 | }
20 | for _, v := range arr {
21 | if ok, err := Compare("EQ", v, val); err == nil && ok {
22 | return true
23 | }
24 | }
25 | return false
26 | }
27 |
28 | // jundge array A in Array B
29 | func AInB(a []interface{}, b []interface{}) bool {
30 | if len(b) == 0 {
31 | return false
32 | }
33 | if len(a) == 0 {
34 | return true
35 | }
36 | if len(a) > len(b) {
37 | return false
38 | }
39 | tmp := make(map[interface{}]struct{}, len(b))
40 | for _, v := range b {
41 | tmp[v] = struct{}{}
42 | }
43 | for _, v := range a {
44 | if _, ok := tmp[v]; !ok {
45 | return false
46 | }
47 | }
48 | return true
49 | }
50 |
--------------------------------------------------------------------------------
/internal/operator/eval.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package operator
14 |
15 | import (
16 | "errors"
17 | "github.com/Knetic/govaluate"
18 | "github.com/skyhackvip/risk_engine/internal/log"
19 | )
20 |
21 | //using govalute to execute expression
22 | func Evaluate(exprStr string, params map[string]interface{}) (bool, error) {
23 | expr, err := govaluate.NewEvaluableExpression(exprStr)
24 | log.Infof("base evaluate: %v", expr, params)
25 | if err != nil {
26 | return false, err
27 | }
28 | eval, err := expr.Evaluate(params)
29 | if err != nil {
30 | return false, err
31 | }
32 | if result, ok := eval.(bool); ok {
33 | return result, nil
34 | }
35 | return false, errors.New("convert error")
36 | }
37 |
--------------------------------------------------------------------------------
/internal/udf/udf.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package udf
14 |
15 | type Udf func(interface{}) (interface{}, error)
16 |
--------------------------------------------------------------------------------
/internal/util/time_util.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package util
14 |
15 | import (
16 | "time"
17 | )
18 |
19 | func TimeSince(from time.Time) int64 {
20 | return int64(time.Since(from)) / 1e6
21 | }
22 |
23 | func TimeFormat(t time.Time) string {
24 | return t.Format("2006-01-02 15:04:05")
25 | }
26 |
--------------------------------------------------------------------------------
/internal/util/time_util_test.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package util
14 |
15 | import (
16 | "testing"
17 | "time"
18 | )
19 |
20 | func TestTimeSince(t *testing.T) {
21 | start := time.Now()
22 | time.Sleep(10 * time.Millisecond)
23 | t.Log(TimeSince(start))
24 | }
25 |
--------------------------------------------------------------------------------
/internal/util/type_util_test.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023
2 | //
3 | // @author 贺鹏Kavin
4 | // 微信公众号:技术岁月
5 | // https://github.com/skyhackvip/risk_engine
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License");
8 | // you may not use this file except in compliance with the License.
9 | // You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | package util
14 |
15 | import (
16 | "testing"
17 | )
18 |
19 | func TestNumberic(t *testing.T) {
20 | t.Log(GetType(20))
21 | t.Log(GetType(30))
22 | t.Log(GetType("1111"))
23 | t.Log(GetType("11.11"))
24 | t.Log(GetType("aa11"))
25 | t.Log(GetType(true))
26 | t.Log(GetType("true"))
27 | t.Log(GetType(1111))
28 | t.Log(GetType(1111.1111))
29 | }
30 |
31 | func TestFloat(t *testing.T) {
32 | t.Log(ToFloat64("-1.588"))
33 | t.Log(ToFloat64("1.588"))
34 | t.Log(ToFloat64(1.588))
35 | t.Log(ToFloat64(1))
36 | t.Log(ToFloat64(-1))
37 | t.Log(ToFloat64(-1.0))
38 | t.Log(ToFloat64(true))
39 | t.Log(ToFloat64("1.35e"))
40 | t.Log(ToFloat64("1.35e5"))
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 | *.test
24 | coverage.out
25 |
26 | manual_test.go
27 | *.out
28 | *.err
29 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | script: ./test.sh
4 |
5 | go:
6 | - 1.2
7 | - 1.3
8 | - 1.4
9 | - 1.5
10 | - 1.6
11 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | This library was authored by George Lester, and contains contributions from:
2 |
3 | vjeantet (regex support)
4 | iasci (ternary operator)
5 | oxtoacart (parameter structures, deferred parameter retrieval)
6 | wmiller848 (bitwise operators)
7 | prashantv (optimization of bools)
8 | dpaolella (exposure of variables used in an expression)
9 | benpaxton (fix for missing type checks during literal elide process)
10 | abrander (panic-finding testing tool)
11 | xfennec (fix for dates being parsed in the current Location)
12 | bgaifullin (lifting restriction on complex/struct types)
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/ExpressionToken.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | /*
4 | Represents a single parsed token.
5 | */
6 | type ExpressionToken struct {
7 | Kind TokenKind
8 | Value interface{}
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2016 George Lester
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/Knetic/govaluate/TokenKind.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | /*
4 | Represents all valid types of tokens that a token can be.
5 | */
6 | type TokenKind int
7 |
8 | const (
9 | UNKNOWN TokenKind = iota
10 |
11 | PREFIX
12 | NUMERIC
13 | BOOLEAN
14 | STRING
15 | PATTERN
16 | TIME
17 | VARIABLE
18 | FUNCTION
19 | SEPARATOR
20 |
21 | COMPARATOR
22 | LOGICALOP
23 | MODIFIER
24 |
25 | CLAUSE
26 | CLAUSE_CLOSE
27 |
28 | TERNARY
29 | )
30 |
31 | /*
32 | GetTokenKindString returns a string that describes the given TokenKind.
33 | e.g., when passed the NUMERIC TokenKind, this returns the string "NUMERIC".
34 | */
35 | func (kind TokenKind) String() string {
36 |
37 | switch kind {
38 |
39 | case PREFIX:
40 | return "PREFIX"
41 | case NUMERIC:
42 | return "NUMERIC"
43 | case BOOLEAN:
44 | return "BOOLEAN"
45 | case STRING:
46 | return "STRING"
47 | case PATTERN:
48 | return "PATTERN"
49 | case TIME:
50 | return "TIME"
51 | case VARIABLE:
52 | return "VARIABLE"
53 | case FUNCTION:
54 | return "FUNCTION"
55 | case SEPARATOR:
56 | return "SEPARATOR"
57 | case COMPARATOR:
58 | return "COMPARATOR"
59 | case LOGICALOP:
60 | return "LOGICALOP"
61 | case MODIFIER:
62 | return "MODIFIER"
63 | case CLAUSE:
64 | return "CLAUSE"
65 | case CLAUSE_CLOSE:
66 | return "CLAUSE_CLOSE"
67 | case TERNARY:
68 | return "TERNARY"
69 | }
70 |
71 | return "UNKNOWN"
72 | }
73 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/expressionFunctions.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | /*
4 | Represents a function that can be called from within an expression.
5 | This method must return an error if, for any reason, it is unable to produce exactly one unambiguous result.
6 | An error returned will halt execution of the expression.
7 | */
8 | type ExpressionFunction func(arguments ...interface{}) (interface{}, error)
9 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/expressionOutputStream.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | import (
4 | "bytes"
5 | )
6 |
7 | /*
8 | Holds a series of "transactions" which represent each token as it is output by an outputter (such as ToSQLQuery()).
9 | Some outputs (such as SQL) require a function call or non-c-like syntax to represent an expression.
10 | To accomplish this, this struct keeps track of each translated token as it is output, and can return and rollback those transactions.
11 | */
12 | type expressionOutputStream struct {
13 | transactions []string
14 | }
15 |
16 | func (this *expressionOutputStream) add(transaction string) {
17 | this.transactions = append(this.transactions, transaction)
18 | }
19 |
20 | func (this *expressionOutputStream) rollback() string {
21 |
22 | index := len(this.transactions) - 1
23 | ret := this.transactions[index]
24 |
25 | this.transactions = this.transactions[:index]
26 | return ret
27 | }
28 |
29 | func (this *expressionOutputStream) createString(delimiter string) string {
30 |
31 | var retBuffer bytes.Buffer
32 | var transaction string
33 |
34 | penultimate := len(this.transactions) - 1
35 |
36 | for i := 0; i < penultimate; i++ {
37 |
38 | transaction = this.transactions[i]
39 |
40 | retBuffer.WriteString(transaction)
41 | retBuffer.WriteString(delimiter)
42 | }
43 | retBuffer.WriteString(this.transactions[penultimate])
44 |
45 | return retBuffer.String()
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/lexerStream.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | type lexerStream struct {
4 | source []rune
5 | position int
6 | length int
7 | }
8 |
9 | func newLexerStream(source string) *lexerStream {
10 |
11 | var ret *lexerStream
12 | var runes []rune
13 |
14 | for _, character := range source {
15 | runes = append(runes, character)
16 | }
17 |
18 | ret = new(lexerStream)
19 | ret.source = runes
20 | ret.length = len(runes)
21 | return ret
22 | }
23 |
24 | func (this *lexerStream) readCharacter() rune {
25 |
26 | var character rune
27 |
28 | character = this.source[this.position]
29 | this.position += 1
30 | return character
31 | }
32 |
33 | func (this *lexerStream) rewind(amount int) {
34 | this.position -= amount
35 | }
36 |
37 | func (this lexerStream) canRead() bool {
38 | return this.position < this.length
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/parameters.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | import (
4 | "errors"
5 | )
6 |
7 | /*
8 | Parameters is a collection of named parameters that can be used by an EvaluableExpression to retrieve parameters
9 | when an expression tries to use them.
10 | */
11 | type Parameters interface {
12 |
13 | /*
14 | Get gets the parameter of the given name, or an error if the parameter is unavailable.
15 | Failure to find the given parameter should be indicated by returning an error.
16 | */
17 | Get(name string) (interface{}, error)
18 | }
19 |
20 | type MapParameters map[string]interface{}
21 |
22 | func (p MapParameters) Get(name string) (interface{}, error) {
23 |
24 | value, found := p[name]
25 |
26 | if !found {
27 | errorMessage := "No parameter '" + name + "' found."
28 | return nil, errors.New(errorMessage)
29 | }
30 |
31 | return value, nil
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Script that runs tests, code coverage, and benchmarks all at once.
4 | # Builds a symlink in /tmp, mostly to avoid messing with GOPATH at the user's shell level.
5 |
6 | TEMPORARY_PATH="/tmp/govaluate_test"
7 | SRC_PATH="${TEMPORARY_PATH}/src"
8 | FULL_PATH="${TEMPORARY_PATH}/src/govaluate"
9 |
10 | # set up temporary directory
11 | rm -rf "${FULL_PATH}"
12 | mkdir -p "${SRC_PATH}"
13 |
14 | ln -s $(pwd) "${FULL_PATH}"
15 | export GOPATH="${TEMPORARY_PATH}"
16 |
17 | pushd "${TEMPORARY_PATH}/src/govaluate"
18 |
19 | # run the actual tests.
20 | export GOVALUATE_TORTURE_TEST="true"
21 | go test -bench=. -benchmem -coverprofile coverage.out
22 | status=$?
23 |
24 | if [ "${status}" != 0 ];
25 | then
26 | exit $status
27 | fi
28 |
29 | # coverage
30 | go tool cover -func=coverage.out
31 |
32 | popd
33 |
--------------------------------------------------------------------------------
/vendor/github.com/Knetic/govaluate/tokenStream.go:
--------------------------------------------------------------------------------
1 | package govaluate
2 |
3 | type tokenStream struct {
4 | tokens []ExpressionToken
5 | index int
6 | tokenLength int
7 | }
8 |
9 | func newTokenStream(tokens []ExpressionToken) *tokenStream {
10 |
11 | var ret *tokenStream
12 |
13 | ret = new(tokenStream)
14 | ret.tokens = tokens
15 | ret.tokenLength = len(tokens)
16 | return ret
17 | }
18 |
19 | func (this *tokenStream) rewind() {
20 | this.index -= 1
21 | }
22 |
23 | func (this *tokenStream) next() ExpressionToken {
24 |
25 | var token ExpressionToken
26 |
27 | token = this.tokens[this.index]
28 |
29 | this.index += 1
30 | return token
31 | }
32 |
33 | func (this tokenStream) hasNext() bool {
34 |
35 | return this.index < this.tokenLength
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-contrib/sse/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | sudo: false
3 | go:
4 | - 1.8.x
5 | - 1.9.x
6 | - 1.10.x
7 | - 1.11.x
8 | - 1.12.x
9 | - master
10 |
11 | git:
12 | depth: 10
13 |
14 | matrix:
15 | fast_finish: true
16 | include:
17 | - go: 1.11.x
18 | env: GO111MODULE=on
19 | - go: 1.12.x
20 | env: GO111MODULE=on
21 |
22 | script:
23 | - go test -v -covermode=count -coverprofile=coverage.out
24 |
25 | after_success:
26 | - bash <(curl -s https://codecov.io/bash)
27 |
--------------------------------------------------------------------------------
/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/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/gin-contrib/sse
2 |
3 | go 1.12
4 |
5 | require github.com/stretchr/testify v1.3.0
6 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-contrib/sse/go.sum:
--------------------------------------------------------------------------------
1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
6 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
7 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
8 |
--------------------------------------------------------------------------------
/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/gin/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/*
2 | !vendor/vendor.json
3 | coverage.out
4 | count.out
5 | test
6 | profile.out
7 | tmp.out
8 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | matrix:
4 | fast_finish: true
5 | include:
6 | - go: 1.11.x
7 | env: GO111MODULE=on
8 | - go: 1.12.x
9 | env: GO111MODULE=on
10 | - go: 1.13.x
11 | - go: 1.13.x
12 | env:
13 | - TESTTAGS=nomsgpack
14 | - go: 1.14.x
15 | - go: 1.14.x
16 | env:
17 | - TESTTAGS=nomsgpack
18 | - go: master
19 |
20 | git:
21 | depth: 10
22 |
23 | before_install:
24 | - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi
25 |
26 | install:
27 | - if [[ "${GO111MODULE}" = "on" ]]; then go mod download; fi
28 | - if [[ "${GO111MODULE}" = "on" ]]; then export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"; fi
29 | - if [[ "${GO111MODULE}" = "on" ]]; then make tools; fi
30 |
31 | go_import_path: github.com/gin-gonic/gin
32 |
33 | script:
34 | - make vet
35 | - make fmt-check
36 | - make misspell-check
37 | - make test
38 |
39 | after_success:
40 | - bash <(curl -s https://codecov.io/bash)
41 |
42 | notifications:
43 | webhooks:
44 | urls:
45 | - https://webhooks.gitter.im/e/7f95bf605c4d356372f4
46 | on_success: change # options: [always|never|change] default: always
47 | on_failure: always # options: [always|never|change] default: always
48 | on_start: false # default: false
49 |
--------------------------------------------------------------------------------
/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/header.go:
--------------------------------------------------------------------------------
1 | package binding
2 |
3 | import (
4 | "net/http"
5 | "net/textproto"
6 | "reflect"
7 | )
8 |
9 | type headerBinding struct{}
10 |
11 | func (headerBinding) Name() string {
12 | return "header"
13 | }
14 |
15 | func (headerBinding) Bind(req *http.Request, obj interface{}) error {
16 |
17 | if err := mapHeader(obj, req.Header); err != nil {
18 | return err
19 | }
20 |
21 | return validate(obj)
22 | }
23 |
24 | func mapHeader(ptr interface{}, h map[string][]string) error {
25 | return mappingByPtr(ptr, headerSource(h), "header")
26 | }
27 |
28 | type headerSource map[string][]string
29 |
30 | var _ setter = headerSource(nil)
31 |
32 | func (hs headerSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string, opt setOptions) (isSetted bool, err error) {
33 | return setByForm(value, field, hs, textproto.CanonicalMIMEHeaderKey(tagValue), opt)
34 | }
35 |
--------------------------------------------------------------------------------
/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 | // +build !nomsgpack
6 |
7 | package binding
8 |
9 | import (
10 | "bytes"
11 | "io"
12 | "net/http"
13 |
14 | "github.com/ugorji/go/codec"
15 | )
16 |
17 | type msgpackBinding struct{}
18 |
19 | func (msgpackBinding) Name() string {
20 | return "msgpack"
21 | }
22 |
23 | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error {
24 | return decodeMsgPack(req.Body, obj)
25 | }
26 |
27 | func (msgpackBinding) BindBody(body []byte, obj interface{}) error {
28 | return decodeMsgPack(bytes.NewReader(body), obj)
29 | }
30 |
31 | func decodeMsgPack(r io.Reader, obj interface{}) error {
32 | cdc := new(codec.MsgpackHandle)
33 | if err := codec.NewDecoder(r, cdc).Decode(&obj); err != nil {
34 | return err
35 | }
36 | return validate(obj)
37 | }
38 |
--------------------------------------------------------------------------------
/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_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/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.com/ 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 | go 1.13
4 |
5 | require (
6 | github.com/gin-contrib/sse v0.1.0
7 | github.com/go-playground/validator/v10 v10.2.0
8 | github.com/golang/protobuf v1.3.3
9 | github.com/json-iterator/go v1.1.9
10 | github.com/mattn/go-isatty v0.0.12
11 | github.com/stretchr/testify v1.4.0
12 | github.com/ugorji/go/codec v1.1.7
13 | gopkg.in/yaml.v2 v2.2.8
14 | )
15 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/internal/bytesconv/bytesconv.go:
--------------------------------------------------------------------------------
1 | package bytesconv
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | // StringToBytes converts string to byte slice without a memory allocation.
9 | func StringToBytes(s string) (b []byte) {
10 | sh := *(*reflect.StringHeader)(unsafe.Pointer(&s))
11 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
12 | bh.Data, bh.Len, bh.Cap = sh.Data, sh.Len, sh.Len
13 | return b
14 | }
15 |
16 | // BytesToString converts byte slice to string without a memory allocation.
17 | func BytesToString(b []byte) string {
18 | return *(*string)(unsafe.Pointer(&b))
19 | }
20 |
--------------------------------------------------------------------------------
/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 | // Unmarshal is exported by gin/json package.
15 | Unmarshal = json.Unmarshal
16 | // MarshalIndent is exported by gin/json package.
17 | MarshalIndent = json.MarshalIndent
18 | // NewDecoder is exported by gin/json package.
19 | NewDecoder = json.NewDecoder
20 | // NewEncoder is exported by gin/json package.
21 | NewEncoder = json.NewEncoder
22 | )
23 |
--------------------------------------------------------------------------------
/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 | // Unmarshal is exported by gin/json package.
16 | Unmarshal = json.Unmarshal
17 | // MarshalIndent is exported by gin/json package.
18 | MarshalIndent = json.MarshalIndent
19 | // NewDecoder is exported by gin/json package.
20 | NewDecoder = json.NewDecoder
21 | // NewEncoder is exported by gin/json package.
22 | NewEncoder = json.NewEncoder
23 | )
24 |
--------------------------------------------------------------------------------
/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/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 | // +build !nomsgpack
6 |
7 | package render
8 |
9 | import (
10 | "net/http"
11 |
12 | "github.com/ugorji/go/codec"
13 | )
14 |
15 | var (
16 | _ Render = MsgPack{}
17 | )
18 |
19 | // MsgPack contains the given interface object.
20 | type MsgPack struct {
21 | Data interface{}
22 | }
23 |
24 | var msgpackContentType = []string{"application/msgpack; charset=utf-8"}
25 |
26 | // WriteContentType (MsgPack) writes MsgPack ContentType.
27 | func (r MsgPack) WriteContentType(w http.ResponseWriter) {
28 | writeContentType(w, msgpackContentType)
29 | }
30 |
31 | // Render (MsgPack) encodes the given interface object and writes data with custom ContentType.
32 | func (r MsgPack) Render(w http.ResponseWriter) error {
33 | return WriteMsgPack(w, r.Data)
34 | }
35 |
36 | // WriteMsgPack writes MsgPack ContentType and encodes the given interface object.
37 | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error {
38 | writeContentType(w, msgpackContentType)
39 | var mh codec.MsgpackHandle
40 | return codec.NewEncoder(w, &mh).Encode(obj)
41 | }
42 |
--------------------------------------------------------------------------------
/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 | _, err = w.Write(bytes)
30 | return err
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 | if r.ContentLength >= 0 {
25 | if r.Headers == nil {
26 | r.Headers = map[string]string{}
27 | }
28 | r.Headers["Content-Length"] = strconv.FormatInt(r.ContentLength, 10)
29 | }
30 | r.writeHeaders(w, r.Headers)
31 | _, err = io.Copy(w, r.Reader)
32 | return
33 | }
34 |
35 | // WriteContentType (Reader) writes custom ContentType.
36 | func (r Reader) WriteContentType(w http.ResponseWriter) {
37 | writeContentType(w, []string{r.ContentType})
38 | }
39 |
40 | // writeHeaders writes custom Header.
41 | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string]string) {
42 | header := w.Header()
43 | for k, v := range headers {
44 | if header.Get(k) == "" {
45 | header.Set(k, v)
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/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 | if (r.Code < http.StatusMultipleChoices || r.Code > http.StatusPermanentRedirect) && r.Code != http.StatusCreated {
22 | panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code))
23 | }
24 | http.Redirect(w, r.Request, r.Location, r.Code)
25 | return nil
26 | }
27 |
28 | // WriteContentType (Redirect) don't write any ContentType.
29 | func (r Redirect) WriteContentType(http.ResponseWriter) {}
30 |
--------------------------------------------------------------------------------
/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 = Reader{}
31 | _ Render = AsciiJSON{}
32 | _ Render = ProtoBuf{}
33 | )
34 |
35 | func writeContentType(w http.ResponseWriter, value []string) {
36 | header := w.Header()
37 | if val := header["Content-Type"]; len(val) == 0 {
38 | header["Content-Type"] = value
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/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 | return WriteString(w, r.Format, r.Data)
24 | }
25 |
26 | // WriteContentType (String) writes Plain ContentType.
27 | func (r String) WriteContentType(w http.ResponseWriter) {
28 | writeContentType(w, plainContentType)
29 | }
30 |
31 | // WriteString writes data according to its format and write custom ContentType.
32 | func WriteString(w http.ResponseWriter, format string, data []interface{}) (err error) {
33 | writeContentType(w, plainContentType)
34 | if len(data) > 0 {
35 | _, err = fmt.Fprintf(w, format, data...)
36 | return
37 | }
38 | _, err = io.WriteString(w, format)
39 | return
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 | _, err = w.Write(bytes)
30 | return err
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/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/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.6.3"
9 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/locales/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 | *.test
24 | *.prof
25 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/locales/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.13.1
4 | - tip
5 | matrix:
6 | allow_failures:
7 | - go: tip
8 |
9 | notifications:
10 | email:
11 | recipients: dean.karn@gmail.com
12 | on_success: change
13 | on_failure: always
14 |
15 | before_install:
16 | - go install github.com/mattn/goveralls
17 |
18 | # Only clone the most recent commit.
19 | git:
20 | depth: 1
21 |
22 | script:
23 | - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./...
24 |
25 | after_success: |
26 | goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/locales/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Go Playground
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/locales/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/go-playground/locales
2 |
3 | go 1.13
4 |
5 | require golang.org/x/text v0.3.2
6 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/locales/go.sum:
--------------------------------------------------------------------------------
1 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
2 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
3 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
4 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/locales/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/go-playground/locales/logo.png
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/universal-translator/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 | *.test
24 | *.prof
25 | *.coverprofile
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/universal-translator/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.13.4
4 | - tip
5 | matrix:
6 | allow_failures:
7 | - go: tip
8 |
9 | notifications:
10 | email:
11 | recipients: dean.karn@gmail.com
12 | on_success: change
13 | on_failure: always
14 |
15 | before_install:
16 | - go install github.com/mattn/goveralls
17 |
18 | # Only clone the most recent commit.
19 | git:
20 | depth: 1
21 |
22 | script:
23 | - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./...
24 |
25 | after_success: |
26 | [ $TRAVIS_GO_VERSION = 1.13.4 ] &&
27 | goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/universal-translator/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Go Playground
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/go-playground/universal-translator/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/go-playground/universal-translator
2 |
3 | go 1.13
4 |
5 | require github.com/go-playground/locales v0.13.0
6 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/universal-translator/go.sum:
--------------------------------------------------------------------------------
1 | github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
2 | github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
3 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
4 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
5 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/universal-translator/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/go-playground/universal-translator/logo.png
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/validator/v10/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 | *.test
24 | *.prof
25 | *.test
26 | *.out
27 | *.txt
28 | cover.html
29 | README.html
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/validator/v10/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.13.4
4 | - tip
5 | matrix:
6 | allow_failures:
7 | - go: tip
8 |
9 | notifications:
10 | email:
11 | recipients: dean.karn@gmail.com
12 | on_success: change
13 | on_failure: always
14 |
15 | before_install:
16 | - go install github.com/mattn/goveralls
17 | - mkdir -p $GOPATH/src/gopkg.in
18 | - ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/validator.v9
19 |
20 | # Only clone the most recent commit.
21 | git:
22 | depth: 1
23 |
24 | script:
25 | - go test -v -race -covermode=atomic -coverprofile=coverage.coverprofile ./...
26 |
27 | after_success: |
28 | [ $TRAVIS_GO_VERSION = 1.13.4 ] &&
29 | goveralls -coverprofile=coverage.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/validator/v10/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/github.com/go-playground/validator/v10/Makefile:
--------------------------------------------------------------------------------
1 | GOCMD=GO111MODULE=on go
2 |
3 | linters-install:
4 | @golangci-lint --version >/dev/null 2>&1 || { \
5 | echo "installing linting tools..."; \
6 | curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0; \
7 | }
8 |
9 | lint: linters-install
10 | $(PWD)/bin/golangci-lint run
11 |
12 | test:
13 | $(GOCMD) test -cover -race ./...
14 |
15 | bench:
16 | $(GOCMD) test -bench=. -benchmem ./...
17 |
18 | .PHONY: test lint linters-install
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/validator/v10/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/go-playground/validator/v10
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/go-playground/assert/v2 v2.0.1
7 | github.com/go-playground/locales v0.13.0
8 | github.com/go-playground/universal-translator v0.17.0
9 | github.com/leodido/go-urn v1.2.0
10 | )
11 |
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/validator/v10/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/go-playground/validator/v10/logo.png
--------------------------------------------------------------------------------
/vendor/github.com/go-playground/validator/v10/translations.go:
--------------------------------------------------------------------------------
1 | package validator
2 |
3 | import ut "github.com/go-playground/universal-translator"
4 |
5 | // TranslationFunc is the function type used to register or override
6 | // custom translations
7 | type TranslationFunc func(ut ut.Translator, fe FieldError) string
8 |
9 | // RegisterTranslationsFunc allows for registering of translations
10 | // for a 'ut.Translator' for use within the 'TranslationFunc'
11 | type RegisterTranslationsFunc func(ut ut.Translator) error
12 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/.codecov.yml:
--------------------------------------------------------------------------------
1 | ignore:
2 | - "output_tests/.*"
3 |
4 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /bug_test.go
3 | /coverage.txt
4 | /.idea
5 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.8.x
5 | - 1.x
6 |
7 | before_install:
8 | - go get -t -v ./...
9 |
10 | script:
11 | - ./test.sh
12 |
13 | after_success:
14 | - bash <(curl -s https://codecov.io/bash)
15 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/Gopkg.lock:
--------------------------------------------------------------------------------
1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
2 |
3 |
4 | [[projects]]
5 | name = "github.com/modern-go/concurrent"
6 | packages = ["."]
7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a"
8 | version = "1.0.0"
9 |
10 | [[projects]]
11 | name = "github.com/modern-go/reflect2"
12 | packages = ["."]
13 | revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
14 | version = "1.0.1"
15 |
16 | [solve-meta]
17 | analyzer-name = "dep"
18 | analyzer-version = 1
19 | inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8"
20 | solver-name = "gps-cdcl"
21 | solver-version = 1
22 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/Gopkg.toml:
--------------------------------------------------------------------------------
1 | # Gopkg.toml example
2 | #
3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
4 | # for detailed Gopkg.toml documentation.
5 | #
6 | # required = ["github.com/user/thing/cmd/thing"]
7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8 | #
9 | # [[constraint]]
10 | # name = "github.com/user/project"
11 | # version = "1.0.0"
12 | #
13 | # [[constraint]]
14 | # name = "github.com/user/project2"
15 | # branch = "dev"
16 | # source = "github.com/myfork/project2"
17 | #
18 | # [[override]]
19 | # name = "github.com/x/y"
20 | # version = "2.4.0"
21 |
22 | ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"]
23 |
24 | [[constraint]]
25 | name = "github.com/modern-go/reflect2"
26 | version = "1.0.1"
27 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 json-iterator
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/json-iterator/go/any_nil.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | type nilAny struct {
4 | baseAny
5 | }
6 |
7 | func (any *nilAny) LastError() error {
8 | return nil
9 | }
10 |
11 | func (any *nilAny) ValueType() ValueType {
12 | return NilValue
13 | }
14 |
15 | func (any *nilAny) MustBeValid() Any {
16 | return any
17 | }
18 |
19 | func (any *nilAny) ToBool() bool {
20 | return false
21 | }
22 |
23 | func (any *nilAny) ToInt() int {
24 | return 0
25 | }
26 |
27 | func (any *nilAny) ToInt32() int32 {
28 | return 0
29 | }
30 |
31 | func (any *nilAny) ToInt64() int64 {
32 | return 0
33 | }
34 |
35 | func (any *nilAny) ToUint() uint {
36 | return 0
37 | }
38 |
39 | func (any *nilAny) ToUint32() uint32 {
40 | return 0
41 | }
42 |
43 | func (any *nilAny) ToUint64() uint64 {
44 | return 0
45 | }
46 |
47 | func (any *nilAny) ToFloat32() float32 {
48 | return 0
49 | }
50 |
51 | func (any *nilAny) ToFloat64() float64 {
52 | return 0
53 | }
54 |
55 | func (any *nilAny) ToString() string {
56 | return ""
57 | }
58 |
59 | func (any *nilAny) WriteTo(stream *Stream) {
60 | stream.WriteNil()
61 | }
62 |
63 | func (any *nilAny) Parse() *Iterator {
64 | return nil
65 | }
66 |
67 | func (any *nilAny) GetInterface() interface{} {
68 | return nil
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | set -x
4 |
5 | if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then
6 | mkdir -p /tmp/build-golang/src/github.com/json-iterator
7 | ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go
8 | fi
9 | export GOPATH=/tmp/build-golang
10 | go get -u github.com/golang/dep/cmd/dep
11 | cd /tmp/build-golang/src/github.com/json-iterator/go
12 | exec $GOPATH/bin/dep ensure -update
13 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md:
--------------------------------------------------------------------------------
1 | | json type \ dest type | bool | int | uint | float |string|
2 | | --- | --- | --- | --- |--|--|
3 | | number | positive => true
negative => true
zero => false| 23.2 => 23
-32.1 => -32| 12.1 => 12
-12.1 => 0|as normal|same as origin|
4 | | string | empty string => false
string "0" => false
other strings => true | "123.32" => 123
"-123.4" => -123
"123.23xxxw" => 123
"abcde12" => 0
"-32.1" => -32| 13.2 => 13
-1.1 => 0 |12.1 => 12.1
-12.3 => -12.3
12.4xxa => 12.4
+1.1e2 =>110 |same as origin|
5 | | bool | true => true
false => false| true => 1
false => 0 | true => 1
false => 0 |true => 1
false => 0|true => "true"
false => "false"|
6 | | object | true | 0 | 0 |0|originnal json|
7 | | array | empty array => false
nonempty array => true| [] => 0
[1,2] => 1 | [] => 0
[1,2] => 1 |[] => 0
[1,2] => 1|original json|
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/json-iterator/go
2 |
3 | go 1.12
4 |
5 | require (
6 | github.com/davecgh/go-spew v1.1.1
7 | github.com/google/gofuzz v1.0.0
8 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
9 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
10 | github.com/stretchr/testify v1.3.0
11 | )
12 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/go.sum:
--------------------------------------------------------------------------------
1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4 | github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
5 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
6 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
7 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
8 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
9 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
10 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
11 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
12 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
13 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
14 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
15 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/jsoniter.go:
--------------------------------------------------------------------------------
1 | // Package jsoniter implements encoding and decoding of JSON as defined in
2 | // RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json.
3 | // Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter
4 | // and variable type declarations (if any).
5 | // jsoniter interfaces gives 100% compatibility with code using standard lib.
6 | //
7 | // "JSON and Go"
8 | // (https://golang.org/doc/articles/json_and_go.html)
9 | // gives a description of how Marshal/Unmarshal operate
10 | // between arbitrary or predefined json objects and bytes,
11 | // and it applies to jsoniter.Marshal/Unmarshal as well.
12 | //
13 | // Besides, jsoniter.Iterator provides a different set of interfaces
14 | // iterating given bytes/string/reader
15 | // and yielding parsed elements one by one.
16 | // This set of interfaces reads input as required and gives
17 | // better performance.
18 | package jsoniter
19 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/pool.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "io"
5 | )
6 |
7 | // IteratorPool a thread safe pool of iterators with same configuration
8 | type IteratorPool interface {
9 | BorrowIterator(data []byte) *Iterator
10 | ReturnIterator(iter *Iterator)
11 | }
12 |
13 | // StreamPool a thread safe pool of streams with same configuration
14 | type StreamPool interface {
15 | BorrowStream(writer io.Writer) *Stream
16 | ReturnStream(stream *Stream)
17 | }
18 |
19 | func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream {
20 | stream := cfg.streamPool.Get().(*Stream)
21 | stream.Reset(writer)
22 | return stream
23 | }
24 |
25 | func (cfg *frozenConfig) ReturnStream(stream *Stream) {
26 | stream.out = nil
27 | stream.Error = nil
28 | stream.Attachment = nil
29 | cfg.streamPool.Put(stream)
30 | }
31 |
32 | func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator {
33 | iter := cfg.iteratorPool.Get().(*Iterator)
34 | iter.ResetBytes(data)
35 | return iter
36 | }
37 |
38 | func (cfg *frozenConfig) ReturnIterator(iter *Iterator) {
39 | iter.Error = nil
40 | iter.Attachment = nil
41 | cfg.iteratorPool.Put(iter)
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/test.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 | echo "" > coverage.txt
5 |
6 | for d in $(go list ./... | grep -v vendor); do
7 | go test -coverprofile=profile.out -coverpkg=github.com/json-iterator/go $d
8 | if [ -f profile.out ]; then
9 | cat profile.out >> coverage.txt
10 | rm profile.out
11 | fi
12 | done
13 |
--------------------------------------------------------------------------------
/vendor/github.com/leodido/go-urn/.gitignore:
--------------------------------------------------------------------------------
1 | *.exe
2 | *.dll
3 | *.so
4 | *.dylib
5 |
6 | *.test
7 |
8 | *.out
9 | *.txt
10 |
11 | vendor/
--------------------------------------------------------------------------------
/vendor/github.com/leodido/go-urn/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.9.x
5 | - 1.10.x
6 | - 1.11.x
7 | - 1.12.x
8 | - 1.13.x
9 | - tip
10 |
11 | before_install:
12 | - go get -t -v ./...
13 |
14 | script:
15 | - go test -race -coverprofile=coverage.txt -covermode=atomic
16 |
17 | after_success:
18 | - bash <(curl -s https://codecov.io/bash)
--------------------------------------------------------------------------------
/vendor/github.com/leodido/go-urn/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Leonardo Di Donato
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/leodido/go-urn/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/leodido/go-urn
2 |
3 | go 1.13
4 |
5 | require github.com/stretchr/testify v1.4.0
6 |
--------------------------------------------------------------------------------
/vendor/github.com/leodido/go-urn/go.sum:
--------------------------------------------------------------------------------
1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
6 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
7 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
8 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
9 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
10 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
11 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
12 |
--------------------------------------------------------------------------------
/vendor/github.com/leodido/go-urn/makefile:
--------------------------------------------------------------------------------
1 | SHELL := /bin/bash
2 |
3 | build: machine.go
4 |
5 | images: docs/urn.png
6 |
7 | machine.go: machine.go.rl
8 | ragel -Z -G2 -e -o $@ $<
9 | @sed -i '/^\/\/line/d' $@
10 | @$(MAKE) -s file=$@ snake2camel
11 | @gofmt -w -s $@
12 |
13 | docs/urn.dot: machine.go.rl
14 | @mkdir -p docs
15 | ragel -Z -e -Vp $< -o $@
16 |
17 | docs/urn.png: docs/urn.dot
18 | dot $< -Tpng -o $@
19 |
20 | .PHONY: bench
21 | bench: *_test.go machine.go
22 | go test -bench=. -benchmem -benchtime=5s ./...
23 |
24 | .PHONY: tests
25 | tests: *_test.go machine.go
26 | go test -race -timeout 10s -coverprofile=coverage.out -covermode=atomic -v ./...
27 |
28 | .PHONY: clean
29 | clean:
30 | @rm -rf docs
31 | @rm -f machine.go
32 |
33 | .PHONY: snake2camel
34 | snake2camel:
35 | @awk -i inplace '{ \
36 | while ( match($$0, /(.*)([a-z]+[0-9]*)_([a-zA-Z0-9])(.*)/, cap) ) \
37 | $$0 = cap[1] cap[2] toupper(cap[3]) cap[4]; \
38 | print \
39 | }' $(file)
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | sudo: false
3 | go:
4 | - 1.13.x
5 | - tip
6 |
7 | before_install:
8 | - go get -t -v ./...
9 |
10 | script:
11 | - ./go.test.sh
12 |
13 | after_success:
14 | - bash <(curl -s https://codecov.io/bash)
15 |
--------------------------------------------------------------------------------
/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 | [](http://godoc.org/github.com/mattn/go-isatty)
4 | [](https://codecov.io/gh/mattn/go-isatty)
5 | [](https://coveralls.io/github/mattn/go-isatty?branch=master)
6 | [](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/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/mattn/go-isatty
2 |
3 | go 1.12
4 |
5 | require golang.org/x/sys v0.0.0-20200116001909-b77594299b42
6 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/go.sum:
--------------------------------------------------------------------------------
1 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
2 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
3 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/go.test.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 | echo "" > coverage.txt
5 |
6 | for d in $(go list ./... | grep -v vendor); do
7 | go test -race -coverprofile=profile.out -covermode=atomic "$d"
8 | if [ -f profile.out ]; then
9 | cat profile.out >> coverage.txt
10 | rm profile.out
11 | fi
12 | done
13 |
--------------------------------------------------------------------------------
/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 "golang.org/x/sys/unix"
7 |
8 | // IsTerminal return true if the file descriptor is terminal.
9 | func IsTerminal(fd uintptr) bool {
10 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA)
11 | return err == nil
12 | }
13 |
14 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
15 | // terminal. This is also always false on this environment.
16 | func IsCygwinTerminal(fd uintptr) bool {
17 | return false
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/isatty_others.go:
--------------------------------------------------------------------------------
1 | // +build appengine js nacl
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_plan9.go:
--------------------------------------------------------------------------------
1 | // +build plan9
2 |
3 | package isatty
4 |
5 | import (
6 | "syscall"
7 | )
8 |
9 | // IsTerminal returns true if the given file descriptor is a terminal.
10 | func IsTerminal(fd uintptr) bool {
11 | path, err := syscall.Fd2path(int(fd))
12 | if err != nil {
13 | return false
14 | }
15 | return path == "/dev/cons" || path == "/mnt/term/dev/cons"
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/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/mattn/go-isatty/isatty_tcgets.go:
--------------------------------------------------------------------------------
1 | // +build linux aix
2 | // +build !appengine
3 |
4 | package isatty
5 |
6 | import "golang.org/x/sys/unix"
7 |
8 | // IsTerminal return true if the file descriptor is terminal.
9 | func IsTerminal(fd uintptr) bool {
10 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
11 | return err == nil
12 | }
13 |
14 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
15 | // terminal. This is also always false on this environment.
16 | func IsCygwinTerminal(fd uintptr) bool {
17 | return false
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:base"
4 | ],
5 | "postUpdateOptions": [
6 | "gomodTidy"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/README.md:
--------------------------------------------------------------------------------
1 | # concurrent
2 | concurrency utilities
3 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/executor.go:
--------------------------------------------------------------------------------
1 | package concurrent
2 |
3 | import "context"
4 |
5 | type Executor interface {
6 | Go(handler func(ctx context.Context))
7 | }
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/go_above_19.go:
--------------------------------------------------------------------------------
1 | //+build go1.9
2 |
3 | package concurrent
4 |
5 | import "sync"
6 |
7 | type Map struct {
8 | sync.Map
9 | }
10 |
11 | func NewMap() *Map {
12 | return &Map{}
13 | }
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/go_below_19.go:
--------------------------------------------------------------------------------
1 | //+build !go1.9
2 |
3 | package concurrent
4 |
5 | import "sync"
6 |
7 | type Map struct {
8 | lock sync.RWMutex
9 | data map[interface{}]interface{}
10 | }
11 |
12 | func NewMap() *Map {
13 | return &Map{
14 | data: make(map[interface{}]interface{}, 32),
15 | }
16 | }
17 |
18 | func (m *Map) Load(key interface{}) (elem interface{}, found bool) {
19 | m.lock.RLock()
20 | elem, found = m.data[key]
21 | m.lock.RUnlock()
22 | return
23 | }
24 |
25 | func (m *Map) Store(key interface{}, elem interface{}) {
26 | m.lock.Lock()
27 | m.data[key] = elem
28 | m.lock.Unlock()
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /coverage.txt
3 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.8.x
5 | - 1.x
6 |
7 | before_install:
8 | - go get -t -v ./...
9 | - go get -t -v github.com/modern-go/reflect2-tests/...
10 |
11 | script:
12 | - ./test.sh
13 |
14 | after_success:
15 | - bash <(curl -s https://codecov.io/bash)
16 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/Gopkg.lock:
--------------------------------------------------------------------------------
1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
2 |
3 |
4 | [[projects]]
5 | name = "github.com/modern-go/concurrent"
6 | packages = ["."]
7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a"
8 | version = "1.0.0"
9 |
10 | [solve-meta]
11 | analyzer-name = "dep"
12 | analyzer-version = 1
13 | inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7"
14 | solver-name = "gps-cdcl"
15 | solver-version = 1
16 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/Gopkg.toml:
--------------------------------------------------------------------------------
1 | # Gopkg.toml example
2 | #
3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4 | # for detailed Gopkg.toml documentation.
5 | #
6 | # required = ["github.com/user/thing/cmd/thing"]
7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8 | #
9 | # [[constraint]]
10 | # name = "github.com/user/project"
11 | # version = "1.0.0"
12 | #
13 | # [[constraint]]
14 | # name = "github.com/user/project2"
15 | # branch = "dev"
16 | # source = "github.com/myfork/project2"
17 | #
18 | # [[override]]
19 | # name = "github.com/x/y"
20 | # version = "2.4.0"
21 | #
22 | # [prune]
23 | # non-go = false
24 | # go-tests = true
25 | # unused-packages = true
26 |
27 | ignored = []
28 |
29 | [[constraint]]
30 | name = "github.com/modern-go/concurrent"
31 | version = "1.0.0"
32 |
33 | [prune]
34 | go-tests = true
35 | unused-packages = true
36 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/go_above_17.go:
--------------------------------------------------------------------------------
1 | //+build go1.7
2 |
3 | package reflect2
4 |
5 | import "unsafe"
6 |
7 | //go:linkname resolveTypeOff reflect.resolveTypeOff
8 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer
9 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/go_above_19.go:
--------------------------------------------------------------------------------
1 | //+build go1.9
2 |
3 | package reflect2
4 |
5 | import (
6 | "unsafe"
7 | )
8 |
9 | //go:linkname makemap reflect.makemap
10 | func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer)
11 |
12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer {
13 | return makemap(rtype, cap)
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/go_below_17.go:
--------------------------------------------------------------------------------
1 | //+build !go1.7
2 |
3 | package reflect2
4 |
5 | import "unsafe"
6 |
7 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
8 | return nil
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/go_below_19.go:
--------------------------------------------------------------------------------
1 | //+build !go1.9
2 |
3 | package reflect2
4 |
5 | import (
6 | "unsafe"
7 | )
8 |
9 | //go:linkname makemap reflect.makemap
10 | func makemap(rtype unsafe.Pointer) (m unsafe.Pointer)
11 |
12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer {
13 | return makemap(rtype)
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/reflect2_amd64.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/reflect2_amd64.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/reflect2_kind.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | // DefaultTypeOfKind return the non aliased default type for the kind
9 | func DefaultTypeOfKind(kind reflect.Kind) Type {
10 | return kindTypes[kind]
11 | }
12 |
13 | var kindTypes = map[reflect.Kind]Type{
14 | reflect.Bool: TypeOf(true),
15 | reflect.Uint8: TypeOf(uint8(0)),
16 | reflect.Int8: TypeOf(int8(0)),
17 | reflect.Uint16: TypeOf(uint16(0)),
18 | reflect.Int16: TypeOf(int16(0)),
19 | reflect.Uint32: TypeOf(uint32(0)),
20 | reflect.Int32: TypeOf(int32(0)),
21 | reflect.Uint64: TypeOf(uint64(0)),
22 | reflect.Int64: TypeOf(int64(0)),
23 | reflect.Uint: TypeOf(uint(0)),
24 | reflect.Int: TypeOf(int(0)),
25 | reflect.Float32: TypeOf(float32(0)),
26 | reflect.Float64: TypeOf(float64(0)),
27 | reflect.Uintptr: TypeOf(uintptr(0)),
28 | reflect.String: TypeOf(""),
29 | reflect.UnsafePointer: TypeOf(unsafe.Pointer(nil)),
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_386.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_386.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_arm.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_arm.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_arm64.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_arm64.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_s390x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/modern-go/reflect2/relfect2_s390x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/safe_struct.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | type safeStructType struct {
4 | safeType
5 | }
6 |
7 | func (type2 *safeStructType) FieldByName(name string) StructField {
8 | field, found := type2.Type.FieldByName(name)
9 | if !found {
10 | panic("field " + name + " not found")
11 | }
12 | return &safeField{StructField: field}
13 | }
14 |
15 | func (type2 *safeStructType) Field(i int) StructField {
16 | return &safeField{StructField: type2.Type.Field(i)}
17 | }
18 |
19 | func (type2 *safeStructType) FieldByIndex(index []int) StructField {
20 | return &safeField{StructField: type2.Type.FieldByIndex(index)}
21 | }
22 |
23 | func (type2 *safeStructType) FieldByNameFunc(match func(string) bool) StructField {
24 | field, found := type2.Type.FieldByNameFunc(match)
25 | if !found {
26 | panic("field match condition not found in " + type2.Type.String())
27 | }
28 | return &safeField{StructField: field}
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/test.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 | echo "" > coverage.txt
5 |
6 | for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do
7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d
8 | if [ -f profile.out ]; then
9 | cat profile.out >> coverage.txt
10 | rm profile.out
11 | fi
12 | done
13 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/unsafe_ptr.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type UnsafePtrType struct {
9 | unsafeType
10 | }
11 |
12 | func newUnsafePtrType(cfg *frozenConfig, type1 reflect.Type) *UnsafePtrType {
13 | return &UnsafePtrType{
14 | unsafeType: *newUnsafeType(cfg, type1),
15 | }
16 | }
17 |
18 | func (type2 *UnsafePtrType) IsNil(obj interface{}) bool {
19 | if obj == nil {
20 | return true
21 | }
22 | objEFace := unpackEFace(obj)
23 | assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
24 | return type2.UnsafeIsNil(objEFace.data)
25 | }
26 |
27 | func (type2 *UnsafePtrType) UnsafeIsNil(ptr unsafe.Pointer) bool {
28 | if ptr == nil {
29 | return true
30 | }
31 | return *(*unsafe.Pointer)(ptr) == nil
32 | }
33 |
34 | func (type2 *UnsafePtrType) LikePtr() bool {
35 | return true
36 | }
37 |
38 | func (type2 *UnsafePtrType) Indirect(obj interface{}) interface{} {
39 | objEFace := unpackEFace(obj)
40 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
41 | return type2.UnsafeIndirect(objEFace.data)
42 | }
43 |
44 | func (type2 *UnsafePtrType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
45 | return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/0_importpath.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 | package codec // import "github.com/ugorji/go/codec"
5 |
6 | // This establishes that this package must be imported as github.com/ugorji/go/codec.
7 | // It makes forking easier, and plays well with pre-module releases of go.
8 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012-2015 Ugorji Nwoke.
4 | All rights reserved.
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/codecgen.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/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 | require (
4 | github.com/ugorji/go v1.1.7
5 | )
6 |
--------------------------------------------------------------------------------
/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_fmt_time_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 "time"
9 |
10 | func fmtTime(t time.Time, b []byte) []byte {
11 | return t.AppendFormat(b, time.RFC3339Nano)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_fmt_time_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 "time"
9 |
10 | func fmtTime(t time.Time, b []byte) []byte {
11 | s := t.Format(time.RFC3339Nano)
12 | b = b[:len(s)]
13 | copy(b, s)
14 | return b
15 | }
16 |
--------------------------------------------------------------------------------
/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_maprange_gte_go112.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.12
5 | // +build safe
6 |
7 | package codec
8 |
9 | import "reflect"
10 |
11 | type mapIter struct {
12 | t *reflect.MapIter
13 | m reflect.Value
14 | values bool
15 | }
16 |
17 | func (t *mapIter) ValidKV() (r bool) {
18 | return true
19 | }
20 |
21 | func (t *mapIter) Next() (r bool) {
22 | return t.t.Next()
23 | }
24 |
25 | func (t *mapIter) Key() reflect.Value {
26 | return t.t.Key()
27 | }
28 |
29 | func (t *mapIter) Value() (r reflect.Value) {
30 | if t.values {
31 | return t.t.Value()
32 | }
33 | return
34 | }
35 |
36 | func (t *mapIter) Done() {}
37 |
38 | func mapRange(t *mapIter, m, k, v reflect.Value, values bool) {
39 | *t = mapIter{
40 | m: m,
41 | t: m.MapRange(),
42 | values: values,
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_maprange_lt_go112.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.12
5 | // +build !go1.7 safe
6 |
7 | package codec
8 |
9 | import "reflect"
10 |
11 | type mapIter struct {
12 | m reflect.Value
13 | keys []reflect.Value
14 | j int
15 | values bool
16 | }
17 |
18 | func (t *mapIter) ValidKV() (r bool) {
19 | return true
20 | }
21 |
22 | func (t *mapIter) Next() (r bool) {
23 | t.j++
24 | return t.j < len(t.keys)
25 | }
26 |
27 | func (t *mapIter) Key() reflect.Value {
28 | return t.keys[t.j]
29 | }
30 |
31 | func (t *mapIter) Value() (r reflect.Value) {
32 | if t.values {
33 | return t.m.MapIndex(t.keys[t.j])
34 | }
35 | return
36 | }
37 |
38 | func (t *mapIter) Done() {}
39 |
40 | func mapRange(t *mapIter, m, k, v reflect.Value, values bool) {
41 | *t = mapIter{
42 | m: m,
43 | keys: m.MapKeys(),
44 | values: values,
45 | j: -1,
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/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/github.com/ugorji/go/codec/helper.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyhackvip/risk_engine/27ec096b7e867fd7f3bf77f30147867a5c9f1dda/vendor/github.com/ugorji/go/codec/helper.s
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/.gitignore:
--------------------------------------------------------------------------------
1 | _obj/
2 | unix.test
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/aliases.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 | // +build go1.9
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | type Signal = syscall.Signal
13 | type Errno = syscall.Errno
14 | type SysProcAttr = syscall.SysProcAttr
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go
11 | //
12 |
13 | TEXT ·syscall6(SB),NOSPLIT,$0-88
14 | JMP syscall·syscall6(SB)
15 |
16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88
17 | JMP syscall·rawSyscall6(SB)
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_darwin_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for 386, Darwin
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, Darwin
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_darwin_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 | // +build arm,darwin
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System call support for ARM, Darwin
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-28
18 | B syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
21 | B syscall·Syscall6(SB)
22 |
23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
24 | B syscall·Syscall9(SB)
25 |
26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
27 | B syscall·RawSyscall(SB)
28 |
29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
30 | B syscall·RawSyscall6(SB)
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 | // +build arm64,darwin
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System call support for AMD64, Darwin
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | B syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | B syscall·Syscall6(SB)
22 |
23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
24 | B syscall·Syscall9(SB)
25 |
26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
27 | B syscall·RawSyscall(SB)
28 |
29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
30 | B syscall·RawSyscall6(SB)
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, DragonFly
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_freebsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for 386, FreeBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, FreeBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM, FreeBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM64, FreeBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for arm, Linux
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
23 | BL runtime·entersyscall(SB)
24 | MOVW trap+0(FP), R7
25 | MOVW a1+4(FP), R0
26 | MOVW a2+8(FP), R1
27 | MOVW a3+12(FP), R2
28 | MOVW $0, R3
29 | MOVW $0, R4
30 | MOVW $0, R5
31 | SWI $0
32 | MOVW R0, r1+16(FP)
33 | MOVW $0, R0
34 | MOVW R0, r2+20(FP)
35 | BL runtime·exitsyscall(SB)
36 | RET
37 |
38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
39 | B syscall·RawSyscall(SB)
40 |
41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
42 | B syscall·RawSyscall6(SB)
43 |
44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
45 | MOVW trap+0(FP), R7 // syscall entry
46 | MOVW a1+4(FP), R0
47 | MOVW a2+8(FP), R1
48 | MOVW a3+12(FP), R2
49 | SWI $0
50 | MOVW R0, r1+16(FP)
51 | MOVW $0, R0
52 | MOVW R0, r2+20(FP)
53 | RET
54 |
55 | TEXT ·seek(SB),NOSPLIT,$0-28
56 | B syscall·seek(SB)
57 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build arm64
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | // Just jump to package syscall's implementation for all these functions.
12 | // The runtime may know about them.
13 |
14 | TEXT ·Syscall(SB),NOSPLIT,$0-56
15 | B syscall·Syscall(SB)
16 |
17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
18 | B syscall·Syscall6(SB)
19 |
20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
21 | BL runtime·entersyscall(SB)
22 | MOVD a1+8(FP), R0
23 | MOVD a2+16(FP), R1
24 | MOVD a3+24(FP), R2
25 | MOVD $0, R3
26 | MOVD $0, R4
27 | MOVD $0, R5
28 | MOVD trap+0(FP), R8 // syscall entry
29 | SVC
30 | MOVD R0, r1+32(FP) // r1
31 | MOVD R1, r2+40(FP) // r2
32 | BL runtime·exitsyscall(SB)
33 | RET
34 |
35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
36 | B syscall·RawSyscall(SB)
37 |
38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
39 | B syscall·RawSyscall6(SB)
40 |
41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
42 | MOVD a1+8(FP), R0
43 | MOVD a2+16(FP), R1
44 | MOVD a3+24(FP), R2
45 | MOVD $0, R3
46 | MOVD $0, R4
47 | MOVD $0, R5
48 | MOVD trap+0(FP), R8 // syscall entry
49 | SVC
50 | MOVD R0, r1+32(FP)
51 | MOVD R1, r2+40(FP)
52 | RET
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_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 ·SyscallNoError(SB),NOSPLIT,$0-48
19 | BL runtime·entersyscall(SB)
20 | MOVD a1+8(FP), R3
21 | MOVD a2+16(FP), R4
22 | MOVD a3+24(FP), R5
23 | MOVD R0, R6
24 | MOVD R0, R7
25 | MOVD R0, R8
26 | MOVD trap+0(FP), R9 // syscall entry
27 | SYSCALL R9
28 | MOVD R3, r1+32(FP)
29 | MOVD R4, r2+40(FP)
30 | BL runtime·exitsyscall(SB)
31 | RET
32 |
33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
34 | MOVD a1+8(FP), R3
35 | MOVD a2+16(FP), R4
36 | MOVD a3+24(FP), R5
37 | MOVD R0, R6
38 | MOVD R0, R7
39 | MOVD R0, R8
40 | MOVD trap+0(FP), R9 // syscall entry
41 | SYSCALL R9
42 | MOVD R3, r1+32(FP)
43 | MOVD R4, r2+40(FP)
44 | RET
45 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build riscv64,!gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for linux/riscv64.
11 | //
12 | // Where available, just jump to package syscall's implementation of
13 | // these functions.
14 |
15 | TEXT ·Syscall(SB),NOSPLIT,$0-56
16 | JMP syscall·Syscall(SB)
17 |
18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
19 | JMP syscall·Syscall6(SB)
20 |
21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
22 | CALL runtime·entersyscall(SB)
23 | MOV a1+8(FP), A0
24 | MOV a2+16(FP), A1
25 | MOV a3+24(FP), A2
26 | MOV trap+0(FP), A7 // syscall entry
27 | ECALL
28 | MOV A0, r1+32(FP) // r1
29 | MOV A1, r2+40(FP) // r2
30 | CALL runtime·exitsyscall(SB)
31 | RET
32 |
33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
34 | JMP syscall·RawSyscall(SB)
35 |
36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
37 | JMP syscall·RawSyscall6(SB)
38 |
39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
40 | MOV a1+8(FP), A0
41 | MOV a2+16(FP), A1
42 | MOV a3+24(FP), A2
43 | MOV trap+0(FP), A7 // syscall entry
44 | ECALL
45 | MOV A0, r1+32(FP)
46 | MOV A1, r2+40(FP)
47 | RET
48 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_s390x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build s390x
6 | // +build linux
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for s390x, Linux
13 | //
14 |
15 | // Just jump to package syscall's implementation for all these functions.
16 | // The runtime may know about them.
17 |
18 | TEXT ·Syscall(SB),NOSPLIT,$0-56
19 | BR syscall·Syscall(SB)
20 |
21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
22 | BR syscall·Syscall6(SB)
23 |
24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
25 | BL runtime·entersyscall(SB)
26 | MOVD a1+8(FP), R2
27 | MOVD a2+16(FP), R3
28 | MOVD a3+24(FP), R4
29 | MOVD $0, R5
30 | MOVD $0, R6
31 | MOVD $0, R7
32 | MOVD trap+0(FP), R1 // syscall entry
33 | SYSCALL
34 | MOVD R2, r1+32(FP)
35 | MOVD R3, r2+40(FP)
36 | BL runtime·exitsyscall(SB)
37 | RET
38 |
39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
40 | BR syscall·RawSyscall(SB)
41 |
42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
43 | BR syscall·RawSyscall6(SB)
44 |
45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
46 | MOVD a1+8(FP), R2
47 | MOVD a2+16(FP), R3
48 | MOVD a3+24(FP), R4
49 | MOVD $0, R5
50 | MOVD $0, R6
51 | MOVD $0, R7
52 | MOVD trap+0(FP), R1 // syscall entry
53 | SYSCALL
54 | MOVD R2, r1+32(FP)
55 | MOVD R3, r2+40(FP)
56 | RET
57 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for 386, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM64, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for 386, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for arm64, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
11 | //
12 |
13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-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 | HCI_CHANNEL_LOGGING = 4
27 | )
28 |
29 | // Socketoption Level
30 | const (
31 | SOL_BLUETOOTH = 0x112
32 | SOL_HCI = 0x0
33 | SOL_L2CAP = 0x6
34 | SOL_RFCOMM = 0x12
35 | SOL_SCO = 0x11
36 | )
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/constants.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | const (
10 | R_OK = 0x4
11 | W_OK = 0x2
12 | X_OK = 0x1
13 | )
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix
6 | // +build ppc
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used by AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev >> 16) & 0xffff)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32(dev & 0xffff)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | return uint64(((major) << 16) | (minor))
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix
6 | // +build ppc64
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev & 0x3fffffff00000000) >> 32)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32((dev & 0x00000000ffffffff) >> 0)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | var DEVNO64 uint64
27 | DEVNO64 = 0x8000000000000000
28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Darwin's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a Darwin device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev >> 24) & 0xff)
13 | }
14 |
15 | // Minor returns the minor component of a Darwin device number.
16 | func Minor(dev uint64) uint32 {
17 | return uint32(dev & 0xffffff)
18 | }
19 |
20 | // Mkdev returns a Darwin device number generated from the given major and minor
21 | // components.
22 | func Mkdev(major, minor uint32) uint64 {
23 | return (uint64(major) << 24) | uint64(minor)
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Dragonfly's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a DragonFlyBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a DragonFlyBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_freebsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in FreeBSD's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a FreeBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a FreeBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a FreeBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_netbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in NetBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a NetBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x000fff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of a NetBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xfff00000) >> 12)
19 | return minor
20 | }
21 |
22 | // Mkdev returns a NetBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x000fff00
26 | dev |= (uint64(minor) << 12) & 0xfff00000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in OpenBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of an OpenBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x0000ff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of an OpenBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xffff0000) >> 8)
19 | return minor
20 | }
21 |
22 | // Mkdev returns an OpenBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x0000ff00
26 | dev |= (uint64(minor) << 8) & 0xffff0000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/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 riscv64
6 |
7 | package unix
8 |
9 | const isBigEndian = false
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/env_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | // Unix environment variables.
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | func Getenv(key string) (value string, found bool) {
14 | return syscall.Getenv(key)
15 | }
16 |
17 | func Setenv(key, value string) error {
18 | return syscall.Setenv(key, value)
19 | }
20 |
21 | func Clearenv() {
22 | syscall.Clearenv()
23 | }
24 |
25 | func Environ() []string {
26 | return syscall.Environ()
27 | }
28 |
29 | func Unsetenv(key string) error {
30 | return syscall.Unsetenv(key)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build dragonfly freebsd linux netbsd openbsd
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64.
13 | var fcntl64Syscall uintptr = SYS_FCNTL
14 |
15 | func fcntl(fd int, cmd, arg int) (int, error) {
16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg))
17 | var err error
18 | if errno != 0 {
19 | err = errno
20 | }
21 | return int(valptr), err
22 | }
23 |
24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
26 | return fcntl(int(fd), cmd, arg)
27 | }
28 |
29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
32 | if errno == 0 {
33 | return nil
34 | }
35 | return errno
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import "unsafe"
8 |
9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
11 | return fcntl(int(fd), cmd, arg)
12 | }
13 |
14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
17 | return err
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go:
--------------------------------------------------------------------------------
1 | // +build linux,386 linux,arm linux,mips linux,mipsle
2 |
3 | // Copyright 2014 The Go Authors. All rights reserved.
4 | // Use of this source code is governed by a BSD-style
5 | // license that can be found in the LICENSE file.
6 |
7 | package unix
8 |
9 | func init() {
10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's
11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL.
12 | fcntl64Syscall = SYS_FCNTL64
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fdset.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | // Set adds fd to the set fds.
10 | func (fds *FdSet) Set(fd int) {
11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS))
12 | }
13 |
14 | // Clear removes fd from the set fds.
15 | func (fds *FdSet) Clear(fd int) {
16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS))
17 | }
18 |
19 | // IsSet returns whether fd is in the set fds.
20 | func (fds *FdSet) IsSet(fd int) bool {
21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0
22 | }
23 |
24 | // Zero clears the set fds.
25 | func (fds *FdSet) Zero() {
26 | for i := range fds.Bits {
27 | fds.Bits[i] = 0
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_c.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo
6 | // +build !aix
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | #define _STRINGIFY2_(x) #x
13 | #define _STRINGIFY_(x) _STRINGIFY2_(x)
14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
15 |
16 | // Call syscall from C code because the gccgo support for calling from
17 | // Go to C does not support varargs functions.
18 |
19 | struct ret {
20 | uintptr_t r;
21 | uintptr_t err;
22 | };
23 |
24 | struct ret
25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
26 | {
27 | struct ret r;
28 |
29 | errno = 0;
30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
31 | r.err = errno;
32 | return r;
33 | }
34 |
35 | uintptr_t
36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
37 | {
38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo,linux,amd64
6 |
7 | package unix
8 |
9 | import "syscall"
10 |
11 | //extern gettimeofday
12 | func realGettimeofday(*Timeval, *byte) int32
13 |
14 | func gettimeofday(tv *Timeval) (err syscall.Errno) {
15 | r := realGettimeofday(tv, nil)
16 | if r < 0 {
17 | return syscall.GetErrno()
18 | }
19 | return 0
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/pagesize_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | // For Unix, get the pagesize from the runtime.
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | func Getpagesize() int {
14 | return syscall.Getpagesize()
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,race linux,race freebsd,race
6 |
7 | package unix
8 |
9 | import (
10 | "runtime"
11 | "unsafe"
12 | )
13 |
14 | const raceenabled = true
15 |
16 | func raceAcquire(addr unsafe.Pointer) {
17 | runtime.RaceAcquire(addr)
18 | }
19 |
20 | func raceReleaseMerge(addr unsafe.Pointer) {
21 | runtime.RaceReleaseMerge(addr)
22 | }
23 |
24 | func raceReadRange(addr unsafe.Pointer, len int) {
25 | runtime.RaceReadRange(addr, len)
26 | }
27 |
28 | func raceWriteRange(addr unsafe.Pointer, len int) {
29 | runtime.RaceWriteRange(addr, len)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race0.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly
6 |
7 | package unix
8 |
9 | import (
10 | "unsafe"
11 | )
12 |
13 | const raceenabled = false
14 |
15 | func raceAcquire(addr unsafe.Pointer) {
16 | }
17 |
18 | func raceReleaseMerge(addr unsafe.Pointer) {
19 | }
20 |
21 | func raceReadRange(addr unsafe.Pointer, len int) {
22 | }
23 |
24 | func raceWriteRange(addr unsafe.Pointer, len int) {
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/readdirent_getdents.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix dragonfly freebsd linux netbsd openbsd
6 |
7 | package unix
8 |
9 | // ReadDirent reads directory entries from fd and writes them into buf.
10 | func ReadDirent(fd int, buf []byte) (n int, err error) {
11 | return Getdents(fd, buf)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // ReadDirent reads directory entries from fd and writes them into buf.
12 | func ReadDirent(fd int, buf []byte) (n int, err error) {
13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil.
14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the
15 | // actual system call is getdirentries64, 64 is a good guess.
16 | // TODO(rsc): Can we use a single global basep for all calls?
17 | var base = (*uintptr)(unsafe.Pointer(new(uint64)))
18 | return Getdirentries(fd, buf, base)
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | // Round the length of a raw sockaddr up to align it properly.
8 | func cmsgAlignOf(salen int) int {
9 | salign := SizeofPtr
10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) {
11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires
12 | // 32-bit aligned access to network subsystem.
13 | salign = 4
14 | }
15 | return (salen + salign - 1) & ^(salign - 1)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Socket control messages
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // UnixCredentials encodes credentials into a socket control message
12 | // for sending to another process. This can be used for
13 | // authentication.
14 | func UnixCredentials(ucred *Ucred) []byte {
15 | b := make([]byte, CmsgSpace(SizeofUcred))
16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
17 | h.Level = SOL_SOCKET
18 | h.Type = SCM_CREDENTIALS
19 | h.SetLen(CmsgLen(SizeofUcred))
20 | *(*Ucred)(h.data(0)) = *ucred
21 | return b
22 | }
23 |
24 | // ParseUnixCredentials decodes a socket control message that contains
25 | // credentials in a Ucred structure. To receive such a message, the
26 | // SO_PASSCRED option must be enabled on the socket.
27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
28 | if m.Header.Level != SOL_SOCKET {
29 | return nil, EINVAL
30 | }
31 | if m.Header.Type != SCM_CREDENTIALS {
32 | return nil, EINVAL
33 | }
34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
35 | return &ucred, nil
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | import (
10 | "runtime"
11 | )
12 |
13 | // Round the length of a raw sockaddr up to align it properly.
14 | func cmsgAlignOf(salen int) int {
15 | salign := SizeofPtr
16 |
17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in
18 | // sockcmsg_dragonfly.go
19 | switch runtime.GOOS {
20 | case "aix":
21 | // There is no alignment on AIX.
22 | salign = 1
23 | case "darwin", "illumos", "solaris":
24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris
25 | // kernels still require 32-bit aligned access to network
26 | // subsystem.
27 | if SizeofPtr == 8 {
28 | salign = 4
29 | }
30 | case "netbsd", "openbsd":
31 | // NetBSD and OpenBSD armv7 require 64-bit alignment.
32 | if runtime.GOARCH == "arm" {
33 | salign = 8
34 | }
35 | }
36 |
37 | return (salen + salign - 1) & ^(salign - 1)
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/str.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency
10 | if val < 0 {
11 | return "-" + uitoa(uint(-val))
12 | }
13 | return uitoa(uint(val))
14 | }
15 |
16 | func uitoa(val uint) string {
17 | var buf [32]byte // big enough for int64
18 | i := len(buf) - 1
19 | for val >= 10 {
20 | buf[i] = byte(val%10 + '0')
21 | i--
22 | val /= 10
23 | }
24 | buf[i] = byte(val + '0')
25 | return string(buf[i:])
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,go1.12,!go1.13
6 |
7 | package unix
8 |
9 | import (
10 | "unsafe"
11 | )
12 |
13 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
14 | // To implement this using libSystem we'd need syscall_syscallPtr for
15 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
16 | // back to raw syscalls for this func on Go 1.12.
17 | var p unsafe.Pointer
18 | if len(buf) > 0 {
19 | p = unsafe.Pointer(&buf[0])
20 | } else {
21 | p = unsafe.Pointer(&_zero)
22 | }
23 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
24 | n = int(r0)
25 | if e1 != 0 {
26 | return n, errnoErr(e1)
27 | }
28 | return n, nil
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,386,!go1.12
6 |
7 | package unix
8 |
9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,amd64,!go1.12
6 |
7 | package unix
8 |
9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,arm,!go1.12
6 |
7 | package unix
8 |
9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
10 | return 0, ENOSYS
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,arm64,!go1.12
6 |
7 | package unix
8 |
9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
10 | return 0, ENOSYS
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,linux
6 | // +build !gccgo
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | //go:noescape
13 | func gettimeofday(tv *Timeval) (err syscall.Errno)
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,!gccgo
6 |
7 | package unix
8 |
9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail.
10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
11 |
12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't
13 | // fail.
14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,!gccgo,386
6 |
7 | package unix
8 |
9 | import "syscall"
10 |
11 | // Underlying system call writes to newoffset via pointer.
12 | // Implemented in assembly to avoid allocation.
13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
14 |
15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,gccgo,386
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
15 | var newoffset int64
16 | offsetLow := uint32(offset & 0xffffffff)
17 | offsetHigh := uint32((offset >> 32) & 0xffffffff)
18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
19 | return newoffset, err
20 | }
21 |
22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
24 | return int(fd), err
25 | }
26 |
27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
29 | return int(fd), err
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,gccgo,arm
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
15 | var newoffset int64
16 | offsetLow := uint32(offset & 0xffffffff)
17 | offsetHigh := uint32((offset >> 32) & 0xffffffff)
18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
19 | return newoffset, err
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build 386,netbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: int32(nsec)}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint32(fd)
19 | k.Filter = uint32(mode)
20 | k.Flags = uint32(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint32(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = int32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
--------------------------------------------------------------------------------
/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 (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = int32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
--------------------------------------------------------------------------------
/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 (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = int32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build arm64,netbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: nsec}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint64(fd)
19 | k.Filter = uint32(mode)
20 | k.Flags = uint32(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint64(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = int32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
--------------------------------------------------------------------------------
/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 (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = uint32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl.
41 | const SYS___SYSCTL = SYS_SYSCTL
42 |
--------------------------------------------------------------------------------
/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 (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = uint32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
41 | const SYS___SYSCTL = SYS_SYSCTL
42 |
--------------------------------------------------------------------------------
/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 (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = uint32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl.
41 | const SYS___SYSCTL = SYS_SYSCTL
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build arm64,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 (msghdr *Msghdr) SetIovlen(length int) {
32 | msghdr.Iovlen = uint32(length)
33 | }
34 |
35 | func (cmsg *Cmsghdr) SetLen(length int) {
36 | cmsg.Len = uint32(length)
37 | }
38 |
39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
41 | const SYS___SYSCTL = SYS_SYSCTL
42 |
--------------------------------------------------------------------------------
/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 (msghdr *Msghdr) SetIovlen(length int) {
22 | msghdr.Iovlen = int32(length)
23 | }
24 |
25 | func (cmsg *Cmsghdr) SetLen(length int) {
26 | cmsg.Len = uint32(length)
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris
6 | // +build !gccgo,!ppc64le,!ppc64
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build ppc64le ppc64
7 | // +build !gccgo
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
14 | return syscall.Syscall(trap, a1, a2, a3)
15 | }
16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6)
18 | }
19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
20 | return syscall.RawSyscall(trap, a1, a2, a3)
21 | }
22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6)
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/unveil_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import (
8 | "syscall"
9 | "unsafe"
10 | )
11 |
12 | // Unveil implements the unveil syscall.
13 | // For more information see unveil(2).
14 | // Note that the special case of blocking further
15 | // unveil calls is handled by UnveilBlock.
16 | func Unveil(path string, flags string) error {
17 | pathPtr, err := syscall.BytePtrFromString(path)
18 | if err != nil {
19 | return err
20 | }
21 | flagsPtr, err := syscall.BytePtrFromString(flags)
22 | if err != nil {
23 | return err
24 | }
25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0)
26 | if e != 0 {
27 | return e
28 | }
29 | return nil
30 | }
31 |
32 | // UnveilBlock blocks future unveil calls.
33 | // For more information see unveil(2).
34 | func UnveilBlock() error {
35 | // Both pointers must be nil.
36 | var pathUnsafe, flagsUnsafe unsafe.Pointer
37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0)
38 | if e != 0 {
39 | return e
40 | }
41 | return nil
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_armnn_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/zptrace_linux_arm64.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT.
2 |
3 | package unix
4 |
5 | import "unsafe"
6 |
7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error {
9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))}
10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
11 | }
12 |
13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries.
14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error {
15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))}
16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -l32 -tags darwin,386,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | // +build darwin,386,go1.13
5 |
6 | package unix
7 |
8 | import (
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | var _ syscall.Errno
14 |
15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
16 |
17 | func closedir(dir uintptr) (err error) {
18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
19 | if e1 != 0 {
20 | err = errnoErr(e1)
21 | }
22 | return
23 | }
24 |
25 | func libc_closedir_trampoline()
26 |
27 | //go:linkname libc_closedir libc_closedir
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | func libc_readdir_r_trampoline()
39 |
40 | //go:linkname libc_readdir_r libc_readdir_r
41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go 386
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | // +build go1.13
5 |
6 | #include "textflag.h"
7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
8 | JMP libc_fdopendir(SB)
9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
10 | JMP libc_closedir(SB)
11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
12 | JMP libc_readdir_r(SB)
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | // +build darwin,amd64,go1.13
5 |
6 | package unix
7 |
8 | import (
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | var _ syscall.Errno
14 |
15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
16 |
17 | func closedir(dir uintptr) (err error) {
18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
19 | if e1 != 0 {
20 | err = errnoErr(e1)
21 | }
22 | return
23 | }
24 |
25 | func libc_closedir_trampoline()
26 |
27 | //go:linkname libc_closedir libc_closedir
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | func libc_readdir_r_trampoline()
39 |
40 | //go:linkname libc_readdir_r libc_readdir_r
41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go amd64
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | // +build go1.13
5 |
6 | #include "textflag.h"
7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
8 | JMP libc_fdopendir(SB)
9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
10 | JMP libc_closedir(SB)
11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
12 | JMP libc_readdir_r(SB)
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -l32 -tags darwin,arm,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | // +build darwin,arm,go1.13
5 |
6 | package unix
7 |
8 | import (
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | var _ syscall.Errno
14 |
15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
16 |
17 | func closedir(dir uintptr) (err error) {
18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
19 | if e1 != 0 {
20 | err = errnoErr(e1)
21 | }
22 | return
23 | }
24 |
25 | func libc_closedir_trampoline()
26 |
27 | //go:linkname libc_closedir libc_closedir
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | func libc_readdir_r_trampoline()
39 |
40 | //go:linkname libc_readdir_r libc_readdir_r
41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go arm
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | // +build go1.13
5 |
6 | #include "textflag.h"
7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
8 | JMP libc_fdopendir(SB)
9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
10 | JMP libc_closedir(SB)
11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
12 | JMP libc_readdir_r(SB)
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | // +build darwin,arm64,go1.13
5 |
6 | package unix
7 |
8 | import (
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | var _ syscall.Errno
14 |
15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
16 |
17 | func closedir(dir uintptr) (err error) {
18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0)
19 | if e1 != 0 {
20 | err = errnoErr(e1)
21 | }
22 | return
23 | }
24 |
25 | func libc_closedir_trampoline()
26 |
27 | //go:linkname libc_closedir libc_closedir
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | func libc_readdir_r_trampoline()
39 |
40 | //go:linkname libc_readdir_r libc_readdir_r
41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go arm64
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | // +build go1.13
5 |
6 | #include "textflag.h"
7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0
8 | JMP libc_fdopendir(SB)
9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0
10 | JMP libc_closedir(SB)
11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0
12 | JMP libc_readdir_r(SB)
13 |
--------------------------------------------------------------------------------
/vendor/gopkg.in/yaml.v2/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - "1.4.x"
5 | - "1.5.x"
6 | - "1.6.x"
7 | - "1.7.x"
8 | - "1.8.x"
9 | - "1.9.x"
10 | - "1.10.x"
11 | - "1.11.x"
12 | - "1.12.x"
13 | - "1.13.x"
14 | - "tip"
15 |
16 | go_import_path: gopkg.in/yaml.v2
17 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/modules.txt:
--------------------------------------------------------------------------------
1 | # github.com/Knetic/govaluate v3.0.0+incompatible
2 | github.com/Knetic/govaluate
3 | # github.com/gin-contrib/sse v0.1.0
4 | github.com/gin-contrib/sse
5 | # github.com/gin-gonic/gin v1.6.3
6 | github.com/gin-gonic/gin
7 | github.com/gin-gonic/gin/binding
8 | github.com/gin-gonic/gin/internal/bytesconv
9 | github.com/gin-gonic/gin/internal/json
10 | github.com/gin-gonic/gin/render
11 | # github.com/go-playground/locales v0.13.0
12 | github.com/go-playground/locales
13 | github.com/go-playground/locales/currency
14 | # github.com/go-playground/universal-translator v0.17.0
15 | github.com/go-playground/universal-translator
16 | # github.com/go-playground/validator/v10 v10.2.0
17 | github.com/go-playground/validator/v10
18 | # github.com/golang/protobuf v1.3.3
19 | github.com/golang/protobuf/proto
20 | # github.com/json-iterator/go v1.1.9
21 | github.com/json-iterator/go
22 | # github.com/leodido/go-urn v1.2.0
23 | github.com/leodido/go-urn
24 | # github.com/mattn/go-isatty v0.0.12
25 | github.com/mattn/go-isatty
26 | # github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
27 | github.com/modern-go/concurrent
28 | # github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
29 | github.com/modern-go/reflect2
30 | # github.com/ugorji/go/codec v1.1.7
31 | github.com/ugorji/go/codec
32 | # golang.org/x/sys v0.0.0-20200116001909-b77594299b42
33 | golang.org/x/sys/unix
34 | # gopkg.in/yaml.v2 v2.3.0
35 | gopkg.in/yaml.v2
36 |
--------------------------------------------------------------------------------