├── .gitignore
├── Dockerfile
├── LICENSE
├── OWNERS
├── README.md
├── go.mod
├── go.sum
├── k8s
├── deployment.yaml
└── service.yaml
├── main.go
└── vendor
├── github.com
├── gin-contrib
│ └── sse
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── 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
│ │ ├── default_validator.go
│ │ ├── form.go
│ │ ├── form_mapping.go
│ │ ├── json.go
│ │ ├── msgpack.go
│ │ ├── protobuf.go
│ │ ├── query.go
│ │ ├── uri.go
│ │ ├── xml.go
│ │ └── yaml.go
│ │ ├── codecov.yml
│ │ ├── context.go
│ │ ├── context_appengine.go
│ │ ├── debug.go
│ │ ├── deprecated.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── fs.go
│ │ ├── gin.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── internal
│ │ └── json
│ │ │ ├── json.go
│ │ │ └── jsoniter.go
│ │ ├── logger.go
│ │ ├── mode.go
│ │ ├── path.go
│ │ ├── recovery.go
│ │ ├── render
│ │ ├── data.go
│ │ ├── html.go
│ │ ├── json.go
│ │ ├── 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
├── 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
│ │ ├── 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
├── mattn
│ └── go-isatty
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── isatty_android.go
│ │ ├── isatty_bsd.go
│ │ ├── isatty_linux.go
│ │ ├── isatty_others.go
│ │ ├── isatty_solaris.go
│ │ └── isatty_windows.go
├── modern-go
│ ├── concurrent
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── executor.go
│ │ ├── go_above_19.go
│ │ ├── go_below_19.go
│ │ ├── log.go
│ │ ├── test.sh
│ │ └── 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
│ ├── LICENSE
│ └── codec
│ ├── 0_importpath.go
│ ├── 0doc.go
│ ├── README.md
│ ├── binc.go
│ ├── build.sh
│ ├── cbor.go
│ ├── codecgen.go
│ ├── decode.go
│ ├── encode.go
│ ├── fast-path.generated.go
│ ├── fast-path.go.tmpl
│ ├── fast-path.not.go
│ ├── gen-dec-array.go.tmpl
│ ├── gen-dec-map.go.tmpl
│ ├── gen-enc-chan.go.tmpl
│ ├── gen-helper.generated.go
│ ├── gen-helper.go.tmpl
│ ├── gen.generated.go
│ ├── gen.go
│ ├── goversion_arrayof_gte_go15.go
│ ├── goversion_arrayof_lt_go15.go
│ ├── goversion_makemap_gte_go19.go
│ ├── goversion_makemap_lt_go19.go
│ ├── goversion_unexportedembeddedptr_gte_go110.go
│ ├── goversion_unexportedembeddedptr_lt_go110.go
│ ├── goversion_unsupported_lt_go14.go
│ ├── goversion_vendor_eq_go15.go
│ ├── goversion_vendor_eq_go16.go
│ ├── goversion_vendor_gte_go17.go
│ ├── goversion_vendor_lt_go15.go
│ ├── helper.go
│ ├── helper_internal.go
│ ├── helper_not_unsafe.go
│ ├── helper_unsafe.go
│ ├── json.go
│ ├── mammoth-test.go.tmpl
│ ├── mammoth2-test.go.tmpl
│ ├── msgpack.go
│ ├── rpc.go
│ ├── simple.go
│ ├── test-cbor-goldens.json
│ └── test.py
├── 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_s390x.s
│ ├── asm_netbsd_386.s
│ ├── asm_netbsd_amd64.s
│ ├── asm_netbsd_arm.s
│ ├── asm_netbsd_arm64.s
│ ├── asm_openbsd_386.s
│ ├── asm_openbsd_amd64.s
│ ├── asm_openbsd_arm.s
│ ├── asm_solaris_amd64.s
│ ├── bluetooth_linux.go
│ ├── cap_freebsd.go
│ ├── constants.go
│ ├── dev_aix_ppc.go
│ ├── dev_aix_ppc64.go
│ ├── dev_darwin.go
│ ├── dev_dragonfly.go
│ ├── dev_freebsd.go
│ ├── dev_linux.go
│ ├── dev_netbsd.go
│ ├── dev_openbsd.go
│ ├── dirent.go
│ ├── endian_big.go
│ ├── endian_little.go
│ ├── env_unix.go
│ ├── errors_freebsd_386.go
│ ├── errors_freebsd_amd64.go
│ ├── errors_freebsd_arm.go
│ ├── fcntl.go
│ ├── fcntl_darwin.go
│ ├── fcntl_linux_32bit.go
│ ├── gccgo.go
│ ├── gccgo_c.c
│ ├── gccgo_linux_amd64.go
│ ├── ioctl.go
│ ├── mkall.sh
│ ├── mkerrors.sh
│ ├── mksysctl_openbsd.pl
│ ├── openbsd_pledge.go
│ ├── openbsd_unveil.go
│ ├── pagesize_unix.go
│ ├── race.go
│ ├── race0.go
│ ├── sockcmsg_linux.go
│ ├── sockcmsg_unix.go
│ ├── str.go
│ ├── syscall.go
│ ├── syscall_aix.go
│ ├── syscall_aix_ppc.go
│ ├── syscall_aix_ppc64.go
│ ├── syscall_bsd.go
│ ├── syscall_darwin.go
│ ├── syscall_darwin_386.go
│ ├── syscall_darwin_amd64.go
│ ├── syscall_darwin_arm.go
│ ├── syscall_darwin_arm64.go
│ ├── syscall_darwin_libSystem.go
│ ├── syscall_dragonfly.go
│ ├── syscall_dragonfly_amd64.go
│ ├── syscall_freebsd.go
│ ├── syscall_freebsd_386.go
│ ├── syscall_freebsd_amd64.go
│ ├── syscall_freebsd_arm.go
│ ├── syscall_freebsd_arm64.go
│ ├── syscall_linux.go
│ ├── syscall_linux_386.go
│ ├── syscall_linux_amd64.go
│ ├── syscall_linux_amd64_gc.go
│ ├── syscall_linux_arm.go
│ ├── syscall_linux_arm64.go
│ ├── syscall_linux_gc.go
│ ├── syscall_linux_gc_386.go
│ ├── syscall_linux_gccgo_386.go
│ ├── syscall_linux_gccgo_arm.go
│ ├── syscall_linux_mips64x.go
│ ├── syscall_linux_mipsx.go
│ ├── syscall_linux_ppc64x.go
│ ├── syscall_linux_riscv64.go
│ ├── syscall_linux_s390x.go
│ ├── syscall_linux_sparc64.go
│ ├── syscall_netbsd.go
│ ├── syscall_netbsd_386.go
│ ├── syscall_netbsd_amd64.go
│ ├── syscall_netbsd_arm.go
│ ├── syscall_netbsd_arm64.go
│ ├── syscall_openbsd.go
│ ├── syscall_openbsd_386.go
│ ├── syscall_openbsd_amd64.go
│ ├── syscall_openbsd_arm.go
│ ├── syscall_solaris.go
│ ├── syscall_solaris_amd64.go
│ ├── syscall_unix.go
│ ├── syscall_unix_gc.go
│ ├── syscall_unix_gc_ppc64x.go
│ ├── timestruct.go
│ ├── xattr_bsd.go
│ ├── zerrors_aix_ppc.go
│ ├── zerrors_aix_ppc64.go
│ ├── zerrors_darwin_386.go
│ ├── zerrors_darwin_amd64.go
│ ├── zerrors_darwin_arm.go
│ ├── zerrors_darwin_arm64.go
│ ├── zerrors_dragonfly_amd64.go
│ ├── zerrors_freebsd_386.go
│ ├── zerrors_freebsd_amd64.go
│ ├── zerrors_freebsd_arm.go
│ ├── zerrors_freebsd_arm64.go
│ ├── zerrors_linux_386.go
│ ├── zerrors_linux_amd64.go
│ ├── zerrors_linux_arm.go
│ ├── zerrors_linux_arm64.go
│ ├── zerrors_linux_mips.go
│ ├── zerrors_linux_mips64.go
│ ├── zerrors_linux_mips64le.go
│ ├── zerrors_linux_mipsle.go
│ ├── zerrors_linux_ppc64.go
│ ├── zerrors_linux_ppc64le.go
│ ├── zerrors_linux_riscv64.go
│ ├── zerrors_linux_s390x.go
│ ├── zerrors_linux_sparc64.go
│ ├── zerrors_netbsd_386.go
│ ├── zerrors_netbsd_amd64.go
│ ├── zerrors_netbsd_arm.go
│ ├── zerrors_netbsd_arm64.go
│ ├── zerrors_openbsd_386.go
│ ├── zerrors_openbsd_amd64.go
│ ├── zerrors_openbsd_arm.go
│ ├── zerrors_solaris_amd64.go
│ ├── zptrace386_linux.go
│ ├── zptracearm_linux.go
│ ├── zptracemips_linux.go
│ ├── zptracemipsle_linux.go
│ ├── zsyscall_aix_ppc.go
│ ├── zsyscall_aix_ppc64.go
│ ├── zsyscall_aix_ppc64_gc.go
│ ├── zsyscall_aix_ppc64_gccgo.go
│ ├── zsyscall_darwin_386.1_11.go
│ ├── zsyscall_darwin_386.go
│ ├── zsyscall_darwin_386.s
│ ├── zsyscall_darwin_amd64.1_11.go
│ ├── zsyscall_darwin_amd64.go
│ ├── zsyscall_darwin_amd64.s
│ ├── zsyscall_darwin_arm.1_11.go
│ ├── zsyscall_darwin_arm.go
│ ├── zsyscall_darwin_arm.s
│ ├── zsyscall_darwin_arm64.1_11.go
│ ├── zsyscall_darwin_arm64.go
│ ├── zsyscall_darwin_arm64.s
│ ├── zsyscall_dragonfly_amd64.go
│ ├── zsyscall_freebsd_386.go
│ ├── zsyscall_freebsd_amd64.go
│ ├── zsyscall_freebsd_arm.go
│ ├── zsyscall_freebsd_arm64.go
│ ├── zsyscall_linux_386.go
│ ├── zsyscall_linux_amd64.go
│ ├── zsyscall_linux_arm.go
│ ├── zsyscall_linux_arm64.go
│ ├── zsyscall_linux_mips.go
│ ├── zsyscall_linux_mips64.go
│ ├── zsyscall_linux_mips64le.go
│ ├── zsyscall_linux_mipsle.go
│ ├── zsyscall_linux_ppc64.go
│ ├── zsyscall_linux_ppc64le.go
│ ├── zsyscall_linux_riscv64.go
│ ├── zsyscall_linux_s390x.go
│ ├── zsyscall_linux_sparc64.go
│ ├── zsyscall_netbsd_386.go
│ ├── zsyscall_netbsd_amd64.go
│ ├── zsyscall_netbsd_arm.go
│ ├── zsyscall_netbsd_arm64.go
│ ├── zsyscall_openbsd_386.go
│ ├── zsyscall_openbsd_amd64.go
│ ├── zsyscall_openbsd_arm.go
│ ├── zsyscall_solaris_amd64.go
│ ├── zsysctl_openbsd_386.go
│ ├── zsysctl_openbsd_amd64.go
│ ├── zsysctl_openbsd_arm.go
│ ├── zsysnum_darwin_386.go
│ ├── zsysnum_darwin_amd64.go
│ ├── zsysnum_darwin_arm.go
│ ├── zsysnum_darwin_arm64.go
│ ├── zsysnum_dragonfly_amd64.go
│ ├── zsysnum_freebsd_386.go
│ ├── zsysnum_freebsd_amd64.go
│ ├── zsysnum_freebsd_arm.go
│ ├── zsysnum_freebsd_arm64.go
│ ├── zsysnum_linux_386.go
│ ├── zsysnum_linux_amd64.go
│ ├── zsysnum_linux_arm.go
│ ├── zsysnum_linux_arm64.go
│ ├── zsysnum_linux_mips.go
│ ├── zsysnum_linux_mips64.go
│ ├── zsysnum_linux_mips64le.go
│ ├── zsysnum_linux_mipsle.go
│ ├── zsysnum_linux_ppc64.go
│ ├── zsysnum_linux_ppc64le.go
│ ├── zsysnum_linux_riscv64.go
│ ├── zsysnum_linux_s390x.go
│ ├── zsysnum_linux_sparc64.go
│ ├── zsysnum_netbsd_386.go
│ ├── zsysnum_netbsd_amd64.go
│ ├── zsysnum_netbsd_arm.go
│ ├── zsysnum_netbsd_arm64.go
│ ├── zsysnum_openbsd_386.go
│ ├── zsysnum_openbsd_amd64.go
│ ├── zsysnum_openbsd_arm.go
│ ├── ztypes_aix_ppc.go
│ ├── ztypes_aix_ppc64.go
│ ├── ztypes_darwin_386.go
│ ├── ztypes_darwin_amd64.go
│ ├── ztypes_darwin_arm.go
│ ├── ztypes_darwin_arm64.go
│ ├── ztypes_dragonfly_amd64.go
│ ├── ztypes_freebsd_386.go
│ ├── ztypes_freebsd_amd64.go
│ ├── ztypes_freebsd_arm.go
│ ├── ztypes_freebsd_arm64.go
│ ├── ztypes_linux_386.go
│ ├── ztypes_linux_amd64.go
│ ├── ztypes_linux_arm.go
│ ├── ztypes_linux_arm64.go
│ ├── ztypes_linux_mips.go
│ ├── ztypes_linux_mips64.go
│ ├── ztypes_linux_mips64le.go
│ ├── ztypes_linux_mipsle.go
│ ├── ztypes_linux_ppc64.go
│ ├── ztypes_linux_ppc64le.go
│ ├── ztypes_linux_riscv64.go
│ ├── ztypes_linux_s390x.go
│ ├── ztypes_linux_sparc64.go
│ ├── ztypes_netbsd_386.go
│ ├── ztypes_netbsd_amd64.go
│ ├── ztypes_netbsd_arm.go
│ ├── ztypes_netbsd_arm64.go
│ ├── ztypes_openbsd_386.go
│ ├── ztypes_openbsd_amd64.go
│ ├── ztypes_openbsd_arm.go
│ └── ztypes_solaris_amd64.go
├── gopkg.in
├── go-playground
│ └── validator.v8
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── baked_in.go
│ │ ├── cache.go
│ │ ├── doc.go
│ │ ├── logo.png
│ │ ├── regexes.go
│ │ ├── util.go
│ │ └── validator.go
└── 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
/.gitignore:
--------------------------------------------------------------------------------
1 | # Binaries for programs and plugins
2 | vote-api-server
3 |
4 | # Test binary, build with `go test -c`
5 | *.test
6 |
7 | # Output of the go coverage tool, specifically when used with LiteIDE
8 | *.out
9 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM image-registry.openshift-image-registry.svc:5000/openshift/golang:latest as builder
2 |
3 | WORKDIR /build
4 | ADD . /build/
5 |
6 |
7 | RUN mkdir /tmp/cache
8 | RUN CGO_ENABLED=0 GOCACHE=/tmp/cache go build -mod=vendor -v -o /tmp/api-server .
9 |
10 | FROM scratch
11 |
12 | WORKDIR /app
13 | COPY --from=builder /tmp/api-server /app/api-server
14 |
15 | CMD [ "/app/api-server" ]
16 |
--------------------------------------------------------------------------------
/OWNERS:
--------------------------------------------------------------------------------
1 | # The OWNERS file is used by prow to automatically merge approved PRs.
2 |
3 | approvers:
4 | - chmouel
5 | - vdemeester
6 | - nikhil-thomas
7 | - piyush-garg
8 | - savitaashture
9 | - pradeepitm12
10 | - bnallapeta
11 | - sm43
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # tekton-pipelines-demo
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/openshift/pipelines-vote-api
2 |
3 | go 1.14
4 |
5 | require github.com/gin-gonic/gin v1.4.0
6 |
--------------------------------------------------------------------------------
/k8s/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: pipelines-vote-api
6 | name: pipelines-vote-api
7 | spec:
8 | replicas: 1
9 | selector:
10 | matchLabels:
11 | app: pipelines-vote-api
12 | template:
13 | metadata:
14 | labels:
15 | app: pipelines-vote-api
16 | spec:
17 | containers:
18 | - image: quay.io/openshift-pipeline/vote-api:latest
19 | imagePullPolicy: Always
20 | name: pipelines-vote-api
21 | ports:
22 | - containerPort: 9000
23 | protocol: TCP
24 |
--------------------------------------------------------------------------------
/k8s/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | app: pipelines-vote-api
6 | name: pipelines-vote-api
7 | spec:
8 | type: ClusterIP
9 | ports:
10 | - protocol: TCP
11 | port: 9000
12 | targetPort: 9000
13 | selector:
14 | app: pipelines-vote-api
15 |
--------------------------------------------------------------------------------
/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "encoding/json"
5 | "net/http"
6 |
7 | "github.com/gin-gonic/gin"
8 | )
9 |
10 | var inMemoryStore = make(map[string]string)
11 | var redirectURL = "http://0.0.0.0:9000"
12 |
13 | func setupRouter() *gin.Engine {
14 | r := gin.Default()
15 |
16 | r.GET("/vote", func(c *gin.Context) {
17 | payload := gin.H{}
18 | voteA := 0
19 | voteB := 0
20 | for _, v := range inMemoryStore {
21 | switch v {
22 | case "a":
23 | voteA++
24 | case "b":
25 | voteB++
26 | }
27 | }
28 | payload["a"] = voteA
29 | payload["b"] = voteB
30 | c.JSON(http.StatusOK, payload)
31 | })
32 |
33 | r.POST("/vote", func(c *gin.Context) {
34 | buf := make([]byte, 1024)
35 | num, _ := c.Request.Body.Read(buf)
36 | reqBody := buf[0:num]
37 | temp := map[string]string{}
38 | json.Unmarshal(reqBody, &temp)
39 | c.JSON(http.StatusOK, reqBody)
40 | voter_id := temp["voter_id"]
41 | vote := temp["vote"]
42 | inMemoryStore[voter_id] = vote
43 | })
44 | return r
45 | }
46 |
47 | func main() {
48 | r := setupRouter()
49 | r.Run(":9000")
50 | }
51 |
--------------------------------------------------------------------------------
/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/README.md:
--------------------------------------------------------------------------------
1 | # Server-Sent Events
2 |
3 | [](https://godoc.org/github.com/gin-contrib/sse)
4 | [](https://travis-ci.org/gin-contrib/sse)
5 | [](https://codecov.io/gh/gin-contrib/sse)
6 | [](https://goreportcard.com/report/github.com/gin-contrib/sse)
7 |
8 | Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is [standardized as part of HTML5[1] by the W3C](http://www.w3.org/TR/2009/WD-eventsource-20091029/).
9 |
10 | - [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/)
11 | - [Browser support](http://caniuse.com/#feat=eventsource)
12 |
13 | ## Sample code
14 |
15 | ```go
16 | import "github.com/gin-contrib/sse"
17 |
18 | func httpHandler(w http.ResponseWriter, req *http.Request) {
19 | // data can be a primitive like a string, an integer or a float
20 | sse.Encode(w, sse.Event{
21 | Event: "message",
22 | Data: "some data\nmore data",
23 | })
24 |
25 | // also a complex type, like a map, a struct or a slice
26 | sse.Encode(w, sse.Event{
27 | Id: "124",
28 | Event: "message",
29 | Data: map[string]interface{}{
30 | "user": "manu",
31 | "date": time.Now().Unix(),
32 | "content": "hi!",
33 | },
34 | })
35 | }
36 | ```
37 | ```
38 | event: message
39 | data: some data\\nmore data
40 |
41 | id: 124
42 | event: message
43 | data: {"content":"hi!","date":1431540810,"user":"manu"}
44 |
45 | ```
46 |
47 | ## Content-Type
48 |
49 | ```go
50 | fmt.Println(sse.ContentType)
51 | ```
52 | ```
53 | text/event-stream
54 | ```
55 |
56 | ## Decoding support
57 |
58 | There is a client-side implementation of SSE coming soon.
59 |
--------------------------------------------------------------------------------
/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.8.x
7 | - go: 1.9.x
8 | - go: 1.10.x
9 | - go: 1.11.x
10 | env: GO111MODULE=on
11 | - go: 1.12.x
12 | env: GO111MODULE=on
13 | - go: master
14 | env: GO111MODULE=on
15 |
16 | git:
17 | depth: 10
18 |
19 | before_install:
20 | - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi
21 |
22 | install:
23 | - if [[ "${GO111MODULE}" = "on" ]]; then go mod download; else make install; fi
24 | - if [[ "${GO111MODULE}" = "on" ]]; then export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"; fi
25 | - if [[ "${GO111MODULE}" = "on" ]]; then make tools; fi
26 |
27 | go_import_path: github.com/gin-gonic/gin
28 |
29 | script:
30 | - make vet
31 | - make fmt-check
32 | - make misspell-check
33 | - make test
34 |
35 | after_success:
36 | - bash <(curl -s https://codecov.io/bash)
37 |
38 | notifications:
39 | webhooks:
40 | urls:
41 | - https://webhooks.gitter.im/e/7f95bf605c4d356372f4
42 | on_success: change # options: [always|never|change] default: always
43 | on_failure: always # options: [always|never|change] default: always
44 | on_start: false # default: false
45 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | - With issues:
4 | - Use the search tool before opening a new issue.
5 | - Please provide source code and commit sha if you found a bug.
6 | - Review existing issues and provide feedback or react to them.
7 |
8 | - With pull requests:
9 | - Open your pull request against `master`
10 | - Your pull request should have no more than two commits, if not you should squash them.
11 | - It should pass all tests in the available continuous integrations systems such as TravisCI.
12 | - You should add/modify tests to cover your proposed code changes.
13 | - If your pull request contains a new feature, please document it on the README.
14 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Manuel Martínez-Almeida
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/default_validator.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import (
8 | "reflect"
9 | "sync"
10 |
11 | "gopkg.in/go-playground/validator.v8"
12 | )
13 |
14 | type defaultValidator struct {
15 | once sync.Once
16 | validate *validator.Validate
17 | }
18 |
19 | var _ StructValidator = &defaultValidator{}
20 |
21 | // ValidateStruct receives any kind of type, but only performed struct or pointer to struct type.
22 | func (v *defaultValidator) ValidateStruct(obj interface{}) error {
23 | value := reflect.ValueOf(obj)
24 | valueType := value.Kind()
25 | if valueType == reflect.Ptr {
26 | valueType = value.Elem().Kind()
27 | }
28 | if valueType == reflect.Struct {
29 | v.lazyinit()
30 | if err := v.validate.Struct(obj); err != nil {
31 | return err
32 | }
33 | }
34 | return nil
35 | }
36 |
37 | // Engine returns the underlying validator engine which powers the default
38 | // Validator instance. This is useful if you want to register custom validations
39 | // or struct level validations. See validator GoDoc for more info -
40 | // https://godoc.org/gopkg.in/go-playground/validator.v8
41 | func (v *defaultValidator) Engine() interface{} {
42 | v.lazyinit()
43 | return v.validate
44 | }
45 |
46 | func (v *defaultValidator) lazyinit() {
47 | v.once.Do(func() {
48 | config := &validator.Config{TagName: "binding"}
49 | v.validate = validator.New(config)
50 | })
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/json.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import (
8 | "bytes"
9 | "fmt"
10 | "io"
11 | "net/http"
12 |
13 | "github.com/gin-gonic/gin/internal/json"
14 | )
15 |
16 | // EnableDecoderUseNumber is used to call the UseNumber method on the JSON
17 | // Decoder instance. UseNumber causes the Decoder to unmarshal a number into an
18 | // interface{} as a Number instead of as a float64.
19 | var EnableDecoderUseNumber = false
20 |
21 | type jsonBinding struct{}
22 |
23 | func (jsonBinding) Name() string {
24 | return "json"
25 | }
26 |
27 | func (jsonBinding) Bind(req *http.Request, obj interface{}) error {
28 | if req == nil || req.Body == nil {
29 | return fmt.Errorf("invalid request")
30 | }
31 | return decodeJSON(req.Body, obj)
32 | }
33 |
34 | func (jsonBinding) BindBody(body []byte, obj interface{}) error {
35 | return decodeJSON(bytes.NewReader(body), obj)
36 | }
37 |
38 | func decodeJSON(r io.Reader, obj interface{}) error {
39 | decoder := json.NewDecoder(r)
40 | if EnableDecoderUseNumber {
41 | decoder.UseNumber()
42 | }
43 | if err := decoder.Decode(obj); err != nil {
44 | return err
45 | }
46 | return validate(obj)
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/msgpack.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import (
8 | "bytes"
9 | "io"
10 | "net/http"
11 |
12 | "github.com/ugorji/go/codec"
13 | )
14 |
15 | type msgpackBinding struct{}
16 |
17 | func (msgpackBinding) Name() string {
18 | return "msgpack"
19 | }
20 |
21 | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error {
22 | return decodeMsgPack(req.Body, obj)
23 | }
24 |
25 | func (msgpackBinding) BindBody(body []byte, obj interface{}) error {
26 | return decodeMsgPack(bytes.NewReader(body), obj)
27 | }
28 |
29 | func decodeMsgPack(r io.Reader, obj interface{}) error {
30 | cdc := new(codec.MsgpackHandle)
31 | if err := codec.NewDecoder(r, cdc).Decode(&obj); err != nil {
32 | return err
33 | }
34 | return validate(obj)
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/protobuf.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import (
8 | "io/ioutil"
9 | "net/http"
10 |
11 | "github.com/golang/protobuf/proto"
12 | )
13 |
14 | type protobufBinding struct{}
15 |
16 | func (protobufBinding) Name() string {
17 | return "protobuf"
18 | }
19 |
20 | func (b protobufBinding) Bind(req *http.Request, obj interface{}) error {
21 | buf, err := ioutil.ReadAll(req.Body)
22 | if err != nil {
23 | return err
24 | }
25 | return b.BindBody(buf, obj)
26 | }
27 |
28 | func (protobufBinding) BindBody(body []byte, obj interface{}) error {
29 | if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil {
30 | return err
31 | }
32 | // Here it's same to return validate(obj), but util now we can't add
33 | // `binding:""` to the struct which automatically generate by gen-proto
34 | return nil
35 | // return validate(obj)
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/query.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import "net/http"
8 |
9 | type queryBinding struct{}
10 |
11 | func (queryBinding) Name() string {
12 | return "query"
13 | }
14 |
15 | func (queryBinding) Bind(req *http.Request, obj interface{}) error {
16 | values := req.URL.Query()
17 | if err := mapForm(obj, values); err != nil {
18 | return err
19 | }
20 | return validate(obj)
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/uri.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Gin Core Team. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | type uriBinding struct{}
8 |
9 | func (uriBinding) Name() string {
10 | return "uri"
11 | }
12 |
13 | func (uriBinding) BindUri(m map[string][]string, obj interface{}) error {
14 | if err := mapUri(obj, m); err != nil {
15 | return err
16 | }
17 | return validate(obj)
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/xml.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import (
8 | "bytes"
9 | "encoding/xml"
10 | "io"
11 | "net/http"
12 | )
13 |
14 | type xmlBinding struct{}
15 |
16 | func (xmlBinding) Name() string {
17 | return "xml"
18 | }
19 |
20 | func (xmlBinding) Bind(req *http.Request, obj interface{}) error {
21 | return decodeXML(req.Body, obj)
22 | }
23 |
24 | func (xmlBinding) BindBody(body []byte, obj interface{}) error {
25 | return decodeXML(bytes.NewReader(body), obj)
26 | }
27 | func decodeXML(r io.Reader, obj interface{}) error {
28 | decoder := xml.NewDecoder(r)
29 | if err := decoder.Decode(obj); err != nil {
30 | return err
31 | }
32 | return validate(obj)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/binding/yaml.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Gin Core Team. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package binding
6 |
7 | import (
8 | "bytes"
9 | "io"
10 | "net/http"
11 |
12 | "gopkg.in/yaml.v2"
13 | )
14 |
15 | type yamlBinding struct{}
16 |
17 | func (yamlBinding) Name() string {
18 | return "yaml"
19 | }
20 |
21 | func (yamlBinding) Bind(req *http.Request, obj interface{}) error {
22 | return decodeYAML(req.Body, obj)
23 | }
24 |
25 | func (yamlBinding) BindBody(body []byte, obj interface{}) error {
26 | return decodeYAML(bytes.NewReader(body), obj)
27 | }
28 |
29 | func decodeYAML(r io.Reader, obj interface{}) error {
30 | decoder := yaml.NewDecoder(r)
31 | if err := decoder.Decode(obj); err != nil {
32 | return err
33 | }
34 | return validate(obj)
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | notify:
3 | gitter:
4 | default:
5 | url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165
6 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/context_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.12
4 |
5 | require (
6 | github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3
7 | github.com/golang/protobuf v1.3.1
8 | github.com/json-iterator/go v1.1.6
9 | github.com/mattn/go-isatty v0.0.7
10 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
11 | github.com/modern-go/reflect2 v1.0.1 // indirect
12 | github.com/stretchr/testify v1.3.0
13 | github.com/ugorji/go v1.1.4
14 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
15 | gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
16 | gopkg.in/go-playground/validator.v8 v8.18.2
17 | gopkg.in/yaml.v2 v2.2.2
18 | )
19 |
--------------------------------------------------------------------------------
/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 | package render
6 |
7 | import (
8 | "net/http"
9 |
10 | "github.com/ugorji/go/codec"
11 | )
12 |
13 | // MsgPack contains the given interface object.
14 | type MsgPack struct {
15 | Data interface{}
16 | }
17 |
18 | var msgpackContentType = []string{"application/msgpack; charset=utf-8"}
19 |
20 | // WriteContentType (MsgPack) writes MsgPack ContentType.
21 | func (r MsgPack) WriteContentType(w http.ResponseWriter) {
22 | writeContentType(w, msgpackContentType)
23 | }
24 |
25 | // Render (MsgPack) encodes the given interface object and writes data with custom ContentType.
26 | func (r MsgPack) Render(w http.ResponseWriter) error {
27 | return WriteMsgPack(w, r.Data)
28 | }
29 |
30 | // WriteMsgPack writes MsgPack ContentType and encodes the given interface object.
31 | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error {
32 | writeContentType(w, msgpackContentType)
33 | var mh codec.MsgpackHandle
34 | return codec.NewEncoder(w, &mh).Encode(obj)
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/render/protobuf.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Gin Core Team. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package render
6 |
7 | import (
8 | "net/http"
9 |
10 | "github.com/golang/protobuf/proto"
11 | )
12 |
13 | // ProtoBuf contains the given interface object.
14 | type ProtoBuf struct {
15 | Data interface{}
16 | }
17 |
18 | var protobufContentType = []string{"application/x-protobuf"}
19 |
20 | // Render (ProtoBuf) marshals the given interface object and writes data with custom ContentType.
21 | func (r ProtoBuf) Render(w http.ResponseWriter) error {
22 | r.WriteContentType(w)
23 |
24 | bytes, err := proto.Marshal(r.Data.(proto.Message))
25 | if err != nil {
26 | return err
27 | }
28 |
29 | _, 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 | r.Headers["Content-Length"] = strconv.FormatInt(r.ContentLength, 10)
25 | r.writeHeaders(w, r.Headers)
26 | _, err = io.Copy(w, r.Reader)
27 | return
28 | }
29 |
30 | // WriteContentType (Reader) writes custom ContentType.
31 | func (r Reader) WriteContentType(w http.ResponseWriter) {
32 | writeContentType(w, []string{r.ContentType})
33 | }
34 |
35 | // writeHeaders writes custom Header.
36 | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string]string) {
37 | header := w.Header()
38 | for k, v := range headers {
39 | if header.Get(k) == "" {
40 | header.Set(k, v)
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/render/redirect.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package render
6 |
7 | import (
8 | "fmt"
9 | "net/http"
10 | )
11 |
12 | // Redirect contains the http request reference and redirects status code and location.
13 | type Redirect struct {
14 | Code int
15 | Request *http.Request
16 | Location string
17 | }
18 |
19 | // Render (Redirect) redirects the http request to new location and writes redirect response.
20 | func (r Redirect) Render(w http.ResponseWriter) error {
21 | 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 = MsgPack{}
31 | _ Render = Reader{}
32 | _ Render = AsciiJSON{}
33 | _ Render = ProtoBuf{}
34 | )
35 |
36 | func writeContentType(w http.ResponseWriter, value []string) {
37 | header := w.Header()
38 | if val := header["Content-Type"]; len(val) == 0 {
39 | header["Content-Type"] = value
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/gin-gonic/gin/render/text.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved.
2 | // Use of this source code is governed by a MIT style
3 | // license that can be found in the LICENSE file.
4 |
5 | package render
6 |
7 | import (
8 | "fmt"
9 | "io"
10 | "net/http"
11 | )
12 |
13 | // String contains the given interface object slice and its format.
14 | type String struct {
15 | Format string
16 | Data []interface{}
17 | }
18 |
19 | var plainContentType = []string{"text/plain; charset=utf-8"}
20 |
21 | // Render (String) writes data with custom ContentType.
22 | func (r String) Render(w http.ResponseWriter) error {
23 | 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.4.0"
9 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2010 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 |
--------------------------------------------------------------------------------
/vendor/github.com/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_float.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "strconv"
5 | )
6 |
7 | type floatAny struct {
8 | baseAny
9 | val float64
10 | }
11 |
12 | func (any *floatAny) Parse() *Iterator {
13 | return nil
14 | }
15 |
16 | func (any *floatAny) ValueType() ValueType {
17 | return NumberValue
18 | }
19 |
20 | func (any *floatAny) MustBeValid() Any {
21 | return any
22 | }
23 |
24 | func (any *floatAny) LastError() error {
25 | return nil
26 | }
27 |
28 | func (any *floatAny) ToBool() bool {
29 | return any.ToFloat64() != 0
30 | }
31 |
32 | func (any *floatAny) ToInt() int {
33 | return int(any.val)
34 | }
35 |
36 | func (any *floatAny) ToInt32() int32 {
37 | return int32(any.val)
38 | }
39 |
40 | func (any *floatAny) ToInt64() int64 {
41 | return int64(any.val)
42 | }
43 |
44 | func (any *floatAny) ToUint() uint {
45 | if any.val > 0 {
46 | return uint(any.val)
47 | }
48 | return 0
49 | }
50 |
51 | func (any *floatAny) ToUint32() uint32 {
52 | if any.val > 0 {
53 | return uint32(any.val)
54 | }
55 | return 0
56 | }
57 |
58 | func (any *floatAny) ToUint64() uint64 {
59 | if any.val > 0 {
60 | return uint64(any.val)
61 | }
62 | return 0
63 | }
64 |
65 | func (any *floatAny) ToFloat32() float32 {
66 | return float32(any.val)
67 | }
68 |
69 | func (any *floatAny) ToFloat64() float64 {
70 | return any.val
71 | }
72 |
73 | func (any *floatAny) ToString() string {
74 | return strconv.FormatFloat(any.val, 'E', -1, 64)
75 | }
76 |
77 | func (any *floatAny) WriteTo(stream *Stream) {
78 | stream.WriteFloat64(any.val)
79 | }
80 |
81 | func (any *floatAny) GetInterface() interface{} {
82 | return any.val
83 | }
84 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/any_int32.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "strconv"
5 | )
6 |
7 | type int32Any struct {
8 | baseAny
9 | val int32
10 | }
11 |
12 | func (any *int32Any) LastError() error {
13 | return nil
14 | }
15 |
16 | func (any *int32Any) ValueType() ValueType {
17 | return NumberValue
18 | }
19 |
20 | func (any *int32Any) MustBeValid() Any {
21 | return any
22 | }
23 |
24 | func (any *int32Any) ToBool() bool {
25 | return any.val != 0
26 | }
27 |
28 | func (any *int32Any) ToInt() int {
29 | return int(any.val)
30 | }
31 |
32 | func (any *int32Any) ToInt32() int32 {
33 | return any.val
34 | }
35 |
36 | func (any *int32Any) ToInt64() int64 {
37 | return int64(any.val)
38 | }
39 |
40 | func (any *int32Any) ToUint() uint {
41 | return uint(any.val)
42 | }
43 |
44 | func (any *int32Any) ToUint32() uint32 {
45 | return uint32(any.val)
46 | }
47 |
48 | func (any *int32Any) ToUint64() uint64 {
49 | return uint64(any.val)
50 | }
51 |
52 | func (any *int32Any) ToFloat32() float32 {
53 | return float32(any.val)
54 | }
55 |
56 | func (any *int32Any) ToFloat64() float64 {
57 | return float64(any.val)
58 | }
59 |
60 | func (any *int32Any) ToString() string {
61 | return strconv.FormatInt(int64(any.val), 10)
62 | }
63 |
64 | func (any *int32Any) WriteTo(stream *Stream) {
65 | stream.WriteInt32(any.val)
66 | }
67 |
68 | func (any *int32Any) Parse() *Iterator {
69 | return nil
70 | }
71 |
72 | func (any *int32Any) GetInterface() interface{} {
73 | return any.val
74 | }
75 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/any_int64.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "strconv"
5 | )
6 |
7 | type int64Any struct {
8 | baseAny
9 | val int64
10 | }
11 |
12 | func (any *int64Any) LastError() error {
13 | return nil
14 | }
15 |
16 | func (any *int64Any) ValueType() ValueType {
17 | return NumberValue
18 | }
19 |
20 | func (any *int64Any) MustBeValid() Any {
21 | return any
22 | }
23 |
24 | func (any *int64Any) ToBool() bool {
25 | return any.val != 0
26 | }
27 |
28 | func (any *int64Any) ToInt() int {
29 | return int(any.val)
30 | }
31 |
32 | func (any *int64Any) ToInt32() int32 {
33 | return int32(any.val)
34 | }
35 |
36 | func (any *int64Any) ToInt64() int64 {
37 | return any.val
38 | }
39 |
40 | func (any *int64Any) ToUint() uint {
41 | return uint(any.val)
42 | }
43 |
44 | func (any *int64Any) ToUint32() uint32 {
45 | return uint32(any.val)
46 | }
47 |
48 | func (any *int64Any) ToUint64() uint64 {
49 | return uint64(any.val)
50 | }
51 |
52 | func (any *int64Any) ToFloat32() float32 {
53 | return float32(any.val)
54 | }
55 |
56 | func (any *int64Any) ToFloat64() float64 {
57 | return float64(any.val)
58 | }
59 |
60 | func (any *int64Any) ToString() string {
61 | return strconv.FormatInt(any.val, 10)
62 | }
63 |
64 | func (any *int64Any) WriteTo(stream *Stream) {
65 | stream.WriteInt64(any.val)
66 | }
67 |
68 | func (any *int64Any) Parse() *Iterator {
69 | return nil
70 | }
71 |
72 | func (any *int64Any) GetInterface() interface{} {
73 | return any.val
74 | }
75 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/any_invalid.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import "fmt"
4 |
5 | type invalidAny struct {
6 | baseAny
7 | err error
8 | }
9 |
10 | func newInvalidAny(path []interface{}) *invalidAny {
11 | return &invalidAny{baseAny{}, fmt.Errorf("%v not found", path)}
12 | }
13 |
14 | func (any *invalidAny) LastError() error {
15 | return any.err
16 | }
17 |
18 | func (any *invalidAny) ValueType() ValueType {
19 | return InvalidValue
20 | }
21 |
22 | func (any *invalidAny) MustBeValid() Any {
23 | panic(any.err)
24 | }
25 |
26 | func (any *invalidAny) ToBool() bool {
27 | return false
28 | }
29 |
30 | func (any *invalidAny) ToInt() int {
31 | return 0
32 | }
33 |
34 | func (any *invalidAny) ToInt32() int32 {
35 | return 0
36 | }
37 |
38 | func (any *invalidAny) ToInt64() int64 {
39 | return 0
40 | }
41 |
42 | func (any *invalidAny) ToUint() uint {
43 | return 0
44 | }
45 |
46 | func (any *invalidAny) ToUint32() uint32 {
47 | return 0
48 | }
49 |
50 | func (any *invalidAny) ToUint64() uint64 {
51 | return 0
52 | }
53 |
54 | func (any *invalidAny) ToFloat32() float32 {
55 | return 0
56 | }
57 |
58 | func (any *invalidAny) ToFloat64() float64 {
59 | return 0
60 | }
61 |
62 | func (any *invalidAny) ToString() string {
63 | return ""
64 | }
65 |
66 | func (any *invalidAny) WriteTo(stream *Stream) {
67 | }
68 |
69 | func (any *invalidAny) Get(path ...interface{}) Any {
70 | if any.err == nil {
71 | return &invalidAny{baseAny{}, fmt.Errorf("get %v from invalid", path)}
72 | }
73 | return &invalidAny{baseAny{}, fmt.Errorf("%v, get %v from invalid", any.err, path)}
74 | }
75 |
76 | func (any *invalidAny) Parse() *Iterator {
77 | return nil
78 | }
79 |
80 | func (any *invalidAny) GetInterface() interface{} {
81 | return nil
82 | }
83 |
--------------------------------------------------------------------------------
/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/any_uint32.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "strconv"
5 | )
6 |
7 | type uint32Any struct {
8 | baseAny
9 | val uint32
10 | }
11 |
12 | func (any *uint32Any) LastError() error {
13 | return nil
14 | }
15 |
16 | func (any *uint32Any) ValueType() ValueType {
17 | return NumberValue
18 | }
19 |
20 | func (any *uint32Any) MustBeValid() Any {
21 | return any
22 | }
23 |
24 | func (any *uint32Any) ToBool() bool {
25 | return any.val != 0
26 | }
27 |
28 | func (any *uint32Any) ToInt() int {
29 | return int(any.val)
30 | }
31 |
32 | func (any *uint32Any) ToInt32() int32 {
33 | return int32(any.val)
34 | }
35 |
36 | func (any *uint32Any) ToInt64() int64 {
37 | return int64(any.val)
38 | }
39 |
40 | func (any *uint32Any) ToUint() uint {
41 | return uint(any.val)
42 | }
43 |
44 | func (any *uint32Any) ToUint32() uint32 {
45 | return any.val
46 | }
47 |
48 | func (any *uint32Any) ToUint64() uint64 {
49 | return uint64(any.val)
50 | }
51 |
52 | func (any *uint32Any) ToFloat32() float32 {
53 | return float32(any.val)
54 | }
55 |
56 | func (any *uint32Any) ToFloat64() float64 {
57 | return float64(any.val)
58 | }
59 |
60 | func (any *uint32Any) ToString() string {
61 | return strconv.FormatInt(int64(any.val), 10)
62 | }
63 |
64 | func (any *uint32Any) WriteTo(stream *Stream) {
65 | stream.WriteUint32(any.val)
66 | }
67 |
68 | func (any *uint32Any) Parse() *Iterator {
69 | return nil
70 | }
71 |
72 | func (any *uint32Any) GetInterface() interface{} {
73 | return any.val
74 | }
75 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/any_uint64.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "strconv"
5 | )
6 |
7 | type uint64Any struct {
8 | baseAny
9 | val uint64
10 | }
11 |
12 | func (any *uint64Any) LastError() error {
13 | return nil
14 | }
15 |
16 | func (any *uint64Any) ValueType() ValueType {
17 | return NumberValue
18 | }
19 |
20 | func (any *uint64Any) MustBeValid() Any {
21 | return any
22 | }
23 |
24 | func (any *uint64Any) ToBool() bool {
25 | return any.val != 0
26 | }
27 |
28 | func (any *uint64Any) ToInt() int {
29 | return int(any.val)
30 | }
31 |
32 | func (any *uint64Any) ToInt32() int32 {
33 | return int32(any.val)
34 | }
35 |
36 | func (any *uint64Any) ToInt64() int64 {
37 | return int64(any.val)
38 | }
39 |
40 | func (any *uint64Any) ToUint() uint {
41 | return uint(any.val)
42 | }
43 |
44 | func (any *uint64Any) ToUint32() uint32 {
45 | return uint32(any.val)
46 | }
47 |
48 | func (any *uint64Any) ToUint64() uint64 {
49 | return any.val
50 | }
51 |
52 | func (any *uint64Any) ToFloat32() float32 {
53 | return float32(any.val)
54 | }
55 |
56 | func (any *uint64Any) ToFloat64() float64 {
57 | return float64(any.val)
58 | }
59 |
60 | func (any *uint64Any) ToString() string {
61 | return strconv.FormatUint(any.val, 10)
62 | }
63 |
64 | func (any *uint64Any) WriteTo(stream *Stream) {
65 | stream.WriteUint64(any.val)
66 | }
67 |
68 | func (any *uint64Any) Parse() *Iterator {
69 | return nil
70 | }
71 |
72 | func (any *uint64Any) GetInterface() interface{} {
73 | return any.val
74 | }
75 |
--------------------------------------------------------------------------------
/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/iter_array.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | // ReadArray read array element, tells if the array has more element to read.
4 | func (iter *Iterator) ReadArray() (ret bool) {
5 | c := iter.nextToken()
6 | switch c {
7 | case 'n':
8 | iter.skipThreeBytes('u', 'l', 'l')
9 | return false // null
10 | case '[':
11 | c = iter.nextToken()
12 | if c != ']' {
13 | iter.unreadByte()
14 | return true
15 | }
16 | return false
17 | case ']':
18 | return false
19 | case ',':
20 | return true
21 | default:
22 | iter.ReportError("ReadArray", "expect [ or , or ] or n, but found "+string([]byte{c}))
23 | return
24 | }
25 | }
26 |
27 | // ReadArrayCB read array with callback
28 | func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) {
29 | c := iter.nextToken()
30 | if c == '[' {
31 | c = iter.nextToken()
32 | if c != ']' {
33 | iter.unreadByte()
34 | if !callback(iter) {
35 | return false
36 | }
37 | c = iter.nextToken()
38 | for c == ',' {
39 | if !callback(iter) {
40 | return false
41 | }
42 | c = iter.nextToken()
43 | }
44 | if c != ']' {
45 | iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c}))
46 | return false
47 | }
48 | return true
49 | }
50 | return true
51 | }
52 | if c == 'n' {
53 | iter.skipThreeBytes('u', 'l', 'l')
54 | return true // null
55 | }
56 | iter.ReportError("ReadArrayCB", "expect [ or n, but found "+string([]byte{c}))
57 | return false
58 | }
59 |
--------------------------------------------------------------------------------
/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/reflect_dynamic.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "github.com/modern-go/reflect2"
5 | "reflect"
6 | "unsafe"
7 | )
8 |
9 | type dynamicEncoder struct {
10 | valType reflect2.Type
11 | }
12 |
13 | func (encoder *dynamicEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
14 | obj := encoder.valType.UnsafeIndirect(ptr)
15 | stream.WriteVal(obj)
16 | }
17 |
18 | func (encoder *dynamicEncoder) IsEmpty(ptr unsafe.Pointer) bool {
19 | return encoder.valType.UnsafeIndirect(ptr) == nil
20 | }
21 |
22 | type efaceDecoder struct {
23 | }
24 |
25 | func (decoder *efaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
26 | pObj := (*interface{})(ptr)
27 | obj := *pObj
28 | if obj == nil {
29 | *pObj = iter.Read()
30 | return
31 | }
32 | typ := reflect2.TypeOf(obj)
33 | if typ.Kind() != reflect.Ptr {
34 | *pObj = iter.Read()
35 | return
36 | }
37 | ptrType := typ.(*reflect2.UnsafePtrType)
38 | ptrElemType := ptrType.Elem()
39 | if iter.WhatIsNext() == NilValue {
40 | if ptrElemType.Kind() != reflect.Ptr {
41 | iter.skipFourBytes('n', 'u', 'l', 'l')
42 | *pObj = nil
43 | return
44 | }
45 | }
46 | if reflect2.IsNil(obj) {
47 | obj := ptrElemType.New()
48 | iter.ReadVal(obj)
49 | *pObj = obj
50 | return
51 | }
52 | iter.ReadVal(obj)
53 | }
54 |
55 | type ifaceDecoder struct {
56 | valType *reflect2.UnsafeIFaceType
57 | }
58 |
59 | func (decoder *ifaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
60 | if iter.ReadNil() {
61 | decoder.valType.UnsafeSet(ptr, decoder.valType.UnsafeNew())
62 | return
63 | }
64 | obj := decoder.valType.UnsafeIndirect(ptr)
65 | if reflect2.IsNil(obj) {
66 | iter.ReportError("decode non empty interface", "can not unmarshal into nil")
67 | return
68 | }
69 | iter.ReadVal(obj)
70 | }
71 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/reflect_json_raw_message.go:
--------------------------------------------------------------------------------
1 | package jsoniter
2 |
3 | import (
4 | "encoding/json"
5 | "github.com/modern-go/reflect2"
6 | "unsafe"
7 | )
8 |
9 | var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()
10 | var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()
11 |
12 | func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder {
13 | if typ == jsonRawMessageType {
14 | return &jsonRawMessageCodec{}
15 | }
16 | if typ == jsoniterRawMessageType {
17 | return &jsoniterRawMessageCodec{}
18 | }
19 | return nil
20 | }
21 |
22 | func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder {
23 | if typ == jsonRawMessageType {
24 | return &jsonRawMessageCodec{}
25 | }
26 | if typ == jsoniterRawMessageType {
27 | return &jsoniterRawMessageCodec{}
28 | }
29 | return nil
30 | }
31 |
32 | type jsonRawMessageCodec struct {
33 | }
34 |
35 | func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
36 | *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes())
37 | }
38 |
39 | func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
40 | stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
41 | }
42 |
43 | func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
44 | return len(*((*json.RawMessage)(ptr))) == 0
45 | }
46 |
47 | type jsoniterRawMessageCodec struct {
48 | }
49 |
50 | func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
51 | *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes())
52 | }
53 |
54 | func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
55 | stream.WriteRaw(string(*((*RawMessage)(ptr))))
56 | }
57 |
58 | func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
59 | return len(*((*RawMessage)(ptr))) == 0
60 | }
61 |
--------------------------------------------------------------------------------
/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/mattn/go-isatty/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - tip
4 |
5 | os:
6 | - linux
7 | - osx
8 |
9 | before_install:
10 | - go get github.com/mattn/goveralls
11 | - go get golang.org/x/tools/cmd/cover
12 | script:
13 | - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5
14 |
--------------------------------------------------------------------------------
/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://travis-ci.org/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 | require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
4 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/go.sum:
--------------------------------------------------------------------------------
1 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
2 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
3 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/isatty_android.go:
--------------------------------------------------------------------------------
1 | // +build android
2 |
3 | package isatty
4 |
5 | import (
6 | "syscall"
7 | "unsafe"
8 | )
9 |
10 | const ioctlReadTermios = syscall.TCGETS
11 |
12 | // IsTerminal return true if the file descriptor is terminal.
13 | func IsTerminal(fd uintptr) bool {
14 | var termios syscall.Termios
15 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
16 | return err == 0
17 | }
18 |
19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
20 | // terminal. This is also always false on this environment.
21 | func IsCygwinTerminal(fd uintptr) bool {
22 | return false
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/isatty_bsd.go:
--------------------------------------------------------------------------------
1 | // +build darwin freebsd openbsd netbsd dragonfly
2 | // +build !appengine
3 |
4 | package isatty
5 |
6 | import (
7 | "syscall"
8 | "unsafe"
9 | )
10 |
11 | const ioctlReadTermios = syscall.TIOCGETA
12 |
13 | // IsTerminal return true if the file descriptor is terminal.
14 | func IsTerminal(fd uintptr) bool {
15 | var termios syscall.Termios
16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
17 | return err == 0
18 | }
19 |
20 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
21 | // terminal. This is also always false on this environment.
22 | func IsCygwinTerminal(fd uintptr) bool {
23 | return false
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/isatty_linux.go:
--------------------------------------------------------------------------------
1 | // +build linux
2 | // +build !appengine
3 | // +build !android
4 |
5 | package isatty
6 |
7 | import "golang.org/x/sys/unix"
8 |
9 | // IsTerminal return true if the file descriptor is terminal.
10 | func IsTerminal(fd uintptr) bool {
11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
12 | return err == nil
13 | }
14 |
15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
16 | // terminal. This is also always false on this environment.
17 | func IsCygwinTerminal(fd uintptr) bool {
18 | return false
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/isatty_others.go:
--------------------------------------------------------------------------------
1 | // +build appengine js
2 |
3 | package isatty
4 |
5 | // IsTerminal returns true if the file descriptor is terminal which
6 | // is always false on js and appengine classic which is a sandboxed PaaS.
7 | func IsTerminal(fd uintptr) bool {
8 | return false
9 | }
10 |
11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
12 | // terminal. This is also always false on this environment.
13 | func IsCygwinTerminal(fd uintptr) bool {
14 | return false
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-isatty/isatty_solaris.go:
--------------------------------------------------------------------------------
1 | // +build solaris
2 | // +build !appengine
3 |
4 | package isatty
5 |
6 | import (
7 | "golang.org/x/sys/unix"
8 | )
9 |
10 | // IsTerminal returns true if the given file descriptor is a terminal.
11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c
12 | func IsTerminal(fd uintptr) bool {
13 | var termio unix.Termio
14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)
15 | return err == nil
16 | }
17 |
18 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
19 | // terminal. This is also always false on this environment.
20 | func IsCygwinTerminal(fd uintptr) bool {
21 | return false
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/.gitignore:
--------------------------------------------------------------------------------
1 | /coverage.txt
2 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/.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/modern-go/concurrent/README.md:
--------------------------------------------------------------------------------
1 | # concurrent
2 |
3 | [](https://sourcegraph.com/github.com/modern-go/concurrent?badge)
4 | [](http://godoc.org/github.com/modern-go/concurrent)
5 | [](https://travis-ci.org/modern-go/concurrent)
6 | [](https://codecov.io/gh/modern-go/concurrent)
7 | [](https://goreportcard.com/report/github.com/modern-go/concurrent)
8 | [](https://raw.githubusercontent.com/modern-go/concurrent/master/LICENSE)
9 |
10 | * concurrent.Map: backport sync.Map for go below 1.9
11 | * concurrent.Executor: goroutine with explicit ownership and cancellable
12 |
13 | # concurrent.Map
14 |
15 | because sync.Map is only available in go 1.9, we can use concurrent.Map to make code portable
16 |
17 | ```go
18 | m := concurrent.NewMap()
19 | m.Store("hello", "world")
20 | elem, found := m.Load("hello")
21 | // elem will be "world"
22 | // found will be true
23 | ```
24 |
25 | # concurrent.Executor
26 |
27 | ```go
28 | executor := concurrent.NewUnboundedExecutor()
29 | executor.Go(func(ctx context.Context) {
30 | everyMillisecond := time.NewTicker(time.Millisecond)
31 | for {
32 | select {
33 | case <-ctx.Done():
34 | fmt.Println("goroutine exited")
35 | return
36 | case <-everyMillisecond.C:
37 | // do something
38 | }
39 | }
40 | })
41 | time.Sleep(time.Second)
42 | executor.StopAndWaitForever()
43 | fmt.Println("executor stopped")
44 | ```
45 |
46 | attach goroutine to executor instance, so that we can
47 |
48 | * cancel it by stop the executor with Stop/StopAndWait/StopAndWaitForever
49 | * handle panic by callback: the default behavior will no longer crash your application
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/executor.go:
--------------------------------------------------------------------------------
1 | package concurrent
2 |
3 | import "context"
4 |
5 | // Executor replace go keyword to start a new goroutine
6 | // the goroutine should cancel itself if the context passed in has been cancelled
7 | // the goroutine started by the executor, is owned by the executor
8 | // we can cancel all executors owned by the executor just by stop the executor itself
9 | // however Executor interface does not Stop method, the one starting and owning executor
10 | // should use the concrete type of executor, instead of this interface.
11 | type Executor interface {
12 | // Go starts a new goroutine controlled by the context
13 | Go(handler func(ctx context.Context))
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/go_above_19.go:
--------------------------------------------------------------------------------
1 | //+build go1.9
2 |
3 | package concurrent
4 |
5 | import "sync"
6 |
7 | // Map is a wrapper for sync.Map introduced in go1.9
8 | type Map struct {
9 | sync.Map
10 | }
11 |
12 | // NewMap creates a thread safe Map
13 | func NewMap() *Map {
14 | return &Map{}
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/go_below_19.go:
--------------------------------------------------------------------------------
1 | //+build !go1.9
2 |
3 | package concurrent
4 |
5 | import "sync"
6 |
7 | // Map implements a thread safe map for go version below 1.9 using mutex
8 | type Map struct {
9 | lock sync.RWMutex
10 | data map[interface{}]interface{}
11 | }
12 |
13 | // NewMap creates a thread safe map
14 | func NewMap() *Map {
15 | return &Map{
16 | data: make(map[interface{}]interface{}, 32),
17 | }
18 | }
19 |
20 | // Load is same as sync.Map Load
21 | func (m *Map) Load(key interface{}) (elem interface{}, found bool) {
22 | m.lock.RLock()
23 | elem, found = m.data[key]
24 | m.lock.RUnlock()
25 | return
26 | }
27 |
28 | // Load is same as sync.Map Store
29 | func (m *Map) Store(key interface{}, elem interface{}) {
30 | m.lock.Lock()
31 | m.data[key] = elem
32 | m.lock.Unlock()
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/log.go:
--------------------------------------------------------------------------------
1 | package concurrent
2 |
3 | import (
4 | "os"
5 | "log"
6 | "io/ioutil"
7 | )
8 |
9 | // ErrorLogger is used to print out error, can be set to writer other than stderr
10 | var ErrorLogger = log.New(os.Stderr, "", 0)
11 |
12 | // InfoLogger is used to print informational message, default to off
13 | var InfoLogger = log.New(ioutil.Discard, "", 0)
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/concurrent/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/modern-go/concurrent $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/.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/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/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/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_386.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_arm.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_arm.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_arm64.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_arm64.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_s390x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/github.com/modern-go/reflect2/relfect2_s390x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/safe_field.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type safeField struct {
9 | reflect.StructField
10 | }
11 |
12 | func (field *safeField) Offset() uintptr {
13 | return field.StructField.Offset
14 | }
15 |
16 | func (field *safeField) Name() string {
17 | return field.StructField.Name
18 | }
19 |
20 | func (field *safeField) PkgPath() string {
21 | return field.StructField.PkgPath
22 | }
23 |
24 | func (field *safeField) Type() Type {
25 | panic("not implemented")
26 | }
27 |
28 | func (field *safeField) Tag() reflect.StructTag {
29 | return field.StructField.Tag
30 | }
31 |
32 | func (field *safeField) Index() []int {
33 | return field.StructField.Index
34 | }
35 |
36 | func (field *safeField) Anonymous() bool {
37 | return field.StructField.Anonymous
38 | }
39 |
40 | func (field *safeField) Set(obj interface{}, value interface{}) {
41 | val := reflect.ValueOf(obj).Elem()
42 | val.FieldByIndex(field.Index()).Set(reflect.ValueOf(value).Elem())
43 | }
44 |
45 | func (field *safeField) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) {
46 | panic("unsafe operation is not supported")
47 | }
48 |
49 | func (field *safeField) Get(obj interface{}) interface{} {
50 | val := reflect.ValueOf(obj).Elem().FieldByIndex(field.Index())
51 | ptr := reflect.New(val.Type())
52 | ptr.Elem().Set(val)
53 | return ptr.Interface()
54 | }
55 |
56 | func (field *safeField) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer {
57 | panic("does not support unsafe operation")
58 | }
59 |
--------------------------------------------------------------------------------
/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/safe_type.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type safeType struct {
9 | reflect.Type
10 | cfg *frozenConfig
11 | }
12 |
13 | func (type2 *safeType) New() interface{} {
14 | return reflect.New(type2.Type).Interface()
15 | }
16 |
17 | func (type2 *safeType) UnsafeNew() unsafe.Pointer {
18 | panic("does not support unsafe operation")
19 | }
20 |
21 | func (type2 *safeType) Elem() Type {
22 | return type2.cfg.Type2(type2.Type.Elem())
23 | }
24 |
25 | func (type2 *safeType) Type1() reflect.Type {
26 | return type2.Type
27 | }
28 |
29 | func (type2 *safeType) PackEFace(ptr unsafe.Pointer) interface{} {
30 | panic("does not support unsafe operation")
31 | }
32 |
33 | func (type2 *safeType) Implements(thatType Type) bool {
34 | return type2.Type.Implements(thatType.Type1())
35 | }
36 |
37 | func (type2 *safeType) RType() uintptr {
38 | panic("does not support unsafe operation")
39 | }
40 |
41 | func (type2 *safeType) Indirect(obj interface{}) interface{} {
42 | return reflect.Indirect(reflect.ValueOf(obj)).Interface()
43 | }
44 |
45 | func (type2 *safeType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
46 | panic("does not support unsafe operation")
47 | }
48 |
49 | func (type2 *safeType) LikePtr() bool {
50 | panic("does not support unsafe operation")
51 | }
52 |
53 | func (type2 *safeType) IsNullable() bool {
54 | return IsNullable(type2.Kind())
55 | }
56 |
57 | func (type2 *safeType) IsNil(obj interface{}) bool {
58 | if obj == nil {
59 | return true
60 | }
61 | return reflect.ValueOf(obj).Elem().IsNil()
62 | }
63 |
64 | func (type2 *safeType) UnsafeIsNil(ptr unsafe.Pointer) bool {
65 | panic("does not support unsafe operation")
66 | }
67 |
68 | func (type2 *safeType) Set(obj interface{}, val interface{}) {
69 | reflect.ValueOf(obj).Elem().Set(reflect.ValueOf(val).Elem())
70 | }
71 |
72 | func (type2 *safeType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) {
73 | panic("does not support unsafe operation")
74 | }
75 |
76 | func (type2 *safeType) AssignableTo(anotherType Type) bool {
77 | return type2.Type1().AssignableTo(anotherType.Type1())
78 | }
79 |
--------------------------------------------------------------------------------
/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_array.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type UnsafeArrayType struct {
9 | unsafeType
10 | elemRType unsafe.Pointer
11 | pElemRType unsafe.Pointer
12 | elemSize uintptr
13 | likePtr bool
14 | }
15 |
16 | func newUnsafeArrayType(cfg *frozenConfig, type1 reflect.Type) *UnsafeArrayType {
17 | return &UnsafeArrayType{
18 | unsafeType: *newUnsafeType(cfg, type1),
19 | elemRType: unpackEFace(type1.Elem()).data,
20 | pElemRType: unpackEFace(reflect.PtrTo(type1.Elem())).data,
21 | elemSize: type1.Elem().Size(),
22 | likePtr: likePtrType(type1),
23 | }
24 | }
25 |
26 | func (type2 *UnsafeArrayType) LikePtr() bool {
27 | return type2.likePtr
28 | }
29 |
30 | func (type2 *UnsafeArrayType) Indirect(obj interface{}) interface{} {
31 | objEFace := unpackEFace(obj)
32 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
33 | return type2.UnsafeIndirect(objEFace.data)
34 | }
35 |
36 | func (type2 *UnsafeArrayType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
37 | if type2.likePtr {
38 | return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
39 | }
40 | return packEFace(type2.rtype, ptr)
41 | }
42 |
43 | func (type2 *UnsafeArrayType) SetIndex(obj interface{}, index int, elem interface{}) {
44 | objEFace := unpackEFace(obj)
45 | assertType("ArrayType.SetIndex argument 1", type2.ptrRType, objEFace.rtype)
46 | elemEFace := unpackEFace(elem)
47 | assertType("ArrayType.SetIndex argument 3", type2.pElemRType, elemEFace.rtype)
48 | type2.UnsafeSetIndex(objEFace.data, index, elemEFace.data)
49 | }
50 |
51 | func (type2 *UnsafeArrayType) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) {
52 | elemPtr := arrayAt(obj, index, type2.elemSize, "i < s.Len")
53 | typedmemmove(type2.elemRType, elemPtr, elem)
54 | }
55 |
56 | func (type2 *UnsafeArrayType) GetIndex(obj interface{}, index int) interface{} {
57 | objEFace := unpackEFace(obj)
58 | assertType("ArrayType.GetIndex argument 1", type2.ptrRType, objEFace.rtype)
59 | elemPtr := type2.UnsafeGetIndex(objEFace.data, index)
60 | return packEFace(type2.pElemRType, elemPtr)
61 | }
62 |
63 | func (type2 *UnsafeArrayType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer {
64 | return arrayAt(obj, index, type2.elemSize, "i < s.Len")
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/unsafe_eface.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type eface struct {
9 | rtype unsafe.Pointer
10 | data unsafe.Pointer
11 | }
12 |
13 | func unpackEFace(obj interface{}) *eface {
14 | return (*eface)(unsafe.Pointer(&obj))
15 | }
16 |
17 | func packEFace(rtype unsafe.Pointer, data unsafe.Pointer) interface{} {
18 | var i interface{}
19 | e := (*eface)(unsafe.Pointer(&i))
20 | e.rtype = rtype
21 | e.data = data
22 | return i
23 | }
24 |
25 | type UnsafeEFaceType struct {
26 | unsafeType
27 | }
28 |
29 | func newUnsafeEFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeEFaceType {
30 | return &UnsafeEFaceType{
31 | unsafeType: *newUnsafeType(cfg, type1),
32 | }
33 | }
34 |
35 | func (type2 *UnsafeEFaceType) IsNil(obj interface{}) bool {
36 | if obj == nil {
37 | return true
38 | }
39 | objEFace := unpackEFace(obj)
40 | assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
41 | return type2.UnsafeIsNil(objEFace.data)
42 | }
43 |
44 | func (type2 *UnsafeEFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool {
45 | if ptr == nil {
46 | return true
47 | }
48 | return unpackEFace(*(*interface{})(ptr)).data == nil
49 | }
50 |
51 | func (type2 *UnsafeEFaceType) Indirect(obj interface{}) interface{} {
52 | objEFace := unpackEFace(obj)
53 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
54 | return type2.UnsafeIndirect(objEFace.data)
55 | }
56 |
57 | func (type2 *UnsafeEFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
58 | return *(*interface{})(ptr)
59 | }
60 |
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/unsafe_iface.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type iface struct {
9 | itab *itab
10 | data unsafe.Pointer
11 | }
12 |
13 | type itab struct {
14 | ignore unsafe.Pointer
15 | rtype unsafe.Pointer
16 | }
17 |
18 | func IFaceToEFace(ptr unsafe.Pointer) interface{} {
19 | iface := (*iface)(ptr)
20 | if iface.itab == nil {
21 | return nil
22 | }
23 | return packEFace(iface.itab.rtype, iface.data)
24 | }
25 |
26 | type UnsafeIFaceType struct {
27 | unsafeType
28 | }
29 |
30 | func newUnsafeIFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeIFaceType {
31 | return &UnsafeIFaceType{
32 | unsafeType: *newUnsafeType(cfg, type1),
33 | }
34 | }
35 |
36 | func (type2 *UnsafeIFaceType) Indirect(obj interface{}) interface{} {
37 | objEFace := unpackEFace(obj)
38 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
39 | return type2.UnsafeIndirect(objEFace.data)
40 | }
41 |
42 | func (type2 *UnsafeIFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
43 | return IFaceToEFace(ptr)
44 | }
45 |
46 | func (type2 *UnsafeIFaceType) IsNil(obj interface{}) bool {
47 | if obj == nil {
48 | return true
49 | }
50 | objEFace := unpackEFace(obj)
51 | assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
52 | return type2.UnsafeIsNil(objEFace.data)
53 | }
54 |
55 | func (type2 *UnsafeIFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool {
56 | if ptr == nil {
57 | return true
58 | }
59 | iface := (*iface)(ptr)
60 | if iface.itab == nil {
61 | return true
62 | }
63 | return false
64 | }
65 |
--------------------------------------------------------------------------------
/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/modern-go/reflect2/unsafe_struct.go:
--------------------------------------------------------------------------------
1 | package reflect2
2 |
3 | import (
4 | "reflect"
5 | "unsafe"
6 | )
7 |
8 | type UnsafeStructType struct {
9 | unsafeType
10 | likePtr bool
11 | }
12 |
13 | func newUnsafeStructType(cfg *frozenConfig, type1 reflect.Type) *UnsafeStructType {
14 | return &UnsafeStructType{
15 | unsafeType: *newUnsafeType(cfg, type1),
16 | likePtr: likePtrType(type1),
17 | }
18 | }
19 |
20 | func (type2 *UnsafeStructType) LikePtr() bool {
21 | return type2.likePtr
22 | }
23 |
24 | func (type2 *UnsafeStructType) Indirect(obj interface{}) interface{} {
25 | objEFace := unpackEFace(obj)
26 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
27 | return type2.UnsafeIndirect(objEFace.data)
28 | }
29 |
30 | func (type2 *UnsafeStructType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
31 | if type2.likePtr {
32 | return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
33 | }
34 | return packEFace(type2.rtype, ptr)
35 | }
36 |
37 | func (type2 *UnsafeStructType) FieldByName(name string) StructField {
38 | structField, found := type2.Type.FieldByName(name)
39 | if !found {
40 | return nil
41 | }
42 | return newUnsafeStructField(type2, structField)
43 | }
44 |
45 | func (type2 *UnsafeStructType) Field(i int) StructField {
46 | return newUnsafeStructField(type2, type2.Type.Field(i))
47 | }
48 |
49 | func (type2 *UnsafeStructType) FieldByIndex(index []int) StructField {
50 | return newUnsafeStructField(type2, type2.Type.FieldByIndex(index))
51 | }
52 |
53 | func (type2 *UnsafeStructType) FieldByNameFunc(match func(string) bool) StructField {
54 | structField, found := type2.Type.FieldByNameFunc(match)
55 | if !found {
56 | panic("field match condition not found in " + type2.Type.String())
57 | }
58 | return newUnsafeStructField(type2, structField)
59 | }
60 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012-2015 Ugorji Nwoke.
4 | All rights reserved.
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/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/codecgen.go:
--------------------------------------------------------------------------------
1 | // +build codecgen generated
2 |
3 | package codec
4 |
5 | // this file is here, to set the codecgen variable to true
6 | // when the build tag codecgen is set.
7 | //
8 | // this allows us do specific things e.g. skip missing fields tests,
9 | // when running in codecgen mode.
10 |
11 | func init() {
12 | codecgen = true
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/fast-path.not.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build notfastpath
5 |
6 | package codec
7 |
8 | import "reflect"
9 |
10 | const fastpathEnabled = false
11 |
12 | // The generated fast-path code is very large, and adds a few seconds to the build time.
13 | // This causes test execution, execution of small tools which use codec, etc
14 | // to take a long time.
15 | //
16 | // To mitigate, we now support the notfastpath tag.
17 | // This tag disables fastpath during build, allowing for faster build, test execution,
18 | // short-program runs, etc.
19 |
20 | func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false }
21 | func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false }
22 | func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false }
23 | func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false }
24 | func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false }
25 |
26 | type fastpathT struct{}
27 | type fastpathE struct {
28 | rtid uintptr
29 | rt reflect.Type
30 | encfn func(*Encoder, *codecFnInfo, reflect.Value)
31 | decfn func(*Decoder, *codecFnInfo, reflect.Value)
32 | }
33 | type fastpathA [0]fastpathE
34 |
35 | func (x fastpathA) index(rtid uintptr) int { return -1 }
36 |
37 | func (_ fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) {
38 | fn := d.h.fn(uint8SliceTyp, true, true)
39 | d.kSlice(&fn.i, reflect.ValueOf(&v).Elem())
40 | return v, true
41 | }
42 |
43 | var fastpathAV fastpathA
44 | var fastpathTV fastpathT
45 |
46 | // ----
47 | type TestMammoth2Wrapper struct{} // to allow testMammoth work in notfastpath mode
48 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl:
--------------------------------------------------------------------------------
1 | {{.Label}}:
2 | switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; {
3 | case timeout{{.Sfx}} == 0: // only consume available
4 | for {
5 | select {
6 | case b{{.Sfx}} := <-{{.Chan}}:
7 | {{ .Slice }} = append({{.Slice}}, b{{.Sfx}})
8 | default:
9 | break {{.Label}}
10 | }
11 | }
12 | case timeout{{.Sfx}} > 0: // consume until timeout
13 | tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}})
14 | for {
15 | select {
16 | case b{{.Sfx}} := <-{{.Chan}}:
17 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}})
18 | case <-tt{{.Sfx}}.C:
19 | // close(tt.C)
20 | break {{.Label}}
21 | }
22 | }
23 | default: // consume until close
24 | for b{{.Sfx}} := range {{.Chan}} {
25 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}})
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build go1.5
5 |
6 | package codec
7 |
8 | import "reflect"
9 |
10 | const reflectArrayOfSupported = true
11 |
12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type {
13 | return reflect.ArrayOf(count, elem)
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build !go1.5
5 |
6 | package codec
7 |
8 | import "reflect"
9 |
10 | const reflectArrayOfSupported = false
11 |
12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type {
13 | panic("codec: reflect.ArrayOf unsupported in this go version")
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build go1.9
5 |
6 | package codec
7 |
8 | import "reflect"
9 |
10 | func makeMapReflect(t reflect.Type, size int) reflect.Value {
11 | if size < 0 {
12 | return reflect.MakeMapWithSize(t, 4)
13 | }
14 | return reflect.MakeMapWithSize(t, size)
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build !go1.9
5 |
6 | package codec
7 |
8 | import "reflect"
9 |
10 | func makeMapReflect(t reflect.Type, size int) reflect.Value {
11 | return reflect.MakeMap(t)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build go1.10
5 |
6 | package codec
7 |
8 | const allowSetUnexportedEmbeddedPtr = false
9 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build !go1.10
5 |
6 | package codec
7 |
8 | const allowSetUnexportedEmbeddedPtr = true
9 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build !go1.4
5 |
6 | package codec
7 |
8 | // This codec package will only work for go1.4 and above.
9 | // This is for the following reasons:
10 | // - go 1.4 was released in 2014
11 | // - go runtime is written fully in go
12 | // - interface only holds pointers
13 | // - reflect.Value is stabilized as 3 words
14 |
15 | func init() {
16 | panic("codec: go 1.3 and below are not supported")
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build go1.5,!go1.6
5 |
6 | package codec
7 |
8 | import "os"
9 |
10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1"
11 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build go1.6,!go1.7
5 |
6 | package codec
7 |
8 | import "os"
9 |
10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0"
11 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build go1.7
5 |
6 | package codec
7 |
8 | const genCheckVendor = true
9 |
--------------------------------------------------------------------------------
/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
2 | // Use of this source code is governed by a MIT license found in the LICENSE file.
3 |
4 | // +build !go1.5
5 |
6 | package codec
7 |
8 | var genCheckVendor = false
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/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/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/.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_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for 386, Linux
11 | //
12 |
13 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
14 | // instead of the glibc-specific "CALL 0x10(GS)".
15 | #define INVOKE_SYSCALL INT $0x80
16 |
17 | // Just jump to package syscall's implementation for all these functions.
18 | // The runtime may know about them.
19 |
20 | TEXT ·Syscall(SB),NOSPLIT,$0-28
21 | JMP syscall·Syscall(SB)
22 |
23 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
24 | JMP syscall·Syscall6(SB)
25 |
26 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
27 | CALL runtime·entersyscall(SB)
28 | MOVL trap+0(FP), AX // syscall entry
29 | MOVL a1+4(FP), BX
30 | MOVL a2+8(FP), CX
31 | MOVL a3+12(FP), DX
32 | MOVL $0, SI
33 | MOVL $0, DI
34 | INVOKE_SYSCALL
35 | MOVL AX, r1+16(FP)
36 | MOVL DX, r2+20(FP)
37 | CALL runtime·exitsyscall(SB)
38 | RET
39 |
40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
41 | JMP syscall·RawSyscall(SB)
42 |
43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
44 | JMP syscall·RawSyscall6(SB)
45 |
46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
47 | MOVL trap+0(FP), AX // syscall entry
48 | MOVL a1+4(FP), BX
49 | MOVL a2+8(FP), CX
50 | MOVL a3+12(FP), DX
51 | MOVL $0, SI
52 | MOVL $0, DI
53 | INVOKE_SYSCALL
54 | MOVL AX, r1+16(FP)
55 | MOVL DX, r2+20(FP)
56 | RET
57 |
58 | TEXT ·socketcall(SB),NOSPLIT,$0-36
59 | JMP syscall·socketcall(SB)
60 |
61 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
62 | JMP syscall·rawsocketcall(SB)
63 |
64 | TEXT ·seek(SB),NOSPLIT,$0-28
65 | JMP syscall·seek(SB)
66 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for AMD64, Linux
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
23 | CALL runtime·entersyscall(SB)
24 | MOVQ a1+8(FP), DI
25 | MOVQ a2+16(FP), SI
26 | MOVQ a3+24(FP), DX
27 | MOVQ $0, R10
28 | MOVQ $0, R8
29 | MOVQ $0, R9
30 | MOVQ trap+0(FP), AX // syscall entry
31 | SYSCALL
32 | MOVQ AX, r1+32(FP)
33 | MOVQ DX, r2+40(FP)
34 | CALL runtime·exitsyscall(SB)
35 | RET
36 |
37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
38 | JMP syscall·RawSyscall(SB)
39 |
40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
41 | JMP syscall·RawSyscall6(SB)
42 |
43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
44 | MOVQ a1+8(FP), DI
45 | MOVQ a2+16(FP), SI
46 | MOVQ a3+24(FP), DX
47 | MOVQ $0, R10
48 | MOVQ $0, R8
49 | MOVQ $0, R9
50 | MOVQ trap+0(FP), AX // syscall entry
51 | SYSCALL
52 | MOVQ AX, r1+32(FP)
53 | MOVQ DX, r2+40(FP)
54 | RET
55 |
56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16
57 | JMP syscall·gettimeofday(SB)
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for arm, Linux
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
23 | BL runtime·entersyscall(SB)
24 | MOVW trap+0(FP), R7
25 | MOVW a1+4(FP), R0
26 | MOVW a2+8(FP), R1
27 | MOVW a3+12(FP), R2
28 | MOVW $0, R3
29 | MOVW $0, R4
30 | MOVW $0, R5
31 | SWI $0
32 | MOVW R0, r1+16(FP)
33 | MOVW $0, R0
34 | MOVW R0, r2+20(FP)
35 | BL runtime·exitsyscall(SB)
36 | RET
37 |
38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
39 | B syscall·RawSyscall(SB)
40 |
41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
42 | B syscall·RawSyscall6(SB)
43 |
44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
45 | MOVW trap+0(FP), R7 // syscall entry
46 | MOVW a1+4(FP), R0
47 | MOVW a2+8(FP), R1
48 | MOVW a3+12(FP), R2
49 | SWI $0
50 | MOVW R0, r1+16(FP)
51 | MOVW $0, R0
52 | MOVW R0, r2+20(FP)
53 | RET
54 |
55 | TEXT ·seek(SB),NOSPLIT,$0-28
56 | B syscall·seek(SB)
57 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build arm64
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | // Just jump to package syscall's implementation for all these functions.
12 | // The runtime may know about them.
13 |
14 | TEXT ·Syscall(SB),NOSPLIT,$0-56
15 | B syscall·Syscall(SB)
16 |
17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
18 | B syscall·Syscall6(SB)
19 |
20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
21 | BL runtime·entersyscall(SB)
22 | MOVD a1+8(FP), R0
23 | MOVD a2+16(FP), R1
24 | MOVD a3+24(FP), R2
25 | MOVD $0, R3
26 | MOVD $0, R4
27 | MOVD $0, R5
28 | MOVD trap+0(FP), R8 // syscall entry
29 | SVC
30 | MOVD R0, r1+32(FP) // r1
31 | MOVD R1, r2+40(FP) // r2
32 | BL runtime·exitsyscall(SB)
33 | RET
34 |
35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
36 | B syscall·RawSyscall(SB)
37 |
38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
39 | B syscall·RawSyscall6(SB)
40 |
41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
42 | MOVD a1+8(FP), R0
43 | MOVD a2+16(FP), R1
44 | MOVD a3+24(FP), R2
45 | MOVD $0, R3
46 | MOVD $0, R4
47 | MOVD $0, R5
48 | MOVD trap+0(FP), R8 // syscall entry
49 | SVC
50 | MOVD R0, r1+32(FP)
51 | MOVD R1, r2+40(FP)
52 | RET
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build mips64 mips64le
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for mips64, Linux
13 | //
14 |
15 | // Just jump to package syscall's implementation for all these functions.
16 | // The runtime may know about them.
17 |
18 | TEXT ·Syscall(SB),NOSPLIT,$0-56
19 | JMP syscall·Syscall(SB)
20 |
21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
22 | JMP syscall·Syscall6(SB)
23 |
24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
25 | JAL runtime·entersyscall(SB)
26 | MOVV a1+8(FP), R4
27 | MOVV a2+16(FP), R5
28 | MOVV a3+24(FP), R6
29 | MOVV R0, R7
30 | MOVV R0, R8
31 | MOVV R0, R9
32 | MOVV trap+0(FP), R2 // syscall entry
33 | SYSCALL
34 | MOVV R2, r1+32(FP)
35 | MOVV R3, r2+40(FP)
36 | JAL runtime·exitsyscall(SB)
37 | RET
38 |
39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
40 | JMP syscall·RawSyscall(SB)
41 |
42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
43 | JMP syscall·RawSyscall6(SB)
44 |
45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
46 | MOVV a1+8(FP), R4
47 | MOVV a2+16(FP), R5
48 | MOVV a3+24(FP), R6
49 | MOVV R0, R7
50 | MOVV R0, R8
51 | MOVV R0, R9
52 | MOVV trap+0(FP), R2 // syscall entry
53 | SYSCALL
54 | MOVV R2, r1+32(FP)
55 | MOVV R3, r2+40(FP)
56 | RET
57 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build mips mipsle
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for mips, Linux
13 | //
14 |
15 | // Just jump to package syscall's implementation for all these functions.
16 | // The runtime may know about them.
17 |
18 | TEXT ·Syscall(SB),NOSPLIT,$0-28
19 | JMP syscall·Syscall(SB)
20 |
21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
22 | JMP syscall·Syscall6(SB)
23 |
24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
25 | JMP syscall·Syscall9(SB)
26 |
27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
28 | JAL runtime·entersyscall(SB)
29 | MOVW a1+4(FP), R4
30 | MOVW a2+8(FP), R5
31 | MOVW a3+12(FP), R6
32 | MOVW R0, R7
33 | MOVW trap+0(FP), R2 // syscall entry
34 | SYSCALL
35 | MOVW R2, r1+16(FP) // r1
36 | MOVW R3, r2+20(FP) // r2
37 | JAL runtime·exitsyscall(SB)
38 | RET
39 |
40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
41 | JMP syscall·RawSyscall(SB)
42 |
43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
44 | JMP syscall·RawSyscall6(SB)
45 |
46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
47 | MOVW a1+4(FP), R4
48 | MOVW a2+8(FP), R5
49 | MOVW a3+12(FP), R6
50 | MOVW trap+0(FP), R2 // syscall entry
51 | SYSCALL
52 | MOVW R2, r1+16(FP)
53 | MOVW R3, r2+20(FP)
54 | RET
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build ppc64 ppc64le
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for ppc64, Linux
13 | //
14 |
15 | // Just jump to package syscall's implementation for all these functions.
16 | // The runtime may know about them.
17 |
18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
19 | BL runtime·entersyscall(SB)
20 | MOVD a1+8(FP), R3
21 | MOVD a2+16(FP), R4
22 | MOVD a3+24(FP), R5
23 | MOVD R0, R6
24 | MOVD R0, R7
25 | MOVD R0, R8
26 | MOVD trap+0(FP), R9 // syscall entry
27 | SYSCALL R9
28 | MOVD R3, r1+32(FP)
29 | MOVD R4, r2+40(FP)
30 | BL runtime·exitsyscall(SB)
31 | RET
32 |
33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
34 | MOVD a1+8(FP), R3
35 | MOVD a2+16(FP), R4
36 | MOVD a3+24(FP), R5
37 | MOVD R0, R6
38 | MOVD R0, R7
39 | MOVD R0, R8
40 | MOVD trap+0(FP), R9 // syscall entry
41 | SYSCALL R9
42 | MOVD R3, r1+32(FP)
43 | MOVD R4, r2+40(FP)
44 | RET
45 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_s390x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build s390x
6 | // +build linux
7 | // +build !gccgo
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for s390x, Linux
13 | //
14 |
15 | // Just jump to package syscall's implementation for all these functions.
16 | // The runtime may know about them.
17 |
18 | TEXT ·Syscall(SB),NOSPLIT,$0-56
19 | BR syscall·Syscall(SB)
20 |
21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
22 | BR syscall·Syscall6(SB)
23 |
24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
25 | BL runtime·entersyscall(SB)
26 | MOVD a1+8(FP), R2
27 | MOVD a2+16(FP), R3
28 | MOVD a3+24(FP), R4
29 | MOVD $0, R5
30 | MOVD $0, R6
31 | MOVD $0, R7
32 | MOVD trap+0(FP), R1 // syscall entry
33 | SYSCALL
34 | MOVD R2, r1+32(FP)
35 | MOVD R3, r2+40(FP)
36 | BL runtime·exitsyscall(SB)
37 | RET
38 |
39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
40 | BR syscall·RawSyscall(SB)
41 |
42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
43 | BR syscall·RawSyscall6(SB)
44 |
45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
46 | MOVD a1+8(FP), R2
47 | MOVD a2+16(FP), R3
48 | MOVD a3+24(FP), R4
49 | MOVD $0, R5
50 | MOVD $0, R6
51 | MOVD $0, R7
52 | MOVD trap+0(FP), R1 // syscall entry
53 | SYSCALL
54 | MOVD R2, r1+32(FP)
55 | MOVD R3, r2+40(FP)
56 | RET
57 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for 386, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM64, NetBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for 386, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for AMD64, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System call support for ARM, OpenBSD
11 | //
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gccgo
6 |
7 | #include "textflag.h"
8 |
9 | //
10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
11 | //
12 |
13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88
14 | JMP syscall·sysvicall6(SB)
15 |
16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
17 | JMP syscall·rawSysvicall6(SB)
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/bluetooth_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Bluetooth sockets and messages
6 |
7 | package unix
8 |
9 | // Bluetooth Protocols
10 | const (
11 | BTPROTO_L2CAP = 0
12 | BTPROTO_HCI = 1
13 | BTPROTO_SCO = 2
14 | BTPROTO_RFCOMM = 3
15 | BTPROTO_BNEP = 4
16 | BTPROTO_CMTP = 5
17 | BTPROTO_HIDP = 6
18 | BTPROTO_AVDTP = 7
19 | )
20 |
21 | const (
22 | HCI_CHANNEL_RAW = 0
23 | HCI_CHANNEL_USER = 1
24 | HCI_CHANNEL_MONITOR = 2
25 | HCI_CHANNEL_CONTROL = 3
26 | )
27 |
28 | // Socketoption Level
29 | const (
30 | SOL_BLUETOOTH = 0x112
31 | SOL_HCI = 0x0
32 | SOL_L2CAP = 0x6
33 | SOL_RFCOMM = 0x12
34 | SOL_SCO = 0x11
35 | )
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/constants.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | const (
10 | R_OK = 0x4
11 | W_OK = 0x2
12 | X_OK = 0x1
13 | )
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix
6 | // +build ppc
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used by AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev >> 16) & 0xffff)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32(dev & 0xffff)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | return uint64(((major) << 16) | (minor))
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix
6 | // +build ppc64
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev & 0x3fffffff00000000) >> 32)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32((dev & 0x00000000ffffffff) >> 0)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | var DEVNO64 uint64
27 | DEVNO64 = 0x8000000000000000
28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Darwin's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a Darwin device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev >> 24) & 0xff)
13 | }
14 |
15 | // Minor returns the minor component of a Darwin device number.
16 | func Minor(dev uint64) uint32 {
17 | return uint32(dev & 0xffffff)
18 | }
19 |
20 | // Mkdev returns a Darwin device number generated from the given major and minor
21 | // components.
22 | func Mkdev(major, minor uint32) uint64 {
23 | return (uint64(major) << 24) | uint64(minor)
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Dragonfly's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a DragonFlyBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a DragonFlyBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_freebsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in FreeBSD's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a FreeBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a FreeBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a FreeBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used by the Linux kernel and glibc.
7 | //
8 | // The information below is extracted and adapted from bits/sysmacros.h in the
9 | // glibc sources:
10 | //
11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
13 | // number and m is a hex digit of the minor number. This is backward compatible
14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
15 | // backward compatible with the Linux kernel, which for some architectures uses
16 | // 32-bit dev_t, encoded as mmmM MMmm.
17 |
18 | package unix
19 |
20 | // Major returns the major component of a Linux device number.
21 | func Major(dev uint64) uint32 {
22 | major := uint32((dev & 0x00000000000fff00) >> 8)
23 | major |= uint32((dev & 0xfffff00000000000) >> 32)
24 | return major
25 | }
26 |
27 | // Minor returns the minor component of a Linux device number.
28 | func Minor(dev uint64) uint32 {
29 | minor := uint32((dev & 0x00000000000000ff) >> 0)
30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12)
31 | return minor
32 | }
33 |
34 | // Mkdev returns a Linux device number generated from the given major and minor
35 | // components.
36 | func Mkdev(major, minor uint32) uint64 {
37 | dev := (uint64(major) & 0x00000fff) << 8
38 | dev |= (uint64(major) & 0xfffff000) << 32
39 | dev |= (uint64(minor) & 0x000000ff) << 0
40 | dev |= (uint64(minor) & 0xffffff00) << 12
41 | return dev
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_netbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in NetBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a NetBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x000fff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of a NetBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xfff00000) >> 12)
19 | return minor
20 | }
21 |
22 | // Mkdev returns a NetBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x000fff00
26 | dev |= (uint64(minor) << 12) & 0xfff00000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in OpenBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of an OpenBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x0000ff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of an OpenBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xffff0000) >> 8)
19 | return minor
20 | }
21 |
22 | // Mkdev returns an OpenBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x0000ff00
26 | dev |= (uint64(minor) << 8) & 0xffff0000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dirent.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | import "syscall"
10 |
11 | // ParseDirent parses up to max directory entries in buf,
12 | // appending the names to names. It returns the number of
13 | // bytes consumed from buf, the number of entries added
14 | // to names, and the new names slice.
15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
16 | return syscall.ParseDirent(buf, max, names)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/endian_big.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 | //
5 | // +build ppc64 s390x mips mips64
6 |
7 | package unix
8 |
9 | const isBigEndian = true
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/endian_little.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 | //
5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le
6 |
7 | package unix
8 |
9 | const isBigEndian = false
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/env_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | // Unix environment variables.
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | func Getenv(key string) (value string, found bool) {
14 | return syscall.Getenv(key)
15 | }
16 |
17 | func Setenv(key, value string) error {
18 | return syscall.Setenv(key, value)
19 | }
20 |
21 | func Clearenv() {
22 | syscall.Clearenv()
23 | }
24 |
25 | func Environ() []string {
26 | return syscall.Environ()
27 | }
28 |
29 | func Unsetenv(key string) error {
30 | return syscall.Unsetenv(key)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build dragonfly freebsd linux netbsd openbsd
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64.
13 | var fcntl64Syscall uintptr = SYS_FCNTL
14 |
15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
18 | var err error
19 | if errno != 0 {
20 | err = errno
21 | }
22 | return int(valptr), err
23 | }
24 |
25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
28 | if errno == 0 {
29 | return nil
30 | }
31 | return errno
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import "unsafe"
8 |
9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
11 | return fcntl(int(fd), cmd, arg)
12 | }
13 |
14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
17 | return err
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go:
--------------------------------------------------------------------------------
1 | // +build linux,386 linux,arm linux,mips linux,mipsle
2 |
3 | // Copyright 2014 The Go Authors. All rights reserved.
4 | // Use of this source code is governed by a BSD-style
5 | // license that can be found in the LICENSE file.
6 |
7 | package unix
8 |
9 | func init() {
10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's
11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL.
12 | fcntl64Syscall = SYS_FCNTL64
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo.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
6 | // +build !aix
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | // We can't use the gc-syntax .s files for gccgo. On the plus side
13 | // much of the functionality can be written directly in Go.
14 |
15 | //extern gccgoRealSyscallNoError
16 | func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr)
17 |
18 | //extern gccgoRealSyscall
19 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
20 |
21 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
22 | syscall.Entersyscall()
23 | r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
24 | syscall.Exitsyscall()
25 | return r, 0
26 | }
27 |
28 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
29 | syscall.Entersyscall()
30 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
31 | syscall.Exitsyscall()
32 | return r, 0, syscall.Errno(errno)
33 | }
34 |
35 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
36 | syscall.Entersyscall()
37 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
38 | syscall.Exitsyscall()
39 | return r, 0, syscall.Errno(errno)
40 | }
41 |
42 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) {
43 | syscall.Entersyscall()
44 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)
45 | syscall.Exitsyscall()
46 | return r, 0, syscall.Errno(errno)
47 | }
48 |
49 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
50 | r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
51 | return r, 0
52 | }
53 |
54 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
55 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
56 | return r, 0, syscall.Errno(errno)
57 | }
58 |
59 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
60 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
61 | return r, 0, syscall.Errno(errno)
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_c.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo
6 | // +build !aix
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | #define _STRINGIFY2_(x) #x
13 | #define _STRINGIFY_(x) _STRINGIFY2_(x)
14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
15 |
16 | // Call syscall from C code because the gccgo support for calling from
17 | // Go to C does not support varargs functions.
18 |
19 | struct ret {
20 | uintptr_t r;
21 | uintptr_t err;
22 | };
23 |
24 | struct ret
25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
26 | {
27 | struct ret r;
28 |
29 | errno = 0;
30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
31 | r.err = errno;
32 | return r;
33 | }
34 |
35 | uintptr_t
36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
37 | {
38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo,linux,amd64
6 |
7 | package unix
8 |
9 | import "syscall"
10 |
11 | //extern gettimeofday
12 | func realGettimeofday(*Timeval, *byte) int32
13 |
14 | func gettimeofday(tv *Timeval) (err syscall.Errno) {
15 | r := realGettimeofday(tv, nil)
16 | if r < 0 {
17 | return syscall.GetErrno()
18 | }
19 | return 0
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ioctl.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | import "runtime"
10 |
11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
12 | //
13 | // To change fd's window size, the req argument should be TIOCSWINSZ.
14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
15 | // TODO: if we get the chance, remove the req parameter and
16 | // hardcode TIOCSWINSZ.
17 | err := ioctlSetWinsize(fd, req, value)
18 | runtime.KeepAlive(value)
19 | return err
20 | }
21 |
22 | // IoctlSetTermios performs an ioctl on fd with a *Termios.
23 | //
24 | // The req value will usually be TCSETA or TIOCSETA.
25 | func IoctlSetTermios(fd int, req uint, value *Termios) error {
26 | // TODO: if we get the chance, remove the req parameter.
27 | err := ioctlSetTermios(fd, req, value)
28 | runtime.KeepAlive(value)
29 | return err
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/openbsd_unveil.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build openbsd
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | // Unveil implements the unveil syscall.
15 | // For more information see unveil(2).
16 | // Note that the special case of blocking further
17 | // unveil calls is handled by UnveilBlock.
18 | func Unveil(path string, flags string) error {
19 | pathPtr, err := syscall.BytePtrFromString(path)
20 | if err != nil {
21 | return err
22 | }
23 | flagsPtr, err := syscall.BytePtrFromString(flags)
24 | if err != nil {
25 | return err
26 | }
27 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0)
28 | if e != 0 {
29 | return e
30 | }
31 | return nil
32 | }
33 |
34 | // UnveilBlock blocks future unveil calls.
35 | // For more information see unveil(2).
36 | func UnveilBlock() error {
37 | // Both pointers must be nil.
38 | var pathUnsafe, flagsUnsafe unsafe.Pointer
39 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0)
40 | if e != 0 {
41 | return e
42 | }
43 | return nil
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/pagesize_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | // For Unix, get the pagesize from the runtime.
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | func Getpagesize() int {
14 | return syscall.Getpagesize()
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin,race linux,race freebsd,race
6 |
7 | package unix
8 |
9 | import (
10 | "runtime"
11 | "unsafe"
12 | )
13 |
14 | const raceenabled = true
15 |
16 | func raceAcquire(addr unsafe.Pointer) {
17 | runtime.RaceAcquire(addr)
18 | }
19 |
20 | func raceReleaseMerge(addr unsafe.Pointer) {
21 | runtime.RaceReleaseMerge(addr)
22 | }
23 |
24 | func raceReadRange(addr unsafe.Pointer, len int) {
25 | runtime.RaceReadRange(addr, len)
26 | }
27 |
28 | func raceWriteRange(addr unsafe.Pointer, len int) {
29 | runtime.RaceWriteRange(addr, len)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race0.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly
6 |
7 | package unix
8 |
9 | import (
10 | "unsafe"
11 | )
12 |
13 | const raceenabled = false
14 |
15 | func raceAcquire(addr unsafe.Pointer) {
16 | }
17 |
18 | func raceReleaseMerge(addr unsafe.Pointer) {
19 | }
20 |
21 | func raceReadRange(addr unsafe.Pointer, len int) {
22 | }
23 |
24 | func raceWriteRange(addr unsafe.Pointer, len int) {
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Socket control messages
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // UnixCredentials encodes credentials into a socket control message
12 | // for sending to another process. This can be used for
13 | // authentication.
14 | func UnixCredentials(ucred *Ucred) []byte {
15 | b := make([]byte, CmsgSpace(SizeofUcred))
16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
17 | h.Level = SOL_SOCKET
18 | h.Type = SCM_CREDENTIALS
19 | h.SetLen(CmsgLen(SizeofUcred))
20 | *((*Ucred)(cmsgData(h))) = *ucred
21 | return b
22 | }
23 |
24 | // ParseUnixCredentials decodes a socket control message that contains
25 | // credentials in a Ucred structure. To receive such a message, the
26 | // SO_PASSCRED option must be enabled on the socket.
27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
28 | if m.Header.Level != SOL_SOCKET {
29 | return nil, EINVAL
30 | }
31 | if m.Header.Type != SCM_CREDENTIALS {
32 | return nil, EINVAL
33 | }
34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
35 | return &ucred, nil
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/str.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 |
7 | package unix
8 |
9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency
10 | if val < 0 {
11 | return "-" + uitoa(uint(-val))
12 | }
13 | return uitoa(uint(val))
14 | }
15 |
16 | func uitoa(val uint) string {
17 | var buf [32]byte // big enough for int64
18 | i := len(buf) - 1
19 | for val >= 10 {
20 | buf[i] = byte(val%10 + '0')
21 | i--
22 | val /= 10
23 | }
24 | buf[i] = byte(val + '0')
25 | return string(buf[i:])
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall.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 contains an interface to the low-level operating system
8 | // primitives. OS details vary depending on the underlying system, and
9 | // by default, godoc will display OS-specific documentation for the current
10 | // system. If you want godoc to display OS documentation for another
11 | // system, set $GOOS and $GOARCH to the desired system. For example, if
12 | // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
13 | // to freebsd and $GOARCH to arm.
14 | //
15 | // The primary use of this package is inside other packages that provide a more
16 | // portable interface to the system, such as "os", "time" and "net". Use
17 | // those packages rather than this one if you can.
18 | //
19 | // For details of the functions and data types in this package consult
20 | // the manuals for the appropriate operating system.
21 | //
22 | // These calls return err == nil to indicate success; otherwise
23 | // err represents an operating system error describing the failure and
24 | // holds a value of type syscall.Errno.
25 | package unix // import "golang.org/x/sys/unix"
26 |
27 | import "strings"
28 |
29 | // ByteSliceFromString returns a NUL-terminated slice of bytes
30 | // containing the text of s. If s contains a NUL byte at any
31 | // location, it returns (nil, EINVAL).
32 | func ByteSliceFromString(s string) ([]byte, error) {
33 | if strings.IndexByte(s, 0) != -1 {
34 | return nil, EINVAL
35 | }
36 | a := make([]byte, len(s)+1)
37 | copy(a, s)
38 | return a, nil
39 | }
40 |
41 | // BytePtrFromString returns a pointer to a NUL-terminated array of
42 | // bytes containing the text of s. If s contains a NUL byte at any
43 | // location, it returns (nil, EINVAL).
44 | func BytePtrFromString(s string) (*byte, error) {
45 | a, err := ByteSliceFromString(s)
46 | if err != nil {
47 | return nil, err
48 | }
49 | return &a[0], nil
50 | }
51 |
52 | // Single-word zero for use when we need a valid pointer to 0 bytes.
53 | // See mkunix.pl.
54 | var _zero uintptr
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix
6 | // +build ppc
7 |
8 | package unix
9 |
10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
13 |
14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
15 |
16 | func setTimespec(sec, nsec int64) Timespec {
17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
18 | }
19 |
20 | func setTimeval(sec, usec int64) Timeval {
21 | return Timeval{Sec: int32(sec), Usec: int32(usec)}
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (cmsg *Cmsghdr) SetLen(length int) {
33 | cmsg.Len = uint32(length)
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build aix
6 | // +build ppc64
7 |
8 | package unix
9 |
10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek
13 |
14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64
15 |
16 | func setTimespec(sec, nsec int64) Timespec {
17 | return Timespec{Sec: sec, Nsec: nsec}
18 | }
19 |
20 | func setTimeval(sec, usec int64) Timeval {
21 | return Timeval{Sec: int64(sec), Usec: int32(usec)}
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint64(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (cmsg *Cmsghdr) SetLen(length int) {
33 | cmsg.Len = uint32(length)
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_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,darwin
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | )
12 |
13 | func setTimespec(sec, nsec int64) Timespec {
14 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
15 | }
16 |
17 | func setTimeval(sec, usec int64) Timeval {
18 | return Timeval{Sec: int32(sec), Usec: int32(usec)}
19 | }
20 |
21 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
22 | func Gettimeofday(tv *Timeval) (err error) {
23 | // The tv passed to gettimeofday must be non-nil
24 | // but is otherwise unused. The answers come back
25 | // in the two registers.
26 | sec, usec, err := gettimeofday(tv)
27 | tv.Sec = int32(sec)
28 | tv.Usec = int32(usec)
29 | return err
30 | }
31 |
32 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
33 | k.Ident = uint32(fd)
34 | k.Filter = int16(mode)
35 | k.Flags = uint16(flags)
36 | }
37 |
38 | func (iov *Iovec) SetLen(length int) {
39 | iov.Len = uint32(length)
40 | }
41 |
42 | func (msghdr *Msghdr) SetControllen(length int) {
43 | msghdr.Controllen = uint32(length)
44 | }
45 |
46 | func (cmsg *Cmsghdr) SetLen(length int) {
47 | cmsg.Len = uint32(length)
48 | }
49 |
50 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
51 |
52 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
53 | // of darwin/386 the syscall is called sysctl instead of __sysctl.
54 | const SYS___SYSCTL = SYS_SYSCTL
55 |
56 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
57 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
58 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
59 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
60 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
61 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
62 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
63 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
64 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,darwin
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | )
12 |
13 | func setTimespec(sec, nsec int64) Timespec {
14 | return Timespec{Sec: sec, Nsec: nsec}
15 | }
16 |
17 | func setTimeval(sec, usec int64) Timeval {
18 | return Timeval{Sec: sec, Usec: int32(usec)}
19 | }
20 |
21 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
22 | func Gettimeofday(tv *Timeval) (err error) {
23 | // The tv passed to gettimeofday must be non-nil
24 | // but is otherwise unused. The answers come back
25 | // in the two registers.
26 | sec, usec, err := gettimeofday(tv)
27 | tv.Sec = sec
28 | tv.Usec = usec
29 | return err
30 | }
31 |
32 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
33 | k.Ident = uint64(fd)
34 | k.Filter = int16(mode)
35 | k.Flags = uint16(flags)
36 | }
37 |
38 | func (iov *Iovec) SetLen(length int) {
39 | iov.Len = uint64(length)
40 | }
41 |
42 | func (msghdr *Msghdr) SetControllen(length int) {
43 | msghdr.Controllen = uint32(length)
44 | }
45 |
46 | func (cmsg *Cmsghdr) SetLen(length int) {
47 | cmsg.Len = uint32(length)
48 | }
49 |
50 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
51 |
52 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
53 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl.
54 | const SYS___SYSCTL = SYS_SYSCTL
55 |
56 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
57 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
58 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
59 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
60 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
61 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
62 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
63 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
64 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import (
8 | "syscall"
9 | )
10 |
11 | func setTimespec(sec, nsec int64) Timespec {
12 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
13 | }
14 |
15 | func setTimeval(sec, usec int64) Timeval {
16 | return Timeval{Sec: int32(sec), Usec: int32(usec)}
17 | }
18 |
19 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
20 | func Gettimeofday(tv *Timeval) (err error) {
21 | // The tv passed to gettimeofday must be non-nil
22 | // but is otherwise unused. The answers come back
23 | // in the two registers.
24 | sec, usec, err := gettimeofday(tv)
25 | tv.Sec = int32(sec)
26 | tv.Usec = int32(usec)
27 | return err
28 | }
29 |
30 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
31 | k.Ident = uint32(fd)
32 | k.Filter = int16(mode)
33 | k.Flags = uint16(flags)
34 | }
35 |
36 | func (iov *Iovec) SetLen(length int) {
37 | iov.Len = uint32(length)
38 | }
39 |
40 | func (msghdr *Msghdr) SetControllen(length int) {
41 | msghdr.Controllen = uint32(length)
42 | }
43 |
44 | func (cmsg *Cmsghdr) SetLen(length int) {
45 | cmsg.Len = uint32(length)
46 | }
47 |
48 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
49 |
50 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
51 | // of darwin/arm the syscall is called sysctl instead of __sysctl.
52 | const SYS___SYSCTL = SYS_SYSCTL
53 |
54 | //sys Fstat(fd int, stat *Stat_t) (err error)
55 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
56 | //sys Fstatfs(fd int, stat *Statfs_t) (err error)
57 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
58 | //sys Lstat(path string, stat *Stat_t) (err error)
59 | //sys Stat(path string, stat *Stat_t) (err error)
60 | //sys Statfs(path string, stat *Statfs_t) (err error)
61 |
62 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
63 | return 0, ENOSYS
64 | }
65 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.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 arm64,darwin
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | )
12 |
13 | func setTimespec(sec, nsec int64) Timespec {
14 | return Timespec{Sec: sec, Nsec: nsec}
15 | }
16 |
17 | func setTimeval(sec, usec int64) Timeval {
18 | return Timeval{Sec: sec, Usec: int32(usec)}
19 | }
20 |
21 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
22 | func Gettimeofday(tv *Timeval) (err error) {
23 | // The tv passed to gettimeofday must be non-nil
24 | // but is otherwise unused. The answers come back
25 | // in the two registers.
26 | sec, usec, err := gettimeofday(tv)
27 | tv.Sec = sec
28 | tv.Usec = usec
29 | return err
30 | }
31 |
32 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
33 | k.Ident = uint64(fd)
34 | k.Filter = int16(mode)
35 | k.Flags = uint16(flags)
36 | }
37 |
38 | func (iov *Iovec) SetLen(length int) {
39 | iov.Len = uint64(length)
40 | }
41 |
42 | func (msghdr *Msghdr) SetControllen(length int) {
43 | msghdr.Controllen = uint32(length)
44 | }
45 |
46 | func (cmsg *Cmsghdr) SetLen(length int) {
47 | cmsg.Len = uint32(length)
48 | }
49 |
50 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
51 |
52 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
53 | // of darwin/arm64 the syscall is called sysctl instead of __sysctl.
54 | const SYS___SYSCTL = SYS_SYSCTL
55 |
56 | //sys Fstat(fd int, stat *Stat_t) (err error)
57 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
58 | //sys Fstatfs(fd int, stat *Statfs_t) (err error)
59 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
60 | //sys Lstat(path string, stat *Stat_t) (err error)
61 | //sys Stat(path string, stat *Stat_t) (err error)
62 | //sys Statfs(path string, stat *Statfs_t) (err error)
63 |
64 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
65 | return 0, ENOSYS
66 | }
67 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.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 darwin,go1.12
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // Implemented in the runtime package (runtime/sys_darwin.go)
12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only
16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
18 |
19 | //go:linkname syscall_syscall syscall.syscall
20 | //go:linkname syscall_syscall6 syscall.syscall6
21 | //go:linkname syscall_syscall6X syscall.syscall6X
22 | //go:linkname syscall_syscall9 syscall.syscall9
23 | //go:linkname syscall_rawSyscall syscall.rawSyscall
24 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6
25 |
26 | // Find the entry point for f. See comments in runtime/proc.go for the
27 | // function of the same name.
28 | //go:nosplit
29 | func funcPC(f func()) uintptr {
30 | return **(**uintptr)(unsafe.Pointer(&f))
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,dragonfly
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func setTimespec(sec, nsec int64) Timespec {
15 | return Timespec{Sec: sec, Nsec: nsec}
16 | }
17 |
18 | func setTimeval(sec, usec int64) Timeval {
19 | return Timeval{Sec: sec, Usec: usec}
20 | }
21 |
22 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
23 | k.Ident = uint64(fd)
24 | k.Filter = int16(mode)
25 | k.Flags = uint16(flags)
26 | }
27 |
28 | func (iov *Iovec) SetLen(length int) {
29 | iov.Len = uint64(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetControllen(length int) {
33 | msghdr.Controllen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
41 | var writtenOut uint64 = 0
42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
43 |
44 | written = int(writtenOut)
45 |
46 | if e1 != 0 {
47 | err = e1
48 | }
49 | return
50 | }
51 |
52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build 386,freebsd
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func setTimespec(sec, nsec int64) Timespec {
15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
16 | }
17 |
18 | func setTimeval(sec, usec int64) Timeval {
19 | return Timeval{Sec: int32(sec), Usec: int32(usec)}
20 | }
21 |
22 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
23 | k.Ident = uint32(fd)
24 | k.Filter = int16(mode)
25 | k.Flags = uint16(flags)
26 | }
27 |
28 | func (iov *Iovec) SetLen(length int) {
29 | iov.Len = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetControllen(length int) {
33 | msghdr.Controllen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
41 | var writtenOut uint64 = 0
42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)
43 |
44 | written = int(writtenOut)
45 |
46 | if e1 != 0 {
47 | err = e1
48 | }
49 | return
50 | }
51 |
52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,freebsd
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func setTimespec(sec, nsec int64) Timespec {
15 | return Timespec{Sec: sec, Nsec: nsec}
16 | }
17 |
18 | func setTimeval(sec, usec int64) Timeval {
19 | return Timeval{Sec: sec, Usec: usec}
20 | }
21 |
22 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
23 | k.Ident = uint64(fd)
24 | k.Filter = int16(mode)
25 | k.Flags = uint16(flags)
26 | }
27 |
28 | func (iov *Iovec) SetLen(length int) {
29 | iov.Len = uint64(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetControllen(length int) {
33 | msghdr.Controllen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
41 | var writtenOut uint64 = 0
42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
43 |
44 | written = int(writtenOut)
45 |
46 | if e1 != 0 {
47 | err = e1
48 | }
49 | return
50 | }
51 |
52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build arm,freebsd
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func setTimespec(sec, nsec int64) Timespec {
15 | return Timespec{Sec: sec, Nsec: int32(nsec)}
16 | }
17 |
18 | func setTimeval(sec, usec int64) Timeval {
19 | return Timeval{Sec: sec, Usec: int32(usec)}
20 | }
21 |
22 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
23 | k.Ident = uint32(fd)
24 | k.Filter = int16(mode)
25 | k.Flags = uint16(flags)
26 | }
27 |
28 | func (iov *Iovec) SetLen(length int) {
29 | iov.Len = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetControllen(length int) {
33 | msghdr.Controllen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
41 | var writtenOut uint64 = 0
42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)
43 |
44 | written = int(writtenOut)
45 |
46 | if e1 != 0 {
47 | err = e1
48 | }
49 | return
50 | }
51 |
52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.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 arm64,freebsd
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func setTimespec(sec, nsec int64) Timespec {
15 | return Timespec{Sec: sec, Nsec: nsec}
16 | }
17 |
18 | func setTimeval(sec, usec int64) Timeval {
19 | return Timeval{Sec: sec, Usec: usec}
20 | }
21 |
22 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
23 | k.Ident = uint64(fd)
24 | k.Filter = int16(mode)
25 | k.Flags = uint16(flags)
26 | }
27 |
28 | func (iov *Iovec) SetLen(length int) {
29 | iov.Len = uint64(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetControllen(length int) {
33 | msghdr.Controllen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
41 | var writtenOut uint64 = 0
42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
43 |
44 | written = int(writtenOut)
45 |
46 | if e1 != 0 {
47 | err = e1
48 | }
49 | return
50 | }
51 |
52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,linux
6 | // +build !gccgo
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | //go:noescape
13 | func gettimeofday(tv *Timeval) (err syscall.Errno)
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,!gccgo
6 |
7 | package unix
8 |
9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail.
10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
11 |
12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't
13 | // fail.
14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,!gccgo,386
6 |
7 | package unix
8 |
9 | import "syscall"
10 |
11 | // Underlying system call writes to newoffset via pointer.
12 | // Implemented in assembly to avoid allocation.
13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
14 |
15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,gccgo,386
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
15 | var newoffset int64
16 | offsetLow := uint32(offset & 0xffffffff)
17 | offsetHigh := uint32((offset >> 32) & 0xffffffff)
18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
19 | return newoffset, err
20 | }
21 |
22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
24 | return int(fd), err
25 | }
26 |
27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
29 | return int(fd), err
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux,gccgo,arm
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
15 | var newoffset int64
16 | offsetLow := uint32(offset & 0xffffffff)
17 | offsetHigh := uint32((offset >> 32) & 0xffffffff)
18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
19 | return newoffset, err
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build 386,netbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: int32(nsec)}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint32(fd)
19 | k.Filter = uint32(mode)
20 | k.Flags = uint32(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint32(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,netbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: nsec}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint64(fd)
19 | k.Filter = uint32(mode)
20 | k.Flags = uint32(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint64(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build arm,netbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: int32(nsec)}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint32(fd)
19 | k.Filter = uint32(mode)
20 | k.Flags = uint32(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint32(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build arm64,netbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: nsec}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint64(fd)
19 | k.Filter = uint32(mode)
20 | k.Flags = uint32(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint64(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build 386,openbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: int32(nsec)}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint32(fd)
19 | k.Filter = int16(mode)
20 | k.Flags = uint16(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint32(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
36 | // of openbsd/386 the syscall is called sysctl instead of __sysctl.
37 | const SYS___SYSCTL = SYS_SYSCTL
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,openbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: nsec}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: usec}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint64(fd)
19 | k.Filter = int16(mode)
20 | k.Flags = uint16(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint64(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
37 | const SYS___SYSCTL = SYS_SYSCTL
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build arm,openbsd
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: int32(nsec)}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: int32(usec)}
15 | }
16 |
17 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
18 | k.Ident = uint32(fd)
19 | k.Filter = int16(mode)
20 | k.Flags = uint16(flags)
21 | }
22 |
23 | func (iov *Iovec) SetLen(length int) {
24 | iov.Len = uint32(length)
25 | }
26 |
27 | func (msghdr *Msghdr) SetControllen(length int) {
28 | msghdr.Controllen = uint32(length)
29 | }
30 |
31 | func (cmsg *Cmsghdr) SetLen(length int) {
32 | cmsg.Len = uint32(length)
33 | }
34 |
35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
36 | // of openbsd/arm the syscall is called sysctl instead of __sysctl.
37 | const SYS___SYSCTL = SYS_SYSCTL
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,solaris
6 |
7 | package unix
8 |
9 | func setTimespec(sec, nsec int64) Timespec {
10 | return Timespec{Sec: sec, Nsec: nsec}
11 | }
12 |
13 | func setTimeval(sec, usec int64) Timeval {
14 | return Timeval{Sec: sec, Usec: usec}
15 | }
16 |
17 | func (iov *Iovec) SetLen(length int) {
18 | iov.Len = uint64(length)
19 | }
20 |
21 | func (cmsg *Cmsghdr) SetLen(length int) {
22 | cmsg.Len = uint32(length)
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris
6 | // +build !gccgo,!ppc64le,!ppc64
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 | // +build ppc64le ppc64
7 | // +build !gccgo
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
14 | return syscall.Syscall(trap, a1, a2, a3)
15 | }
16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6)
18 | }
19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
20 | return syscall.RawSyscall(trap, a1, a2, a3)
21 | }
22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6)
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace386_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair(386, amd64). DO NOT EDIT.
2 |
3 | // +build linux
4 | // +build 386 amd64
5 |
6 | package unix
7 |
8 | import "unsafe"
9 |
10 | // PtraceRegs386 is the registers used by 386 binaries.
11 | type PtraceRegs386 struct {
12 | Ebx int32
13 | Ecx int32
14 | Edx int32
15 | Esi int32
16 | Edi int32
17 | Ebp int32
18 | Eax int32
19 | Xds int32
20 | Xes int32
21 | Xfs int32
22 | Xgs int32
23 | Orig_eax int32
24 | Eip int32
25 | Xcs int32
26 | Eflags int32
27 | Esp int32
28 | Xss int32
29 | }
30 |
31 | // PtraceGetRegs386 fetches the registers used by 386 binaries.
32 | func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error {
33 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
34 | }
35 |
36 | // PtraceSetRegs386 sets the registers used by 386 binaries.
37 | func PtraceSetRegs386(pid int, regs *PtraceRegs386) error {
38 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
39 | }
40 |
41 | // PtraceRegsAmd64 is the registers used by amd64 binaries.
42 | type PtraceRegsAmd64 struct {
43 | R15 uint64
44 | R14 uint64
45 | R13 uint64
46 | R12 uint64
47 | Rbp uint64
48 | Rbx uint64
49 | R11 uint64
50 | R10 uint64
51 | R9 uint64
52 | R8 uint64
53 | Rax uint64
54 | Rcx uint64
55 | Rdx uint64
56 | Rsi uint64
57 | Rdi uint64
58 | Orig_rax uint64
59 | Rip uint64
60 | Cs uint64
61 | Eflags uint64
62 | Rsp uint64
63 | Ss uint64
64 | Fs_base uint64
65 | Gs_base uint64
66 | Ds uint64
67 | Es uint64
68 | Fs uint64
69 | Gs uint64
70 | }
71 |
72 | // PtraceGetRegsAmd64 fetches the registers used by amd64 binaries.
73 | func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error {
74 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
75 | }
76 |
77 | // PtraceSetRegsAmd64 sets the registers used by amd64 binaries.
78 | func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error {
79 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
80 | }
81 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptracearm_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT.
2 |
3 | // +build linux
4 | // +build arm arm64
5 |
6 | package unix
7 |
8 | import "unsafe"
9 |
10 | // PtraceRegsArm is the registers used by arm binaries.
11 | type PtraceRegsArm struct {
12 | Uregs [18]uint32
13 | }
14 |
15 | // PtraceGetRegsArm fetches the registers used by arm binaries.
16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
18 | }
19 |
20 | // PtraceSetRegsArm sets the registers used by arm binaries.
21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
23 | }
24 |
25 | // PtraceRegsArm64 is the registers used by arm64 binaries.
26 | type PtraceRegsArm64 struct {
27 | Regs [31]uint64
28 | Sp uint64
29 | Pc uint64
30 | Pstate uint64
31 | }
32 |
33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
36 | }
37 |
38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries.
39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptracemips_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT.
2 |
3 | // +build linux
4 | // +build mips mips64
5 |
6 | package unix
7 |
8 | import "unsafe"
9 |
10 | // PtraceRegsMips is the registers used by mips binaries.
11 | type PtraceRegsMips struct {
12 | Regs [32]uint64
13 | Lo uint64
14 | Hi uint64
15 | Epc uint64
16 | Badvaddr uint64
17 | Status uint64
18 | Cause uint64
19 | }
20 |
21 | // PtraceGetRegsMips fetches the registers used by mips binaries.
22 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
24 | }
25 |
26 | // PtraceSetRegsMips sets the registers used by mips binaries.
27 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
29 | }
30 |
31 | // PtraceRegsMips64 is the registers used by mips64 binaries.
32 | type PtraceRegsMips64 struct {
33 | Regs [32]uint64
34 | Lo uint64
35 | Hi uint64
36 | Epc uint64
37 | Badvaddr uint64
38 | Status uint64
39 | Cause uint64
40 | }
41 |
42 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
43 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
45 | }
46 |
47 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries.
48 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
50 | }
51 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptracemipsle_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT.
2 |
3 | // +build linux
4 | // +build mipsle mips64le
5 |
6 | package unix
7 |
8 | import "unsafe"
9 |
10 | // PtraceRegsMipsle is the registers used by mipsle binaries.
11 | type PtraceRegsMipsle struct {
12 | Regs [32]uint64
13 | Lo uint64
14 | Hi uint64
15 | Epc uint64
16 | Badvaddr uint64
17 | Status uint64
18 | Cause uint64
19 | }
20 |
21 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries.
22 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error {
23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
24 | }
25 |
26 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries.
27 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error {
28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
29 | }
30 |
31 | // PtraceRegsMips64le is the registers used by mips64le binaries.
32 | type PtraceRegsMips64le struct {
33 | Regs [32]uint64
34 | Lo uint64
35 | Hi uint64
36 | Epc uint64
37 | Badvaddr uint64
38 | Status uint64
39 | Cause uint64
40 | }
41 |
42 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries.
43 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error {
44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
45 | }
46 |
47 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries.
48 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error {
49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
50 | }
51 |
--------------------------------------------------------------------------------
/vendor/gopkg.in/go-playground/validator.v8/.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/gopkg.in/go-playground/validator.v8/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Dean Karn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/vendor/gopkg.in/go-playground/validator.v8/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openshift/pipelines-vote-api/493b864eb4459ae21df53adc5bca7fb409bc8180/vendor/gopkg.in/go-playground/validator.v8/logo.png
--------------------------------------------------------------------------------
/vendor/gopkg.in/yaml.v2/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.4
5 | - 1.5
6 | - 1.6
7 | - 1.7
8 | - 1.8
9 | - 1.9
10 | - tip
11 |
12 | go_import_path: gopkg.in/yaml.v2
13 |
--------------------------------------------------------------------------------
/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/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3
2 | github.com/gin-contrib/sse
3 | # github.com/gin-gonic/gin v1.4.0
4 | ## explicit
5 | github.com/gin-gonic/gin
6 | github.com/gin-gonic/gin/binding
7 | github.com/gin-gonic/gin/internal/json
8 | github.com/gin-gonic/gin/render
9 | # github.com/golang/protobuf v1.3.1
10 | github.com/golang/protobuf/proto
11 | # github.com/json-iterator/go v1.1.6
12 | github.com/json-iterator/go
13 | # github.com/mattn/go-isatty v0.0.7
14 | github.com/mattn/go-isatty
15 | # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
16 | github.com/modern-go/concurrent
17 | # github.com/modern-go/reflect2 v1.0.1
18 | github.com/modern-go/reflect2
19 | # github.com/ugorji/go v1.1.4
20 | github.com/ugorji/go/codec
21 | # golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
22 | golang.org/x/sys/unix
23 | # gopkg.in/go-playground/validator.v8 v8.18.2
24 | gopkg.in/go-playground/validator.v8
25 | # gopkg.in/yaml.v2 v2.2.2
26 | gopkg.in/yaml.v2
27 |
--------------------------------------------------------------------------------