├── .github └── workflows │ ├── make-all.yml │ ├── make-image.yml │ ├── make-release.yml │ └── toc.yml ├── .gitignore ├── .goosarch ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── VERSION.txt ├── basic.mk ├── go.mod ├── go.sum ├── main.go ├── main_unix.go ├── main_windows.go ├── tripit ├── const.go ├── create.go ├── delete.go ├── event.go ├── get.go ├── list.go ├── replace.go ├── tripit.go └── types.go ├── vendor ├── cloud.google.com │ └── go │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ └── compute │ │ └── metadata │ │ └── metadata.go ├── github.com │ ├── genuinetools │ │ └── pkg │ │ │ ├── LICENSE │ │ │ └── cli │ │ │ ├── cli.go │ │ │ ├── doc.go │ │ │ └── version.go │ ├── golang │ │ └── protobuf │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ └── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ ├── mmcloughlin │ │ └── openflights │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── README.md.j2 │ │ │ ├── airlines.go │ │ │ ├── airlines.schema.yaml │ │ │ ├── airports.go │ │ │ ├── airports.schema.yaml │ │ │ └── doc.go │ └── sirupsen │ │ └── logrus │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── appveyor.yml │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_bsd.go │ │ ├── terminal_check_appengine.go │ │ ├── terminal_check_notappengine.go │ │ ├── terminal_linux.go │ │ ├── text_formatter.go │ │ └── writer.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── ssh │ │ │ └── terminal │ │ │ ├── terminal.go │ │ │ ├── util.go │ │ │ ├── util_aix.go │ │ │ ├── util_bsd.go │ │ │ ├── util_linux.go │ │ │ ├── util_plan9.go │ │ │ ├── util_solaris.go │ │ │ └── util_windows.go │ │ ├── net │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── context │ │ │ ├── context.go │ │ │ ├── ctxhttp │ │ │ └── ctxhttp.go │ │ │ ├── go17.go │ │ │ ├── go19.go │ │ │ ├── pre_go17.go │ │ │ └── pre_go19.go │ │ ├── oauth2 │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── google │ │ │ ├── appengine.go │ │ │ ├── appengine_hook.go │ │ │ ├── appengineflex_hook.go │ │ │ ├── default.go │ │ │ ├── doc_go19.go │ │ │ ├── doc_not_go19.go │ │ │ ├── go19.go │ │ │ ├── google.go │ │ │ ├── jwt.go │ │ │ ├── not_go19.go │ │ │ └── sdk.go │ │ ├── internal │ │ │ ├── client_appengine.go │ │ │ ├── doc.go │ │ │ ├── oauth2.go │ │ │ ├── token.go │ │ │ └── transport.go │ │ ├── jws │ │ │ └── jws.go │ │ ├── jwt │ │ │ └── jwt.go │ │ ├── oauth2.go │ │ ├── token.go │ │ └── transport.go │ │ └── sys │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_freebsd_arm64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_netbsd_arm64.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mksysctl_openbsd.pl │ │ ├── openbsd_pledge.go │ │ ├── openbsd_unveil.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── timestruct.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_386.1_11.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_386.s │ │ ├── zsyscall_darwin_amd64.1_11.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm.1_11.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm.s │ │ ├── zsyscall_darwin_arm64.1_11.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ │ └── windows │ │ ├── aliases.go │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── asm_windows_arm.s │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mkerrors.bash │ │ ├── mkerrors.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm.go │ │ ├── zerrors_windows.go │ │ └── zsyscall_windows.go ├── google.golang.org │ ├── api │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── calendar │ │ │ └── v3 │ │ │ │ ├── calendar-api.json │ │ │ │ └── calendar-gen.go │ │ ├── gensupport │ │ │ ├── backoff.go │ │ │ ├── buffer.go │ │ │ ├── doc.go │ │ │ ├── go18.go │ │ │ ├── header.go │ │ │ ├── json.go │ │ │ ├── jsonfloat.go │ │ │ ├── media.go │ │ │ ├── not_go18.go │ │ │ ├── params.go │ │ │ ├── resumable.go │ │ │ ├── retry.go │ │ │ └── send.go │ │ └── googleapi │ │ │ ├── googleapi.go │ │ │ ├── internal │ │ │ └── uritemplates │ │ │ │ ├── LICENSE │ │ │ │ ├── uritemplates.go │ │ │ │ └── utils.go │ │ │ └── types.go │ └── appengine │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appengine.go │ │ ├── appengine_vm.go │ │ ├── errors.go │ │ ├── identity.go │ │ ├── internal │ │ ├── api.go │ │ ├── api_classic.go │ │ ├── api_common.go │ │ ├── api_pre17.go │ │ ├── app_id.go │ │ ├── app_identity │ │ │ ├── app_identity_service.pb.go │ │ │ └── app_identity_service.proto │ │ ├── base │ │ │ ├── api_base.pb.go │ │ │ └── api_base.proto │ │ ├── datastore │ │ │ ├── datastore_v3.pb.go │ │ │ └── datastore_v3.proto │ │ ├── identity.go │ │ ├── identity_classic.go │ │ ├── identity_vm.go │ │ ├── internal.go │ │ ├── log │ │ │ ├── log_service.pb.go │ │ │ └── log_service.proto │ │ ├── main.go │ │ ├── main_vm.go │ │ ├── metadata.go │ │ ├── modules │ │ │ ├── modules_service.pb.go │ │ │ └── modules_service.proto │ │ ├── net.go │ │ ├── regen.sh │ │ ├── remote_api │ │ │ ├── remote_api.pb.go │ │ │ └── remote_api.proto │ │ ├── transaction.go │ │ └── urlfetch │ │ │ ├── urlfetch_service.pb.go │ │ │ └── urlfetch_service.proto │ │ ├── namespace.go │ │ ├── timeout.go │ │ └── urlfetch │ │ └── urlfetch.go └── modules.txt └── version └── version.go /.github/workflows/make-all.yml: -------------------------------------------------------------------------------- 1 | on: push 2 | name: make all 3 | jobs: 4 | makeall: 5 | name: make all 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@master 9 | - name: make all 10 | uses: docker://golang:latest 11 | with: 12 | entrypoint: bash 13 | args: -c "go get honnef.co/go/tools/cmd/staticcheck && go get golang.org/x/lint/golint && git checkout . && make all" 14 | -------------------------------------------------------------------------------- /.github/workflows/make-image.yml: -------------------------------------------------------------------------------- 1 | on: push 2 | name: make image 3 | jobs: 4 | makeimage: 5 | name: make image 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@master 9 | - name: make image 10 | run: make image 11 | shell: bash 12 | -------------------------------------------------------------------------------- /.github/workflows/make-release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | tags: 4 | - v* 5 | name: make release 6 | jobs: 7 | makerelease: 8 | name: make release 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: make release 13 | uses: docker://golang:latest 14 | with: 15 | args: make release 16 | - name: upload assets 17 | uses: docker://r.j3ss.co/github-dev 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | with: 21 | entrypoint: bash 22 | args: -c "upload-assets ./cross/*" 23 | - name: update release body 24 | uses: docker://r.j3ss.co/pepper 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | with: 28 | entrypoint: sh 29 | args: -c "pepper release --repo $GITHUB_REPOSITORY -d --nouser" 30 | -------------------------------------------------------------------------------- /.github/workflows/toc.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master # Push events on master branch 5 | name: Table of Contents Generator 6 | jobs: 7 | generateTOC: 8 | name: TOC Generator 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: TOC Generator 12 | uses: technote-space/toc-generator@v1 13 | with: 14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 15 | TARGET_PATHS: "README.md" 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ###Go### 2 | 3 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 4 | *.o 5 | *.a 6 | *.so 7 | 8 | # Folders 9 | _obj 10 | _test 11 | 12 | # Architecture specific extensions/prefixes 13 | *.[568vq] 14 | [568vq].out 15 | 16 | *.cgo1.go 17 | *.cgo2.c 18 | _cgo_defun.c 19 | _cgo_gotypes.go 20 | _cgo_export.* 21 | 22 | _testmain.go 23 | 24 | *.exe 25 | *.test 26 | 27 | 28 | ###OSX### 29 | 30 | .DS_Store 31 | .AppleDouble 32 | .LSOverride 33 | 34 | # Icon must ends with two \r. 35 | Icon 36 | 37 | 38 | # Thumbnails 39 | ._* 40 | 41 | # Files that might appear on external disk 42 | .Spotlight-V100 43 | .Trashes 44 | 45 | tripitcalb0t 46 | cross/ 47 | 48 | # Go coverage results 49 | coverage.txt 50 | profile.out 51 | 52 | !go.mod 53 | -------------------------------------------------------------------------------- /.goosarch: -------------------------------------------------------------------------------- 1 | darwin/amd64 2 | darwin/386 3 | freebsd/amd64 4 | freebsd/386 5 | linux/arm 6 | linux/arm64 7 | linux/amd64 8 | linux/386 9 | solaris/amd64 10 | windows/amd64 11 | windows/386 12 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine as builder 2 | MAINTAINER Jessica Frazelle 3 | 4 | ENV PATH /go/bin:/usr/local/go/bin:$PATH 5 | ENV GOPATH /go 6 | 7 | RUN apk add --no-cache \ 8 | bash \ 9 | ca-certificates 10 | 11 | COPY . /go/src/github.com/jessfraz/tripitcalb0t 12 | 13 | RUN set -x \ 14 | && apk add --no-cache --virtual .build-deps \ 15 | git \ 16 | gcc \ 17 | libc-dev \ 18 | libgcc \ 19 | make \ 20 | && cd /go/src/github.com/jessfraz/tripitcalb0t \ 21 | && make static \ 22 | && mv tripitcalb0t /usr/bin/tripitcalb0t \ 23 | && apk del .build-deps \ 24 | && rm -rf /go \ 25 | && echo "Build complete." 26 | 27 | FROM alpine:latest 28 | 29 | COPY --from=builder /usr/bin/tripitcalb0t /usr/bin/tripitcalb0t 30 | COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs 31 | 32 | ENTRYPOINT [ "tripitcalb0t" ] 33 | CMD [ "--help" ] 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Jessica Frazelle 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 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Setup name variables for the package/tool 2 | NAME := tripitcalb0t 3 | PKG := github.com/jessfraz/$(NAME) 4 | 5 | CGO_ENABLED := 0 6 | 7 | # Set any default go build tags. 8 | BUILDTAGS := 9 | 10 | include basic.mk 11 | 12 | .PHONY: prebuild 13 | prebuild: 14 | -------------------------------------------------------------------------------- /VERSION.txt: -------------------------------------------------------------------------------- 1 | v0.1.5 2 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jessfraz/tripitcalb0t 2 | 3 | go 1.14 4 | 5 | require ( 6 | cloud.google.com/go v0.25.0 // indirect 7 | github.com/davecgh/go-spew v1.1.1 // indirect 8 | github.com/genuinetools/pkg v0.0.0-20180716210454-965f911b80a9 9 | github.com/kr/pretty v0.1.0 // indirect 10 | github.com/mmcloughlin/openflights v0.0.0-20170819211133-257f09e6e50c 11 | github.com/onsi/gomega v1.4.2 // indirect 12 | github.com/pmezard/go-difflib v1.0.0 // indirect 13 | github.com/sirupsen/logrus v1.0.5 14 | github.com/stretchr/testify v1.2.2 // indirect 15 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect 16 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect 17 | golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd 18 | golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect 19 | google.golang.org/api v0.0.0-20180716222000-81e9282165ac 20 | google.golang.org/appengine v1.1.0 // indirect 21 | gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect 22 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect 23 | gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect 24 | ) 25 | -------------------------------------------------------------------------------- /main_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 2 | 3 | package main 4 | 5 | const ( 6 | homeKey = "HOME" 7 | ) 8 | -------------------------------------------------------------------------------- /main_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package main 4 | 5 | const ( 6 | homeKey = "USERPROFILE" 7 | ) 8 | -------------------------------------------------------------------------------- /tripit/create.go: -------------------------------------------------------------------------------- 1 | package tripit 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // Create takes a Request object and creates it. 8 | func (c *Client) Create(req Request) (*Response, error) { 9 | return c.doRequest(http.MethodPost, "v1/create", req) 10 | } 11 | -------------------------------------------------------------------------------- /tripit/list.go: -------------------------------------------------------------------------------- 1 | package tripit 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | // ListTrips returns a list of trips and other object data depending on the filters passed. 9 | func (c *Client) ListTrips(filters ...Filter) (*Response, error) { 10 | return c.doRequest(http.MethodGet, fmt.Sprintf("%s/%s", ListTripsEndpoint, formatFilters(filters)), nil) 11 | } 12 | 13 | // ListObjects returns a list of objects and other data depending on the filters passed. 14 | func (c *Client) ListObjects(filters ...Filter) (*Response, error) { 15 | return c.doRequest(http.MethodGet, fmt.Sprintf("%s/%s", ListObjectsEndpoint, formatFilters(filters)), nil) 16 | } 17 | 18 | // ListPointsPrograms returns a list of points programs depending on the filters passed. 19 | func (c *Client) ListPointsPrograms(filters ...Filter) ([]PointsProgram, error) { 20 | resp, err := c.doRequest(http.MethodGet, fmt.Sprintf("%s/%s", ListPointsProgramsEndpoint, formatFilters(filters)), nil) 21 | if err != nil { 22 | return nil, err 23 | } 24 | 25 | return resp.PointsPrograms, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/cloud.google.com/go/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of cloud authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as: 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | Filippo Valsorda 10 | Google Inc. 11 | Ingo Oeser 12 | Palm Stone Games, Inc. 13 | Paweł Knap 14 | Péter Szilágyi 15 | Tyler Treat 16 | -------------------------------------------------------------------------------- /vendor/cloud.google.com/go/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # People who have agreed to one of the CLAs and can contribute patches. 2 | # The AUTHORS file lists the copyright holders; this file 3 | # lists people. For example, Google employees are listed here 4 | # but not in AUTHORS, because Google holds the copyright. 5 | # 6 | # https://developers.google.com/open-source/cla/individual 7 | # https://developers.google.com/open-source/cla/corporate 8 | # 9 | # Names should be added to this file as: 10 | # Name 11 | 12 | # Keep the list alphabetically sorted. 13 | 14 | Alexis Hunt 15 | Andreas Litt 16 | Andrew Gerrand 17 | Brad Fitzpatrick 18 | Burcu Dogan 19 | Dave Day 20 | David Sansome 21 | David Symonds 22 | Filippo Valsorda 23 | Glenn Lewis 24 | Ingo Oeser 25 | James Hall 26 | Johan Euphrosine 27 | Jonathan Amsterdam 28 | Kunpei Sakai 29 | Luna Duclos 30 | Magnus Hiie 31 | Mario Castro 32 | Michael McGreevy 33 | Omar Jarjur 34 | Paweł Knap 35 | Péter Szilágyi 36 | Sarah Adams 37 | Thanatat Tamtan 38 | Toby Burress 39 | Tuo Shan 40 | Tyler Treat 41 | -------------------------------------------------------------------------------- /vendor/github.com/genuinetools/pkg/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 The Genuinetools Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 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/genuinetools/pkg/cli/doc.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go programs. It is designed to be easy to understand and write. 3 | package cli 4 | -------------------------------------------------------------------------------- /vendor/github.com/genuinetools/pkg/cli/version.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "context" 5 | "flag" 6 | "fmt" 7 | "runtime" 8 | ) 9 | 10 | const versionHelp = `Show the version information.` 11 | 12 | func (cmd *versionCommand) Name() string { return "version" } 13 | func (cmd *versionCommand) Args() string { return "" } 14 | func (cmd *versionCommand) ShortHelp() string { return versionHelp } 15 | func (cmd *versionCommand) LongHelp() string { return versionHelp } 16 | func (cmd *versionCommand) Hidden() bool { return false } 17 | 18 | func (cmd *versionCommand) Register(fs *flag.FlagSet) {} 19 | 20 | type versionCommand struct{} 21 | 22 | func (cmd *versionCommand) Run(ctx context.Context, args []string) error { 23 | fmt.Printf(`%s: 24 | version : %s 25 | git hash : %s 26 | go version : %s 27 | go compiler : %s 28 | platform : %s/%s 29 | `, "ship", ctx.Value(VersionKey).(string), ctx.Value(GitCommitKey).(string), 30 | runtime.Version(), runtime.Compiler, runtime.GOOS, runtime.GOARCH) 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /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/mmcloughlin/openflights/.gitignore: -------------------------------------------------------------------------------- 1 | *.dat 2 | *.csv 3 | *.doc 4 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/LICENSE: -------------------------------------------------------------------------------- 1 | Licensing for this package follows that of the underlying data. 2 | 3 | This openflights package is made available under the Open Database License: 4 | http://opendatacommons.org/licenses/odbl/1.0/. Any rights in individual 5 | contents of the database are licensed under the Database Contents License: 6 | http://opendatacommons.org/licenses/dbcl/1.0/ 7 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/Makefile: -------------------------------------------------------------------------------- 1 | all: airports.go airlines.go README.md 2 | 3 | %.dat: 4 | wget https://raw.githubusercontent.com/jpatokal/openflights/master/data/$@ 5 | 6 | %.csv: %.dat 7 | cat $< | sed 's/\\N//g' | sed 's/\\\\//g' | sed 's/\\"/""/g' > $@ 8 | 9 | %.go: %.schema.yaml %.csv 10 | databundler -pkg openflights -schema $*.schema.yaml -data $*.csv -output $@ 11 | gofmt -w $@ 12 | 13 | %.doc: 14 | godoc -src github.com/mmcloughlin/openflights $* | awk '$$1 != "use" && length($$0) > 0' > $@ 15 | 16 | README.md: README.md.j2 Airport.doc Airline.doc 17 | j2 $< > $@ 18 | 19 | deps: 20 | go get github.com/mmcloughlin/databundler 21 | 22 | clean: 23 | $(RM) *.dat *.csv 24 | 25 | .PHONY: all clean deps 26 | 27 | .PRECIOUS: %.dat 28 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/README.md: -------------------------------------------------------------------------------- 1 | # openflights 2 | 3 | [OpenFlights airport and airline data](https://openflights.org/data.html) encapsulated in a Golang package. 4 | 5 | This package contains a list `Airports` with the following fields. 6 | 7 | ```go 8 | // Airport represents an airport. 9 | type Airport struct { 10 | // Airport name. 11 | Name string 12 | // Main city served by airport. 13 | City string 14 | // Country or territory where airport is located. 15 | Country string 16 | // 3-letter IATA code. Empty if not assigned/unknown. 17 | IATA string 18 | // 4-letter ICAO code. 19 | ICAO string 20 | // Latitude in decimal degrees. 21 | Latitude float64 22 | // Longitude in decimal degrees. 23 | Longitude float64 24 | // Altitude in feet. 25 | Altitude float64 26 | } 27 | ``` 28 | 29 | Also offers `Airlines` with the following fields. 30 | 31 | ```go 32 | // Airline represents an airline. 33 | type Airline struct { 34 | // Name of the airline. 35 | Name string 36 | // Alias of the airline. For example, All Nippon Airways is commonly known as "ANA". 37 | Alias string 38 | // 2-letter IATA code, if available. 39 | IATA string 40 | // 3-letter ICAO code, if available. 41 | ICAO string 42 | // Airline callsign. 43 | Callsign string 44 | // Country or territory where airline is incorporated. 45 | Country string 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/README.md.j2: -------------------------------------------------------------------------------- 1 | # openflights 2 | 3 | [OpenFlights airport and airline data](https://openflights.org/data.html) encapsulated in a Golang package. 4 | 5 | This package contains a list `Airports` with the following fields. 6 | 7 | ```go 8 | {% include 'Airport.doc' %} 9 | ``` 10 | 11 | Also offers `Airlines` with the following fields. 12 | 13 | ```go 14 | {% include 'Airline.doc' %} 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/airlines.schema.yaml: -------------------------------------------------------------------------------- 1 | name: Airline 2 | doc: Airline represents an airline. 3 | collection_doc: Airlines is a list of all airlines in the OpenFlights dataset. 4 | fields: 5 | - null # Airline ID 6 | - name: Name 7 | doc: Name of the airline. 8 | type: string 9 | - name: Alias 10 | doc: Alias of the airline. For example, All Nippon Airways is commonly known as "ANA". 11 | type: string 12 | - name: IATA 13 | doc: 2-letter IATA code, if available. 14 | type: string 15 | - name: ICAO 16 | doc: 3-letter ICAO code, if available. 17 | type: string 18 | - name: Callsign 19 | doc: Airline callsign. 20 | type: string 21 | - name: Country 22 | doc: Country or territory where airline is incorporated. 23 | type: string 24 | - null # Active Y/N 25 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/airports.schema.yaml: -------------------------------------------------------------------------------- 1 | name: Airport 2 | doc: Airport represents an airport. 3 | collection_doc: Airports is a list of all airports in the OpenFlights dataset. 4 | fields: 5 | - null # Airport ID 6 | - name: Name 7 | doc: Airport name. 8 | type: string 9 | - name: City 10 | doc: Main city served by airport. 11 | type: string 12 | - name: Country 13 | doc: Country or territory where airport is located. 14 | type: string 15 | - name: IATA 16 | doc: 3-letter IATA code. Empty if not assigned/unknown. 17 | type: string 18 | - name: ICAO 19 | doc: 4-letter ICAO code. 20 | type: string 21 | - name: Latitude 22 | doc: Latitude in decimal degrees. 23 | type: float64 24 | - name: Longitude 25 | doc: Longitude in decimal degrees. 26 | type: float64 27 | - name: Altitude 28 | doc: Altitude in feet. 29 | type: float64 30 | - null # Timezone 31 | - null # DST 32 | - null # tz (Olsen) format 33 | - null # Type 34 | - null # Source 35 | -------------------------------------------------------------------------------- /vendor/github.com/mmcloughlin/openflights/doc.go: -------------------------------------------------------------------------------- 1 | // Package openflights provides airport and airline lists. 2 | package openflights 3 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.6.x 4 | - 1.7.x 5 | - 1.8.x 6 | - tip 7 | env: 8 | - GOMAXPROCS=4 GORACE=halt_on_error=1 9 | install: 10 | - go get github.com/stretchr/testify/assert 11 | - go get gopkg.in/gemnasium/logrus-airbrake-hook.v2 12 | - go get golang.org/x/sys/unix 13 | - go get golang.org/x/sys/windows 14 | script: 15 | - go test -race -v ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 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/sirupsen/logrus/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | platform: x64 3 | clone_folder: c:\gopath\src\github.com\sirupsen\logrus 4 | environment: 5 | GOPATH: c:\gopath 6 | branches: 7 | only: 8 | - master 9 | install: 10 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 11 | - go version 12 | build_script: 13 | - go get -t 14 | - go test 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import "time" 4 | 5 | const defaultTimestampFormat = time.RFC3339 6 | 7 | // The Formatter interface is used to implement a custom Formatter. It takes an 8 | // `Entry`. It exposes all the fields, including the default ones: 9 | // 10 | // * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. 11 | // * `entry.Data["time"]`. The timestamp. 12 | // * `entry.Data["level"]. The level the entry was logged at. 13 | // 14 | // Any additional fields added with `WithField` or `WithFields` are also in 15 | // `entry.Data`. Format is expected to return an array of bytes which are then 16 | // logged to `logger.Out`. 17 | type Formatter interface { 18 | Format(*Entry) ([]byte, error) 19 | } 20 | 21 | // This is to not silently overwrite `time`, `msg` and `level` fields when 22 | // dumping it. If this code wasn't there doing: 23 | // 24 | // logrus.WithField("level", 1).Info("hello") 25 | // 26 | // Would just silently drop the user provided level. Instead with this code 27 | // it'll logged as: 28 | // 29 | // {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} 30 | // 31 | // It's not exported because it's still using Data in an opinionated way. It's to 32 | // avoid code duplication between the two default formatters. 33 | func prefixFieldClashes(data Fields) { 34 | if t, ok := data["time"]; ok { 35 | data["fields.time"] = t 36 | } 37 | 38 | if m, ok := data["msg"]; ok { 39 | data["fields.msg"] = m 40 | } 41 | 42 | if l, ok := data["level"]; ok { 43 | data["fields.level"] = l 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type fieldKey string 9 | 10 | // FieldMap allows customization of the key names for default fields. 11 | type FieldMap map[fieldKey]string 12 | 13 | // Default key names for the default fields 14 | const ( 15 | FieldKeyMsg = "msg" 16 | FieldKeyLevel = "level" 17 | FieldKeyTime = "time" 18 | ) 19 | 20 | func (f FieldMap) resolve(key fieldKey) string { 21 | if k, ok := f[key]; ok { 22 | return k 23 | } 24 | 25 | return string(key) 26 | } 27 | 28 | // JSONFormatter formats logs into parsable json 29 | type JSONFormatter struct { 30 | // TimestampFormat sets the format used for marshaling timestamps. 31 | TimestampFormat string 32 | 33 | // DisableTimestamp allows disabling automatic timestamps in output 34 | DisableTimestamp bool 35 | 36 | // FieldMap allows users to customize the names of keys for default fields. 37 | // As an example: 38 | // formatter := &JSONFormatter{ 39 | // FieldMap: FieldMap{ 40 | // FieldKeyTime: "@timestamp", 41 | // FieldKeyLevel: "@level", 42 | // FieldKeyMsg: "@message", 43 | // }, 44 | // } 45 | FieldMap FieldMap 46 | } 47 | 48 | // Format renders a single log entry 49 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 50 | data := make(Fields, len(entry.Data)+3) 51 | for k, v := range entry.Data { 52 | switch v := v.(type) { 53 | case error: 54 | // Otherwise errors are ignored by `encoding/json` 55 | // https://github.com/sirupsen/logrus/issues/137 56 | data[k] = v.Error() 57 | default: 58 | data[k] = v 59 | } 60 | } 61 | prefixFieldClashes(data) 62 | 63 | timestampFormat := f.TimestampFormat 64 | if timestampFormat == "" { 65 | timestampFormat = defaultTimestampFormat 66 | } 67 | 68 | if !f.DisableTimestamp { 69 | data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat) 70 | } 71 | data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message 72 | data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String() 73 | 74 | serialized, err := json.Marshal(data) 75 | if err != nil { 76 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 77 | } 78 | return append(serialized, '\n'), nil 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine,!gopherjs 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TIOCGETA 9 | 10 | type Termios unix.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine gopherjs 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!gopherjs 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/crypto/ssh/terminal" 10 | ) 11 | 12 | func checkIfTerminal(w io.Writer) bool { 13 | switch v := w.(type) { 14 | case *os.File: 15 | return terminal.IsTerminal(int(v.Fd())) 16 | default: 17 | return false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine,!gopherjs 7 | 8 | package logrus 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | 14 | type Termios unix.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() *io.PipeWriter { 10 | return logger.WriterLevel(InfoLevel) 11 | } 12 | 13 | func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { 14 | return NewEntry(logger).WriterLevel(level) 15 | } 16 | 17 | func (entry *Entry) Writer() *io.PipeWriter { 18 | return entry.WriterLevel(InfoLevel) 19 | } 20 | 21 | func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { 22 | reader, writer := io.Pipe() 23 | 24 | var printFunc func(args ...interface{}) 25 | 26 | switch level { 27 | case DebugLevel: 28 | printFunc = entry.Debug 29 | case InfoLevel: 30 | printFunc = entry.Info 31 | case WarnLevel: 32 | printFunc = entry.Warn 33 | case ErrorLevel: 34 | printFunc = entry.Error 35 | case FatalLevel: 36 | printFunc = entry.Fatal 37 | case PanicLevel: 38 | printFunc = entry.Panic 39 | default: 40 | printFunc = entry.Print 41 | } 42 | 43 | go entry.writerScanner(reader, printFunc) 44 | runtime.SetFinalizer(writer, writerFinalizer) 45 | 46 | return writer 47 | } 48 | 49 | func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { 50 | scanner := bufio.NewScanner(reader) 51 | for scanner.Scan() { 52 | printFunc(scanner.Text()) 53 | } 54 | if err := scanner.Err(); err != nil { 55 | entry.Errorf("Error while reading from Writer: %s", err) 56 | } 57 | reader.Close() 58 | } 59 | 60 | func writerFinalizer(writer *io.PipeWriter) { 61 | writer.Close() 62 | } 63 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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 https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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 https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_aix.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 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TCGETS 12 | const ioctlWriteTermios = unix.TCSETS 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.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 darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.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 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_plan9.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 | // Package terminal provides support functions for dealing with terminals, as 6 | // commonly found on UNIX systems. 7 | // 8 | // Putting a terminal into raw mode is the most common requirement: 9 | // 10 | // oldState, err := terminal.MakeRaw(0) 11 | // if err != nil { 12 | // panic(err) 13 | // } 14 | // defer terminal.Restore(0, oldState) 15 | package terminal 16 | 17 | import ( 18 | "fmt" 19 | "runtime" 20 | ) 21 | 22 | type State struct{} 23 | 24 | // IsTerminal returns whether the given file descriptor is a terminal. 25 | func IsTerminal(fd int) bool { 26 | return false 27 | } 28 | 29 | // MakeRaw put the terminal connected to the given file descriptor into raw 30 | // mode and returns the previous state of the terminal so that it can be 31 | // restored. 32 | func MakeRaw(fd int) (*State, error) { 33 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 34 | } 35 | 36 | // GetState returns the current state of a terminal which may be useful to 37 | // restore the terminal after a signal. 38 | func GetState(fd int) (*State, error) { 39 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 40 | } 41 | 42 | // Restore restores the terminal connected to the given file descriptor to a 43 | // previous state. 44 | func Restore(fd int, state *State) error { 45 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 46 | } 47 | 48 | // GetSize returns the dimensions of the given terminal. 49 | func GetSize(fd int) (width, height int, err error) { 50 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 51 | } 52 | 53 | // ReadPassword reads a line of input from a terminal without local echo. This 54 | // is commonly used for inputting passwords and other sensitive data. The slice 55 | // returned does not include the \n. 56 | func ReadPassword(fd int) ([]byte, error) { 57 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/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/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/ctxhttp/ctxhttp.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 | // Package ctxhttp provides helper functions for performing context-aware HTTP requests. 6 | package ctxhttp // import "golang.org/x/net/context/ctxhttp" 7 | 8 | import ( 9 | "context" 10 | "io" 11 | "net/http" 12 | "net/url" 13 | "strings" 14 | ) 15 | 16 | // Do sends an HTTP request with the provided http.Client and returns 17 | // an HTTP response. 18 | // 19 | // If the client is nil, http.DefaultClient is used. 20 | // 21 | // The provided ctx must be non-nil. If it is canceled or times out, 22 | // ctx.Err() will be returned. 23 | func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { 24 | if client == nil { 25 | client = http.DefaultClient 26 | } 27 | resp, err := client.Do(req.WithContext(ctx)) 28 | // If we got an error, and the context has been canceled, 29 | // the context's error is probably more useful. 30 | if err != nil { 31 | select { 32 | case <-ctx.Done(): 33 | err = ctx.Err() 34 | default: 35 | } 36 | } 37 | return resp, err 38 | } 39 | 40 | // Get issues a GET request via the Do function. 41 | func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { 42 | req, err := http.NewRequest("GET", url, nil) 43 | if err != nil { 44 | return nil, err 45 | } 46 | return Do(ctx, client, req) 47 | } 48 | 49 | // Head issues a HEAD request via the Do function. 50 | func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { 51 | req, err := http.NewRequest("HEAD", url, nil) 52 | if err != nil { 53 | return nil, err 54 | } 55 | return Do(ctx, client, req) 56 | } 57 | 58 | // Post issues a POST request via the Do function. 59 | func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { 60 | req, err := http.NewRequest("POST", url, body) 61 | if err != nil { 62 | return nil, err 63 | } 64 | req.Header.Set("Content-Type", bodyType) 65 | return Do(ctx, client, req) 66 | } 67 | 68 | // PostForm issues a POST request via the Do function. 69 | func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { 70 | return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) 71 | } 72 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - tip 5 | 6 | install: 7 | - export GOPATH="$HOME/gopath" 8 | - mkdir -p "$GOPATH/src/golang.org/x" 9 | - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" 10 | - go get -v -t -d golang.org/x/oauth2/... 11 | 12 | script: 13 | - go test -v golang.org/x/oauth2/... 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/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/oauth2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/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/oauth2/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/oauth2/google/appengine_hook.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 appengine appenginevm 6 | 7 | package google 8 | 9 | import "google.golang.org/appengine" 10 | 11 | func init() { 12 | appengineTokenFunc = appengine.AccessToken 13 | appengineAppIDFunc = appengine.AppID 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/google/appengineflex_hook.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 appenginevm 6 | 7 | package google 8 | 9 | func init() { 10 | appengineFlex = true // Flex doesn't support appengine.AccessToken; depend on metadata server. 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/google/doc_go19.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 go1.9 6 | 7 | // Package google provides support for making OAuth2 authorized and authenticated 8 | // HTTP requests to Google APIs. It supports the Web server flow, client-side 9 | // credentials, service accounts, Google Compute Engine service accounts, and Google 10 | // App Engine service accounts. 11 | // 12 | // A brief overview of the package follows. For more information, please read 13 | // https://developers.google.com/accounts/docs/OAuth2 14 | // and 15 | // https://developers.google.com/accounts/docs/application-default-credentials. 16 | // 17 | // OAuth2 Configs 18 | // 19 | // Two functions in this package return golang.org/x/oauth2.Config values from Google credential 20 | // data. Google supports two JSON formats for OAuth2 credentials: one is handled by ConfigFromJSON, 21 | // the other by JWTConfigFromJSON. The returned Config can be used to obtain a TokenSource or 22 | // create an http.Client. 23 | // 24 | // 25 | // Credentials 26 | // 27 | // The Credentials type represents Google credentials, including Application Default 28 | // Credentials. 29 | // 30 | // Use FindDefaultCredentials to obtain Application Default Credentials. 31 | // FindDefaultCredentials looks in some well-known places for a credentials file, and 32 | // will call AppEngineTokenSource or ComputeTokenSource as needed. 33 | // 34 | // DefaultClient and DefaultTokenSource are convenience methods. They first call FindDefaultCredentials, 35 | // then use the credentials to construct an http.Client or an oauth2.TokenSource. 36 | // 37 | // Use CredentialsFromJSON to obtain credentials from either of the two JSON formats 38 | // described in OAuth2 Configs, above. The TokenSource in the returned value is the 39 | // same as the one obtained from the oauth2.Config returned from ConfigFromJSON or 40 | // JWTConfigFromJSON, but the Credentials may contain additional information 41 | // that is useful is some circumstances. 42 | package google // import "golang.org/x/oauth2/google" 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/google/doc_not_go19.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 !go1.9 6 | 7 | // Package google provides support for making OAuth2 authorized and authenticated 8 | // HTTP requests to Google APIs. It supports the Web server flow, client-side 9 | // credentials, service accounts, Google Compute Engine service accounts, and Google 10 | // App Engine service accounts. 11 | // 12 | // A brief overview of the package follows. For more information, please read 13 | // https://developers.google.com/accounts/docs/OAuth2 14 | // and 15 | // https://developers.google.com/accounts/docs/application-default-credentials. 16 | // 17 | // OAuth2 Configs 18 | // 19 | // Two functions in this package return golang.org/x/oauth2.Config values from Google credential 20 | // data. Google supports two JSON formats for OAuth2 credentials: one is handled by ConfigFromJSON, 21 | // the other by JWTConfigFromJSON. The returned Config can be used to obtain a TokenSource or 22 | // create an http.Client. 23 | // 24 | // 25 | // Credentials 26 | // 27 | // The DefaultCredentials type represents Google Application Default Credentials, as 28 | // well as other forms of credential. 29 | // 30 | // Use FindDefaultCredentials to obtain Application Default Credentials. 31 | // FindDefaultCredentials looks in some well-known places for a credentials file, and 32 | // will call AppEngineTokenSource or ComputeTokenSource as needed. 33 | // 34 | // DefaultClient and DefaultTokenSource are convenience methods. They first call FindDefaultCredentials, 35 | // then use the credentials to construct an http.Client or an oauth2.TokenSource. 36 | // 37 | // Use CredentialsFromJSON to obtain credentials from either of the two JSON 38 | // formats described in OAuth2 Configs, above. (The DefaultCredentials returned may 39 | // not be "Application Default Credentials".) The TokenSource in the returned value 40 | // is the same as the one obtained from the oauth2.Config returned from 41 | // ConfigFromJSON or JWTConfigFromJSON, but the DefaultCredentials may contain 42 | // additional information that is useful is some circumstances. 43 | package google // import "golang.org/x/oauth2/google" 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/google/jwt.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 google 6 | 7 | import ( 8 | "crypto/rsa" 9 | "fmt" 10 | "time" 11 | 12 | "golang.org/x/oauth2" 13 | "golang.org/x/oauth2/internal" 14 | "golang.org/x/oauth2/jws" 15 | ) 16 | 17 | // JWTAccessTokenSourceFromJSON uses a Google Developers service account JSON 18 | // key file to read the credentials that authorize and authenticate the 19 | // requests, and returns a TokenSource that does not use any OAuth2 flow but 20 | // instead creates a JWT and sends that as the access token. 21 | // The audience is typically a URL that specifies the scope of the credentials. 22 | // 23 | // Note that this is not a standard OAuth flow, but rather an 24 | // optimization supported by a few Google services. 25 | // Unless you know otherwise, you should use JWTConfigFromJSON instead. 26 | func JWTAccessTokenSourceFromJSON(jsonKey []byte, audience string) (oauth2.TokenSource, error) { 27 | cfg, err := JWTConfigFromJSON(jsonKey) 28 | if err != nil { 29 | return nil, fmt.Errorf("google: could not parse JSON key: %v", err) 30 | } 31 | pk, err := internal.ParseKey(cfg.PrivateKey) 32 | if err != nil { 33 | return nil, fmt.Errorf("google: could not parse key: %v", err) 34 | } 35 | ts := &jwtAccessTokenSource{ 36 | email: cfg.Email, 37 | audience: audience, 38 | pk: pk, 39 | pkID: cfg.PrivateKeyID, 40 | } 41 | tok, err := ts.Token() 42 | if err != nil { 43 | return nil, err 44 | } 45 | return oauth2.ReuseTokenSource(tok, ts), nil 46 | } 47 | 48 | type jwtAccessTokenSource struct { 49 | email, audience string 50 | pk *rsa.PrivateKey 51 | pkID string 52 | } 53 | 54 | func (ts *jwtAccessTokenSource) Token() (*oauth2.Token, error) { 55 | iat := time.Now() 56 | exp := iat.Add(time.Hour) 57 | cs := &jws.ClaimSet{ 58 | Iss: ts.email, 59 | Sub: ts.email, 60 | Aud: ts.audience, 61 | Iat: iat.Unix(), 62 | Exp: exp.Unix(), 63 | } 64 | hdr := &jws.Header{ 65 | Algorithm: "RS256", 66 | Typ: "JWT", 67 | KeyID: string(ts.pkID), 68 | } 69 | msg, err := jws.Encode(hdr, cs, ts.pk) 70 | if err != nil { 71 | return nil, fmt.Errorf("google: could not encode JWT: %v", err) 72 | } 73 | return &oauth2.Token{AccessToken: msg, TokenType: "Bearer", Expiry: exp}, nil 74 | } 75 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/client_appengine.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 appengine 6 | 7 | package internal 8 | 9 | import "google.golang.org/appengine/urlfetch" 10 | 11 | func init() { 12 | appengineClientHook = urlfetch.Client 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package internal contains support packages for oauth2 package. 6 | package internal 7 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/oauth2.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 | package internal 6 | 7 | import ( 8 | "crypto/rsa" 9 | "crypto/x509" 10 | "encoding/pem" 11 | "errors" 12 | "fmt" 13 | ) 14 | 15 | // ParseKey converts the binary contents of a private key file 16 | // to an *rsa.PrivateKey. It detects whether the private key is in a 17 | // PEM container or not. If so, it extracts the the private key 18 | // from PEM container before conversion. It only supports PEM 19 | // containers with no passphrase. 20 | func ParseKey(key []byte) (*rsa.PrivateKey, error) { 21 | block, _ := pem.Decode(key) 22 | if block != nil { 23 | key = block.Bytes 24 | } 25 | parsedKey, err := x509.ParsePKCS8PrivateKey(key) 26 | if err != nil { 27 | parsedKey, err = x509.ParsePKCS1PrivateKey(key) 28 | if err != nil { 29 | return nil, fmt.Errorf("private key should be a PEM or plain PKSC1 or PKCS8; parse error: %v", err) 30 | } 31 | } 32 | parsed, ok := parsedKey.(*rsa.PrivateKey) 33 | if !ok { 34 | return nil, errors.New("private key is invalid") 35 | } 36 | return parsed, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/transport.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 | package internal 6 | 7 | import ( 8 | "net/http" 9 | 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // HTTPClient is the context key to use with golang.org/x/net/context's 14 | // WithValue function to associate an *http.Client value with a context. 15 | var HTTPClient ContextKey 16 | 17 | // ContextKey is just an empty struct. It exists so HTTPClient can be 18 | // an immutable public variable with a unique type. It's immutable 19 | // because nobody else can create a ContextKey, being unexported. 20 | type ContextKey struct{} 21 | 22 | var appengineClientHook func(context.Context) *http.Client 23 | 24 | func ContextClient(ctx context.Context) *http.Client { 25 | if ctx != nil { 26 | if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { 27 | return hc 28 | } 29 | } 30 | if appengineClientHook != nil { 31 | return appengineClientHook(ctx) 32 | } 33 | return http.DefaultClient 34 | } 35 | -------------------------------------------------------------------------------- /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/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-16 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-12 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-24 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·getprocaddress(SB),NOSPLIT,$0 8 | B syscall·getprocaddress(SB) 9 | 10 | TEXT ·loadlibrary(SB),NOSPLIT,$0 11 | B syscall·loadlibrary(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/exec_windows.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 | // Fork, exec, wait, etc. 6 | 7 | package windows 8 | 9 | // EscapeArg rewrites command line argument s as prescribed 10 | // in http://msdn.microsoft.com/en-us/library/ms880421. 11 | // This function returns "" (2 double quotes) if s is empty. 12 | // Alternatively, these transformations are done: 13 | // - every back slash (\) is doubled, but only if immediately 14 | // followed by double quote ("); 15 | // - every double quote (") is escaped by back slash (\); 16 | // - finally, s is wrapped with double quotes (arg -> "arg"), 17 | // but only if there is space or tab inside s. 18 | func EscapeArg(s string) string { 19 | if len(s) == 0 { 20 | return "\"\"" 21 | } 22 | n := len(s) 23 | hasSpace := false 24 | for i := 0; i < len(s); i++ { 25 | switch s[i] { 26 | case '"', '\\': 27 | n++ 28 | case ' ', '\t': 29 | hasSpace = true 30 | } 31 | } 32 | if hasSpace { 33 | n += 2 34 | } 35 | if n == len(s) { 36 | return s 37 | } 38 | 39 | qs := make([]byte, n) 40 | j := 0 41 | if hasSpace { 42 | qs[j] = '"' 43 | j++ 44 | } 45 | slashes := 0 46 | for i := 0; i < len(s); i++ { 47 | switch s[i] { 48 | default: 49 | slashes = 0 50 | qs[j] = s[i] 51 | case '\\': 52 | slashes++ 53 | qs[j] = s[i] 54 | case '"': 55 | for ; slashes > 0; slashes-- { 56 | qs[j] = '\\' 57 | j++ 58 | } 59 | qs[j] = '\\' 60 | j++ 61 | qs[j] = s[i] 62 | } 63 | j++ 64 | } 65 | if hasSpace { 66 | for ; slashes > 0; slashes-- { 67 | qs[j] = '\\' 68 | j++ 69 | } 70 | qs[j] = '"' 71 | j++ 72 | } 73 | return string(qs[:j]) 74 | } 75 | 76 | func CloseOnExec(fd Handle) { 77 | SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0) 78 | } 79 | 80 | // FullPath retrieves the full path of the specified file. 81 | func FullPath(name string) (path string, err error) { 82 | p, err := UTF16PtrFromString(name) 83 | if err != nil { 84 | return "", err 85 | } 86 | n := uint32(100) 87 | for { 88 | buf := make([]uint16, n) 89 | n, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil) 90 | if err != nil { 91 | return "", err 92 | } 93 | if n <= uint32(len(buf)) { 94 | return UTF16ToString(buf[:n]), nil 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mkerrors.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 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 | set -e 8 | shopt -s nullglob 9 | 10 | [[ $# -eq 1 ]] || { echo "Usage: $0 OUTPUT_FILE.go" >&2; exit 1; } 11 | winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" 12 | [[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } 13 | 14 | declare -A errors 15 | 16 | { 17 | echo "// Code generated by 'go generate'; DO NOT EDIT." 18 | echo 19 | echo "package windows" 20 | echo "import \"syscall\"" 21 | echo "const (" 22 | 23 | while read -r line; do 24 | unset vtype 25 | if [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +([A-Z0-9_]+\()?([A-Z][A-Z0-9_]+k?)\)? ]]; then 26 | key="${BASH_REMATCH[1]}" 27 | value="${BASH_REMATCH[3]}" 28 | elif [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +([A-Z0-9_]+\()?((0x)?[0-9A-Fa-f]+)L?\)? ]]; then 29 | key="${BASH_REMATCH[1]}" 30 | value="${BASH_REMATCH[3]}" 31 | vtype="${BASH_REMATCH[2]}" 32 | elif [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +\(\(([A-Z]+)\)((0x)?[0-9A-Fa-f]+)L?\) ]]; then 33 | key="${BASH_REMATCH[1]}" 34 | value="${BASH_REMATCH[3]}" 35 | vtype="${BASH_REMATCH[2]}" 36 | else 37 | continue 38 | fi 39 | [[ -n $key && -n $value ]] || continue 40 | [[ -z ${errors["$key"]} ]] || continue 41 | errors["$key"]="$value" 42 | if [[ -v vtype ]]; then 43 | if [[ $key == FACILITY_* || $key == NO_ERROR ]]; then 44 | vtype="" 45 | elif [[ $vtype == *HANDLE* || $vtype == *HRESULT* ]]; then 46 | vtype="Handle" 47 | else 48 | vtype="syscall.Errno" 49 | fi 50 | last_vtype="$vtype" 51 | else 52 | vtype="" 53 | if [[ $last_vtype == Handle && $value == NO_ERROR ]]; then 54 | value="S_OK" 55 | elif [[ $last_vtype == syscall.Errno && $value == NO_ERROR ]]; then 56 | value="ERROR_SUCCESS" 57 | fi 58 | fi 59 | 60 | echo "$key $vtype = $value" 61 | done < "$winerror" 62 | 63 | echo ")" 64 | } | gofmt > "$1" 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mkerrors.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 windows 6 | 7 | //go:generate ./mkerrors.bash zerrors_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | Google Inc. 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who can contribute 2 | # (and typically have contributed) code to the repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. For example, Google employees are listed here 5 | # but not in AUTHORS, because Google holds the copyright. 6 | # 7 | # The submission process automatically checks to make sure 8 | # that people submitting code are listed in this file (by email address). 9 | # 10 | # Names should be added to this file only after verifying that 11 | # the individual or the individual's organization has agreed to 12 | # the appropriate Contributor License Agreement, found here: 13 | # 14 | # https://cla.developers.google.com/about/google-individual 15 | # https://cla.developers.google.com/about/google-corporate 16 | # 17 | # The CLA can be filled out on the web: 18 | # 19 | # https://cla.developers.google.com/ 20 | # 21 | # When adding J Random Contributor's name to this file, 22 | # either J's name or J's organization's name should be 23 | # added to the AUTHORS file, depending on whether the 24 | # individual or corporate CLA was used. 25 | 26 | # Names should be added to this file like so: 27 | # Name 28 | # 29 | # An entry with two email addresses specifies that the 30 | # first address should be used in the submit logs and 31 | # that the second address should be recognized as the 32 | # same person when interacting with Rietveld. 33 | 34 | # Please keep the list sorted. 35 | 36 | Alain Vongsouvanhalainv 37 | Andrew Gerrand 38 | Brad Fitzpatrick 39 | Eric Koleda 40 | Francesc Campoy 41 | Garrick Evans 42 | Glenn Lewis 43 | Ivan Krasin 44 | Jason Hall 45 | Johan Euphrosine 46 | Kostik Shtoyk 47 | Kunpei Sakai 48 | Matthew Whisenhunt 49 | Michael McGreevy 50 | Nick Craig-Wood 51 | Robbie Trencheny 52 | Ross Light 53 | Sarah Adams 54 | Scott Van Woudenberg 55 | Takashi Matsuo 56 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Google Inc. 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/google.golang.org/api/gensupport/backoff.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 | package gensupport 6 | 7 | import ( 8 | "math/rand" 9 | "time" 10 | ) 11 | 12 | type BackoffStrategy interface { 13 | // Pause returns the duration of the next pause and true if the operation should be 14 | // retried, or false if no further retries should be attempted. 15 | Pause() (time.Duration, bool) 16 | 17 | // Reset restores the strategy to its initial state. 18 | Reset() 19 | } 20 | 21 | // ExponentialBackoff performs exponential backoff as per https://en.wikipedia.org/wiki/Exponential_backoff. 22 | // The initial pause time is given by Base. 23 | // Once the total pause time exceeds Max, Pause will indicate no further retries. 24 | type ExponentialBackoff struct { 25 | Base time.Duration 26 | Max time.Duration 27 | total time.Duration 28 | n uint 29 | } 30 | 31 | func (eb *ExponentialBackoff) Pause() (time.Duration, bool) { 32 | if eb.total > eb.Max { 33 | return 0, false 34 | } 35 | 36 | // The next pause is selected from randomly from [0, 2^n * Base). 37 | d := time.Duration(rand.Int63n((1 << eb.n) * int64(eb.Base))) 38 | eb.total += d 39 | eb.n++ 40 | return d, true 41 | } 42 | 43 | func (eb *ExponentialBackoff) Reset() { 44 | eb.n = 0 45 | eb.total = 0 46 | } 47 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/gensupport/doc.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 | // Package gensupport is an internal implementation detail used by code 6 | // generated by the google-api-go-generator tool. 7 | // 8 | // This package may be modified at any time without regard for backwards 9 | // compatibility. It should not be used directly by API users. 10 | package gensupport 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/gensupport/go18.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 go1.8 6 | 7 | package gensupport 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | // SetGetBody sets the GetBody field of req to f. 15 | func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) { 16 | req.GetBody = f 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/gensupport/header.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gensupport 6 | 7 | import ( 8 | "fmt" 9 | "runtime" 10 | "strings" 11 | ) 12 | 13 | // GoogleClientHeader returns the value to use for the x-goog-api-client 14 | // header, which is used internally by Google. 15 | func GoogleClientHeader(generatorVersion, clientElement string) string { 16 | elts := []string{"gl-go/" + strings.Replace(runtime.Version(), " ", "_", -1)} 17 | if clientElement != "" { 18 | elts = append(elts, clientElement) 19 | } 20 | elts = append(elts, fmt.Sprintf("gdcl/%s", generatorVersion)) 21 | return strings.Join(elts, " ") 22 | } 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/gensupport/jsonfloat.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All Rights Reserved. 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 | 15 | package gensupport 16 | 17 | import ( 18 | "encoding/json" 19 | "errors" 20 | "fmt" 21 | "math" 22 | ) 23 | 24 | // JSONFloat64 is a float64 that supports proper unmarshaling of special float 25 | // values in JSON, according to 26 | // https://developers.google.com/protocol-buffers/docs/proto3#json. Although 27 | // that is a proto-to-JSON spec, it applies to all Google APIs. 28 | // 29 | // The jsonpb package 30 | // (https://github.com/golang/protobuf/blob/master/jsonpb/jsonpb.go) has 31 | // similar functionality, but only for direct translation from proto messages 32 | // to JSON. 33 | type JSONFloat64 float64 34 | 35 | func (f *JSONFloat64) UnmarshalJSON(data []byte) error { 36 | var ff float64 37 | if err := json.Unmarshal(data, &ff); err == nil { 38 | *f = JSONFloat64(ff) 39 | return nil 40 | } 41 | var s string 42 | if err := json.Unmarshal(data, &s); err == nil { 43 | switch s { 44 | case "NaN": 45 | ff = math.NaN() 46 | case "Infinity": 47 | ff = math.Inf(1) 48 | case "-Infinity": 49 | ff = math.Inf(-1) 50 | default: 51 | return fmt.Errorf("google.golang.org/api/internal: bad float string %q", s) 52 | } 53 | *f = JSONFloat64(ff) 54 | return nil 55 | } 56 | return errors.New("google.golang.org/api/internal: data not float or string") 57 | } 58 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/gensupport/not_go18.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 !go1.8 6 | 7 | package gensupport 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {} 15 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/gensupport/params.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 gensupport 6 | 7 | import ( 8 | "net/url" 9 | 10 | "google.golang.org/api/googleapi" 11 | ) 12 | 13 | // URLParams is a simplified replacement for url.Values 14 | // that safely builds up URL parameters for encoding. 15 | type URLParams map[string][]string 16 | 17 | // Get returns the first value for the given key, or "". 18 | func (u URLParams) Get(key string) string { 19 | vs := u[key] 20 | if len(vs) == 0 { 21 | return "" 22 | } 23 | return vs[0] 24 | } 25 | 26 | // Set sets the key to value. 27 | // It replaces any existing values. 28 | func (u URLParams) Set(key, value string) { 29 | u[key] = []string{value} 30 | } 31 | 32 | // SetMulti sets the key to an array of values. 33 | // It replaces any existing values. 34 | // Note that values must not be modified after calling SetMulti 35 | // so the caller is responsible for making a copy if necessary. 36 | func (u URLParams) SetMulti(key string, values []string) { 37 | u[key] = values 38 | } 39 | 40 | // Encode encodes the values into ``URL encoded'' form 41 | // ("bar=baz&foo=quux") sorted by key. 42 | func (u URLParams) Encode() string { 43 | return url.Values(u).Encode() 44 | } 45 | 46 | func SetOptions(u URLParams, opts ...googleapi.CallOption) { 47 | for _, o := range opts { 48 | u.Set(o.Get()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Joshua Tacoma 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.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 | package uritemplates 6 | 7 | // Expand parses then expands a URI template with a set of values to produce 8 | // the resultant URI. Two forms of the result are returned: one with all the 9 | // elements escaped, and one with the elements unescaped. 10 | func Expand(path string, values map[string]string) (escaped, unescaped string, err error) { 11 | template, err := parse(path) 12 | if err != nil { 13 | return "", "", err 14 | } 15 | escaped, unescaped = template.Expand(values) 16 | return escaped, unescaped, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6.x 5 | - 1.7.x 6 | - 1.8.x 7 | - 1.9.x 8 | 9 | go_import_path: google.golang.org/appengine 10 | 11 | install: 12 | - go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v appengine) 13 | - mkdir /tmp/sdk 14 | - curl -o /tmp/sdk.zip "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.40.zip" 15 | - unzip -q /tmp/sdk.zip -d /tmp/sdk 16 | - export PATH="$PATH:/tmp/sdk/go_appengine" 17 | - export APPENGINE_DEV_APPSERVER=/tmp/sdk/go_appengine/dev_appserver.py 18 | 19 | script: 20 | - goapp version 21 | - go version 22 | - go test -v google.golang.org/appengine/... 23 | - go test -v -race google.golang.org/appengine/... 24 | - goapp test -v google.golang.org/appengine/... 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/appengine_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package appengine 8 | 9 | import ( 10 | "golang.org/x/net/context" 11 | 12 | "google.golang.org/appengine/internal" 13 | ) 14 | 15 | // BackgroundContext returns a context not associated with a request. 16 | // This should only be used when not servicing a request. 17 | // This only works in App Engine "flexible environment". 18 | func BackgroundContext() context.Context { 19 | return internal.BackgroundContext() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // This file provides error functions for common API failure modes. 6 | 7 | package appengine 8 | 9 | import ( 10 | "fmt" 11 | 12 | "google.golang.org/appengine/internal" 13 | ) 14 | 15 | // IsOverQuota reports whether err represents an API call failure 16 | // due to insufficient available quota. 17 | func IsOverQuota(err error) bool { 18 | callErr, ok := err.(*internal.CallError) 19 | return ok && callErr.Code == 4 20 | } 21 | 22 | // MultiError is returned by batch operations when there are errors with 23 | // particular elements. Errors will be in a one-to-one correspondence with 24 | // the input elements; successful elements will have a nil entry. 25 | type MultiError []error 26 | 27 | func (m MultiError) Error() string { 28 | s, n := "", 0 29 | for _, e := range m { 30 | if e != nil { 31 | if n == 0 { 32 | s = e.Error() 33 | } 34 | n++ 35 | } 36 | } 37 | switch n { 38 | case 0: 39 | return "(0 errors)" 40 | case 1: 41 | return s 42 | case 2: 43 | return s + " (and 1 other error)" 44 | } 45 | return fmt.Sprintf("%s (and %d other errors)", s, n-1) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/app_id.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | func parseFullAppID(appid string) (partition, domain, displayID string) { 12 | if i := strings.Index(appid, "~"); i != -1 { 13 | partition, appid = appid[:i], appid[i+1:] 14 | } 15 | if i := strings.Index(appid, ":"); i != -1 { 16 | domain, appid = appid[:i], appid[i+1:] 17 | } 18 | return partition, domain, appid 19 | } 20 | 21 | // appID returns "appid" or "domain.com:appid". 22 | func appID(fullAppID string) string { 23 | _, dom, dis := parseFullAppID(fullAppID) 24 | if dom != "" { 25 | return dom + ":" + dis 26 | } 27 | return dis 28 | } 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "app_identity"; 3 | 4 | package appengine; 5 | 6 | message AppIdentityServiceError { 7 | enum ErrorCode { 8 | SUCCESS = 0; 9 | UNKNOWN_SCOPE = 9; 10 | BLOB_TOO_LARGE = 1000; 11 | DEADLINE_EXCEEDED = 1001; 12 | NOT_A_VALID_APP = 1002; 13 | UNKNOWN_ERROR = 1003; 14 | NOT_ALLOWED = 1005; 15 | NOT_IMPLEMENTED = 1006; 16 | } 17 | } 18 | 19 | message SignForAppRequest { 20 | optional bytes bytes_to_sign = 1; 21 | } 22 | 23 | message SignForAppResponse { 24 | optional string key_name = 1; 25 | optional bytes signature_bytes = 2; 26 | } 27 | 28 | message GetPublicCertificateForAppRequest { 29 | } 30 | 31 | message PublicCertificate { 32 | optional string key_name = 1; 33 | optional string x509_certificate_pem = 2; 34 | } 35 | 36 | message GetPublicCertificateForAppResponse { 37 | repeated PublicCertificate public_certificate_list = 1; 38 | optional int64 max_client_cache_time_in_second = 2; 39 | } 40 | 41 | message GetServiceAccountNameRequest { 42 | } 43 | 44 | message GetServiceAccountNameResponse { 45 | optional string service_account_name = 1; 46 | } 47 | 48 | message GetAccessTokenRequest { 49 | repeated string scope = 1; 50 | optional int64 service_account_id = 2; 51 | optional string service_account_name = 3; 52 | } 53 | 54 | message GetAccessTokenResponse { 55 | optional string access_token = 1; 56 | optional int64 expiration_time = 2; 57 | } 58 | 59 | message GetDefaultGcsBucketNameRequest { 60 | } 61 | 62 | message GetDefaultGcsBucketNameResponse { 63 | optional string default_gcs_bucket_name = 1; 64 | } 65 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/base/api_base.proto: -------------------------------------------------------------------------------- 1 | // Built-in base types for API calls. Primarily useful as return types. 2 | 3 | syntax = "proto2"; 4 | option go_package = "base"; 5 | 6 | package appengine.base; 7 | 8 | message StringProto { 9 | required string value = 1; 10 | } 11 | 12 | message Integer32Proto { 13 | required int32 value = 1; 14 | } 15 | 16 | message Integer64Proto { 17 | required int64 value = 1; 18 | } 19 | 20 | message BoolProto { 21 | required bool value = 1; 22 | } 23 | 24 | message DoubleProto { 25 | required double value = 1; 26 | } 27 | 28 | message BytesProto { 29 | required bytes value = 1 [ctype=CORD]; 30 | } 31 | 32 | message VoidProto { 33 | } 34 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import netcontext "golang.org/x/net/context" 8 | 9 | // These functions are implementations of the wrapper functions 10 | // in ../appengine/identity.go. See that file for commentary. 11 | 12 | func AppID(c netcontext.Context) string { 13 | return appID(FullyQualifiedAppID(c)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine" 11 | 12 | netcontext "golang.org/x/net/context" 13 | ) 14 | 15 | func DefaultVersionHostname(ctx netcontext.Context) string { 16 | c := fromContext(ctx) 17 | if c == nil { 18 | panic(errNotAppEngineContext) 19 | } 20 | return appengine.DefaultVersionHostname(c) 21 | } 22 | 23 | func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() } 24 | func ServerSoftware() string { return appengine.ServerSoftware() } 25 | func InstanceID() string { return appengine.InstanceID() } 26 | func IsDevAppServer() bool { return appengine.IsDevAppServer() } 27 | 28 | func RequestID(ctx netcontext.Context) string { 29 | c := fromContext(ctx) 30 | if c == nil { 31 | panic(errNotAppEngineContext) 32 | } 33 | return appengine.RequestID(c) 34 | } 35 | 36 | func ModuleName(ctx netcontext.Context) string { 37 | c := fromContext(ctx) 38 | if c == nil { 39 | panic(errNotAppEngineContext) 40 | } 41 | return appengine.ModuleName(c) 42 | } 43 | func VersionID(ctx netcontext.Context) string { 44 | c := fromContext(ctx) 45 | if c == nil { 46 | panic(errNotAppEngineContext) 47 | } 48 | return appengine.VersionID(c) 49 | } 50 | 51 | func fullyQualifiedAppID(ctx netcontext.Context) string { 52 | c := fromContext(ctx) 53 | if c == nil { 54 | panic(errNotAppEngineContext) 55 | } 56 | return c.FullyQualifiedAppID() 57 | } 58 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine_internal" 11 | ) 12 | 13 | func Main() { 14 | appengine_internal.Main() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "io" 11 | "log" 12 | "net/http" 13 | "net/url" 14 | "os" 15 | ) 16 | 17 | func Main() { 18 | installHealthChecker(http.DefaultServeMux) 19 | 20 | port := "8080" 21 | if s := os.Getenv("PORT"); s != "" { 22 | port = s 23 | } 24 | 25 | host := "" 26 | if IsDevAppServer() { 27 | host = "127.0.0.1" 28 | } 29 | if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil { 30 | log.Fatalf("http.ListenAndServe: %v", err) 31 | } 32 | } 33 | 34 | func installHealthChecker(mux *http.ServeMux) { 35 | // If no health check handler has been installed by this point, add a trivial one. 36 | const healthPath = "/_ah/health" 37 | hreq := &http.Request{ 38 | Method: "GET", 39 | URL: &url.URL{ 40 | Path: healthPath, 41 | }, 42 | } 43 | if _, pat := mux.Handler(hreq); pat != healthPath { 44 | mux.HandleFunc(healthPath, func(w http.ResponseWriter, r *http.Request) { 45 | io.WriteString(w, "ok") 46 | }) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/metadata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | // This file has code for accessing metadata. 8 | // 9 | // References: 10 | // https://cloud.google.com/compute/docs/metadata 11 | 12 | import ( 13 | "fmt" 14 | "io/ioutil" 15 | "log" 16 | "net/http" 17 | "net/url" 18 | ) 19 | 20 | const ( 21 | metadataHost = "metadata" 22 | metadataPath = "/computeMetadata/v1/" 23 | ) 24 | 25 | var ( 26 | metadataRequestHeaders = http.Header{ 27 | "Metadata-Flavor": []string{"Google"}, 28 | } 29 | ) 30 | 31 | // TODO(dsymonds): Do we need to support default values, like Python? 32 | func mustGetMetadata(key string) []byte { 33 | b, err := getMetadata(key) 34 | if err != nil { 35 | log.Fatalf("Metadata fetch failed: %v", err) 36 | } 37 | return b 38 | } 39 | 40 | func getMetadata(key string) ([]byte, error) { 41 | // TODO(dsymonds): May need to use url.Parse to support keys with query args. 42 | req := &http.Request{ 43 | Method: "GET", 44 | URL: &url.URL{ 45 | Scheme: "http", 46 | Host: metadataHost, 47 | Path: metadataPath + key, 48 | }, 49 | Header: metadataRequestHeaders, 50 | Host: metadataHost, 51 | } 52 | resp, err := http.DefaultClient.Do(req) 53 | if err != nil { 54 | return nil, err 55 | } 56 | defer resp.Body.Close() 57 | if resp.StatusCode != 200 { 58 | return nil, fmt.Errorf("metadata server returned HTTP %d", resp.StatusCode) 59 | } 60 | return ioutil.ReadAll(resp.Body) 61 | } 62 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/modules/modules_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "modules"; 3 | 4 | package appengine; 5 | 6 | message ModulesServiceError { 7 | enum ErrorCode { 8 | OK = 0; 9 | INVALID_MODULE = 1; 10 | INVALID_VERSION = 2; 11 | INVALID_INSTANCES = 3; 12 | TRANSIENT_ERROR = 4; 13 | UNEXPECTED_STATE = 5; 14 | } 15 | } 16 | 17 | message GetModulesRequest { 18 | } 19 | 20 | message GetModulesResponse { 21 | repeated string module = 1; 22 | } 23 | 24 | message GetVersionsRequest { 25 | optional string module = 1; 26 | } 27 | 28 | message GetVersionsResponse { 29 | repeated string version = 1; 30 | } 31 | 32 | message GetDefaultVersionRequest { 33 | optional string module = 1; 34 | } 35 | 36 | message GetDefaultVersionResponse { 37 | required string version = 1; 38 | } 39 | 40 | message GetNumInstancesRequest { 41 | optional string module = 1; 42 | optional string version = 2; 43 | } 44 | 45 | message GetNumInstancesResponse { 46 | required int64 instances = 1; 47 | } 48 | 49 | message SetNumInstancesRequest { 50 | optional string module = 1; 51 | optional string version = 2; 52 | required int64 instances = 3; 53 | } 54 | 55 | message SetNumInstancesResponse {} 56 | 57 | message StartModuleRequest { 58 | required string module = 1; 59 | required string version = 2; 60 | } 61 | 62 | message StartModuleResponse {} 63 | 64 | message StopModuleRequest { 65 | optional string module = 1; 66 | optional string version = 2; 67 | } 68 | 69 | message StopModuleResponse {} 70 | 71 | message GetHostnameRequest { 72 | optional string module = 1; 73 | optional string version = 2; 74 | optional string instance = 3; 75 | } 76 | 77 | message GetHostnameResponse { 78 | required string hostname = 1; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | // This file implements a network dialer that limits the number of concurrent connections. 8 | // It is only used for API calls. 9 | 10 | import ( 11 | "log" 12 | "net" 13 | "runtime" 14 | "sync" 15 | "time" 16 | ) 17 | 18 | var limitSem = make(chan int, 100) // TODO(dsymonds): Use environment variable. 19 | 20 | func limitRelease() { 21 | // non-blocking 22 | select { 23 | case <-limitSem: 24 | default: 25 | // This should not normally happen. 26 | log.Print("appengine: unbalanced limitSem release!") 27 | } 28 | } 29 | 30 | func limitDial(network, addr string) (net.Conn, error) { 31 | limitSem <- 1 32 | 33 | // Dial with a timeout in case the API host is MIA. 34 | // The connection should normally be very fast. 35 | conn, err := net.DialTimeout(network, addr, 500*time.Millisecond) 36 | if err != nil { 37 | limitRelease() 38 | return nil, err 39 | } 40 | lc := &limitConn{Conn: conn} 41 | runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required 42 | return lc, nil 43 | } 44 | 45 | type limitConn struct { 46 | close sync.Once 47 | net.Conn 48 | } 49 | 50 | func (lc *limitConn) Close() error { 51 | defer lc.close.Do(func() { 52 | limitRelease() 53 | runtime.SetFinalizer(lc, nil) 54 | }) 55 | return lc.Conn.Close() 56 | } 57 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # This script rebuilds the generated code for the protocol buffers. 4 | # To run this you will need protoc and goprotobuf installed; 5 | # see https://github.com/golang/protobuf for instructions. 6 | 7 | PKG=google.golang.org/appengine 8 | 9 | function die() { 10 | echo 1>&2 $* 11 | exit 1 12 | } 13 | 14 | # Sanity check that the right tools are accessible. 15 | for tool in go protoc protoc-gen-go; do 16 | q=$(which $tool) || die "didn't find $tool" 17 | echo 1>&2 "$tool: $q" 18 | done 19 | 20 | echo -n 1>&2 "finding package dir... " 21 | pkgdir=$(go list -f '{{.Dir}}' $PKG) 22 | echo 1>&2 $pkgdir 23 | base=$(echo $pkgdir | sed "s,/$PKG\$,,") 24 | echo 1>&2 "base: $base" 25 | cd $base 26 | 27 | # Run protoc once per package. 28 | for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do 29 | echo 1>&2 "* $dir" 30 | protoc --go_out=. $dir/*.proto 31 | done 32 | 33 | for f in $(find $PKG/internal -name '*.pb.go'); do 34 | # Remove proto.RegisterEnum calls. 35 | # These cause duplicate registration panics when these packages 36 | # are used on classic App Engine. proto.RegisterEnum only affects 37 | # parsing the text format; we don't care about that. 38 | # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 39 | sed -i '/proto.RegisterEnum/d' $f 40 | done 41 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "remote_api"; 3 | 4 | package remote_api; 5 | 6 | message Request { 7 | required string service_name = 2; 8 | required string method = 3; 9 | required bytes request = 4; 10 | optional string request_id = 5; 11 | } 12 | 13 | message ApplicationError { 14 | required int32 code = 1; 15 | required string detail = 2; 16 | } 17 | 18 | message RpcError { 19 | enum ErrorCode { 20 | UNKNOWN = 0; 21 | CALL_NOT_FOUND = 1; 22 | PARSE_ERROR = 2; 23 | SECURITY_VIOLATION = 3; 24 | OVER_QUOTA = 4; 25 | REQUEST_TOO_LARGE = 5; 26 | CAPABILITY_DISABLED = 6; 27 | FEATURE_DISABLED = 7; 28 | BAD_REQUEST = 8; 29 | RESPONSE_TOO_LARGE = 9; 30 | CANCELLED = 10; 31 | REPLAY_ERROR = 11; 32 | DEADLINE_EXCEEDED = 12; 33 | } 34 | required int32 code = 1; 35 | optional string detail = 2; 36 | } 37 | 38 | message Response { 39 | optional bytes response = 1; 40 | optional bytes exception = 2; 41 | optional ApplicationError application_error = 3; 42 | optional bytes java_exception = 4; 43 | optional RpcError rpc_error = 5; 44 | } 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "urlfetch"; 3 | 4 | package appengine; 5 | 6 | message URLFetchServiceError { 7 | enum ErrorCode { 8 | OK = 0; 9 | INVALID_URL = 1; 10 | FETCH_ERROR = 2; 11 | UNSPECIFIED_ERROR = 3; 12 | RESPONSE_TOO_LARGE = 4; 13 | DEADLINE_EXCEEDED = 5; 14 | SSL_CERTIFICATE_ERROR = 6; 15 | DNS_ERROR = 7; 16 | CLOSED = 8; 17 | INTERNAL_TRANSIENT_ERROR = 9; 18 | TOO_MANY_REDIRECTS = 10; 19 | MALFORMED_REPLY = 11; 20 | CONNECTION_ERROR = 12; 21 | } 22 | } 23 | 24 | message URLFetchRequest { 25 | enum RequestMethod { 26 | GET = 1; 27 | POST = 2; 28 | HEAD = 3; 29 | PUT = 4; 30 | DELETE = 5; 31 | PATCH = 6; 32 | } 33 | required RequestMethod Method = 1; 34 | required string Url = 2; 35 | repeated group Header = 3 { 36 | required string Key = 4; 37 | required string Value = 5; 38 | } 39 | optional bytes Payload = 6 [ctype=CORD]; 40 | 41 | optional bool FollowRedirects = 7 [default=true]; 42 | 43 | optional double Deadline = 8; 44 | 45 | optional bool MustValidateServerCertificate = 9 [default=true]; 46 | } 47 | 48 | message URLFetchResponse { 49 | optional bytes Content = 1; 50 | required int32 StatusCode = 2; 51 | repeated group Header = 3 { 52 | required string Key = 4; 53 | required string Value = 5; 54 | } 55 | optional bool ContentWasTruncated = 6 [default=false]; 56 | optional int64 ExternalBytesSent = 7; 57 | optional int64 ExternalBytesReceived = 8; 58 | 59 | optional string FinalUrl = 9; 60 | 61 | optional int64 ApiCpuMilliseconds = 10 [default=0]; 62 | optional int64 ApiBytesSent = 11 [default=0]; 63 | optional int64 ApiBytesReceived = 12 [default=0]; 64 | } 65 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/namespace.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package appengine 6 | 7 | import ( 8 | "fmt" 9 | "regexp" 10 | 11 | "golang.org/x/net/context" 12 | 13 | "google.golang.org/appengine/internal" 14 | ) 15 | 16 | // Namespace returns a replacement context that operates within the given namespace. 17 | func Namespace(c context.Context, namespace string) (context.Context, error) { 18 | if !validNamespace.MatchString(namespace) { 19 | return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", namespace, validNamespace) 20 | } 21 | return internal.NamespacedContext(c, namespace), nil 22 | } 23 | 24 | // validNamespace matches valid namespace names. 25 | var validNamespace = regexp.MustCompile(`^[0-9A-Za-z._-]{0,100}$`) 26 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/timeout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package appengine 6 | 7 | import "golang.org/x/net/context" 8 | 9 | // IsTimeoutError reports whether err is a timeout error. 10 | func IsTimeoutError(err error) bool { 11 | if err == context.DeadlineExceeded { 12 | return true 13 | } 14 | if t, ok := err.(interface { 15 | IsTimeout() bool 16 | }); ok { 17 | return t.IsTimeout() 18 | } 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # cloud.google.com/go v0.25.0 2 | ## explicit 3 | cloud.google.com/go/compute/metadata 4 | # github.com/davecgh/go-spew v1.1.1 5 | ## explicit 6 | # github.com/genuinetools/pkg v0.0.0-20180716210454-965f911b80a9 7 | ## explicit 8 | github.com/genuinetools/pkg/cli 9 | # github.com/golang/protobuf v1.2.0 10 | github.com/golang/protobuf/proto 11 | # github.com/kr/pretty v0.1.0 12 | ## explicit 13 | # github.com/mmcloughlin/openflights v0.0.0-20170819211133-257f09e6e50c 14 | ## explicit 15 | github.com/mmcloughlin/openflights 16 | # github.com/onsi/gomega v1.4.2 17 | ## explicit 18 | # github.com/pmezard/go-difflib v1.0.0 19 | ## explicit 20 | # github.com/sirupsen/logrus v1.0.5 21 | ## explicit 22 | github.com/sirupsen/logrus 23 | # github.com/stretchr/testify v1.2.2 24 | ## explicit 25 | # golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 26 | ## explicit 27 | golang.org/x/crypto/ssh/terminal 28 | # golang.org/x/net v0.0.0-20190620200207-3b0461eec859 29 | ## explicit 30 | golang.org/x/net/context 31 | golang.org/x/net/context/ctxhttp 32 | # golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd 33 | ## explicit 34 | golang.org/x/oauth2 35 | golang.org/x/oauth2/google 36 | golang.org/x/oauth2/internal 37 | golang.org/x/oauth2/jws 38 | golang.org/x/oauth2/jwt 39 | # golang.org/x/sync v0.0.0-20190423024810-112230192c58 40 | ## explicit 41 | # golang.org/x/sys v0.0.0-20190412213103-97732733099d 42 | golang.org/x/sys/unix 43 | golang.org/x/sys/windows 44 | # google.golang.org/api v0.0.0-20180716222000-81e9282165ac 45 | ## explicit 46 | google.golang.org/api/calendar/v3 47 | google.golang.org/api/gensupport 48 | google.golang.org/api/googleapi 49 | google.golang.org/api/googleapi/internal/uritemplates 50 | # google.golang.org/appengine v1.1.0 51 | ## explicit 52 | google.golang.org/appengine 53 | google.golang.org/appengine/internal 54 | google.golang.org/appengine/internal/app_identity 55 | google.golang.org/appengine/internal/base 56 | google.golang.org/appengine/internal/datastore 57 | google.golang.org/appengine/internal/log 58 | google.golang.org/appengine/internal/modules 59 | google.golang.org/appengine/internal/remote_api 60 | google.golang.org/appengine/internal/urlfetch 61 | google.golang.org/appengine/urlfetch 62 | # gopkg.in/airbrake/gobrake.v2 v2.0.9 63 | ## explicit 64 | # gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 65 | ## explicit 66 | # gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 67 | ## explicit 68 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // VERSION indicates which version of the binary is running. 4 | var VERSION string 5 | 6 | // GITCOMMIT indicates which git hash the binary was built off of 7 | var GITCOMMIT string 8 | --------------------------------------------------------------------------------