Full Code of adnanh/webhook for AI

master 857e708f87a6 cached
581 files
8.8 MB
2.3M tokens
95543 symbols
1 requests
Download .txt
Showing preview only (9,314K chars total). Download the full file or copy to clipboard to get everything.
Repository: adnanh/webhook
Branch: master
Commit: 857e708f87a6
Files: 581
Total size: 8.8 MB

Directory structure:
gitextract_v6ndqv7b/

├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE.md
│   └── workflows/
│       └── build.yml
├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── docs/
│   ├── Hook-Definition.md
│   ├── Hook-Examples.md
│   ├── Hook-Rules.md
│   ├── Referencing-Request-Values.md
│   ├── Systemd-Activation.md
│   ├── Templates.md
│   └── Webhook-Parameters.md
├── droppriv_nope.go
├── droppriv_unix.go
├── go.mod
├── go.sum
├── hooks.json.example
├── hooks.json.tmpl.example
├── hooks.yaml.example
├── hooks.yaml.tmpl.example
├── internal/
│   ├── hook/
│   │   ├── hook.go
│   │   ├── hook_test.go
│   │   └── request.go
│   ├── middleware/
│   │   ├── dumper.go
│   │   ├── logger.go
│   │   └── request_id.go
│   └── pidfile/
│       ├── README.md
│       ├── mkdirall.go
│       ├── mkdirall_windows.go
│       ├── pidfile.go
│       ├── pidfile_darwin.go
│       ├── pidfile_test.go
│       ├── pidfile_unix.go
│       └── pidfile_windows.go
├── platform_unix.go
├── platform_windows.go
├── signals.go
├── signals_windows.go
├── test/
│   ├── hookecho.go
│   ├── hooks.json.tmpl
│   └── hooks.yaml.tmpl
├── testutils.go
├── testutils_windows.go
├── tls.go
├── vendor/
│   ├── github.com/
│   │   ├── Microsoft/
│   │   │   └── go-winio/
│   │   │       ├── .gitattributes
│   │   │       ├── .gitignore
│   │   │       ├── .golangci.yml
│   │   │       ├── CODEOWNERS
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── SECURITY.md
│   │   │       ├── backup.go
│   │   │       ├── doc.go
│   │   │       ├── ea.go
│   │   │       ├── file.go
│   │   │       ├── fileinfo.go
│   │   │       ├── hvsock.go
│   │   │       ├── internal/
│   │   │       │   ├── fs/
│   │   │       │   │   ├── doc.go
│   │   │       │   │   ├── fs.go
│   │   │       │   │   ├── security.go
│   │   │       │   │   └── zsyscall_windows.go
│   │   │       │   ├── socket/
│   │   │       │   │   ├── rawaddr.go
│   │   │       │   │   ├── socket.go
│   │   │       │   │   └── zsyscall_windows.go
│   │   │       │   └── stringbuffer/
│   │   │       │       └── wstring.go
│   │   │       ├── pipe.go
│   │   │       ├── pkg/
│   │   │       │   └── guid/
│   │   │       │       ├── guid.go
│   │   │       │       ├── guid_nonwindows.go
│   │   │       │       ├── guid_windows.go
│   │   │       │       └── variant_string.go
│   │   │       ├── privilege.go
│   │   │       ├── reparse.go
│   │   │       ├── sd.go
│   │   │       ├── syscall.go
│   │   │       └── zsyscall_windows.go
│   │   ├── clbanning/
│   │   │   └── mxj/
│   │   │       └── v2/
│   │   │           ├── .travis.yml
│   │   │           ├── LICENSE
│   │   │           ├── anyxml.go
│   │   │           ├── atomFeedString.xml
│   │   │           ├── doc.go
│   │   │           ├── escapechars.go
│   │   │           ├── exists.go
│   │   │           ├── files.go
│   │   │           ├── files_test.badjson
│   │   │           ├── files_test.badxml
│   │   │           ├── files_test.json
│   │   │           ├── files_test.xml
│   │   │           ├── files_test_dup.json
│   │   │           ├── files_test_dup.xml
│   │   │           ├── files_test_indent.json
│   │   │           ├── files_test_indent.xml
│   │   │           ├── gob.go
│   │   │           ├── json.go
│   │   │           ├── keyvalues.go
│   │   │           ├── leafnode.go
│   │   │           ├── misc.go
│   │   │           ├── mxj.go
│   │   │           ├── newmap.go
│   │   │           ├── readme.md
│   │   │           ├── remove.go
│   │   │           ├── rename.go
│   │   │           ├── set.go
│   │   │           ├── setfieldsep.go
│   │   │           ├── songtext.xml
│   │   │           ├── strict.go
│   │   │           ├── struct.go
│   │   │           ├── updatevalues.go
│   │   │           ├── xml.go
│   │   │           ├── xmlseq.go
│   │   │           └── xmlseq2.go
│   │   ├── coreos/
│   │   │   └── go-systemd/
│   │   │       └── v22/
│   │   │           ├── LICENSE
│   │   │           ├── NOTICE
│   │   │           └── activation/
│   │   │               ├── files_unix.go
│   │   │               ├── files_windows.go
│   │   │               ├── listeners.go
│   │   │               └── packetconns.go
│   │   ├── dustin/
│   │   │   └── go-humanize/
│   │   │       ├── .travis.yml
│   │   │       ├── LICENSE
│   │   │       ├── README.markdown
│   │   │       ├── big.go
│   │   │       ├── bigbytes.go
│   │   │       ├── bytes.go
│   │   │       ├── comma.go
│   │   │       ├── commaf.go
│   │   │       ├── ftoa.go
│   │   │       ├── humanize.go
│   │   │       ├── number.go
│   │   │       ├── ordinals.go
│   │   │       ├── si.go
│   │   │       └── times.go
│   │   ├── fsnotify/
│   │   │   └── fsnotify/
│   │   │       ├── .cirrus.yml
│   │   │       ├── .editorconfig
│   │   │       ├── .gitattributes
│   │   │       ├── .gitignore
│   │   │       ├── .mailmap
│   │   │       ├── CHANGELOG.md
│   │   │       ├── CONTRIBUTING.md
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── backend_fen.go
│   │   │       ├── backend_inotify.go
│   │   │       ├── backend_kqueue.go
│   │   │       ├── backend_other.go
│   │   │       ├── backend_windows.go
│   │   │       ├── fsnotify.go
│   │   │       ├── mkdoc.zsh
│   │   │       ├── system_bsd.go
│   │   │       └── system_darwin.go
│   │   ├── ghodss/
│   │   │   └── yaml/
│   │   │       ├── .gitignore
│   │   │       ├── .travis.yml
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── fields.go
│   │   │       └── yaml.go
│   │   ├── go-chi/
│   │   │   └── chi/
│   │   │       └── v5/
│   │   │           ├── .gitignore
│   │   │           ├── CHANGELOG.md
│   │   │           ├── CONTRIBUTING.md
│   │   │           ├── LICENSE
│   │   │           ├── Makefile
│   │   │           ├── README.md
│   │   │           ├── SECURITY.md
│   │   │           ├── chain.go
│   │   │           ├── chi.go
│   │   │           ├── context.go
│   │   │           ├── middleware/
│   │   │           │   ├── basic_auth.go
│   │   │           │   ├── clean_path.go
│   │   │           │   ├── compress.go
│   │   │           │   ├── content_charset.go
│   │   │           │   ├── content_encoding.go
│   │   │           │   ├── content_type.go
│   │   │           │   ├── get_head.go
│   │   │           │   ├── heartbeat.go
│   │   │           │   ├── logger.go
│   │   │           │   ├── maybe.go
│   │   │           │   ├── middleware.go
│   │   │           │   ├── nocache.go
│   │   │           │   ├── page_route.go
│   │   │           │   ├── path_rewrite.go
│   │   │           │   ├── profiler.go
│   │   │           │   ├── realip.go
│   │   │           │   ├── recoverer.go
│   │   │           │   ├── request_id.go
│   │   │           │   ├── request_size.go
│   │   │           │   ├── route_headers.go
│   │   │           │   ├── strip.go
│   │   │           │   ├── sunset.go
│   │   │           │   ├── supress_notfound.go
│   │   │           │   ├── terminal.go
│   │   │           │   ├── throttle.go
│   │   │           │   ├── timeout.go
│   │   │           │   ├── url_format.go
│   │   │           │   ├── value.go
│   │   │           │   └── wrap_writer.go
│   │   │           ├── mux.go
│   │   │           ├── path_value.go
│   │   │           ├── path_value_fallback.go
│   │   │           └── tree.go
│   │   ├── gofrs/
│   │   │   └── uuid/
│   │   │       └── v5/
│   │   │           ├── .gitignore
│   │   │           ├── LICENSE
│   │   │           ├── README.md
│   │   │           ├── codec.go
│   │   │           ├── fuzz.go
│   │   │           ├── generator.go
│   │   │           ├── sql.go
│   │   │           └── uuid.go
│   │   └── gorilla/
│   │       └── mux/
│   │           ├── .editorconfig
│   │           ├── .gitignore
│   │           ├── LICENSE
│   │           ├── Makefile
│   │           ├── README.md
│   │           ├── doc.go
│   │           ├── middleware.go
│   │           ├── mux.go
│   │           ├── regexp.go
│   │           ├── route.go
│   │           └── test_helpers.go
│   ├── golang.org/
│   │   └── x/
│   │       └── sys/
│   │           ├── LICENSE
│   │           ├── PATENTS
│   │           ├── unix/
│   │           │   ├── .gitignore
│   │           │   ├── README.md
│   │           │   ├── affinity_linux.go
│   │           │   ├── aliases.go
│   │           │   ├── asm_aix_ppc64.s
│   │           │   ├── asm_bsd_386.s
│   │           │   ├── asm_bsd_amd64.s
│   │           │   ├── asm_bsd_arm.s
│   │           │   ├── asm_bsd_arm64.s
│   │           │   ├── asm_bsd_ppc64.s
│   │           │   ├── asm_bsd_riscv64.s
│   │           │   ├── asm_linux_386.s
│   │           │   ├── asm_linux_amd64.s
│   │           │   ├── asm_linux_arm.s
│   │           │   ├── asm_linux_arm64.s
│   │           │   ├── asm_linux_loong64.s
│   │           │   ├── asm_linux_mips64x.s
│   │           │   ├── asm_linux_mipsx.s
│   │           │   ├── asm_linux_ppc64x.s
│   │           │   ├── asm_linux_riscv64.s
│   │           │   ├── asm_linux_s390x.s
│   │           │   ├── asm_openbsd_mips64.s
│   │           │   ├── asm_solaris_amd64.s
│   │           │   ├── asm_zos_s390x.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
│   │           │   ├── dev_zos.go
│   │           │   ├── dirent.go
│   │           │   ├── endian_big.go
│   │           │   ├── endian_little.go
│   │           │   ├── env_unix.go
│   │           │   ├── epoll_zos.go
│   │           │   ├── fcntl.go
│   │           │   ├── fcntl_darwin.go
│   │           │   ├── fcntl_linux_32bit.go
│   │           │   ├── fdset.go
│   │           │   ├── fstatfs_zos.go
│   │           │   ├── gccgo.go
│   │           │   ├── gccgo_c.c
│   │           │   ├── gccgo_linux_amd64.go
│   │           │   ├── ifreq_linux.go
│   │           │   ├── ioctl_linux.go
│   │           │   ├── ioctl_signed.go
│   │           │   ├── ioctl_unsigned.go
│   │           │   ├── ioctl_zos.go
│   │           │   ├── mkall.sh
│   │           │   ├── mkerrors.sh
│   │           │   ├── mmap_nomremap.go
│   │           │   ├── mremap.go
│   │           │   ├── pagesize_unix.go
│   │           │   ├── pledge_openbsd.go
│   │           │   ├── ptrace_darwin.go
│   │           │   ├── ptrace_ios.go
│   │           │   ├── race.go
│   │           │   ├── race0.go
│   │           │   ├── readdirent_getdents.go
│   │           │   ├── readdirent_getdirentries.go
│   │           │   ├── sockcmsg_dragonfly.go
│   │           │   ├── sockcmsg_linux.go
│   │           │   ├── sockcmsg_unix.go
│   │           │   ├── sockcmsg_unix_other.go
│   │           │   ├── syscall.go
│   │           │   ├── syscall_aix.go
│   │           │   ├── syscall_aix_ppc.go
│   │           │   ├── syscall_aix_ppc64.go
│   │           │   ├── syscall_bsd.go
│   │           │   ├── syscall_darwin.go
│   │           │   ├── syscall_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── syscall_hurd.go
│   │           │   ├── syscall_hurd_386.go
│   │           │   ├── syscall_illumos.go
│   │           │   ├── syscall_linux.go
│   │           │   ├── syscall_linux_386.go
│   │           │   ├── syscall_linux_alarm.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_gc_arm.go
│   │           │   ├── syscall_linux_gccgo_386.go
│   │           │   ├── syscall_linux_gccgo_arm.go
│   │           │   ├── syscall_linux_loong64.go
│   │           │   ├── syscall_linux_mips64x.go
│   │           │   ├── syscall_linux_mipsx.go
│   │           │   ├── syscall_linux_ppc.go
│   │           │   ├── syscall_linux_ppc64x.go
│   │           │   ├── syscall_linux_riscv64.go
│   │           │   ├── syscall_linux_s390x.go
│   │           │   ├── syscall_linux_sparc64.go
│   │           │   ├── syscall_netbsd.go
│   │           │   ├── syscall_netbsd_386.go
│   │           │   ├── syscall_netbsd_amd64.go
│   │           │   ├── syscall_netbsd_arm.go
│   │           │   ├── syscall_netbsd_arm64.go
│   │           │   ├── syscall_openbsd.go
│   │           │   ├── syscall_openbsd_386.go
│   │           │   ├── syscall_openbsd_amd64.go
│   │           │   ├── syscall_openbsd_arm.go
│   │           │   ├── syscall_openbsd_arm64.go
│   │           │   ├── syscall_openbsd_libc.go
│   │           │   ├── syscall_openbsd_mips64.go
│   │           │   ├── syscall_openbsd_ppc64.go
│   │           │   ├── syscall_openbsd_riscv64.go
│   │           │   ├── syscall_solaris.go
│   │           │   ├── syscall_solaris_amd64.go
│   │           │   ├── syscall_unix.go
│   │           │   ├── syscall_unix_gc.go
│   │           │   ├── syscall_unix_gc_ppc64x.go
│   │           │   ├── syscall_zos_s390x.go
│   │           │   ├── sysvshm_linux.go
│   │           │   ├── sysvshm_unix.go
│   │           │   ├── sysvshm_unix_other.go
│   │           │   ├── timestruct.go
│   │           │   ├── unveil_openbsd.go
│   │           │   ├── xattr_bsd.go
│   │           │   ├── zerrors_aix_ppc.go
│   │           │   ├── zerrors_aix_ppc64.go
│   │           │   ├── zerrors_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── zerrors_linux.go
│   │           │   ├── zerrors_linux_386.go
│   │           │   ├── zerrors_linux_amd64.go
│   │           │   ├── zerrors_linux_arm.go
│   │           │   ├── zerrors_linux_arm64.go
│   │           │   ├── zerrors_linux_loong64.go
│   │           │   ├── zerrors_linux_mips.go
│   │           │   ├── zerrors_linux_mips64.go
│   │           │   ├── zerrors_linux_mips64le.go
│   │           │   ├── zerrors_linux_mipsle.go
│   │           │   ├── zerrors_linux_ppc.go
│   │           │   ├── zerrors_linux_ppc64.go
│   │           │   ├── zerrors_linux_ppc64le.go
│   │           │   ├── zerrors_linux_riscv64.go
│   │           │   ├── zerrors_linux_s390x.go
│   │           │   ├── zerrors_linux_sparc64.go
│   │           │   ├── zerrors_netbsd_386.go
│   │           │   ├── zerrors_netbsd_amd64.go
│   │           │   ├── zerrors_netbsd_arm.go
│   │           │   ├── zerrors_netbsd_arm64.go
│   │           │   ├── zerrors_openbsd_386.go
│   │           │   ├── zerrors_openbsd_amd64.go
│   │           │   ├── zerrors_openbsd_arm.go
│   │           │   ├── zerrors_openbsd_arm64.go
│   │           │   ├── zerrors_openbsd_mips64.go
│   │           │   ├── zerrors_openbsd_ppc64.go
│   │           │   ├── zerrors_openbsd_riscv64.go
│   │           │   ├── zerrors_solaris_amd64.go
│   │           │   ├── zerrors_zos_s390x.go
│   │           │   ├── zptrace_armnn_linux.go
│   │           │   ├── zptrace_linux_arm64.go
│   │           │   ├── zptrace_mipsnn_linux.go
│   │           │   ├── zptrace_mipsnnle_linux.go
│   │           │   ├── zptrace_x86_linux.go
│   │           │   ├── zsyscall_aix_ppc.go
│   │           │   ├── zsyscall_aix_ppc64.go
│   │           │   ├── zsyscall_aix_ppc64_gc.go
│   │           │   ├── zsyscall_aix_ppc64_gccgo.go
│   │           │   ├── zsyscall_darwin_amd64.go
│   │           │   ├── zsyscall_darwin_amd64.s
│   │           │   ├── zsyscall_darwin_arm64.go
│   │           │   ├── zsyscall_darwin_arm64.s
│   │           │   ├── zsyscall_dragonfly_amd64.go
│   │           │   ├── zsyscall_freebsd_386.go
│   │           │   ├── zsyscall_freebsd_amd64.go
│   │           │   ├── zsyscall_freebsd_arm.go
│   │           │   ├── zsyscall_freebsd_arm64.go
│   │           │   ├── zsyscall_freebsd_riscv64.go
│   │           │   ├── zsyscall_illumos_amd64.go
│   │           │   ├── zsyscall_linux.go
│   │           │   ├── zsyscall_linux_386.go
│   │           │   ├── zsyscall_linux_amd64.go
│   │           │   ├── zsyscall_linux_arm.go
│   │           │   ├── zsyscall_linux_arm64.go
│   │           │   ├── zsyscall_linux_loong64.go
│   │           │   ├── zsyscall_linux_mips.go
│   │           │   ├── zsyscall_linux_mips64.go
│   │           │   ├── zsyscall_linux_mips64le.go
│   │           │   ├── zsyscall_linux_mipsle.go
│   │           │   ├── zsyscall_linux_ppc.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_386.s
│   │           │   ├── zsyscall_openbsd_amd64.go
│   │           │   ├── zsyscall_openbsd_amd64.s
│   │           │   ├── zsyscall_openbsd_arm.go
│   │           │   ├── zsyscall_openbsd_arm.s
│   │           │   ├── zsyscall_openbsd_arm64.go
│   │           │   ├── zsyscall_openbsd_arm64.s
│   │           │   ├── zsyscall_openbsd_mips64.go
│   │           │   ├── zsyscall_openbsd_mips64.s
│   │           │   ├── zsyscall_openbsd_ppc64.go
│   │           │   ├── zsyscall_openbsd_ppc64.s
│   │           │   ├── zsyscall_openbsd_riscv64.go
│   │           │   ├── zsyscall_openbsd_riscv64.s
│   │           │   ├── zsyscall_solaris_amd64.go
│   │           │   ├── zsyscall_zos_s390x.go
│   │           │   ├── zsysctl_openbsd_386.go
│   │           │   ├── zsysctl_openbsd_amd64.go
│   │           │   ├── zsysctl_openbsd_arm.go
│   │           │   ├── zsysctl_openbsd_arm64.go
│   │           │   ├── zsysctl_openbsd_mips64.go
│   │           │   ├── zsysctl_openbsd_ppc64.go
│   │           │   ├── zsysctl_openbsd_riscv64.go
│   │           │   ├── zsysnum_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── zsysnum_linux_386.go
│   │           │   ├── zsysnum_linux_amd64.go
│   │           │   ├── zsysnum_linux_arm.go
│   │           │   ├── zsysnum_linux_arm64.go
│   │           │   ├── zsysnum_linux_loong64.go
│   │           │   ├── zsysnum_linux_mips.go
│   │           │   ├── zsysnum_linux_mips64.go
│   │           │   ├── zsysnum_linux_mips64le.go
│   │           │   ├── zsysnum_linux_mipsle.go
│   │           │   ├── zsysnum_linux_ppc.go
│   │           │   ├── zsysnum_linux_ppc64.go
│   │           │   ├── zsysnum_linux_ppc64le.go
│   │           │   ├── zsysnum_linux_riscv64.go
│   │           │   ├── zsysnum_linux_s390x.go
│   │           │   ├── zsysnum_linux_sparc64.go
│   │           │   ├── zsysnum_netbsd_386.go
│   │           │   ├── zsysnum_netbsd_amd64.go
│   │           │   ├── zsysnum_netbsd_arm.go
│   │           │   ├── zsysnum_netbsd_arm64.go
│   │           │   ├── zsysnum_openbsd_386.go
│   │           │   ├── zsysnum_openbsd_amd64.go
│   │           │   ├── zsysnum_openbsd_arm.go
│   │           │   ├── zsysnum_openbsd_arm64.go
│   │           │   ├── zsysnum_openbsd_mips64.go
│   │           │   ├── zsysnum_openbsd_ppc64.go
│   │           │   ├── zsysnum_openbsd_riscv64.go
│   │           │   ├── zsysnum_zos_s390x.go
│   │           │   ├── ztypes_aix_ppc.go
│   │           │   ├── ztypes_aix_ppc64.go
│   │           │   ├── ztypes_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── ztypes_linux.go
│   │           │   ├── ztypes_linux_386.go
│   │           │   ├── ztypes_linux_amd64.go
│   │           │   ├── ztypes_linux_arm.go
│   │           │   ├── ztypes_linux_arm64.go
│   │           │   ├── ztypes_linux_loong64.go
│   │           │   ├── ztypes_linux_mips.go
│   │           │   ├── ztypes_linux_mips64.go
│   │           │   ├── ztypes_linux_mips64le.go
│   │           │   ├── ztypes_linux_mipsle.go
│   │           │   ├── ztypes_linux_ppc.go
│   │           │   ├── ztypes_linux_ppc64.go
│   │           │   ├── ztypes_linux_ppc64le.go
│   │           │   ├── ztypes_linux_riscv64.go
│   │           │   ├── ztypes_linux_s390x.go
│   │           │   ├── ztypes_linux_sparc64.go
│   │           │   ├── ztypes_netbsd_386.go
│   │           │   ├── ztypes_netbsd_amd64.go
│   │           │   ├── ztypes_netbsd_arm.go
│   │           │   ├── ztypes_netbsd_arm64.go
│   │           │   ├── ztypes_openbsd_386.go
│   │           │   ├── ztypes_openbsd_amd64.go
│   │           │   ├── ztypes_openbsd_arm.go
│   │           │   ├── ztypes_openbsd_arm64.go
│   │           │   ├── ztypes_openbsd_mips64.go
│   │           │   ├── ztypes_openbsd_ppc64.go
│   │           │   ├── ztypes_openbsd_riscv64.go
│   │           │   ├── ztypes_solaris_amd64.go
│   │           │   └── ztypes_zos_s390x.go
│   │           └── windows/
│   │               ├── aliases.go
│   │               ├── dll_windows.go
│   │               ├── empty.s
│   │               ├── env_windows.go
│   │               ├── eventlog.go
│   │               ├── exec_windows.go
│   │               ├── memory_windows.go
│   │               ├── mkerrors.bash
│   │               ├── mkknownfolderids.bash
│   │               ├── mksyscall.go
│   │               ├── race.go
│   │               ├── race0.go
│   │               ├── security_windows.go
│   │               ├── service.go
│   │               ├── setupapi_windows.go
│   │               ├── str.go
│   │               ├── syscall.go
│   │               ├── syscall_windows.go
│   │               ├── types_windows.go
│   │               ├── types_windows_386.go
│   │               ├── types_windows_amd64.go
│   │               ├── types_windows_arm.go
│   │               ├── types_windows_arm64.go
│   │               ├── zerrors_windows.go
│   │               ├── zknownfolderids_windows.go
│   │               └── zsyscall_windows.go
│   ├── gopkg.in/
│   │   └── yaml.v2/
│   │       ├── .travis.yml
│   │       ├── LICENSE
│   │       ├── LICENSE.libyaml
│   │       ├── NOTICE
│   │       ├── README.md
│   │       ├── apic.go
│   │       ├── decode.go
│   │       ├── emitterc.go
│   │       ├── encode.go
│   │       ├── parserc.go
│   │       ├── readerc.go
│   │       ├── resolve.go
│   │       ├── scannerc.go
│   │       ├── sorter.go
│   │       ├── writerc.go
│   │       ├── yaml.go
│   │       ├── yamlh.go
│   │       └── yamlprivateh.go
│   └── modules.txt
├── webhook.go
└── webhook_test.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

open_collective: webhook
github: adnanh


================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
<!-- Love webhook? Please consider supporting our collective:
👉  https://opencollective.com/webhook/donate -->

================================================
FILE: .github/workflows/build.yml
================================================
name: build
on: [push, pull_request]
jobs:
  build:
    env:
      # The special value "local" tells Go to use the bundled Go
      # version rather than trying to fetch one according to a
      # `toolchain` value in `go.mod`. This ensures that we're
      # really running the Go version in the CI matrix rather than
      # one that the Go command has upgraded to automatically.
      GOTOOLCHAIN: local
    strategy:
      matrix:
        go-version: [1.21.x, 1.22.x]
        os: [ubuntu-latest, macos-latest, windows-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.go-version }}
        id: go

      - name: Build
        run: go build -v

      - name: Test
        run: go test -v ./...


================================================
FILE: .gitignore
================================================
.idea
.cover
coverage
webhook
/test/hookecho
build


================================================
FILE: .travis.yml
================================================
language: go

go:
  - 1.14.x
  - master

os:
  - linux
  - osx
  - windows

arch:
  - amd64
  - arm64

matrix:
  fast_finish: true
  allow_failures:
    - go: master
  exclude:
    - os: windows
      go: master
    - os: windows
      arch: arm64
    - os: osx
      arch: arm64

install:
  - go get -d -v -t ./...

script:
  - go test -v -race ./...


================================================
FILE: CONTRIBUTING.md
================================================
# Contribute

## Introduction

First, thank you for considering contributing to webhook! It's people like you that make the open source community such a great community! 😊

We welcome any type of contribution, not only code. You can help with 
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
- **Marketing**: writing blog posts, howto's, printing stickers, ...
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
- **Code**: take a look at the [open issues](issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.
- **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/webhook).

## Your First Contribution

Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).

## Submitting code

Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.

## Code review process

The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you?

## Financial contributions

We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/webhook).
Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.

## Questions

If you have any questions, create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!).
You can also reach us at hello@webhook.opencollective.com.

## Credits

### Contributors

Thank you to all the people who have already contributed to webhook!
<a href="graphs/contributors"><img src="https://opencollective.com/webhook/contributors.svg?width=890" /></a>


### Backers

Thank you to all our backers! [[Become a backer](https://opencollective.com/webhook#backer)]

<a href="https://opencollective.com/webhook#backers" target="_blank"><img src="https://opencollective.com/webhook/backers.svg?width=890"></a>


### Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/webhook#sponsor))

<a href="https://opencollective.com/webhook/sponsor/0/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/1/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/2/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/3/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/4/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/5/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/6/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/7/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/8/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/9/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/9/avatar.svg"></a>

<!-- This `CONTRIBUTING.md` is based on @nayafia's template https://github.com/nayafia/contributing-template -->

================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015 Adnan Hajdarevic <adnanh@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: Makefile
================================================
OS = darwin freebsd linux openbsd
ARCHS = 386 arm amd64 arm64

.DEFAULT_GOAL := help

.PHONY: help
help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'

all: build release release-windows

build: deps ## Build the project
	go build

release: clean deps ## Generate releases for unix systems
	@for arch in $(ARCHS);\
	do \
		for os in $(OS);\
		do \
			echo "Building $$os-$$arch"; \
			mkdir -p build/webhook-$$os-$$arch/; \
			CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch go build -o build/webhook-$$os-$$arch/webhook; \
			tar cz -C build -f build/webhook-$$os-$$arch.tar.gz webhook-$$os-$$arch; \
		done \
	done

release-windows: clean deps ## Generate release for windows
	@for arch in $(ARCHS);\
	do \
		echo "Building windows-$$arch"; \
		mkdir -p build/webhook-windows-$$arch/; \
		GOOS=windows GOARCH=$$arch go build -o build/webhook-windows-$$arch/webhook.exe; \
		tar cz -C build -f build/webhook-windows-$$arch.tar.gz webhook-windows-$$arch; \
	done

test: deps ## Execute tests
	go test ./...

deps: ## Install dependencies using go get
	go get -d -v -t ./...

clean: ## Remove building artifacts
	rm -rf build
	rm -f webhook


================================================
FILE: README.md
================================================
# What is webhook? ![build-status][badge]

 <img src="https://github.com/adnanh/webhook/raw/development/docs/logo/logo-128x128.png" alt="Webhook" align="left" />
 
 [webhook][w] is a lightweight configurable tool written in Go, that allows you to easily create HTTP endpoints (hooks) on your server, which you can use to execute configured commands. You can also pass data from the HTTP request (such as headers, payload or query variables) to your commands. [webhook][w] also allows you to specify rules which have to be satisfied in order for the hook to be triggered.

For example, if you're using Github or Bitbucket, you can use [webhook][w] to set up a hook that runs a redeploy script for your project on your staging server, whenever you push changes to the master branch of your project.

If you use Mattermost or Slack, you can set up an "Outgoing webhook integration" or "Slash command" to run various commands on your server, which can then report back directly to you or your channels using the "Incoming webhook integrations", or the appropriate response body.

[webhook][w] aims to do nothing more than it should do, and that is:
 1. receive the request,
 2. parse the headers, payload and query variables,
 3. check if the specified rules for the hook are satisfied,
 3. and finally, pass the specified arguments to the specified command via
    command line arguments or via environment variables.

Everything else is the responsibility of the command's author.

## Not what you're looking for?
| <a href="https://www.hookdoo.com/?github"><img src="https://hookdoo.com/img/Hookdoo_Logo_1.png" height="48" alt="hookdoo" /></a> | <picture><source media="(prefers-color-scheme: dark)" srcset="images/hookdeck-white.svg"><img height="36" alt="hookdeck" src="images/hookdeck-black.svg"></picture></a> |
| :-: | :-: |
| Scriptable webhook gateway to safely run your custom builds, deploys, and proxy scripts on your servers.                                      | An event gateway to reliably ingest, verify, queue, transform, filter, inspect, monitor, and replay webhooks. |
 

# Getting started
## Installation
### Building from source
To get started, first make sure you've properly set up your [Go](http://golang.org/doc/install) 1.21 or newer environment and then run
```bash
$ go build github.com/adnanh/webhook
```
to build the latest version of the [webhook][w].

### Using package manager
#### Snap store
[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/webhook)

#### Ubuntu
If you are using Ubuntu linux (17.04 or later), you can install webhook using `sudo apt-get install webhook` which will install community packaged version.

#### Debian
If you are using Debian linux ("stretch" or later), you can install webhook using `sudo apt-get install webhook` which will install community packaged version (thanks [@freeekanayaka](https://github.com/freeekanayaka)) from https://packages.debian.org/sid/webhook

#### FreeBSD
If you are using FreeBSD, you can install webhook using `pkg install webhook`.

### Download prebuilt binaries
Prebuilt binaries for different architectures are available at [GitHub Releases](https://github.com/adnanh/webhook/releases).

## Configuration
Next step is to define some hooks you want [webhook][w] to serve.
[webhook][w] supports JSON or YAML configuration files, but we'll focus primarily on JSON in the following example.
Begin by creating an empty file named `hooks.json`. This file will contain an array of hooks the [webhook][w] will serve. Check [Hook definition page](docs/Hook-Definition.md) to see the detailed description of what properties a hook can contain, and how to use them.

Let's define a simple hook named `redeploy-webhook` that will run a redeploy script located in `/var/scripts/redeploy.sh`. Make sure that your bash script has `#!/bin/sh` shebang on top.

Our `hooks.json` file will now look like this:
```json
[
  {
    "id": "redeploy-webhook",
    "execute-command": "/var/scripts/redeploy.sh",
    "command-working-directory": "/var/webhook"
  }
]
```

**NOTE:** If you prefer YAML, the equivalent `hooks.yaml` file would be:
```yaml
- id: redeploy-webhook
  execute-command: "/var/scripts/redeploy.sh"
  command-working-directory: "/var/webhook"
```

You can now run [webhook][w] using
```bash
$ /path/to/webhook -hooks hooks.json -verbose
```

It will start up on default port 9000 and will provide you with one HTTP endpoint
```http
http://yourserver:9000/hooks/redeploy-webhook
```

Check [webhook parameters page](docs/Webhook-Parameters.md) to see how to override the ip, port and other settings such as hook hotreload, verbose output, etc, when starting the [webhook][w].

By performing a simple HTTP GET or POST request to that endpoint, your specified redeploy script would be executed. Neat!

However, hook defined like that could pose a security threat to your system, because anyone who knows your endpoint, can send a request and execute your command. To prevent that, you can use the `"trigger-rule"` property for your hook, to specify the exact circumstances under which the hook would be triggered. For example, you can use them to add a secret that you must supply as a parameter in order to successfully trigger the hook. Please check out the [Hook rules page](docs/Hook-Rules.md) for detailed list of available rules and their  usage.

## Multipart Form Data
[webhook][w] provides limited support the parsing of multipart form data.
Multipart form data can contain two types of parts: values and files.
All form _values_ are automatically added to the `payload` scope.
Use the `parse-parameters-as-json` settings to parse a given value as JSON.
All files are ignored unless they match one of the following criteria:

1. The `Content-Type` header is `application/json`.
1. The part is named in the `parse-parameters-as-json` setting.

In either case, the given file part will be parsed as JSON and added to the `payload` map.

## Templates
[webhook][w] can parse the hooks configuration file as a Go template when given the `-template` [CLI parameter](docs/Webhook-Parameters.md). See the [Templates page](docs/Templates.md) for more details on template usage.

## Using HTTPS
[webhook][w] by default serves hooks using http. If you want [webhook][w] to serve secure content using https, you can use the `-secure` flag while starting [webhook][w]. Files containing a certificate and matching private key for the server must be provided using the `-cert /path/to/cert.pem` and `-key /path/to/key.pem` flags. If the certificate is signed by a certificate authority, the cert file should be the concatenation of the server's certificate followed by the CA's certificate.

TLS version and cipher suite selection flags are available from the command line. To list available cipher suites, use the `-list-cipher-suites` flag.  The `-tls-min-version` flag can be used with `-list-cipher-suites`.

## Running behind a reverse proxy
[webhook][w] may be run behind a "reverse proxy" - another web-facing server such as [Apache httpd](https://httpd.apache.org) or [Nginx](https://nginx.org) that accepts requests from clients and forwards them on to [webhook][h].  You can have [webhook][w] listen on a regular TCP port or on a Unix domain socket (with the `-socket` flag), then configure your proxy to send requests for a specific host name or sub-path over that port or socket to [webhook][w].

Note that when running in this mode the [`ip-whitelist`](docs/Hook-Rules.md#match-whitelisted-ip-range) trigger rule will not work as expected, since it will be checking the address of the _proxy_, not the _client_.  Client IP restrictions will need to be enforced within the proxy, before it decides whether to forward the request to [webhook][w].

## CORS Headers
If you want to set CORS headers, you can use the `-header name=value` flag while starting [webhook][w] to set the appropriate CORS headers that will be returned with each response.

## Running under `systemd`
On platforms that use [systemd](https://systemd.io), [webhook][w] supports the _socket activation_ mechanism.  If [webhook][w] detects that it has been launched from a systemd-managed socket it will automatically use that instead of opening its own listening port.  See [the systemd page](docs/Systemd-Activation.md) for full details.

## Interested in running webhook inside of a Docker container?
You can use one of the following Docker images, or create your own (please read [this discussion](https://github.com/adnanh/webhook/issues/63)):
- [almir/webhook](https://github.com/almir/docker-webhook)
- [roxedus/webhook](https://github.com/Roxedus/docker-webhook)
- [thecatlady/webhook](https://github.com/thecatlady/docker-webhook)
- [lwlook/webhook](https://hub.docker.com/r/lwlook/webhook) - This setup allows direct access to the Docker host, providing a streamlined and efficient way to manage webhooks.

## Examples
Check out [Hook examples page](docs/Hook-Examples.md) for more complex examples of hooks.

### Guides featuring webhook
 - [Plex 2 Telegram](https://gitlab.com/-/snippets/1972594) by [@psyhomb](https://github.com/psyhomb)
 - [Webhook & JIRA](https://sites.google.com/site/mrxpalmeiras/more/jira-webhooks) by [@perfecto25](https://github.com/perfecto25)
 - [Trigger Ansible AWX job runs on SCM (e.g. git) commit](http://jpmens.net/2017/10/23/trigger-awx-job-runs-on-scm-commit/) by [@jpmens](http://mens.de/)
 - [Deploy using GitHub webhooks](https://davidauthier.wearemd.com/blog/deploy-using-github-webhooks.html) by [@awea](https://davidauthier.wearemd.com)
 - [Setting up Automatic Deployment and Builds Using Webhooks](https://willbrowning.me/setting-up-automatic-deployment-and-builds-using-webhooks/) by [Will Browning](https://willbrowning.me/about/)
 - [Auto deploy your Node.js app on push to GitHub in 3 simple steps](https://webhookrelay.com/blog/2018/07/17/auto-deploy-on-git-push/) by Karolis Rusenas
 - [Automate Static Site Deployments with Salt, Git, and Webhooks](https://www.linode.com/docs/applications/configuration-management/automate-a-static-site-deployment-with-salt/) by [Linode](https://www.linode.com)
 - [Using Prometheus to Automatically Scale WebLogic Clusters on Kubernetes](https://blogs.oracle.com/weblogicserver/using-prometheus-to-automatically-scale-weblogic-clusters-on-kubernetes-v5) by [Marina Kogan](https://blogs.oracle.com/author/9a4fe754-1cc2-4c64-95fc-360642b62927)
 - [Github Pages and Jekyll - A New Platform for LACNIC Labs](https://labs.lacnic.net/a-new-platform-for-lacniclabs/) by [Carlos Martínez Cagnazzo](https://twitter.com/carlosm3011)
 - [How to Deploy React Apps Using Webhooks and Integrating Slack on Ubuntu](https://www.alibabacloud.com/blog/how-to-deploy-react-apps-using-webhooks-and-integrating-slack-on-ubuntu_594116) by Arslan Ud Din Shafiq
 - [Private webhooks](https://tmertz.com/2018/01/private-webhooks/) by [Thomas](https://tmertz.com)
 - [Adventures in webhooks](https://medium.com/@draketech/adventures-in-webhooks-2d6584501c62) by [Drake](https://medium.com/@draketech)
 - [GitHub pro tips](http://notes.spencerlyon.com/2016/01/04/github-pro-tips/) by [Spencer Lyon](http://notes.spencerlyon.com/)
 - [XiaoMi Vacuum + Amazon Button = Dash Cleaning](https://www.instructables.com/id/XiaoMi-Vacuum-Amazon-Button-Dash-Cleaning/) by [c0mmensal](https://www.instructables.com/member/c0mmensal/)
 - [Set up Automated Deployments From Github With Webhook](https://maximorlov.com/automated-deployments-from-github-with-webhook/) by [Maxim Orlov](https://twitter.com/_maximization)
 - [Kick Me Now with Webhooks](https://freebsdfoundation.org/kick-me-now-with-webhooks/) By Dave Cottlehuber
 - VIDEO: [Gitlab CI/CD configuration using Docker and adnanh/webhook to deploy on VPS - Tutorial #1](https://www.youtube.com/watch?v=Qhn-lXjyrZA&feature=youtu.be) by [Yes! Let's Learn Software Engineering](https://www.youtube.com/channel/UCH4XJf2BZ_52fbf8fOBMF3w)
 - [Integrate automatic deployment in 20 minutes using webhooks + Nginx setup](https://anksus.me/blog/integrate-automatic-deployment-in-20-minutes-using-webhooks) by [Anksus](https://github.com/Anksus)
 - [Automatically redeploy your static blog with Gitea, Uberspace & Webhook](https://by.arran.nz/posts/code/webhook-deploy/) by [Arran](https://arran.nz)
- [Automatically Updating My Zola Site Using a Webhook](https://osc.garden/blog/updating-site-with-webhook/) by [Óscar Fernández](https://osc.garden/)
 - ...
 - Want to add your own? Open an Issue or create a PR :-)
 
## Community Contributions
See the [webhook-contrib][wc] repository for a collections of tools and helpers related to [webhook][w] that have been contributed by the [webhook][w] community.

## Need help?
Check out [existing issues](https://github.com/adnanh/webhook/issues) to see if someone else also had the same problem, or [open a new one](https://github.com/adnanh/webhook/issues/new).

# Support active development

## Sponsors
## <a href="https://www.digitalocean.com/?ref=webhook"><img src="http://www.hajdarevic.net/DO_Logo_Horizontal_Blue.png" alt="DigitalOcean" width="250"/></a>
[DigitalOcean](https://www.digitalocean.com/?ref=webhook) is a simple and robust cloud computing platform, designed for developers.


## <a href="https://www.browserstack.com/?ref=webhook"><img src="http://www.hajdarevic.net/browserstack.svg" alt="BrowserStack" width="250"/></a>
[BrowserStack](https://www.browserstack.com/?ref=webhook) is a cloud-based cross-browser testing tool that enables developers to test their websites across various browsers on different operating systems and mobile devices, without requiring users to install virtual machines, devices or emulators.

---

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

<a href="https://opencollective.com/webhook/sponsor/0/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/1/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/2/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/3/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/4/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/5/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/6/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/7/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/8/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/webhook/sponsor/9/website" target="_blank"><img src="https://opencollective.com/webhook/sponsor/9/avatar.svg"></a>

## By contributing

This project exists thanks to all the people who contribute. [Contribute!](CONTRIBUTING.md).
<a href="graphs/contributors"><img src="https://opencollective.com/webhook/contributors.svg?width=890" /></a>

## By giving money

 - [OpenCollective Backer](https://opencollective.com/webhook#backer)
 - [OpenCollective Sponsor](https://opencollective.com/webhook#sponsor)
 - [PayPal](https://paypal.me/hookdoo)
 - [Patreon](https://www.patreon.com/webhook)
 - [Faircode](https://faircode.io/product/webhook?utm_source=badge&utm_medium=badgelarge&utm_campaign=webhook)
 - [Flattr](https://flattr.com/submit/auto?user_id=adnanh&url=https%3A%2F%2Fwww.github.com%2Fadnanh%2Fwebhook)

---

Thank you to all our backers!

<a href="https://opencollective.com/webhook#backers" target="_blank"><img src="https://opencollective.com/webhook/backers.svg?width=890"></a>

# License

The MIT License (MIT)

Copyright (c) 2015 Adnan Hajdarevic <adnanh@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


[w]: https://github.com/adnanh/webhook
[wc]: https://github.com/adnanh/webhook-contrib
[badge]: https://github.com/adnanh/webhook/workflows/build/badge.svg


================================================
FILE: docs/Hook-Definition.md
================================================
# Hook definition

Hooks are defined as objects in the JSON or YAML hooks configuration file. Please note that in order to be considered valid, a hook object must contain the `id` and `execute-command` properties. All other properties are considered optional.

## Properties (keys)

 * `id` - specifies the ID of your hook. This value is used to create the HTTP endpoint (http://yourserver:port/hooks/your-hook-id)
 * `execute-command` - specifies the command that should be executed when the hook is triggered
 * `command-working-directory` - specifies the working directory that will be used for the script when it's executed
 * `response-message` - specifies the string that will be returned to the hook initiator
 * `response-headers` - specifies the list of headers in format `{"name": "X-Example-Header", "value": "it works"}` that will be returned in HTTP response for the hook
 * `success-http-response-code` - specifies the HTTP status code to be returned upon success
 * `incoming-payload-content-type` - sets the `Content-Type` of the incoming HTTP request (ie. `application/json`); useful when the request lacks a `Content-Type` or sends an erroneous value
 * `http-methods` - a list of allowed HTTP methods, such as `POST` and `GET`
 * `include-command-output-in-response` - boolean whether webhook should wait for the command to finish and return the raw output as a response to the hook initiator. If the command fails to execute or encounters any errors while executing the response will result in 500 Internal Server Error HTTP status code, otherwise the 200 OK status code will be returned.
 * `include-command-output-in-response-on-error` - boolean whether webhook should include command stdout & stderror as a response in failed executions. It only works if `include-command-output-in-response` is set to `true`.
 * `parse-parameters-as-json` - specifies the list of arguments that contain JSON strings. These parameters will be decoded by webhook and you can access them like regular objects in rules and `pass-arguments-to-command`.
 * `pass-arguments-to-command` - specifies the list of arguments that will be passed to the command. Check [Referencing request values page](Referencing-Request-Values.md) to see how to reference the values from the request. If you want to pass a static string value to your command you can specify it as
`{ "source": "string", "name": "argumentvalue" }`
 * `pass-environment-to-command` - specifies the list of arguments that will be passed to the command as environment variables. If you do not specify the `"envname"` field in the referenced value, the hook will be in format "HOOK_argumentname", otherwise "envname" field will be used as it's name. Check [Referencing request values page](Referencing-Request-Values.md) to see how to reference the values from the request. If you want to pass a static string value to your command you can specify it as
`{ "source": "string", "envname": "SOMETHING", "name": "argumentvalue" }`
* `pass-file-to-command` - specifies a list of entries that will be serialized as a file. Incoming [data](Referencing-Request-Values.md) will be serialized in a request-temporary-file (otherwise parallel calls of the hook would lead to concurrent overwritings of the file). The filename to be addressed within the subsequent script is provided via an environment variable. Use `envname` to specify the name of the environment variable. If `envname` is not provided `HOOK_` and the name used to reference the request value are used. Defining `command-working-directory` will store the file relative to this location, if not provided, the systems temporary file directory will be used.  If `base64decode` is true, the incoming binary data will be base 64 decoded prior to storing it into the file. By default the corresponding file will be removed after the webhook exited.
 * `trigger-rule` - specifies the rule that will be evaluated in order to determine should the hook be triggered. Check [Hook rules page](Hook-Rules.md) to see the list of valid rules and their usage
 * `trigger-rule-mismatch-http-response-code` - specifies the HTTP status code to be returned when the trigger rule is not satisfied
 * `trigger-signature-soft-failures` - allow signature validation failures within Or rules; by default, signature failures are treated as errors.

## Examples
Check out [Hook examples page](Hook-Examples.md) for more complex examples of hooks.


================================================
FILE: docs/Hook-Examples.md
================================================
# Hook Examples

Hooks are defined in a hooks configuration file in either JSON or YAML format,
although the examples on this page all use the JSON format.

🌱 This page is still a work in progress. Feel free to contribute!

### Table of Contents

* [Incoming Github webhook](#incoming-github-webhook)
* [Incoming Bitbucket webhook](#incoming-bitbucket-webhook)
* [Incoming Gitlab webhook](#incoming-gitlab-webhook)
* [Incoming Gogs webhook](#incoming-gogs-webhook)
* [Incoming Gitea webhook](#incoming-gitea-webhook)
* [Slack slash command](#slack-slash-command)
* [A simple webhook with a secret key in GET query](#a-simple-webhook-with-a-secret-key-in-get-query)
* [JIRA Webhooks](#jira-webhooks)
* [Pass File-to-command sample](#pass-file-to-command-sample)
* [Incoming Scalr Webhook](#incoming-scalr-webhook)
* [Travis CI webhook](#travis-ci-webhook)
* [XML Payload](#xml-payload)
* [Multipart Form Data](#multipart-form-data)
* [Pass string arguments to command](#pass-string-arguments-to-command)
* [Receive Synology DSM notifications](#receive-synology-notifications)
* [Incoming Azure Container Registry (ACR) webhook](#incoming-acr-webhook)

## Printing the Raw Webhook Payload to Standard Output

This hook configuration receives incoming webhook requests and prints the raw request body (payload) directly to the server's standard output (visible in the webhook process logs when running with -verbose). It is particularly useful for debugging and verifying webhook deliveries from external services.

```json
[
  {
    "id": "print-payload",
    "execute-command": "/bin/echo",
    "pass-arguments-to-command": [
      {
        "source": "entire-payload",
      }
    ]
  }
]
```

## Incoming Github webhook

This example works on 2.8+ versions of Webhook - if you are on a previous series, change `payload-hmac-sha1` to `payload-hash-sha1`.

```json
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "pusher.name"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha1",
            "secret": "mysecret",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]
```

## Incoming Bitbucket webhook

Bitbucket does not pass any secrets back to the webhook.  [Per their documentation](https://support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/#Outgoing-Connections), in order to verify that the webhook came from Bitbucket you must whitelist a set of IP ranges:

```json
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "actor.username"
      }
    ],
    "trigger-rule":
    {
      "or":
      [
        { "match": { "type": "ip-whitelist", "ip-range": "13.52.5.96/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "13.236.8.224/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "18.136.214.96/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "18.184.99.224/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "18.234.32.224/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "18.246.31.224/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "52.215.192.224/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "104.192.137.240/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "104.192.138.240/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "104.192.140.240/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "104.192.142.240/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "104.192.143.240/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "185.166.143.240/28" } },
        { "match": { "type": "ip-whitelist", "ip-range": "185.166.142.240/28" } }
      ]
    }
  }
]
```

## Incoming Gitlab Webhook
Gitlab provides webhooks for many kinds of events. 
Refer to this URL for example request body content: [gitlab-ce/integrations/webhooks](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/user/project/integrations/webhooks.md)
Values in the request body can be accessed in the command or to the match rule by referencing 'payload' as the source:
```json
[
  {
    "id": "redeploy-webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "user_name"
      }
    ],
    "response-message": "Executing redeploy script",
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "value": "<YOUR-GENERATED-TOKEN>",
        "parameter":
        {
          "source": "header",
          "name": "X-Gitlab-Token"
        }
      }
    }
  }
]
```

## Incoming Gogs webhook
```json
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "pusher.name"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha256",
            "secret": "mysecret",
            "parameter":
            {
              "source": "header",
              "name": "X-Gogs-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]
```

## Incoming Gitea webhook

JSON version:

```json
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "pusher.full_name"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha256",
            "secret": "mysecret",
            "parameter":
            {
              "source": "header",
              "name": "X-Gitea-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/main",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]
```

YAML version:

```yaml
- id: webhook
  execute-command: /home/adnan/redeploy-go-webhook.sh
  command-working-directory: /home/adnan/go
  pass-arguments-to-command:
    - source: payload
      name: head_commit.id
    - source: payload
      name: pusher.full_name
    - source: payload
      name: pusher.email
  trigger-rule:
    and:
      - match:
          type: payload-hmac-sha256
          secret: mysecret
          parameter:
            source: header
            name: X-Gitea-Signature
      - match:
          type: value
          value: refs/heads/main
          parameter:
            source: payload
            name: ref
```

## Slack slash command
```json
[
  {
    "id": "redeploy-webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "response-message": "Executing redeploy script",
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "value": "<YOUR-GENERATED-TOKEN>",
        "parameter":
        {
          "source": "payload",
          "name": "token"
        }
      }
    }
  }
]
```

## A simple webhook with a secret key in GET query

__Not recommended in production due to low security__

`example.com:9000/hooks/simple-one` - won't work  
`example.com:9000/hooks/simple-one?token=42` - will work

```json
[
  {
    "id": "simple-one",
    "execute-command": "/path/to/command.sh",
    "response-message": "Executing simple webhook...",
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "value": "42",
        "parameter":
        {
          "source": "url",
          "name": "token"
        }
      }
    }
  }
]
```

## JIRA Webhooks
[Guide by @perfecto25](https://sites.google.com/site/mrxpalmeiras/more/jira-webhooks)

## Pass File-to-command sample

### Webhook configuration

```json
[
  {
    "id": "test-file-webhook",
    "execute-command": "/bin/ls",
    "command-working-directory": "/tmp",
    "pass-file-to-command":
    [
      {
      	"source": "payload",
 	"name": "binary",
      	"envname": "ENV_VARIABLE", // to use $ENV_VARIABLE in execute-command
                                   // if not defined, $HOOK_BINARY will be provided
      	"base64decode": true,      // defaults to false
      }
    ],
    "include-command-output-in-response": true
  }
]
```

### Sample client usage 

Store the following file as `testRequest.json`. 

```json
{"binary":"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wUmlnaHRzPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvcmlnaHRzLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcFJpZ2h0czpNYXJrZWQ9IkZhbHNlIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjEzMTA4RDI0QzMxQjExRTBCMzYzRjY1QUQ1Njc4QzFBIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjEzMTA4RDIzQzMxQjExRTBCMzYzRjY1QUQ1Njc4QzFBIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzMgV2luZG93cyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ1dWlkOkFDMUYyRTgzMzI0QURGMTFBQUI4QzUzOTBEODVCNUIzIiBzdFJlZjpkb2N1bWVudElEPSJ1dWlkOkM5RDM0OTY2NEEzQ0REMTFCMDhBQkJCQ0ZGMTcyMTU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+IBFgEwAAAmJJREFUeNqkk89rE1EQx2d/NNq0xcYYayPYJDWC9ODBsKIgAREjBmvEg2cvHnr05KHQ9iB49SL+/BMEfxBQKHgwCEbTNNIYaqgaoanFJi+rcXezye4689jYkIMIDnx47837zrx583YFx3Hgf0xA6/dJyAkkgUy4vgryAnmNWH9L4EVmotFoKplMHgoGg6PkrFarjXQ6/bFcLj/G5W1E+3NaX4KZeDx+dX5+7kg4HBlmrC6JoiDFYrGhROLM/mp1Y6JSqdCd3/SW0GUqEAjkl5ZyHTSHKBQKnO6a9khD2m5cr91IJBJ1VVWdiM/n6LruNJtNDs3JR3ukIW03SHTHi8iVsbG9I51OG1bW16HVasHQZopDc/JZVgdIQ1o3BmTkEnJXURS/KIpgGAYPkCQJPi0u8uzDKQN0XQPbtgE1MmrHs9nsfSqAEjxCNtHxZHLy4G4smUQgyzL4LzOegDGGp1ucVqsNqKVrpJCM7F4hg6iaZvhqtZrg8XjA4xnAU3XeKLqWaRImoIZeQXVjQO5pYp4xNVirsR1erxer2O4yfa227WCwhtWoJmn7m0h270NxmemFW4706zMm8GCgxBGEASCfhnukIW03iFdQnOPz0LNKp3362JqQzSw4u2LXBe+Bs3xD+/oc1NxN55RiC9fOme0LEQiRf2rBzaKEeJJ37ZWTVunBeGN2WmQjg/DeLTVP89nzAive2dMwlo9bpFVC2xWMZr+A720FVn88fAUb3wDMOjyN7YNc6TvUSHQ4AH6TOUdLL7em68UtWPsJqxgTpgeiLu1EBt1R+Me/mF7CQPTfAgwAGxY2vOTrR3oAAAAASUVORK5CYII="}
```

use then the curl tool to execute a request to the webhook.

```sh
#!/bin/bash
curl -H "Content-Type:application/json" -X POST -d @testRequest.json \
http://localhost:9000/hooks/test-file-webhook
```

or in a single line, using https://github.com/jpmens/jo to generate the JSON code
```console
jo binary=%filename.zip | curl -H "Content-Type:application/json" -X POST -d @- \
http://localhost:9000/hooks/test-file-webhook
```


## Incoming Scalr Webhook
[Guide by @hassanbabaie]
Scalr makes webhook calls based on an event to a configured webhook endpoint (for example Host Down, Host Up). Webhook endpoints are URLs where Scalr will deliver Webhook notifications.  
Scalr assigns a unique signing key for every configured webhook endpoint.
Refer to this URL for information on how to setup the webhook call on the Scalr side: [Scalr Wiki Webhooks](https://scalr-wiki.atlassian.net/wiki/spaces/docs/pages/6193173/Webhooks)
In order to leverage the Signing Key for additional authentication/security you must configure the trigger rule with a match type of "scalr-signature".

```json
[
    {
        "id": "redeploy-webhook",
        "execute-command": "/home/adnan/redeploy-go-webhook.sh",
        "command-working-directory": "/home/adnan/go",
        "include-command-output-in-response": true,
        "trigger-rule": 
		{
            "match": 
			{
                "type": "scalr-signature",
                "secret": "Scalr-provided signing key"
            }
        },
        "pass-environment-to-command": 
		[
            {
                "envname": "EVENT_NAME",
                "source": "payload",
                "name": "eventName"
            },
            {
                "envname": "SERVER_HOSTNAME",
                "source": "payload",
                "name": "data.SCALR_SERVER_HOSTNAME"
            }
        ]
    }
]

```

## Travis CI webhook
Travis sends webhooks as `payload=<JSON_STRING>`, so the payload needs to be parsed as JSON. Here is an example to run on successful builds of the master branch.

```json
[
  {
    "id": "deploy",
    "execute-command": "/root/my-server/deployment.sh",
    "command-working-directory": "/root/my-server",
    "parse-parameters-as-json": [
      {
        "source": "payload",
        "name": "payload"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "value",
            "value": "passed",
            "parameter": {
              "name": "payload.state",
              "source": "payload"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "master",
            "parameter": {
              "name": "payload.branch",
              "source": "payload"
            }
          }
        }
      ]
    }
  }
]
```

## JSON Array Payload

If the JSON payload is an array instead of an object, `webhook` will process the payload and place it into a "root" object.
Therefore, references to payload values must begin with `root.`.

For example, given the following payload (taken from the Sendgrid Event Webhook documentation):
```json
[
  {
    "email": "example@test.com",
    "timestamp": 1513299569,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "processed",
    "category": "cat facts",
    "sg_event_id": "sg_event_id",
    "sg_message_id": "sg_message_id"
  },
  {
    "email": "example@test.com",
    "timestamp": 1513299569,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "deferred",
    "category": "cat facts",
    "sg_event_id": "sg_event_id",
    "sg_message_id": "sg_message_id",
    "response": "400 try again later",
    "attempt": "5"
  }
]
```

A reference to the second item in the array would look like this:
```json
[
  {
    "id": "sendgrid",
    "execute-command": "/root/my-server/deployment.sh",
    "command-working-directory": "/root/my-server",
    "trigger-rule": {
      "match": {
        "type": "value",
        "parameter": {
          "source": "payload",
          "name": "root.1.event"
        },
        "value": "deferred"
      }
    }
  }
]
```

## XML Payload

Given the following payload:

```xml
<app>
  <users>
    <user id="1" name="Jeff" />
    <user id="2" name="Sally" />
  </users>
  <messages>
    <message id="1" from_user="1" to_user="2">Hello!!</message>
  </messages>
</app>
```

```json
[
  {
    "id": "deploy",
    "execute-command": "/root/my-server/deployment.sh",
    "command-working-directory": "/root/my-server",
    "trigger-rule": {
      "and": [
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "app.users.user.0.-name"
            },
            "value": "Jeff"
          }
        },
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "app.messages.message.#text"
            },
            "value": "Hello!!"
          }
        },
      ],
    }
  }
]
```

## Multipart Form Data

Example of a [Plex Media Server webhook](https://support.plex.tv/articles/115002267687-webhooks/).
The Plex Media Server will send two parts: payload and thumb.
We only care about the payload part.

```json
[
  {
    "id": "plex",
    "execute-command": "play-command.sh",
    "parse-parameters-as-json": [
      {
        "source": "payload",
        "name": "payload"
      }
    ],
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "parameter": {
          "source": "payload",
          "name": "payload.event"
        },
        "value": "media.play"
      }
    }
  }
]
```

Each part of a multipart form data body will have a `Content-Disposition` header.
Some example headers:

```
Content-Disposition: form-data; name="payload"
Content-Disposition: form-data; name="thumb"; filename="thumb.jpg"
```

We key off of the `name` attribute in the `Content-Disposition` value.

## Pass string arguments to command

To pass simple string arguments to a command, use the `string` parameter source.
The following example will pass two static string parameters ("-e 123123") to the
`execute-command` before appending the `pusher.email` value from the payload:

```json
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "pass-arguments-to-command":
    [
      {
        "source": "string",
        "name": "-e"
      },
      {
        "source": "string",
        "name": "123123"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ]
  }
]
```

## Receive Synology DSM notifications

It's possible to securely receive Synology push notifications via webhooks.
Webhooks feature introduced in DSM 7.x seems to be incomplete & broken, but you can use Synology SMS notification service to push webhooks. To configure SMS notifications on DSM follow instructions found here: https://github.com/ryancurrah/synology-notifications this will allow you to set up everything needed for webhook to accept any and all notifications sent by Synology. During setup an 'api_key' is specified - you can generate your own 32-char string and use it as an authentication mechanism to secure your webhook. Additionally, you can specify what notifications to receive via this method by going and selecting the "SMS" checkboxes under topics of interes in DSM: Control Panel -> Notification -> Rules

```json
[
  {
    "id": "synology",
    "execute-command": "do-something.sh",
    "command-working-directory": "/opt/webhook-linux-amd64/synology",
    "response-message": "Request accepted",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "message"
      }
    ],
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "value": "PUT_YOUR_API_KEY_HERE",
        "parameter":
        {
          "source": "header",
          "name": "api_key"
        }
      }
    }
  }
]
```
## Incoming Azure Container Registry (ACR) webhook

ACR can send webhooks on image push events.  The `hooks.json` below will handle those events and pass relevant properties as environment variables to a command.

Here is an example of a working docker webhook container used to handle the webhooks and fill the cache of a local registry: [ACR Harbor local cache feeder](https://github.com/tomdess/registry-cache-feeder).


```json
[
  {
    "id": "acr-push-event",
    "execute-command": "/config/script-acr.sh",
    "command-working-directory": "/config",
    "pass-environment-to-command": 
    [
      {
	"envname": "ACTION",
        "source": "payload",
        "name": "action"
      },
      {
	"envname": "REPO",
        "source": "payload",
        "name": "target.repository"
      },
      {
	"envname": "TAG",
        "source": "payload",
        "name": "target.tag"
      },
      {
	"envname": "DIGEST",
        "source": "payload",
        "name": "target.digest"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "value",
            "value": "mysecretToken",
            "parameter":
            {
              "source": "header",
              "name": "X-Static-Token"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "push",
            "parameter":
            {
              "source": "payload",
              "name": "action"
            }
          }
        }
      ]
    }
  }
]
```


================================================
FILE: docs/Hook-Rules.md
================================================
# Hook rules

### Table of Contents

* [And](#and)
* [Or](#or)
* [Not](#not)
* [Multi-level](#multi-level)
* [Match](#match)
  * [Match value](#match-value)
  * [Match regex](#match-regex)
  * [Match payload-hmac-sha1](#match-payload-hmac-sha1)
  * [Match payload-hmac-sha256](#match-payload-hmac-sha256)
  * [Match payload-hmac-sha512](#match-payload-hmac-sha512)
  * [Match Whitelisted IP range](#match-whitelisted-ip-range)
  * [Match scalr-signature](#match-scalr-signature)

## And
*And rule* will evaluate to _true_, if and only if all of the sub rules evaluate to _true_.
```json
{
"and":
  [
    {
      "match":
      {
        "type": "value",
        "value": "refs/heads/master",
        "parameter":
        {
          "source": "payload",
          "name": "ref"
        }
      }
    },
    {
      "match":
      {
        "type": "regex",
        "regex": ".*",
        "parameter":
        {
          "source": "payload",
          "name": "repository.owner.name"
        }
      }
    }
  ]
}
```
## Or
*Or rule* will evaluate to _true_, if any of the sub rules evaluate to _true_.
```json
{
"or":
  [
    {
      "match":
      {
        "type": "value",
        "value": "refs/heads/master",
        "parameter":
        {
          "source": "payload",
          "name": "ref"
        }
      }
    },
    {
      "match":
      {
        "type": "value",
        "value": "refs/heads/development",
        "parameter":
        {
          "source": "payload",
          "name": "ref"
        }
      }
    }
  ]
}
```
## Not
*Not rule* will evaluate to _true_, if and only if the sub rule evaluates to _false_.
```json
{
"not":
  {
    "match":
    {
      "type": "value",
      "value": "refs/heads/development",
      "parameter":
      {
        "source": "payload",
        "name": "ref"
      }
    }
  }
}
```
## Multi-level
```json
{
    "and": [
    {
        "match": {
            "parameter": {
                "source": "header",
                "name": "X-Hub-Signature"
            },
            "type": "payload-hmac-sha1",
            "secret": "mysecret"
        }
    },
    {
        "or": [
        {
            "match":
            {
                "parameter":
                {
                    "source": "payload",
                    "name": "ref"
                },
                "type": "value",
                "value": "refs/heads/master"
            }
        },
        {
            "match":
            {
                "parameter":
                {
                    "source": "header",
                    "name": "X-GitHub-Event"
                },
                "type": "value",
                "value": "ping"
            }
        }
        ]
    }
    ]
}
```
## Match
*Match rule* will evaluate to _true_, if and only if the referenced value in the `parameter` field satisfies the `type`-specific rule.

*Please note:* Due to technical reasons, _number_ and _boolean_ values in the _match rule_ must be wrapped around with a pair of quotes.

### Match value
```json
{
  "match":
  {
    "type": "value",
    "value": "refs/heads/development",
    "parameter":
    {
      "source": "payload",
      "name": "ref"
    }
  }
}
```

### Match regex
For the regex syntax, check out <http://golang.org/pkg/regexp/syntax/>
```json
{
  "match":
  {
    "type": "regex",
    "regex": ".*",
    "parameter":
    {
      "source": "payload",
      "name": "ref"
    }
  }
}
```

### Match payload-hmac-sha1
Validate the HMAC of the payload using the SHA1 hash and the given *secret*.
```json
{
  "match":
  {
    "type": "payload-hmac-sha1",
    "secret": "yoursecret",
    "parameter":
    {
      "source": "header",
      "name": "X-Hub-Signature"
    }
  }
}
```

Note that if multiple signatures were passed via a comma separated string, each
will be tried unless a match is found. For example:

```
X-Hub-Signature: sha1=the-first-signature,sha1=the-second-signature
```

### Match payload-hmac-sha256
Validate the HMAC of the payload using the SHA256 hash and the given *secret*.
```json
{
  "match":
  {
    "type": "payload-hmac-sha256",
    "secret": "yoursecret",
    "parameter":
    {
      "source": "header",
      "name": "X-Signature"
    }
  }
}
```

Note that if multiple signatures were passed via a comma separated string, each
will be tried unless a match is found. For example:

```
X-Hub-Signature: sha256=the-first-signature,sha256=the-second-signature
```

### Match payload-hmac-sha512
Validate the HMAC of the payload using the SHA512 hash and the given *secret*.
```json
{
  "match":
  {
    "type": "payload-hmac-sha512",
    "secret": "yoursecret",
    "parameter":
    {
      "source": "header",
      "name": "X-Signature"
    }
  }
}
```

Note that if multiple signatures were passed via a comma separated string, each
will be tried unless a match is found. For example:

```
X-Hub-Signature: sha512=the-first-signature,sha512=the-second-signature
```

### Match Whitelisted IP range

The IP can be IPv4- or IPv6-formatted, using [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_blocks).  To match a single IP address only, use `/32`.

```json
{
  "match":
  {
    "type": "ip-whitelist",
    "ip-range": "192.168.0.1/24"
  }
}
```

Note this does not work if webhook is running behind a reverse proxy, as the "client IP" will either not be available at all (if webhook is using a Unix socket or named pipe) or it will be the address of the _proxy_, not of the real client.  You will probably need to enforce client IP restrictions in the reverse proxy itself, before forwarding the requests to webhook.

### Match scalr-signature

The trigger rule checks the scalr signature and also checks that the request was signed less than 5 minutes before it was received. 
A unique signing key is generated for each webhook endpoint URL you register in Scalr.
Given the time check make sure that NTP is enabled on both your Scalr and webhook server to prevent any issues

```json
{
  "match":
  {
    "type": "scalr-signature",
    "secret": "Scalr-provided signing key"
  }
}
```


================================================
FILE: docs/Referencing-Request-Values.md
================================================
# Referencing request values
There are four types of request values:

1. HTTP Request Header values

    ```json
    {
      "source": "header",
      "name": "Header-Name"
    }
    ```

2. HTTP Query parameters

    ```json
    {
      "source": "url",
      "name": "parameter-name"
    }
    ```

3. HTTP Request parameters
    #### Valid `name` Parameters:
    - `"name": "method"`
    - `"name": "remote-addr"`

    *Note* Anything other than above mentioned `name` parameters would be invalid!

    ```json
    {
      "source": "request",
      "name": "method"
    }
    ```

    ```json
    {
      "source": "request",
      "name": "remote-addr"
    }
    ```

4. Payload (JSON or form-value encoded)
    ```json
    {
      "source": "payload",
      "name": "parameter-name"
    }
    ```

    *Note:* For JSON encoded payload, you can reference nested values using the dot-notation.
    For example, if you have following JSON payload
 
    ```json
    {
      "commits": [
        {
          "commit": {
            "id": 1
          }
        }, {
          "commit": {
            "id": 2
          }
        }
      ]
    }
    ```

    You can reference the first commit id as

    ```json
    {
      "source": "payload",
      "name": "commits.0.commit.id"
    }
    ```

    If the payload contains a key with the specified name "commits.0.commit.id", then the value of that key has priority over the dot-notation referencing.

4. XML Payload

    Referencing XML payload parameters is much like the JSON examples above, but XML is more complex.
    Element attributes are prefixed by a hyphen (`-`).
    Element values are prefixed by a pound (`#`).

    Take the following XML payload:

    ```xml
    <app>
      <users>
        <user id="1" name="Jeff" />
        <user id="2" name="Sally" />
      </users>
      <messages>
        <message id="1" from_user="1" to_user="2">Hello!!</message>
      </messages>
    </app>
    ```

    To access a given `user` element, you must treat them as an array.
    So `app.users.user.0.name` yields `Jeff`.

    Since there's only one `message` tag, it's not treated as an array.
    So `app.messages.message.id` yields `1`.

    To access the text within the `message` tag, you would use: `app.messages.message.#text`.

If you are referencing values for environment, you can use `envname` property to set the name of the environment variable like so
```json
{
  "source": "url",
  "name": "q",
  "envname": "QUERY"
}
``` 
to get the QUERY environment variable set to the `q` parameter passed in the query string.

# Special cases
If you want to pass the entire payload as JSON string to your command you can use
```json
{
  "source": "entire-payload"
}
```

for headers you can use
```json
{
  "source": "entire-headers"
}
```

and for query variables you can use
```json
{
  "source": "entire-query"
}
```


================================================
FILE: docs/Systemd-Activation.md
================================================
# Using systemd socket activation

_New in v2.8.2_

On platforms that use [systemd](https://systemd.io), [webhook][w] 
supports the _socket activation_ mechanism.  In this mode, systemd itself is responsible for managing the listening socket, and it launches [webhook][w] the first time it receives a request on the socket.  This has a number of advantages over the standard mode:

- [webhook][w] can run as a normal user while still being able to use a port number like 80 or 443 that would normally require root privilege
- if the [webhook][w] process dies and is restarted, pending connections are not dropped - they just keep waiting until the restarted [webhook][w] is ready

No special configuration is necessary to tell [webhook][w] that socket activation is being used - socket activation sets specific environment variables when launching the activated service, if [webhook][w] detects these variables it will ignore the `-port` and `-socket` options and simply use the systemd-provided socket instead of opening its own.

## Configuration
To run [webhook][w] with socket activation you need to create _two_ separate unit files in your systemd configuration directory (typically `/etc/systemd/system`), one for the socket and one for the service.  They must have matching names; in this example we use `webhook.socket` and `webhook.service`.  At their simplest, these files should look like:

**webhook.socket**
```
[Unit]
Description=Webhook server socket

[Socket]
# Listen on all network interfaces, port 9000
ListenStream=9000

# Alternatives:

## Listen on one specific interface only
# ListenStream=10.0.0.1:9000
# FreeBind=true

## Listen on a Unix domain socket
# ListenStream=/tmp/webhook.sock

[Install]
WantedBy=multi-user.target
```

**webhook.service**
```
[Unit]
Description=Webhook server

[Service]
Type=exec
ExecStart=webhook -nopanic -hooks /etc/webhook/hooks.yml

# Which user should the webhooks run as?
User=nobody
Group=nogroup
```

You should enable and start the _socket_, but it is not necessary to enable the _service_ - this will be started automatically when the socket receives its first request.

```sh
sudo systemctl enable webhook.socket
sudo systemctl start webhook.socket
```

Systemd unit files support many other options, see the [systemd.socket](https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html) and [systemd.service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html) manual pages for full details.

[w]: https://github.com/adnanh/webhook


================================================
FILE: docs/Templates.md
================================================
# Templates in Webhook

[`webhook`][w] can parse a hooks configuration file as a Go template when given the `-template` [CLI parameter](Webhook-Parameters.md).

In additional to the [built-in Go template functions and features][tt], `webhook` provides a `getenv` template function for inserting environment variables into a templated configuration file.

## Example Usage

In the example JSON template file below (YAML is also supported), the `payload-hmac-sha1` matching rule looks up the HMAC secret from the environment using the `getenv` template function.
Additionally, the result is piped through the built-in Go template function `js` to ensure that the result is a well-formed Javascript/JSON string.

```
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "response-message": "I got the payload!",
    "response-headers":
    [
      {
        "name": "Access-Control-Allow-Origin",
        "value": "*"
      }
    ],
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "pusher.name"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha1",
            "secret": "{{ getenv "XXXTEST_SECRET" | js }}",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]

```

## Template Functions

In addition to the [built-in Go template functions and features][tt], `webhook` provides the following functions:

### `getenv`

The `getenv` template function can be used for inserting environment variables into a templated configuration file.

Example: 
```
"Secret": "{{getenv TEST_secret | js}}"
```

### `cat`

The `cat` template function can be used to read a file from the local filesystem. This is useful for reading secrets from files. If the file doesn't exist, it returns an empty string.

Example:
```
"secret": "{{ cat "/run/secrets/my-secret" | js }}"
```

### `credential`

The `credential` template function provides a way to retrieve secrets using [systemd's LoadCredential mechanism](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Credentials). It reads the file specified by the given name from the directory specified in the `CREDENTIALS_DIRECTORY` environment variable.

If `CREDENTIALS_DIRECTORY` is not set, it will fall back to using `getenv` to read the secret from an environment variable of the given name.

Example:
```
"secret": "{{ credential "my-secret" | js }}"
```

[w]: https://github.com/adnanh/webhook
[tt]: https://golang.org/pkg/text/template/


================================================
FILE: docs/Webhook-Parameters.md
================================================
# Webhook parameters
```
Usage of webhook:
  -cert string
        path to the HTTPS certificate pem file (default "cert.pem")
  -cipher-suites string
        comma-separated list of supported TLS cipher suites
  -debug
        show debug output
  -header value
        response header to return, specified in format name=value, use multiple times to set multiple headers
  -hooks value
        path to the json file containing defined hooks the webhook should serve, use multiple times to load from different files
  -hotreload
        watch hooks file for changes and reload them automatically
  -http-methods string
        set default allowed HTTP methods (ie. "POST"); separate methods with comma
  -ip string
        ip the webhook should serve hooks on (default "0.0.0.0")
  -key string
        path to the HTTPS certificate private key pem file (default "key.pem")
  -list-cipher-suites
        list available TLS cipher suites
  -logfile string
        send log output to a file; implicitly enables verbose logging
  -max-multipart-mem int
        maximum memory in bytes for parsing multipart form data before disk caching (default 1048576)
  -nopanic
        do not panic if hooks cannot be loaded when webhook is not running in verbose mode
  -pidfile string
        create PID file at the given path
  -port int
        port the webhook should serve hooks on (default 9000)
  -secure
        use HTTPS instead of HTTP
  -setgid int
        set group ID after opening listening port; must be used with setuid
  -setuid int
        set user ID after opening listening port; must be used with setgid
  -socket string
        path to a Unix socket (e.g. /tmp/webhook.sock) or Windows named pipe (e.g. \\.\pipe\webhook) to use instead of listening on an ip and port; if specified, the ip and port options are ignored
  -template
        parse hooks file as a Go template
  -tls-min-version string
        minimum TLS version (1.0, 1.1, 1.2, 1.3) (default "1.2")
  -urlprefix string
        url prefix to use for served hooks (protocol://yourserver:port/PREFIX/:hook-id) (default "hooks")
  -verbose
        show verbose output
  -version
        display webhook version and quit
  -x-request-id
        use X-Request-Id header, if present, as request ID
  -x-request-id-limit int
        truncate X-Request-Id header to limit; default no limit
```

Use any of the above specified flags to override their default behavior.

# Live reloading hooks
If you are running an OS that supports the HUP or USR1 signal, you can use it to trigger hooks reload from hooks file, without restarting the webhook instance.
```bash
kill -USR1 webhookpid

kill -HUP webhookpid
```


================================================
FILE: droppriv_nope.go
================================================
// +build windows

package main

import (
	"errors"
	"runtime"
)

func dropPrivileges(uid, gid int) error {
	return errors.New("setuid and setgid not supported on " + runtime.GOOS)
}


================================================
FILE: droppriv_unix.go
================================================
// +build linux !windows

package main

import (
	"syscall"
)

func dropPrivileges(uid, gid int) error {
	err := syscall.Setgroups([]int{})
	if err != nil {
		return err
	}

	err = syscall.Setgid(gid)
	if err != nil {
		return err
	}

	err = syscall.Setuid(uid)
	if err != nil {
		return err
	}

	return nil
}


================================================
FILE: go.mod
================================================
module github.com/adnanh/webhook

go 1.21

toolchain go1.22.0

require (
	github.com/Microsoft/go-winio v0.6.2
	github.com/clbanning/mxj/v2 v2.7.0
	github.com/coreos/go-systemd/v22 v22.5.0
	github.com/dustin/go-humanize v1.0.1
	github.com/fsnotify/fsnotify v1.7.0
	github.com/ghodss/yaml v1.0.0
	github.com/go-chi/chi/v5 v5.0.12
	github.com/gofrs/uuid/v5 v5.0.0
	github.com/gorilla/mux v1.8.1
	golang.org/x/sys v0.18.0
)

require (
	github.com/google/go-cmp v0.6.0 // indirect
	github.com/kr/pretty v0.1.0 // indirect
	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
	gopkg.in/yaml.v2 v2.4.0 // indirect
)


================================================
FILE: go.sum
================================================
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s=
github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=


================================================
FILE: hooks.json.example
================================================
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "response-message": "I got the payload!",
    "response-headers":
    [
      {
        "name": "Access-Control-Allow-Origin",
        "value": "*"
      }
    ],
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "pusher.name"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha1",
            "secret": "mysecret",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]


================================================
FILE: hooks.json.tmpl.example
================================================
[
  {
    "id": "webhook",
    "execute-command": "/home/adnan/redeploy-go-webhook.sh",
    "command-working-directory": "/home/adnan/go",
    "response-message": "I got the payload!",
    "response-headers":
    [
      {
        "name": "Access-Control-Allow-Origin",
        "value": "*"
      }
    ],
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "pusher.name"
      },
      {
        "source": "payload",
        "name": "pusher.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha1",
            "secret": "{{ getenv "XXXTEST_SECRET" | js }}",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]


================================================
FILE: hooks.yaml.example
================================================
- id: webhook
  execute-command: /home/adnan/redeploy-go-webhook.sh
  command-working-directory: /home/adnan/go
  response-message: I got the payload!
  response-headers:
  - name: Access-Control-Allow-Origin
    value: '*'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: pusher.name
  - source: payload
    name: pusher.email
  trigger-rule:
    and:
    - match:
        type: payload-hmac-sha1
        secret: mysecret
        parameter:
          source: header
          name: X-Hub-Signature
    - match:
        type: value
        value: refs/heads/master
        parameter:
          source: payload
          name: ref


================================================
FILE: hooks.yaml.tmpl.example
================================================
- id: webhook
  execute-command: /home/adnan/redeploy-go-webhook.sh
  command-working-directory: /home/adnan/go
  response-message: I got the payload!
  response-headers:
  - name: Access-Control-Allow-Origin
    value: '*'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: pusher.name
  - source: payload
    name: pusher.email
  trigger-rule:
    and:
    - match:
        type: payload-hmac-sha1
        secret: "{{ getenv "XXXTEST_SECRET" | js }}"
        parameter:
          source: header
          name: X-Hub-Signature
    - match:
        type: value
        value: refs/heads/master
        parameter:
          source: payload
          name: ref


================================================
FILE: internal/hook/hook.go
================================================
package hook

import (
	"bytes"
	"crypto/hmac"
	"crypto/sha1"
	"crypto/sha256"
	"crypto/sha512"
	"crypto/subtle"
	"encoding/base64"
	"encoding/hex"
	"encoding/json"
	"errors"
	"fmt"
	"hash"
	"log"
	"math"
	"net"
	"net/textproto"
	"os"
	"path"
	"reflect"
	"regexp"
	"strconv"
	"strings"
	"text/template"
	"time"

	"github.com/ghodss/yaml"
)

// Constants used to specify the parameter source
const (
	SourceHeader         string = "header"
	SourceQuery          string = "url"
	SourceQueryAlias     string = "query"
	SourcePayload        string = "payload"
	SourceRawRequestBody string = "raw-request-body"
	SourceRequest        string = "request"
	SourceString         string = "string"
	SourceEntirePayload  string = "entire-payload"
	SourceEntireQuery    string = "entire-query"
	SourceEntireHeaders  string = "entire-headers"
)

const (
	// EnvNamespace is the prefix used for passing arguments into the command
	// environment.
	EnvNamespace string = "HOOK_"
)

// ParameterNodeError describes an error walking a parameter node.
type ParameterNodeError struct {
	key string
}

func (e *ParameterNodeError) Error() string {
	if e == nil {
		return "<nil>"
	}
	return fmt.Sprintf("parameter node not found: %s", e.key)
}

// IsParameterNodeError returns whether err is of type ParameterNodeError.
func IsParameterNodeError(err error) bool {
	switch err.(type) {
	case *ParameterNodeError:
		return true
	default:
		return false
	}
}

// SignatureError describes an invalid payload signature passed to Hook.
type SignatureError struct {
	Signature  string
	Signatures []string

	emptyPayload bool
}

func (e *SignatureError) Error() string {
	if e == nil {
		return "<nil>"
	}

	var empty string
	if e.emptyPayload {
		empty = " on empty payload"
	}

	if e.Signatures != nil {
		return fmt.Sprintf("invalid payload signatures %s%s", e.Signatures, empty)
	}

	return fmt.Sprintf("invalid payload signature %s%s", e.Signature, empty)
}

// IsSignatureError returns whether err is of type SignatureError.
func IsSignatureError(err error) bool {
	switch err.(type) {
	case *SignatureError:
		return true
	default:
		return false
	}
}

// ArgumentError describes an invalid argument passed to Hook.
type ArgumentError struct {
	Argument Argument
}

func (e *ArgumentError) Error() string {
	if e == nil {
		return "<nil>"
	}
	return fmt.Sprintf("couldn't retrieve argument for %+v", e.Argument)
}

// SourceError describes an invalid source passed to Hook.
type SourceError struct {
	Argument Argument
}

func (e *SourceError) Error() string {
	if e == nil {
		return "<nil>"
	}
	return fmt.Sprintf("invalid source for argument %+v", e.Argument)
}

// ParseError describes an error parsing user input.
type ParseError struct {
	Err error
}

func (e *ParseError) Error() string {
	if e == nil {
		return "<nil>"
	}
	return e.Err.Error()
}

// ExtractCommaSeparatedValues will extract the values matching the key.
func ExtractCommaSeparatedValues(source, prefix string) []string {
	parts := strings.Split(source, ",")
	values := make([]string, 0)
	for _, part := range parts {
		if strings.HasPrefix(part, prefix) {
			values = append(values, strings.TrimPrefix(part, prefix))
		}
	}

	return values
}

// ExtractSignatures will extract all the signatures from the source.
func ExtractSignatures(source, prefix string) []string {
	// If there are multiple possible matches, let the comma separated extractor
	// do it's work.
	if strings.Contains(source, ",") {
		return ExtractCommaSeparatedValues(source, prefix)
	}

	// There were no commas, so just trim the prefix (if it even exists) and
	// pass it back.
	return []string{
		strings.TrimPrefix(source, prefix),
	}
}

// ValidateMAC will verify that the expected mac for the given hash will match
// the one provided.
func ValidateMAC(payload []byte, mac hash.Hash, signatures []string) (string, error) {
	// Write the payload to the provided hash.
	_, err := mac.Write(payload)
	if err != nil {
		return "", err
	}

	actualMAC := hex.EncodeToString(mac.Sum(nil))

	for _, signature := range signatures {
		if hmac.Equal([]byte(signature), []byte(actualMAC)) {
			return actualMAC, err
		}
	}

	e := &SignatureError{Signatures: signatures}
	if len(payload) == 0 {
		e.emptyPayload = true
	}

	return actualMAC, e
}

// CheckPayloadSignature calculates and verifies SHA1 signature of the given payload
func CheckPayloadSignature(payload []byte, secret, signature string) (string, error) {
	if secret == "" {
		return "", errors.New("signature validation secret can not be empty")
	}

	// Extract the signatures.
	signatures := ExtractSignatures(signature, "sha1=")

	// Validate the MAC.
	return ValidateMAC(payload, hmac.New(sha1.New, []byte(secret)), signatures)
}

// CheckPayloadSignature256 calculates and verifies SHA256 signature of the given payload
func CheckPayloadSignature256(payload []byte, secret, signature string) (string, error) {
	if secret == "" {
		return "", errors.New("signature validation secret can not be empty")
	}

	// Extract the signatures.
	signatures := ExtractSignatures(signature, "sha256=")

	// Validate the MAC.
	return ValidateMAC(payload, hmac.New(sha256.New, []byte(secret)), signatures)
}

// CheckPayloadSignature512 calculates and verifies SHA512 signature of the given payload
func CheckPayloadSignature512(payload []byte, secret, signature string) (string, error) {
	if secret == "" {
		return "", errors.New("signature validation secret can not be empty")
	}

	// Extract the signatures.
	signatures := ExtractSignatures(signature, "sha512=")

	// Validate the MAC.
	return ValidateMAC(payload, hmac.New(sha512.New, []byte(secret)), signatures)
}

func CheckScalrSignature(r *Request, signingKey string, checkDate bool) (bool, error) {
	if r.Headers == nil {
		return false, nil
	}

	// Check for the signature and date headers
	if _, ok := r.Headers["X-Signature"]; !ok {
		return false, nil
	}
	if _, ok := r.Headers["Date"]; !ok {
		return false, nil
	}
	if signingKey == "" {
		return false, errors.New("signature validation signing key can not be empty")
	}

	providedSignature := r.Headers["X-Signature"].(string)
	dateHeader := r.Headers["Date"].(string)
	mac := hmac.New(sha1.New, []byte(signingKey))
	mac.Write(r.Body)
	mac.Write([]byte(dateHeader))
	expectedSignature := hex.EncodeToString(mac.Sum(nil))

	if !hmac.Equal([]byte(providedSignature), []byte(expectedSignature)) {
		return false, &SignatureError{Signature: providedSignature}
	}

	if !checkDate {
		return true, nil
	}
	// Example format: Fri 08 Sep 2017 11:24:32 UTC
	date, err := time.Parse("Mon 02 Jan 2006 15:04:05 MST", dateHeader)
	if err != nil {
		return false, err
	}
	now := time.Now()
	delta := math.Abs(now.Sub(date).Seconds())

	if delta > 300 {
		return false, &SignatureError{Signature: "outdated"}
	}
	return true, nil
}

// CheckIPWhitelist makes sure the provided remote address (of the form IP:port) falls within the provided IP range
// (in CIDR form or a single IP address).
func CheckIPWhitelist(remoteAddr, ipRange string) (bool, error) {
	// Extract IP address from remote address.

	// IPv6 addresses will likely be surrounded by [].
	ip := strings.Trim(remoteAddr, " []")

	if i := strings.LastIndex(ip, ":"); i != -1 {
		ip = ip[:i]
		ip = strings.Trim(ip, " []")
	}

	parsedIP := net.ParseIP(ip)
	if parsedIP == nil {
		return false, fmt.Errorf("invalid IP address found in remote address '%s'", remoteAddr)
	}

	for _, r := range strings.Fields(ipRange) {
		// Extract IP range in CIDR form.  If a single IP address is provided, turn it into CIDR form.

		if !strings.Contains(r, "/") {
			r = r + "/32"
		}

		_, cidr, err := net.ParseCIDR(r)
		if err != nil {
			return false, err
		}

		if cidr.Contains(parsedIP) {
			return true, nil
		}
	}

	return false, nil
}

// ReplaceParameter replaces parameter value with the passed value in the passed map
// (please note you should pass pointer to the map, because we're modifying it)
// based on the passed string
func ReplaceParameter(s string, params, value interface{}) bool {
	if params == nil {
		return false
	}

	if paramsValue := reflect.ValueOf(params); paramsValue.Kind() == reflect.Slice {
		if paramsValueSliceLength := paramsValue.Len(); paramsValueSliceLength > 0 {
			if p := strings.SplitN(s, ".", 2); len(p) > 1 {
				index, err := strconv.ParseUint(p[0], 10, 64)

				if err != nil || paramsValueSliceLength <= int(index) {
					return false
				}

				return ReplaceParameter(p[1], params.([]interface{})[index], value)
			}
		}

		return false
	}

	if p := strings.SplitN(s, ".", 2); len(p) > 1 {
		if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
			return ReplaceParameter(p[1], pValue, value)
		}
	} else {
		if _, ok := (*params.(*map[string]interface{}))[p[0]]; ok {
			(*params.(*map[string]interface{}))[p[0]] = value
			return true
		}
	}

	return false
}

// GetParameter extracts interface{} value based on the passed string
func GetParameter(s string, params interface{}) (interface{}, error) {
	if params == nil {
		return nil, errors.New("no parameters")
	}

	paramsValue := reflect.ValueOf(params)

	switch paramsValue.Kind() {
	case reflect.Slice:
		paramsValueSliceLength := paramsValue.Len()
		if paramsValueSliceLength > 0 {

			if p := strings.SplitN(s, ".", 2); len(p) > 1 {
				index, err := strconv.ParseUint(p[0], 10, 64)

				if err != nil || paramsValueSliceLength <= int(index) {
					return nil, &ParameterNodeError{s}
				}

				return GetParameter(p[1], params.([]interface{})[index])
			}

			index, err := strconv.ParseUint(s, 10, 64)

			if err != nil || paramsValueSliceLength <= int(index) {
				return nil, &ParameterNodeError{s}
			}

			return params.([]interface{})[index], nil
		}

		return nil, &ParameterNodeError{s}

	case reflect.Map:
		// Check for raw key
		if v, ok := params.(map[string]interface{})[s]; ok {
			return v, nil
		}

		// Checked for dotted references
		p := strings.SplitN(s, ".", 2)
		if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
			if len(p) > 1 {
				return GetParameter(p[1], pValue)
			}

			return pValue, nil
		}
	}

	return nil, &ParameterNodeError{s}
}

// ExtractParameterAsString extracts value from interface{} as string based on
// the passed string.  Complex data types are rendered as JSON instead of the Go
// Stringer format.
func ExtractParameterAsString(s string, params interface{}) (string, error) {
	pValue, err := GetParameter(s, params)
	if err != nil {
		return "", err
	}

	switch v := reflect.ValueOf(pValue); v.Kind() {
	case reflect.Array, reflect.Map, reflect.Slice:
		r, err := json.Marshal(pValue)
		if err != nil {
			return "", err
		}

		return string(r), nil

	default:
		return fmt.Sprintf("%v", pValue), nil
	}
}

// Argument type specifies the parameter key name and the source it should
// be extracted from
type Argument struct {
	Source       string `json:"source,omitempty"`
	Name         string `json:"name,omitempty"`
	EnvName      string `json:"envname,omitempty"`
	Base64Decode bool   `json:"base64decode,omitempty"`
}

// Get Argument method returns the value for the Argument's key name
// based on the Argument's source
func (ha *Argument) Get(r *Request) (string, error) {
	var source *map[string]interface{}
	key := ha.Name

	switch ha.Source {
	case SourceHeader:
		source = &r.Headers
		key = textproto.CanonicalMIMEHeaderKey(ha.Name)

	case SourceQuery, SourceQueryAlias:
		source = &r.Query

	case SourcePayload:
		source = &r.Payload

	case SourceString:
		return ha.Name, nil

	case SourceRawRequestBody:
		return string(r.Body), nil

	case SourceRequest:
		if r == nil || r.RawRequest == nil {
			return "", errors.New("request is nil")
		}

		switch strings.ToLower(ha.Name) {
		case "remote-addr":
			return r.RawRequest.RemoteAddr, nil
		case "method":
			return r.RawRequest.Method, nil
		default:
			return "", fmt.Errorf("unsupported request key: %q", ha.Name)
		}

	case SourceEntirePayload:
		res, err := json.Marshal(&r.Payload)
		if err != nil {
			return "", err
		}

		return string(res), nil

	case SourceEntireHeaders:
		res, err := json.Marshal(&r.Headers)
		if err != nil {
			return "", err
		}

		return string(res), nil

	case SourceEntireQuery:
		res, err := json.Marshal(&r.Query)
		if err != nil {
			return "", err
		}

		return string(res), nil
	}

	if source != nil {
		return ExtractParameterAsString(key, *source)
	}

	return "", errors.New("no source for value retrieval")
}

// Header is a structure containing header name and it's value
type Header struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

// ResponseHeaders is a slice of Header objects
type ResponseHeaders []Header

func (h *ResponseHeaders) String() string {
	// a 'hack' to display name=value in flag usage listing
	if len(*h) == 0 {
		return "name=value"
	}

	result := make([]string, len(*h))

	for idx, responseHeader := range *h {
		result[idx] = fmt.Sprintf("%s=%s", responseHeader.Name, responseHeader.Value)
	}

	return strings.Join(result, ", ")
}

// Set method appends new Header object from header=value notation
func (h *ResponseHeaders) Set(value string) error {
	splitResult := strings.SplitN(value, "=", 2)

	if len(splitResult) != 2 {
		return errors.New("header flag must be in name=value format")
	}

	*h = append(*h, Header{Name: splitResult[0], Value: splitResult[1]})
	return nil
}

// HooksFiles is a slice of String
type HooksFiles []string

func (h *HooksFiles) String() string {
	if len(*h) == 0 {
		return "hooks.json"
	}

	return strings.Join(*h, ", ")
}

// Set method appends new string
func (h *HooksFiles) Set(value string) error {
	*h = append(*h, value)
	return nil
}

// Hook type is a structure containing details for a single hook
type Hook struct {
	ID                                  string          `json:"id,omitempty"`
	ExecuteCommand                      string          `json:"execute-command,omitempty"`
	CommandWorkingDirectory             string          `json:"command-working-directory,omitempty"`
	ResponseMessage                     string          `json:"response-message,omitempty"`
	ResponseHeaders                     ResponseHeaders `json:"response-headers,omitempty"`
	CaptureCommandOutput                bool            `json:"include-command-output-in-response,omitempty"`
	CaptureCommandOutputOnError         bool            `json:"include-command-output-in-response-on-error,omitempty"`
	PassEnvironmentToCommand            []Argument      `json:"pass-environment-to-command,omitempty"`
	PassArgumentsToCommand              []Argument      `json:"pass-arguments-to-command,omitempty"`
	PassFileToCommand                   []Argument      `json:"pass-file-to-command,omitempty"`
	JSONStringParameters                []Argument      `json:"parse-parameters-as-json,omitempty"`
	TriggerRule                         *Rules          `json:"trigger-rule,omitempty"`
	TriggerRuleMismatchHttpResponseCode int             `json:"trigger-rule-mismatch-http-response-code,omitempty"`
	TriggerSignatureSoftFailures        bool            `json:"trigger-signature-soft-failures,omitempty"`
	IncomingPayloadContentType          string          `json:"incoming-payload-content-type,omitempty"`
	SuccessHttpResponseCode             int             `json:"success-http-response-code,omitempty"`
	HTTPMethods                         []string        `json:"http-methods"`
}

// ParseJSONParameters decodes specified arguments to JSON objects and replaces the
// string with the newly created object
func (h *Hook) ParseJSONParameters(r *Request) []error {
	errors := make([]error, 0)

	for i := range h.JSONStringParameters {
		arg, err := h.JSONStringParameters[i].Get(r)
		if err != nil {
			errors = append(errors, &ArgumentError{h.JSONStringParameters[i]})
		} else {
			var newArg map[string]interface{}

			decoder := json.NewDecoder(strings.NewReader(string(arg)))
			decoder.UseNumber()

			err := decoder.Decode(&newArg)
			if err != nil {
				errors = append(errors, &ParseError{err})
				continue
			}

			var source *map[string]interface{}

			switch h.JSONStringParameters[i].Source {
			case SourceHeader:
				source = &r.Headers
			case SourcePayload:
				source = &r.Payload
			case SourceQuery, SourceQueryAlias:
				source = &r.Query
			}

			if source != nil {
				key := h.JSONStringParameters[i].Name

				if h.JSONStringParameters[i].Source == SourceHeader {
					key = textproto.CanonicalMIMEHeaderKey(h.JSONStringParameters[i].Name)
				}

				ReplaceParameter(key, source, newArg)
			} else {
				errors = append(errors, &SourceError{h.JSONStringParameters[i]})
			}
		}
	}

	if len(errors) > 0 {
		return errors
	}

	return nil
}

// ExtractCommandArguments creates a list of arguments, based on the
// PassArgumentsToCommand property that is ready to be used with exec.Command()
func (h *Hook) ExtractCommandArguments(r *Request) ([]string, []error) {
	args := make([]string, 0)
	errors := make([]error, 0)

	args = append(args, h.ExecuteCommand)

	for i := range h.PassArgumentsToCommand {
		arg, err := h.PassArgumentsToCommand[i].Get(r)
		if err != nil {
			args = append(args, "")
			errors = append(errors, &ArgumentError{h.PassArgumentsToCommand[i]})
			continue
		}

		args = append(args, arg)
	}

	if len(errors) > 0 {
		return args, errors
	}

	return args, nil
}

// ExtractCommandArgumentsForEnv creates a list of arguments in key=value
// format, based on the PassEnvironmentToCommand property that is ready to be used
// with exec.Command().
func (h *Hook) ExtractCommandArgumentsForEnv(r *Request) ([]string, []error) {
	args := make([]string, 0)
	errors := make([]error, 0)
	for i := range h.PassEnvironmentToCommand {
		arg, err := h.PassEnvironmentToCommand[i].Get(r)
		if err != nil {
			errors = append(errors, &ArgumentError{h.PassEnvironmentToCommand[i]})
			continue
		}

		if h.PassEnvironmentToCommand[i].EnvName != "" {
			// first try to use the EnvName if specified
			args = append(args, h.PassEnvironmentToCommand[i].EnvName+"="+arg)
		} else {
			// then fallback on the name
			args = append(args, EnvNamespace+h.PassEnvironmentToCommand[i].Name+"="+arg)
		}
	}

	if len(errors) > 0 {
		return args, errors
	}

	return args, nil
}

// FileParameter describes a pass-file-to-command instance to be stored as file
type FileParameter struct {
	File    *os.File
	EnvName string
	Data    []byte
}

// ExtractCommandArgumentsForFile creates a list of arguments in key=value
// format, based on the PassFileToCommand property that is ready to be used
// with exec.Command().
func (h *Hook) ExtractCommandArgumentsForFile(r *Request) ([]FileParameter, []error) {
	args := make([]FileParameter, 0)
	errors := make([]error, 0)
	for i := range h.PassFileToCommand {
		arg, err := h.PassFileToCommand[i].Get(r)
		if err != nil {
			errors = append(errors, &ArgumentError{h.PassFileToCommand[i]})
			continue
		}

		if h.PassFileToCommand[i].EnvName == "" {
			// if no environment-variable name is set, fall-back on the name
			log.Printf("no ENVVAR name specified, falling back to [%s]", EnvNamespace+strings.ToUpper(h.PassFileToCommand[i].Name))
			h.PassFileToCommand[i].EnvName = EnvNamespace + strings.ToUpper(h.PassFileToCommand[i].Name)
		}

		var fileContent []byte
		if h.PassFileToCommand[i].Base64Decode {
			dec, err := base64.StdEncoding.DecodeString(arg)
			if err != nil {
				log.Printf("error decoding string [%s]", err)
			}
			fileContent = []byte(dec)
		} else {
			fileContent = []byte(arg)
		}

		args = append(args, FileParameter{EnvName: h.PassFileToCommand[i].EnvName, Data: fileContent})
	}

	if len(errors) > 0 {
		return args, errors
	}

	return args, nil
}

// Hooks is an array of Hook objects
type Hooks []Hook

// LoadFromFile attempts to load hooks from the specified file, which
// can be either JSON or YAML.  The asTemplate parameter causes the file
// contents to be parsed as a Go text/template prior to unmarshalling.
func (h *Hooks) LoadFromFile(path string, asTemplate bool) error {
	if path == "" {
		return nil
	}

	// parse hook file for hooks
	file, e := os.ReadFile(path)

	if e != nil {
		return e
	}

	if asTemplate {
		funcMap := template.FuncMap{
			"cat":        cat,
			"credential": credential,
			"getenv":     getenv,
		}

		tmpl, err := template.New("hooks").Funcs(funcMap).Parse(string(file))
		if err != nil {
			return err
		}

		var buf bytes.Buffer

		err = tmpl.Execute(&buf, nil)
		if err != nil {
			return err
		}

		file = buf.Bytes()
	}

	return yaml.Unmarshal(file, h)
}

// Append appends hooks unless the new hooks contain a hook with an ID that already exists
func (h *Hooks) Append(other *Hooks) error {
	for _, hook := range *other {
		if h.Match(hook.ID) != nil {
			return fmt.Errorf("hook with ID %s is already defined", hook.ID)
		}

		*h = append(*h, hook)
	}

	return nil
}

// Match iterates through Hooks and returns first one that matches the given ID,
// if no hook matches the given ID, nil is returned
func (h *Hooks) Match(id string) *Hook {
	for i := range *h {
		if (*h)[i].ID == id {
			return &(*h)[i]
		}
	}

	return nil
}

// Rules is a structure that contains one of the valid rule types
type Rules struct {
	And   *AndRule   `json:"and,omitempty"`
	Or    *OrRule    `json:"or,omitempty"`
	Not   *NotRule   `json:"not,omitempty"`
	Match *MatchRule `json:"match,omitempty"`
}

// Evaluate finds the first rule property that is not nil and returns the value
// it evaluates to
func (r Rules) Evaluate(req *Request) (bool, error) {
	switch {
	case r.And != nil:
		return r.And.Evaluate(req)
	case r.Or != nil:
		return r.Or.Evaluate(req)
	case r.Not != nil:
		return r.Not.Evaluate(req)
	case r.Match != nil:
		return r.Match.Evaluate(req)
	}

	return false, nil
}

// AndRule will evaluate to true if and only if all of the ChildRules evaluate to true
type AndRule []Rules

// Evaluate AndRule will return true if and only if all of ChildRules evaluate to true
func (r AndRule) Evaluate(req *Request) (bool, error) {
	res := true

	for _, v := range r {
		rv, err := v.Evaluate(req)
		if err != nil {
			return false, err
		}

		res = res && rv
		if !res {
			return res, nil
		}
	}

	return res, nil
}

// OrRule will evaluate to true if any of the ChildRules evaluate to true
type OrRule []Rules

// Evaluate OrRule will return true if any of ChildRules evaluate to true
func (r OrRule) Evaluate(req *Request) (bool, error) {
	res := false

	for _, v := range r {
		rv, err := v.Evaluate(req)
		if err != nil {
			if !IsParameterNodeError(err) {
				if !req.AllowSignatureErrors || (req.AllowSignatureErrors && !IsSignatureError(err)) {
					return false, err
				}
			}
		}

		res = res || rv
		if res {
			return res, nil
		}
	}

	return res, nil
}

// NotRule will evaluate to true if any and only if the ChildRule evaluates to false
type NotRule Rules

// Evaluate NotRule will return true if and only if ChildRule evaluates to false
func (r NotRule) Evaluate(req *Request) (bool, error) {
	rv, err := Rules(r).Evaluate(req)
	return !rv, err
}

// MatchRule will evaluate to true based on the type
type MatchRule struct {
	Type      string   `json:"type,omitempty"`
	Regex     string   `json:"regex,omitempty"`
	Secret    string   `json:"secret,omitempty"`
	Value     string   `json:"value,omitempty"`
	Parameter Argument `json:"parameter,omitempty"`
	IPRange   string   `json:"ip-range,omitempty"`
}

// Constants for the MatchRule type
const (
	MatchValue      string = "value"
	MatchRegex      string = "regex"
	MatchHMACSHA1   string = "payload-hmac-sha1"
	MatchHMACSHA256 string = "payload-hmac-sha256"
	MatchHMACSHA512 string = "payload-hmac-sha512"
	MatchHashSHA1   string = "payload-hash-sha1"
	MatchHashSHA256 string = "payload-hash-sha256"
	MatchHashSHA512 string = "payload-hash-sha512"
	IPWhitelist     string = "ip-whitelist"
	ScalrSignature  string = "scalr-signature"
)

// Evaluate MatchRule will return based on the type
func (r MatchRule) Evaluate(req *Request) (bool, error) {
	if r.Type == IPWhitelist {
		return CheckIPWhitelist(req.RawRequest.RemoteAddr, r.IPRange)
	}
	if r.Type == ScalrSignature {
		return CheckScalrSignature(req, r.Secret, true)
	}

	arg, err := r.Parameter.Get(req)
	if err == nil {
		switch r.Type {
		case MatchValue:
			return compare(arg, r.Value), nil
		case MatchRegex:
			return regexp.MatchString(r.Regex, arg)
		case MatchHashSHA1:
			log.Print(`warn: use of deprecated option payload-hash-sha1; use payload-hmac-sha1 instead`)
			fallthrough
		case MatchHMACSHA1:
			_, err := CheckPayloadSignature(req.Body, r.Secret, arg)
			return err == nil, err
		case MatchHashSHA256:
			log.Print(`warn: use of deprecated option payload-hash-sha256: use payload-hmac-sha256 instead`)
			fallthrough
		case MatchHMACSHA256:
			_, err := CheckPayloadSignature256(req.Body, r.Secret, arg)
			return err == nil, err
		case MatchHashSHA512:
			log.Print(`warn: use of deprecated option payload-hash-sha512: use payload-hmac-sha512 instead`)
			fallthrough
		case MatchHMACSHA512:
			_, err := CheckPayloadSignature512(req.Body, r.Secret, arg)
			return err == nil, err
		}
	}
	return false, err
}

// compare is a helper function for constant time string comparisons.
func compare(a, b string) bool {
	return subtle.ConstantTimeCompare([]byte(a), []byte(b)) == 1
}

// getenv provides a template function to retrieve OS environment variables.
func getenv(s string) string {
	return os.Getenv(s)
}

// cat provides a template function to retrieve content of files
// Similarly to getenv, if no file is found, it returns the empty string
func cat(s string) string {
	data, e := os.ReadFile(s)

	if e != nil {
		return ""
	}

	return strings.TrimSuffix(string(data), "\n")
}

// credential provides a template function to retreive secrets using systemd's LoadCredential mechanism
func credential(s string) string {
	dir := getenv("CREDENTIALS_DIRECTORY")

	// If no credential directory is found, fallback to the env variable
	if dir == "" {
		return getenv(s)
	}

	return cat(path.Join(dir, s))
}


================================================
FILE: internal/hook/hook_test.go
================================================
package hook

import (
	"net/http"
	"os"
	"reflect"
	"strings"
	"testing"
)

func TestGetParameter(t *testing.T) {
	for _, test := range []struct {
		key    string
		val    interface{}
		expect interface{}
		ok     bool
	}{
		// True
		{"a", map[string]interface{}{"a": "1"}, "1", true},
		{"a.b", map[string]interface{}{"a.b": "1"}, "1", true},
		{"a.c", map[string]interface{}{"a": map[string]interface{}{"c": 2}}, 2, true},
		{"a.1", map[string]interface{}{"a": map[string]interface{}{"1": 3}}, 3, true},
		{"a.1", map[string]interface{}{"a": []interface{}{"a", "b"}}, "b", true},
		{"0", []interface{}{"a", "b"}, "a", true},

		// False
		{"z", map[string]interface{}{"a": "1"}, nil, false},
		{"a.z", map[string]interface{}{"a": map[string]interface{}{"b": 2}}, nil, false},
		{"z.b", map[string]interface{}{"a": map[string]interface{}{"z": 2}}, nil, false},
		{"a.2", map[string]interface{}{"a": []interface{}{"a", "b"}}, nil, false},
	} {
		res, err := GetParameter(test.key, test.val)
		if (err == nil) != test.ok {
			t.Errorf("unexpected result given {%q, %q}: %s\n", test.key, test.val, err)
		}

		if !reflect.DeepEqual(res, test.expect) {
			t.Errorf("failed given {%q, %q}:\nexpected {%#v}\ngot {%#v}\n", test.key, test.val, test.expect, res)
		}
	}
}

var checkPayloadSignatureTests = []struct {
	payload   []byte
	secret    string
	signature string
	mac       string
	ok        bool
}{
	{[]byte(`{"a": "z"}`), "secret", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", true},
	{[]byte(`{"a": "z"}`), "secret", "sha1=b17e04cbb22afa8ffbff8796fc1894ed27badd9e", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", true},
	{[]byte(`{"a": "z"}`), "secret", "sha1=XXXe04cbb22afa8ffbff8796fc1894ed27badd9e,sha1=b17e04cbb22afa8ffbff8796fc1894ed27badd9e", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", true},
	{[]byte(``), "secret", "25af6174a0fcecc4d346680a72b7ce644b9a88e8", "25af6174a0fcecc4d346680a72b7ce644b9a88e8", true},
	// failures
	{[]byte(`{"a": "z"}`), "secret", "XXXe04cbb22afa8ffbff8796fc1894ed27badd9e", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", false},
	{[]byte(`{"a": "z"}`), "secret", "sha1=XXXe04cbb22afa8ffbff8796fc1894ed27badd9e", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", false},
	{[]byte(`{"a": "z"}`), "secret", "sha1=XXXe04cbb22afa8ffbff8796fc1894ed27badd9e,sha1=XXXe04cbb22afa8ffbff8796fc1894ed27badd9e", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", false},
	{[]byte(`{"a": "z"}`), "secreX", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", "900225703e9342328db7307692736e2f7cc7b36e", false},
	{[]byte(`{"a": "z"}`), "", "b17e04cbb22afa8ffbff8796fc1894ed27badd9e", "", false},
	{[]byte(``), "secret", "XXXf6174a0fcecc4d346680a72b7ce644b9a88e8", "25af6174a0fcecc4d346680a72b7ce644b9a88e8", false},
}

func TestCheckPayloadSignature(t *testing.T) {
	for _, tt := range checkPayloadSignatureTests {
		mac, err := CheckPayloadSignature(tt.payload, tt.secret, tt.signature)
		if (err == nil) != tt.ok || mac != tt.mac {
			t.Errorf("failed to check payload signature {%q, %q, %q}:\nexpected {mac:%#v, ok:%#v},\ngot {mac:%#v, ok:%#v}", tt.payload, tt.secret, tt.signature, tt.mac, tt.ok, mac, (err == nil))
		}

		if err != nil && tt.mac != "" && strings.Contains(err.Error(), tt.mac) {
			t.Errorf("error message should not disclose expected mac: %s", err)
		}
	}
}

var checkPayloadSignature256Tests = []struct {
	payload   []byte
	secret    string
	signature string
	mac       string
	ok        bool
}{
	{[]byte(`{"a": "z"}`), "secret", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", true},
	{[]byte(`{"a": "z"}`), "secret", "sha256=f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", true},
	{[]byte(`{"a": "z"}`), "secret", "sha256=XXX7af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89,sha256=f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", true},
	{[]byte(``), "secret", "f9e66e179b6747ae54108f82f8ade8b3c25d76fd30afde6c395822c530196169", "f9e66e179b6747ae54108f82f8ade8b3c25d76fd30afde6c395822c530196169", true},
	// failures
	{[]byte(`{"a": "z"}`), "secret", "XXX7af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", false},
	{[]byte(`{"a": "z"}`), "secret", "sha256=XXX7af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", false},
	{[]byte(`{"a": "z"}`), "secret", "sha256=XXX7af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89,sha256=XXX7af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", false},
	{[]byte(`{"a": "z"}`), "", "XXX7af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89", "", false},
	{[]byte(``), "secret", "XXX66e179b6747ae54108f82f8ade8b3c25d76fd30afde6c395822c530196169", "f9e66e179b6747ae54108f82f8ade8b3c25d76fd30afde6c395822c530196169", false},
}

func TestCheckPayloadSignature256(t *testing.T) {
	for _, tt := range checkPayloadSignature256Tests {
		mac, err := CheckPayloadSignature256(tt.payload, tt.secret, tt.signature)
		if (err == nil) != tt.ok || mac != tt.mac {
			t.Errorf("failed to check payload signature {%q, %q, %q}:\nexpected {mac:%#v, ok:%#v},\ngot {mac:%#v, ok:%#v}", tt.payload, tt.secret, tt.signature, tt.mac, tt.ok, mac, (err == nil))
		}

		if err != nil && tt.mac != "" && strings.Contains(err.Error(), tt.mac) {
			t.Errorf("error message should not disclose expected mac: %s", err)
		}
	}
}

var checkPayloadSignature512Tests = []struct {
	payload   []byte
	secret    string
	signature string
	mac       string
	ok        bool
}{
	{[]byte(`{"a": "z"}`), "secret", "4ab17cc8ec668ead8bf498f87f8f32848c04d5ca3c9bcfcd3db9363f0deb44e580b329502a7fdff633d4d8fca301cc5c94a55a2fec458c675fb0ff2655898324", "4ab17cc8ec668ead8bf498f87f8f32848c04d5ca3c9bcfcd3db9363f0deb44e580b329502a7fdff633d4d8fca301cc5c94a55a2fec458c675fb0ff2655898324", true},
	{[]byte(`{"a": "z"}`), "secret", "sha512=4ab17cc8ec668ead8bf498f87f8f32848c04d5ca3c9bcfcd3db9363f0deb44e580b329502a7fdff633d4d8fca301cc5c94a55a2fec458c675fb0ff2655898324", "4ab17cc8ec668ead8bf498f87f8f32848c04d5ca3c9bcfcd3db9363f0deb44e580b329502a7fdff633d4d8fca301cc5c94a55a2fec458c675fb0ff2655898324", true},
	{[]byte(``), "secret", "b0e9650c5faf9cd8ae02276671545424104589b3656731ec193b25d01b07561c27637c2d4d68389d6cf5007a8632c26ec89ba80a01c77a6cdd389ec28db43901", "b0e9650c5faf9cd8ae02276671545424104589b3656731ec193b25d01b07561c27637c2d4d68389d6cf5007a8632c26ec89ba80a01c77a6cdd389ec28db43901", true},
	// failures
	{[]byte(`{"a": "z"}`), "secret", "74a0081f5b5988f4f3e8b8dd34dadc6291611f2e6260635a7e1535f8e95edb97ff520ba8b152e8ca5760ac42639854f3242e29efc81be73a8bf52d474d31ffea", "4ab17cc8ec668ead8bf498f87f8f32848c04d5ca3c9bcfcd3db9363f0deb44e580b329502a7fdff633d4d8fca301cc5c94a55a2fec458c675fb0ff2655898324", false},
	{[]byte(`{"a": "z"}`), "", "74a0081f5b5988f4f3e8b8dd34dadc6291611f2e6260635a7e1535f8e95edb97ff520ba8b152e8ca5760ac42639854f3242e29efc81be73a8bf52d474d31ffea", "", false},
	{[]byte(``), "secret", "XXX9650c5faf9cd8ae02276671545424104589b3656731ec193b25d01b07561c27637c2d4d68389d6cf5007a8632c26ec89ba80a01c77a6cdd389ec28db43901", "b0e9650c5faf9cd8ae02276671545424104589b3656731ec193b25d01b07561c27637c2d4d68389d6cf5007a8632c26ec89ba80a01c77a6cdd389ec28db43901", false},
}

func TestCheckPayloadSignature512(t *testing.T) {
	for _, tt := range checkPayloadSignature512Tests {
		mac, err := CheckPayloadSignature512(tt.payload, tt.secret, tt.signature)
		if (err == nil) != tt.ok || mac != tt.mac {
			t.Errorf("failed to check payload signature {%q, %q, %q}:\nexpected {mac:%#v, ok:%#v},\ngot {mac:%#v, ok:%#v}", tt.payload, tt.secret, tt.signature, tt.mac, tt.ok, mac, (err == nil))
		}

		if err != nil && tt.mac != "" && strings.Contains(err.Error(), tt.mac) {
			t.Errorf("error message should not disclose expected mac: %s", err)
		}
	}
}

var checkScalrSignatureTests = []struct {
	description       string
	headers           map[string]interface{}
	body              []byte
	secret            string
	expectedSignature string
	ok                bool
}{
	{
		"Valid signature",
		map[string]interface{}{"Date": "Thu 07 Sep 2017 06:30:04 UTC", "X-Signature": "48e395e38ac48988929167df531eb2da00063a7d"},
		[]byte(`{"a": "b"}`), "bilFGi4ZVZUdG+C6r0NIM9tuRq6PaG33R3eBUVhLwMAErGBaazvXe4Gq2DcJs5q+",
		"48e395e38ac48988929167df531eb2da00063a7d", true,
	},
	{
		"Wrong signature",
		map[string]interface{}{"Date": "Thu 07 Sep 2017 06:30:04 UTC", "X-Signature": "999395e38ac48988929167df531eb2da00063a7d"},
		[]byte(`{"a": "b"}`), "bilFGi4ZVZUdG+C6r0NIM9tuRq6PaG33R3eBUVhLwMAErGBaazvXe4Gq2DcJs5q+",
		"48e395e38ac48988929167df531eb2da00063a7d", false,
	},
	{
		"Missing Date header",
		map[string]interface{}{"X-Signature": "999395e38ac48988929167df531eb2da00063a7d"},
		[]byte(`{"a": "b"}`), "bilFGi4ZVZUdG+C6r0NIM9tuRq6PaG33R3eBUVhLwMAErGBaazvXe4Gq2DcJs5q+",
		"48e395e38ac48988929167df531eb2da00063a7d", false,
	},
	{
		"Missing X-Signature header",
		map[string]interface{}{"Date": "Thu 07 Sep 2017 06:30:04 UTC"},
		[]byte(`{"a": "b"}`), "bilFGi4ZVZUdG+C6r0NIM9tuRq6PaG33R3eBUVhLwMAErGBaazvXe4Gq2DcJs5q+",
		"48e395e38ac48988929167df531eb2da00063a7d", false,
	},
	{
		"Missing signing key",
		map[string]interface{}{"Date": "Thu 07 Sep 2017 06:30:04 UTC", "X-Signature": "48e395e38ac48988929167df531eb2da00063a7d"},
		[]byte(`{"a": "b"}`), "",
		"48e395e38ac48988929167df531eb2da00063a7d", false,
	},
}

func TestCheckScalrSignature(t *testing.T) {
	for _, testCase := range checkScalrSignatureTests {
		r := &Request{
			Headers: testCase.headers,
			Body:    testCase.body,
		}
		valid, err := CheckScalrSignature(r, testCase.secret, false)
		if valid != testCase.ok {
			t.Errorf("failed to check scalr signature for test case: %s\nexpected ok:%#v, got ok:%#v}",
				testCase.description, testCase.ok, valid)
		}

		if err != nil && testCase.secret != "" && strings.Contains(err.Error(), testCase.expectedSignature) {
			t.Errorf("error message should not disclose expected mac: %s on test case %s", err, testCase.description)
		}
	}
}

var checkIPWhitelistTests = []struct {
	addr    string
	ipRange string
	expect  bool
	ok      bool
}{
	{"[ 10.0.0.1:1234 ] ", "  10.0.0.1 ", true, true},
	{"[ 10.0.0.1:1234 ] ", "  10.0.0.0 ", false, true},
	{"[ 10.0.0.1:1234 ] ", "  10.0.0.1 10.0.0.1 ", true, true},
	{"[ 10.0.0.1:1234 ] ", "  10.0.0.0/31 ", true, true},
	{" [2001:db8:1:2::1:1234] ", "  2001:db8:1::/48 ", true, true},
	{" [2001:db8:1:2::1:1234] ", "  2001:db8:1::/48 2001:db8:1::/64", true, true},
	{" [2001:db8:1:2::1:1234] ", "  2001:db8:1::/64 ", false, true},
}

func TestCheckIPWhitelist(t *testing.T) {
	for _, tt := range checkIPWhitelistTests {
		result, err := CheckIPWhitelist(tt.addr, tt.ipRange)
		if (err == nil) != tt.ok || result != tt.expect {
			t.Errorf("ip whitelist test failed {%q, %q}:\nwant {expect:%#v, ok:%#v},\ngot {result:%#v, ok:%#v}", tt.addr, tt.ipRange, tt.expect, tt.ok, result, err)
		}
	}
}

var extractParameterTests = []struct {
	s      string
	params interface{}
	value  string
	ok     bool
}{
	{"a", map[string]interface{}{"a": "z"}, "z", true},
	{"a.b", map[string]interface{}{"a": map[string]interface{}{"b": "z"}}, "z", true},
	{"a.b.c", map[string]interface{}{"a": map[string]interface{}{"b": map[string]interface{}{"c": "z"}}}, "z", true},
	{"a.b.0", map[string]interface{}{"a": map[string]interface{}{"b": []interface{}{"x", "y", "z"}}}, "x", true},
	{"a.1.b", map[string]interface{}{"a": []interface{}{map[string]interface{}{"b": "y"}, map[string]interface{}{"b": "z"}}}, "z", true},
	{"a.1.b.c", map[string]interface{}{"a": []interface{}{map[string]interface{}{"b": map[string]interface{}{"c": "y"}}, map[string]interface{}{"b": map[string]interface{}{"c": "z"}}}}, "z", true},
	{"b", map[string]interface{}{"b": map[string]interface{}{"z": 1}}, `{"z":1}`, true},
	{"c", map[string]interface{}{"c": []interface{}{"y", "z"}}, `["y","z"]`, true},
	{"d", map[string]interface{}{"d": [2]interface{}{"y", "z"}}, `["y","z"]`, true},
	// failures
	{"check_nil", nil, "", false},
	{"a.X", map[string]interface{}{"a": map[string]interface{}{"b": "z"}}, "", false},                                                      // non-existent parameter reference
	{"a.X.c", map[string]interface{}{"a": []interface{}{map[string]interface{}{"b": "y"}, map[string]interface{}{"b": "z"}}}, "", false},   // non-integer slice index
	{"a.-1.b", map[string]interface{}{"a": []interface{}{map[string]interface{}{"b": "y"}, map[string]interface{}{"b": "z"}}}, "", false},  // negative slice index
	{"a.500.b", map[string]interface{}{"a": map[string]interface{}{"b": "z"}}, "", false},                                                  // non-existent slice
	{"a.501.b", map[string]interface{}{"a": []interface{}{map[string]interface{}{"b": "y"}, map[string]interface{}{"b": "z"}}}, "", false}, // non-existent slice index
	{"a.502.b", map[string]interface{}{"a": []interface{}{}}, "", false},                                                                   // non-existent slice index
	{"a.b.503", map[string]interface{}{"a": map[string]interface{}{"b": []interface{}{"x", "y", "z"}}}, "", false},                         // trailing, non-existent slice index
	{"a.b", interface{}("a"), "", false}, // non-map, non-slice input
}

func TestExtractParameter(t *testing.T) {
	for _, tt := range extractParameterTests {
		value, err := ExtractParameterAsString(tt.s, tt.params)
		if (err == nil) != tt.ok || value != tt.value {
			t.Errorf("failed to extract parameter %q:\nexpected {value:%#v, ok:%#v},\ngot {value:%#v, err:%v}", tt.s, tt.value, tt.ok, value, err)
		}
	}
}

var argumentGetTests = []struct {
	source, name            string
	headers, query, payload map[string]interface{}
	request                 *http.Request
	value                   string
	ok                      bool
}{
	{"header", "a", map[string]interface{}{"A": "z"}, nil, nil, nil, "z", true},
	{"url", "a", nil, map[string]interface{}{"a": "z"}, nil, nil, "z", true},
	{"payload", "a", nil, nil, map[string]interface{}{"a": "z"}, nil, "z", true},
	{"request", "METHOD", nil, nil, map[string]interface{}{"a": "z"}, &http.Request{Method: "POST", RemoteAddr: "127.0.0.1:1234"}, "POST", true},
	{"request", "remote-addr", nil, nil, map[string]interface{}{"a": "z"}, &http.Request{Method: "POST", RemoteAddr: "127.0.0.1:1234"}, "127.0.0.1:1234", true},
	{"string", "a", nil, nil, map[string]interface{}{"a": "z"}, nil, "a", true},
	// failures
	{"header", "a", nil, map[string]interface{}{"a": "z"}, map[string]interface{}{"a": "z"}, nil, "", false},  // nil headers
	{"url", "a", map[string]interface{}{"A": "z"}, nil, map[string]interface{}{"a": "z"}, nil, "", false},     // nil query
	{"payload", "a", map[string]interface{}{"A": "z"}, map[string]interface{}{"a": "z"}, nil, nil, "", false}, // nil payload
	{"foo", "a", map[string]interface{}{"A": "z"}, nil, nil, nil, "", false},                                  // invalid source
}

func TestArgumentGet(t *testing.T) {
	for _, tt := range argumentGetTests {
		a := Argument{tt.source, tt.name, "", false}
		r := &Request{
			Headers:    tt.headers,
			Query:      tt.query,
			Payload:    tt.payload,
			RawRequest: tt.request,
		}
		value, err := a.Get(r)
		if (err == nil) != tt.ok || value != tt.value {
			t.Errorf("failed to get {%q, %q}:\nexpected {value:%#v, ok:%#v},\ngot {value:%#v, err:%v}", tt.source, tt.name, tt.value, tt.ok, value, err)
		}
	}
}

var hookParseJSONParametersTests = []struct {
	params                     []Argument
	headers, query, payload    map[string]interface{}
	rheaders, rquery, rpayload map[string]interface{}
	ok                         bool
}{
	{[]Argument{Argument{"header", "a", "", false}}, map[string]interface{}{"A": `{"b": "y"}`}, nil, nil, map[string]interface{}{"A": map[string]interface{}{"b": "y"}}, nil, nil, true},
	{[]Argument{Argument{"url", "a", "", false}}, nil, map[string]interface{}{"a": `{"b": "y"}`}, nil, nil, map[string]interface{}{"a": map[string]interface{}{"b": "y"}}, nil, true},
	{[]Argument{Argument{"payload", "a", "", false}}, nil, nil, map[string]interface{}{"a": `{"b": "y"}`}, nil, nil, map[string]interface{}{"a": map[string]interface{}{"b": "y"}}, true},
	{[]Argument{Argument{"header", "z", "", false}}, map[string]interface{}{"Z": `{}`}, nil, nil, map[string]interface{}{"Z": map[string]interface{}{}}, nil, nil, true},
	// failures
	{[]Argument{Argument{"header", "z", "", false}}, map[string]interface{}{"Z": ``}, nil, nil, map[string]interface{}{"Z": ``}, nil, nil, false},     // empty string
	{[]Argument{Argument{"header", "y", "", false}}, map[string]interface{}{"X": `{}`}, nil, nil, map[string]interface{}{"X": `{}`}, nil, nil, false}, // missing parameter
	{[]Argument{Argument{"string", "z", "", false}}, map[string]interface{}{"Z": ``}, nil, nil, map[string]interface{}{"Z": ``}, nil, nil, false},     // invalid argument source
}

func TestHookParseJSONParameters(t *testing.T) {
	for _, tt := range hookParseJSONParametersTests {
		h := &Hook{JSONStringParameters: tt.params}
		r := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
		}
		err := h.ParseJSONParameters(r)
		if (err == nil) != tt.ok || !reflect.DeepEqual(tt.headers, tt.rheaders) {
			t.Errorf("failed to parse %v:\nexpected %#v, ok: %v\ngot %#v, ok: %v", tt.params, tt.rheaders, tt.ok, tt.headers, (err == nil))
		}
	}
}

var hookExtractCommandArgumentsTests = []struct {
	exec                    string
	args                    []Argument
	headers, query, payload map[string]interface{}
	value                   []string
	ok                      bool
}{
	{"test", []Argument{Argument{"header", "a", "", false}}, map[string]interface{}{"A": "z"}, nil, nil, []string{"test", "z"}, true},
	// failures
	{"fail", []Argument{Argument{"payload", "a", "", false}}, map[string]interface{}{"A": "z"}, nil, nil, []string{"fail", ""}, false},
}

func TestHookExtractCommandArguments(t *testing.T) {
	for _, tt := range hookExtractCommandArgumentsTests {
		h := &Hook{ExecuteCommand: tt.exec, PassArgumentsToCommand: tt.args}
		r := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
		}
		value, err := h.ExtractCommandArguments(r)
		if (err == nil) != tt.ok || !reflect.DeepEqual(value, tt.value) {
			t.Errorf("failed to extract args {cmd=%q, args=%v}:\nexpected %#v, ok: %v\ngot %#v, ok: %v", tt.exec, tt.args, tt.value, tt.ok, value, (err == nil))
		}
	}
}

// Here we test the extraction of env variables when the user defined a hook
// with the "pass-environment-to-command" directive
// we test both cases where the name of the data is used as the name of the
// env key & the case where the hook definition sets the env var name to a
// fixed value using the envname construct like so::
//    [
//      {
//        "id": "push",
//        "execute-command": "bb2mm",
//        "command-working-directory": "/tmp",
//        "pass-environment-to-command":
//        [
//          {
//            "source": "entire-payload",
//            "envname": "PAYLOAD"
//          },
//        ]
//      }
//    ]
var hookExtractCommandArgumentsForEnvTests = []struct {
	exec                    string
	args                    []Argument
	headers, query, payload map[string]interface{}
	value                   []string
	ok                      bool
}{
	// successes
	{
		"test",
		[]Argument{Argument{"header", "a", "", false}},
		map[string]interface{}{"A": "z"}, nil, nil,
		[]string{"HOOK_a=z"},
		true,
	},
	{
		"test",
		[]Argument{Argument{"header", "a", "MYKEY", false}},
		map[string]interface{}{"A": "z"}, nil, nil,
		[]string{"MYKEY=z"},
		true,
	},
	// failures
	{
		"fail",
		[]Argument{Argument{"payload", "a", "", false}},
		map[string]interface{}{"A": "z"}, nil, nil,
		[]string{},
		false,
	},
}

func TestHookExtractCommandArgumentsForEnv(t *testing.T) {
	for _, tt := range hookExtractCommandArgumentsForEnvTests {
		h := &Hook{ExecuteCommand: tt.exec, PassEnvironmentToCommand: tt.args}
		r := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
		}
		value, err := h.ExtractCommandArgumentsForEnv(r)
		if (err == nil) != tt.ok || !reflect.DeepEqual(value, tt.value) {
			t.Errorf("failed to extract args for env {cmd=%q, args=%v}:\nexpected %#v, ok: %v\ngot %#v, ok: %v", tt.exec, tt.args, tt.value, tt.ok, value, (err == nil))
		}
	}
}

var hooksLoadFromFileTests = []struct {
	path       string
	asTemplate bool
	ok         bool
}{
	{"../../hooks.json.example", false, true},
	{"../../hooks.yaml.example", false, true},
	{"../../hooks.json.tmpl.example", true, true},
	{"../../hooks.yaml.tmpl.example", true, true},
	{"", false, true},
	// failures
	{"missing.json", false, false},
}

func TestHooksLoadFromFile(t *testing.T) {
	secret := `foo"123`
	os.Setenv("XXXTEST_SECRET", secret)

	for _, tt := range hooksLoadFromFileTests {
		h := &Hooks{}
		err := h.LoadFromFile(tt.path, tt.asTemplate)
		if (err == nil) != tt.ok {
			t.Errorf(err.Error())
		}
	}
}

func TestHooksTemplateLoadFromFile(t *testing.T) {
	secret := `foo"123`
	os.Setenv("XXXTEST_SECRET", secret)

	for _, tt := range hooksLoadFromFileTests {
		if !tt.asTemplate {
			continue
		}

		h := &Hooks{}
		err := h.LoadFromFile(tt.path, tt.asTemplate)
		if (err == nil) != tt.ok {
			t.Errorf(err.Error())
			continue
		}

		s := (*h.Match("webhook").TriggerRule.And)[0].Match.Secret
		if s != secret {
			t.Errorf("Expected secret of %q, got %q", secret, s)
		}
	}
}

var hooksMatchTests = []struct {
	id    string
	hooks Hooks
	value *Hook
}{
	{"a", Hooks{Hook{ID: "a"}}, &Hook{ID: "a"}},
	{"X", Hooks{Hook{ID: "a"}}, new(Hook)},
}

func TestHooksMatch(t *testing.T) {
	for _, tt := range hooksMatchTests {
		value := tt.hooks.Match(tt.id)
		if reflect.DeepEqual(reflect.ValueOf(value), reflect.ValueOf(tt.value)) {
			t.Errorf("failed to match %q:\nexpected %#v,\ngot %#v", tt.id, tt.value, value)
		}
	}
}

var matchRuleTests = []struct {
	typ, regex, secret, value, ipRange string
	param                              Argument
	headers, query, payload            map[string]interface{}
	body                               []byte
	remoteAddr                         string
	ok                                 bool
	err                                bool
}{
	{"value", "", "", "z", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, "", true, false},
	{"regex", "^z", "", "z", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, "", true, false},
	{"payload-hmac-sha1", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "b17e04cbb22afa8ffbff8796fc1894ed27badd9e"}, nil, nil, []byte(`{"a": "z"}`), "", true, false},
	{"payload-hash-sha1", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "b17e04cbb22afa8ffbff8796fc1894ed27badd9e"}, nil, nil, []byte(`{"a": "z"}`), "", true, false},
	{"payload-hmac-sha256", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89"}, nil, nil, []byte(`{"a": "z"}`), "", true, false},
	{"payload-hash-sha256", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "f417af3a21bd70379b5796d5f013915e7029f62c580fb0f500f59a35a6f04c89"}, nil, nil, []byte(`{"a": "z"}`), "", true, false},
	// failures
	{"value", "", "", "X", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, "", false, false},
	{"regex", "^X", "", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, "", false, false},
	{"value", "", "2", "X", "", Argument{"header", "a", "", false}, map[string]interface{}{"Y": "z"}, nil, nil, []byte{}, "", false, true}, // reference invalid header
	// errors
	{"regex", "*", "", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, "", false, true},                   // invalid regex
	{"payload-hmac-sha1", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": ""}, nil, nil, []byte{}, "", false, true},   // invalid hmac
	{"payload-hash-sha1", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": ""}, nil, nil, []byte{}, "", false, true},   // invalid hmac
	{"payload-hmac-sha256", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": ""}, nil, nil, []byte{}, "", false, true}, // invalid hmac
	{"payload-hash-sha256", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": ""}, nil, nil, []byte{}, "", false, true}, // invalid hmac
	{"payload-hmac-sha512", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": ""}, nil, nil, []byte{}, "", false, true}, // invalid hmac
	{"payload-hash-sha512", "", "secret", "", "", Argument{"header", "a", "", false}, map[string]interface{}{"A": ""}, nil, nil, []byte{}, "", false, true}, // invalid hmac
	// IP whitelisting, valid cases
	{"ip-whitelist", "", "", "", "192.168.0.1/24", Argument{}, nil, nil, nil, []byte{}, "192.168.0.2:9000", true, false}, // valid IPv4, with range
	{"ip-whitelist", "", "", "", "192.168.0.1/24", Argument{}, nil, nil, nil, []byte{}, "192.168.0.2:9000", true, false}, // valid IPv4, with range
	{"ip-whitelist", "", "", "", "192.168.0.1", Argument{}, nil, nil, nil, []byte{}, "192.168.0.1:9000", true, false},    // valid IPv4, no range
	{"ip-whitelist", "", "", "", "::1/24", Argument{}, nil, nil, nil, []byte{}, "[::1]:9000", true, false},               // valid IPv6, with range
	{"ip-whitelist", "", "", "", "::1", Argument{}, nil, nil, nil, []byte{}, "[::1]:9000", true, false},                  // valid IPv6, no range
	// IP whitelisting, invalid cases
	{"ip-whitelist", "", "", "", "192.168.0.1/a", Argument{}, nil, nil, nil, []byte{}, "192.168.0.2:9000", false, true},  // invalid IPv4, with range
	{"ip-whitelist", "", "", "", "192.168.0.a", Argument{}, nil, nil, nil, []byte{}, "192.168.0.2:9000", false, true},    // invalid IPv4, no range
	{"ip-whitelist", "", "", "", "192.168.0.1/24", Argument{}, nil, nil, nil, []byte{}, "192.168.0.a:9000", false, true}, // invalid IPv4 address
	{"ip-whitelist", "", "", "", "::1/a", Argument{}, nil, nil, nil, []byte{}, "[::1]:9000", false, true},                // invalid IPv6, with range
	{"ip-whitelist", "", "", "", "::z", Argument{}, nil, nil, nil, []byte{}, "[::1]:9000", false, true},                  // invalid IPv6, no range
	{"ip-whitelist", "", "", "", "::1/24", Argument{}, nil, nil, nil, []byte{}, "[::z]:9000", false, true},               // invalid IPv6 address
}

func TestMatchRule(t *testing.T) {
	for i, tt := range matchRuleTests {
		r := MatchRule{tt.typ, tt.regex, tt.secret, tt.value, tt.param, tt.ipRange}
		req := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
			Body:    tt.body,
			RawRequest: &http.Request{
				RemoteAddr: tt.remoteAddr,
			},
		}
		ok, err := r.Evaluate(req)
		if ok != tt.ok || (err != nil) != tt.err {
			t.Errorf("%d failed to match %#v:\nexpected ok: %#v, err: %v\ngot ok: %#v, err: %v", i, r, tt.ok, tt.err, ok, err)
		}
	}
}

var andRuleTests = []struct {
	desc                    string // description of the test case
	rule                    AndRule
	headers, query, payload map[string]interface{}
	body                    []byte
	ok                      bool
	err                     bool
}{
	{
		"(a=z, b=y): a=z && b=y",
		AndRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
			{Match: &MatchRule{"value", "", "", "y", Argument{"header", "b", "", false}, ""}},
		},
		map[string]interface{}{"A": "z", "B": "y"}, nil, nil,
		[]byte{},
		true, false,
	},
	{
		"(a=z, b=Y): a=z && b=y",
		AndRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
			{Match: &MatchRule{"value", "", "", "y", Argument{"header", "b", "", false}, ""}},
		},
		map[string]interface{}{"A": "z", "B": "Y"}, nil, nil,
		[]byte{},
		false, false,
	},
	// Complex test to cover Rules.Evaluate
	{
		"(a=z, b=y, c=x, d=w=, e=X, f=X): a=z && (b=y && c=x) && (d=w || e=v) && !f=u",
		AndRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
			{
				And: &AndRule{
					{Match: &MatchRule{"value", "", "", "y", Argument{"header", "b", "", false}, ""}},
					{Match: &MatchRule{"value", "", "", "x", Argument{"header", "c", "", false}, ""}},
				},
			},
			{
				Or: &OrRule{
					{Match: &MatchRule{"value", "", "", "w", Argument{"header", "d", "", false}, ""}},
					{Match: &MatchRule{"value", "", "", "v", Argument{"header", "e", "", false}, ""}},
				},
			},
			{
				Not: &NotRule{
					Match: &MatchRule{"value", "", "", "u", Argument{"header", "f", "", false}, ""},
				},
			},
		},
		map[string]interface{}{"A": "z", "B": "y", "C": "x", "D": "w", "E": "X", "F": "X"}, nil, nil,
		[]byte{},
		true, false,
	},
	{"empty rule", AndRule{{}}, nil, nil, nil, nil, false, false},
	// failures
	{
		"invalid rule",
		AndRule{{Match: &MatchRule{"value", "", "", "X", Argument{"header", "a", "", false}, ""}}},
		map[string]interface{}{"Y": "z"}, nil, nil, nil,
		false, true,
	},
}

func TestAndRule(t *testing.T) {
	for _, tt := range andRuleTests {
		r := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
			Body:    tt.body,
		}
		ok, err := tt.rule.Evaluate(r)
		if ok != tt.ok || (err != nil) != tt.err {
			t.Errorf("failed to match %#v:\nexpected ok: %#v, err: %v\ngot ok: %#v, err: %v", tt.desc, tt.ok, tt.err, ok, err)
		}
	}
}

var orRuleTests = []struct {
	desc                    string // description of the test case
	rule                    OrRule
	headers, query, payload map[string]interface{}
	body                    []byte
	ok                      bool
	err                     bool
}{
	{
		"(a=z, b=X): a=z || b=y",
		OrRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
			{Match: &MatchRule{"value", "", "", "y", Argument{"header", "b", "", false}, ""}},
		},
		map[string]interface{}{"A": "z", "B": "X"}, nil, nil,
		[]byte{},
		true, false,
	},
	{
		"(a=X, b=y): a=z || b=y",
		OrRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
			{Match: &MatchRule{"value", "", "", "y", Argument{"header", "b", "", false}, ""}},
		},
		map[string]interface{}{"A": "X", "B": "y"}, nil, nil,
		[]byte{},
		true, false,
	},
	{
		"(a=Z, b=Y): a=z || b=y",
		OrRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
			{Match: &MatchRule{"value", "", "", "y", Argument{"header", "b", "", false}, ""}},
		},
		map[string]interface{}{"A": "Z", "B": "Y"}, nil, nil,
		[]byte{},
		false, false,
	},
	// failures
	{
		"missing parameter node",
		OrRule{
			{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}},
		},
		map[string]interface{}{"Y": "Z"}, nil, nil,
		[]byte{},
		false, false,
	},
}

func TestOrRule(t *testing.T) {
	for _, tt := range orRuleTests {
		r := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
			Body:    tt.body,
		}
		ok, err := tt.rule.Evaluate(r)
		if ok != tt.ok || (err != nil) != tt.err {
			t.Errorf("%#v:\nexpected ok: %#v, err: %v\ngot ok: %#v err: %v", tt.desc, tt.ok, tt.err, ok, err)
		}
	}
}

var notRuleTests = []struct {
	desc                    string // description of the test case
	rule                    NotRule
	headers, query, payload map[string]interface{}
	body                    []byte
	ok                      bool
	err                     bool
}{
	{"(a=z): !a=X", NotRule{Match: &MatchRule{"value", "", "", "X", Argument{"header", "a", "", false}, ""}}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, true, false},
	{"(a=z): !a=z", NotRule{Match: &MatchRule{"value", "", "", "z", Argument{"header", "a", "", false}, ""}}, map[string]interface{}{"A": "z"}, nil, nil, []byte{}, false, false},
}

func TestNotRule(t *testing.T) {
	for _, tt := range notRuleTests {
		r := &Request{
			Headers: tt.headers,
			Query:   tt.query,
			Payload: tt.payload,
			Body:    tt.body,
		}
		ok, err := tt.rule.Evaluate(r)
		if ok != tt.ok || (err != nil) != tt.err {
			t.Errorf("failed to match %#v:\nexpected ok: %#v, err: %v\ngot ok: %#v, err: %v", tt.rule, tt.ok, tt.err, ok, err)
		}
	}
}

func TestCompare(t *testing.T) {
	for _, tt := range []struct {
		a, b string
		ok   bool
	}{
		{"abcd", "abcd", true},
		{"zyxw", "abcd", false},
	} {
		if ok := compare(tt.a, tt.b); ok != tt.ok {
			t.Errorf("compare failed for %q and %q: got %v\n", tt.a, tt.b, ok)
		}
	}
}


================================================
FILE: internal/hook/request.go
================================================
package hook

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
	"unicode"

	"github.com/clbanning/mxj/v2"
)

// Request represents a webhook request.
type Request struct {
	// The request ID set by the RequestID middleware.
	ID string

	// The Content-Type of the request.
	ContentType string

	// The raw request body.
	Body []byte

	// Headers is a map of the parsed headers.
	Headers map[string]interface{}

	// Query is a map of the parsed URL query values.
	Query map[string]interface{}

	// Payload is a map of the parsed payload.
	Payload map[string]interface{}

	// The underlying HTTP request.
	RawRequest *http.Request

	// Treat signature errors as simple validate failures.
	AllowSignatureErrors bool
}

func (r *Request) ParseJSONPayload() error {
	decoder := json.NewDecoder(bytes.NewReader(r.Body))
	decoder.UseNumber()

	var firstChar byte
	for i := 0; i < len(r.Body); i++ {
		if unicode.IsSpace(rune(r.Body[i])) {
			continue
		}
		firstChar = r.Body[i]
		break
	}

	if firstChar == byte('[') {
		var arrayPayload interface{}
		err := decoder.Decode(&arrayPayload)
		if err != nil {
			return fmt.Errorf("error parsing JSON array payload %+v", err)
		}

		r.Payload = make(map[string]interface{}, 1)
		r.Payload["root"] = arrayPayload
	} else {
		err := decoder.Decode(&r.Payload)
		if err != nil {
			return fmt.Errorf("error parsing JSON payload %+v", err)
		}
	}

	return nil
}

func (r *Request) ParseHeaders(headers map[string][]string) {
	r.Headers = make(map[string]interface{}, len(headers))

	for k, v := range headers {
		if len(v) > 0 {
			r.Headers[k] = v[0]
		}
	}
}

func (r *Request) ParseQuery(query map[string][]string) {
	r.Query = make(map[string]interface{}, len(query))

	for k, v := range query {
		if len(v) > 0 {
			r.Query[k] = v[0]
		}
	}
}

func (r *Request) ParseFormPayload() error {
	fd, err := url.ParseQuery(string(r.Body))
	if err != nil {
		return fmt.Errorf("error parsing form payload %+v", err)
	}

	r.Payload = make(map[string]interface{}, len(fd))

	for k, v := range fd {
		if len(v) > 0 {
			r.Payload[k] = v[0]
		}
	}

	return nil
}

func (r *Request) ParseXMLPayload() error {
	var err error

	r.Payload, err = mxj.NewMapXmlReader(bytes.NewReader(r.Body))
	if err != nil {
		return fmt.Errorf("error parsing XML payload: %+v", err)
	}

	return nil
}


================================================
FILE: internal/middleware/dumper.go
================================================
package middleware

// Derived from the Goa project, MIT Licensed
// https://github.com/goadesign/goa/blob/v3/http/middleware/debug.go

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/http/httputil"
	"sort"
	"strings"
)

// responseDupper tees the response to a buffer and a response writer.
type responseDupper struct {
	http.ResponseWriter
	Buffer *bytes.Buffer
	Status int
}

// Dumper returns a debug middleware which prints detailed information about
// incoming requests and outgoing responses including all headers, parameters
// and bodies.
func Dumper(w io.Writer) func(http.Handler) http.Handler {
	return func(h http.Handler) http.Handler {
		return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
			buf := &bytes.Buffer{}
			// Request ID
			rid := r.Context().Value(RequestIDKey)

			// Dump request

			bd, err := httputil.DumpRequest(r, true)
			if err != nil {
				buf.WriteString(fmt.Sprintf("[%s] Error dumping request for debugging: %s\n", rid, err))
			}

			sc := bufio.NewScanner(bytes.NewBuffer(bd))
			sc.Split(bufio.ScanLines)
			for sc.Scan() {
				buf.WriteString(fmt.Sprintf("> [%s] ", rid))
				buf.WriteString(sc.Text() + "\n")
			}

			w.Write(buf.Bytes())
			buf.Reset()

			// Dump Response

			dupper := &responseDupper{ResponseWriter: rw, Buffer: &bytes.Buffer{}}
			h.ServeHTTP(dupper, r)

			// Response Status
			buf.WriteString(fmt.Sprintf("< [%s] %d %s\n", rid, dupper.Status, http.StatusText(dupper.Status)))

			// Response Headers
			keys := make([]string, len(dupper.Header()))
			i := 0
			for k := range dupper.Header() {
				keys[i] = k
				i++
			}
			sort.Strings(keys)
			for _, k := range keys {
				buf.WriteString(fmt.Sprintf("< [%s] %s: %s\n", rid, k, strings.Join(dupper.Header()[k], ", ")))
			}

			// Response Body
			if dupper.Buffer.Len() > 0 {
				buf.WriteString(fmt.Sprintf("< [%s]\n", rid))
				sc = bufio.NewScanner(dupper.Buffer)
				sc.Split(bufio.ScanLines)
				for sc.Scan() {
					buf.WriteString(fmt.Sprintf("< [%s] ", rid))
					buf.WriteString(sc.Text() + "\n")
				}
			}
			w.Write(buf.Bytes())
		})
	}
}

// Write writes the data to the buffer and connection as part of an HTTP reply.
func (r *responseDupper) Write(b []byte) (int, error) {
	r.Buffer.Write(b)
	return r.ResponseWriter.Write(b)
}

// WriteHeader records the status and sends an HTTP response header with status code.
func (r *responseDupper) WriteHeader(s int) {
	r.Status = s
	r.ResponseWriter.WriteHeader(s)
}

// Hijack supports the http.Hijacker interface.
func (r *responseDupper) Hijack() (net.Conn, *bufio.ReadWriter, error) {
	if hijacker, ok := r.ResponseWriter.(http.Hijacker); ok {
		return hijacker.Hijack()
	}
	return nil, nil, fmt.Errorf("dumper middleware: inner ResponseWriter cannot be hijacked: %T", r.ResponseWriter)
}


================================================
FILE: internal/middleware/logger.go
================================================
package middleware

import (
	"bytes"
	"fmt"
	"log"
	"net/http"
	"time"

	"github.com/dustin/go-humanize"
	"github.com/go-chi/chi/v5/middleware"
)

// Logger is a middleware that logs useful data about each HTTP request.
type Logger struct {
	Logger middleware.LoggerInterface
}

// NewLogger creates a new RequestLogger Handler.
func NewLogger() func(next http.Handler) http.Handler {
	return middleware.RequestLogger(&Logger{})
}

// NewLogEntry creates a new LogEntry for the request.
func (l *Logger) NewLogEntry(r *http.Request) middleware.LogEntry {
	e := &LogEntry{
		req: r,
		buf: &bytes.Buffer{},
	}

	return e
}

// LogEntry represents an individual log entry.
type LogEntry struct {
	*Logger
	req *http.Request
	buf *bytes.Buffer
}

// Write constructs and writes the final log entry.
func (l *LogEntry) Write(status, totalBytes int, header http.Header, elapsed time.Duration, extra interface{}) {
	rid := GetReqID(l.req.Context())
	if rid != "" {
		fmt.Fprintf(l.buf, "[%s] ", rid)
	}

	fmt.Fprintf(l.buf, "%03d | %s | %s | ", status, humanize.IBytes(uint64(totalBytes)), elapsed)
	l.buf.WriteString(l.req.Host + " | " + l.req.Method + " " + l.req.RequestURI)
	log.Print(l.buf.String())
}

// Panic prints the call stack for a panic.
func (l *LogEntry) Panic(v interface{}, stack []byte) {
	e := l.NewLogEntry(l.req).(*LogEntry)
	fmt.Fprintf(e.buf, "panic: %#v", v)
	log.Print(e.buf.String())
	log.Print(string(stack))
}


================================================
FILE: internal/middleware/request_id.go
================================================
package middleware

// Derived from Goa project, MIT Licensed
// https://github.com/goadesign/goa/blob/v3/http/middleware/requestid.go

import (
	"context"
	"net/http"

	"github.com/gofrs/uuid/v5"
)

// Key to use when setting the request ID.
type ctxKeyRequestID int

// RequestIDKey is the key that holds the unique request ID in a request context.
const RequestIDKey ctxKeyRequestID = 0

// RequestID is a middleware that injects a request ID into the context of each
// request.
func RequestID(options ...RequestIDOption) func(http.Handler) http.Handler {
	o := newRequestIDOptions(options...)

	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			ctx := r.Context()

			var id string

			if o.UseRequestID() {
				id = r.Header.Get("X-Request-Id")
				if o.requestIDLimit > 0 && len(id) > o.requestIDLimit {
					id = id[:o.requestIDLimit]
				}
			}

			if id == "" {
				id = uuid.Must(uuid.NewV4()).String()[:6]
			}

			ctx = context.WithValue(ctx, RequestIDKey, id)
			next.ServeHTTP(w, r.WithContext(ctx))
		})
	}
}

// GetReqID returns a request ID from the given context if one is present.
// Returns the empty string if a request ID cannot be found.
func GetReqID(ctx context.Context) string {
	if ctx == nil {
		return ""
	}
	if reqID, ok := ctx.Value(RequestIDKey).(string); ok {
		return reqID
	}
	return ""
}

func UseXRequestIDHeaderOption(f bool) RequestIDOption {
	return func(o *RequestIDOptions) *RequestIDOptions {
		o.useXRequestID = f
		return o
	}
}

func XRequestIDLimitOption(limit int) RequestIDOption {
	return func(o *RequestIDOptions) *RequestIDOptions {
		o.requestIDLimit = limit
		return o
	}
}

type (
	RequestIDOption func(*RequestIDOptions) *RequestIDOptions

	RequestIDOptions struct {
		// useXRequestID enabled the use of the X-Request-Id request header as
		// the request ID.
		useXRequestID bool

		// requestIDLimit is the maximum length of the X-Request-Id header
		// allowed. Values longer than this value are truncated. Zero value
		// means no limit.
		requestIDLimit int
	}
)

func newRequestIDOptions(options ...RequestIDOption) *RequestIDOptions {
	o := new(RequestIDOptions)
	for _, opt := range options {
		o = opt(o)
	}
	return o
}

func (o *RequestIDOptions) UseRequestID() bool {
	return o.useXRequestID
}


================================================
FILE: internal/pidfile/README.md
================================================
Package pidfile is derived from github.com/moby/moby/pkg/pidfile.

Moby is licensed under the Apache License, Version 2.0.
Copyright 2012-2017 Docker, Inc.


================================================
FILE: internal/pidfile/mkdirall.go
================================================
// +build !windows

package pidfile

import "os"

// MkdirAll creates a directory named path along with any necessary parents,
// with permission specified by attribute perm for all dir created.
func MkdirAll(path string, perm os.FileMode) error {
	return os.MkdirAll(path, perm)
}


================================================
FILE: internal/pidfile/mkdirall_windows.go
================================================
// +build windows

package pidfile

import (
	"os"
	"regexp"
	"syscall"
	"unsafe"

	"golang.org/x/sys/windows"
)

// MkdirAll implementation that is volume path aware for Windows. It can be used
// as a drop-in replacement for os.MkdirAll()
func MkdirAll(path string, _ os.FileMode) error {
	return mkdirall(path, false, "")
}

// mkdirall is a custom version of os.MkdirAll modified for use on Windows
// so that it is both volume path aware, and can create a directory with
// a DACL.
func mkdirall(path string, applyACL bool, sddl string) error {
	if re := regexp.MustCompile(`^\\\\\?\\Volume{[a-z0-9-]+}$`); re.MatchString(path) {
		return nil
	}

	// The rest of this method is largely copied from os.MkdirAll and should be kept
	// as-is to ensure compatibility.

	// Fast path: if we can tell whether path is a directory or file, stop with success or error.
	dir, err := os.Stat(path)
	if err == nil {
		if dir.IsDir() {
			return nil
		}
		return &os.PathError{
			Op:   "mkdir",
			Path: path,
			Err:  syscall.ENOTDIR,
		}
	}

	// Slow path: make sure parent exists and then call Mkdir for path.
	i := len(path)
	for i > 0 && os.IsPathSeparator(path[i-1]) { // Skip trailing path separator.
		i--
	}

	j := i
	for j > 0 && !os.IsPathSeparator(path[j-1]) { // Scan backward over element.
		j--
	}

	if j > 1 {
		// Create parent
		err = mkdirall(path[0:j-1], false, sddl)
		if err != nil {
			return err
		}
	}

	// Parent now exists; invoke os.Mkdir or mkdirWithACL and use its result.
	if applyACL {
		err = mkdirWithACL(path, sddl)
	} else {
		err = os.Mkdir(path, 0)
	}

	if err != nil {
		// Handle arguments like "foo/." by
		// double-checking that directory doesn't exist.
		dir, err1 := os.Lstat(path)
		if err1 == nil && dir.IsDir() {
			return nil
		}
		return err
	}
	return nil
}

// mkdirWithACL creates a new directory. If there is an error, it will be of
// type *PathError. .
//
// This is a modified and combined version of os.Mkdir and windows.Mkdir
// in golang to cater for creating a directory am ACL permitting full
// access, with inheritance, to any subfolder/file for Built-in Administrators
// and Local System.
func mkdirWithACL(name string, sddl string) error {
	sa := windows.SecurityAttributes{Length: 0}
	sd, err := windows.SecurityDescriptorFromString(sddl)
	if err != nil {
		return &os.PathError{Op: "mkdir", Path: name, Err: err}
	}
	sa.Length = uint32(unsafe.Sizeof(sa))
	sa.InheritHandle = 1
	sa.SecurityDescriptor = sd

	namep, err := windows.UTF16PtrFromString(name)
	if err != nil {
		return &os.PathError{Op: "mkdir", Path: name, Err: err}
	}

	e := windows.CreateDirectory(namep, &sa)
	if e != nil {
		return &os.PathError{Op: "mkdir", Path: name, Err: e}
	}
	return nil
}


================================================
FILE: internal/pidfile/pidfile.go
================================================
// Package pidfile provides structure and helper functions to create and remove
// PID file. A PID file is usually a file used to store the process ID of a
// running process.
package pidfile

import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"strconv"
	"strings"
)

// PIDFile is a file used to store the process ID of a running process.
type PIDFile struct {
	path string
}

func checkPIDFileAlreadyExists(path string) error {
	if pidByte, err := ioutil.ReadFile(path); err == nil {
		pidString := strings.TrimSpace(string(pidByte))
		if pid, err := strconv.Atoi(pidString); err == nil {
			if processExists(pid) {
				return fmt.Errorf("pid file found, ensure webhook is not running or delete %s", path)
			}
		}
	}
	return nil
}

// New creates a PIDfile using the specified path.
func New(path string) (*PIDFile, error) {
	if err := checkPIDFileAlreadyExists(path); err != nil {
		return nil, err
	}
	// Note MkdirAll returns nil if a directory already exists
	if err := MkdirAll(filepath.Dir(path), os.FileMode(0o755)); err != nil {
		return nil, err
	}
	if err := ioutil.WriteFile(path, []byte(fmt.Sprintf("%d", os.Getpid())), 0o600); err != nil {
		return nil, err
	}

	return &PIDFile{path: path}, nil
}

// Remove removes the PIDFile.
func (file PIDFile) Remove() error {
	return os.Remove(file.path)
}


================================================
FILE: internal/pidfile/pidfile_darwin.go
================================================
// +build darwin

package pidfile

import (
	"golang.org/x/sys/unix"
)

func processExists(pid int) bool {
	// OS X does not have a proc filesystem.
	// Use kill -0 pid to judge if the process exists.
	err := unix.Kill(pid, 0)
	return err == nil
}


================================================
FILE: internal/pidfile/pidfile_test.go
================================================
package pidfile

import (
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"
)

func TestNewAndRemove(t *testing.T) {
	dir, err := ioutil.TempDir(os.TempDir(), "test-pidfile")
	if err != nil {
		t.Fatal("Could not create test directory")
	}

	path := filepath.Join(dir, "testfile")
	file, err := New(path)
	if err != nil {
		t.Fatal("Could not create test file", err)
	}

	_, err = New(path)
	if err == nil {
		t.Fatal("Test file creation not blocked")
	}

	if err := file.Remove(); err != nil {
		t.Fatal("Could not delete created test file")
	}
}

func TestRemoveInvalidPath(t *testing.T) {
	file := PIDFile{path: filepath.Join("foo", "bar")}

	if err := file.Remove(); err == nil {
		t.Fatal("Non-existing file doesn't give an error on delete")
	}
}


================================================
FILE: internal/pidfile/pidfile_unix.go
================================================
// +build !windows,!darwin

package pidfile

import (
	"os"
	"path/filepath"
	"strconv"
)

func processExists(pid int) bool {
	if _, err := os.Stat(filepath.Join("/proc", strconv.Itoa(pid))); err == nil {
		return true
	}
	return false
}


================================================
FILE: internal/pidfile/pidfile_windows.go
================================================
package pidfile

import (
	"golang.org/x/sys/windows"
)

const (
	processQueryLimitedInformation = 0x1000

	stillActive = 259
)

func processExists(pid int) bool {
	h, err := windows.OpenProcess(processQueryLimitedInformation, false, uint32(pid))
	if err != nil {
		return false
	}
	var c uint32
	err = windows.GetExitCodeProcess(h, &c)
	windows.Close(h)
	if err != nil {
		return c == stillActive
	}
	return true
}


================================================
FILE: platform_unix.go
================================================
//go:build !windows
// +build !windows

package main

import (
	"flag"
	"fmt"
	"github.com/coreos/go-systemd/v22/activation"
	"net"
)

func platformFlags() {
	flag.StringVar(&socket, "socket", "", "path to a Unix socket (e.g. /tmp/webhook.sock) to use instead of listening on an ip and port; if specified, the ip and port options are ignored")
	flag.IntVar(&setGID, "setgid", 0, "set group ID after opening listening port; must be used with setuid, not permitted with -socket")
	flag.IntVar(&setUID, "setuid", 0, "set user ID after opening listening port; must be used with setgid, not permitted with -socket")
}

func trySocketListener() (net.Listener, error) {
	// first check whether we have any sockets from systemd
	listeners, err := activation.Listeners()
	if err != nil {
		return nil, fmt.Errorf("failed to retrieve sockets from systemd: %w", err)
	}
	numListeners := len(listeners)
	if numListeners > 1 {
		return nil, fmt.Errorf("received %d sockets from systemd, but only 1 is supported", numListeners)
	}
	if numListeners == 1 {
		sockAddr := listeners[0].Addr()
		if sockAddr.Network() == "tcp" {
			addr = sockAddr.String()
		} else {
			addr = fmt.Sprintf("{%s:%s}", sockAddr.Network(), sockAddr.String())
		}
		return listeners[0], nil
	}
	// if we get to here, we got no sockets from systemd, so check -socket flag
	if socket != "" {
		if setGID != 0 || setUID != 0 {
			return nil, fmt.Errorf("-setuid and -setgid options are not compatible with -socket.  If you need to bind a socket as root but run webhook as a different user, consider using systemd activation")
		}
		addr = fmt.Sprintf("{unix:%s}", socket)
		return net.Listen("unix", socket)
	}
	return nil, nil
}


================================================
FILE: platform_windows.go
================================================
//go:build windows
// +build windows

package main

import (
	"flag"
	"fmt"
	"github.com/Microsoft/go-winio"
	"net"
)

func platformFlags() {
	flag.StringVar(&socket, "socket", "", "path to a Windows named pipe (e.g. \\\\.\\pipe\\webhook) to use instead of listening on an ip and port; if specified, the ip and port options are ignored")
}

func trySocketListener() (net.Listener, error) {
	if socket != "" {
		addr = fmt.Sprintf("{pipe:%s}", socket)
		return winio.ListenPipe(socket, nil)
	}
	return nil, nil
}


================================================
FILE: signals.go
================================================
//go:build !windows
// +build !windows

package main

import (
	"log"
	"os"
	"os/signal"
	"strings"
	"syscall"
)

func setupSignals() {
	log.Printf("setting up os signal watcher\n")

	signals = make(chan os.Signal, 1)
	signal.Notify(signals, syscall.SIGUSR1)
	signal.Notify(signals, syscall.SIGHUP)
	signal.Notify(signals, syscall.SIGTERM)
	signal.Notify(signals, os.Interrupt)

	go watchForSignals()
}

func watchForSignals() {
	log.Println("os signal watcher ready")

	for {
		sig := <-signals
		switch sig {
		case syscall.SIGUSR1:
			log.Println("caught USR1 signal")
			reloadAllHooks()

		case syscall.SIGHUP:
			log.Println("caught HUP signal")
			reloadAllHooks()

		case os.Interrupt, syscall.SIGTERM:
			log.Printf("caught %s signal; exiting\n", sig)
			if pidFile != nil {
				err := pidFile.Remove()
				if err != nil {
					log.Print(err)
				}
			}
			if socket != "" && !strings.HasPrefix(socket, "@") {
				// we've been listening on a named Unix socket, delete it
				// before we exit so subsequent runs can re-bind the same
				// socket path
				err := os.Remove(socket)
				if err != nil {
					log.Printf("Failed to remove socket file %s: %v", socket, err)
				}
			}
			os.Exit(0)

		default:
			log.Printf("caught unhandled signal %+v\n", sig)
		}
	}
}


================================================
FILE: signals_windows.go
================================================
// +build windows

package main

func setupSignals() {
	// NOOP: Windows doesn't have signals equivalent to the Unix world.
}


================================================
FILE: test/hookecho.go
================================================
// Hook Echo is a simply utility used for testing the Webhook package.

package main

import (
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	if len(os.Args) > 1 {
		fmt.Printf("arg: %s\n", strings.Join(os.Args[1:], " "))
	}

	var env []string
	for _, v := range os.Environ() {
		if strings.HasPrefix(v, "HOOK_") {
			env = append(env, v)
		}
	}

	if len(env) > 0 {
		fmt.Printf("env: %s\n", strings.Join(env, " "))
	}

	if (len(os.Args) > 1) && (strings.HasPrefix(os.Args[1], "exit=")) {
		exit_code_str := os.Args[1][5:]
		exit_code, err := strconv.Atoi(exit_code_str)
		if err != nil {
			fmt.Printf("Exit code %s not an int!", exit_code_str)
			os.Exit(-1)
		}
		os.Exit(exit_code)
	}
}


================================================
FILE: test/hooks.json.tmpl
================================================
[
  {
    "id": "github",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "http-methods": ["Post "],
    "include-command-output-in-response": true,
    "trigger-rule-mismatch-http-response-code": 400,
    "pass-environment-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.timestamp"
      }
    ],
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "head_commit.author.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha1",
            "secret": "mysecret",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  },
  {
    "id": "github-multi-sig",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "http-methods": ["Post "],
    "include-command-output-in-response": true,
    "trigger-rule-mismatch-http-response-code": 400,
    "trigger-signature-soft-failures": true,
    "pass-environment-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.timestamp"
      }
    ],
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "head_commit.author.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        "or":
        [
          {
            "match":
            {
              "type": "payload-hmac-sha1",
              "secret": "mysecretFAIL",
              "parameter":
              {
                "source": "header",
                "name": "X-Hub-Signature"
              }
            }
          },
          {
            "match":
            {
              "type": "payload-hmac-sha1",
              "secret": "mysecret",
              "parameter":
              {
                "source": "header",
                "name": "X-Hub-Signature"
              }
            }
          }
        ],
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  },
  {
    "id": "github-multi-sig-fail",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "http-methods": ["Post "],
    "include-command-output-in-response": true,
    "trigger-rule-mismatch-http-response-code": 400,
    "pass-environment-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.timestamp"
      }
    ],
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "head_commit.author.email"
      }
    ],
    "trigger-rule":
    {
      "and":
      [
        "or":
        [
          {
            "match":
            {
              "type": "payload-hmac-sha1",
              "secret": "mysecretFAIL",
              "parameter":
              {
                "source": "header",
                "name": "X-Hub-Signature"
              }
            }
          },
          {
            "match":
            {
              "type": "payload-hmac-sha1",
              "secret": "mysecret",
              "parameter":
              {
                "source": "header",
                "name": "X-Hub-Signature"
              }
            }
          }
        ],
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/master",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  },
  {
    "id": "bitbucket",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "include-command-output-in-response": false,
    "response-message": "success",
    "trigger-rule-mismatch-http-response-code": 999,
    "parse-parameters-as-json": [
      {
        "source": "payload",
        "name": "payload"
      }
    ],
    "trigger-rule": {
      "and": [
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "payload.canon_url"
            },
            "value": "https://bitbucket.org"
          }
        },
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "payload.repository.absolute_url"
            },
            "value": "/webhook/testing/"
          }
        },
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "payload.commits.0.branch"
            },
            "value": "master"
          }
        }
      ]
    }
  },
  {
    "id": "gitlab",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "response-message": "success",
    "include-command-output-in-response": true,
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "commits.0.id"
      },
      {
        "source": "payload",
        "name": "user_name"
      },
      {
        "source": "payload",
        "name": "user_email"
      }
    ],
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "value": "refs/heads/master",
        "parameter":
        {
          "source": "payload",
          "name": "ref"
        }
      }
    }
  },
  {
    "id": "xml",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "response-message": "success",
    "trigger-rule": {
      "and": [
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "app.users.user.0.-name"
            },
            "value": "Jeff"
          }
        },
        {
          "match": {
            "type": "value",
            "parameter": {
              "source": "payload",
              "name": "app.messages.message.#text"
            },
            "value": "Hello!!"
          }
        },
      ],
    }
  },
  {
    "id": "txt-raw",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "include-command-output-in-response": true,
    "pass-arguments-to-command": [
      {
        "source": "raw-request-body"
      }
    ]
  },
  {
    "id": "sendgrid",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "response-message": "success",
    "trigger-rule": {
      "match": {
        "type": "value",
        "parameter": {
          "source": "payload",
          "name": "root.0.event"
        },
        "value": "processed"
      }
    }
  },
  {
    "id": "sendgrid/dir",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "response-message": "success",
    "trigger-rule": {
      "match": {
        "type": "value",
        "parameter": {
          "source": "payload",
          "name": "root.0.event"
        },
        "value": "it worked!"
      }
    }
  },
  {
    "id": "plex",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "response-message": "success",
    "parse-parameters-as-json": [
      {
        "source": "payload",
        "name": "payload"
      }
    ],
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "parameter": {
          "source": "payload",
          "name": "payload.event"
        },
        "value": "media.play"
      }
    }
  },
  {
    "id": "capture-command-output-on-success-not-by-default",
    "pass-arguments-to-command": [
      {
        "source": "string",
        "name": "exit=0"
      }
    ],
    "execute-command": "{{ .Hookecho }}"
  },
  {
    "id": "capture-command-output-on-success-yes-with-flag",
    "pass-arguments-to-command": [
      {
        "source": "string",
        "name": "exit=0"
      }
    ],
    "execute-command": "{{ .Hookecho }}",
    "include-command-output-in-response": true
  },
  {
    "id": "capture-command-output-on-error-not-by-default",
    "pass-arguments-to-command": [
      {
        "source": "string",
        "name": "exit=1"
      }
    ],
    "execute-command": "{{ .Hookecho }}",
    "include-command-output-in-response": true
  },
  {
    "id": "capture-command-output-on-error-yes-with-extra-flag",
    "pass-arguments-to-command": [
      {
        "source": "string",
        "name": "exit=1"
      }
    ],
    "execute-command": "{{ .Hookecho }}",
    "include-command-output-in-response": true,
    "include-command-output-in-response-on-error": true
  },
  {
    "id": "request-source",
    "pass-arguments-to-command": [
      {
        "source": "request",
        "name": "method"
      },
      {
        "source": "request",
        "name": "remote-addr"
      }
    ],
    "execute-command": "{{ .Hookecho }}",
    "include-command-output-in-response": true
  },
  {
    "id": "static-params-ok",
		"execute-command": "{{ .Hookecho }}",
		"response-message": "success",
    "include-command-output-in-response": true,
		"pass-arguments-to-command": [
      {
        "source": "string",
        "name": "passed"
      }
    ],
  },
  {
    "id": "warn-on-space",
		"execute-command": "{{ .Hookecho }} foo",
		"response-message": "success",
    "include-command-output-in-response": true,
		"pass-arguments-to-command": [
      {
        "source": "string",
        "name": "passed"
      }
    ],
  },
  {
    "id": "issue-471",
    "execute-command": "{{ .Hookecho }}",
    "response-message": "success",
    "trigger-rule":
    {
      "or":
      [
        {
          "match":
          {
            "parameter":
            {
              "source": "payload",
              "name": "foo"
            },
            "type": "value",
            "value": "bar"
          }
        },
        {
          "match":
          {
            "parameter":
            {
              "source": "payload",
              "name": "exists"
            },
            "type": "value",
            "value": 1
          }
        }
      ]
    }
  },
  {
    "id": "issue-471-and",
    "execute-command": "{{ .Hookecho }}",
    "response-message": "success",
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "parameter":
            {
              "source": "payload",
              "name": "foo"
            },
            "type": "value",
            "value": "bar"
          }
        },
        {
          "match":
          {
            "parameter":
            {
              "source": "payload",
              "name": "exists"
            },
            "type": "value",
            "value": 1
          }
        }
      ]
    }
  },
  {
    "id": "empty-payload-signature",
    "execute-command": "{{ .Hookecho }}",
    "command-working-directory": "/",
    "include-command-output-in-response": true,
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hmac-sha1",
            "secret": "mysecret",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        }
      ]
    }
  }
]


================================================
FILE: test/hooks.yaml.tmpl
================================================
- id: github
  http-methods:
  - "Post "
  trigger-rule:
    and:
    - match:
        parameter:
          source: header
          name: X-Hub-Signature
        secret: mysecret
        type: payload-hmac-sha1
    - match:
        parameter:
          source: payload
          name: ref
        type: value
        value: refs/heads/master
  include-command-output-in-response: true
  trigger-rule-mismatch-http-response-code: 400
  execute-command: '{{ .Hookecho }}'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: head_commit.author.email
  pass-environment-to-command:
  - source: payload
    name: head_commit.timestamp
  command-working-directory: /

- id: github-multi-sig
  http-methods:
  - "Post "
  trigger-rule:
    and:
    - or:
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecretFAIL
          type: payload-hmac-sha1
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecret
          type: payload-hmac-sha1
    - match:
        parameter:
          source: payload
          name: ref
        type: value
        value: refs/heads/master
  include-command-output-in-response: true
  trigger-rule-mismatch-http-response-code: 400
  trigger-signature-soft-failures: true
  execute-command: '{{ .Hookecho }}'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: head_commit.author.email
  pass-environment-to-command:
  - source: payload
    name: head_commit.timestamp
  command-working-directory: /

- id: github-multi-sig-fail
  http-methods:
  - "Post "
  trigger-rule:
    and:
    - or:
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecretFAIL
          type: payload-hmac-sha1
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecret
          type: payload-hmac-sha1
    - match:
        parameter:
          source: payload
          name: ref
        type: value
        value: refs/heads/master
  include-command-output-in-response: true
  trigger-rule-mismatch-http-response-code: 400
  execute-command: '{{ .Hookecho }}'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: head_commit.author.email
  pass-environment-to-command:
  - source: payload
    name: head_commit.timestamp
  command-working-directory: /

- id: bitbucket
  trigger-rule:
    and:
    - match:
        parameter:
          source: payload
          name: payload.canon_url
        type: value
        value: https://bitbucket.org
    - match:
        parameter:
          source: payload
          name: payload.repository.absolute_url
        type: value
        value: /webhook/testing/
    - match:
        parameter:
          source: payload
          name: payload.commits.0.branch
        type: value
        value: master
  parse-parameters-as-json:
  - source: payload
    name: payload
  trigger-rule-mismatch-http-response-code: 999
  execute-command: '{{ .Hookecho }}'
  response-message: success
  include-command-output-in-response: false
  command-working-directory: /

- id: gitlab
  trigger-rule:
    match:
      parameter:
        source: payload
        name: ref
      type: value
      value: refs/heads/master
  pass-arguments-to-command:
  - source: payload
    name: commits.0.id
  - source: payload
    name: user_name
  - source: payload
    name: user_email
  execute-command: '{{ .Hookecho }}'
  response-message: success
  include-command-output-in-response: true
  command-working-directory: /

- id: xml
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  response-message: success
  trigger-rule:
    and:
    - match:
        type: value
        parameter:
          source: payload
          name: app.users.user.0.-name
        value: Jeff
    - match:
        type: value
        parameter:
          source: payload
          name: "app.messages.message.#text"
        value: "Hello!!"

- id: txt-raw
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  include-command-output-in-response: true
  pass-arguments-to-command:
  - source: raw-request-body

- id: sendgrid
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  response-message: success
  trigger-rule:
    match:
      type: value
      parameter:
        source: payload
        name: root.0.event
      value: processed

- id: sendgrid/dir
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  response-message: success
  trigger-rule:
    match:
      type: value
      parameter:
        source: payload
        name: root.0.event
      value: it worked!

- id: plex
  trigger-rule:
    match:
      type: value
      parameter:
        source: payload
        name: payload.event
      value: media.play
  parse-parameters-as-json:
  - source: payload
    name: payload
  execute-command: '{{ .Hookecho }}'
  response-message: success
  command-working-directory: /

- id: capture-command-output-on-success-not-by-default
  pass-arguments-to-command:
  - source: string
    name: exit=0
  execute-command: '{{ .Hookecho }}'

- id: capture-command-output-on-success-yes-with-flag
  pass-arguments-to-command:
  - source: string
    name: exit=0
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true

- id: capture-command-output-on-error-not-by-default
  pass-arguments-to-command:
  - source: string
    name: exit=1
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true

- id: capture-command-output-on-error-yes-with-extra-flag
  pass-arguments-to-command:
  - source: string
    name: exit=1
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true
  include-command-output-in-response-on-error: true

- id: request-source
  pass-arguments-to-command:
  - source: request
    name: method
  - source: request
    name: remote-addr
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true

- id: static-params-ok
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true
  pass-arguments-to-command:
  - source: string
    name: passed

- id: warn-on-space
  execute-command: '{{ .Hookecho }} foo'
  include-command-output-in-response: true

- id: issue-471
  execute-command: '{{ .Hookecho }}'
  response-message: success
  trigger-rule:
    or:
    - match:
        parameter:
          source: payload
          name: foo
        type: value
        value: bar
    - match:
        parameter:
          source: payload
          name: exists
        type: value
        value: 1

- id: issue-471-and
  execute-command: '{{ .Hookecho }}'
  response-message: success
  trigger-rule:
    and:
    - match:
        parameter:
          source: payload
          name: foo
        type: value
        value: bar
    - match:
        parameter:
          source: payload
          name: exists
        type: value
        value: 1

- id: empty-payload-signature
  include-command-output-in-response: true
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  trigger-rule:
    and:
    - match:
        parameter:
          source: header
          name: X-Hub-Signature
        secret: mysecret
        type: payload-hmac-sha1


================================================
FILE: testutils.go
================================================
//go:build !windows
// +build !windows

package main

import (
	"context"
	"io/ioutil"
	"net"
	"net/http"
	"os"
	"path"
)

func prepareTestSocket(_ string) (socketPath string, transport *http.Transport, cleanup func(), err error) {
	tmp, err := ioutil.TempDir("", "webhook-socket-")
	if err != nil {
		return "", nil, nil, err
	}
	cleanup = func() { os.RemoveAll(tmp) }
	socketPath = path.Join(tmp, "webhook.sock")
	socketDialer := &net.Dialer{}
	transport = &http.Transport{
		DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
			return socketDialer.DialContext(ctx, "unix", socketPath)
		},
	}

	return socketPath, transport, cleanup, nil
}


================================================
FILE: testutils_windows.go
================================================
//go:build windows
// +build windows

package main

import (
	"context"
	"github.com/Microsoft/go-winio"
	"net"
	"net/http"
)

func prepareTestSocket(hookTmpl string) (socketPath string, transport *http.Transport, cleanup func(), err error) {
	socketPath = "\\\\.\\pipe\\webhook-" + hookTmpl
	transport = &http.Transport{
		DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
			return winio.DialPipeContext(ctx, socketPath)
		},
	}

	return socketPath, transport, nil, nil
}


================================================
FILE: tls.go
================================================
package main

import (
	"crypto/tls"
	"io"
	"log"
	"strings"
)

func writeTLSSupportedCipherStrings(w io.Writer, min uint16) error {
	for _, c := range tls.CipherSuites() {
		var found bool

		for _, v := range c.SupportedVersions {
			if v >= min {
				found = true
			}
		}

		if !found {
			continue
		}

		_, err := w.Write([]byte(c.Name + "\n"))
		if err != nil {
			return err
		}
	}

	return nil
}

// getTLSMinVersion converts a version string into a TLS version ID.
func getTLSMinVersion(v string) uint16 {
	switch v {
	case "1.0":
		return tls.VersionTLS10
	case "1.1":
		return tls.VersionTLS11
	case "1.2", "":
		return tls.VersionTLS12
	case "1.3":
		return tls.VersionTLS13
	default:
		log.Fatalln("error: unknown minimum TLS version:", v)
		return 0
	}
}

// getTLSCipherSuites converts a comma separated list of cipher suites into a
// slice of TLS cipher suite IDs.
func getTLSCipherSuites(v string) []uint16 {
	supported := tls.CipherSuites()

	if v == "" {
		suites := make([]uint16, len(supported))

		for _, cs := range supported {
			suites = append(suites, cs.ID)
		}

		return suites
	}

	var found bool
	txts := strings.Split(v, ",")
	suites := make([]uint16, len(txts))

	for _, want := range txts {
		found = false

		for _, cs := range supported {
			if want == cs.Name {
				suites = append(suites, cs.ID)
				found = true
			}
		}

		if !found {
			log.Fatalln("error: unknown TLS cipher suite:", want)
		}
	}

	return suites
}


================================================
FILE: vendor/github.com/Microsoft/go-winio/.gitattributes
================================================
* text=auto eol=lf

================================================
FILE: vendor/github.com/Microsoft/go-winio/.gitignore
================================================
.vscode/

*.exe

# testing
testdata

# go workspaces
go.work
go.work.sum


================================================
FILE: vendor/github.com/Microsoft/go-winio/.golangci.yml
================================================
linters:
  enable:
    # style
    - containedctx # struct contains a context
    - dupl # duplicate code
    - errname # erorrs are named correctly
    - nolintlint # "//nolint" directives are properly explained
    - revive # golint replacement
    - unconvert # unnecessary conversions
    - wastedassign

    # bugs, performance, unused, etc ...
    - contextcheck # function uses a non-inherited context
    - errorlint # errors not wrapped for 1.13
    - exhaustive # check exhaustiveness of enum switch statements
    - gofmt # files are gofmt'ed
    - gosec # security
    - nilerr # returns nil even with non-nil error
    - thelper #  test helpers without t.Helper()
    - unparam # unused function params

issues:
  exclude-dirs:
    - pkg/etw/sample

  exclude-rules:
    # err is very often shadowed in nested scopes
    - linters:
        - govet
      text: '^shadow: declaration of "err" shadows declaration'

    # ignore long lines for skip autogen directives
    - linters:
        - revive
      text: "^line-length-limit: "
      source: "^//(go:generate|sys) "

    #TODO: remove after upgrading to go1.18
    # ignore comment spacing for nolint and sys directives
    - linters:
        - revive
      text: "^comment-spacings: no space between comment delimiter and comment text"
      source: "//(cspell:|nolint:|sys |todo)"

    # not on go 1.18 yet, so no any
    - linters:
        - revive
      text: "^use-any: since GO 1.18 'interface{}' can be replaced by 'any'"

    # allow unjustified ignores of error checks in defer statements
    - linters:
        - nolintlint
      text: "^directive `//nolint:errcheck` should provide explanation"
      source: '^\s*defer '

    # allow unjustified ignores of error lints for io.EOF
    - linters:
        - nolintlint
      text: "^directive `//nolint:errorlint` should provide explanation"
      source: '[=|!]= io.EOF'


linters-settings:
  exhaustive:
    default-signifies-exhaustive: true
  govet:
    enable-all: true
    disable:
      # struct order is often for Win32 compat
      # also, ignore pointer bytes/GC issues for now until performance becomes an issue
      - fieldalignment
  nolintlint:
    require-explanation: true
    require-specific: true
  revive:
    # revive is more configurable than static check, so likely the preferred alternative to static-check
    # (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997)
    enable-all-rules:
      true
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
    rules:
      # rules with required arguments
      - name: argument-limit
        disabled: true
      - name: banned-characters
        disabled: true
      - name: cognitive-complexity
        disabled: true
      - name: cyclomatic
        disabled: true
      - name: file-header
        disabled: true
      - name: function-length
        disabled: true
      - name: function-result-limit
        disabled: true
      - name: max-public-structs
        disabled: true
      # geneally annoying rules
      - name: add-constant # complains about any and all strings and integers
        disabled: true
      - name: confusing-naming # we frequently use "Foo()" and "foo()" together
        disabled: true
      - name: flag-parameter # excessive, and a common idiom we use
        disabled: true
      - name: unhandled-error # warns over common fmt.Print* and io.Close; rely on errcheck instead
        disabled: true
      # general config
      - name: line-length-limit
        arguments:
          - 140
      - name: var-naming
        arguments:
          - []
          - - CID
            - CRI
            - CTRD
            - DACL
            - DLL
            - DOS
            - ETW
            - FSCTL
            - GCS
            - GMSA
            - HCS
            - HV
            - IO
            - LCOW
            - LDAP
            - LPAC
            - LTSC
            - MMIO
            - NT
            - OCI
            - PMEM
            - PWSH
            - RX
            - SACl
            - SID
            - SMB
            - TX
            - VHD
            - VHDX
            - VMID
            - VPCI
            - WCOW
            - WIM


================================================
FILE: vendor/github.com/Microsoft/go-winio/CODEOWNERS
================================================
  * @microsoft/containerplat


================================================
FILE: vendor/github.com/Microsoft/go-winio/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



================================================
FILE: vendor/github.com/Microsoft/go-winio/README.md
================================================
# go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/go-winio/actions/workflows/ci.yml)

This repository contains utilities for efficiently performing Win32 IO operations in
Go. Currently, this is focused on accessing named pipes and other file handles, and
for using named pipes as a net transport.

This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go
to reuse the thread to schedule another goroutine. This limits support to Windows Vista and
newer operating systems. This is similar to the implementation of network sockets in Go's net
package.

Please see the LICENSE file for licensing information.

## Contributing

This project welcomes contributions and suggestions.
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that
you have the right to, and actually do, grant us the rights to use your contribution.
For details, visit [Microsoft CLA](https://cla.microsoft.com).

When you submit a pull request, a CLA-bot will automatically determine whether you need to
provide a CLA and decorate the PR appropriately (e.g., label, comment).
Simply follow the instructions provided by the bot.
You will only need to do this once across all repos using our CLA.

Additionally, the pull request pipeline requires the following steps to be performed before
mergining.

### Code Sign-Off

We require that contributors sign their commits using [`git commit --signoff`][git-commit-s]
to certify they either authored the work themselves or otherwise have permission to use it in this project.

A range of commits can be signed off using [`git rebase --signoff`][git-rebase-s].

Please see [the developer certificate](https://developercertificate.org) for more info,
as well as to make sure that you can attest to the rules listed.
Our CI uses the DCO Github app to ensure that all commits in a given PR are signed-off.

### Linting

Code must pass a linting stage, which uses [`golangci-lint`][lint].
The linting settings are stored in [`.golangci.yaml`](./.golangci.yaml), and can be run
automatically with VSCode by adding the following to your workspace or folder settings:

```json
    "go.lintTool": "golangci-lint",
    "go.lintOnSave": "package",
```

Additional editor [integrations options are also available][lint-ide].

Alternatively, `golangci-lint` can be [installed locally][lint-install] and run from the repo root:

```shell
# use . or specify a path to only lint a package
# to show all lint errors, use flags "--max-issues-per-linter=0 --max-same-issues=0"
> golangci-lint run ./...
```

### Go Generate

The pipeline checks that auto-generated code, via `go generate`, are up to date.

This can be done for the entire repo:

```shell
> go generate ./...
```

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Special Thanks

Thanks to [natefinch][natefinch] for the inspiration for this library.
See [npipe](https://github.com/natefinch/npipe) for another named pipe implementation.

[lint]: https://golangci-lint.run/
[lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration
[lint-install]: https://golangci-lint.run/usage/install/#local-installation

[git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s
[git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff

[natefinch]: https://github.com/natefinch


================================================
FILE: vendor/github.com/Microsoft/go-winio/SECURITY.md
================================================
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
  * Full paths of source file(s) related to the manifestation of the issue
  * The location of the affected source code (tag/branch/commit or direct URL)
  * Any special configuration required to reproduce the issue
  * Step-by-step instructions to reproduce the issue
  * Proof-of-concept or exploit code (if possible)
  * Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->


================================================
FILE: vendor/github.com/Microsoft/go-winio/backup.go
================================================
//go:build windows
// +build windows

package winio

import (
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"os"
	"runtime"
	"unicode/utf16"

	"github.com/Microsoft/go-winio/internal/fs"
	"golang.org/x/sys/windows"
)

//sys backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead
//sys backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite

const (
	BackupData = uint32(iota + 1)
	BackupEaData
	BackupSecurity
	BackupAlternateData
	BackupLink
	BackupPropertyData
	BackupObjectId //revive:disable-line:var-naming ID, not Id
	BackupReparseData
	BackupSparseBlock
	BackupTxfsData
)

const (
	StreamSparseAttributes = uint32(8)
)

//nolint:revive // var-naming: ALL_CAPS
const (
	WRITE_DAC              = windows.WRITE_DAC
	WRITE_OWNER            = windows.WRITE_OWNER
	ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY
)

// BackupHeader represents a backup stream of a file.
type BackupHeader struct {
	//revive:disable-next-line:var-naming ID, not Id
	Id         uint32 // The backup stream ID
	Attributes uint32 // Stream attributes
	Size       int64  // The size of the stream in bytes
	Name       string // The name of the stream (for BackupAlternateData only).
	Offset     int64  // The offset of the stream in the file (for BackupSparseBlock only).
}

type win32StreamID struct {
	StreamID   uint32
	Attributes uint32
	Size       uint64
	NameSize   uint32
}

// BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series
// of BackupHeader values.
type BackupStreamReader struct {
	r         io.Reader
	bytesLeft int64
}

// NewBackupStreamReader produces a BackupStreamReader from any io.Reader.
func NewBackupStreamReader(r io.Reader) *BackupStreamReader {
	return &BackupStreamReader{r, 0}
}

// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if
// it was not completely read.
func (r *BackupStreamReader) Next() (*BackupHeader, error) {
	if r.bytesLeft > 
Download .txt
gitextract_v6ndqv7b/

├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE.md
│   └── workflows/
│       └── build.yml
├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── docs/
│   ├── Hook-Definition.md
│   ├── Hook-Examples.md
│   ├── Hook-Rules.md
│   ├── Referencing-Request-Values.md
│   ├── Systemd-Activation.md
│   ├── Templates.md
│   └── Webhook-Parameters.md
├── droppriv_nope.go
├── droppriv_unix.go
├── go.mod
├── go.sum
├── hooks.json.example
├── hooks.json.tmpl.example
├── hooks.yaml.example
├── hooks.yaml.tmpl.example
├── internal/
│   ├── hook/
│   │   ├── hook.go
│   │   ├── hook_test.go
│   │   └── request.go
│   ├── middleware/
│   │   ├── dumper.go
│   │   ├── logger.go
│   │   └── request_id.go
│   └── pidfile/
│       ├── README.md
│       ├── mkdirall.go
│       ├── mkdirall_windows.go
│       ├── pidfile.go
│       ├── pidfile_darwin.go
│       ├── pidfile_test.go
│       ├── pidfile_unix.go
│       └── pidfile_windows.go
├── platform_unix.go
├── platform_windows.go
├── signals.go
├── signals_windows.go
├── test/
│   ├── hookecho.go
│   ├── hooks.json.tmpl
│   └── hooks.yaml.tmpl
├── testutils.go
├── testutils_windows.go
├── tls.go
├── vendor/
│   ├── github.com/
│   │   ├── Microsoft/
│   │   │   └── go-winio/
│   │   │       ├── .gitattributes
│   │   │       ├── .gitignore
│   │   │       ├── .golangci.yml
│   │   │       ├── CODEOWNERS
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── SECURITY.md
│   │   │       ├── backup.go
│   │   │       ├── doc.go
│   │   │       ├── ea.go
│   │   │       ├── file.go
│   │   │       ├── fileinfo.go
│   │   │       ├── hvsock.go
│   │   │       ├── internal/
│   │   │       │   ├── fs/
│   │   │       │   │   ├── doc.go
│   │   │       │   │   ├── fs.go
│   │   │       │   │   ├── security.go
│   │   │       │   │   └── zsyscall_windows.go
│   │   │       │   ├── socket/
│   │   │       │   │   ├── rawaddr.go
│   │   │       │   │   ├── socket.go
│   │   │       │   │   └── zsyscall_windows.go
│   │   │       │   └── stringbuffer/
│   │   │       │       └── wstring.go
│   │   │       ├── pipe.go
│   │   │       ├── pkg/
│   │   │       │   └── guid/
│   │   │       │       ├── guid.go
│   │   │       │       ├── guid_nonwindows.go
│   │   │       │       ├── guid_windows.go
│   │   │       │       └── variant_string.go
│   │   │       ├── privilege.go
│   │   │       ├── reparse.go
│   │   │       ├── sd.go
│   │   │       ├── syscall.go
│   │   │       └── zsyscall_windows.go
│   │   ├── clbanning/
│   │   │   └── mxj/
│   │   │       └── v2/
│   │   │           ├── .travis.yml
│   │   │           ├── LICENSE
│   │   │           ├── anyxml.go
│   │   │           ├── atomFeedString.xml
│   │   │           ├── doc.go
│   │   │           ├── escapechars.go
│   │   │           ├── exists.go
│   │   │           ├── files.go
│   │   │           ├── files_test.badjson
│   │   │           ├── files_test.badxml
│   │   │           ├── files_test.json
│   │   │           ├── files_test.xml
│   │   │           ├── files_test_dup.json
│   │   │           ├── files_test_dup.xml
│   │   │           ├── files_test_indent.json
│   │   │           ├── files_test_indent.xml
│   │   │           ├── gob.go
│   │   │           ├── json.go
│   │   │           ├── keyvalues.go
│   │   │           ├── leafnode.go
│   │   │           ├── misc.go
│   │   │           ├── mxj.go
│   │   │           ├── newmap.go
│   │   │           ├── readme.md
│   │   │           ├── remove.go
│   │   │           ├── rename.go
│   │   │           ├── set.go
│   │   │           ├── setfieldsep.go
│   │   │           ├── songtext.xml
│   │   │           ├── strict.go
│   │   │           ├── struct.go
│   │   │           ├── updatevalues.go
│   │   │           ├── xml.go
│   │   │           ├── xmlseq.go
│   │   │           └── xmlseq2.go
│   │   ├── coreos/
│   │   │   └── go-systemd/
│   │   │       └── v22/
│   │   │           ├── LICENSE
│   │   │           ├── NOTICE
│   │   │           └── activation/
│   │   │               ├── files_unix.go
│   │   │               ├── files_windows.go
│   │   │               ├── listeners.go
│   │   │               └── packetconns.go
│   │   ├── dustin/
│   │   │   └── go-humanize/
│   │   │       ├── .travis.yml
│   │   │       ├── LICENSE
│   │   │       ├── README.markdown
│   │   │       ├── big.go
│   │   │       ├── bigbytes.go
│   │   │       ├── bytes.go
│   │   │       ├── comma.go
│   │   │       ├── commaf.go
│   │   │       ├── ftoa.go
│   │   │       ├── humanize.go
│   │   │       ├── number.go
│   │   │       ├── ordinals.go
│   │   │       ├── si.go
│   │   │       └── times.go
│   │   ├── fsnotify/
│   │   │   └── fsnotify/
│   │   │       ├── .cirrus.yml
│   │   │       ├── .editorconfig
│   │   │       ├── .gitattributes
│   │   │       ├── .gitignore
│   │   │       ├── .mailmap
│   │   │       ├── CHANGELOG.md
│   │   │       ├── CONTRIBUTING.md
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── backend_fen.go
│   │   │       ├── backend_inotify.go
│   │   │       ├── backend_kqueue.go
│   │   │       ├── backend_other.go
│   │   │       ├── backend_windows.go
│   │   │       ├── fsnotify.go
│   │   │       ├── mkdoc.zsh
│   │   │       ├── system_bsd.go
│   │   │       └── system_darwin.go
│   │   ├── ghodss/
│   │   │   └── yaml/
│   │   │       ├── .gitignore
│   │   │       ├── .travis.yml
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── fields.go
│   │   │       └── yaml.go
│   │   ├── go-chi/
│   │   │   └── chi/
│   │   │       └── v5/
│   │   │           ├── .gitignore
│   │   │           ├── CHANGELOG.md
│   │   │           ├── CONTRIBUTING.md
│   │   │           ├── LICENSE
│   │   │           ├── Makefile
│   │   │           ├── README.md
│   │   │           ├── SECURITY.md
│   │   │           ├── chain.go
│   │   │           ├── chi.go
│   │   │           ├── context.go
│   │   │           ├── middleware/
│   │   │           │   ├── basic_auth.go
│   │   │           │   ├── clean_path.go
│   │   │           │   ├── compress.go
│   │   │           │   ├── content_charset.go
│   │   │           │   ├── content_encoding.go
│   │   │           │   ├── content_type.go
│   │   │           │   ├── get_head.go
│   │   │           │   ├── heartbeat.go
│   │   │           │   ├── logger.go
│   │   │           │   ├── maybe.go
│   │   │           │   ├── middleware.go
│   │   │           │   ├── nocache.go
│   │   │           │   ├── page_route.go
│   │   │           │   ├── path_rewrite.go
│   │   │           │   ├── profiler.go
│   │   │           │   ├── realip.go
│   │   │           │   ├── recoverer.go
│   │   │           │   ├── request_id.go
│   │   │           │   ├── request_size.go
│   │   │           │   ├── route_headers.go
│   │   │           │   ├── strip.go
│   │   │           │   ├── sunset.go
│   │   │           │   ├── supress_notfound.go
│   │   │           │   ├── terminal.go
│   │   │           │   ├── throttle.go
│   │   │           │   ├── timeout.go
│   │   │           │   ├── url_format.go
│   │   │           │   ├── value.go
│   │   │           │   └── wrap_writer.go
│   │   │           ├── mux.go
│   │   │           ├── path_value.go
│   │   │           ├── path_value_fallback.go
│   │   │           └── tree.go
│   │   ├── gofrs/
│   │   │   └── uuid/
│   │   │       └── v5/
│   │   │           ├── .gitignore
│   │   │           ├── LICENSE
│   │   │           ├── README.md
│   │   │           ├── codec.go
│   │   │           ├── fuzz.go
│   │   │           ├── generator.go
│   │   │           ├── sql.go
│   │   │           └── uuid.go
│   │   └── gorilla/
│   │       └── mux/
│   │           ├── .editorconfig
│   │           ├── .gitignore
│   │           ├── LICENSE
│   │           ├── Makefile
│   │           ├── README.md
│   │           ├── doc.go
│   │           ├── middleware.go
│   │           ├── mux.go
│   │           ├── regexp.go
│   │           ├── route.go
│   │           └── test_helpers.go
│   ├── golang.org/
│   │   └── x/
│   │       └── sys/
│   │           ├── LICENSE
│   │           ├── PATENTS
│   │           ├── unix/
│   │           │   ├── .gitignore
│   │           │   ├── README.md
│   │           │   ├── affinity_linux.go
│   │           │   ├── aliases.go
│   │           │   ├── asm_aix_ppc64.s
│   │           │   ├── asm_bsd_386.s
│   │           │   ├── asm_bsd_amd64.s
│   │           │   ├── asm_bsd_arm.s
│   │           │   ├── asm_bsd_arm64.s
│   │           │   ├── asm_bsd_ppc64.s
│   │           │   ├── asm_bsd_riscv64.s
│   │           │   ├── asm_linux_386.s
│   │           │   ├── asm_linux_amd64.s
│   │           │   ├── asm_linux_arm.s
│   │           │   ├── asm_linux_arm64.s
│   │           │   ├── asm_linux_loong64.s
│   │           │   ├── asm_linux_mips64x.s
│   │           │   ├── asm_linux_mipsx.s
│   │           │   ├── asm_linux_ppc64x.s
│   │           │   ├── asm_linux_riscv64.s
│   │           │   ├── asm_linux_s390x.s
│   │           │   ├── asm_openbsd_mips64.s
│   │           │   ├── asm_solaris_amd64.s
│   │           │   ├── asm_zos_s390x.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
│   │           │   ├── dev_zos.go
│   │           │   ├── dirent.go
│   │           │   ├── endian_big.go
│   │           │   ├── endian_little.go
│   │           │   ├── env_unix.go
│   │           │   ├── epoll_zos.go
│   │           │   ├── fcntl.go
│   │           │   ├── fcntl_darwin.go
│   │           │   ├── fcntl_linux_32bit.go
│   │           │   ├── fdset.go
│   │           │   ├── fstatfs_zos.go
│   │           │   ├── gccgo.go
│   │           │   ├── gccgo_c.c
│   │           │   ├── gccgo_linux_amd64.go
│   │           │   ├── ifreq_linux.go
│   │           │   ├── ioctl_linux.go
│   │           │   ├── ioctl_signed.go
│   │           │   ├── ioctl_unsigned.go
│   │           │   ├── ioctl_zos.go
│   │           │   ├── mkall.sh
│   │           │   ├── mkerrors.sh
│   │           │   ├── mmap_nomremap.go
│   │           │   ├── mremap.go
│   │           │   ├── pagesize_unix.go
│   │           │   ├── pledge_openbsd.go
│   │           │   ├── ptrace_darwin.go
│   │           │   ├── ptrace_ios.go
│   │           │   ├── race.go
│   │           │   ├── race0.go
│   │           │   ├── readdirent_getdents.go
│   │           │   ├── readdirent_getdirentries.go
│   │           │   ├── sockcmsg_dragonfly.go
│   │           │   ├── sockcmsg_linux.go
│   │           │   ├── sockcmsg_unix.go
│   │           │   ├── sockcmsg_unix_other.go
│   │           │   ├── syscall.go
│   │           │   ├── syscall_aix.go
│   │           │   ├── syscall_aix_ppc.go
│   │           │   ├── syscall_aix_ppc64.go
│   │           │   ├── syscall_bsd.go
│   │           │   ├── syscall_darwin.go
│   │           │   ├── syscall_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── syscall_hurd.go
│   │           │   ├── syscall_hurd_386.go
│   │           │   ├── syscall_illumos.go
│   │           │   ├── syscall_linux.go
│   │           │   ├── syscall_linux_386.go
│   │           │   ├── syscall_linux_alarm.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_gc_arm.go
│   │           │   ├── syscall_linux_gccgo_386.go
│   │           │   ├── syscall_linux_gccgo_arm.go
│   │           │   ├── syscall_linux_loong64.go
│   │           │   ├── syscall_linux_mips64x.go
│   │           │   ├── syscall_linux_mipsx.go
│   │           │   ├── syscall_linux_ppc.go
│   │           │   ├── syscall_linux_ppc64x.go
│   │           │   ├── syscall_linux_riscv64.go
│   │           │   ├── syscall_linux_s390x.go
│   │           │   ├── syscall_linux_sparc64.go
│   │           │   ├── syscall_netbsd.go
│   │           │   ├── syscall_netbsd_386.go
│   │           │   ├── syscall_netbsd_amd64.go
│   │           │   ├── syscall_netbsd_arm.go
│   │           │   ├── syscall_netbsd_arm64.go
│   │           │   ├── syscall_openbsd.go
│   │           │   ├── syscall_openbsd_386.go
│   │           │   ├── syscall_openbsd_amd64.go
│   │           │   ├── syscall_openbsd_arm.go
│   │           │   ├── syscall_openbsd_arm64.go
│   │           │   ├── syscall_openbsd_libc.go
│   │           │   ├── syscall_openbsd_mips64.go
│   │           │   ├── syscall_openbsd_ppc64.go
│   │           │   ├── syscall_openbsd_riscv64.go
│   │           │   ├── syscall_solaris.go
│   │           │   ├── syscall_solaris_amd64.go
│   │           │   ├── syscall_unix.go
│   │           │   ├── syscall_unix_gc.go
│   │           │   ├── syscall_unix_gc_ppc64x.go
│   │           │   ├── syscall_zos_s390x.go
│   │           │   ├── sysvshm_linux.go
│   │           │   ├── sysvshm_unix.go
│   │           │   ├── sysvshm_unix_other.go
│   │           │   ├── timestruct.go
│   │           │   ├── unveil_openbsd.go
│   │           │   ├── xattr_bsd.go
│   │           │   ├── zerrors_aix_ppc.go
│   │           │   ├── zerrors_aix_ppc64.go
│   │           │   ├── zerrors_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── zerrors_linux.go
│   │           │   ├── zerrors_linux_386.go
│   │           │   ├── zerrors_linux_amd64.go
│   │           │   ├── zerrors_linux_arm.go
│   │           │   ├── zerrors_linux_arm64.go
│   │           │   ├── zerrors_linux_loong64.go
│   │           │   ├── zerrors_linux_mips.go
│   │           │   ├── zerrors_linux_mips64.go
│   │           │   ├── zerrors_linux_mips64le.go
│   │           │   ├── zerrors_linux_mipsle.go
│   │           │   ├── zerrors_linux_ppc.go
│   │           │   ├── zerrors_linux_ppc64.go
│   │           │   ├── zerrors_linux_ppc64le.go
│   │           │   ├── zerrors_linux_riscv64.go
│   │           │   ├── zerrors_linux_s390x.go
│   │           │   ├── zerrors_linux_sparc64.go
│   │           │   ├── zerrors_netbsd_386.go
│   │           │   ├── zerrors_netbsd_amd64.go
│   │           │   ├── zerrors_netbsd_arm.go
│   │           │   ├── zerrors_netbsd_arm64.go
│   │           │   ├── zerrors_openbsd_386.go
│   │           │   ├── zerrors_openbsd_amd64.go
│   │           │   ├── zerrors_openbsd_arm.go
│   │           │   ├── zerrors_openbsd_arm64.go
│   │           │   ├── zerrors_openbsd_mips64.go
│   │           │   ├── zerrors_openbsd_ppc64.go
│   │           │   ├── zerrors_openbsd_riscv64.go
│   │           │   ├── zerrors_solaris_amd64.go
│   │           │   ├── zerrors_zos_s390x.go
│   │           │   ├── zptrace_armnn_linux.go
│   │           │   ├── zptrace_linux_arm64.go
│   │           │   ├── zptrace_mipsnn_linux.go
│   │           │   ├── zptrace_mipsnnle_linux.go
│   │           │   ├── zptrace_x86_linux.go
│   │           │   ├── zsyscall_aix_ppc.go
│   │           │   ├── zsyscall_aix_ppc64.go
│   │           │   ├── zsyscall_aix_ppc64_gc.go
│   │           │   ├── zsyscall_aix_ppc64_gccgo.go
│   │           │   ├── zsyscall_darwin_amd64.go
│   │           │   ├── zsyscall_darwin_amd64.s
│   │           │   ├── zsyscall_darwin_arm64.go
│   │           │   ├── zsyscall_darwin_arm64.s
│   │           │   ├── zsyscall_dragonfly_amd64.go
│   │           │   ├── zsyscall_freebsd_386.go
│   │           │   ├── zsyscall_freebsd_amd64.go
│   │           │   ├── zsyscall_freebsd_arm.go
│   │           │   ├── zsyscall_freebsd_arm64.go
│   │           │   ├── zsyscall_freebsd_riscv64.go
│   │           │   ├── zsyscall_illumos_amd64.go
│   │           │   ├── zsyscall_linux.go
│   │           │   ├── zsyscall_linux_386.go
│   │           │   ├── zsyscall_linux_amd64.go
│   │           │   ├── zsyscall_linux_arm.go
│   │           │   ├── zsyscall_linux_arm64.go
│   │           │   ├── zsyscall_linux_loong64.go
│   │           │   ├── zsyscall_linux_mips.go
│   │           │   ├── zsyscall_linux_mips64.go
│   │           │   ├── zsyscall_linux_mips64le.go
│   │           │   ├── zsyscall_linux_mipsle.go
│   │           │   ├── zsyscall_linux_ppc.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_386.s
│   │           │   ├── zsyscall_openbsd_amd64.go
│   │           │   ├── zsyscall_openbsd_amd64.s
│   │           │   ├── zsyscall_openbsd_arm.go
│   │           │   ├── zsyscall_openbsd_arm.s
│   │           │   ├── zsyscall_openbsd_arm64.go
│   │           │   ├── zsyscall_openbsd_arm64.s
│   │           │   ├── zsyscall_openbsd_mips64.go
│   │           │   ├── zsyscall_openbsd_mips64.s
│   │           │   ├── zsyscall_openbsd_ppc64.go
│   │           │   ├── zsyscall_openbsd_ppc64.s
│   │           │   ├── zsyscall_openbsd_riscv64.go
│   │           │   ├── zsyscall_openbsd_riscv64.s
│   │           │   ├── zsyscall_solaris_amd64.go
│   │           │   ├── zsyscall_zos_s390x.go
│   │           │   ├── zsysctl_openbsd_386.go
│   │           │   ├── zsysctl_openbsd_amd64.go
│   │           │   ├── zsysctl_openbsd_arm.go
│   │           │   ├── zsysctl_openbsd_arm64.go
│   │           │   ├── zsysctl_openbsd_mips64.go
│   │           │   ├── zsysctl_openbsd_ppc64.go
│   │           │   ├── zsysctl_openbsd_riscv64.go
│   │           │   ├── zsysnum_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── zsysnum_linux_386.go
│   │           │   ├── zsysnum_linux_amd64.go
│   │           │   ├── zsysnum_linux_arm.go
│   │           │   ├── zsysnum_linux_arm64.go
│   │           │   ├── zsysnum_linux_loong64.go
│   │           │   ├── zsysnum_linux_mips.go
│   │           │   ├── zsysnum_linux_mips64.go
│   │           │   ├── zsysnum_linux_mips64le.go
│   │           │   ├── zsysnum_linux_mipsle.go
│   │           │   ├── zsysnum_linux_ppc.go
│   │           │   ├── zsysnum_linux_ppc64.go
│   │           │   ├── zsysnum_linux_ppc64le.go
│   │           │   ├── zsysnum_linux_riscv64.go
│   │           │   ├── zsysnum_linux_s390x.go
│   │           │   ├── zsysnum_linux_sparc64.go
│   │           │   ├── zsysnum_netbsd_386.go
│   │           │   ├── zsysnum_netbsd_amd64.go
│   │           │   ├── zsysnum_netbsd_arm.go
│   │           │   ├── zsysnum_netbsd_arm64.go
│   │           │   ├── zsysnum_openbsd_386.go
│   │           │   ├── zsysnum_openbsd_amd64.go
│   │           │   ├── zsysnum_openbsd_arm.go
│   │           │   ├── zsysnum_openbsd_arm64.go
│   │           │   ├── zsysnum_openbsd_mips64.go
│   │           │   ├── zsysnum_openbsd_ppc64.go
│   │           │   ├── zsysnum_openbsd_riscv64.go
│   │           │   ├── zsysnum_zos_s390x.go
│   │           │   ├── ztypes_aix_ppc.go
│   │           │   ├── ztypes_aix_ppc64.go
│   │           │   ├── ztypes_darwin_amd64.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_freebsd_riscv64.go
│   │           │   ├── ztypes_linux.go
│   │           │   ├── ztypes_linux_386.go
│   │           │   ├── ztypes_linux_amd64.go
│   │           │   ├── ztypes_linux_arm.go
│   │           │   ├── ztypes_linux_arm64.go
│   │           │   ├── ztypes_linux_loong64.go
│   │           │   ├── ztypes_linux_mips.go
│   │           │   ├── ztypes_linux_mips64.go
│   │           │   ├── ztypes_linux_mips64le.go
│   │           │   ├── ztypes_linux_mipsle.go
│   │           │   ├── ztypes_linux_ppc.go
│   │           │   ├── ztypes_linux_ppc64.go
│   │           │   ├── ztypes_linux_ppc64le.go
│   │           │   ├── ztypes_linux_riscv64.go
│   │           │   ├── ztypes_linux_s390x.go
│   │           │   ├── ztypes_linux_sparc64.go
│   │           │   ├── ztypes_netbsd_386.go
│   │           │   ├── ztypes_netbsd_amd64.go
│   │           │   ├── ztypes_netbsd_arm.go
│   │           │   ├── ztypes_netbsd_arm64.go
│   │           │   ├── ztypes_openbsd_386.go
│   │           │   ├── ztypes_openbsd_amd64.go
│   │           │   ├── ztypes_openbsd_arm.go
│   │           │   ├── ztypes_openbsd_arm64.go
│   │           │   ├── ztypes_openbsd_mips64.go
│   │           │   ├── ztypes_openbsd_ppc64.go
│   │           │   ├── ztypes_openbsd_riscv64.go
│   │           │   ├── ztypes_solaris_amd64.go
│   │           │   └── ztypes_zos_s390x.go
│   │           └── windows/
│   │               ├── aliases.go
│   │               ├── dll_windows.go
│   │               ├── empty.s
│   │               ├── env_windows.go
│   │               ├── eventlog.go
│   │               ├── exec_windows.go
│   │               ├── memory_windows.go
│   │               ├── mkerrors.bash
│   │               ├── mkknownfolderids.bash
│   │               ├── mksyscall.go
│   │               ├── race.go
│   │               ├── race0.go
│   │               ├── security_windows.go
│   │               ├── service.go
│   │               ├── setupapi_windows.go
│   │               ├── str.go
│   │               ├── syscall.go
│   │               ├── syscall_windows.go
│   │               ├── types_windows.go
│   │               ├── types_windows_386.go
│   │               ├── types_windows_amd64.go
│   │               ├── types_windows_arm.go
│   │               ├── types_windows_arm64.go
│   │               ├── zerrors_windows.go
│   │               ├── zknownfolderids_windows.go
│   │               └── zsyscall_windows.go
│   ├── gopkg.in/
│   │   └── yaml.v2/
│   │       ├── .travis.yml
│   │       ├── LICENSE
│   │       ├── LICENSE.libyaml
│   │       ├── NOTICE
│   │       ├── README.md
│   │       ├── apic.go
│   │       ├── decode.go
│   │       ├── emitterc.go
│   │       ├── encode.go
│   │       ├── parserc.go
│   │       ├── readerc.go
│   │       ├── resolve.go
│   │       ├── scannerc.go
│   │       ├── sorter.go
│   │       ├── writerc.go
│   │       ├── yaml.go
│   │       ├── yamlh.go
│   │       └── yamlprivateh.go
│   └── modules.txt
├── webhook.go
└── webhook_test.go
Download .txt
Showing preview only (8,065K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (95543 symbols across 447 files)

FILE: droppriv_nope.go
  function dropPrivileges (line 10) | func dropPrivileges(uid, gid int) error {

FILE: droppriv_unix.go
  function dropPrivileges (line 9) | func dropPrivileges(uid, gid int) error {

FILE: internal/hook/hook.go
  constant SourceHeader (line 34) | SourceHeader         string = "header"
  constant SourceQuery (line 35) | SourceQuery          string = "url"
  constant SourceQueryAlias (line 36) | SourceQueryAlias     string = "query"
  constant SourcePayload (line 37) | SourcePayload        string = "payload"
  constant SourceRawRequestBody (line 38) | SourceRawRequestBody string = "raw-request-body"
  constant SourceRequest (line 39) | SourceRequest        string = "request"
  constant SourceString (line 40) | SourceString         string = "string"
  constant SourceEntirePayload (line 41) | SourceEntirePayload  string = "entire-payload"
  constant SourceEntireQuery (line 42) | SourceEntireQuery    string = "entire-query"
  constant SourceEntireHeaders (line 43) | SourceEntireHeaders  string = "entire-headers"
  constant EnvNamespace (line 49) | EnvNamespace string = "HOOK_"
  type ParameterNodeError (line 53) | type ParameterNodeError struct
    method Error (line 57) | func (e *ParameterNodeError) Error() string {
  function IsParameterNodeError (line 65) | func IsParameterNodeError(err error) bool {
  type SignatureError (line 75) | type SignatureError struct
    method Error (line 82) | func (e *SignatureError) Error() string {
  function IsSignatureError (line 100) | func IsSignatureError(err error) bool {
  type ArgumentError (line 110) | type ArgumentError struct
    method Error (line 114) | func (e *ArgumentError) Error() string {
  type SourceError (line 122) | type SourceError struct
    method Error (line 126) | func (e *SourceError) Error() string {
  type ParseError (line 134) | type ParseError struct
    method Error (line 138) | func (e *ParseError) Error() string {
  function ExtractCommaSeparatedValues (line 146) | func ExtractCommaSeparatedValues(source, prefix string) []string {
  function ExtractSignatures (line 159) | func ExtractSignatures(source, prefix string) []string {
  function ValidateMAC (line 175) | func ValidateMAC(payload []byte, mac hash.Hash, signatures []string) (st...
  function CheckPayloadSignature (line 199) | func CheckPayloadSignature(payload []byte, secret, signature string) (st...
  function CheckPayloadSignature256 (line 212) | func CheckPayloadSignature256(payload []byte, secret, signature string) ...
  function CheckPayloadSignature512 (line 225) | func CheckPayloadSignature512(payload []byte, secret, signature string) ...
  function CheckScalrSignature (line 237) | func CheckScalrSignature(r *Request, signingKey string, checkDate bool) ...
  function CheckIPWhitelist (line 283) | func CheckIPWhitelist(remoteAddr, ipRange string) (bool, error) {
  function ReplaceParameter (line 322) | func ReplaceParameter(s string, params, value interface{}) bool {
  function GetParameter (line 358) | func GetParameter(s string, params interface{}) (interface{}, error) {
  function ExtractParameterAsString (line 414) | func ExtractParameterAsString(s string, params interface{}) (string, err...
  type Argument (line 436) | type Argument struct
    method Get (line 445) | func (ha *Argument) Get(r *Request) (string, error) {
  type Header (line 513) | type Header struct
  type ResponseHeaders (line 519) | type ResponseHeaders
    method String (line 521) | func (h *ResponseHeaders) String() string {
    method Set (line 537) | func (h *ResponseHeaders) Set(value string) error {
  type HooksFiles (line 549) | type HooksFiles
    method String (line 551) | func (h *HooksFiles) String() string {
    method Set (line 560) | func (h *HooksFiles) Set(value string) error {
  type Hook (line 566) | type Hook struct
    method ParseJSONParameters (line 588) | func (h *Hook) ParseJSONParameters(r *Request) []error {
    method ExtractCommandArguments (line 641) | func (h *Hook) ExtractCommandArguments(r *Request) ([]string, []error) {
    method ExtractCommandArgumentsForEnv (line 668) | func (h *Hook) ExtractCommandArgumentsForEnv(r *Request) ([]string, []...
    method ExtractCommandArgumentsForFile (line 704) | func (h *Hook) ExtractCommandArgumentsForFile(r *Request) ([]FileParam...
  type FileParameter (line 695) | type FileParameter struct
  type Hooks (line 742) | type Hooks
    method LoadFromFile (line 747) | func (h *Hooks) LoadFromFile(path string, asTemplate bool) error {
    method Append (line 785) | func (h *Hooks) Append(other *Hooks) error {
    method Match (line 799) | func (h *Hooks) Match(id string) *Hook {
  type Rules (line 810) | type Rules struct
    method Evaluate (line 819) | func (r Rules) Evaluate(req *Request) (bool, error) {
  type AndRule (line 835) | type AndRule
    method Evaluate (line 838) | func (r AndRule) Evaluate(req *Request) (bool, error) {
  type OrRule (line 857) | type OrRule
    method Evaluate (line 860) | func (r OrRule) Evaluate(req *Request) (bool, error) {
  type NotRule (line 883) | type NotRule
    method Evaluate (line 886) | func (r NotRule) Evaluate(req *Request) (bool, error) {
  type MatchRule (line 892) | type MatchRule struct
    method Evaluate (line 916) | func (r MatchRule) Evaluate(req *Request) (bool, error) {
  constant MatchValue (line 903) | MatchValue      string = "value"
  constant MatchRegex (line 904) | MatchRegex      string = "regex"
  constant MatchHMACSHA1 (line 905) | MatchHMACSHA1   string = "payload-hmac-sha1"
  constant MatchHMACSHA256 (line 906) | MatchHMACSHA256 string = "payload-hmac-sha256"
  constant MatchHMACSHA512 (line 907) | MatchHMACSHA512 string = "payload-hmac-sha512"
  constant MatchHashSHA1 (line 908) | MatchHashSHA1   string = "payload-hash-sha1"
  constant MatchHashSHA256 (line 909) | MatchHashSHA256 string = "payload-hash-sha256"
  constant MatchHashSHA512 (line 910) | MatchHashSHA512 string = "payload-hash-sha512"
  constant IPWhitelist (line 911) | IPWhitelist     string = "ip-whitelist"
  constant ScalrSignature (line 912) | ScalrSignature  string = "scalr-signature"
  function compare (line 955) | func compare(a, b string) bool {
  function getenv (line 960) | func getenv(s string) string {
  function cat (line 966) | func cat(s string) string {
  function credential (line 977) | func credential(s string) string {

FILE: internal/hook/hook_test.go
  function TestGetParameter (line 11) | func TestGetParameter(t *testing.T) {
  function TestCheckPayloadSignature (line 63) | func TestCheckPayloadSignature(t *testing.T) {
  function TestCheckPayloadSignature256 (line 95) | func TestCheckPayloadSignature256(t *testing.T) {
  function TestCheckPayloadSignature512 (line 124) | func TestCheckPayloadSignature512(t *testing.T) {
  function TestCheckScalrSignature (line 177) | func TestCheckScalrSignature(t *testing.T) {
  function TestCheckIPWhitelist (line 210) | func TestCheckIPWhitelist(t *testing.T) {
  function TestExtractParameter (line 246) | func TestExtractParameter(t *testing.T) {
  function TestArgumentGet (line 275) | func TestArgumentGet(t *testing.T) {
  function TestHookParseJSONParameters (line 307) | func TestHookParseJSONParameters(t *testing.T) {
  function TestHookExtractCommandArguments (line 334) | func TestHookExtractCommandArguments(t *testing.T) {
  function TestHookExtractCommandArgumentsForEnv (line 400) | func TestHookExtractCommandArgumentsForEnv(t *testing.T) {
  function TestHooksLoadFromFile (line 429) | func TestHooksLoadFromFile(t *testing.T) {
  function TestHooksTemplateLoadFromFile (line 442) | func TestHooksTemplateLoadFromFile(t *testing.T) {
  function TestHooksMatch (line 474) | func TestHooksMatch(t *testing.T) {
  function TestMatchRule (line 525) | func TestMatchRule(t *testing.T) {
  function TestAndRule (line 609) | func TestAndRule(t *testing.T) {
  function TestOrRule (line 674) | func TestOrRule(t *testing.T) {
  function TestNotRule (line 701) | func TestNotRule(t *testing.T) {
  function TestCompare (line 716) | func TestCompare(t *testing.T) {

FILE: internal/hook/request.go
  type Request (line 15) | type Request struct
    method ParseJSONPayload (line 41) | func (r *Request) ParseJSONPayload() error {
    method ParseHeaders (line 73) | func (r *Request) ParseHeaders(headers map[string][]string) {
    method ParseQuery (line 83) | func (r *Request) ParseQuery(query map[string][]string) {
    method ParseFormPayload (line 93) | func (r *Request) ParseFormPayload() error {
    method ParseXMLPayload (line 110) | func (r *Request) ParseXMLPayload() error {

FILE: internal/middleware/dumper.go
  type responseDupper (line 19) | type responseDupper struct
    method Write (line 88) | func (r *responseDupper) Write(b []byte) (int, error) {
    method WriteHeader (line 94) | func (r *responseDupper) WriteHeader(s int) {
    method Hijack (line 100) | func (r *responseDupper) Hijack() (net.Conn, *bufio.ReadWriter, error) {
  function Dumper (line 28) | func Dumper(w io.Writer) func(http.Handler) http.Handler {

FILE: internal/middleware/logger.go
  type Logger (line 15) | type Logger struct
    method NewLogEntry (line 25) | func (l *Logger) NewLogEntry(r *http.Request) middleware.LogEntry {
  function NewLogger (line 20) | func NewLogger() func(next http.Handler) http.Handler {
  type LogEntry (line 35) | type LogEntry struct
    method Write (line 42) | func (l *LogEntry) Write(status, totalBytes int, header http.Header, e...
    method Panic (line 54) | func (l *LogEntry) Panic(v interface{}, stack []byte) {

FILE: internal/middleware/request_id.go
  type ctxKeyRequestID (line 14) | type ctxKeyRequestID
  constant RequestIDKey (line 17) | RequestIDKey ctxKeyRequestID = 0
  function RequestID (line 21) | func RequestID(options ...RequestIDOption) func(http.Handler) http.Handl...
  function GetReqID (line 49) | func GetReqID(ctx context.Context) string {
  function UseXRequestIDHeaderOption (line 59) | func UseXRequestIDHeaderOption(f bool) RequestIDOption {
  function XRequestIDLimitOption (line 66) | func XRequestIDLimitOption(limit int) RequestIDOption {
  type RequestIDOption (line 74) | type RequestIDOption
  type RequestIDOptions (line 76) | type RequestIDOptions struct
    method UseRequestID (line 96) | func (o *RequestIDOptions) UseRequestID() bool {
  function newRequestIDOptions (line 88) | func newRequestIDOptions(options ...RequestIDOption) *RequestIDOptions {

FILE: internal/pidfile/mkdirall.go
  function MkdirAll (line 9) | func MkdirAll(path string, perm os.FileMode) error {

FILE: internal/pidfile/mkdirall_windows.go
  function MkdirAll (line 16) | func MkdirAll(path string, _ os.FileMode) error {
  function mkdirall (line 23) | func mkdirall(path string, applyACL bool, sddl string) error {
  function mkdirWithACL (line 89) | func mkdirWithACL(name string, sddl string) error {

FILE: internal/pidfile/pidfile.go
  type PIDFile (line 16) | type PIDFile struct
    method Remove (line 49) | func (file PIDFile) Remove() error {
  function checkPIDFileAlreadyExists (line 20) | func checkPIDFileAlreadyExists(path string) error {
  function New (line 33) | func New(path string) (*PIDFile, error) {

FILE: internal/pidfile/pidfile_darwin.go
  function processExists (line 9) | func processExists(pid int) bool {

FILE: internal/pidfile/pidfile_test.go
  function TestNewAndRemove (line 10) | func TestNewAndRemove(t *testing.T) {
  function TestRemoveInvalidPath (line 32) | func TestRemoveInvalidPath(t *testing.T) {

FILE: internal/pidfile/pidfile_unix.go
  function processExists (line 11) | func processExists(pid int) bool {

FILE: internal/pidfile/pidfile_windows.go
  constant processQueryLimitedInformation (line 8) | processQueryLimitedInformation = 0x1000
  constant stillActive (line 10) | stillActive = 259
  function processExists (line 13) | func processExists(pid int) bool {

FILE: platform_unix.go
  function platformFlags (line 13) | func platformFlags() {
  function trySocketListener (line 19) | func trySocketListener() (net.Listener, error) {

FILE: platform_windows.go
  function platformFlags (line 13) | func platformFlags() {
  function trySocketListener (line 17) | func trySocketListener() (net.Listener, error) {

FILE: signals.go
  function setupSignals (line 14) | func setupSignals() {
  function watchForSignals (line 26) | func watchForSignals() {

FILE: signals_windows.go
  function setupSignals (line 5) | func setupSignals() {

FILE: test/hookecho.go
  function main (line 12) | func main() {

FILE: testutils.go
  function prepareTestSocket (line 15) | func prepareTestSocket(_ string) (socketPath string, transport *http.Tra...

FILE: testutils_windows.go
  function prepareTestSocket (line 13) | func prepareTestSocket(hookTmpl string) (socketPath string, transport *h...

FILE: tls.go
  function writeTLSSupportedCipherStrings (line 10) | func writeTLSSupportedCipherStrings(w io.Writer, min uint16) error {
  function getTLSMinVersion (line 34) | func getTLSMinVersion(v string) uint16 {
  function getTLSCipherSuites (line 52) | func getTLSCipherSuites(v string) []uint16 {

FILE: vendor/github.com/Microsoft/go-winio/backup.go
  constant BackupData (line 23) | BackupData = uint32(iota + 1)
  constant BackupEaData (line 24) | BackupEaData
  constant BackupSecurity (line 25) | BackupSecurity
  constant BackupAlternateData (line 26) | BackupAlternateData
  constant BackupLink (line 27) | BackupLink
  constant BackupPropertyData (line 28) | BackupPropertyData
  constant BackupObjectId (line 29) | BackupObjectId
  constant BackupReparseData (line 30) | BackupReparseData
  constant BackupSparseBlock (line 31) | BackupSparseBlock
  constant BackupTxfsData (line 32) | BackupTxfsData
  constant StreamSparseAttributes (line 36) | StreamSparseAttributes = uint32(8)
  constant WRITE_DAC (line 41) | WRITE_DAC              = windows.WRITE_DAC
  constant WRITE_OWNER (line 42) | WRITE_OWNER            = windows.WRITE_OWNER
  constant ACCESS_SYSTEM_SECURITY (line 43) | ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY
  type BackupHeader (line 47) | type BackupHeader struct
  type win32StreamID (line 56) | type win32StreamID struct
  type BackupStreamReader (line 65) | type BackupStreamReader struct
    method Next (line 77) | func (r *BackupStreamReader) Next() (*BackupHeader, error) {
    method Read (line 120) | func (r *BackupStreamReader) Read(b []byte) (int, error) {
  function NewBackupStreamReader (line 71) | func NewBackupStreamReader(r io.Reader) *BackupStreamReader {
  type BackupStreamWriter (line 138) | type BackupStreamWriter struct
    method WriteHeader (line 149) | func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error {
    method Write (line 182) | func (w *BackupStreamWriter) Write(b []byte) (int, error) {
  function NewBackupStreamWriter (line 144) | func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter {
  type BackupFileReader (line 192) | type BackupFileReader struct
    method Read (line 206) | func (r *BackupFileReader) Read(b []byte) (int, error) {
    method Close (line 221) | func (r *BackupFileReader) Close() error {
  function NewBackupFileReader (line 200) | func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileRe...
  type BackupFileWriter (line 231) | type BackupFileWriter struct
    method Write (line 245) | func (w *BackupFileWriter) Write(b []byte) (int, error) {
    method Close (line 260) | func (w *BackupFileWriter) Close() error {
  function NewBackupFileWriter (line 239) | func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWr...
  function OpenForBackup (line 273) | func OpenForBackup(path string, access uint32, share uint32, createmode ...

FILE: vendor/github.com/Microsoft/go-winio/ea.go
  type fileFullEaInformation (line 9) | type fileFullEaInformation struct
  type ExtendedAttribute (line 25) | type ExtendedAttribute struct
  function parseEa (line 31) | func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) {
  function DecodeExtendedAttributes (line 60) | func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err er...
  function writeEa (line 73) | func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error {
  function EncodeExtendedAttributes (line 123) | func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) {

FILE: vendor/github.com/Microsoft/go-winio/file.go
  type timeoutError (line 29) | type timeoutError struct
    method Error (line 31) | func (*timeoutError) Error() string   { return "i/o timeout" }
    method Timeout (line 32) | func (*timeoutError) Timeout() bool   { return true }
    method Temporary (line 33) | func (*timeoutError) Temporary() bool { return true }
  type timeoutChan (line 35) | type timeoutChan
  type ioResult (line 41) | type ioResult struct
  type ioOperation (line 47) | type ioOperation struct
  function initIO (line 52) | func initIO() {
  type win32File (line 63) | type win32File struct
    method closeHandle (line 114) | func (f *win32File) closeHandle() {
    method Close (line 131) | func (f *win32File) Close() error {
    method IsClosed (line 137) | func (f *win32File) IsClosed() bool {
    method prepareIO (line 143) | func (f *win32File) prepareIO() (*ioOperation, error) {
    method asyncIO (line 174) | func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes ...
    method Read (line 221) | func (f *win32File) Read(b []byte) (int, error) {
    method Write (line 247) | func (f *win32File) Write(b []byte) (int, error) {
    method SetReadDeadline (line 265) | func (f *win32File) SetReadDeadline(deadline time.Time) error {
    method SetWriteDeadline (line 269) | func (f *win32File) SetWriteDeadline(deadline time.Time) error {
    method Flush (line 273) | func (f *win32File) Flush() error {
    method Fd (line 277) | func (f *win32File) Fd() uintptr {
  type deadlineHandler (line 73) | type deadlineHandler struct
    method set (line 281) | func (d *deadlineHandler) set(deadline time.Time) error {
  function makeWin32File (line 82) | func makeWin32File(h windows.Handle) (*win32File, error) {
  function MakeOpenFile (line 99) | func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) {
  function NewOpenFile (line 103) | func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error) {
  function ioCompletionProcessor (line 157) | func ioCompletionProcessor(h windows.Handle) {

FILE: vendor/github.com/Microsoft/go-winio/fileinfo.go
  type FileBasicInfo (line 15) | type FileBasicInfo struct
  type alignedFileBasicInfo (line 24) | type alignedFileBasicInfo struct
  function GetFileBasicInfo (line 31) | func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) {
  function SetFileBasicInfo (line 48) | func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error {
  type FileStandardInfo (line 67) | type FileStandardInfo struct
  function GetFileStandardInfo (line 74) | func GetFileStandardInfo(f *os.File) (*FileStandardInfo, error) {
  type FileIDInfo (line 88) | type FileIDInfo struct
  function GetFileID (line 94) | func GetFileID(f *os.File) (*FileIDInfo, error) {

FILE: vendor/github.com/Microsoft/go-winio/hvsock.go
  constant afHVSock (line 22) | afHVSock = 34
  function HvsockGUIDWildcard (line 28) | func HvsockGUIDWildcard() guid.GUID { // 00000000-0000-0000-0000-0000000...
  function HvsockGUIDBroadcast (line 33) | func HvsockGUIDBroadcast() guid.GUID { // ffffffff-ffff-ffff-ffff-ffffff...
  function HvsockGUIDLoopback (line 43) | func HvsockGUIDLoopback() guid.GUID { // e0e16197-dd56-4a10-9195-5ee7a15...
  function HvsockGUIDSiloHost (line 55) | func HvsockGUIDSiloHost() guid.GUID { // 36bd0c5c-7276-4223-88ba-7d03b65...
  function HvsockGUIDChildren (line 65) | func HvsockGUIDChildren() guid.GUID { // 90db8b89-0d35-4f79-8ce9-49ea0ac...
  function HvsockGUIDParent (line 80) | func HvsockGUIDParent() guid.GUID { // a42e7cda-d03f-480c-9cc2-a4de20abb878
  function hvsockVsockServiceTemplate (line 90) | func hvsockVsockServiceTemplate() guid.GUID { // 00000000-facb-11e6-bd58...
  type HvsockAddr (line 99) | type HvsockAddr struct
    method Network (line 114) | func (*HvsockAddr) Network() string {
    method String (line 118) | func (addr *HvsockAddr) String() string {
    method raw (line 129) | func (addr *HvsockAddr) raw() rawHvsockAddr {
    method fromRaw (line 137) | func (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) {
  type rawHvsockAddr (line 104) | type rawHvsockAddr struct
    method Sockaddr (line 146) | func (r *rawHvsockAddr) Sockaddr() (unsafe.Pointer, int32, error) {
    method FromBytes (line 151) | func (r *rawHvsockAddr) FromBytes(b []byte) error {
  function VsockServiceID (line 123) | func VsockServiceID(port uint32) guid.GUID {
  type HvsockListener (line 167) | type HvsockListener struct
    method opErr (line 223) | func (l *HvsockListener) opErr(op string, err error) error {
    method Addr (line 228) | func (l *HvsockListener) Addr() net.Addr {
    method Accept (line 233) | func (l *HvsockListener) Accept() (_ net.Conn, err error) {
    method Close (line 284) | func (l *HvsockListener) Close() error {
  type HvsockConn (line 175) | type HvsockConn struct
    method opErr (line 443) | func (conn *HvsockConn) opErr(op string, err error) error {
    method Read (line 451) | func (conn *HvsockConn) Read(b []byte) (int, error) {
    method Write (line 473) | func (conn *HvsockConn) Write(b []byte) (int, error) {
    method write (line 486) | func (conn *HvsockConn) write(b []byte) (int, error) {
    method Close (line 507) | func (conn *HvsockConn) Close() error {
    method IsClosed (line 511) | func (conn *HvsockConn) IsClosed() bool {
    method shutdown (line 516) | func (conn *HvsockConn) shutdown(how int) error {
    method CloseRead (line 534) | func (conn *HvsockConn) CloseRead() error {
    method CloseWrite (line 544) | func (conn *HvsockConn) CloseWrite() error {
    method LocalAddr (line 553) | func (conn *HvsockConn) LocalAddr() net.Addr {
    method RemoteAddr (line 558) | func (conn *HvsockConn) RemoteAddr() net.Addr {
    method SetDeadline (line 563) | func (conn *HvsockConn) SetDeadline(t time.Time) error {
    method SetReadDeadline (line 575) | func (conn *HvsockConn) SetReadDeadline(t time.Time) error {
    method SetWriteDeadline (line 580) | func (conn *HvsockConn) SetWriteDeadline(t time.Time) error {
  function newHVSocket (line 182) | func newHVSocket() (*win32File, error) {
  function ListenHvsock (line 197) | func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) {
  type HvsockDialer (line 289) | type HvsockDialer struct
    method Dial (line 315) | func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (co...
    method redialWait (line 406) | func (d *HvsockDialer) redialWait(ctx context.Context) (err error) {
  function Dial (line 306) | func Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err ...
  function canRedial (line 432) | func canRedial(err error) bool {

FILE: vendor/github.com/Microsoft/go-winio/internal/fs/fs.go
  constant NullHandle (line 16) | NullHandle windows.Handle = 0
  constant FILE_ANY_ACCESS (line 50) | FILE_ANY_ACCESS AccessMask = 0
  constant GENERIC_READ (line 52) | GENERIC_READ           AccessMask = 0x8000_0000
  constant GENERIC_WRITE (line 53) | GENERIC_WRITE          AccessMask = 0x4000_0000
  constant GENERIC_EXECUTE (line 54) | GENERIC_EXECUTE        AccessMask = 0x2000_0000
  constant GENERIC_ALL (line 55) | GENERIC_ALL            AccessMask = 0x1000_0000
  constant ACCESS_SYSTEM_SECURITY (line 56) | ACCESS_SYSTEM_SECURITY AccessMask = 0x0100_0000
  constant FILE_READ_DATA (line 61) | FILE_READ_DATA      AccessMask = (0x0001)
  constant FILE_LIST_DIRECTORY (line 62) | FILE_LIST_DIRECTORY AccessMask = (0x0001)
  constant FILE_WRITE_DATA (line 64) | FILE_WRITE_DATA AccessMask = (0x0002)
  constant FILE_ADD_FILE (line 65) | FILE_ADD_FILE   AccessMask = (0x0002)
  constant FILE_APPEND_DATA (line 67) | FILE_APPEND_DATA          AccessMask = (0x0004)
  constant FILE_ADD_SUBDIRECTORY (line 68) | FILE_ADD_SUBDIRECTORY     AccessMask = (0x0004)
  constant FILE_CREATE_PIPE_INSTANCE (line 69) | FILE_CREATE_PIPE_INSTANCE AccessMask = (0x0004)
  constant FILE_READ_EA (line 71) | FILE_READ_EA         AccessMask = (0x0008)
  constant FILE_READ_PROPERTIES (line 72) | FILE_READ_PROPERTIES AccessMask = FILE_READ_EA
  constant FILE_WRITE_EA (line 74) | FILE_WRITE_EA         AccessMask = (0x0010)
  constant FILE_WRITE_PROPERTIES (line 75) | FILE_WRITE_PROPERTIES AccessMask = FILE_WRITE_EA
  constant FILE_EXECUTE (line 77) | FILE_EXECUTE  AccessMask = (0x0020)
  constant FILE_TRAVERSE (line 78) | FILE_TRAVERSE AccessMask = (0x0020)
  constant FILE_DELETE_CHILD (line 80) | FILE_DELETE_CHILD AccessMask = (0x0040)
  constant FILE_READ_ATTRIBUTES (line 82) | FILE_READ_ATTRIBUTES AccessMask = (0x0080)
  constant FILE_WRITE_ATTRIBUTES (line 84) | FILE_WRITE_ATTRIBUTES AccessMask = (0x0100)
  constant FILE_ALL_ACCESS (line 86) | FILE_ALL_ACCESS      AccessMask = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZ...
  constant FILE_GENERIC_READ (line 87) | FILE_GENERIC_READ    AccessMask = (STANDARD_RIGHTS_READ | FILE_READ_DATA...
  constant FILE_GENERIC_WRITE (line 88) | FILE_GENERIC_WRITE   AccessMask = (STANDARD_RIGHTS_WRITE | FILE_WRITE_DA...
  constant FILE_GENERIC_EXECUTE (line 89) | FILE_GENERIC_EXECUTE AccessMask = (STANDARD_RIGHTS_EXECUTE | FILE_READ_A...
  constant SPECIFIC_RIGHTS_ALL (line 91) | SPECIFIC_RIGHTS_ALL AccessMask = 0x0000FFFF
  constant DELETE (line 96) | DELETE       AccessMask = 0x0001_0000
  constant READ_CONTROL (line 97) | READ_CONTROL AccessMask = 0x0002_0000
  constant WRITE_DAC (line 98) | WRITE_DAC    AccessMask = 0x0004_0000
  constant WRITE_OWNER (line 99) | WRITE_OWNER  AccessMask = 0x0008_0000
  constant SYNCHRONIZE (line 100) | SYNCHRONIZE  AccessMask = 0x0010_0000
  constant STANDARD_RIGHTS_REQUIRED (line 102) | STANDARD_RIGHTS_REQUIRED AccessMask = 0x000F_0000
  constant STANDARD_RIGHTS_READ (line 104) | STANDARD_RIGHTS_READ    AccessMask = READ_CONTROL
  constant STANDARD_RIGHTS_WRITE (line 105) | STANDARD_RIGHTS_WRITE   AccessMask = READ_CONTROL
  constant STANDARD_RIGHTS_EXECUTE (line 106) | STANDARD_RIGHTS_EXECUTE AccessMask = READ_CONTROL
  constant STANDARD_RIGHTS_ALL (line 108) | STANDARD_RIGHTS_ALL AccessMask = 0x001F_0000
  type FileShareMode (line 111) | type FileShareMode
  constant FILE_SHARE_NONE (line 115) | FILE_SHARE_NONE        FileShareMode = 0x00
  constant FILE_SHARE_READ (line 116) | FILE_SHARE_READ        FileShareMode = 0x01
  constant FILE_SHARE_WRITE (line 117) | FILE_SHARE_WRITE       FileShareMode = 0x02
  constant FILE_SHARE_DELETE (line 118) | FILE_SHARE_DELETE      FileShareMode = 0x04
  constant FILE_SHARE_VALID_FLAGS (line 119) | FILE_SHARE_VALID_FLAGS FileShareMode = 0x07
  type FileCreationDisposition (line 122) | type FileCreationDisposition
  constant CREATE_NEW (line 128) | CREATE_NEW        FileCreationDisposition = 0x01
  constant CREATE_ALWAYS (line 129) | CREATE_ALWAYS     FileCreationDisposition = 0x02
  constant OPEN_EXISTING (line 130) | OPEN_EXISTING     FileCreationDisposition = 0x03
  constant OPEN_ALWAYS (line 131) | OPEN_ALWAYS       FileCreationDisposition = 0x04
  constant TRUNCATE_EXISTING (line 132) | TRUNCATE_EXISTING FileCreationDisposition = 0x05
  type NTFileCreationDisposition (line 136) | type NTFileCreationDisposition
  constant FILE_SUPERSEDE (line 142) | FILE_SUPERSEDE           NTFileCreationDisposition = 0x00
  constant FILE_OPEN (line 143) | FILE_OPEN                NTFileCreationDisposition = 0x01
  constant FILE_CREATE (line 144) | FILE_CREATE              NTFileCreationDisposition = 0x02
  constant FILE_OPEN_IF (line 145) | FILE_OPEN_IF             NTFileCreationDisposition = 0x03
  constant FILE_OVERWRITE (line 146) | FILE_OVERWRITE           NTFileCreationDisposition = 0x04
  constant FILE_OVERWRITE_IF (line 147) | FILE_OVERWRITE_IF        NTFileCreationDisposition = 0x05
  constant FILE_MAXIMUM_DISPOSITION (line 148) | FILE_MAXIMUM_DISPOSITION NTFileCreationDisposition = 0x05
  type FileFlagOrAttribute (line 155) | type FileFlagOrAttribute
  constant FILE_FLAG_WRITE_THROUGH (line 161) | FILE_FLAG_WRITE_THROUGH       FileFlagOrAttribute = 0x8000_0000
  constant FILE_FLAG_OVERLAPPED (line 162) | FILE_FLAG_OVERLAPPED          FileFlagOrAttribute = 0x4000_0000
  constant FILE_FLAG_NO_BUFFERING (line 163) | FILE_FLAG_NO_BUFFERING        FileFlagOrAttribute = 0x2000_0000
  constant FILE_FLAG_RANDOM_ACCESS (line 164) | FILE_FLAG_RANDOM_ACCESS       FileFlagOrAttribute = 0x1000_0000
  constant FILE_FLAG_SEQUENTIAL_SCAN (line 165) | FILE_FLAG_SEQUENTIAL_SCAN     FileFlagOrAttribute = 0x0800_0000
  constant FILE_FLAG_DELETE_ON_CLOSE (line 166) | FILE_FLAG_DELETE_ON_CLOSE     FileFlagOrAttribute = 0x0400_0000
  constant FILE_FLAG_BACKUP_SEMANTICS (line 167) | FILE_FLAG_BACKUP_SEMANTICS    FileFlagOrAttribute = 0x0200_0000
  constant FILE_FLAG_POSIX_SEMANTICS (line 168) | FILE_FLAG_POSIX_SEMANTICS     FileFlagOrAttribute = 0x0100_0000
  constant FILE_FLAG_OPEN_REPARSE_POINT (line 169) | FILE_FLAG_OPEN_REPARSE_POINT  FileFlagOrAttribute = 0x0020_0000
  constant FILE_FLAG_OPEN_NO_RECALL (line 170) | FILE_FLAG_OPEN_NO_RECALL      FileFlagOrAttribute = 0x0010_0000
  constant FILE_FLAG_FIRST_PIPE_INSTANCE (line 171) | FILE_FLAG_FIRST_PIPE_INSTANCE FileFlagOrAttribute = 0x0008_0000
  type NTCreateOptions (line 179) | type NTCreateOptions
  constant FILE_DIRECTORY_FILE (line 185) | FILE_DIRECTORY_FILE            NTCreateOptions = 0x0000_0001
  constant FILE_WRITE_THROUGH (line 186) | FILE_WRITE_THROUGH             NTCreateOptions = 0x0000_0002
  constant FILE_SEQUENTIAL_ONLY (line 187) | FILE_SEQUENTIAL_ONLY           NTCreateOptions = 0x0000_0004
  constant FILE_NO_INTERMEDIATE_BUFFERING (line 188) | FILE_NO_INTERMEDIATE_BUFFERING NTCreateOptions = 0x0000_0008
  constant FILE_SYNCHRONOUS_IO_ALERT (line 190) | FILE_SYNCHRONOUS_IO_ALERT    NTCreateOptions = 0x0000_0010
  constant FILE_SYNCHRONOUS_IO_NONALERT (line 191) | FILE_SYNCHRONOUS_IO_NONALERT NTCreateOptions = 0x0000_0020
  constant FILE_NON_DIRECTORY_FILE (line 192) | FILE_NON_DIRECTORY_FILE      NTCreateOptions = 0x0000_0040
  constant FILE_CREATE_TREE_CONNECTION (line 193) | FILE_CREATE_TREE_CONNECTION  NTCreateOptions = 0x0000_0080
  constant FILE_COMPLETE_IF_OPLOCKED (line 195) | FILE_COMPLETE_IF_OPLOCKED NTCreateOptions = 0x0000_0100
  constant FILE_NO_EA_KNOWLEDGE (line 196) | FILE_NO_EA_KNOWLEDGE      NTCreateOptions = 0x0000_0200
  constant FILE_DISABLE_TUNNELING (line 197) | FILE_DISABLE_TUNNELING    NTCreateOptions = 0x0000_0400
  constant FILE_RANDOM_ACCESS (line 198) | FILE_RANDOM_ACCESS        NTCreateOptions = 0x0000_0800
  constant FILE_DELETE_ON_CLOSE (line 200) | FILE_DELETE_ON_CLOSE        NTCreateOptions = 0x0000_1000
  constant FILE_OPEN_BY_FILE_ID (line 201) | FILE_OPEN_BY_FILE_ID        NTCreateOptions = 0x0000_2000
  constant FILE_OPEN_FOR_BACKUP_INTENT (line 202) | FILE_OPEN_FOR_BACKUP_INTENT NTCreateOptions = 0x0000_4000
  constant FILE_NO_COMPRESSION (line 203) | FILE_NO_COMPRESSION         NTCreateOptions = 0x0000_8000
  constant SECURITY_ANONYMOUS (line 212) | SECURITY_ANONYMOUS      FileSQSFlag = FileSQSFlag(SecurityAnonymous << 16)
  constant SECURITY_IDENTIFICATION (line 213) | SECURITY_IDENTIFICATION FileSQSFlag = FileSQSFlag(SecurityIdentification...
  constant SECURITY_IMPERSONATION (line 214) | SECURITY_IMPERSONATION  FileSQSFlag = FileSQSFlag(SecurityImpersonation ...
  constant SECURITY_DELEGATION (line 215) | SECURITY_DELEGATION     FileSQSFlag = FileSQSFlag(SecurityDelegation << 16)
  constant SECURITY_SQOS_PRESENT (line 217) | SECURITY_SQOS_PRESENT     FileSQSFlag = 0x0010_0000
  constant SECURITY_VALID_SQOS_FLAGS (line 218) | SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F_0000
  type GetFinalPathFlag (line 224) | type GetFinalPathFlag
  constant GetFinalPathDefaultFlag (line 228) | GetFinalPathDefaultFlag GetFinalPathFlag = 0x0
  constant FILE_NAME_NORMALIZED (line 230) | FILE_NAME_NORMALIZED GetFinalPathFlag = 0x0
  constant FILE_NAME_OPENED (line 231) | FILE_NAME_OPENED     GetFinalPathFlag = 0x8
  constant VOLUME_NAME_DOS (line 233) | VOLUME_NAME_DOS  GetFinalPathFlag = 0x0
  constant VOLUME_NAME_GUID (line 234) | VOLUME_NAME_GUID GetFinalPathFlag = 0x1
  constant VOLUME_NAME_NT (line 235) | VOLUME_NAME_NT   GetFinalPathFlag = 0x2
  constant VOLUME_NAME_NONE (line 236) | VOLUME_NAME_NONE GetFinalPathFlag = 0x4
  function GetFinalPathNameByHandle (line 244) | func GetFinalPathNameByHandle(h windows.Handle, flags GetFinalPathFlag) ...

FILE: vendor/github.com/Microsoft/go-winio/internal/fs/security.go
  type SecurityImpersonationLevel (line 4) | type SecurityImpersonationLevel
  constant SecurityAnonymous (line 8) | SecurityAnonymous      SecurityImpersonationLevel = 0
  constant SecurityIdentification (line 9) | SecurityIdentification SecurityImpersonationLevel = 1
  constant SecurityImpersonation (line 10) | SecurityImpersonation  SecurityImpersonationLevel = 2
  constant SecurityDelegation (line 11) | SecurityDelegation     SecurityImpersonationLevel = 3

FILE: vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go
  constant errnoERROR_IO_PENDING (line 19) | errnoERROR_IO_PENDING = 997
  function errnoErr (line 29) | func errnoErr(e syscall.Errno) error {
  function CreateFile (line 45) | func CreateFile(name string, access AccessMask, mode FileShareMode, sa *...
  function _CreateFile (line 54) | func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa...

FILE: vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go
  type RawSockaddr (line 13) | type RawSockaddr interface

FILE: vendor/github.com/Microsoft/go-winio/internal/socket/socket.go
  constant socketError (line 23) | socketError = uintptr(^uint32(0))
  function GetSockName (line 38) | func GetSockName(s windows.Handle, rsa RawSockaddr) error {
  function GetPeerName (line 52) | func GetPeerName(s windows.Handle, rsa RawSockaddr) error {
  function Bind (line 61) | func Bind(s windows.Handle, rsa RawSockaddr) (err error) {
  type runtimeFunc (line 79) | type runtimeFunc struct
    method Load (line 86) | func (f *runtimeFunc) Load() error {
  function ConnectEx (line 122) | func ConnectEx(
  function connectEx (line 150) | func connectEx(

FILE: vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go
  constant errnoERROR_IO_PENDING (line 19) | errnoERROR_IO_PENDING = 997
  function errnoErr (line 29) | func errnoErr(e syscall.Errno) error {
  function bind (line 47) | func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err err...
  function getpeername (line 55) | func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) ...
  function getsockname (line 63) | func getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) ...

FILE: vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go
  constant MinWStringCap (line 13) | MinWStringCap = 310
  function newBuffer (line 25) | func newBuffer() []uint16 { return *(pathPool.Get().(*[]uint16)) }
  function freeBuffer (line 29) | func freeBuffer(b []uint16) { pathPool.Put(&b) }
  type WString (line 36) | type WString struct
    method Free (line 54) | func (b *WString) Free() {
    method ResizeTo (line 64) | func (b *WString) ResizeTo(c uint32) uint32 {
    method Buffer (line 88) | func (b *WString) Buffer() []uint16 {
    method Pointer (line 97) | func (b *WString) Pointer() *uint16 {
    method String (line 107) | func (b *WString) String() string {
    method Cap (line 124) | func (b *WString) Cap() uint32 {
    method cap (line 131) | func (b *WString) cap() uint32 { return uint32(cap(b.b)) }
    method empty (line 132) | func (b *WString) empty() bool { return b == nil || b.cap() == 0 }
  function NewWString (line 48) | func NewWString() *WString {

FILE: vendor/github.com/Microsoft/go-winio/pipe.go
  type PipeConn (line 32) | type PipeConn interface
  type ioStatusBlock (line 46) | type ioStatusBlock struct
  type objectAttributes (line 60) | type objectAttributes struct
  type unicodeString (line 69) | type unicodeString struct
  type securityDescriptor (line 86) | type securityDescriptor struct
  type ntStatus (line 96) | type ntStatus
    method Err (line 98) | func (status ntStatus) Err() error {
  type win32Pipe (line 112) | type win32Pipe struct
    method LocalAddr (line 127) | func (f *win32Pipe) LocalAddr() net.Addr {
    method RemoteAddr (line 131) | func (f *win32Pipe) RemoteAddr() net.Addr {
    method SetDeadline (line 135) | func (f *win32Pipe) SetDeadline(t time.Time) error {
    method Disconnect (line 142) | func (f *win32Pipe) Disconnect() error {
  type win32MessageBytePipe (line 119) | type win32MessageBytePipe struct
    method CloseWrite (line 147) | func (f *win32MessageBytePipe) CloseWrite() error {
    method Write (line 165) | func (f *win32MessageBytePipe) Write(b []byte) (int, error) {
    method Read (line 177) | func (f *win32MessageBytePipe) Read(b []byte) (int, error) {
  type pipeAddress (line 125) | type pipeAddress
    method Network (line 198) | func (pipeAddress) Network() string {
    method String (line 202) | func (s pipeAddress) String() string {
  function tryDialPipe (line 207) | func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask...
  function DialPipe (line 237) | func DialPipe(path string, timeout *time.Duration) (net.Conn, error) {
  function DialPipeContext (line 255) | func DialPipeContext(ctx context.Context, path string) (net.Conn, error) {
  type PipeImpLevel (line 261) | type PipeImpLevel
  constant PipeImpLevelAnonymous (line 264) | PipeImpLevelAnonymous      = PipeImpLevel(fs.SECURITY_ANONYMOUS)
  constant PipeImpLevelIdentification (line 265) | PipeImpLevelIdentification = PipeImpLevel(fs.SECURITY_IDENTIFICATION)
  constant PipeImpLevelImpersonation (line 266) | PipeImpLevelImpersonation  = PipeImpLevel(fs.SECURITY_IMPERSONATION)
  constant PipeImpLevelDelegation (line 267) | PipeImpLevelDelegation     = PipeImpLevel(fs.SECURITY_DELEGATION)
  function DialPipeAccess (line 272) | func DialPipeAccess(ctx context.Context, path string, access uint32) (ne...
  function DialPipeAccessImpLevel (line 279) | func DialPipeAccessImpLevel(ctx context.Context, path string, access uin...
  type acceptResponse (line 309) | type acceptResponse struct
  type win32PipeListener (line 314) | type win32PipeListener struct
    method makeServerPipe (line 416) | func (l *win32PipeListener) makeServerPipe() (*win32File, error) {
    method makeConnectedServerPipe (line 429) | func (l *win32PipeListener) makeConnectedServerPipe() (*win32File, err...
    method listenerRoutine (line 459) | func (l *win32PipeListener) listenerRoutine() {
    method Accept (line 555) | func (l *win32PipeListener) Accept() (net.Conn, error) {
    method Close (line 575) | func (l *win32PipeListener) Close() error {
    method Addr (line 584) | func (l *win32PipeListener) Addr() net.Addr {
  function makeServerPipeHandle (line 323) | func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first b...
  type PipeConfig (line 489) | type PipeConfig struct
  function ListenPipe (line 510) | func ListenPipe(path string, c *PipeConfig) (net.Listener, error) {
  function connectPipe (line 540) | func connectPipe(p *win32File) error {

FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go
  type Variant (line 21) | type Variant
  constant VariantUnknown (line 27) | VariantUnknown Variant = iota
  constant VariantNCS (line 28) | VariantNCS
  constant VariantRFC4122 (line 29) | VariantRFC4122
  constant VariantMicrosoft (line 30) | VariantMicrosoft
  constant VariantFuture (line 31) | VariantFuture
  type Version (line 37) | type Version
    method String (line 39) | func (v Version) String() string {
  function NewV4 (line 47) | func NewV4() (GUID, error) {
  function NewV5 (line 67) | func NewV5(namespace GUID, name []byte) (GUID, error) {
  function fromArray (line 83) | func fromArray(b [16]byte, order binary.ByteOrder) GUID {
  method toArray (line 92) | func (g GUID) toArray(order binary.ByteOrder) [16]byte {
  function FromArray (line 102) | func FromArray(b [16]byte) GUID {
  method ToArray (line 108) | func (g GUID) ToArray() [16]byte {
  function FromWindowsArray (line 113) | func FromWindowsArray(b [16]byte) GUID {
  method ToWindowsArray (line 119) | func (g GUID) ToWindowsArray() [16]byte {
  method String (line 123) | func (g GUID) String() string {
  function FromString (line 136) | func FromString(s string) (GUID, error) {
  method setVariant (line 175) | func (g *GUID) setVariant(v Variant) {
  method Variant (line 195) | func (g GUID) Variant() Variant {
  method setVersion (line 209) | func (g *GUID) setVersion(v Version) {
  method Version (line 214) | func (g GUID) Version() Version {
  method MarshalText (line 219) | func (g GUID) MarshalText() ([]byte, error) {
  method UnmarshalText (line 225) | func (g *GUID) UnmarshalText(text []byte) error {

FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go
  type GUID (line 11) | type GUID struct

FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go
  type GUID (line 13) | type GUID

FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go
  function _ (line 7) | func _() {
  constant _Variant_name (line 18) | _Variant_name = "UnknownNCSRFC 4122MicrosoftFuture"
  method String (line 22) | func (i Variant) String() string {

FILE: vendor/github.com/Microsoft/go-winio/privilege.go
  constant SE_PRIVILEGE_ENABLED (line 28) | SE_PRIVILEGE_ENABLED = windows.SE_PRIVILEGE_ENABLED
  constant ERROR_NOT_ALL_ASSIGNED (line 31) | ERROR_NOT_ALL_ASSIGNED windows.Errno = windows.ERROR_NOT_ALL_ASSIGNED
  constant SeBackupPrivilege (line 33) | SeBackupPrivilege   = "SeBackupPrivilege"
  constant SeRestorePrivilege (line 34) | SeRestorePrivilege  = "SeRestorePrivilege"
  constant SeSecurityPrivilege (line 35) | SeSecurityPrivilege = "SeSecurityPrivilege"
  type PrivilegeError (line 44) | type PrivilegeError struct
    method Error (line 48) | func (e *PrivilegeError) Error() string {
  function RunWithPrivilege (line 65) | func RunWithPrivilege(name string, fn func() error) error {
  function RunWithPrivileges (line 70) | func RunWithPrivileges(names []string, fn func() error) error {
  function mapPrivileges (line 89) | func mapPrivileges(names []string) ([]uint64, error) {
  function EnableProcessPrivileges (line 108) | func EnableProcessPrivileges(names []string) error {
  function DisableProcessPrivileges (line 113) | func DisableProcessPrivileges(names []string) error {
  function enableDisableProcessPrivilege (line 117) | func enableDisableProcessPrivilege(names []string, action uint32) error {
  function adjustPrivileges (line 134) | func adjustPrivileges(token windows.Token, privileges []uint64, action u...
  function getPrivilegeName (line 153) | func getPrivilegeName(luid uint64) string {
  function newThreadToken (line 172) | func newThreadToken() (windows.Token, error) {
  function releaseThreadToken (line 190) | func releaseThreadToken(h windows.Token) {

FILE: vendor/github.com/Microsoft/go-winio/reparse.go
  constant reparseTagMountPoint (line 16) | reparseTagMountPoint = 0xA0000003
  constant reparseTagSymlink (line 17) | reparseTagSymlink    = 0xA000000C
  type reparseDataBuffer (line 20) | type reparseDataBuffer struct
  type ReparsePoint (line 31) | type ReparsePoint struct
  type UnsupportedReparsePointError (line 38) | type UnsupportedReparsePointError struct
    method Error (line 42) | func (e *UnsupportedReparsePointError) Error() string {
  function DecodeReparsePoint (line 48) | func DecodeReparsePoint(b []byte) (*ReparsePoint, error) {
  function DecodeReparsePointData (line 53) | func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) {
  function isDriveLetter (line 75) | func isDriveLetter(c byte) bool {
  function EncodeReparsePoint (line 81) | func EncodeReparsePoint(rp *ReparsePoint) []byte {

FILE: vendor/github.com/Microsoft/go-winio/sd.go
  type AccountLookupError (line 19) | type AccountLookupError struct
    method Error (line 24) | func (e *AccountLookupError) Error() string {
    method Unwrap (line 40) | func (e *AccountLookupError) Unwrap() error { return e.Err }
  type SddlConversionError (line 42) | type SddlConversionError struct
    method Error (line 47) | func (e *SddlConversionError) Error() string {
    method Unwrap (line 51) | func (e *SddlConversionError) Unwrap() error { return e.Err }
  function LookupSidByName (line 56) | func LookupSidByName(name string) (sid string, err error) {
  function LookupNameBySid (line 85) | func LookupNameBySid(sid string) (name string, err error) {
  function SddlToSecurityDescriptor (line 118) | func SddlToSecurityDescriptor(sddl string) ([]byte, error) {
  function SecurityDescriptorToSddl (line 127) | func SecurityDescriptorToSddl(sd []byte) (string, error) {

FILE: vendor/github.com/Microsoft/go-winio/zsyscall_windows.go
  constant errnoERROR_IO_PENDING (line 19) | errnoERROR_IO_PENDING = 997
  function errnoErr (line 29) | func errnoErr(e syscall.Errno) error {
  function adjustTokenPrivileges (line 75) | func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *...
  function convertSidToStringSid (line 88) | func convertSidToStringSid(sid *byte, str **uint16) (err error) {
  function convertStringSidToSid (line 96) | func convertStringSidToSid(str *uint16, sid **byte) (err error) {
  function impersonateSelf (line 104) | func impersonateSelf(level uint32) (err error) {
  function lookupAccountName (line 112) | func lookupAccountName(systemName *uint16, accountName string, sid *byte...
  function _lookupAccountName (line 121) | func _lookupAccountName(systemName *uint16, accountName *uint16, sid *by...
  function lookupAccountSid (line 129) | func lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameS...
  function lookupPrivilegeDisplayName (line 137) | func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer ...
  function _lookupPrivilegeDisplayName (line 146) | func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffe...
  function lookupPrivilegeName (line 154) | func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16...
  function _lookupPrivilegeName (line 163) | func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint...
  function lookupPrivilegeValue (line 171) | func lookupPrivilegeValue(systemName string, name string, luid *uint64) ...
  function _lookupPrivilegeValue (line 185) | func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint6...
  function openThreadToken (line 193) | func openThreadToken(thread windows.Handle, accessMask uint32, openAsSel...
  function revertToSelf (line 205) | func revertToSelf() (err error) {
  function backupRead (line 213) | func backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort boo...
  function backupWrite (line 233) | func backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort...
  function cancelIoEx (line 253) | func cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) {
  function connectNamedPipe (line 261) | func connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err e...
  function createIoCompletionPort (line 269) | func createIoCompletionPort(file windows.Handle, port windows.Handle, ke...
  function createNamedPipe (line 278) | func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInst...
  function _createNamedPipe (line 287) | func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxIn...
  function disconnectNamedPipe (line 296) | func disconnectNamedPipe(pipe windows.Handle) (err error) {
  function getCurrentThread (line 304) | func getCurrentThread() (h windows.Handle) {
  function getNamedPipeHandleState (line 310) | func getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInst...
  function getNamedPipeInfo (line 318) | func getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint3...
  function getQueuedCompletionStatus (line 326) | func getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *...
  function setFileCompletionNotificationModes (line 334) | func setFileCompletionNotificationModes(h windows.Handle, flags uint8) (...
  function ntCreateNamedPipeFile (line 342) | func ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa...
  function rtlDefaultNpAcl (line 348) | func rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) {
  function rtlDosPathNameToNtPathName (line 354) | func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, fil...
  function rtlNtStatusToDosError (line 360) | func rtlNtStatusToDosError(status ntStatus) (winerr error) {
  function wsaGetOverlappedResult (line 368) | func wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, byt...

FILE: vendor/github.com/clbanning/mxj/v2/anyxml.go
  constant DefaultElementTag (line 10) | DefaultElementTag = "element"
  function AnyXml (line 59) | func AnyXml(v interface{}, tags ...string) ([]byte, error) {
  function AnyXmlIndent (line 128) | func AnyXmlIndent(v interface{}, prefix, indent string, tags ...string) ...

FILE: vendor/github.com/clbanning/mxj/v2/escapechars.go
  function XMLEscapeChars (line 30) | func XMLEscapeChars(b ...bool) {
  function escapeChars (line 54) | func escapeChars(s string) string {
  function XMLEscapeCharsDecoder (line 84) | func XMLEscapeCharsDecoder(b ...bool) {

FILE: vendor/github.com/clbanning/mxj/v2/exists.go
  method Exists (line 6) | func (mv Map) Exists(path string, subkeys ...string) (bool, error) {

FILE: vendor/github.com/clbanning/mxj/v2/files.go
  type Maps (line 9) | type Maps
    method JsonString (line 156) | func (mvs Maps) JsonString(safeEncoding ...bool) (string, error) {
    method JsonStringIndent (line 169) | func (mvs Maps) JsonStringIndent(prefix, indent string, safeEncoding ....
    method XmlString (line 188) | func (mvs Maps) XmlString() (string, error) {
    method XmlStringIndent (line 201) | func (mvs Maps) XmlStringIndent(prefix, indent string) (string, error) {
    method JsonFile (line 216) | func (mvs Maps) JsonFile(file string, safeEncoding ...bool) error {
    method JsonFileIndent (line 237) | func (mvs Maps) JsonFileIndent(file, prefix, indent string, safeEncodi...
    method XmlFile (line 258) | func (mvs Maps) XmlFile(file string) error {
    method XmlFileIndent (line 275) | func (mvs Maps) XmlFileIndent(file, prefix, indent string) error {
  function NewMaps (line 11) | func NewMaps() Maps {
  type MapRaw (line 15) | type MapRaw struct
  function NewMapsFromJsonFile (line 21) | func NewMapsFromJsonFile(name string) (Maps, error) {
  function NewMapsFromJsonFileRaw (line 53) | func NewMapsFromJsonFileRaw(name string) ([]MapRaw, error) {
  function NewMapsFromXmlFile (line 86) | func NewMapsFromXmlFile(name string) (Maps, error) {
  function NewMapsFromXmlFileRaw (line 120) | func NewMapsFromXmlFileRaw(name string) ([]MapRaw, error) {

FILE: vendor/github.com/clbanning/mxj/v2/gob.go
  function NewMapGob (line 14) | func NewMapGob(gobj []byte) (Map, error) {
  method Gob (line 28) | func (mv Map) Gob() ([]byte, error) {

FILE: vendor/github.com/clbanning/mxj/v2/json.go
  method Json (line 20) | func (mv Map) Json(safeEncoding ...bool) ([]byte, error) {
  method JsonIndent (line 39) | func (mv Map) JsonIndent(prefix, indent string, safeEncoding ...bool) ([...
  method JsonWriter (line 59) | func (mv Map) JsonWriter(jsonWriter io.Writer, safeEncoding ...bool) err...
  method JsonWriterRaw (line 71) | func (mv Map) JsonWriterRaw(jsonWriter io.Writer, safeEncoding ...bool) ...
  method JsonIndentWriter (line 83) | func (mv Map) JsonIndentWriter(jsonWriter io.Writer, prefix, indent stri...
  method JsonIndentWriterRaw (line 95) | func (mv Map) JsonIndentWriterRaw(jsonWriter io.Writer, prefix, indent s...
  function NewMapJson (line 128) | func NewMapJson(jsonVal []byte) (Map, error) {
  function NewMapJsonReader (line 154) | func NewMapJsonReader(jsonReader io.Reader) (Map, error) {
  function NewMapJsonReaderRaw (line 169) | func NewMapJsonReaderRaw(jsonReader io.Reader) (Map, []byte, error) {
  function getJson (line 182) | func getJson(rdr io.Reader) (*[]byte, error) {
  function HandleJsonReader (line 254) | func HandleJsonReader(jsonReader io.Reader, mapHandler func(Map) bool, e...
  function HandleJsonReaderRaw (line 293) | func HandleJsonReaderRaw(jsonReader io.Reader, mapHandler func(Map, []by...

FILE: vendor/github.com/clbanning/mxj/v2/keyvalues.go
  constant minArraySize (line 19) | minArraySize = 32
  function SetArraySize (line 27) | func SetArraySize(size int) int {
  method ValuesForKey (line 47) | func (mv Map) ValuesForKey(key string, subkeys ...string) ([]interface{}...
  method ValueForKey (line 68) | func (mv Map) ValueForKey(key string, subkeys ...string) (interface{}, e...
  function hasKey (line 81) | func hasKey(iv interface{}, key string, ret *[]interface{}, cnt *int, su...
  method ValuesForPath (line 168) | func (mv Map) ValuesForPath(path string, subkeys ...string) ([]interface...
  function valuesForArray (line 203) | func valuesForArray(keys []*key, m Map) ([]interface{}, error) {
  type key (line 288) | type key struct
  function parsePath (line 294) | func parsePath(s string) ([]*key, error) {
  method oldValuesForPath (line 331) | func (mv Map) oldValuesForPath(path string, subkeys ...string) ([]interf...
  function valuesForKeyPath (line 352) | func valuesForKeyPath(ret *[]interface{}, cnt *int, m interface{}, keys ...
  function hasSubKeys (line 436) | func hasSubKeys(v interface{}, subkeys map[string]interface{}) bool {
  function getSubKeyMap (line 507) | func getSubKeyMap(kv ...string) (map[string]interface{}, error) {
  method PathsForKey (line 552) | func (mv Map) PathsForKey(key string) []string {
  method PathForKeyShortest (line 575) | func (mv Map) PathForKeyShortest(key string) string {
  function hasKeyPath (line 602) | func hasKeyPath(crumbs string, iv interface{}, key string, basket map[st...
  method ValueForPath (line 639) | func (mv Map) ValueForPath(path string) (interface{}, error) {
  method ValueForPathString (line 651) | func (mv Map) ValueForPathString(path string) (string, error) {
  method ValueOrEmptyForPathString (line 665) | func (mv Map) ValueOrEmptyForPathString(path string) string {

FILE: vendor/github.com/clbanning/mxj/v2/leafnode.go
  constant NoAttributes (line 12) | NoAttributes = true
  type LeafNode (line 19) | type LeafNode struct
  method LeafNodes (line 34) | func (mv Map) LeafNodes(no_attr ...bool) []LeafNode {
  function getLeafNodes (line 45) | func getLeafNodes(path, node string, mv interface{}, l *[]LeafNode, noat...
  method LeafPaths (line 78) | func (mv Map) LeafPaths(no_attr ...bool) []string {
  method LeafValues (line 88) | func (mv Map) LeafValues(no_attr ...bool) []interface{} {
  function LeafUseDotNotation (line 106) | func LeafUseDotNotation(b ...bool) {

FILE: vendor/github.com/clbanning/mxj/v2/misc.go
  method Root (line 19) | func (mv Map) Root() (string, error) {
  method Elements (line 33) | func (mv Map) Elements(path string) ([]string, error) {
  method Attributes (line 63) | func (mv Map) Attributes(path string) ([]string, error) {

FILE: vendor/github.com/clbanning/mxj/v2/mxj.go
  constant Cast (line 14) | Cast         = true
  constant SafeEncoding (line 15) | SafeEncoding = true
  type Map (line 18) | type Map
    method Old (line 27) | func (mv Map) Old() map[string]interface{} {
    method Copy (line 39) | func (mv Map) Copy() (Map, error) {
    method StringIndent (line 53) | func (mv Map) StringIndent(offset ...int) string {
    method StringIndentNoTypeInfo (line 58) | func (mv Map) StringIndentNoTypeInfo(offset ...int) string {
  function New (line 21) | func New() Map {
  function writeMap (line 65) | func writeMap(m interface{}, typeInfo, root bool, offset ...int) string {
  type mapList (line 116) | type mapList
    method Len (line 118) | func (ml mapList) Len() int {
    method Swap (line 122) | func (ml mapList) Swap(i, j int) {
    method Less (line 126) | func (ml mapList) Less(i, j int) bool {

FILE: vendor/github.com/clbanning/mxj/v2/newmap.go
  method NewMap (line 38) | func (mv Map) NewMap(keypairs ...string) (Map, error) {
  function addNewVal (line 96) | func addNewVal(n *map[string]interface{}, path []string, val []interface...

FILE: vendor/github.com/clbanning/mxj/v2/remove.go
  method Remove (line 6) | func (mv Map) Remove(path string) error {
  function remove (line 11) | func remove(m interface{}, path string) error {
  function lastKey (line 25) | func lastKey(path string) string {
  function parentPath (line 33) | func parentPath(path string) string {

FILE: vendor/github.com/clbanning/mxj/v2/rename.go
  method RenameKey (line 11) | func (mv Map) RenameKey(path string, newName string) error {
  function renameKey (line 29) | func renameKey(m interface{}, path string, newName string) error {
  function prevValueByPath (line 44) | func prevValueByPath(m interface{}, path string) (map[string]interface{}...

FILE: vendor/github.com/clbanning/mxj/v2/set.go
  method SetValueForPath (line 8) | func (mv Map) SetValueForPath(value interface{}, path string) error {

FILE: vendor/github.com/clbanning/mxj/v2/setfieldsep.go
  function SetFieldSeparator (line 14) | func SetFieldSeparator(s ...string) {

FILE: vendor/github.com/clbanning/mxj/v2/strict.go
  function useCustomDecoder (line 23) | func useCustomDecoder(d *xml.Decoder) {

FILE: vendor/github.com/clbanning/mxj/v2/struct.go
  function NewMapStruct (line 28) | func NewMapStruct(structVal interface{}) (Map, error) {
  method Struct (line 41) | func (mv Map) Struct(structPtr interface{}) error {

FILE: vendor/github.com/clbanning/mxj/v2/updatevalues.go
  method UpdateValuesForPath (line 35) | func (mv Map) UpdateValuesForPath(newVal interface{}, path string, subke...
  function updateValuesForKeyPath (line 103) | func updateValuesForKeyPath(key string, value interface{}, m interface{}...
  function updateValue (line 152) | func updateValue(key string, value interface{}, m interface{}, keys0 str...

FILE: vendor/github.com/clbanning/mxj/v2/xml.go
  function SetGlobalKeyMapPrefix (line 38) | func SetGlobalKeyMapPrefix(s string) {
  function NewMapXml (line 85) | func NewMapXml(xmlVal []byte, cast ...bool) (Map, error) {
  function NewMapXmlReader (line 100) | func NewMapXmlReader(xmlReader io.Reader, cast ...bool) (Map, error) {
  function NewMapXmlReaderRaw (line 130) | func NewMapXmlReaderRaw(xmlReader io.Reader, cast ...bool) (Map, []byte,...
  function xmlReaderToMap (line 153) | func xmlReaderToMap(rdr io.Reader, r bool) (map[string]interface{}, erro...
  function xmlToMap (line 165) | func xmlToMap(doc []byte, r bool) (map[string]interface{}, error) {
  function PrependAttrWithHyphen (line 183) | func PrependAttrWithHyphen(v bool) {
  function IncludeTagSeqNum (line 236) | func IncludeTagSeqNum(b ...bool) {
  function CoerceKeysToLower (line 255) | func CoerceKeysToLower(b ...bool) {
  function DisableTrimWhiteSpace (line 269) | func DisableTrimWhiteSpace(b ...bool) {
  function SetAttrPrefix (line 293) | func SetAttrPrefix(s string) {
  function CoerceKeysToSnakeCase (line 305) | func CoerceKeysToSnakeCase(b ...bool) {
  function CastValuesToInt (line 320) | func CastValuesToInt(b ...bool) {
  function HandleXMPPStreamTag (line 341) | func HandleXMPPStreamTag(b ...bool) {
  function DecodeSimpleValuesAsMap (line 358) | func DecodeSimpleValuesAsMap(b ...bool) {
  function xmlToMapParser (line 369) | func xmlToMapParser(skey string, a []xml.Attr, p *xml.Decoder, r bool) (...
  function CastNanInf (line 541) | func CastNanInf(b ...bool) {
  function cast (line 551) | func cast(s string, r bool, t string) interface{} {
  function CastValuesToFloat (line 606) | func CastValuesToFloat(b ...bool) {
  function CastValuesToBool (line 619) | func CastValuesToBool(b ...bool) {
  function SetCheckTagToSkipFunc (line 637) | func SetCheckTagToSkipFunc(fn func(string) bool) {
  constant DefaultRootTag (line 646) | DefaultRootTag = "doc"
  function XmlGoEmptyElemSyntax (line 655) | func XmlGoEmptyElemSyntax() {
  function XmlDefaultEmptyElemSyntax (line 662) | func XmlDefaultEmptyElemSyntax() {
  function XmlCheckIsValid (line 672) | func XmlCheckIsValid(b ...bool) {
  method Xml (line 696) | func (mv Map) Xml(rootTag ...string) ([]byte, error) {
  method XmlWriter (line 746) | func (mv Map) XmlWriter(xmlWriter io.Writer, rootTag ...string) error {
  method XmlIndentWriter (line 772) | func (mv Map) XmlIndentWriter(xmlWriter io.Writer, prefix, indent string...
  function HandleXmlReader (line 811) | func HandleXmlReader(xmlReader io.Reader, mapHandler func(Map) bool, err...
  function HandleXmlReaderRaw (line 851) | func HandleXmlReaderRaw(xmlReader io.Reader, mapHandler func(Map, []byte...
  type teeReader (line 894) | type teeReader struct
    method Read (line 906) | func (t *teeReader) Read(p []byte) (int, error) {
    method ReadByte (line 910) | func (t *teeReader) ReadByte() (byte, error) {
  function myTeeReader (line 900) | func myTeeReader(r io.Reader, w io.Writer) io.Reader {
  type byteReader (line 921) | type byteReader struct
    method Read (line 933) | func (b *byteReader) Read(p []byte) (int, error) {
    method ReadByte (line 937) | func (b *byteReader) ReadByte() (byte, error) {
  function myByteReader (line 926) | func myByteReader(r io.Reader) io.Reader {
  method XmlIndent (line 953) | func (mv Map) XmlIndent(prefix, indent string, rootTag ...string) ([]byt...
  type pretty (line 992) | type pretty struct
    method Indent (line 1000) | func (p *pretty) Indent() {
    method Outdent (line 1005) | func (p *pretty) Outdent() {
  function marshalMapToXmlIndent (line 1015) | func marshalMapToXmlIndent(doIndent bool, b *bytes.Buffer, key string, v...
  type attrList (line 1414) | type attrList
    method Len (line 1416) | func (a attrList) Len() int {
    method Swap (line 1420) | func (a attrList) Swap(i, j int) {
    method Less (line 1424) | func (a attrList) Less(i, j int) bool {
  type elemList (line 1428) | type elemList
    method Len (line 1430) | func (e elemList) Len() int {
    method Swap (line 1434) | func (e elemList) Swap(i, j int) {
    method Less (line 1438) | func (e elemList) Less(i, j int) bool {

FILE: vendor/github.com/clbanning/mxj/v2/xmlseq.go
  type MapSeq (line 26) | type MapSeq
    method Xml (line 445) | func (mv MapSeq) Xml(rootTag ...string) ([]byte, error) {
    method XmlWriter (line 495) | func (mv MapSeq) XmlWriter(xmlWriter io.Writer, rootTag ...string) err...
    method XmlIndentWriter (line 521) | func (mv MapSeq) XmlIndentWriter(xmlWriter io.Writer, prefix, indent s...
    method XmlIndent (line 551) | func (mv MapSeq) XmlIndent(prefix, indent string, rootTag ...string) (...
  function NewMapXmlSeq (line 87) | func NewMapXmlSeq(xmlVal []byte, cast ...bool) (MapSeq, error) {
  function NewMapFormattedXmlSeq (line 103) | func NewMapFormattedXmlSeq(xmlVal []byte, cast ...bool) (MapSeq, error) {
  function NewMapXmlSeqReader (line 128) | func NewMapXmlSeqReader(xmlReader io.Reader, cast ...bool) (MapSeq, erro...
  function NewMapXmlSeqReaderRaw (line 163) | func NewMapXmlSeqReaderRaw(xmlReader io.Reader, cast ...bool) (MapSeq, [...
  function xmlSeqReaderToMap (line 183) | func xmlSeqReaderToMap(rdr io.Reader, r bool) (map[string]interface{}, e...
  function xmlSeqToMap (line 195) | func xmlSeqToMap(doc []byte, r bool) (map[string]interface{}, error) {
  function xmlSeqToMapParser (line 210) | func xmlSeqToMapParser(skey string, a []xml.Attr, p *xml.Decoder, r bool...
  function mapToXmlSeqIndent (line 595) | func mapToXmlSeqIndent(doIndent bool, s *string, key string, value inter...
  type keyval (line 855) | type keyval struct
  type elemListSeq (line 859) | type elemListSeq
    method Len (line 861) | func (e elemListSeq) Len() int {
    method Swap (line 865) | func (e elemListSeq) Swap(i, j int) {
    method Less (line 869) | func (e elemListSeq) Less(i, j int) bool {
  function BeautifyXml (line 896) | func BeautifyXml(b []byte, prefix, indent string) ([]byte, error) {

FILE: vendor/github.com/clbanning/mxj/v2/xmlseq2.go
  method StringIndent (line 10) | func (msv MapSeq) StringIndent(offset ...int) string {
  method StringIndentNoTypeInfo (line 15) | func (msv MapSeq) StringIndentNoTypeInfo(offset ...int) string {

FILE: vendor/github.com/coreos/go-systemd/v22/activation/files_unix.go
  constant listenFdsStart (line 30) | listenFdsStart = 3
  function Files (line 39) | func Files(unsetEnv bool) []*os.File {

FILE: vendor/github.com/coreos/go-systemd/v22/activation/files_windows.go
  function Files (line 19) | func Files(unsetEnv bool) []*os.File {

FILE: vendor/github.com/coreos/go-systemd/v22/activation/listeners.go
  function Listeners (line 28) | func Listeners() ([]net.Listener, error) {
  function ListenersWithNames (line 42) | func ListenersWithNames() (map[string][]net.Listener, error) {
  function TLSListeners (line 63) | func TLSListeners(tlsConfig *tls.Config) ([]net.Listener, error) {
  function TLSListenersWithNames (line 84) | func TLSListenersWithNames(tlsConfig *tls.Config) (map[string][]net.List...

FILE: vendor/github.com/coreos/go-systemd/v22/activation/packetconns.go
  function PacketConns (line 27) | func PacketConns() ([]net.PacketConn, error) {

FILE: vendor/github.com/dustin/go-humanize/big.go
  function oomm (line 8) | func oomm(n, b *big.Int, maxmag int) (float64, int) {
  function oom (line 23) | func oom(n, b *big.Int) (float64, int) {

FILE: vendor/github.com/dustin/go-humanize/bigbytes.go
  function humanateBigBytes (line 112) | func humanateBigBytes(s, base *big.Int, sizes []string) string {
  function BigBytes (line 133) | func BigBytes(s *big.Int) string {
  function BigIBytes (line 143) | func BigIBytes(s *big.Int) string {
  function ParseBigBytes (line 155) | func ParseBigBytes(s string) (*big.Int, error) {

FILE: vendor/github.com/dustin/go-humanize/bytes.go
  constant Byte (line 14) | Byte = 1 << (iota * 10)
  constant KiByte (line 15) | KiByte
  constant MiByte (line 16) | MiByte
  constant GiByte (line 17) | GiByte
  constant TiByte (line 18) | TiByte
  constant PiByte (line 19) | PiByte
  constant EiByte (line 20) | EiByte
  constant IByte (line 25) | IByte = 1
  constant KByte (line 26) | KByte = IByte * 1000
  constant MByte (line 27) | MByte = KByte * 1000
  constant GByte (line 28) | GByte = MByte * 1000
  constant TByte (line 29) | TByte = GByte * 1000
  constant PByte (line 30) | PByte = TByte * 1000
  constant EByte (line 31) | EByte = PByte * 1000
  function logn (line 64) | func logn(n, b float64) float64 {
  function humanateBytes (line 68) | func humanateBytes(s uint64, base float64, sizes []string) string {
  function Bytes (line 88) | func Bytes(s uint64) string {
  function IBytes (line 98) | func IBytes(s uint64) string {
  function ParseBytes (line 110) | func ParseBytes(s string) (uint64, error) {

FILE: vendor/github.com/dustin/go-humanize/comma.go
  function Comma (line 15) | func Comma(v int64) string {
  function Commaf (line 50) | func Commaf(v float64) string {
  function CommafWithDigits (line 83) | func CommafWithDigits(f float64, decimals int) string {
  function BigComma (line 89) | func BigComma(b *big.Int) string {

FILE: vendor/github.com/dustin/go-humanize/commaf.go
  function BigCommaf (line 14) | func BigCommaf(v *big.Float) string {

FILE: vendor/github.com/dustin/go-humanize/ftoa.go
  function stripTrailingZeros (line 8) | func stripTrailingZeros(s string) string {
  function stripTrailingDigits (line 26) | func stripTrailingDigits(s string, digits int) string {
  function Ftoa (line 41) | func Ftoa(num float64) string {
  function FtoaWithDigits (line 47) | func FtoaWithDigits(num float64, digits int) string {

FILE: vendor/github.com/dustin/go-humanize/number.go
  function FormatFloat (line 65) | func FormatFloat(format string, n float64) string {
  function FormatInteger (line 190) | func FormatInteger(format string, n int) string {

FILE: vendor/github.com/dustin/go-humanize/ordinals.go
  function Ordinal (line 8) | func Ordinal(x int) string {

FILE: vendor/github.com/dustin/go-humanize/si.go
  function revfmap (line 37) | func revfmap(in map[float64]string) map[string]float64 {
  function init (line 47) | func init() {
  function ComputeSI (line 64) | func ComputeSI(input float64) (float64, string) {
  function SI (line 95) | func SI(input float64, unit string) string {
  function SIWithDigits (line 105) | func SIWithDigits(input float64, decimals int, unit string) string {
  function ParseSI (line 117) | func ParseSI(input string) (float64, string, error) {

FILE: vendor/github.com/dustin/go-humanize/times.go
  constant Day (line 12) | Day      = 24 * time.Hour
  constant Week (line 13) | Week     = 7 * Day
  constant Month (line 14) | Month    = 30 * Day
  constant Year (line 15) | Year     = 12 * Month
  constant LongTime (line 16) | LongTime = 37 * Year
  function Time (line 22) | func Time(then time.Time) string {
  type RelTimeMagnitude (line 41) | type RelTimeMagnitude struct
  function RelTime (line 74) | func RelTime(a, b time.Time, albl, blbl string) string {
  function CustomRelTime (line 84) | func CustomRelTime(a, b time.Time, albl, blbl string, magnitudes []RelTi...

FILE: vendor/github.com/fsnotify/fsnotify/backend_fen.go
  type Watcher (line 84) | type Watcher struct
    method sendEvent (line 174) | func (w *Watcher) sendEvent(name string, op Op) (sent bool) {
    method sendError (line 185) | func (w *Watcher) sendError(err error) (sent bool) {
    method isClosed (line 194) | func (w *Watcher) isClosed() bool {
    method Close (line 204) | func (w *Watcher) Close() error {
    method Add (line 252) | func (w *Watcher) Add(name string) error { return w.AddWith(name) }
    method AddWith (line 261) | func (w *Watcher) AddWith(name string, opts ...addOpt) error {
    method Remove (line 310) | func (w *Watcher) Remove(name string) error {
    method readEvents (line 349) | func (w *Watcher) readEvents() {
    method handleDirectory (line 395) | func (w *Watcher) handleDirectory(path string, stat os.FileInfo, follo...
    method handleEvent (line 421) | func (w *Watcher) handleEvent(event *unix.PortEvent) error {
    method updateDirectory (line 546) | func (w *Watcher) updateDirectory(path string) error {
    method associateFile (line 578) | func (w *Watcher) associateFile(path string, stat os.FileInfo, follow ...
    method dissociateFile (line 612) | func (w *Watcher) dissociateFile(path string, stat os.FileInfo, unused...
    method WatchList (line 623) | func (w *Watcher) WatchList() []string {
  function NewWatcher (line 141) | func NewWatcher() (*Watcher, error) {
  function NewBufferedWatcher (line 153) | func NewBufferedWatcher(sz uint) (*Watcher, error) {

FILE: vendor/github.com/fsnotify/fsnotify/backend_inotify.go
  type Watcher (line 87) | type Watcher struct
    method sendEvent (line 275) | func (w *Watcher) sendEvent(e Event) bool {
    method sendError (line 285) | func (w *Watcher) sendError(err error) bool {
    method isClosed (line 294) | func (w *Watcher) isClosed() bool {
    method Close (line 304) | func (w *Watcher) Close() error {
    method Add (line 362) | func (w *Watcher) Add(name string) error { return w.AddWith(name) }
    method AddWith (line 371) | func (w *Watcher) AddWith(name string, opts ...addOpt) error {
    method Remove (line 415) | func (w *Watcher) Remove(name string) error {
    method remove (line 422) | func (w *Watcher) remove(name string) error {
    method WatchList (line 449) | func (w *Watcher) WatchList() []string {
    method readEvents (line 466) | func (w *Watcher) readEvents() {
    method newEvent (line 576) | func (w *Watcher) newEvent(name string, mask uint32) Event {
  type watches (line 147) | type watches struct
    method len (line 166) | func (w *watches) len() int {
    method add (line 172) | func (w *watches) add(ww *watch) {
    method remove (line 179) | func (w *watches) remove(wd uint32) {
    method removePath (line 186) | func (w *watches) removePath(path string) (uint32, bool) {
    method byPath (line 201) | func (w *watches) byPath(path string) *watch {
    method byWd (line 207) | func (w *watches) byWd(wd uint32) *watch {
    method updatePath (line 213) | func (w *watches) updatePath(path string, f func(*watch) (*watch, erro...
  type watch (line 152) | type watch struct
  function newWatches (line 159) | func newWatches() *watches {
  function NewWatcher (line 240) | func NewWatcher() (*Watcher, error) {
  function NewBufferedWatcher (line 252) | func NewBufferedWatcher(sz uint) (*Watcher, error) {

FILE: vendor/github.com/fsnotify/fsnotify/backend_kqueue.go
  type Watcher (line 84) | type Watcher struct
    method sendEvent (line 224) | func (w *Watcher) sendEvent(e Event) bool {
    method sendError (line 234) | func (w *Watcher) sendError(err error) bool {
    method Close (line 244) | func (w *Watcher) Close() error {
    method Add (line 305) | func (w *Watcher) Add(name string) error { return w.AddWith(name) }
    method AddWith (line 314) | func (w *Watcher) AddWith(name string, opts ...addOpt) error {
    method Remove (line 332) | func (w *Watcher) Remove(name string) error {
    method remove (line 336) | func (w *Watcher) remove(name string, unwatchFiles bool) error {
    method WatchList (line 398) | func (w *Watcher) WatchList() []string {
    method addWatch (line 420) | func (w *Watcher) addWatch(name string, flags uint32) (string, error) {
    method readEvents (line 537) | func (w *Watcher) readEvents() {
    method newEvent (line 625) | func (w *Watcher) newEvent(name string, mask uint32) Event {
    method watchDirectoryFiles (line 648) | func (w *Watcher) watchDirectoryFiles(dirPath string) error {
    method sendDirectoryChangeEvents (line 689) | func (w *Watcher) sendDirectoryChangeEvents(dir string) error {
    method sendFileCreatedEventIfNew (line 719) | func (w *Watcher) sendFileCreatedEventIfNew(filePath string, fi os.Fil...
    method internalWatch (line 742) | func (w *Watcher) internalWatch(name string, fi os.FileInfo) (string, ...
    method register (line 759) | func (w *Watcher) register(fds []int, flags int, fflags uint32) error {
    method read (line 776) | func (w *Watcher) read(events []unix.Kevent_t) ([]unix.Kevent_t, error) {
  type pathInfo (line 146) | type pathInfo struct
  function NewWatcher (line 152) | func NewWatcher() (*Watcher, error) {
  function NewBufferedWatcher (line 164) | func NewBufferedWatcher(sz uint) (*Watcher, error) {
  function newKqueue (line 194) | func newKqueue() (kq int, closepipe [2]int, err error) {
  constant noteAllEvents (line 414) | noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | ...

FILE: vendor/github.com/fsnotify/fsnotify/backend_other.go
  type Watcher (line 76) | type Watcher struct
    method Close (line 142) | func (w *Watcher) Close() error { return nil }
    method WatchList (line 148) | func (w *Watcher) WatchList() []string { return nil }
    method Add (line 186) | func (w *Watcher) Add(name string) error { return nil }
    method AddWith (line 195) | func (w *Watcher) AddWith(name string, opts ...addOpt) error { return ...
    method Remove (line 205) | func (w *Watcher) Remove(name string) error { return nil }
  function NewWatcher (line 127) | func NewWatcher() (*Watcher, error) {
  function NewBufferedWatcher (line 139) | func NewBufferedWatcher(sz uint) (*Watcher, error) { return NewWatcher() }

FILE: vendor/github.com/fsnotify/fsnotify/backend_windows.go
  type Watcher (line 92) | type Watcher struct
    method isClosed (line 180) | func (w *Watcher) isClosed() bool {
    method sendEvent (line 186) | func (w *Watcher) sendEvent(name string, mask uint64) bool {
    method sendError (line 201) | func (w *Watcher) sendError(err error) bool {
    method Close (line 211) | func (w *Watcher) Close() error {
    method Add (line 265) | func (w *Watcher) Add(name string) error { return w.AddWith(name) }
    method AddWith (line 274) | func (w *Watcher) AddWith(name string, opts ...addOpt) error {
    method Remove (line 306) | func (w *Watcher) Remove(name string) error {
    method WatchList (line 327) | func (w *Watcher) WatchList() []string {
    method newEvent (line 364) | func (w *Watcher) newEvent(name string, mask uint32) Event {
    method wakeupReader (line 420) | func (w *Watcher) wakeupReader() error {
    method getDir (line 428) | func (w *Watcher) getDir(pathname string) (dir string, err error) {
    method getIno (line 442) | func (w *Watcher) getIno(path string) (ino *inode, err error) {
    method addWatch (line 485) | func (w *Watcher) addWatch(pathname string, flags uint64, bufsize int)...
    method remWatch (line 541) | func (w *Watcher) remWatch(pathname string) error {
    method deleteWatch (line 581) | func (w *Watcher) deleteWatch(watch *watch) {
    method startRead (line 597) | func (w *Watcher) startRead(watch *watch) error {
    method readEvents (line 640) | func (w *Watcher) readEvents() {
    method toWindowsFlags (line 802) | func (w *Watcher) toWindowsFlags(mask uint64) uint32 {
    method toFSnotifyFlags (line 813) | func (w *Watcher) toFSnotifyFlags(action uint32) uint64 {
  function NewWatcher (line 151) | func NewWatcher() (*Watcher, error) {
  function NewBufferedWatcher (line 163) | func NewBufferedWatcher(sz uint) (*Watcher, error) {
  constant sysFSALLEVENTS (line 352) | sysFSALLEVENTS  = 0xfff
  constant sysFSCREATE (line 353) | sysFSCREATE     = 0x100
  constant sysFSDELETE (line 354) | sysFSDELETE     = 0x200
  constant sysFSDELETESELF (line 355) | sysFSDELETESELF = 0x400
  constant sysFSMODIFY (line 356) | sysFSMODIFY     = 0x2
  constant sysFSMOVE (line 357) | sysFSMOVE       = 0xc0
  constant sysFSMOVEDFROM (line 358) | sysFSMOVEDFROM  = 0x40
  constant sysFSMOVEDTO (line 359) | sysFSMOVEDTO    = 0x80
  constant sysFSMOVESELF (line 360) | sysFSMOVESELF   = 0x800
  constant sysFSIGNORED (line 361) | sysFSIGNORED    = 0x8000
  constant opAddWatch (line 382) | opAddWatch = iota
  constant opRemoveWatch (line 383) | opRemoveWatch
  constant provisional (line 387) | provisional uint64 = 1 << (32 + iota)
  type input (line 390) | type input struct
  type inode (line 398) | type inode struct
  type watch (line 404) | type watch struct
  type indexMap (line 416) | type indexMap
  type watchMap (line 417) | type watchMap
    method get (line 467) | func (m watchMap) get(ino *inode) *watch {
    method set (line 475) | func (m watchMap) set(ino *inode, watch *watch) {

FILE: vendor/github.com/fsnotify/fsnotify/fsnotify.go
  type Event (line 20) | type Event struct
    method Has (line 99) | func (e Event) Has(op Op) bool { return e.Op.Has(op) }
    method String (line 102) | func (e Event) String() string {
  type Op (line 36) | type Op
    method String (line 72) | func (o Op) String() string {
    method Has (line 96) | func (o Op) Has(h Op) bool { return o&h != 0 }
  constant Create (line 42) | Create Op = 1 << iota
  constant Write (line 46) | Write
  constant Remove (line 51) | Remove
  constant Rename (line 55) | Rename
  constant Chmod (line 62) | Chmod
  type addOpt (line 107) | type addOpt
  type withOpts (line 108) | type withOpts struct
  function getOptions (line 117) | func getOptions(opts ...addOpt) withOpts {
  function WithBufferSize (line 135) | func WithBufferSize(bytes int) addOpt {
  function recursivePath (line 141) | func recursivePath(path string) (string, bool) {

FILE: vendor/github.com/fsnotify/fsnotify/system_bsd.go
  constant openMode (line 8) | openMode = unix.O_NONBLOCK | unix.O_RDONLY | unix.O_CLOEXEC

FILE: vendor/github.com/fsnotify/fsnotify/system_darwin.go
  constant openMode (line 9) | openMode = unix.O_EVTONLY | unix.O_CLOEXEC

FILE: vendor/github.com/ghodss/yaml/fields.go
  function indirect (line 22) | func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, enc...
  type field (line 68) | type field struct
  function fillField (line 80) | func fillField(f field) field {
  type byName (line 89) | type byName
    method Len (line 91) | func (x byName) Len() int { return len(x) }
    method Swap (line 93) | func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
    method Less (line 95) | func (x byName) Less(i, j int) bool {
  type byIndex (line 109) | type byIndex
    method Len (line 111) | func (x byIndex) Len() int { return len(x) }
    method Swap (line 113) | func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
    method Less (line 115) | func (x byIndex) Less(i, j int) bool {
  function typeFields (line 130) | func typeFields(t reflect.Type) []field {
  function dominantField (line 254) | func dominantField(fields []field) (field, bool) {
  function cachedTypeFields (line 292) | func cachedTypeFields(t reflect.Type) []field {
  function isValidTag (line 316) | func isValidTag(s string) bool {
  constant caseMask (line 336) | caseMask     = ^byte(0x20)
  constant kelvin (line 337) | kelvin       = '\u212a'
  constant smallLongEss (line 338) | smallLongEss = '\u017f'
  function foldFunc (line 356) | func foldFunc(s []byte) func(s, t []byte) bool {
  function equalFoldRight (line 384) | func equalFoldRight(s, t []byte) bool {
  function asciiEqualFold (line 432) | func asciiEqualFold(s, t []byte) bool {
  function simpleLetterEqualFold (line 456) | func simpleLetterEqualFold(s, t []byte) bool {
  type tagOptions (line 470) | type tagOptions
    method Contains (line 484) | func (o tagOptions) Contains(optionName string) bool {
  function parseTag (line 474) | func parseTag(tag string) (string, tagOptions) {

FILE: vendor/github.com/ghodss/yaml/yaml.go
  function Marshal (line 15) | func Marshal(o interface{}) ([]byte, error) {
  function Unmarshal (line 30) | func Unmarshal(y []byte, o interface{}) error {
  function JSONToYAML (line 46) | func JSONToYAML(j []byte) ([]byte, error) {
  function YAMLToJSON (line 73) | func YAMLToJSON(y []byte) ([]byte, error) {
  function yamlToJSON (line 77) | func yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) {
  function convertToJSONableObject (line 98) | func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Va...

FILE: vendor/github.com/go-chi/chi/v5/chain.go
  function Chain (line 6) | func Chain(middlewares ...func(http.Handler) http.Handler) Middlewares {
  method Handler (line 12) | func (mws Middlewares) Handler(h http.Handler) http.Handler {
  method HandlerFunc (line 18) | func (mws Middlewares) HandlerFunc(h http.HandlerFunc) http.Handler {
  type ChainHandler (line 24) | type ChainHandler struct
    method ServeHTTP (line 30) | func (c *ChainHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques...
  function chain (line 36) | func chain(middlewares []func(http.Handler) http.Handler, endpoint http....

FILE: vendor/github.com/go-chi/chi/v5/chi.go
  function NewRouter (line 61) | func NewRouter() *Mux {
  type Router (line 67) | type Router interface
  type Routes (line 119) | type Routes interface
  type Middlewares (line 134) | type Middlewares

FILE: vendor/github.com/go-chi/chi/v5/context.go
  function URLParam (line 10) | func URLParam(r *http.Request, key string) string {
  function URLParamFromCtx (line 18) | func URLParamFromCtx(ctx context.Context, key string) string {
  function RouteContext (line 27) | func RouteContext(ctx context.Context) *Context {
  function NewRouteContext (line 33) | func NewRouteContext() *Context {
  type Context (line 45) | type Context struct
    method Reset (line 83) | func (x *Context) Reset() {
    method URLParam (line 101) | func (x *Context) URLParam(key string) string {
    method RoutePattern (line 124) | func (x *Context) RoutePattern() string {
  function replaceWildcards (line 136) | func replaceWildcards(p string) string {
  type RouteParams (line 144) | type RouteParams struct
    method Add (line 149) | func (s *RouteParams) Add(key, value string) {
  type contextKey (line 157) | type contextKey struct
    method String (line 161) | func (k *contextKey) String() string {

FILE: vendor/github.com/go-chi/chi/v5/middleware/basic_auth.go
  function BasicAuth (line 10) | func BasicAuth(realm string, creds map[string]string) func(next http.Han...
  function basicAuthFailed (line 30) | func basicAuthFailed(w http.ResponseWriter, realm string) {

FILE: vendor/github.com/go-chi/chi/v5/middleware/clean_path.go
  function CleanPath (line 12) | func CleanPath(next http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/compress.go
  function Compress (line 41) | func Compress(level int, types ...string) func(next http.Handler) http.H...
  type Compressor (line 47) | type Compressor struct
    method SetEncoder (line 148) | func (c *Compressor) SetEncoder(encoding string, fn EncoderFunc) {
    method Handler (line 190) | func (c *Compressor) Handler(next http.Handler) http.Handler {
    method selectEncoder (line 214) | func (c *Compressor) selectEncoder(h http.Header, w io.Writer) (io.Wri...
  function NewCompressor (line 64) | func NewCompressor(level int, types ...string) *Compressor {
  function matchAcceptEncoding (line 243) | func matchAcceptEncoding(accepted []string, encoding string) bool {
  type EncoderFunc (line 256) | type EncoderFunc
  type ioResetterWriter (line 259) | type ioResetterWriter interface
  type compressResponseWriter (line 264) | type compressResponseWriter struct
    method isCompressible (line 277) | func (cw *compressResponseWriter) isCompressible() bool {
    method WriteHeader (line 296) | func (cw *compressResponseWriter) WriteHeader(code int) {
    method Write (line 324) | func (cw *compressResponseWriter) Write(p []byte) (int, error) {
    method writer (line 332) | func (cw *compressResponseWriter) writer() io.Writer {
    method Flush (line 343) | func (cw *compressResponseWriter) Flush() {
    method Hijack (line 359) | func (cw *compressResponseWriter) Hijack() (net.Conn, *bufio.ReadWrite...
    method Push (line 366) | func (cw *compressResponseWriter) Push(target string, opts *http.PushO...
    method Close (line 373) | func (cw *compressResponseWriter) Close() error {
    method Unwrap (line 380) | func (cw *compressResponseWriter) Unwrap() http.ResponseWriter {
  type compressFlusher (line 339) | type compressFlusher interface
  function encoderGzip (line 384) | func encoderGzip(w io.Writer, level int) io.Writer {
  function encoderDeflate (line 392) | func encoderDeflate(w io.Writer, level int) io.Writer {

FILE: vendor/github.com/go-chi/chi/v5/middleware/content_charset.go
  function ContentCharset (line 10) | func ContentCharset(charsets ...string) func(next http.Handler) http.Han...
  function contentEncoding (line 28) | func contentEncoding(ce string, charsets ...string) bool {
  function split (line 42) | func split(str, sep string) (string, string) {

FILE: vendor/github.com/go-chi/chi/v5/middleware/content_encoding.go
  function AllowContentEncoding (line 10) | func AllowContentEncoding(contentEncoding ...string) func(next http.Hand...

FILE: vendor/github.com/go-chi/chi/v5/middleware/content_type.go
  function SetHeader (line 9) | func SetHeader(key, value string) func(next http.Handler) http.Handler {
  function AllowContentType (line 21) | func AllowContentType(contentTypes ...string) func(next http.Handler) ht...

FILE: vendor/github.com/go-chi/chi/v5/middleware/get_head.go
  function GetHead (line 10) | func GetHead(next http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/heartbeat.go
  function Heartbeat (line 12) | func Heartbeat(endpoint string) func(http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/logger.go
  function Logger (line 39) | func Logger(next http.Handler) http.Handler {
  function RequestLogger (line 44) | func RequestLogger(f LogFormatter) func(next http.Handler) http.Handler {
  type LogFormatter (line 63) | type LogFormatter interface
  type LogEntry (line 69) | type LogEntry interface
  function GetLogEntry (line 75) | func GetLogEntry(r *http.Request) LogEntry {
  function WithLogEntry (line 81) | func WithLogEntry(r *http.Request, entry LogEntry) *http.Request {
  type LoggerInterface (line 87) | type LoggerInterface interface
  type DefaultLogFormatter (line 92) | type DefaultLogFormatter struct
    method NewLogEntry (line 98) | func (l *DefaultLogFormatter) NewLogEntry(r *http.Request) LogEntry {
  type defaultLogEntry (line 127) | type defaultLogEntry struct
    method Write (line 134) | func (l *defaultLogEntry) Write(status, bytes int, header http.Header,...
    method Panic (line 162) | func (l *defaultLogEntry) Panic(v interface{}, stack []byte) {
  function init (line 166) | func init() {

FILE: vendor/github.com/go-chi/chi/v5/middleware/maybe.go
  function Maybe (line 8) | func Maybe(mw func(http.Handler) http.Handler, maybeFn func(r *http.Requ...

FILE: vendor/github.com/go-chi/chi/v5/middleware/middleware.go
  function New (line 6) | func New(h http.Handler) func(next http.Handler) http.Handler {
  type contextKey (line 17) | type contextKey struct
    method String (line 21) | func (k *contextKey) String() string {

FILE: vendor/github.com/go-chi/chi/v5/middleware/nocache.go
  function NoCache (line 40) | func NoCache(h http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/page_route.go
  function PageRoute (line 10) | func PageRoute(path string, handler http.Handler) func(http.Handler) htt...

FILE: vendor/github.com/go-chi/chi/v5/middleware/path_rewrite.go
  function PathRewrite (line 9) | func PathRewrite(old, new string) func(http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/profiler.go
  function Profiler (line 20) | func Profiler() http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/realip.go
  function RealIP (line 31) | func RealIP(h http.Handler) http.Handler {
  function realIP (line 42) | func realIP(r *http.Request) string {

FILE: vendor/github.com/go-chi/chi/v5/middleware/recoverer.go
  function Recoverer (line 22) | func Recoverer(next http.Handler) http.Handler {
  function PrintPrettyStack (line 54) | func PrintPrettyStack(rvr interface{}) {
  type prettyStack (line 66) | type prettyStack struct
    method parse (line 69) | func (s prettyStack) parse(debugStack []byte, rvr interface{}) ([]byte...
    method decorateLine (line 112) | func (s prettyStack) decorateLine(line string, useColor bool, num int)...
    method decorateFuncCallLine (line 126) | func (s prettyStack) decorateFuncCallLine(line string, useColor bool, ...
    method decorateSourceLine (line 166) | func (s prettyStack) decorateSourceLine(line string, useColor bool, nu...

FILE: vendor/github.com/go-chi/chi/v5/middleware/request_id.go
  type ctxKeyRequestID (line 18) | type ctxKeyRequestID
  constant RequestIDKey (line 21) | RequestIDKey ctxKeyRequestID = 0
  function init (line 46) | func init() {
  function RequestID (line 67) | func RequestID(next http.Handler) http.Handler {
  function GetReqID (line 83) | func GetReqID(ctx context.Context) string {
  function NextRequestID (line 94) | func NextRequestID() uint64 {

FILE: vendor/github.com/go-chi/chi/v5/middleware/request_size.go
  function RequestSize (line 9) | func RequestSize(bytes int64) func(http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/route_headers.go
  function RouteHeaders (line 42) | func RouteHeaders() HeaderRouter {
  type HeaderRouter (line 46) | type HeaderRouter
    method Route (line 48) | func (hr HeaderRouter) Route(header, match string, middlewareHandler f...
    method RouteAny (line 58) | func (hr HeaderRouter) RouteAny(header string, match []string, middlew...
    method RouteDefault (line 72) | func (hr HeaderRouter) RouteDefault(handler func(next http.Handler) ht...
    method Handler (line 77) | func (hr HeaderRouter) Handler(next http.Handler) http.Handler {
  type HeaderRoute (line 109) | type HeaderRoute struct
    method IsMatch (line 115) | func (r HeaderRoute) IsMatch(value string) bool {
  type Pattern (line 128) | type Pattern struct
    method Match (line 146) | func (p Pattern) Match(v string) bool {
  function NewPattern (line 134) | func NewPattern(value string) Pattern {

FILE: vendor/github.com/go-chi/chi/v5/middleware/strip.go
  function StripSlashes (line 13) | func StripSlashes(next http.Handler) http.Handler {
  function RedirectSlashes (line 40) | func RedirectSlashes(next http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/sunset.go
  function Sunset (line 11) | func Sunset(sunsetAt time.Time, links ...string) func(http.Handler) http...

FILE: vendor/github.com/go-chi/chi/v5/middleware/supress_notfound.go
  function SupressNotFound (line 15) | func SupressNotFound(router *chi.Mux) func(next http.Handler) http.Handl...

FILE: vendor/github.com/go-chi/chi/v5/middleware/terminal.go
  function init (line 37) | func init() {
  function cW (line 55) | func cW(w io.Writer, useColor bool, color []byte, s string, args ...inte...

FILE: vendor/github.com/go-chi/chi/v5/middleware/throttle.go
  constant errCapacityExceeded (line 10) | errCapacityExceeded = "Server capacity exceeded."
  constant errTimedOut (line 11) | errTimedOut         = "Timed out while waiting for a pending request to ...
  constant errContextCanceled (line 12) | errContextCanceled  = "Context was canceled."
  type ThrottleOpts (line 20) | type ThrottleOpts struct
  function Throttle (line 31) | func Throttle(limit int) func(http.Handler) http.Handler {
  function ThrottleBacklog (line 38) | func ThrottleBacklog(limit, backlogLimit int, backlogTimeout time.Durati...
  function ThrottleWithOpts (line 43) | func ThrottleWithOpts(opts ThrottleOpts) func(http.Handler) http.Handler {
  type token (line 116) | type token struct
  type throttler (line 119) | type throttler struct
    method setRetryAfterHeaderIfNeeded (line 127) | func (t throttler) setRetryAfterHeaderIfNeeded(w http.ResponseWriter, ...

FILE: vendor/github.com/go-chi/chi/v5/middleware/timeout.go
  function Timeout (line 32) | func Timeout(timeout time.Duration) func(next http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/url_format.go
  function URLFormat (line 46) | func URLFormat(next http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/value.go
  function WithValue (line 9) | func WithValue(key, val interface{}) func(next http.Handler) http.Handler {

FILE: vendor/github.com/go-chi/chi/v5/middleware/wrap_writer.go
  function NewWrapResponseWriter (line 15) | func NewWrapResponseWriter(w http.ResponseWriter, protoMajor int) WrapRe...
  type WrapResponseWriter (line 48) | type WrapResponseWriter interface
  type basicWriter (line 68) | type basicWriter struct
    method WriteHeader (line 76) | func (b *basicWriter) WriteHeader(code int) {
    method Write (line 84) | func (b *basicWriter) Write(buf []byte) (int, error) {
    method maybeWriteHeader (line 98) | func (b *basicWriter) maybeWriteHeader() {
    method Status (line 104) | func (b *basicWriter) Status() int {
    method BytesWritten (line 108) | func (b *basicWriter) BytesWritten() int {
    method Tee (line 112) | func (b *basicWriter) Tee(w io.Writer) {
    method Unwrap (line 116) | func (b *basicWriter) Unwrap() http.ResponseWriter {
  type flushWriter (line 121) | type flushWriter struct
    method Flush (line 125) | func (f *flushWriter) Flush() {
  type hijackWriter (line 134) | type hijackWriter struct
    method Hijack (line 138) | func (f *hijackWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
  type flushHijackWriter (line 146) | type flushHijackWriter struct
    method Flush (line 150) | func (f *flushHijackWriter) Flush() {
    method Hijack (line 156) | func (f *flushHijackWriter) Hijack() (net.Conn, *bufio.ReadWriter, err...
  type httpFancyWriter (line 168) | type httpFancyWriter struct
    method Flush (line 172) | func (f *httpFancyWriter) Flush() {
    method Hijack (line 178) | func (f *httpFancyWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
    method ReadFrom (line 187) | func (f *httpFancyWriter) ReadFrom(r io.Reader) (int64, error) {
  type http2FancyWriter (line 209) | type http2FancyWriter struct
    method Push (line 183) | func (f *http2FancyWriter) Push(target string, opts *http.PushOptions)...
    method Flush (line 213) | func (f *http2FancyWriter) Flush() {

FILE: vendor/github.com/go-chi/chi/v5/mux.go
  type Mux (line 21) | type Mux struct
    method ServeHTTP (line 63) | func (mx *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    method Use (line 100) | func (mx *Mux) Use(middlewares ...func(http.Handler) http.Handler) {
    method Handle (line 109) | func (mx *Mux) Handle(pattern string, handler http.Handler) {
    method HandleFunc (line 121) | func (mx *Mux) HandleFunc(pattern string, handlerFn http.HandlerFunc) {
    method Method (line 133) | func (mx *Mux) Method(method, pattern string, handler http.Handler) {
    method MethodFunc (line 143) | func (mx *Mux) MethodFunc(method, pattern string, handlerFn http.Handl...
    method Connect (line 149) | func (mx *Mux) Connect(pattern string, handlerFn http.HandlerFunc) {
    method Delete (line 155) | func (mx *Mux) Delete(pattern string, handlerFn http.HandlerFunc) {
    method Get (line 161) | func (mx *Mux) Get(pattern string, handlerFn http.HandlerFunc) {
    method Head (line 167) | func (mx *Mux) Head(pattern string, handlerFn http.HandlerFunc) {
    method Options (line 173) | func (mx *Mux) Options(pattern string, handlerFn http.HandlerFunc) {
    method Patch (line 179) | func (mx *Mux) Patch(pattern string, handlerFn http.HandlerFunc) {
    method Post (line 185) | func (mx *Mux) Post(pattern string, handlerFn http.HandlerFunc) {
    method Put (line 191) | func (mx *Mux) Put(pattern string, handlerFn http.HandlerFunc) {
    method Trace (line 197) | func (mx *Mux) Trace(pattern string, handlerFn http.HandlerFunc) {
    method NotFound (line 203) | func (mx *Mux) NotFound(handlerFn http.HandlerFunc) {
    method MethodNotAllowed (line 223) | func (mx *Mux) MethodNotAllowed(handlerFn http.HandlerFunc) {
    method With (line 242) | func (mx *Mux) With(middlewares ...func(http.Handler) http.Handler) Ro...
    method Group (line 268) | func (mx *Mux) Group(fn func(r Router)) Router {
    method Route (line 278) | func (mx *Mux) Route(pattern string, fn func(r Router)) Router {
    method Mount (line 295) | func (mx *Mux) Mount(pattern string, handler http.Handler) {
    method Routes (line 350) | func (mx *Mux) Routes() []Route {
    method Middlewares (line 355) | func (mx *Mux) Middlewares() Middlewares {
    method Match (line 365) | func (mx *Mux) Match(rctx *Context, method, path string) bool {
    method NotFoundHandler (line 383) | func (mx *Mux) NotFoundHandler() http.HandlerFunc {
    method MethodNotAllowedHandler (line 392) | func (mx *Mux) MethodNotAllowedHandler(methodsAllowed ...methodTyp) ht...
    method handle (line 401) | func (mx *Mux) handle(method methodTyp, pattern string, handler http.H...
    method routeHTTP (line 426) | func (mx *Mux) routeHTTP(w http.ResponseWriter, r *http.Request) {
    method nextRoutePath (line 469) | func (mx *Mux) nextRoutePath(rctx *Context) string {
    method updateSubRoutes (line 479) | func (mx *Mux) updateSubRoutes(fn func(subMux *Mux)) {
    method updateRouteHandler (line 493) | func (mx *Mux) updateRouteHandler() {
  function NewMux (line 52) | func NewMux() *Mux {
  function methodNotAllowedHandler (line 500) | func methodNotAllowedHandler(methodsAllowed ...methodTyp) func(w http.Re...

FILE: vendor/github.com/go-chi/chi/v5/path_value.go
  constant supportsPathValue (line 11) | supportsPathValue = true
  function setPathValue (line 15) | func setPathValue(rctx *Context, r *http.Request) {

FILE: vendor/github.com/go-chi/chi/v5/path_value_fallback.go
  constant supportsPathValue (line 11) | supportsPathValue = false
  function setPathValue (line 18) | func setPathValue(rctx *Context, r *http.Request) {

FILE: vendor/github.com/go-chi/chi/v5/tree.go
  type methodTyp (line 16) | type methodTyp
  constant mSTUB (line 19) | mSTUB methodTyp = 1 << iota
  constant mCONNECT (line 20) | mCONNECT
  constant mDELETE (line 21) | mDELETE
  constant mGET (line 22) | mGET
  constant mHEAD (line 23) | mHEAD
  constant mOPTIONS (line 24) | mOPTIONS
  constant mPATCH (line 25) | mPATCH
  constant mPOST (line 26) | mPOST
  constant mPUT (line 27) | mPUT
  constant mTRACE (line 28) | mTRACE
  function RegisterMethod (line 60) | func RegisterMethod(method string) {
  type nodeTyp (line 77) | type nodeTyp
  constant ntStatic (line 80) | ntStatic   nodeTyp = iota
  constant ntRegexp (line 81) | ntRegexp
  constant ntParam (line 82) | ntParam
  constant ntCatchAll (line 83) | ntCatchAll
  type node (line 86) | type node struct
    method InsertRoute (line 137) | func (n *node) InsertRoute(method methodTyp, pattern string, handler h...
    method addChild (line 233) | func (n *node) addChild(child *node, prefix string) *node {
    method replaceChild (line 317) | func (n *node) replaceChild(label, tail byte, child *node) {
    method getEdge (line 329) | func (n *node) getEdge(ntyp nodeTyp, label, tail byte, prefix string) ...
    method setEndpoint (line 342) | func (n *node) setEndpoint(method methodTyp, handler http.Handler, pat...
    method FindRoute (line 372) | func (n *node) FindRoute(rctx *Context, method methodTyp, path string)...
    method findRoute (line 399) | func (n *node) findRoute(rctx *Context, method methodTyp, path string)...
    method findEdge (line 546) | func (n *node) findEdge(ntyp nodeTyp, label byte) *node {
    method isLeaf (line 574) | func (n *node) isLeaf() bool {
    method findPattern (line 578) | func (n *node) findPattern(pattern string) bool {
    method routes (line 620) | func (n *node) routes() []Route {
    method walk (line 670) | func (n *node) walk(fn func(eps endpoints, subroutes Routes) bool) bool {
  type endpoints (line 115) | type endpoints
    method Value (line 128) | func (s endpoints) Value(method methodTyp) *endpoint {
  type endpoint (line 117) | type endpoint struct
  function patNextSegment (line 689) | func patNextSegment(pattern string) (nodeTyp, string, string, byte, int,...
  function patParamKeys (line 759) | func patParamKeys(pattern string) []string {
  function longestPrefix (line 779) | func longestPrefix(k1, k2 string) int {
  function methodTypString (line 793) | func methodTypString(method methodTyp) string {
  type nodes (line 802) | type nodes
    method Sort (line 805) | func (ns nodes) Sort()              { sort.Sort(ns); ns.tailSort() }
    method Len (line 806) | func (ns nodes) Len() int           { return len(ns) }
    method Swap (line 807) | func (ns nodes) Swap(i, j int)      { ns[i], ns[j] = ns[j], ns[i] }
    method Less (line 808) | func (ns nodes) Less(i, j int) bool { return ns[i].label < ns[j].label }
    method tailSort (line 812) | func (ns nodes) tailSort() {
    method findEdge (line 821) | func (ns nodes) findEdge(label byte) *node {
  type Route (line 843) | type Route struct
  type WalkFunc (line 850) | type WalkFunc
  function Walk (line 853) | func Walk(r Routes, walkFn WalkFunc) error {
  function walk (line 857) | func walk(r Routes, walkFn WalkFunc, parentRoute string, parentMw ...fun...

FILE: vendor/github.com/gofrs/uuid/v5/codec.go
  function FromBytes (line 31) | func FromBytes(input []byte) (UUID, error) {
  function FromBytesOrNil (line 39) | func FromBytesOrNil(input []byte) UUID {
  function fromHexChar (line 49) | func fromHexChar(c byte) byte {
  method Parse (line 63) | func (u *UUID) Parse(s string) error {
  function FromString (line 115) | func FromString(text string) (UUID, error) {
  function FromStringOrNil (line 123) | func FromStringOrNil(input string) UUID {
  method MarshalText (line 133) | func (u UUID) MarshalText() ([]byte, error) {
  method UnmarshalText (line 172) | func (u *UUID) UnmarshalText(b []byte) error {
  method MarshalBinary (line 221) | func (u UUID) MarshalBinary() ([]byte, error) {
  method UnmarshalBinary (line 227) | func (u *UUID) UnmarshalBinary(data []byte) error {

FILE: vendor/github.com/gofrs/uuid/v5/fuzz.go
  function Fuzz (line 42) | func Fuzz(data []byte) int {

FILE: vendor/github.com/gofrs/uuid/v5/generator.go
  constant epochStart (line 39) | epochStart = 122192928000000000
  type EpochFunc (line 42) | type EpochFunc
  type HWAddrFunc (line 45) | type HWAddrFunc
  function NewV1 (line 51) | func NewV1() (UUID, error) {
  function NewV3 (line 56) | func NewV3(ns UUID, name string) UUID {
  function NewV4 (line 61) | func NewV4() (UUID, error) {
  function NewV5 (line 66) | func NewV5(ns UUID, name string) UUID {
  function NewV6 (line 79) | func NewV6() (UUID, error) {
  function NewV7 (line 91) | func NewV7() (UUID, error) {
  type Generator (line 96) | type Generator interface
  type Gen (line 116) | type Gen struct
    method NewV1 (line 226) | func (g *Gen) NewV1() (UUID, error) {
    method NewV3 (line 251) | func (g *Gen) NewV3(ns UUID, name string) UUID {
    method NewV4 (line 260) | func (g *Gen) NewV4() (UUID, error) {
    method NewV5 (line 272) | func (g *Gen) NewV5(ns UUID, name string) UUID {
    method NewV6 (line 289) | func (g *Gen) NewV6() (UUID, error) {
    method getClockSequence (line 317) | func (g *Gen) getClockSequence(useUnixTSMs bool) (uint64, uint16, erro...
    method NewV7 (line 357) | func (g *Gen) NewV7() (UUID, error) {
    method getHardwareAddr (line 403) | func (g *Gen) getHardwareAddr() ([]byte, error) {
    method getEpoch (line 428) | func (g *Gen) getEpoch() uint64 {
  type GenOption (line 131) | type GenOption
  function NewGen (line 138) | func NewGen() *Gen {
  function NewGenWithHWAF (line 153) | func NewGenWithHWAF(hwaf HWAddrFunc) *Gen {
  function NewGenWithOptions (line 172) | func NewGenWithOptions(opts ...GenOption) *Gen {
  function WithHWAddrFunc (line 189) | func WithHWAddrFunc(hwaf HWAddrFunc) GenOption {
  function WithEpochFunc (line 202) | func WithEpochFunc(epochf EpochFunc) GenOption {
  function WithRandomReader (line 215) | func WithRandomReader(reader io.Reader) GenOption {
  function newFromHash (line 433) | func newFromHash(h hash.Hash, ns UUID, name string) UUID {
  function defaultHWAddrFunc (line 445) | func defaultHWAddrFunc() (net.HardwareAddr, error) {

FILE: vendor/github.com/gofrs/uuid/v5/sql.go
  method Value (line 34) | func (u UUID) Value() (driver.Value, error) {
  method Scan (line 41) | func (u *UUID) Scan(src interface{}) error {
  type NullUUID (line 64) | type NullUUID struct
    method Value (line 70) | func (u NullUUID) Value() (driver.Value, error) {
    method Scan (line 79) | func (u *NullUUID) Scan(src interface{}) error {
    method MarshalJSON (line 93) | func (u NullUUID) MarshalJSON() ([]byte, error) {
    method UnmarshalJSON (line 105) | func (u *NullUUID) UnmarshalJSON(b []byte) error {

FILE: vendor/github.com/gofrs/uuid/v5/uuid.go
  constant Size (line 51) | Size = 16
  type UUID (line 54) | type UUID
    method IsNil (line 147) | func (u UUID) IsNil() bool {
    method Version (line 152) | func (u UUID) Version() byte {
    method Variant (line 157) | func (u UUID) Variant() byte {
    method Bytes (line 173) | func (u UUID) Bytes() []byte {
    method String (line 200) | func (u UUID) String() string {
    method Format (line 215) | func (u UUID) Format(f fmt.State, c rune) {
    method SetVersion (line 255) | func (u *UUID) SetVersion(v byte) {
    method SetVariant (line 260) | func (u *UUID) SetVariant(v byte) {
  constant _ (line 58) | _  byte = iota
  constant V1 (line 59) | V1
  constant _ (line 60) | _
  constant V3 (line 61) | V3
  constant V4 (line 62) | V4
  constant V5 (line 63) | V5
  constant V6 (line 64) | V6
  constant V7 (line 65) | V7
  constant _ (line 66) | _
  constant VariantNCS (line 71) | VariantNCS byte = iota
  constant VariantRFC4122 (line 72) | VariantRFC4122
  constant VariantMicrosoft (line 73) | VariantMicrosoft
  constant VariantFuture (line 74) | VariantFuture
  constant DomainPerson (line 79) | DomainPerson = iota
  constant DomainGroup (line 80) | DomainGroup
  constant DomainOrg (line 81) | DomainOrg
  type Timestamp (line 87) | type Timestamp
    method Time (line 92) | func (t Timestamp) Time() (time.Time, error) {
  constant _100nsPerSecond (line 89) | _100nsPerSecond = 10000000
  function TimestampFromV1 (line 101) | func TimestampFromV1(u UUID) (Timestamp, error) {
  function TimestampFromV6 (line 122) | func TimestampFromV6(u UUID) (Timestamp, error) {
  function encodeCanonical (line 179) | func encodeCanonical(dst []byte, u UUID) {
  function toUpperHex (line 246) | func toUpperHex(b []byte) {
  function Must (line 280) | func Must(u UUID, err error) UUID {

FILE: vendor/github.com/gorilla/mux/middleware.go
  type MiddlewareFunc (line 11) | type MiddlewareFunc
    method Middleware (line 19) | func (mw MiddlewareFunc) Middleware(handler http.Handler) http.Handler {
  type middleware (line 14) | type middleware interface
  method Use (line 24) | func (r *Router) Use(mwf ...MiddlewareFunc) {
  method useInterface (line 31) | func (r *Router) useInterface(mw middleware) {
  function CORSMethodMiddleware (line 39) | func CORSMethodMiddleware(r *Router) MiddlewareFunc {
  function getAllMethodsForRoute (line 58) | func getAllMethodsForRoute(r *Router, req *http.Request) ([]string, erro...

FILE: vendor/github.com/gorilla/mux/mux.go
  function NewRouter (line 25) | func NewRouter() *Router {
  type Router (line 47) | type Router struct
    method Match (line 138) | func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
    method ServeHTTP (line 175) | func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
    method Get (line 216) | func (r *Router) Get(name string) *Route {
    method GetRoute (line 222) | func (r *Router) GetRoute(name string) *Route {
    method StrictSlash (line 245) | func (r *Router) StrictSlash(value bool) *Router {
    method SkipClean (line 258) | func (r *Router) SkipClean(value bool) *Router {
    method UseEncodedPath (line 269) | func (r *Router) UseEncodedPath() *Router {
    method NewRoute (line 279) | func (r *Router) NewRoute() *Route {
    method Name (line 288) | func (r *Router) Name(name string) *Route {
    method Handle (line 294) | func (r *Router) Handle(path string, handler http.Handler) *Route {
    method HandleFunc (line 300) | func (r *Router) HandleFunc(path string, f func(http.ResponseWriter,
    method Headers (line 307) | func (r *Router) Headers(pairs ...string) *Route {
    method Host (line 313) | func (r *Router) Host(tpl string) *Route {
    method MatcherFunc (line 319) | func (r *Router) MatcherFunc(f MatcherFunc) *Route {
    method Methods (line 325) | func (r *Router) Methods(methods ...string) *Route {
    method Path (line 331) | func (r *Router) Path(tpl string) *Route {
    method PathPrefix (line 337) | func (r *Router) PathPrefix(tpl string) *Route {
    method Queries (line 343) | func (r *Router) Queries(pairs ...string) *Route {
    method Schemes (line 349) | func (r *Router) Schemes(schemes ...string) *Route {
    method BuildVarsFunc (line 355) | func (r *Router) BuildVarsFunc(f BuildVarsFunc) *Route {
    method Walk (line 362) | func (r *Router) Walk(walkFn WalkFunc) error {
    method walk (line 375) | func (r *Router) walk(walkFn WalkFunc, ancestors []*Route) error {
  type routeConf (line 75) | type routeConf struct
  function copyRouteConf (line 100) | func copyRouteConf(r routeConf) routeConf {
  function copyRouteRegexp (line 122) | func copyRouteRegexp(r *routeRegexp) *routeRegexp {
  type WalkFunc (line 373) | type WalkFunc
  type RouteMatch (line 411) | type RouteMatch struct
  type contextKey (line 422) | type contextKey
  constant varsKey (line 425) | varsKey contextKey = iota
  constant routeKey (line 426) | routeKey
  function Vars (line 430) | func Vars(r *http.Request) map[string]string {
  function CurrentRoute (line 441) | func CurrentRoute(r *http.Request) *Route {
  function requestWithVars (line 448) | func requestWithVars(r *http.Request, vars map[string]string) *http.Requ...
  function requestWithRoute (line 453) | func requestWithRoute(r *http.Request, route *Route) *http.Request {
  function cleanPath (line 464) | func cleanPath(p string) string {
  function uniqueVars (line 482) | func uniqueVars(s1, s2 []string) error {
  function checkPairs (line 495) | func checkPairs(pairs ...string) (int, error) {
  function mapFromPairsToString (line 506) | func mapFromPairsToString(pairs ...string) (map[string]string, error) {
  function mapFromPairsToRegex (line 520) | func mapFromPairsToRegex(pairs ...string) (map[string]*regexp.Regexp, er...
  function matchInArray (line 537) | func matchInArray(arr []string, value string) bool {
  function matchMapWithString (line 547) | func matchMapWithString(toCheck map[string]string, toMatch map[string][]...
  function matchMapWithRegex (line 575) | func matchMapWithRegex(toCheck map[string]*regexp.Regexp, toMatch map[st...
  function methodNotAllowed (line 602) | func methodNotAllowed(w http.ResponseWriter, r *http.Request) {
  function methodNotAllowedHandler (line 608) | func methodNotAllowedHandler() http.Handler { return http.HandlerFunc(me...

FILE: vendor/github.com/gorilla/mux/regexp.go
  type routeRegexpOptions (line 17) | type routeRegexpOptions struct
  type regexpType (line 22) | type regexpType
  constant regexpTypePath (line 25) | regexpTypePath regexpType = iota
  constant regexpTypeHost (line 26) | regexpTypeHost
  constant regexpTypePrefix (line 27) | regexpTypePrefix
  constant regexpTypeQuery (line 28) | regexpTypeQuery
  function newRouteRegexp (line 41) | func newRouteRegexp(tpl string, typ regexpType, options routeRegexpOptio...
  type routeRegexp (line 154) | type routeRegexp struct
    method Match (line 174) | func (r *routeRegexp) Match(req *http.Request, match *RouteMatch) bool {
    method url (line 197) | func (r *routeRegexp) url(values map[string]string) (string, error) {
    method getURLQuery (line 228) | func (r *routeRegexp) getURLQuery(req *http.Request) string {
    method matchQueryString (line 278) | func (r *routeRegexp) matchQueryString(req *http.Request) bool {
  function findFirstQueryKey (line 242) | func findFirstQueryKey(rawQuery, key string) (value string, ok bool) {
  function braceIndices (line 284) | func braceIndices(s string) ([]int, error) {
  function varGroupName (line 308) | func varGroupName(idx int) string {
  type routeRegexpGroup (line 317) | type routeRegexpGroup struct
    method setMatch (line 324) | func (v routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r...
  function getHost (line 377) | func getHost(r *http.Request) string {
  function extractVars (line 384) | func extractVars(input string, matches []int, names []string, output map...

FILE: vendor/github.com/gorilla/mux/route.go
  type Route (line 17) | type Route struct
    method SkipClean (line 36) | func (r *Route) SkipClean() bool {
    method Match (line 41) | func (r *Route) Match(req *http.Request, match *RouteMatch) bool {
    method GetError (line 115) | func (r *Route) GetError() error {
    method BuildOnly (line 120) | func (r *Route) BuildOnly() *Route {
    method Handler (line 128) | func (r *Route) Handler(handler http.Handler) *Route {
    method HandlerFunc (line 136) | func (r *Route) HandlerFunc(f func(http.ResponseWriter, *http.Request)...
    method GetHandler (line 141) | func (r *Route) GetHandler() http.Handler {
    method Name (line 149) | func (r *Route) Name(name string) *Route {
    method GetName (line 162) | func (r *Route) GetName() string {
    method addMatcher (line 176) | func (r *Route) addMatcher(m matcher) *Route {
    method addRegexpMatcher (line 184) | func (r *Route) addRegexpMatcher(tpl string, typ regexpType) error {
    method Headers (line 249) | func (r *Route) Headers(pairs ...string) *Route {
    method HeadersRegexp (line 275) | func (r *Route) HeadersRegexp(pairs ...string) *Route {
    method Host (line 303) | func (r *Route) Host(tpl string) *Route {
    method MatcherFunc (line 319) | func (r *Route) MatcherFunc(f MatcherFunc) *Route {
    method Methods (line 335) | func (r *Route) Methods(methods ...string) *Route {
    method Path (line 363) | func (r *Route) Path(tpl string) *Route {
    method PathPrefix (line 379) | func (r *Route) PathPrefix(tpl string) *Route {
    method Queries (line 403) | func (r *Route) Queries(pairs ...string) *Route {
    method Schemes (line 449) | func (r *Route) Schemes(schemes ...string) *Route {
    method BuildVarsFunc (line 467) | func (r *Route) BuildVarsFunc(f BuildVarsFunc) *Route {
    method Subrouter (line 494) | func (r *Route) Subrouter() *Router {
    method URL (line 543) | func (r *Route) URL(pairs ...string) (*url.URL, error) {
    method URLHost (line 585) | func (r *Route) URLHost(pairs ...string) (*url.URL, error) {
    method URLPath (line 613) | func (r *Route) URLPath(pairs ...string) (*url.URL, error) {
    method GetPathTemplate (line 638) | func (r *Route) GetPathTemplate() (string, error) {
    method GetPathRegexp (line 652) | func (r *Route) GetPathRegexp() (string, error) {
    method GetQueriesRegexp (line 667) | func (r *Route) GetQueriesRegexp() ([]string, error) {
    method GetQueriesTemplates (line 686) | func (r *Route) GetQueriesTemplates() ([]string, error) {
    method GetMethods (line 704) | func (r *Route) GetMethods() ([]string, error) {
    method GetHostTemplate (line 721) | func (r *Route) GetHostTemplate() (string, error) {
    method GetVarNames (line 733) | func (r *Route) GetVarNames() ([]string, error) {
    method prepareVars (line 752) | func (r *Route) prepareVars(pairs ...string) (map[string]string, error) {
    method buildVars (line 760) | func (r *Route) buildVars(m map[string]string) map[string]string {
  type matcher (line 171) | type matcher interface
  type headerMatcher (line 234) | type headerMatcher
    method Match (line 236) | func (m headerMatcher) Match(r *http.Request, match *RouteMatch) bool {
  type headerRegexMatcher (line 259) | type headerRegexMatcher
    method Match (line 261) | func (m headerRegexMatcher) Match(r *http.Request, match *RouteMatch) ...
  type MatcherFunc (line 311) | type MatcherFunc
    method Match (line 314) | func (m MatcherFunc) Match(r *http.Request, match *RouteMatch) bool {
  type methodMatcher (line 326) | type methodMatcher
    method Match (line 328) | func (m methodMatcher) Match(r *http.Request, match *RouteMatch) bool {
  type schemeMatcher (line 422) | type schemeMatcher
    method Match (line 424) | func (m schemeMatcher) Match(r *http.Request, match *RouteMatch) bool {
  type BuildVarsFunc (line 463) | type BuildVarsFunc

FILE: vendor/github.com/gorilla/mux/test_helpers.go
  function SetURLVars (line 17) | func SetURLVars(r *http.Request, val map[string]string) *http.Request {

FILE: vendor/golang.org/x/sys/unix/affinity_linux.go
  constant cpuSetSize (line 14) | cpuSetSize = _CPU_SETSIZE / _NCPUBITS
  type CPUSet (line 17) | type CPUSet
    method Zero (line 40) | func (s *CPUSet) Zero() {
    method Set (line 55) | func (s *CPUSet) Set(cpu int) {
    method Clear (line 63) | func (s *CPUSet) Clear(cpu int) {
    method IsSet (line 71) | func (s *CPUSet) IsSet(cpu int) bool {
    method Count (line 80) | func (s *CPUSet) Count() int {
  function schedAffinity (line 19) | func schedAffinity(trap uintptr, pid int, set *CPUSet) error {
  function SchedGetaffinity (line 29) | func SchedGetaffinity(pid int, set *CPUSet) error {
  function SchedSetaffinity (line 35) | func SchedSetaffinity(pid int, set *CPUSet) error {
  function cpuBitsIndex (line 46) | func cpuBitsIndex(cpu int) int {
  function cpuBitsMask (line 50) | func cpuBitsMask(cpu int) cpuMask {

FILE: vendor/golang.org/x/sys/unix/bluetooth_linux.go
  constant BTPROTO_L2CAP (line 11) | BTPROTO_L2CAP  = 0
  constant BTPROTO_HCI (line 12) | BTPROTO_HCI    = 1
  constant BTPROTO_SCO (line 13) | BTPROTO_SCO    = 2
  constant BTPROTO_RFCOMM (line 14) | BTPROTO_RFCOMM = 3
  constant BTPROTO_BNEP (line 15) | BTPROTO_BNEP   = 4
  constant BTPROTO_CMTP (line 16) | BTPROTO_CMTP   = 5
  constant BTPROTO_HIDP (line 17) | BTPROTO_HIDP   = 6
  constant BTPROTO_AVDTP (line 18) | BTPROTO_AVDTP  = 7
  constant HCI_CHANNEL_RAW (line 22) | HCI_CHANNEL_RAW     = 0
  constant HCI_CHANNEL_USER (line 23) | HCI_CHANNEL_USER    = 1
  constant HCI_CHANNEL_MONITOR (line 24) | HCI_CHANNEL_MONITOR = 2
  constant HCI_CHANNEL_CONTROL (line 25) | HCI_CHANNEL_CONTROL = 3
  constant HCI_CHANNEL_LOGGING (line 26) | HCI_CHANNEL_LOGGING = 4
  constant SOL_BLUETOOTH (line 31) | SOL_BLUETOOTH = 0x112
  constant SOL_HCI (line 32) | SOL_HCI       = 0x0
  constant SOL_L2CAP (line 33) | SOL_L2CAP     = 0x6
  constant SOL_RFCOMM (line 34) | SOL_RFCOMM    = 0x12
  constant SOL_SCO (line 35) | SOL_SCO       = 0x11

FILE: vendor/golang.org/x/sys/unix/cap_freebsd.go
  constant capRightsGoVersion (line 18) | capRightsGoVersion = CAP_RIGHTS_VERSION_00
  constant capArSizeMin (line 19) | capArSizeMin       = CAP_RIGHTS_VERSION_00 + 2
  constant capArSizeMax (line 20) | capArSizeMax       = capRightsGoVersion + 2
  function capidxbit (line 30) | func capidxbit(right uint64) int {
  function rightToIndex (line 34) | func rightToIndex(right uint64) (int, error) {
  function caprver (line 42) | func caprver(right uint64) int {
  function capver (line 46) | func capver(rights *CapRights) int {
  function caparsize (line 50) | func caparsize(rights *CapRights) int {
  function CapRightsSet (line 55) | func CapRightsSet(rights *CapRights, setrights []uint64) error {
  function CapRightsClear (line 90) | func CapRightsClear(rights *CapRights, clearrights []uint64) error {
  function CapRightsIsSet (line 125) | func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
  function capright (line 158) | func capright(idx uint64, bit uint64) uint64 {
  function CapRightsInit (line 164) | func CapRightsInit(rights []uint64) (*CapRights, error) {
  function CapRightsLimit (line 179) | func CapRightsLimit(fd uintptr, rights *CapRights) error {
  function CapRightsGet (line 185) | func CapRightsGet(fd uintptr) (*CapRights, error) {

FILE: vendor/golang.org/x/sys/unix/constants.go
  constant R_OK (line 10) | R_OK = 0x4
  constant W_OK (line 11) | W_OK = 0x2
  constant X_OK (line 12) | X_OK = 0x1

FILE: vendor/golang.org/x/sys/unix/dev_aix_ppc.go
  function Major (line 13) | func Major(dev uint64) uint32 {
  function Minor (line 18) | func Minor(dev uint64) uint32 {
  function Mkdev (line 24) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
  function Major (line 13) | func Major(dev uint64) uint32 {
  function Minor (line 18) | func Minor(dev uint64) uint32 {
  function Mkdev (line 24) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_darwin.go
  function Major (line 11) | func Major(dev uint64) uint32 {
  function Minor (line 16) | func Minor(dev uint64) uint32 {
  function Mkdev (line 22) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_dragonfly.go
  function Major (line 17) | func Major(dev uint64) uint32 {
  function Minor (line 22) | func Minor(dev uint64) uint32 {
  function Mkdev (line 28) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_freebsd.go
  function Major (line 17) | func Major(dev uint64) uint32 {
  function Minor (line 22) | func Minor(dev uint64) uint32 {
  function Mkdev (line 28) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_linux.go
  function Major (line 21) | func Major(dev uint64) uint32 {
  function Minor (line 28) | func Minor(dev uint64) uint32 {
  function Mkdev (line 36) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_netbsd.go
  function Major (line 11) | func Major(dev uint64) uint32 {
  function Minor (line 16) | func Minor(dev uint64) uint32 {
  function Mkdev (line 24) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_openbsd.go
  function Major (line 11) | func Major(dev uint64) uint32 {
  function Minor (line 16) | func Minor(dev uint64) uint32 {
  function Mkdev (line 24) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dev_zos.go
  function Major (line 15) | func Major(dev uint64) uint32 {
  function Minor (line 20) | func Minor(dev uint64) uint32 {
  function Mkdev (line 26) | func Mkdev(major, minor uint32) uint64 {

FILE: vendor/golang.org/x/sys/unix/dirent.go
  function readInt (line 12) | func readInt(b []byte, off, size uintptr) (u uint64, ok bool) {
  function readIntBE (line 22) | func readIntBE(b []byte, size uintptr) uint64 {
  function readIntLE (line 41) | func readIntLE(b []byte, size uintptr) uint64 {
  function ParseDirent (line 64) | func ParseDirent(buf []byte, max int, names []string) (consumed int, cou...

FILE: vendor/golang.org/x/sys/unix/endian_big.go
  constant isBigEndian (line 9) | isBigEndian = true

FILE: vendor/golang.org/x/sys/unix/endian_little.go
  constant isBigEndian (line 9) | isBigEndian = false

FILE: vendor/golang.org/x/sys/unix/env_unix.go
  function Getenv (line 13) | func Getenv(key string) (value string, found bool) {
  function Setenv (line 17) | func Setenv(key, value string) error {
  function Clearenv (line 21) | func Clearenv() {
  function Environ (line 25) | func Environ() []string {
  function Unsetenv (line 29) | func Unsetenv(key string) error {

FILE: vendor/golang.org/x/sys/unix/epoll_zos.go
  type EpollEvent (line 17) | type EpollEvent struct
  constant EPOLLERR (line 24) | EPOLLERR      = 0x8
  constant EPOLLHUP (line 25) | EPOLLHUP      = 0x10
  constant EPOLLIN (line 26) | EPOLLIN       = 0x1
  constant EPOLLMSG (line 27) | EPOLLMSG      = 0x400
  constant EPOLLOUT (line 28) | EPOLLOUT      = 0x4
  constant EPOLLPRI (line 29) | EPOLLPRI      = 0x2
  constant EPOLLRDBAND (line 30) | EPOLLRDBAND   = 0x80
  constant EPOLLRDNORM (line 31) | EPOLLRDNORM   = 0x40
  constant EPOLLWRBAND (line 32) | EPOLLWRBAND   = 0x200
  constant EPOLLWRNORM (line 33) | EPOLLWRNORM   = 0x100
  constant EPOLL_CTL_ADD (line 34) | EPOLL_CTL_ADD = 0x1
  constant EPOLL_CTL_DEL (line 35) | EPOLL_CTL_DEL = 0x2
  constant EPOLL_CTL_MOD (line 36) | EPOLL_CTL_MOD = 0x3
  function epToPollEvt (line 52) | func epToPollEvt(events uint32) int16 {
  function pToEpollEvt (line 72) | func pToEpollEvt(revents int16) uint32 {
  type epollImpl (line 92) | type epollImpl struct
    method epollcreate (line 111) | func (e *epollImpl) epollcreate(size int) (epfd int, err error) {
    method epollcreate1 (line 123) | func (e *epollImpl) epollcreate1(flag int) (fd int, err error) {
    method epollctl (line 127) | func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEve...
    method epollwait (line 169) | func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int)...
  type eventPoll (line 100) | type eventPoll struct
    method getFds (line 161) | func (ep *eventPoll) getFds() []int {
  function EpollCreate (line 204) | func EpollCreate(size int) (fd int, err error) {
  function EpollCreate1 (line 208) | func EpollCreate1(flag int) (fd int, err error) {
  function EpollCtl (line 212) | func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
  function EpollWait (line 218) | func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err erro...

FILE: vendor/golang.org/x/sys/unix/fcntl.go
  function fcntl (line 15) | func fcntl(fd int, cmd, arg int) (int, error) {
  function FcntlInt (line 25) | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
  function FcntlFlock (line 30) | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {

FILE: vendor/golang.org/x/sys/unix/fcntl_darwin.go
  function FcntlInt (line 10) | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
  function FcntlFlock (line 15) | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
  function FcntlFstore (line 21) | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error {

FILE: vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
  function init (line 9) | func init() {

FILE: vendor/golang.org/x/sys/unix/fdset.go
  method Set (line 10) | func (fds *FdSet) Set(fd int) {
  method Clear (line 15) | func (fds *FdSet) Clear(fd int) {
  method IsSet (line 20) | func (fds *FdSet) IsSet(fd int) bool {
  method Zero (line 25) | func (fds *FdSet) Zero() {

FILE: vendor/golang.org/x/sys/unix/fstatfs_zos.go
  function Fstatfs (line 15) | func Fstatfs(fd int, stat *Statfs_t) (err error) {
  function tryGetmntent64 (line 60) | func tryGetmntent64(stat *Statfs_t) (err error) {
  function tryGetmntent128 (line 81) | func tryGetmntent128(stat *Statfs_t) (err error) {
  function tryGetmntent256 (line 102) | func tryGetmntent256(stat *Statfs_t) (err error) {
  function tryGetmntent512 (line 123) | func tryGetmntent512(stat *Statfs_t) (err error) {
  function tryGetmntent1024 (line 144) | func tryGetmntent1024(stat *Statfs_t) (err error) {

FILE: vendor/golang.org/x/sys/unix/gccgo.go
  function realSyscallNoError (line 14) | func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr...
  function realSyscall (line 16) | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, e...
  function SyscallNoError (line 18) | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
  function Syscall (line 25) | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errn...
  function Syscall6 (line 32) | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err...
  function Syscall9 (line 39) | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 ...
  function RawSyscallNoError (line 46) | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
  function RawSyscall (line 51) | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.E...
  function RawSyscall6 (line 56) | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, ...

FILE: vendor/golang.org/x/sys/unix/gccgo_c.c
  type ret (line 18) | struct ret {
  type ret (line 23) | struct ret
  function gccgoRealSyscall (line 26) | struct ret
  function gccgoRealSyscallNoError (line 40) | uintptr_t

FILE: vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
  function realGettimeofday (line 12) | func realGettimeofday(*Timeval, *byte) int32
  function gettimeofday (line 14) | func gettimeofday(tv *Timeval) (err syscall.Errno) {

FILE: vendor/golang.org/x/sys/unix/ifreq_linux.go
  type Ifreq (line 25) | type Ifreq struct
    method Name (line 45) | func (ifr *Ifreq) Name() string {
    method Inet4Addr (line 56) | func (ifr *Ifreq) Inet4Addr() ([]byte, error) {
    method SetInet4Addr (line 69) | func (ifr *Ifreq) SetInet4Addr(v []byte) error {
    method Uint16 (line 90) | func (ifr *Ifreq) Uint16() uint16 {
    method SetUint16 (line 95) | func (ifr *Ifreq) SetUint16(v uint16) {
    method Uint32 (line 101) | func (ifr *Ifreq) Uint32() uint32 {
    method SetUint32 (line 106) | func (ifr *Ifreq) SetUint32(v uint32) {
    method clear (line 113) | func (ifr *Ifreq) clear() {
    method withData (line 136) | func (ifr Ifreq) withData(p unsafe.Pointer) ifreqData {
  function NewIfreq (line 30) | func NewIfreq(name string) (*Ifreq, error) {
  type ifreqData (line 124) | type ifreqData struct

FILE: vendor/golang.org/x/sys/unix/ioctl_linux.go
  function IoctlRetInt (line 12) | func IoctlRetInt(fd int, req uint) (int, error) {
  function IoctlGetUint32 (line 20) | func IoctlGetUint32(fd int, req uint) (uint32, error) {
  function IoctlGetRTCTime (line 26) | func IoctlGetRTCTime(fd int) (*RTCTime, error) {
  function IoctlSetRTCTime (line 32) | func IoctlSetRTCTime(fd int, value *RTCTime) error {
  function IoctlGetRTCWkAlrm (line 36) | func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
  function IoctlSetRTCWkAlrm (line 42) | func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error {
  function IoctlGetEthtoolDrvinfo (line 48) | func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, err...
  function IoctlGetWatchdogInfo (line 64) | func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) {
  function IoctlWatchdogKeepalive (line 73) | func IoctlWatchdogKeepalive(fd int) error {
  function IoctlFileCloneRange (line 81) | func IoctlFileCloneRange(destFd int, value *FileCloneRange) error {
  function IoctlFileClone (line 88) | func IoctlFileClone(destFd, srcFd int) error {
  type FileDedupeRange (line 92) | type FileDedupeRange struct
  type FileDedupeRangeInfo (line 100) | type FileDedupeRangeInfo struct
  function IoctlFileDedupeRange (line 112) | func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error {
  function IoctlHIDGetDesc (line 150) | func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error {
  function IoctlHIDGetRawInfo (line 154) | func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) {
  function IoctlHIDGetRawName (line 160) | func IoctlHIDGetRawName(fd int) (string, error) {
  function IoctlHIDGetRawPhys (line 166) | func IoctlHIDGetRawPhys(fd int) (string, error) {
  function IoctlHIDGetRawUniq (line 172) | func IoctlHIDGetRawUniq(fd int) (string, error) {
  function IoctlIfreq (line 180) | func IoctlIfreq(fd int, req uint, value *Ifreq) error {
  function ioctlIfreqData (line 190) | func ioctlIfreqData(fd int, req uint, value *ifreqData) error {
  function IoctlKCMClone (line 199) | func IoctlKCMClone(fd int) (*KCMClone, error) {
  function IoctlKCMAttach (line 210) | func IoctlKCMAttach(fd int, info KCMAttach) error {
  function IoctlKCMUnattach (line 215) | func IoctlKCMUnattach(fd int, info KCMUnattach) error {
  function IoctlLoopGetStatus64 (line 221) | func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) {
  function IoctlLoopSetStatus64 (line 231) | func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
  function IoctlLoopConfigure (line 236) | func IoctlLoopConfigure(fd int, value *LoopConfig) error {

FILE: vendor/golang.org/x/sys/unix/ioctl_signed.go
  function IoctlSetInt (line 18) | func IoctlSetInt(fd int, req int, value int) error {
  function IoctlSetPointerInt (line 26) | func IoctlSetPointerInt(fd int, req int, value int) error {
  function IoctlSetWinsize (line 34) | func IoctlSetWinsize(fd int, req int, value *Winsize) error {
  function IoctlSetTermios (line 43) | func IoctlSetTermios(fd int, req int, value *Termios) error {
  function IoctlGetInt (line 53) | func IoctlGetInt(fd int, req int) (int, error) {
  function IoctlGetWinsize (line 59) | func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
  function IoctlGetTermios (line 65) | func IoctlGetTermios(fd int, req int) (*Termios, error) {

FILE: vendor/golang.org/x/sys/unix/ioctl_unsigned.go
  function IoctlSetInt (line 18) | func IoctlSetInt(fd int, req uint, value int) error {
  function IoctlSetPointerInt (line 26) | func IoctlSetPointerInt(fd int, req uint, value int) error {
  function IoctlSetWinsize (line 34) | func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
  function IoctlSetTermios (line 43) | func IoctlSetTermios(fd int, req uint, value *Termios) error {
  function IoctlGetInt (line 53) | func IoctlGetInt(fd int, req uint) (int, error) {
  function IoctlGetWinsize (line 59) | func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
  function IoctlGetTermios (line 65) | func IoctlGetTermios(fd int, req uint) (*Termios, error) {

FILE: vendor/golang.org/x/sys/unix/ioctl_zos.go
  function IoctlSetInt (line 19) | func IoctlSetInt(fd int, req int, value int) error {
  function IoctlSetWinsize (line 26) | func IoctlSetWinsize(fd int, req int, value *Winsize) error {
  function IoctlSetTermios (line 35) | func IoctlSetTermios(fd int, req int, value *Termios) error {
  function IoctlGetInt (line 49) | func IoctlGetInt(fd int, req int) (int, error) {
  function IoctlGetWinsize (line 55) | func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
  function IoctlGetTermios (line 64) | func IoctlGetTermios(fd int, req int) (*Termios, error) {

FILE: vendor/golang.org/x/sys/unix/mremap.go
  type mremapMmapper (line 11) | type mremapMmapper struct
    method Mremap (line 25) | func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags in...
  function Mremap (line 50) | func Mremap(oldData []byte, newLength int, flags int) (data []byte, err ...

FILE: vendor/golang.org/x/sys/unix/pagesize_unix.go
  function Getpagesize (line 13) | func Getpagesize() int {

FILE: vendor/golang.org/x/sys/unix/pledge_openbsd.go
  function Pledge (line 20) | func Pledge(promises, execpromises string) error {
  function PledgePromises (line 43) | func PledgePromises(promises string) error {
  function PledgeExecpromises (line 61) | func PledgeExecpromises(execpromises string) error {
  function majmin (line 75) | func majmin() (major int, minor int, err error) {
  function pledgeAvailable (line 99) | func pledgeAvailable() error {

FILE: vendor/golang.org/x/sys/unix/ptrace_darwin.go
  function ptrace (line 9) | func ptrace(request int, pid int, addr uintptr, data uintptr) error {

FILE: vendor/golang.org/x/sys/unix/ptrace_ios.go
  function ptrace (line 9) | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {

FILE: vendor/golang.org/x/sys/unix/race.go
  constant raceenabled (line 14) | raceenabled = true
  function raceAcquire (line 16) | func raceAcquire(addr unsafe.Pointer) {
  function raceReleaseMerge (line 20) | func raceReleaseMerge(addr unsafe.Pointer) {
  function raceReadRange (line 24) | func raceReadRange(addr unsafe.Pointer, len int) {
  function raceWriteRange (line 28) | func raceWriteRange(addr unsafe.Pointer, len int) {

FILE: vendor/golang.org/x/sys/unix/race0.go
  constant raceenabled (line 13) | raceenabled = false
  function raceAcquire (line 15) | func raceAcquire(addr unsafe.Pointer) {
  function raceReleaseMerge (line 18) | func raceReleaseMerge(addr unsafe.Pointer) {
  function raceReadRange (line 21) | func raceReadRange(addr unsafe.Pointer, len int) {
  function raceWriteRange (line 24) | func raceWriteRange(addr unsafe.Pointer, len int) {

FILE: vendor/golang.org/x/sys/unix/readdirent_getdents.go
  function ReadDirent (line 10) | func ReadDirent(fd int, buf []byte) (n int, err error) {

FILE: vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
  function ReadDirent (line 12) | func ReadDirent(fd int, buf []byte) (n int, err error) {

FILE: vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go
  function cmsgAlignOf (line 8) | func cmsgAlignOf(salen int) int {

FILE: vendor/golang.org/x/sys/unix/sockcmsg_linux.go
  function UnixCredentials (line 14) | func UnixCredentials(ucred *Ucred) []byte {
  function ParseUnixCredentials (line 27) | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
  function PktInfo4 (line 39) | func PktInfo4(info *Inet4Pktinfo) []byte {
  function PktInfo6 (line 50) | func PktInfo6(info *Inet6Pktinfo) []byte {
  function ParseOrigDstAddr (line 63) | func ParseOrigDstAddr(m *SocketControlMessage) (Sockaddr, error) {

FILE: vendor/golang.org/x/sys/unix/sockcmsg_unix.go
  function CmsgLen (line 17) | func CmsgLen(datalen int) int {
  function CmsgSpace (line 23) | func CmsgSpace(datalen int) int {
  method data (line 27) | func (h *Cmsghdr) data(offset uintptr) unsafe.Pointer {
  type SocketControlMessage (line 32) | type SocketControlMessage struct
  function ParseSocketControlMessage (line 39) | func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) {
  function ParseOneSocketControlMessage (line 57) | func ParseOneSocketControlMessage(b []byte) (hdr Cmsghdr, data []byte, r...
  function socketControlMessageHeaderAndData (line 68) | func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, erro...
  function UnixRights (line 78) | func UnixRights(fds ...int) []byte {
  function ParseUnixRights (line 93) | func ParseUnixRights(m *SocketControlMessage) ([]int, error) {

FILE: vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
  function cmsgAlignOf (line 14) | func cmsgAlignOf(salen int) int {

FILE: vendor/golang.org/x/sys/unix/syscall.go
  function ByteSliceFromString (line 36) | func ByteSliceFromString(s string) ([]byte, error) {
  function BytePtrFromString (line 48) | func BytePtrFromString(s string) (*byte, error) {
  function ByteSliceToString (line 58) | func ByteSliceToString(s []byte) string {
  function BytePtrToString (line 68) | func BytePtrToString(p *byte) string {

FILE: vendor/golang.org/x/sys/unix/syscall_aix.go
  function Access (line 22) | func Access(path string, mode uint32) (err error) {
  function Chmod (line 26) | func Chmod(path string, mode uint32) (err error) {
  function Chown (line 30) | func Chown(path string, uid int, gid int) (err error) {
  function Creat (line 34) | func Creat(path string, mode uint32) (fd int, err error) {
  function Utimes (line 40) | func Utimes(path string, tv []Timeval) error {
  function UtimesNano (line 49) | func UtimesNano(path string, ts []Timespec) error {
  function UtimesNanoAt (line 56) | func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
  method sockaddr (line 66) | func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 78) | func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 91) | func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
  function Getsockname (line 119) | func Getsockname(fd int) (sa Sockaddr, err error) {
  constant ImplementsGetwd (line 130) | ImplementsGetwd = true
  function Getwd (line 132) | func Getwd() (ret string, err error) {
  function Getcwd (line 149) | func Getcwd(buf []byte) (n int, err error) {
  function Getgroups (line 161) | func Getgroups() (gids []int, err error) {
  function Setgroups (line 187) | func Setgroups(gids []int) (err error) {
  function Accept (line 205) | func Accept(fd int) (nfd int, sa Sockaddr, err error) {
  function recvmsgRaw (line 220) | func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSock...
  function sendmsgN (line 248) | func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen...
  function anyToSockaddr (line 279) | func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  function Gettimeofday (line 318) | func Gettimeofday(tv *Timeval) (err error) {
  function Sendfile (line 323) | func Sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function sendfile (line 331) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function direntIno (line 335) | func direntIno(buf []byte) (uint64, bool) {
  function direntReclen (line 339) | func direntReclen(buf []byte) (uint64, bool) {
  function direntNamlen (line 343) | func direntNamlen(buf []byte) (uint64, bool) {
  function Getdents (line 353) | func Getdents(fd int, buf []byte) (n int, err error) {
  function Wait4 (line 359) | func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (w...
  type WaitStatus (line 379) | type WaitStatus
    method Stopped (line 381) | func (w WaitStatus) Stopped() bool { return w&0x40 != 0 }
    method StopSignal (line 382) | func (w WaitStatus) StopSignal() Signal {
    method Exited (line 389) | func (w WaitStatus) Exited() bool { return w&0xFF == 0 }
    method ExitStatus (line 390) | func (w WaitStatus) ExitStatus() int {
    method Signaled (line 397) | func (w WaitStatus) Signaled() bool { return w&0x40 == 0 && w&0xFF != 0 }
    method Signal (line 398) | func (w WaitStatus) Signal() Signal {
    method Continued (line 405) | func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 }
    method CoreDump (line 407) | func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 }
    method TrapCause (line 409) | func (w WaitStatus) TrapCause() int { return -1 }
  function Fsync (line 428) | func Fsync(fd int) error {
  function Pipe (line 546) | func Pipe(p []int) (err error) {
  function Poll (line 561) | func Poll(fds []PollFd, timeout int) (n int, err error) {
  function Unmount (line 576) | func Unmount(target string, flags int) (err error) {

FILE: vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  method SetLen (line 22) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 26) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 30) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 34) | func (cmsg *Cmsghdr) SetLen(length int) {
  function Fstat (line 38) | func Fstat(fd int, stat *Stat_t) error {
  function Fstatat (line 42) | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error {
  function Lstat (line 46) | func Lstat(path string, stat *Stat_t) error {
  function Stat (line 50) | func Stat(path string, statptr *Stat_t) error {

FILE: vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  method SetLen (line 22) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 26) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 30) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 34) | func (cmsg *Cmsghdr) SetLen(length int) {
  function fixStatTimFields (line 43) | func fixStatTimFields(stat *Stat_t) {
  function Fstat (line 49) | func Fstat(fd int, stat *Stat_t) error {
  function Fstatat (line 58) | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error {
  function Lstat (line 67) | func Lstat(path string, stat *Stat_t) error {
  function Stat (line 76) | func Stat(path string, statptr *Stat_t) error {

FILE: vendor/golang.org/x/sys/unix/syscall_bsd.go
  constant ImplementsGetwd (line 21) | ImplementsGetwd = true
  function Getwd (line 23) | func Getwd() (string, error) {
  function Getgroups (line 43) | func Getgroups() (gids []int, err error) {
  function Setgroups (line 69) | func Setgroups(gids []int) (err error) {
  type WaitStatus (line 87) | type WaitStatus
    method Exited (line 99) | func (w WaitStatus) Exited() bool { return w&mask == exited }
    method ExitStatus (line 101) | func (w WaitStatus) ExitStatus() int {
    method Signaled (line 108) | func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&ma...
    method Signal (line 110) | func (w WaitStatus) Signal() syscall.Signal {
    method CoreDump (line 118) | func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core !=...
    method Stopped (line 120) | func (w WaitStatus) Stopped() bool { return w&mask == stopped && sysca...
    method Killed (line 122) | func (w WaitStatus) Killed() bool { return w&mask == killed && syscall...
    method Continued (line 124) | func (w WaitStatus) Continued() bool { return w&mask == stopped && sys...
    method StopSignal (line 126) | func (w WaitStatus) StopSignal() syscall.Signal {
    method TrapCause (line 133) | func (w WaitStatus) TrapCause() int { return -1 }
  constant mask (line 90) | mask  = 0x7F
  constant core (line 91) | core  = 0x80
  constant shift (line 92) | shift = 8
  constant exited (line 94) | exited  = 0
  constant killed (line 95) | killed  = 9
  constant stopped (line 96) | stopped = 0x7F
  function Wait4 (line 137) | func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (w...
  method sockaddr (line 156) | func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 169) | func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 183) | func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 197) | func (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) {
  function anyToSockaddr (line 212) | func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  function Accept (line 270) | func Accept(fd int) (nfd int, sa Sockaddr, err error) {
  function Getsockname (line 293) | func Getsockname(fd int) (sa Sockaddr, err error) {
  function GetsockoptString (line 312) | func GetsockoptString(fd, level, opt int) (string, error) {
  function recvmsgRaw (line 326) | func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSock...
  function sendmsgN (line 356) | func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen...
  function Kevent (line 389) | func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n in...
  function sysctlmib (line 401) | func sysctlmib(name string, args ...int) ([]_C_int, error) {
  function Sysctl (line 415) | func Sysctl(name string) (string, error) {
  function SysctlArgs (line 419) | func SysctlArgs(name string, args ...int) (string, error) {
  function SysctlUint32 (line 433) | func SysctlUint32(name string) (uint32, error) {
  function SysctlUint32Args (line 437) | func SysctlUint32Args(name string, args ...int) (uint32, error) {
  function SysctlUint64 (line 454) | func SysctlUint64(name string, args ...int) (uint64, error) {
  function SysctlRaw (line 471) | func SysctlRaw(name string, args ...int) ([]byte, error) {
  function SysctlClockinfo (line 497) | func SysctlClockinfo(name string) (*Clockinfo, error) {
  function SysctlTimeval (line 514) | func SysctlTimeval(name string) (*Timeval, error) {
  function Utimes (line 533) | func Utimes(path string, tv []Timeval) error {
  function UtimesNano (line 543) | func UtimesNano(path string, ts []Timespec) error {
  function UtimesNanoAt (line 567) | func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
  function Futimes (line 579) | func Futimes(fd int, tv []Timeval) error {
  function Poll (line 591) | func Poll(fds []PollFd, timeout int) (n int, err error) {

FILE: vendor/golang.org/x/sys/unix/syscall_darwin.go
  function fdopendir (line 24) | func fdopendir(fd int) (dir uintptr, err error) {
  function Getdirentries (line 37) | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
  type SockaddrDatalink (line 112) | type SockaddrDatalink struct
  type SockaddrCtl (line 125) | type SockaddrCtl struct
    method sockaddr (line 131) | func (sa *SockaddrCtl) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrVM (line 144) | type SockaddrVM struct
    method sockaddr (line 155) | func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) {
  function anyToSockaddrGOOS (line 164) | func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  constant SYS___SYSCTL (line 188) | SYS___SYSCTL = SYS_SYSCTL
  function nametomib (line 191) | func nametomib(name string) (mib []_C_int, err error) {
  function direntIno (line 218) | func direntIno(buf []byte) (uint64, bool) {
  function direntReclen (line 222) | func direntReclen(buf []byte) (uint64, bool) {
  function direntNamlen (line 226) | func direntNamlen(buf []byte) (uint64, bool) {
  function PtraceAttach (line 230) | func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0...
  function PtraceDetach (line 231) | func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0...
  function PtraceDenyAttach (line 232) | func PtraceDenyAttach() (err error)    { return ptrace(PT_DENY_ATTACH, 0...
  function Pipe (line 236) | func Pipe(p []int) (err error) {
  function Getfsstat (line 249) | func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
  function xattrPointer (line 259) | func xattrPointer(dest []byte) *byte {
  function Getxattr (line 274) | func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
  function Lgetxattr (line 278) | func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
  function Fgetxattr (line 284) | func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
  function Setxattr (line 290) | func Setxattr(path string, attr string, data []byte, flags int) (err err...
  function Lsetxattr (line 320) | func Lsetxattr(link string, attr string, data []byte, flags int) (err er...
  function Fsetxattr (line 326) | func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
  function Removexattr (line 332) | func Removexattr(path string, attr string) (err error) {
  function Lremovexattr (line 339) | func Lremovexattr(link string, attr string) (err error) {
  function Fremovexattr (line 345) | func Fremovexattr(fd int, attr string) (err error) {
  function Listxattr (line 351) | func Listxattr(path string, dest []byte) (sz int, err error) {
  function Llistxattr (line 355) | func Llistxattr(link string, dest []byte) (sz int, err error) {
  function Flistxattr (line 361) | func Flistxattr(fd int, dest []byte) (sz int, err error) {
  function Kill (line 375) | func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid,...
  function IoctlCtlInfo (line 380) | func IoctlCtlInfo(fd int, ctlInfo *CtlInfo) error {
  type IfreqMTU (line 385) | type IfreqMTU struct
  function IoctlGetIfreqMTU (line 392) | func IoctlGetIfreqMTU(fd int, ifname string) (*IfreqMTU, error) {
  function IoctlSetIfreqMTU (line 401) | func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error {
  function Uname (line 407) | func Uname(uname *Utsname) error {
  function Sendfile (line 453) | func Sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function GetsockoptIPMreqn (line 463) | func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
  function SetsockoptIPMreqn (line 470) | func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
  function GetsockoptXucred (line 476) | func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
  function GetsockoptTCPConnectionInfo (line 483) | func GetsockoptTCPConnectionInfo(fd, level, opt int) (*TCPConnectionInfo...
  function SysctlKinfoProc (line 490) | func SysctlKinfoProc(name string, args ...int) (*KinfoProc, error) {
  function SysctlKinfoProcSlice (line 507) | func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {

FILE: vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
  function setTimespec (line 11) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 15) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 19) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 25) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 29) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 33) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 37) | func (cmsg *Cmsghdr) SetLen(length int) {
  function Syscall9 (line 41) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...

FILE: vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
  function setTimespec (line 11) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 15) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 19) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 25) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 29) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 33) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 37) | func (cmsg *Cmsghdr) SetLen(length int) {
  function Syscall9 (line 41) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...

FILE: vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
  function syscall_syscall (line 12) | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
  function syscall_syscall6 (line 13) | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintpt...
  function syscall_syscall6X (line 14) | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintp...
  function syscall_syscall9 (line 15) | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r...
  function syscall_rawSyscall (line 16) | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
  function syscall_rawSyscall6 (line 17) | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uin...
  function syscall_syscallPtr (line 18) | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)

FILE: vendor/golang.org/x/sys/unix/syscall_dragonfly.go
  constant _dragonflyABIChangeVersion (line 28) | _dragonflyABIChangeVersion = 500705
  function supportsABI (line 30) | func supportsABI(ver uint32) bool {
  type SockaddrDatalink (line 36) | type SockaddrDatalink struct
  function anyToSockaddrGOOS (line 50) | func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  function nametomib (line 55) | func nametomib(name string) (mib []_C_int, err error) {
  function direntIno (line 82) | func direntIno(buf []byte) (uint64, bool) {
  function direntReclen (line 86) | func direntReclen(buf []byte) (uint64, bool) {
  function direntNamlen (line 94) | func direntNamlen(buf []byte) (uint64, bool) {
  function Pipe (line 100) | func Pipe(p []int) (err error) {
  function Pipe2 (line 113) | func Pipe2(p []int, flags int) (err error) {
  function pread (line 129) | func pread(fd int, p []byte, offset int64) (n int, err error) {
  function pwrite (line 135) | func pwrite(fd int, p []byte, offset int64) (n int, err error) {
  function Accept4 (line 139) | func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
  function Getfsstat (line 159) | func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
  function sysctlUname (line 179) | func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
  function Uname (line 192) | func Uname(uname *Utsname) error {
  function Sendfile (line 242) | func Sendfile(outfd int, infd int, offset *int64, count int) (written in...

FILE: vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 22) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 28) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 32) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 36) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 40) | func (cmsg *Cmsghdr) SetLen(length int) {
  function sendfile (line 44) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Syscall9 (line 56) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...

FILE: vendor/golang.org/x/sys/unix/syscall_freebsd.go
  function supportsABI (line 27) | func supportsABI(ver uint32) bool {
  type SockaddrDatalink (line 33) | type SockaddrDatalink struct
  function anyToSockaddrGOOS (line 45) | func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  function nametomib (line 50) | func nametomib(name string) (mib []_C_int, err error) {
  function direntIno (line 77) | func direntIno(buf []byte) (uint64, bool) {
  function direntReclen (line 81) | func direntReclen(buf []byte) (uint64, bool) {
  function direntNamlen (line 85) | func direntNamlen(buf []byte) (uint64, bool) {
  function Pipe (line 89) | func Pipe(p []int) (err error) {
  function Pipe2 (line 95) | func Pipe2(p []int, flags int) error {
  function GetsockoptIPMreqn (line 108) | func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
  function SetsockoptIPMreqn (line 115) | func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
  function GetsockoptXucred (line 121) | func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
  function Accept4 (line 128) | func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
  function Getfsstat (line 148) | func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
  function Uname (line 170) | func Uname(uname *Utsname) error {
  function Stat (line 217) | func Stat(path string, st *Stat_t) (err error) {
  function Lstat (line 221) | func Lstat(path string, st *Stat_t) (err error) {
  function Getdents (line 225) | func Getdents(fd int, buf []byte) (n int, err error) {
  function Getdirentries (line 229) | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
  function Mknod (line 247) | func Mknod(path string, mode uint32, dev uint64) (err error) {
  function Sendfile (line 251) | func Sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function PtraceAttach (line 261) | func PtraceAttach(pid int) (err error) {
  function PtraceCont (line 265) | func PtraceCont(pid int, signal int) (err error) {
  function PtraceDetach (line 269) | func PtraceDetach(pid int) (err error) {
  function PtraceGetFpRegs (line 273) | func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) {
  function PtraceGetRegs (line 277) | func PtraceGetRegs(pid int, regsout *Reg) (err error) {
  function PtraceIO (line 281) | func PtraceIO(req int, pid int, offs uintptr, out []byte, countin int) (...
  function PtraceLwpEvents (line 298) | func PtraceLwpEvents(pid int, enable int) (err error) {
  function PtraceLwpInfo (line 302) | func PtraceLwpInfo(pid int, info *PtraceLwpInfoStruct) (err error) {
  function PtracePeekData (line 306) | func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err e...
  function PtracePeekText (line 310) | func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err e...
  function PtracePokeData (line 314) | func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err ...
  function PtracePokeText (line 318) | func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err ...
  function PtraceSetRegs (line 322) | func PtraceSetRegs(pid int, regs *Reg) (err error) {
  function PtraceSingleStep (line 326) | func PtraceSingleStep(pid int) (err error) {
  function Dup3 (line 330) | func Dup3(oldfd, newfd, flags int) error {

FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 22) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 28) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 32) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 36) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 40) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetLen (line 44) | func (d *PtraceIoDesc) SetLen(length int) {
  function sendfile (line 48) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Syscall9 (line 60) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...
  function PtraceGetFsBase (line 62) | func PtraceGetFsBase(pid int, fsbase *int64) (err error) {

FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 22) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 28) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 32) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 36) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 40) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetLen (line 44) | func (d *PtraceIoDesc) SetLen(length int) {
  function sendfile (line 48) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Syscall9 (line 60) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...
  function PtraceGetFsBase (line 62) | func PtraceGetFsBase(pid int, fsbase *int64) (err error) {

FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 22) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 28) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 32) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 36) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 40) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetLen (line 44) | func (d *PtraceIoDesc) SetLen(length int) {
  function sendfile (line 48) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Syscall9 (line 60) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...

FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 22) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 28) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 32) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 36) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 40) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetLen (line 44) | func (d *PtraceIoDesc) SetLen(length int) {
  function sendfile (line 48) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Syscall9 (line 60) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...

FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
  function setTimespec (line 14) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 18) | func setTimeval(sec, usec int64) Timeval {
  function SetKevent (line 22) | func SetKevent(k *Kevent_t, fd, mode, flags int) {
  method SetLen (line 28) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 32) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 36) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 40) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetLen (line 44) | func (d *PtraceIoDesc) SetLen(length int) {
  function sendfile (line 48) | func sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Syscall9 (line 60) | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 u...

FILE: vendor/golang.org/x/sys/unix/syscall_hurd.go
  function ioctl (line 15) | func ioctl(fd int, req uint, arg uintptr) (err error) {
  function ioctlPtr (line 23) | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {

FILE: vendor/golang.org/x/sys/unix/syscall_hurd_386.go
  constant TIOCGETA (line 10) | TIOCGETA = 0x62251713
  type Winsize (line 13) | type Winsize struct
  type Termios (line 20) | type Termios struct

FILE: vendor/golang.org/x/sys/unix/syscall_illumos.go
  function bytes2iovec (line 15) | func bytes2iovec(bs [][]byte) []Iovec {
  function Readv (line 30) | func Readv(fd int, iovs [][]byte) (n int, err error) {
  function Preadv (line 38) | func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) {
  function Writev (line 46) | func Writev(fd int, iovs [][]byte) (n int, err error) {
  function Pwritev (line 54) | func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) {
  function Accept4 (line 62) | func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {

FILE: vendor/golang.org/x/sys/unix/syscall_linux.go
  function Access (line 26) | func Access(path string, mode uint32) (err error) {
  function Chmod (line 30) | func Chmod(path string, mode uint32) (err error) {
  function Chown (line 34) | func Chown(path string, uid int, gid int) (err error) {
  function Creat (line 38) | func Creat(path string, mode uint32) (fd int, err error) {
  function EpollCreate (line 42) | func EpollCreate(size int) (fd int, err error) {
  function FanotifyMark (line 52) | func FanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname s...
  function Fchmodat (line 66) | func Fchmodat(dirfd int, path string, mode uint32, flags int) error {
  function InotifyInit (line 85) | func InotifyInit() (fd int, err error) {
  function Link (line 104) | func Link(oldpath string, newpath string) (err error) {
  function Mkdir (line 108) | func Mkdir(path string, mode uint32) (err error) {
  function Mknod (line 112) | func Mknod(path string, mode uint32, dev int) (err error) {
  function Open (line 116) | func Open(path string, mode int, perm uint32) (fd int, err error) {
  function Openat (line 122) | func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err...
  function Openat2 (line 128) | func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) {
  function Pipe (line 132) | func Pipe(p []int) error {
  function Pipe2 (line 138) | func Pipe2(p []int, flags int) error {
  function Ppoll (line 153) | func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, e...
  function Poll (line 160) | func Poll(fds []PollFd, timeout int) (n int, err error) {
  function Readlink (line 171) | func Readlink(path string, buf []byte) (n int, err error) {
  function Rename (line 175) | func Rename(oldpath string, newpath string) (err error) {
  function Rmdir (line 179) | func Rmdir(path string) error {
  function Symlink (line 185) | func Symlink(oldpath string, newpath string) (err error) {
  function Unlink (line 189) | func Unlink(path string) error {
  function Utimes (line 195) | func Utimes(path string, tv []Timeval) error {
  function UtimesNano (line 218) | func UtimesNano(path string, ts []Timespec) error {
  function UtimesNanoAt (line 222) | func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
  function Futimesat (line 232) | func Futimesat(dirfd int, path string, tv []Timeval) error {
  function Futimes (line 242) | func Futimes(fd int, tv []Timeval) (err error) {
  constant ImplementsGetwd (line 248) | ImplementsGetwd = true
  function Getwd (line 252) | func Getwd() (wd string, err error) {
  function Getgroups (line 272) | func Getgroups() (gids []int, err error) {
  function Setgroups (line 298) | func Setgroups(gids []int) (err error) {
  type WaitStatus (line 310) | type WaitStatus
    method Exited (line 329) | func (w WaitStatus) Exited() bool { return w&mask == exited }
    method Signaled (line 331) | func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&ma...
    method Stopped (line 333) | func (w WaitStatus) Stopped() bool { return w&0xFF == stopped }
    method Continued (line 335) | func (w WaitStatus) Continued() bool { return w == 0xFFFF }
    method CoreDump (line 337) | func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core !=...
    method ExitStatus (line 339) | func (w WaitStatus) ExitStatus() int {
    method Signal (line 346) | func (w WaitStatus) Signal() syscall.Signal {
    method StopSignal (line 353) | func (w WaitStatus) StopSignal() syscall.Signal {
    method TrapCause (line 360) | func (w WaitStatus) TrapCause() int {
  constant mask (line 322) | mask    = 0x7F
  constant core (line 323) | core    = 0x80
  constant exited (line 324) | exited  = 0x00
  constant stopped (line 325) | stopped = 0x7F
  constant shift (line 326) | shift   = 8
  function Wait4 (line 369) | func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (w...
  function Mkfifo (line 380) | func Mkfifo(path string, mode uint32) error {
  function Mkfifoat (line 384) | func Mkfifoat(dirfd int, path string, mode uint32) error {
  method sockaddr (line 388) | func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 400) | func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
  method sockaddr (line 413) | func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrLinklayer (line 439) | type SockaddrLinklayer struct
    method sockaddr (line 449) | func (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, err...
  type SockaddrNetlink (line 464) | type SockaddrNetlink struct
    method sockaddr (line 472) | func (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrHCI (line 482) | type SockaddrHCI struct
    method sockaddr (line 488) | func (sa *SockaddrHCI) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrL2 (line 497) | type SockaddrL2 struct
    method sockaddr (line 505) | func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrRFCOMM (line 543) | type SockaddrRFCOMM struct
    method sockaddr (line 554) | func (sa *SockaddrRFCOMM) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrCAN (line 578) | type SockaddrCAN struct
    method sockaddr (line 585) | func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrCANJ1939 (line 606) | type SockaddrCANJ1939 struct
    method sockaddr (line 614) | func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, erro...
  type SockaddrALG (line 695) | type SockaddrALG struct
    method sockaddr (line 703) | func (sa *SockaddrALG) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrVM (line 726) | type SockaddrVM struct
    method sockaddr (line 738) | func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrXDP (line 747) | type SockaddrXDP struct
    method sockaddr (line 755) | func (sa *SockaddrXDP) sockaddr() (unsafe.Pointer, _Socklen, error) {
  constant px_proto_oe (line 772) | px_proto_oe = 0
  type SockaddrPPPoE (line 774) | type SockaddrPPPoE struct
    method sockaddr (line 781) | func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrTIPC (line 812) | type SockaddrTIPC struct
    method sockaddr (line 861) | func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type TIPCAddr (line 832) | type TIPCAddr interface
  method tipcAddr (line 837) | func (sa *TIPCSocketAddr) tipcAddr() [12]byte {
  method tipcAddrtype (line 843) | func (sa *TIPCSocketAddr) tipcAddrtype() uint8 { return TIPC_SOCKET_ADDR }
  method tipcAddr (line 845) | func (sa *TIPCServiceRange) tipcAddr() [12]byte {
  method tipcAddrtype (line 851) | func (sa *TIPCServiceRange) tipcAddrtype() uint8 { return TIPC_SERVICE_R...
  method tipcAddr (line 853) | func (sa *TIPCServiceName) tipcAddr() [12]byte {
  method tipcAddrtype (line 859) | func (sa *TIPCServiceName) tipcAddrtype() uint8 { return TIPC_SERVICE_AD...
  type SockaddrL2TPIP (line 873) | type SockaddrL2TPIP struct
    method sockaddr (line 879) | func (sa *SockaddrL2TPIP) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrL2TPIP6 (line 887) | type SockaddrL2TPIP6 struct
    method sockaddr (line 894) | func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrIUCV (line 903) | type SockaddrIUCV struct
    method sockaddr (line 909) | func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrNFC (line 931) | type SockaddrNFC struct
    method sockaddr (line 938) | func (sa *SockaddrNFC) sockaddr() (unsafe.Pointer, _Socklen, error) {
  type SockaddrNFCLLCP (line 946) | type SockaddrNFCLLCP struct
    method sockaddr (line 956) | func (sa *SockaddrNFCLLCP) sockaddr() (unsafe.Pointer, _Socklen, error) {
  function anyToSockaddr (line 975) | func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  function Accept (line 1235) | func Accept(fd int) (nfd int, sa Sockaddr, err error) {
  function Accept4 (line 1250) | func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
  function Getsockname (line 1268) | func Getsockname(fd int) (sa Sockaddr, err error) {
  function GetsockoptIPMreqn (line 1277) | func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
  function GetsockoptUcred (line 1284) | func GetsockoptUcred(fd, level, opt int) (*Ucred, error) {
  function GetsockoptTCPInfo (line 1291) | func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
  function GetsockoptString (line 1300) | func GetsockoptString(fd, level, opt int) (string, error) {
  function GetsockoptTpacketStats (line 1316) | func GetsockoptTpacketStats(fd, level, opt int) (*TpacketStats, error) {
  function GetsockoptTpacketStatsV3 (line 1323) | func GetsockoptTpacketStatsV3(fd, level, opt int) (*TpacketStatsV3, erro...
  function SetsockoptIPMreqn (line 1330) | func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
  function SetsockoptPacketMreq (line 1334) | func SetsockoptPacketMreq(fd, level, opt int, mreq *PacketMreq) error {
  function SetsockoptSockFprog (line 1340) | func SetsockoptSockFprog(fd, level, opt int, fprog *SockFprog) error {
  function SetsockoptCanRawFilter (line 1344) | func SetsockoptCanRawFilter(fd, level, opt int, filter []CanFilter) error {
  function SetsockoptTpacketReq (line 1352) | func SetsockoptTpacketReq(fd, level, opt int, tp *TpacketReq) error {
  function SetsockoptTpacketReq3 (line 1356) | func SetsockoptTpacketReq3(fd, level, opt int, tp *TpacketReq3) error {
  function SetsockoptTCPRepairOpt (line 1360) | func SetsockoptTCPRepairOpt(fd, level, opt int, o []TCPRepairOpt) (err e...
  function SetsockoptTCPMD5Sig (line 1367) | func SetsockoptTCPMD5Sig(fd, level, opt int, s *TCPMD5Sig) error {
  function KeyctlString (line 1387) | func KeyctlString(cmd int, id int) (string, error) {
  function KeyctlGetKeyringID (line 1416) | func KeyctlGetKeyringID(id int, create bool) (ringid int, err error) {
  function KeyctlSetperm (line 1429) | func KeyctlSetperm(id int, perm uint32) error {
  function KeyctlJoinSessionKeyring (line 1439) | func KeyctlJoinSessionKeyring(name string) (ringid int, err error) {
  function KeyctlSearch (line 1448) | func KeyctlSearch(ringid int, keyType, description string, destRingid in...
  function KeyctlInstantiateIOV (line 1459) | func KeyctlInstantiateIOV(id int, payload []Iovec, ringid int) error {
  function KeyctlDHCompute (line 1474) | func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, e...
  function KeyctlRestrictKeyring (line 1496) | func KeyctlRestrictKeyring(ringid int, keyType string, restriction strin...
  function recvmsgRaw (line 1506) | func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSock...
  function sendmsgN (line 1541) | func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen...
  function BindToDevice (line 1580) | func BindToDevice(fd int, device string) (err error) {
  function ptracePeek (line 1587) | func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, ...
  function PtracePeekText (line 1627) | func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err e...
  function PtracePeekData (line 1631) | func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err e...
  function PtracePeekUser (line 1635) | func PtracePeekUser(pid int, addr uintptr, out []byte) (count int, err e...
  function ptracePoke (line 1639) | func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []...
  function PtracePokeText (line 1690) | func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err ...
  function PtracePokeData (line 1694) | func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err ...
  function PtracePokeUser (line 1698) | func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err ...
  constant elfNT_PRSTATUS (line 1705) | elfNT_PRSTATUS = 1
  function PtraceGetRegs (line 1707) | func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
  function PtraceSetRegs (line 1714) | func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
  function PtraceSetOptions (line 1721) | func PtraceSetOptions(pid int, options int) (err error) {
  function PtraceGetEventMsg (line 1725) | func PtraceGetEventMsg(pid int) (msg uint, err error) {
  function PtraceCont (line 1732) | func PtraceCont(pid int, signal int) (err error) {
  function PtraceSyscall (line 1736) | func PtraceSyscall(pid int, signal int) (err error) {
  function PtraceSingleStep (line 1740) | func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLE...
  function PtraceInterrupt (line 1742) | func PtraceInterrupt(pid int) (err error) { return ptrace(PTRACE_INTERRU...
  function PtraceAttach (line 1744) | func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pi...
  function PtraceSeize (line 1746) | func PtraceSeize(pid int) (err error) { return ptrace(PTRACE_SEIZE, pid,...
  function PtraceDetach (line 1748) | func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pi...
  function Reboot (line 1752) | func Reboot(cmd int) (err error) {
  function direntIno (line 1756) | func direntIno(buf []byte) (uint64, bool) {
  function direntReclen (line 1760) | func direntReclen(buf []byte) (uint64, bool) {
  function direntNamlen (line 1764) | func direntNamlen(buf []byte) (uint64, bool) {
  function Mount (line 1774) | func Mount(source string, target string, fstype string, flags uintptr, d...
  function MountSetattr (line 1793) | func MountSetattr(dirfd int, pathname string, flags uint, attr *MountAtt...
  function Sendfile (line 1797) | func Sendfile(outfd int, infd int, offset *int64, count int) (written in...
  function Dup2 (line 1828) | func Dup2(oldfd, newfd int) error {
  function fsconfigCommon (line 1855) | func fsconfigCommon(fd int, cmd uint, key string, value *byte, aux int) ...
  function FsconfigSetFlag (line 1868) | func FsconfigSetFlag(fd int, key string) (err error) {
  function FsconfigSetString (line 1878) | func FsconfigSetString(fd int, key string, value string) (err error) {
  function FsconfigSetBinary (line 1892) | func FsconfigSetBinary(fd int, key string, value []byte) (err error) {
  function FsconfigSetPath (line 1906) | func FsconfigSetPath(fd int, key string, path string, atfd int) (err err...
  function FsconfigSetPathEmpty (line 1917) | func FsconfigSetPathEmpty(fd int, key string, path string, atfd int) (er...
  function FsconfigSetFd (line 1931) | func FsconfigSetFd(fd int, key string, value int) (err error) {
  function FsconfigCreate (line 1939) | func FsconfigCreate(fd int) (err error) {
  function FsconfigReconfigure (line 1947) | func FsconfigReconfigure(fd int) (err error) {
  function Getpgrp (line 1954) | func Getpgrp() (pid int) {
  function syscall_prlimit (line 2000) | func syscall_prlimit(pid, resource int, newlimit, old *syscall.Rlimit) e...
  function Prlimit (line 2002) | func Prlimit(pid, resource int, newlimit, old *Rlimit) error {
  function PrctlRetInt (line 2011) | func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, a...
  function Setuid (line 2019) | func Setuid(uid int) (err error) {
  function Setgid (line 2023) | func Setgid(gid int) (err error) {
  function Setreuid (line 2027) | func Setreuid(ruid, euid int) (err error) {
  function Setregid (line 2031) | func Setregid(rgid, egid int) (err error) {
  function Setresuid (line 2035) | func Setresuid(ruid, euid, suid int) (err error) {
  function Setresgid (line 2039) | func Setresgid(rgid, egid, sgid int) (err error) {
  function SetfsgidRetGid (line 2046) | func SetfsgidRetGid(gid int) (int, error) {
  function SetfsuidRetUid (line 2053) | func SetfsuidRetUid(uid int) (int, error) {
  function Setfsgid (line 2057) | func Setfsgid(gid int) error {
  function Setfsuid (line 2062) | func Setfsuid(uid int) error {
  function Signalfd (line 2067) | func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err erro...
  constant minIovec (line 2103) | minIovec = 8
  function appendBytes (line 2106) | func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
  function offs2lohi (line 2121) | func offs2lohi(offs int64) (lo, hi uintptr) {
  function Readv (line 2126) | func Readv(fd int, iovs [][]byte) (n int, err error) {
  function Preadv (line 2134) | func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
  function Preadv2 (line 2143) | func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err...
  function readvRacedetect (line 2152) | func readvRacedetect(iovecs []Iovec, n int, err error) {
  function Writev (line 2171) | func Writev(fd int, iovs [][]byte) (n int, err error) {
  function Pwritev (line 2182) | func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
  function Pwritev2 (line 2194) | func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, er...
  function writevRacedetect (line 2206) | func writevRacedetect(iovecs []Iovec, n int) {
  constant mremapFixed (line 2234) | mremapFixed     = MREMAP_FIXED
  constant mremapDontunmap (line 2235) | mremapDontunmap = MREMAP_DONTUNMAP
  constant mremapMaymove (line 2236) | mremapMaymove   = MREMAP_MAYMOVE
  function Vmsplice (line 2241) | func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
  function isGroupMember (line 2255) | func isGroupMember(gid int) bool {
  function isCapDacOverrideSet (line 2269) | func isCapDacOverrideSet() bool {
  function Faccessat (line 2280) | func Faccessat(dirfd int, path string, mode uint32, flags int) (err erro...
  type fileHandle (line 2367) | type fileHandle struct
  type FileHandle (line 2375) | type FileHandle struct
    method Size (line 2390) | func (fh *FileHandle) Size() int   { return int(fh.fileHandle.Bytes) }
    method Type (line 2391) | func (fh *FileHandle) Type() int32 { return fh.fileHandle.Type }
    method Bytes (line 2392) | func (fh *FileHandle) Bytes() []byte {
  function NewFileHandle (line 2380) | func NewFileHandle(handleType int32, handle []byte) FileHandle {
  function NameToHandleAt (line 2402) | func NameToHandleAt(dirfd int, path string, flags int) (handle FileHandl...
  function OpenByHandleAt (line 2431) | func OpenByHandleAt(mountFD int, handle FileHandle, flags int) (fd int, ...
  function Klogset (line 2437) | func Klogset(typ int, arg int) (err error) {
  type RemoteIovec (line 2450) | type RemoteIovec struct
  function MakeItimerval (line 2471) | func MakeItimerval(interval, value time.Duration) Itimerval {
  type ItimerWhich (line 2480) | type ItimerWhich
  constant ItimerReal (line 2484) | ItimerReal    ItimerWhich = ITIMER_REAL
  constant ItimerVirtual (line 2485) | ItimerVirtual ItimerWhich = ITIMER_VIRTUAL
  constant ItimerProf (line 2486) | ItimerProf    ItimerWhich = ITIMER_PROF
  function Getitimer (line 2491) | func Getitimer(which ItimerWhich) (Itimerval, error) {
  function Setitimer (line 2504) | func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) {
  function PthreadSigmask (line 2515) | func PthreadSigmask(how int, set, oldset *Sigset_t) error {
  function Getresuid (line 2526) | func Getresuid() (ruid, euid, suid int) {
  function Getresgid (line 2532) | func Getresgid() (rgid, egid, sgid int) {
  function Pselect (line 2540) | func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, s...
  function SchedSetAttr (line 2576) | func SchedSetAttr(pid int, attr *SchedAttr, flags uint) error {
  function SchedGetAttr (line 2586) | func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) {

FILE: vendor/golang.org/x/sys/unix/syscall_linux_386.go
  function setTimespec (line 13) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 17) | func setTimeval(sec, usec int64) Timeval {
  function mmap (line 55) | func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, off...
  type rlimit32 (line 63) | type rlimit32 struct
  constant rlimInf32 (line 70) | rlimInf32 = ^uint32(0)
  constant rlimInf64 (line 71) | rlimInf64 = ^uint64(0)
  function Getrlimit (line 73) | func Getrlimit(resource int, rlim *Rlimit) (err error) {
  function Seek (line 99) | func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
  constant _SOCKET (line 122) | _SOCKET      = 1
  constant _BIND (line 123) | _BIND        = 2
  constant _CONNECT (line 124) | _CONNECT     = 3
  constant _LISTEN (line 125) | _LISTEN      = 4
  constant _ACCEPT (line 126) | _ACCEPT      = 5
  constant _GETSOCKNAME (line 127) | _GETSOCKNAME = 6
  constant _GETPEERNAME (line 128) | _GETPEERNAME = 7
  constant _SOCKETPAIR (line 129) | _SOCKETPAIR  = 8
  constant _SEND (line 130) | _SEND        = 9
  constant _RECV (line 131) | _RECV        = 10
  constant _SENDTO (line 132) | _SENDTO      = 11
  constant _RECVFROM (line 133) | _RECVFROM    = 12
  constant _SHUTDOWN (line 134) | _SHUTDOWN    = 13
  constant _SETSOCKOPT (line 135) | _SETSOCKOPT  = 14
  constant _GETSOCKOPT (line 136) | _GETSOCKOPT  = 15
  constant _SENDMSG (line 137) | _SENDMSG     = 16
  constant _RECVMSG (line 138) | _RECVMSG     = 17
  constant _ACCEPT4 (line 139) | _ACCEPT4     = 18
  constant _RECVMMSG (line 140) | _RECVMMSG    = 19
  constant _SENDMMSG (line 141) | _SENDMMSG    = 20
  function accept4 (line 144) | func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (...
  function getsockname (line 152) | func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err err...
  function getpeername (line 160) | func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err err...
  function socketpair (line 168) | func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {
  function bind (line 176) | func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
  function connect (line 184) | func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
  function socket (line 192) | func socket(domain int, typ int, proto int) (fd int, err error) {
  function getsockopt (line 200) | func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *...
  function setsockopt (line 208) | func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen u...
  function recvfrom (line 216) | func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen ...
  function sendto (line 228) | func sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Sock...
  function recvmsg (line 240) | func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
  function sendmsg (line 248) | func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
  function Listen (line 256) | func Listen(s int, n int) (err error) {
  function Shutdown (line 264) | func Shutdown(s, how int) (err error) {
  function Fstatfs (line 272) | func Fstatfs(fd int, buf *Statfs_t) (err error) {
  function Statfs (line 280) | func Statfs(path string, buf *Statfs_t) (err error) {
  method PC (line 292) | func (r *PtraceRegs) PC() uint64 { return uint64(uint32(r.Eip)) }
  method SetPC (line 294) | func (r *PtraceRegs) SetPC(pc uint64) { r.Eip = int32(pc) }
  method SetLen (line 296) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 300) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 304) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 308) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetServiceNameLen (line 312) | func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {

FILE: vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
  function Lstat (line 26) | func Lstat(path string, stat *Stat_t) (err error) {
  function Select (line 37) | func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n ...
  function Stat (line 51) | func Stat(path string, stat *Stat_t) (err error) {
  function Gettimeofday (line 79) | func Gettimeofday(tv *Timeval) (err error) {
  function Time (line 87) | func Time(t *Time_t) (tt Time_t, err error) {
  function setTimespec (line 102) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 106) | func setTimeval(sec, usec int64) Timeval {
  method PC (line 110) | func (r *PtraceRegs) PC() uint64 { return r.Rip }
  method SetPC (line 112) | func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc }
  method SetLen (line 114) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 118) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 122) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 126) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetServiceNameLen (line 130) | func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
  function KexecFileLoad (line 136) | func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int...

FILE: vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go
  function gettimeofday (line 12) | func gettimeofday(tv *Timeval) (err syscall.Errno)

FILE: vendor/golang.org/x/sys/unix/syscall_linux_arm.go
  function setTimespec (line 13) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 17) | func setTimeval(sec, usec int64) Timeval {
  function Seek (line 21) | func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
  function Time (line 72) | func Time(t *Time_t) (Time_t, error) {
  function Utime (line 84) | func Utime(path string, buf *Utimbuf) error {
  function Fadvise (line 99) | func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
  function Fstatfs (line 109) | func Fstatfs(fd int, buf *Statfs_t) (err error) {
  function Statfs (line 117) | func Statfs(path string, buf *Statfs_t) (err error) {
  function mmap (line 129) | func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, off...
  type rlimit32 (line 137) | type rlimit32 struct
  constant rlimInf32 (line 144) | rlimInf32 = ^uint32(0)
  constant rlimInf64 (line 145) | rlimInf64 = ^uint64(0)
  function Getrlimit (line 147) | func Getrlimit(resource int, rlim *Rlimit) (err error) {
  method PC (line 173) | func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }
  method SetPC (line 175) | func (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) }
  method SetLen (line 177) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 181) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 185) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 189) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetServiceNameLen (line 193) | func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
  function SyncFileRange (line 199) | func SyncFileRange(fd int, off int64, n int64, flags int) error {
  function KexecFileLoad (line 207) | func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int...

FILE: vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
  function Select (line 30) | func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n ...
  function Stat (line 44) | func Stat(path string, stat *Stat_t) (err error) {
  function Lchown (line 48) | func Lchown(path string, uid int, gid int) (err error) {
  function Lstat (line 52) | func Lstat(path string, stat *Stat_t) (err error) {
  function Ustat (line 60) | func Ustat(dev int, ubuf *Ustat_t) (err error) {
  function setTimespec (line 83) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 87) | func setTimeval(sec, usec int64) Timeval {
  function futimesat (line 91) | func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
  function Time (line 103) | func Time(t *Time_t) (Time_t, error) {
  function Utime (line 115) | func Utime(path string, buf *Utimbuf) error {
  function utimes (line 123) | func utimes(path string, tv *[2]Timeval) (err error) {
  function Getrlimit (line 136) | func Getrlimit(resource int, rlim *Rlimit) error {
  method PC (line 144) | func (r *PtraceRegs) PC() uint64 { return r.Pc }
  method SetPC (line 146) | func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
  method SetLen (line 148) | func (iov *Iovec) SetLen(length int) {
  method SetControllen (line 152) | func (msghdr *Msghdr) SetControllen(length int) {
  method SetIovlen (line 156) | func (msghdr *Msghdr) SetIovlen(length int) {
  method SetLen (line 160) | func (cmsg *Cmsghdr) SetLen(length int) {
  method SetServiceNameLen (line 164) | func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
  function Pause (line 168) | func Pause() error {
  function KexecFileLoad (line 175) | func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int...

FILE: vendor/golang.org/x/sys/unix/syscall_linux_gc.go
  function SyscallNoError (line 10) | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
  function RawSyscallNoError (line 14) | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)

FILE: vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go
  function seek (line 13) | func seek(fd int, offset int64, whence int) (newoffset int64, err syscal...
  function socketcall (line 15) | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err sy...
  function rawsocketcall (line 16) | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err...

FILE: vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go
  function seek (line 13) | func seek(fd int, offset int64, whence int) (newoffset int64, err syscal...

FILE: vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go
  function seek (line 14) | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
  function socketcall (line 22) | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall....
  function rawsocketcall (line 27) | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, sysca...

FILE: vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go
  function seek (line 14) | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {

FILE: vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
  function Select (line 25) | func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n ...
  function timespecFromStatxTimestamp (line 39) | func timespecFromStatxTimestamp(x StatxTimestamp) Timespec {
  function Fstatat (line 46) | func Fstatat(fd int, path string, stat *Stat_t, flags int) error {
  function Fstat (line 72) | func Fstat(fd int, stat *Stat_t) (err error) {
  function Stat (line 76) | func Stat(path string, stat *Stat_t) (err error) {
  function Lchown (line 80) | func Lchown(path string, uid int, gid int) (err error) {
  function Lstat (line 84) | func Lstat(path string, stat *Stat_t) (err error) {
  function Ustat (line 92) | func Ustat(dev int, ubuf *Ustat_t) (err error) {
  function setTimespec (line 115) | func setTimespec(sec, nsec int64) Timespec {
  function setTimeval (line 119) | func setTimeval(sec, usec int64) Timeval {
  function Getrlimit (line 123) | func Getrlimit(resource int, rlim *Rlimit) (err error) {
  function futimesat (line 128) | func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
  function Time (line 140) | func Time(t *Time_t) (Time_t, error) {
  func
Condensed preview — 581 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (9,768K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 87,
    "preview": "# These are supported funding model platforms\n\nopen_collective: webhook\ngithub: adnanh\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "chars": 110,
    "preview": "<!-- Love webhook? Please consider supporting our collective:\n👉  https://opencollective.com/webhook/donate -->"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 813,
    "preview": "name: build\non: [push, pull_request]\njobs:\n  build:\n    env:\n      # The special value \"local\" tells Go to use the bundl"
  },
  {
    "path": ".gitignore",
    "chars": 57,
    "preview": ".idea\r\n.cover\r\ncoverage\r\nwebhook\r\n/test/hookecho\r\nbuild\r\n"
  },
  {
    "path": ".travis.yml",
    "chars": 352,
    "preview": "language: go\n\ngo:\n  - 1.14.x\n  - master\n\nos:\n  - linux\n  - osx\n  - windows\n\narch:\n  - amd64\n  - arm64\n\nmatrix:\n  fast_fi"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 4474,
    "preview": "# Contribute\n\n## Introduction\n\nFirst, thank you for considering contributing to webhook! It's people like you that make "
  },
  {
    "path": "LICENSE",
    "chars": 1102,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Adnan Hajdarevic <adnanh@gmail.com>\n\nPermission is hereby granted, free of cha"
  },
  {
    "path": "Makefile",
    "chars": 1223,
    "preview": "OS = darwin freebsd linux openbsd\nARCHS = 386 arm amd64 arm64\n\n.DEFAULT_GOAL := help\n\n.PHONY: help\nhelp:\n\t@grep -E '^[a-"
  },
  {
    "path": "README.md",
    "chars": 17721,
    "preview": "# What is webhook? ![build-status][badge]\r\n\r\n <img src=\"https://github.com/adnanh/webhook/raw/development/docs/logo/logo"
  },
  {
    "path": "docs/Hook-Definition.md",
    "chars": 4435,
    "preview": "# Hook definition\n\nHooks are defined as objects in the JSON or YAML hooks configuration file. Please note that in order "
  },
  {
    "path": "docs/Hook-Examples.md",
    "chars": 22782,
    "preview": "# Hook Examples\r\n\r\nHooks are defined in a hooks configuration file in either JSON or YAML format,\r\nalthough the examples"
  },
  {
    "path": "docs/Hook-Rules.md",
    "chars": 6112,
    "preview": "# Hook rules\n\n### Table of Contents\n\n* [And](#and)\n* [Or](#or)\n* [Not](#not)\n* [Multi-level](#multi-level)\n* [Match](#ma"
  },
  {
    "path": "docs/Referencing-Request-Values.md",
    "chars": 2877,
    "preview": "# Referencing request values\nThere are four types of request values:\n\n1. HTTP Request Header values\n\n    ```json\n    {\n "
  },
  {
    "path": "docs/Systemd-Activation.md",
    "chars": 2540,
    "preview": "# Using systemd socket activation\n\n_New in v2.8.2_\n\nOn platforms that use [systemd](https://systemd.io), [webhook][w] \ns"
  },
  {
    "path": "docs/Templates.md",
    "chars": 3137,
    "preview": "# Templates in Webhook\n\n[`webhook`][w] can parse a hooks configuration file as a Go template when given the `-template` "
  },
  {
    "path": "docs/Webhook-Parameters.md",
    "chars": 2669,
    "preview": "# Webhook parameters\n```\nUsage of webhook:\n  -cert string\n        path to the HTTPS certificate pem file (default \"cert."
  },
  {
    "path": "droppriv_nope.go",
    "chars": 183,
    "preview": "// +build windows\n\npackage main\n\nimport (\n\t\"errors\"\n\t\"runtime\"\n)\n\nfunc dropPrivileges(uid, gid int) error {\n\treturn erro"
  },
  {
    "path": "droppriv_unix.go",
    "chars": 310,
    "preview": "// +build linux !windows\n\npackage main\n\nimport (\n\t\"syscall\"\n)\n\nfunc dropPrivileges(uid, gid int) error {\n\terr := syscall"
  },
  {
    "path": "go.mod",
    "chars": 623,
    "preview": "module github.com/adnanh/webhook\n\ngo 1.21\n\ntoolchain go1.22.0\n\nrequire (\n\tgithub.com/Microsoft/go-winio v0.6.2\n\tgithub.c"
  },
  {
    "path": "go.sum",
    "chars": 2819,
    "preview": "github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=\ngithub.com/Microsoft/go-winio v0.6."
  },
  {
    "path": "hooks.json.example",
    "chars": 1166,
    "preview": "[\n  {\n    \"id\": \"webhook\",\n    \"execute-command\": \"/home/adnan/redeploy-go-webhook.sh\",\n    \"command-working-directory\":"
  },
  {
    "path": "hooks.json.tmpl.example",
    "chars": 1192,
    "preview": "[\n  {\n    \"id\": \"webhook\",\n    \"execute-command\": \"/home/adnan/redeploy-go-webhook.sh\",\n    \"command-working-directory\":"
  },
  {
    "path": "hooks.yaml.example",
    "chars": 685,
    "preview": "- id: webhook\n  execute-command: /home/adnan/redeploy-go-webhook.sh\n  command-working-directory: /home/adnan/go\n  respon"
  },
  {
    "path": "hooks.yaml.tmpl.example",
    "chars": 713,
    "preview": "- id: webhook\n  execute-command: /home/adnan/redeploy-go-webhook.sh\n  command-working-directory: /home/adnan/go\n  respon"
  },
  {
    "path": "internal/hook/hook.go",
    "chars": 25947,
    "preview": "package hook\n\nimport (\n\t\"bytes\"\n\t\"crypto/hmac\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"crypto/subtle\"\n\t\"encod"
  },
  {
    "path": "internal/hook/hook_test.go",
    "chars": 33029,
    "preview": "package hook\n\nimport (\n\t\"net/http\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestGetParameter(t *testing.T) {\n\tfor "
  },
  {
    "path": "internal/hook/request.go",
    "chars": 2327,
    "preview": "package hook\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"unicode\"\n\n\t\"github.com/clbanning/mxj/v2"
  },
  {
    "path": "internal/middleware/dumper.go",
    "chars": 2815,
    "preview": "package middleware\n\n// Derived from the Goa project, MIT Licensed\n// https://github.com/goadesign/goa/blob/v3/http/middl"
  },
  {
    "path": "internal/middleware/logger.go",
    "chars": 1434,
    "preview": "package middleware\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/dustin/go-humanize\"\n\t\"github.com/g"
  },
  {
    "path": "internal/middleware/request_id.go",
    "chars": 2335,
    "preview": "package middleware\n\n// Derived from Goa project, MIT Licensed\n// https://github.com/goadesign/goa/blob/v3/http/middlewar"
  },
  {
    "path": "internal/pidfile/README.md",
    "chars": 156,
    "preview": "Package pidfile is derived from github.com/moby/moby/pkg/pidfile.\n\nMoby is licensed under the Apache License, Version 2."
  },
  {
    "path": "internal/pidfile/mkdirall.go",
    "chars": 282,
    "preview": "// +build !windows\n\npackage pidfile\n\nimport \"os\"\n\n// MkdirAll creates a directory named path along with any necessary pa"
  },
  {
    "path": "internal/pidfile/mkdirall_windows.go",
    "chars": 2725,
    "preview": "// +build windows\n\npackage pidfile\n\nimport (\n\t\"os\"\n\t\"regexp\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n// Mkd"
  },
  {
    "path": "internal/pidfile/pidfile.go",
    "chars": 1316,
    "preview": "// Package pidfile provides structure and helper functions to create and remove\n// PID file. A PID file is usually a fil"
  },
  {
    "path": "internal/pidfile/pidfile_darwin.go",
    "chars": 248,
    "preview": "// +build darwin\n\npackage pidfile\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc processExists(pid int) bool {\n\t// OS X does"
  },
  {
    "path": "internal/pidfile/pidfile_test.go",
    "chars": 749,
    "preview": "package pidfile\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestNewAndRemove(t *testing.T) {\n\tdir, "
  },
  {
    "path": "internal/pidfile/pidfile_unix.go",
    "chars": 238,
    "preview": "// +build !windows,!darwin\n\npackage pidfile\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n)\n\nfunc processExists(pid int) b"
  },
  {
    "path": "internal/pidfile/pidfile_windows.go",
    "chars": 416,
    "preview": "package pidfile\n\nimport (\n\t\"golang.org/x/sys/windows\"\n)\n\nconst (\n\tprocessQueryLimitedInformation = 0x1000\n\n\tstillActive "
  },
  {
    "path": "platform_unix.go",
    "chars": 1688,
    "preview": "//go:build !windows\n// +build !windows\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/coreos/go-systemd/v22/activat"
  },
  {
    "path": "platform_windows.go",
    "chars": 512,
    "preview": "//go:build windows\n// +build windows\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/Microsoft/go-winio\"\n\t\"net\"\n)\n\nf"
  },
  {
    "path": "signals.go",
    "chars": 1277,
    "preview": "//go:build !windows\n// +build !windows\n\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc s"
  },
  {
    "path": "signals_windows.go",
    "chars": 126,
    "preview": "// +build windows\n\npackage main\n\nfunc setupSignals() {\n\t// NOOP: Windows doesn't have signals equivalent to the Unix wor"
  },
  {
    "path": "test/hookecho.go",
    "chars": 697,
    "preview": "// Hook Echo is a simply utility used for testing the Webhook package.\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t"
  },
  {
    "path": "test/hooks.json.tmpl",
    "chars": 11941,
    "preview": "[\n  {\n    \"id\": \"github\",\n    \"execute-command\": \"{{ .Hookecho }}\",\n    \"command-working-directory\": \"/\",\n    \"http-meth"
  },
  {
    "path": "test/hooks.yaml.tmpl",
    "chars": 7474,
    "preview": "- id: github\n  http-methods:\n  - \"Post \"\n  trigger-rule:\n    and:\n    - match:\n        parameter:\n          source: head"
  },
  {
    "path": "testutils.go",
    "chars": 665,
    "preview": "//go:build !windows\n// +build !windows\n\npackage main\n\nimport (\n\t\"context\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n"
  },
  {
    "path": "testutils_windows.go",
    "chars": 496,
    "preview": "//go:build windows\n// +build windows\n\npackage main\n\nimport (\n\t\"context\"\n\t\"github.com/Microsoft/go-winio\"\n\t\"net\"\n\t\"net/ht"
  },
  {
    "path": "tls.go",
    "chars": 1458,
    "preview": "package main\n\nimport (\n\t\"crypto/tls\"\n\t\"io\"\n\t\"log\"\n\t\"strings\"\n)\n\nfunc writeTLSSupportedCipherStrings(w io.Writer, min uin"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/.gitattributes",
    "chars": 18,
    "preview": "* text=auto eol=lf"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/.gitignore",
    "chars": 73,
    "preview": ".vscode/\n\n*.exe\n\n# testing\ntestdata\n\n# go workspaces\ngo.work\ngo.work.sum\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/.golangci.yml",
    "chars": 4244,
    "preview": "linters:\n  enable:\n    # style\n    - containedctx # struct contains a context\n    - dupl # duplicate code\n    - errname "
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/CODEOWNERS",
    "chars": 29,
    "preview": "  * @microsoft/containerplat\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/LICENSE",
    "chars": 1077,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Microsoft\n\nPermission is hereby granted, free of charge, to any person obtaini"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/README.md",
    "chars": 3771,
    "preview": "# go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.co"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/SECURITY.md",
    "chars": 2757,
    "preview": "<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->\n\n## Security\n\nMicrosoft takes the security of our software products an"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/backup.go",
    "chars": 8330,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"runtime\""
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/doc.go",
    "chars": 1076,
    "preview": "// This package provides utilities for efficiently performing Win32 IO operations in Go.\n// Currently, this package is p"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/ea.go",
    "chars": 3178,
    "preview": "package winio\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n)\n\ntype fileFullEaInformation struct {\n\tNextEntryOffset ui"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/file.go",
    "chars": 8132,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"runtime\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"syscal"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/fileinfo.go",
    "chars": 3619,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/hvsock.go",
    "chars": 15948,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"time\"\n\t\"u"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/doc.go",
    "chars": 68,
    "preview": "// This package contains Win32 filesystem functionality.\npackage fs\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/fs.go",
    "chars": 10077,
    "preview": "//go:build windows\n\npackage fs\n\nimport (\n\t\"golang.org/x/sys/windows\"\n\n\t\"github.com/Microsoft/go-winio/internal/stringbuf"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/security.go",
    "chars": 469,
    "preview": "package fs\n\n// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level\ntype Secu"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go",
    "chars": 1754,
    "preview": "//go:build windows\n\n// Code generated by 'go generate' using \"github.com/Microsoft/go-winio/tools/mkwinsyscall\"; DO NOT "
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go",
    "chars": 723,
    "preview": "package socket\n\nimport (\n\t\"unsafe\"\n)\n\n// RawSockaddr allows structs to be used with [Bind] and [ConnectEx]. The\n// struc"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/socket/socket.go",
    "chars": 4952,
    "preview": "//go:build windows\n\npackage socket\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/Microsof"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go",
    "chars": 1662,
    "preview": "//go:build windows\n\n// Code generated by 'go generate' using \"github.com/Microsoft/go-winio/tools/mkwinsyscall\"; DO NOT "
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go",
    "chars": 3471,
    "preview": "package stringbuffer\n\nimport (\n\t\"sync\"\n\t\"unicode/utf16\"\n)\n\n// TODO: worth exporting and using in mkwinsyscall?\n\n// Uint1"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pipe.go",
    "chars": 16501,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go",
    "chars": 6198,
    "preview": "// Package guid provides a GUID type. The backing structure for a GUID is\n// identical to that used by the golang.org/x/"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go",
    "chars": 444,
    "preview": "//go:build !windows\n// +build !windows\n\npackage guid\n\n// GUID represents a GUID/UUID. It has the same structure as\n// go"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go",
    "chars": 420,
    "preview": "//go:build windows\n// +build windows\n\npackage guid\n\nimport \"golang.org/x/sys/windows\"\n\n// GUID represents a GUID/UUID. I"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go",
    "chars": 747,
    "preview": "// Code generated by \"stringer -type=Variant -trimprefix=Variant -linecomment\"; DO NOT EDIT.\n\npackage guid\n\nimport \"strc"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/privilege.go",
    "chars": 5565,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"sync\"\n\t\"un"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/reparse.go",
    "chars": 3525,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/ut"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/sd.go",
    "chars": 4368,
    "preview": "//go:build windows\n// +build windows\n\npackage winio\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/syscall.go",
    "chars": 140,
    "preview": "//go:build windows\n\npackage winio\n\n//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscal"
  },
  {
    "path": "vendor/github.com/Microsoft/go-winio/zsyscall_windows.go",
    "chars": 14895,
    "preview": "//go:build windows\n\n// Code generated by 'go generate' using \"github.com/Microsoft/go-winio/tools/mkwinsyscall\"; DO NOT "
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/.travis.yml",
    "chars": 23,
    "preview": "language: go\n\ngo:\n- 1.x"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/LICENSE",
    "chars": 1133,
    "preview": "Copyright (c) 2012-2021 Charles Banning <clbanning@gmail.com>.  All rights reserved.\n\nThe MIT License (MIT)\n\nPermission "
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/anyxml.go",
    "chars": 4348,
    "preview": "package mxj\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"reflect\"\n)\n\nconst (\n\tDefaultElementTag = \"element\"\n)\n\n// Encode arbitra"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/atomFeedString.xml",
    "chars": 2987,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en-us\" updated=\"2009-10-04T01"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/doc.go",
    "chars": 8442,
    "preview": "// mxj - A collection of map[string]interface{} and associated XML and JSON utilities.\n// Copyright 2012-2019, Charles B"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/escapechars.go",
    "chars": 2611,
    "preview": "// Copyright 2016 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/exists.go",
    "chars": 332,
    "preview": "package mxj\n\n// Checks whether the path exists. If err != nil then 'false' is returned\n// along with the error encounter"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files.go",
    "chars": 6345,
    "preview": "package mxj\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype Maps []Map\n\nfunc NewMaps() Maps {\n\treturn make(Maps, 0)\n}\n\ntype MapRaw "
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test.badjson",
    "chars": 107,
    "preview": "{ \"this\":\"is\", \"a\":\"test\", \"file\":\"for\", \"files_test.go\":\"case\" }\n{ \"with\":\"some\", \"bad\":JSON, \"in\":\"it\" }\n"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test.badxml",
    "chars": 135,
    "preview": "<doc>\n\t<some>test</some>\n\t<data>for files.go</data>\n</doc>\n<msg>\n\t<just>some</just>\n\t<another>doc</other>\n\t<for>test cas"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test.json",
    "chars": 123,
    "preview": "{ \"this\":\"is\", \"a\":\"test\", \"file\":\"for\", \"files_test.go\":\"case\" }\n{ \"with\":\"just\", \"two\":2, \"JSON\":\"values\", \"true\":true"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test.xml",
    "chars": 137,
    "preview": "<doc>\n\t<some>test</some>\n\t<data>for files.go</data>\n</doc>\n<msg>\n\t<just>some</just>\n\t<another>doc</another>\n\t<for>test c"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test_dup.json",
    "chars": 111,
    "preview": "{\"a\":\"test\",\"file\":\"for\",\"files_test.go\":\"case\",\"this\":\"is\"}{\"JSON\":\"values\",\"true\":true,\"two\":2,\"with\":\"just\"}"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test_dup.xml",
    "chars": 123,
    "preview": "<doc><data>for files.go</data><some>test</some></doc><msg><another>doc</another><for>test case</for><just>some</just></m"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test_indent.json",
    "chars": 146,
    "preview": "{\n  \"a\": \"test\",\n  \"file\": \"for\",\n  \"files_test.go\": \"case\",\n  \"this\": \"is\"\n}\n{\n  \"JSON\": \"values\",\n  \"true\": true,\n  \"t"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/files_test_indent.xml",
    "chars": 140,
    "preview": "<doc>\n  <data>for files.go</data>\n  <some>test</some>\n</doc><msg>\n  <another>doc</another>\n  <for>test case</for>\n  <jus"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/gob.go",
    "chars": 837,
    "preview": "// gob.go - Encode/Decode a Map into a gob object.\n\npackage mxj\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n)\n\n// NewMapGob retur"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/json.go",
    "chars": 10231,
    "preview": "// Copyright 2012-2014 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/keyvalues.go",
    "chars": 19069,
    "preview": "// Copyright 2012-2014 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/leafnode.go",
    "chars": 3337,
    "preview": "package mxj\n\n// leafnode.go - return leaf nodes with paths and values for the Map\n// inspired by: https://groups.google."
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/misc.go",
    "chars": 2543,
    "preview": "// Copyright 2016 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/mxj.go",
    "chars": 3312,
    "preview": "// mxj - A collection of map[string]interface{} and associated XML and JSON utilities.\n// Copyright 2012-2014 Charles Ba"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/newmap.go",
    "chars": 5860,
    "preview": "// mxj - A collection of map[string]interface{} and associated XML and JSON utilities.\n// Copyright 2012-2014, 2018 Char"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/readme.md",
    "chars": 11729,
    "preview": "<h2>mxj - to/from maps, XML and JSON</h2>\nDecode/encode XML to/from map[string]interface{} (or JSON) values, and extract"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/remove.go",
    "chars": 765,
    "preview": "package mxj\n\nimport \"strings\"\n\n// Removes the path.\nfunc (mv Map) Remove(path string) error {\n\tm := map[string]interface"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/rename.go",
    "chars": 1523,
    "preview": "package mxj\n\nimport (\n\t\"errors\"\n\t\"strings\"\n)\n\n// RenameKey renames a key in a Map.\n// It works only for nested maps. \n//"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/set.go",
    "chars": 529,
    "preview": "package mxj\n\nimport (\n\t\"strings\"\n)\n\n// Sets the value for the path\nfunc (mv Map) SetValueForPath(value interface{}, path"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/setfieldsep.go",
    "chars": 727,
    "preview": "package mxj\n\n// Per: https://github.com/clbanning/mxj/issues/37#issuecomment-278651862\nvar fieldSep string = \":\"\n\n// Set"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/songtext.xml",
    "chars": 1147,
    "preview": "<msg mtype=\"alert\" mpriority=\"1\">\n\t<text>help me!</text>\n\t<song title=\"A Long Time\" author=\"Mayer Hawthorne\">\n\t\t<verses>"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/strict.go",
    "chars": 997,
    "preview": "// Copyright 2016 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/struct.go",
    "chars": 1710,
    "preview": "// Copyright 2012-2017 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/updatevalues.go",
    "chars": 8261,
    "preview": "// Copyright 2012-2014, 2017 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/xml.go",
    "chars": 42332,
    "preview": "// Copyright 2012-2016, 2018-2019 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/xmlseq.go",
    "chars": 29005,
    "preview": "// Copyright 2012-2016, 2019 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style"
  },
  {
    "path": "vendor/github.com/clbanning/mxj/v2/xmlseq2.go",
    "chars": 638,
    "preview": "// Copyright 2012-2016, 2019 Charles Banning. All rights reserved.\n// Use of this source code is governed by a BSD-style"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/v22/LICENSE",
    "chars": 10273,
    "preview": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AN"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/v22/NOTICE",
    "chars": 126,
    "preview": "CoreOS Project\nCopyright 2018 CoreOS, Inc\n\nThis product includes software developed at CoreOS, Inc.\n(http://www.coreos.c"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/v22/activation/files_unix.go",
    "chars": 2001,
    "preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/v22/activation/files_windows.go",
    "chars": 676,
    "preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/v22/activation/listeners.go",
    "chars": 2906,
    "preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/v22/activation/packetconns.go",
    "chars": 1275,
    "preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/.travis.yml",
    "chars": 482,
    "preview": "sudo: false\nlanguage: go\ngo_import_path: github.com/dustin/go-humanize\ngo:\n  - 1.13.x\n  - 1.14.x\n  - 1.15.x\n  - 1.16.x\n "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/LICENSE",
    "chars": 1136,
    "preview": "Copyright (c) 2005-2008  Dustin Sallings <dustin@spy.net>\n\nPermission is hereby granted, free of charge, to any person o"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/README.markdown",
    "chars": 3078,
    "preview": "# Humane Units [![Build Status](https://travis-ci.org/dustin/go-humanize.svg?branch=master)](https://travis-ci.org/dusti"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/big.go",
    "chars": 612,
    "preview": "package humanize\n\nimport (\n\t\"math/big\"\n)\n\n// order of magnitude (to a max order)\nfunc oomm(n, b *big.Int, maxmag int) (f"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/bigbytes.go",
    "chars": 4850,
    "preview": "package humanize\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nvar (\n\tbigIECExp = big.NewInt(1024)\n\n\t// BigByte "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/bytes.go",
    "chars": 2610,
    "preview": "package humanize\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\n// IEC Sizes.\n// kibis of bits\nconst (\n\tBy"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/comma.go",
    "chars": 2476,
    "preview": "package humanize\n\nimport (\n\t\"bytes\"\n\t\"math\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Comma produces a string form of the "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/commaf.go",
    "chars": 762,
    "preview": "//go:build go1.6\n// +build go1.6\n\npackage humanize\n\nimport (\n\t\"bytes\"\n\t\"math/big\"\n\t\"strings\"\n)\n\n// BigCommaf produces a "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/ftoa.go",
    "chars": 986,
    "preview": "package humanize\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc stripTrailingZeros(s string) string {\n\tif !strings.ContainsRune"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/humanize.go",
    "chars": 276,
    "preview": "/*\nPackage humanize converts boring ugly numbers to human-friendly strings and back.\n\nDurations can be turned into strin"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/number.go",
    "chars": 4318,
    "preview": "package humanize\n\n/*\nSlightly adapted from the source to fit go-humanize.\n\nAuthor: https://github.com/gorhill\nSource: ht"
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/ordinals.go",
    "chars": 371,
    "preview": "package humanize\n\nimport \"strconv\"\n\n// Ordinal gives you the input number in a rank/ordinal format.\n//\n// Ordinal(3) -> "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/si.go",
    "chars": 2908,
    "preview": "package humanize\n\nimport (\n\t\"errors\"\n\t\"math\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nvar siPrefixTable = map[float64]string{\n\t-30: \"q\", "
  },
  {
    "path": "vendor/github.com/dustin/go-humanize/times.go",
    "chars": 3239,
    "preview": "package humanize\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n\t\"time\"\n)\n\n// Seconds-based time units\nconst (\n\tDay      = 24 * time.H"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/.cirrus.yml",
    "chars": 479,
    "preview": "freebsd_task:\n  name: 'FreeBSD'\n  freebsd_instance:\n    image_family: freebsd-13-2\n  install_script:\n    - pkg update -f"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/.editorconfig",
    "chars": 196,
    "preview": "root = true\n\n[*.go]\nindent_style = tab\nindent_size = 4\ninsert_final_newline = true\n\n[*.{yml,yaml}]\nindent_style = space\n"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/.gitattributes",
    "chars": 26,
    "preview": "go.sum linguist-generated\n"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/.gitignore",
    "chars": 99,
    "preview": "# go test -c output\n*.test\n*.test.exe\n\n# Output of go build ./cmd/fsnotify\n/fsnotify\n/fsnotify.exe\n"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/.mailmap",
    "chars": 122,
    "preview": "Chris Howey <howeyc@gmail.com> <chris@howey.me>\nNathan Youngman <git@nathany.com> <4566+nathany@users.noreply.github.com"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/CHANGELOG.md",
    "chars": 21242,
    "preview": "# Changelog\n\nUnreleased\n----------\nNothing yet.\n\n1.7.0 - 2023-10-22\n------------------\nThis version of fsnotify needs Go"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md",
    "chars": 1013,
    "preview": "Thank you for your interest in contributing to fsnotify! We try to review and\nmerge PRs in a reasonable timeframe, but p"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/LICENSE",
    "chars": 1529,
    "preview": "Copyright © 2012 The Go Authors. All rights reserved.\nCopyright © fsnotify Authors. All rights reserved.\n\nRedistribution"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/README.md",
    "chars": 7037,
    "preview": "fsnotify is a Go library to provide cross-platform filesystem notifications on\nWindows, Linux, macOS, BSD, and illumos.\n"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/backend_fen.go",
    "chars": 19118,
    "preview": "//go:build solaris\n// +build solaris\n\n// Note: the documentation on the Watcher type and methods is generated from\n// mk"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/backend_inotify.go",
    "chars": 17549,
    "preview": "//go:build linux && !appengine\n// +build linux,!appengine\n\n// Note: the documentation on the Watcher type and methods is"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/backend_kqueue.go",
    "chars": 23361,
    "preview": "//go:build freebsd || openbsd || netbsd || dragonfly || darwin\n// +build freebsd openbsd netbsd dragonfly darwin\n\n// Not"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/backend_other.go",
    "chars": 8763,
    "preview": "//go:build appengine || (!darwin && !dragonfly && !freebsd && !openbsd && !linux && !netbsd && !solaris && !windows)\n// "
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/backend_windows.go",
    "chars": 23483,
    "preview": "//go:build windows\n// +build windows\n\n// Windows backend based on ReadDirectoryChangesW()\n//\n// https://learn.microsoft."
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/fsnotify.go",
    "chars": 4010,
    "preview": "// Package fsnotify provides a cross-platform interface for file system\n// notifications.\n//\n// Currently supported syst"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/mkdoc.zsh",
    "chars": 9512,
    "preview": "#!/usr/bin/env zsh\n[ \"${ZSH_VERSION:-}\" = \"\" ] && echo >&2 \"Only works with zsh\" && exit 1\nsetopt err_exit no_unset pipe"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/system_bsd.go",
    "chars": 213,
    "preview": "//go:build freebsd || openbsd || netbsd || dragonfly\n// +build freebsd openbsd netbsd dragonfly\n\npackage fsnotify\n\nimpor"
  },
  {
    "path": "vendor/github.com/fsnotify/fsnotify/system_darwin.go",
    "chars": 180,
    "preview": "//go:build darwin\n// +build darwin\n\npackage fsnotify\n\nimport \"golang.org/x/sys/unix\"\n\n// note: this constant is not defi"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/.gitignore",
    "chars": 232,
    "preview": "# OSX leaves these everywhere on SMB shares\n._*\n\n# Eclipse files\n.classpath\n.project\n.settings/**\n\n# Emacs save files\n*~"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/.travis.yml",
    "chars": 66,
    "preview": "language: go\ngo:\n  - 1.3\n  - 1.4\nscript:\n  - go test\n  - go build\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/LICENSE",
    "chars": 2557,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Sam Ghods\n\nPermission is hereby granted, free of charge, to any person obtaini"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/README.md",
    "chars": 3188,
    "preview": "# YAML marshaling and unmarshaling support for Go\n\n[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://trav"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/fields.go",
    "chars": 12721,
    "preview": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/ghodss/yaml/yaml.go",
    "chars": 8489,
    "preview": "package yaml\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\n\t\"gopkg.in/yaml.v2\"\n)\n\n// Marshals the ob"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/.gitignore",
    "chars": 20,
    "preview": ".idea\n*.sw?\n.vscode\n"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/CHANGELOG.md",
    "chars": 15854,
    "preview": "# Changelog\n\n## v5.0.12 (2024-02-16)\n\n- History of changes: see https://github.com/go-chi/chi/compare/v5.0.11...v5.0.12\n"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/CONTRIBUTING.md",
    "chars": 1070,
    "preview": "# Contributing\n\n## Prerequisites\n\n1. [Install Go][go-install].\n2. Download the sources and switch the working directory:"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/LICENSE",
    "chars": 1123,
    "preview": "Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc.\n\nMIT License\n\nPermission is hereby"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/Makefile",
    "chars": 490,
    "preview": ".PHONY: all\nall:\n\t@echo \"**********************************************************\"\n\t@echo \"**                    chi b"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/README.md",
    "chars": 23154,
    "preview": "# <img alt=\"chi\" src=\"https://cdn.rawgit.com/go-chi/chi/master/_examples/chi.svg\" width=\"220\" />\n\n\n[![GoDoc Widget]][GoD"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/SECURITY.md",
    "chars": 313,
    "preview": "# Reporting Security Issues\n\nWe appreciate your efforts to responsibly disclose your findings, and will make every effor"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/chain.go",
    "chars": 1517,
    "preview": "package chi\n\nimport \"net/http\"\n\n// Chain returns a Middlewares type from a slice of middleware handlers.\nfunc Chain(midd"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/chi.go",
    "chars": 4615,
    "preview": "// Package chi is a small, idiomatic and composable router for building HTTP services.\n//\n// chi requires Go 1.14 or new"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/context.go",
    "chars": 4826,
    "preview": "package chi\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// URLParam returns the url parameter from a http.Request obj"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/basic_auth.go",
    "chars": 852,
    "preview": "package middleware\n\nimport (\n\t\"crypto/subtle\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// BasicAuth implements a simple middleware handler "
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/clean_path.go",
    "chars": 658,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"path\"\n\n\t\"github.com/go-chi/chi/v5\"\n)\n\n// CleanPath middleware will clean out "
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/compress.go",
    "chars": 11601,
    "preview": "package middleware\n\nimport (\n\t\"bufio\"\n\t\"compress/flate\"\n\t\"compress/gzip\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"ne"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/content_charset.go",
    "chars": 1283,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// ContentCharset generates a handler that writes a 415 Unsupport"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/content_encoding.go",
    "chars": 1087,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// AllowContentEncoding enforces a whitelist of request Content-E"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/content_type.go",
    "chars": 1327,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// SetHeader is a convenience handler to set a response header ke"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/get_head.go",
    "chars": 977,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/go-chi/chi/v5\"\n)\n\n// GetHead automatically route undefined HEAD r"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/heartbeat.go",
    "chars": 755,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// Heartbeat endpoint middleware useful to setting up a path like"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/logger.go",
    "chars": 4978,
    "preview": "package middleware\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\t\"time\"\n)\n\nvar (\n\t// LogEntryCtxKey"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/maybe.go",
    "chars": 636,
    "preview": "package middleware\n\nimport \"net/http\"\n\n// Maybe middleware will allow you to change the flow of the middleware stack exe"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/middleware.go",
    "chars": 684,
    "preview": "package middleware\n\nimport \"net/http\"\n\n// New will create a new middleware handler from a http.Handler.\nfunc New(h http."
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/nocache.go",
    "chars": 1430,
    "preview": "package middleware\n\n// Ported from Goji's middleware, source:\n// https://github.com/zenazn/goji/tree/master/web/middlewa"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/page_route.go",
    "chars": 519,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// PageRoute is a simple middleware which allows you to route a s"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/path_rewrite.go",
    "chars": 422,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// PathRewrite is a simple middleware which allows you to rewrite"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/profiler.go",
    "chars": 1287,
    "preview": "package middleware\n\nimport (\n\t\"expvar\"\n\t\"net/http\"\n\t\"net/http/pprof\"\n\n\t\"github.com/go-chi/chi/v5\"\n)\n\n// Profiler is a co"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/realip.go",
    "chars": 1870,
    "preview": "package middleware\n\n// Ported from Goji's middleware, source:\n// https://github.com/zenazn/goji/tree/master/web/middlewa"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/recoverer.go",
    "chars": 4858,
    "preview": "package middleware\n\n// The original work was derived from Goji's middleware, source:\n// https://github.com/zenazn/goji/t"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/request_id.go",
    "chars": 2966,
    "preview": "package middleware\n\n// Ported from Goji's middleware, source:\n// https://github.com/zenazn/goji/tree/master/web/middlewa"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/request_size.go",
    "chars": 454,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n)\n\n// RequestSize is a middleware that will limit request sizes to a specified\n"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/route_headers.go",
    "chars": 4249,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// RouteHeaders is a neat little header-based router that allows "
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/strip.go",
    "chars": 1690,
    "preview": "package middleware\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/go-chi/chi/v5\"\n)\n\n// StripSlashes is a middleware that wil"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/sunset.go",
    "chars": 700,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"time\"\n)\n\n// Sunset set Deprecation/Sunset header to response\n// This can be u"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/supress_notfound.go",
    "chars": 852,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/go-chi/chi/v5\"\n)\n\n// SupressNotFound will quickly respond with a "
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/terminal.go",
    "chars": 1885,
    "preview": "package middleware\n\n// Ported from Goji's middleware, source:\n// https://github.com/zenazn/goji/tree/master/web/middlewa"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/throttle.go",
    "chars": 3822,
    "preview": "package middleware\n\nimport (\n\t\"net/http\"\n\t\"strconv\"\n\t\"time\"\n)\n\nconst (\n\terrCapacityExceeded = \"Server capacity exceeded."
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/timeout.go",
    "chars": 1222,
    "preview": "package middleware\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"time\"\n)\n\n// Timeout is a middleware that cancels ctx after a given"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/url_format.go",
    "chars": 1786,
    "preview": "package middleware\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/go-chi/chi/v5\"\n)\n\nvar (\n\t// URLFormatCtxKey"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/value.go",
    "chars": 436,
    "preview": "package middleware\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\n// WithValue is a middleware that sets a given key/value in a con"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/middleware/wrap_writer.go",
    "chars": 5441,
    "preview": "package middleware\n\n// The original work was derived from Goji's middleware, source:\n// https://github.com/zenazn/goji/t"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/mux.go",
    "chars": 16163,
    "preview": "package chi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n)\n\nvar _ Router = &Mux{}\n\n// Mux is a simple HTTP"
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/path_value.go",
    "chars": 517,
    "preview": "//go:build go1.22\n// +build go1.22\n\npackage chi\n\nimport \"net/http\"\n\n// supportsPathValue is true if the Go version is 1."
  },
  {
    "path": "vendor/github.com/go-chi/chi/v5/path_value_fallback.go",
    "chars": 524,
    "preview": "//go:build !go1.22\n// +build !go1.22\n\npackage chi\n\nimport \"net/http\"\n\n// supportsPathValue is true if the Go version is "
  }
]

// ... and 381 more files (download for full content)

About this extraction

This page contains the full source code of the adnanh/webhook GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 581 files (8.8 MB), approximately 2.3M tokens, and a symbol index with 95543 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!