├── .dockerignore ├── .drone.yml ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .golangci.json ├── CODE_OF_CONDUCT.md ├── Dockerfile.dapper ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── go.mod ├── go.sum ├── images ├── 00-base │ ├── Dockerfile │ └── archs ├── 03-base │ ├── Dockerfile │ └── archs ├── 05-base │ ├── Dockerfile │ └── archs ├── 10-gobuild │ ├── Dockerfile │ └── gobuild ├── 10-k3s │ └── Dockerfile ├── 10-kernel-stage1 │ ├── Dockerfile │ └── archs ├── 20-progs │ ├── Dockerfile │ └── root ├── 20-rootfs │ ├── Dockerfile │ └── root ├── 30-bin │ ├── Dockerfile │ └── root ├── 40-kernel │ ├── Dockerfile │ └── archs ├── 50-package │ ├── Dockerfile │ └── archs ├── 60-package │ ├── Dockerfile │ └── archs ├── 70-iso │ ├── Dockerfile │ ├── archs │ ├── config.yaml │ ├── grub.cfg │ └── run-kvm.sh ├── 80-tar │ └── Dockerfile └── output │ ├── 01-full │ ├── Dockerfile │ └── archs │ └── 01-lite │ ├── Dockerfile │ └── archs ├── install.sh ├── main.go ├── overlay ├── etc │ ├── conf.d │ │ ├── connman │ │ ├── k3s-service │ │ ├── net-online │ │ ├── udev-coldplug │ │ ├── udev-root │ │ └── wpa_supplicant │ ├── environment │ ├── init.d │ │ ├── ccapply │ │ ├── cloud-config │ │ ├── issue │ │ ├── net-online │ │ ├── udev-coldplug │ │ └── udev-root │ ├── inittab │ ├── issue │ ├── motd │ ├── nsswitch.conf │ ├── profile.d │ │ ├── color_prompt.sh │ │ └── vim.sh │ ├── securetty │ ├── ssh │ │ └── sshd_config │ ├── sysctl.d │ │ └── 00-k3os.conf │ ├── topdefaultrc │ └── wpa_supplicant │ │ └── wpa_supplicant.conf ├── init ├── lib │ └── os-release ├── libexec │ └── k3os │ │ ├── boot │ │ ├── bootstrap │ │ ├── functions │ │ ├── live │ │ ├── mode │ │ ├── mode-disk │ │ ├── mode-install │ │ ├── mode-live │ │ ├── mode-local │ │ └── mode-shell ├── sbin │ └── update-issue └── share │ └── rancher │ ├── k3os │ └── scripts │ │ ├── k3os-upgrade-kernel │ │ ├── k3os-upgrade-rootfs │ │ └── toolbox │ └── k3s │ └── server │ └── manifests │ ├── system-upgrade-controller.yaml │ └── system-upgrade-plans │ └── k3os-latest.yaml ├── package ├── Dockerfile └── packer │ ├── aws │ ├── README.md │ ├── config.yaml │ ├── template-arm64.json │ └── template.json │ ├── gcp │ ├── .gitignore │ ├── README.md │ ├── config.yaml │ └── template.json │ ├── hetzner │ ├── README.md │ ├── config.yaml │ └── template.json │ ├── openstack │ ├── README.md │ ├── config.yaml │ ├── template-arm64.json │ └── template.json │ ├── proxmox │ ├── README.md │ ├── config │ │ └── cloud.yml │ ├── template.json │ └── vars.json │ ├── vagrant-libvirt │ ├── README.md │ ├── Vagrantfile │ ├── config.yml │ ├── packer_rsa │ ├── packer_rsa.pub │ └── template.pkr.hcl │ ├── vagrant │ ├── README.md │ ├── Vagrantfile │ ├── config.yml │ ├── packer_rsa │ ├── packer_rsa.pub │ ├── template.pkr.hcl │ └── vagrantfile.template │ └── vsphere │ ├── README.md │ ├── agent │ ├── k3os-agent-variables.json │ └── k3os-agent.json │ └── server │ ├── k3os-server-variables.json │ └── k3os-server.json ├── pkg ├── cc │ ├── apply.go │ └── funcs.go ├── cli │ ├── app │ │ └── app.go │ ├── config │ │ └── config.go │ ├── install │ │ └── install.go │ ├── rc │ │ └── rc.go │ └── upgrade │ │ └── upgrade.go ├── cliinstall │ ├── ask.go │ └── install.go ├── command │ └── command.go ├── config │ ├── coerce.go │ ├── config.go │ ├── read.go │ ├── read_cc.go │ ├── read_test.go │ ├── rename.go │ └── write.go ├── enterchroot │ ├── ensureloop.go │ └── enter.go ├── hostname │ └── hostname.go ├── mode │ └── mode.go ├── module │ └── module.go ├── questions │ └── questions.go ├── ssh │ └── ssh.go ├── sysctl │ └── sysctl.go ├── system │ ├── component.go │ └── system.go ├── transferroot │ └── transferroot.go ├── util │ ├── decode.go │ ├── prompt.go │ └── util.go ├── version │ └── version.go └── writefile │ └── writefile.go ├── scripts ├── build ├── ci ├── default ├── entry ├── images ├── package ├── release ├── run ├── run-qemu ├── test ├── validate └── version └── vendor ├── github.com ├── cpuguy83 │ └── go-md2man │ │ └── v2 │ │ ├── LICENSE.md │ │ └── md2man │ │ ├── md2man.go │ │ └── roff.go ├── docker │ ├── docker │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── pkg │ │ │ ├── mount │ │ │ ├── flags.go │ │ │ ├── flags_freebsd.go │ │ │ ├── flags_linux.go │ │ │ ├── flags_unsupported.go │ │ │ ├── mount.go │ │ │ ├── mounter_freebsd.go │ │ │ ├── mounter_linux.go │ │ │ ├── mounter_solaris.go │ │ │ ├── mounter_unsupported.go │ │ │ ├── mountinfo.go │ │ │ ├── mountinfo_freebsd.go │ │ │ ├── mountinfo_linux.go │ │ │ ├── mountinfo_solaris.go │ │ │ ├── mountinfo_unsupported.go │ │ │ ├── mountinfo_windows.go │ │ │ ├── sharedsubtree_linux.go │ │ │ └── sharedsubtree_solaris.go │ │ │ └── reexec │ │ │ ├── README.md │ │ │ ├── command_linux.go │ │ │ ├── command_unix.go │ │ │ ├── command_unsupported.go │ │ │ ├── command_windows.go │ │ │ └── reexec.go │ └── go-units │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── MAINTAINERS │ │ ├── README.md │ │ ├── circle.yml │ │ ├── duration.go │ │ ├── size.go │ │ └── ulimit.go ├── ghodss │ └── yaml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── fields.go │ │ └── yaml.go ├── konsorten │ └── go-windows-terminal-sequences │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.mod │ │ ├── sequences.go │ │ └── sequences_dummy.go ├── mattn │ ├── go-isatty │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── isatty_android.go │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go │ └── go-shellwords │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.mod │ │ ├── shellwords.go │ │ ├── util_go15.go │ │ ├── util_posix.go │ │ └── util_windows.go ├── otiai10 │ └── copy │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── copy.go │ │ ├── go.mod │ │ └── go.sum ├── paultag │ └── go-modprobe │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dep.go │ │ ├── docs.go │ │ ├── elf.go │ │ ├── load.go │ │ └── modprobe.go ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── errors.go │ │ └── stack.go ├── rancher │ ├── mapper │ │ ├── LICENSE │ │ ├── README.md │ │ ├── convert │ │ │ ├── convert.go │ │ │ ├── merge │ │ │ │ └── merge.go │ │ │ ├── ref.go │ │ │ ├── transform.go │ │ │ └── value_set_string.go │ │ ├── definition │ │ │ └── definition.go │ │ ├── encoder.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── mapper.go │ │ ├── mappers │ │ │ ├── access.go │ │ │ ├── alias_field.go │ │ │ ├── alias_value.go │ │ │ ├── annotation_field.go │ │ │ ├── base64.go │ │ │ ├── batchmove.go │ │ │ ├── bytes.go │ │ │ ├── changetype.go │ │ │ ├── check.go │ │ │ ├── colon_map.go │ │ │ ├── condition.go │ │ │ ├── copy.go │ │ │ ├── default_mapper.go │ │ │ ├── default_missing.go │ │ │ ├── display_name.go │ │ │ ├── drop.go │ │ │ ├── embed.go │ │ │ ├── enum.go │ │ │ ├── json_encode.go │ │ │ ├── json_keys.go │ │ │ ├── label_field.go │ │ │ ├── metadata.go │ │ │ ├── move.go │ │ │ ├── object.go │ │ │ ├── objects_to_slice.go │ │ │ ├── pendingstatus.go │ │ │ ├── read_only.go │ │ │ ├── required.go │ │ │ ├── root.go │ │ │ ├── scope.go │ │ │ ├── setvalue.go │ │ │ ├── shlex.go │ │ │ ├── single_slice.go │ │ │ ├── slice_merge.go │ │ │ └── slice_to_map.go │ │ ├── reflection.go │ │ ├── schemas.go │ │ ├── types.go │ │ └── values │ │ │ └── values.go │ └── wrangler │ │ ├── LICENSE │ │ └── pkg │ │ └── name │ │ └── name.go ├── russross │ └── blackfriday │ │ └── v2 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── block.go │ │ ├── doc.go │ │ ├── esc.go │ │ ├── go.mod │ │ ├── html.go │ │ ├── inline.go │ │ ├── markdown.go │ │ ├── node.go │ │ └── smartypants.go ├── shurcooL │ └── sanitized_anchor_name │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.mod │ │ └── main.go ├── sirupsen │ └── logrus │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── appveyor.yml │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_check_appengine.go │ │ ├── terminal_check_bsd.go │ │ ├── terminal_check_no_terminal.go │ │ ├── terminal_check_notappengine.go │ │ ├── terminal_check_solaris.go │ │ ├── terminal_check_unix.go │ │ ├── terminal_check_windows.go │ │ ├── text_formatter.go │ │ └── writer.go └── urfave │ └── cli │ ├── .flake8 │ ├── .gitignore │ ├── .travis.yml │ ├── CODE_OF_CONDUCT.md │ ├── LICENSE │ ├── README.md │ ├── app.go │ ├── appveyor.yml │ ├── category.go │ ├── cli.go │ ├── command.go │ ├── context.go │ ├── docs.go │ ├── errors.go │ ├── fish.go │ ├── flag.go │ ├── flag_bool.go │ ├── flag_bool_t.go │ ├── flag_duration.go │ ├── flag_float64.go │ ├── flag_generic.go │ ├── flag_int.go │ ├── flag_int64.go │ ├── flag_int64_slice.go │ ├── flag_int_slice.go │ ├── flag_string.go │ ├── flag_string_slice.go │ ├── flag_uint.go │ ├── flag_uint64.go │ ├── funcs.go │ ├── go.mod │ ├── go.sum │ ├── help.go │ ├── parse.go │ ├── sort.go │ └── template.go ├── golang.org └── x │ ├── crypto │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── ssh │ │ └── terminal │ │ ├── terminal.go │ │ ├── util.go │ │ ├── util_aix.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ ├── util_solaris.go │ │ └── util_windows.go │ └── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_freebsd_arm64.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_riscv64.s │ ├── asm_linux_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_netbsd_arm64.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_openbsd_arm.s │ ├── asm_openbsd_arm64.s │ ├── asm_solaris_amd64.s │ ├── bluetooth_linux.go │ ├── cap_freebsd.go │ ├── constants.go │ ├── dev_aix_ppc.go │ ├── dev_aix_ppc64.go │ ├── dev_darwin.go │ ├── dev_dragonfly.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_netbsd.go │ ├── dev_openbsd.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── fdset.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ioctl.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── pagesize_unix.go │ ├── pledge_openbsd.go │ ├── race.go │ ├── race0.go │ ├── readdirent_getdents.go │ ├── readdirent_getdirentries.go │ ├── sockcmsg_dragonfly.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── sockcmsg_unix_other.go │ ├── str.go │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.1_12.go │ ├── syscall_darwin.1_13.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.1_11.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.1_11.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.1_11.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.1_11.go │ ├── syscall_darwin_arm64.go │ ├── syscall_darwin_libSystem.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_freebsd_arm64.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_gc.go │ ├── syscall_linux_gc_386.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_riscv64.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_netbsd_arm64.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_openbsd_arm64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── timestruct.go │ ├── unveil_openbsd.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_freebsd_arm64.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_riscv64.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_netbsd_arm64.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_openbsd_arm64.go │ ├── zerrors_solaris_amd64.go │ ├── zptrace386_linux.go │ ├── zptracearm_linux.go │ ├── zptracemips_linux.go │ ├── zptracemipsle_linux.go │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_386.1_11.go │ ├── zsyscall_darwin_386.1_13.go │ ├── zsyscall_darwin_386.1_13.s │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_386.s │ ├── zsyscall_darwin_amd64.1_11.go │ ├── zsyscall_darwin_amd64.1_13.go │ ├── zsyscall_darwin_amd64.1_13.s │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm.1_11.go │ ├── zsyscall_darwin_arm.1_13.go │ ├── zsyscall_darwin_arm.1_13.s │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm.s │ ├── zsyscall_darwin_arm64.1_11.go │ ├── zsyscall_darwin_arm64.1_13.go │ ├── zsyscall_darwin_arm64.1_13.s │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_darwin_arm64.s │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_freebsd_arm64.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_riscv64.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_netbsd_arm64.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_openbsd_arm64.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysctl_openbsd_arm64.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_freebsd_arm64.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_riscv64.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_netbsd_arm64.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── zsysnum_openbsd_arm64.go │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_freebsd_arm64.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_riscv64.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_netbsd_arm64.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ ├── ztypes_openbsd_arm64.go │ └── ztypes_solaris_amd64.go │ └── 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 │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ ├── zerrors_windows.go │ ├── zknownfolderids_windows.go │ └── zsyscall_windows.go ├── gopkg.in ├── freddierice │ └── go-losetup.v1 │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── constants.go │ │ ├── device.go │ │ ├── format.go │ │ ├── info.go │ │ └── losetup.go └── yaml.v2 │ ├── .travis.yml │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── go.mod │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go ├── modules.txt └── pault.ag └── go └── topsort ├── LICENSE ├── README.md └── topsort.go /.dockerignore: -------------------------------------------------------------------------------- 1 | ./.idea 2 | ./.dapper 3 | ./.cache 4 | ./.trash-cache 5 | ./dist/ 6 | package/packer/vagrant/.vagrant/ 7 | package/packer/vagrant/packer_cache/ 8 | package/packer/vagrant/*.box 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'kind/bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | **Version (k3OS / kernel)** 13 | 14 | 15 | 16 | **Architecture** 17 | 18 | 19 | **Describe the bug** 20 | 21 | 22 | **To Reproduce** 23 | 24 | 25 | **Expected behavior** 26 | 27 | 28 | **Actual behavior** 29 | 30 | 31 | **Additional context** 32 | 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'kind/feature' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Thanks for helping us to improve k3OS! We welcome all feature requests. Please fill out each area of the template so we can better understand the request. ***You can delete this message portion of the bug report.*** 11 | 12 | **Is your feature request related to a problem? Please describe.** 13 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 14 | 15 | **Describe the solution you'd like** 16 | A clear and concise description of what you want to happen. 17 | 18 | **Describe alternatives you've considered** 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | **Additional context** 22 | Add any other context or screenshots about the feature request here. 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.dapper 3 | /.cache 4 | /.trash-cache 5 | /bin/ 6 | /dist/ 7 | /build/ 8 | *.swp 9 | /.bash_history 10 | /.docker/ 11 | 12 | # Packer and vagrant 13 | .vagrant/ 14 | packer_cache/ 15 | *.box 16 | -------------------------------------------------------------------------------- /.golangci.json: -------------------------------------------------------------------------------- 1 | { 2 | "linters": { 3 | "disable-all": true, 4 | "enable": [ 5 | "govet", 6 | "golint", 7 | "goimports", 8 | "misspell", 9 | "ineffassign", 10 | "gofmt" 11 | ] 12 | }, 13 | "run": { 14 | "skip-files": [ 15 | "/zz_generated_" 16 | ], 17 | "deadline": "5m" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Dockerfile.dapper: -------------------------------------------------------------------------------- 1 | FROM golang:1.16-alpine3.14 2 | 3 | ARG DAPPER_HOST_ARCH 4 | ENV ARCH $DAPPER_HOST_ARCH 5 | 6 | RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates 7 | RUN if [ "$(go env GOARCH)" = "arm64" ]; then \ 8 | curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.38.0; \ 9 | fi 10 | 11 | ENV DAPPER_RUN_ARGS --privileged -v /tmp:/tmp -v k3os-pkg:/go/pkg -v k3os-cache:/root/.cache/go-build 12 | ENV DAPPER_ENV REPO TAG DRONE_TAG 13 | ENV DAPPER_SOURCE /go/src/github.com/rancher/k3os/ 14 | ENV DAPPER_OUTPUT ./build ./dist 15 | ENV DAPPER_DOCKER_SOCKET true 16 | ENV HOME ${DAPPER_SOURCE} 17 | WORKDIR ${DAPPER_SOURCE} 18 | ENTRYPOINT ["./scripts/entry"] 19 | CMD ["ci"] 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGETS := $(shell ls scripts) 2 | 3 | .dapper: 4 | @echo Downloading dapper 5 | @curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp 6 | @@chmod +x .dapper.tmp 7 | @./.dapper.tmp -v 8 | @mv .dapper.tmp .dapper 9 | 10 | $(TARGETS): .dapper 11 | @rm -rf ./dist ./build 12 | ./.dapper $@ 13 | 14 | .DEFAULT_GOAL := default 15 | 16 | .PHONY: $(TARGETS) 17 | -------------------------------------------------------------------------------- /images/00-base/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 arm -------------------------------------------------------------------------------- /images/03-base/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-base:${TAG} AS base 4 | RUN apk --no-cache add \ 5 | virt-what 6 | -------------------------------------------------------------------------------- /images/03-base/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 -------------------------------------------------------------------------------- /images/05-base/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-base:${TAG} AS base 4 | RUN apk --no-cache add \ 5 | grub-bios \ 6 | open-vm-tools \ 7 | open-vm-tools-deploypkg \ 8 | open-vm-tools-guestinfo \ 9 | open-vm-tools-static \ 10 | open-vm-tools-vmbackup 11 | -------------------------------------------------------------------------------- /images/05-base/archs: -------------------------------------------------------------------------------- 1 | amd64 -------------------------------------------------------------------------------- /images/10-gobuild/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.16-alpine3.14 AS gobuild 2 | RUN apk -U add git gcc linux-headers musl-dev make libseccomp libseccomp-dev bash 3 | COPY gobuild /usr/bin/ 4 | RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh 5 | WORKDIR /output -------------------------------------------------------------------------------- /images/10-gobuild/gobuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LINKFLAGS=${LINKFLAGS:-"-extldflags -static -s"} 4 | exec env CGO_ENABLED=0 go build -ldflags "-X github.com/rancher/k3os/pkg/version.Version=$VERSION $LINKFLAGS" "$@" 5 | -------------------------------------------------------------------------------- /images/10-k3s/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-base:${TAG} 4 | 5 | ARG ARCH 6 | ENV ARCH ${ARCH} 7 | ENV VERSION v1.25.11+k3s1 8 | ADD https://raw.githubusercontent.com/rancher/k3s/${VERSION}/install.sh /output/install.sh 9 | ENV INSTALL_K3S_VERSION=${VERSION} \ 10 | INSTALL_K3S_SKIP_START=true \ 11 | INSTALL_K3S_BIN_DIR=/output 12 | RUN chmod +x /output/install.sh 13 | RUN /output/install.sh 14 | RUN echo "${VERSION}" > /output/version 15 | -------------------------------------------------------------------------------- /images/10-kernel-stage1/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 2 | -------------------------------------------------------------------------------- /images/20-progs/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | ARG VERSION 4 | FROM ${REPO}/k3os-gobuild:${TAG} as gobuild 5 | 6 | ENV LINUXKIT v0.8 7 | 8 | FROM gobuild as linuxkit 9 | ENV GO111MODULE off 10 | RUN git clone https://github.com/linuxkit/linuxkit.git $GOPATH/src/github.com/linuxkit/linuxkit 11 | WORKDIR $GOPATH/src/github.com/linuxkit/linuxkit/pkg/metadata 12 | RUN git checkout -b current $LINUXKIT 13 | RUN gobuild -o /output/metadata 14 | 15 | FROM gobuild as k3os 16 | ARG VERSION 17 | COPY go.mod $GOPATH/src/github.com/rancher/k3os/ 18 | COPY go.sum $GOPATH/src/github.com/rancher/k3os/ 19 | COPY /pkg/ $GOPATH/src/github.com/rancher/k3os/pkg/ 20 | COPY /main.go $GOPATH/src/github.com/rancher/k3os/ 21 | COPY /vendor/ $GOPATH/src/github.com/rancher/k3os/vendor/ 22 | WORKDIR $GOPATH/src/github.com/rancher/k3os 23 | RUN gobuild -mod=readonly -o /output/k3os 24 | 25 | FROM gobuild 26 | COPY --from=linuxkit /output/ /output/ 27 | COPY --from=k3os /output/ /output/ 28 | WORKDIR /output 29 | RUN git clone --branch v0.7.0 https://github.com/ahmetb/kubectx.git \ 30 | && chmod -v +x kubectx/kubectx kubectx/kubens 31 | -------------------------------------------------------------------------------- /images/20-progs/root: -------------------------------------------------------------------------------- 1 | ../.. -------------------------------------------------------------------------------- /images/20-rootfs/root: -------------------------------------------------------------------------------- 1 | ../.. -------------------------------------------------------------------------------- /images/30-bin/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-rootfs:${TAG} as rootfs 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-progs:${TAG} as progs 8 | 9 | ARG REPO 10 | ARG TAG 11 | FROM ${REPO}/k3os-base:${TAG} 12 | 13 | COPY --from=rootfs /output/rootfs.squashfs /usr/src/ 14 | COPY install.sh /output/k3os-install.sh 15 | COPY --from=progs /output/k3os /output/k3os 16 | RUN echo -n "_sqmagic_" >> /output/k3os 17 | RUN cat /usr/src/rootfs.squashfs >> /output/k3os 18 | -------------------------------------------------------------------------------- /images/30-bin/root: -------------------------------------------------------------------------------- 1 | ../.. -------------------------------------------------------------------------------- /images/40-kernel/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-bin:${TAG} as bin 4 | 5 | FROM ${REPO}/k3os-kernel-stage1:${TAG} as kernel 6 | 7 | FROM ${REPO}/k3os-base:${TAG} 8 | ARG TAG 9 | RUN apk add squashfs-tools 10 | COPY --from=kernel /output/ /usr/src/kernel/ 11 | 12 | RUN mkdir -p /usr/src/initrd/lib && \ 13 | cd /usr/src/kernel && \ 14 | tar cf - -T initrd-modules -T initrd-firmware | tar xf - -C /usr/src/initrd/ && \ 15 | depmod -b /usr/src/initrd $(cat /usr/src/kernel/version) 16 | 17 | RUN mkdir -p /output && \ 18 | cd /usr/src/kernel && \ 19 | depmod -b . $(cat /usr/src/kernel/version) && \ 20 | mksquashfs . /output/kernel.squashfs 21 | 22 | RUN cp /usr/src/kernel/version /output/ && \ 23 | cp /usr/src/kernel/vmlinuz /output/ 24 | 25 | COPY --from=bin /output/ /usr/src/k3os/ 26 | RUN cd /usr/src/initrd && \ 27 | mkdir -p k3os/system/k3os/${TAG} && \ 28 | cp /usr/src/k3os/k3os k3os/system/k3os/${TAG} && \ 29 | ln -s ${TAG} k3os/system/k3os/current && \ 30 | ln -s /k3os/system/k3os/current/k3os init 31 | 32 | RUN cd /usr/src/initrd && \ 33 | find . | cpio -H newc -o | gzip -c -1 > /output/initrd 34 | -------------------------------------------------------------------------------- /images/40-kernel/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 2 | -------------------------------------------------------------------------------- /images/50-package/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-k3s:${TAG} as k3s 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-bin:${TAG} as bin 8 | 9 | ARG REPO 10 | ARG TAG 11 | FROM ${REPO}/k3os-base:${TAG} as base 12 | ARG VERSION 13 | 14 | COPY --from=k3s /output/ /output/k3os/system/k3s/ 15 | COPY --from=bin /output/ /output/k3os/system/k3os/${VERSION}/ 16 | 17 | WORKDIR /output/k3os/system/k3s 18 | RUN mkdir -vp $(cat version) /output/sbin 19 | RUN mv -vf crictl ctr kubectl /output/sbin/ 20 | RUN ln -sf $(cat version) current 21 | RUN mv -vf install.sh current/k3s-install.sh 22 | RUN mv -vf k3s current/ 23 | RUN rm -vf version *.sh 24 | RUN ln -sf /k3os/system/k3s/current/k3s /output/sbin/k3s 25 | 26 | WORKDIR /output/k3os/system/k3os 27 | RUN ln -sf ${VERSION} current 28 | RUN ln -sf /k3os/system/k3os/current/k3os /output/sbin/k3os 29 | RUN ln -sf k3os /output/sbin/init 30 | -------------------------------------------------------------------------------- /images/50-package/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 arm -------------------------------------------------------------------------------- /images/60-package/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-kernel:${TAG} as kernel 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-package:${TAG} 8 | ARG VERSION 9 | 10 | COPY --from=kernel /output/ /output/k3os/system/kernel/ 11 | 12 | WORKDIR /output/k3os/system/kernel 13 | RUN mkdir -vp $(cat version) 14 | RUN ln -sf $(cat version) current 15 | RUN mv -vf initrd kernel.squashfs current/ 16 | RUN rm -vf version vmlinuz 17 | -------------------------------------------------------------------------------- /images/60-package/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 2 | -------------------------------------------------------------------------------- /images/70-iso/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-package:${TAG} as package 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-base:${TAG} as base 8 | ARG VERSION 9 | ARG ARCH 10 | RUN apk add xorriso grub grub-efi mtools libvirt qemu-img 11 | RUN if [ "$ARCH" == "amd64" ]; then \ 12 | apk add qemu-system-x86_64 grub-bios ovmf \ 13 | ;elif [ "$ARCH" == "arm64" ]; then \ 14 | apk add qemu-system-aarch64 \ 15 | ;fi 16 | RUN ln -s /usr/bin/qemu-system-* /usr/bin/qemu-system 17 | RUN qemu-img create -f qcow2 /hd.img 40G 18 | COPY run-kvm.sh /usr/bin/ 19 | COPY grub.cfg /usr/src/iso/boot/grub/grub.cfg 20 | 21 | COPY --from=package /output/ /usr/src/iso/ 22 | 23 | COPY config.yaml /usr/src/iso/k3os/system/ 24 | RUN mkdir -p /output && \ 25 | grub-mkrescue -o /output/k3os.iso /usr/src/iso/. -- -volid K3OS -joliet on && \ 26 | [ -e /output/k3os.iso ] # grub-mkrescue doesn't exit non-zero on failure 27 | 28 | CMD ["run-kvm.sh"] 29 | -------------------------------------------------------------------------------- /images/70-iso/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 2 | -------------------------------------------------------------------------------- /images/70-iso/config.yaml: -------------------------------------------------------------------------------- 1 | # See https://github.com/rancher/k3os/blob/master/README.md#configuration 2 | # and https://github.com/rancher/k3os/blob/master/README.md#remastering-iso 3 | # This file is a placeholder for custom configuration when building a custom ISO image. 4 | -------------------------------------------------------------------------------- /images/70-iso/grub.cfg: -------------------------------------------------------------------------------- 1 | set default=0 2 | set timeout=10 3 | 4 | set gfxmode=auto 5 | set gfxpayload=keep 6 | insmod all_video 7 | insmod gfxterm 8 | 9 | menuentry "k3OS LiveCD & Installer" { 10 | search.fs_label K3OS root 11 | set sqfile=/k3os/system/kernel/current/kernel.squashfs 12 | loopback loop0 /$sqfile 13 | set root=($root) 14 | linux (loop0)/vmlinuz printk.devkmsg=on k3os.mode=live console=ttyS0 console=tty1 15 | initrd /k3os/system/kernel/current/initrd 16 | } 17 | 18 | menuentry "k3OS Installer" { 19 | search.fs_label K3OS root 20 | set sqfile=/k3os/system/kernel/current/kernel.squashfs 21 | loopback loop0 /$sqfile 22 | set root=($root) 23 | linux (loop0)/vmlinuz printk.devkmsg=on k3os.mode=install console=ttyS0 console=tty1 24 | initrd /k3os/system/kernel/current/initrd 25 | } 26 | 27 | menuentry "k3OS Rescue Shell" { 28 | search.fs_label K3OS root 29 | set sqfile=/k3os/system/kernel/current/kernel.squashfs 30 | loopback loop0 /$sqfile 31 | set root=($root) 32 | linux (loop0)/vmlinuz printk.devkmsg=on rescue console=ttyS0 console=tty1 33 | initrd /k3os/system/kernel/current/initrd 34 | } 35 | -------------------------------------------------------------------------------- /images/70-iso/run-kvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec /usr/bin/qemu-system \ 4 | -enable-kvm \ 5 | -nographic \ 6 | -serial mon:stdio \ 7 | -display none \ 8 | -rtc \ 9 | base=utc,clock=host \ 10 | -cdrom /output/k3os.iso \ 11 | -m 2048 \ 12 | -smp 2 \ 13 | -device virtio-rng-pci \ 14 | -net nic \ 15 | -net user,hostfwd=::2222-:22 \ 16 | -drive if=virtio,file=/hd.img 17 | -------------------------------------------------------------------------------- /images/80-tar/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-package:${TAG} as package 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-base:${TAG} as base 8 | ARG VERSION 9 | 10 | COPY --from=package /output/ /usr/src/${VERSION}/ 11 | WORKDIR /output 12 | RUN tar cvf userspace.tar -C /usr/src ${VERSION} 13 | -------------------------------------------------------------------------------- /images/output/01-full/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-tar:${TAG} as tar 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-iso:${TAG} as iso 8 | 9 | ARG REPO 10 | ARG TAG 11 | FROM ${REPO}/k3os-kernel:${TAG} as kernel 12 | 13 | ARG REPO 14 | ARG TAG 15 | FROM ${REPO}/k3os-base:${TAG} 16 | ARG ARCH 17 | 18 | COPY --from=kernel /output/vmlinuz /output/k3os-vmlinuz-${ARCH} 19 | COPY --from=kernel /output/initrd /output/k3os-initrd-${ARCH} 20 | COPY --from=kernel /output/kernel.squashfs /output/k3os-kernel-${ARCH}.squashfs 21 | COPY --from=kernel /output/version /output/k3os-kernel-version-${ARCH} 22 | COPY --from=iso /output/k3os.iso /output/k3os-${ARCH}.iso 23 | COPY --from=tar /output/userspace.tar /output/k3os-rootfs-${ARCH}.tar 24 | RUN gzip /output/k3os-rootfs-${ARCH}.tar 25 | -------------------------------------------------------------------------------- /images/output/01-full/archs: -------------------------------------------------------------------------------- 1 | amd64 arm64 2 | -------------------------------------------------------------------------------- /images/output/01-lite/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REPO 2 | ARG TAG 3 | FROM ${REPO}/k3os-tar:${TAG} as tar 4 | 5 | ARG REPO 6 | ARG TAG 7 | FROM ${REPO}/k3os-base:${TAG} 8 | ARG ARCH 9 | 10 | COPY --from=tar /output/userspace.tar /output/k3os-rootfs-${ARCH}.tar 11 | RUN gzip /output/k3os-rootfs-${ARCH}.tar 12 | -------------------------------------------------------------------------------- /images/output/01-lite/archs: -------------------------------------------------------------------------------- 1 | arm 2 | -------------------------------------------------------------------------------- /overlay/etc/conf.d/connman: -------------------------------------------------------------------------------- 1 | command_args="-r" 2 | -------------------------------------------------------------------------------- /overlay/etc/conf.d/k3s-service: -------------------------------------------------------------------------------- 1 | rc_need="!net !net-online" 2 | rc_after="ccapply" 3 | rc_want="network-online" 4 | -------------------------------------------------------------------------------- /overlay/etc/conf.d/net-online: -------------------------------------------------------------------------------- 1 | # The interfaces setting controls which interfaces the net-online 2 | # service considers in deciding whether the network is active. The 3 | # default is all interfaces that support ethernet. 4 | #interfaces="eth0 wlan0" 5 | 6 | # The minimum_up setting controls how many interfaces the net-online 7 | # service expects to be "up" when deciding whether the network is active. 8 | # The default is the number of detected/specified interfaces. 9 | minimum_up=1 10 | 11 | # This setting controls whether a ping test is included in the test for 12 | # network connectivity after all interfaces are active. 13 | #include_ping_test=yes 14 | 15 | # This setting is the host to attempt to ping if the above is yes. 16 | # The default is google.com. 17 | #ping_test_host=get.k3s.io 18 | 19 | # The timeout setting controls how long the net-online service waits 20 | # for the network to be configured. 21 | # The default is 120 seconds. 22 | # if this is set to 0, the wait is infinite. 23 | timeout=30 24 | -------------------------------------------------------------------------------- /overlay/etc/conf.d/udev-coldplug: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/udev-coldplug: config file for udev-coldplug 2 | 3 | # udev can trigger coldplug events which cause services to start and 4 | # kernel modules to be loaded. 5 | # Services are deferred to start in the boot runlevel. 6 | # Set rc_coldplug="NO" if you don't want this. 7 | # If you want module coldplugging but not coldplugging of services then you 8 | # can disable service coldplugging in baselayout/openrc config files. 9 | # The setting is named different in different versions. 10 | # in /etc/rc.conf: rc_hotplug="!*" or 11 | # in /etc/conf.d/rc: rc_plug_services="!*" 12 | #rc_coldplug="yes" 13 | 14 | # Run udevadmin monitor to get a log of all events 15 | # in /run/udevmonitor.log 16 | #udev_monitor="yes" 17 | 18 | # Keep udevmonitor running after populating /dev. 19 | #udev_monitor_keep_running="no" 20 | 21 | # Set cmdline options for udevmonitor. 22 | # could be some of --env --kernel --udev 23 | #udev_monitor_opts="--env" 24 | -------------------------------------------------------------------------------- /overlay/etc/conf.d/udev-root: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/udev-root: config file for udev-root 2 | 3 | # We can create a /dev/root symbolic link to point to the root device in 4 | # some situations. This is on by default because some software relies on 5 | # it,. However, this software should be fixed to not do this. 6 | # For more information, see 7 | # https://bugs.gentoo.org/show_bug.cgi?id=438380. 8 | # If you are not using any affected software, you do not need this, so 9 | # feel free to turn it off. 10 | #rc_dev_root_symlink="yes" 11 | -------------------------------------------------------------------------------- /overlay/etc/conf.d/wpa_supplicant: -------------------------------------------------------------------------------- 1 | wpa_supplicant_args="-u" 2 | -------------------------------------------------------------------------------- /overlay/etc/environment: -------------------------------------------------------------------------------- 1 | K3S_KUBECONFIG_MODE=0644 2 | -------------------------------------------------------------------------------- /overlay/etc/init.d/ccapply: -------------------------------------------------------------------------------- 1 | #!/sbin/openrc-run 2 | 3 | depend() { 4 | want network-online 5 | } 6 | 7 | name="ccapply" 8 | command="/k3os/system/k3os/current/k3os" 9 | command_args="config" -------------------------------------------------------------------------------- /overlay/etc/init.d/cloud-config: -------------------------------------------------------------------------------- 1 | #!/sbin/openrc-run 2 | 3 | depend() { 4 | want network-online 5 | before ccapply 6 | } 7 | 8 | name="cloud-config" 9 | command="/usr/sbin/metadata" 10 | -------------------------------------------------------------------------------- /overlay/etc/init.d/issue: -------------------------------------------------------------------------------- 1 | #!/sbin/openrc-run 2 | 3 | depend() { 4 | use network-online 5 | } 6 | 7 | name="issue" 8 | command="/usr/sbin/update-issue" 9 | -------------------------------------------------------------------------------- /overlay/etc/inittab: -------------------------------------------------------------------------------- 1 | # /etc/inittab 2 | 3 | ::sysinit:/sbin/openrc sysinit 4 | ::sysinit:/sbin/openrc boot 5 | ::wait:/sbin/openrc default 6 | 7 | # Stuff to do for the 3-finger salute 8 | ::ctrlaltdel:/sbin/reboot 9 | 10 | # Stuff to do before rebooting 11 | ::shutdown:/sbin/openrc shutdown 12 | 13 | # Dynamically appended getty stuff 14 | -------------------------------------------------------------------------------- /overlay/etc/issue: -------------------------------------------------------------------------------- 1 | Welcome to k3OS (login with user: rancher) 2 | Kernel \r on an \m (\l) 3 | -------------------------------------------------------------------------------- /overlay/etc/motd: -------------------------------------------------------------------------------- 1 | Welcome to k3OS! 2 | 3 | Refer to https://github.com/rancher/k3os for README and issues. 4 | 5 | The default mode of k3OS is to run a single node cluster. Use "kubectl" 6 | to access it. The node token in /var/lib/rancher/k3s/server/node-token 7 | can be used to join agents to this server. 8 | 9 | -------------------------------------------------------------------------------- /overlay/etc/nsswitch.conf: -------------------------------------------------------------------------------- 1 | hosts: files dns 2 | -------------------------------------------------------------------------------- /overlay/etc/profile.d/color_prompt.sh: -------------------------------------------------------------------------------- 1 | # Setup a red prompt for root and a green one for users. 2 | # rename this file to color_prompt.sh to actually enable it 3 | NORMAL="\[\e[0m\]" 4 | RED="\[\e[1;31m\]" 5 | GREEN="\[\e[1;32m\]" 6 | if [ "$(id -u)" = 0 ]; then 7 | PS1="$RED\h [$NORMAL\w$RED]# $NORMAL" 8 | else 9 | PS1="$GREEN\h [$NORMAL\w$GREEN]\$ $NORMAL" 10 | fi 11 | -------------------------------------------------------------------------------- /overlay/etc/profile.d/vim.sh: -------------------------------------------------------------------------------- 1 | alias vi=vim 2 | if [ -z "$EDITOR" ]; then 3 | export EDITOR=vim 4 | fi 5 | -------------------------------------------------------------------------------- /overlay/etc/securetty: -------------------------------------------------------------------------------- 1 | console 2 | -------------------------------------------------------------------------------- /overlay/etc/ssh/sshd_config: -------------------------------------------------------------------------------- 1 | # See https://man.openbsd.org/sshd_config for 2 | # details on these and other parameters. 3 | 4 | AllowTcpForwarding no 5 | GatewayPorts no 6 | PasswordAuthentication no 7 | X11Forwarding no 8 | PermitRootLogin no 9 | LoginGraceTime 30s 10 | MaxAuthTries 5 11 | 12 | Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr 13 | MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com 14 | KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256 15 | 16 | Subsystem sftp internal-sftp 17 | -------------------------------------------------------------------------------- /overlay/etc/sysctl.d/00-k3os.conf: -------------------------------------------------------------------------------- 1 | # adapted from linuxkit 2 | net.ipv4.ip_forward = 1 3 | # general limits 4 | vm.max_map_count = 262144 5 | vm.overcommit_memory = 1 6 | net.core.somaxconn = 1024 7 | net.ipv4.neigh.default.gc_thresh1 = 80000 8 | net.ipv4.neigh.default.gc_thresh2 = 90000 9 | net.ipv4.neigh.default.gc_thresh3 = 100000 10 | fs.aio-max-nr = 1048576 11 | fs.file-max = 1048576 12 | # for rngd 13 | kernel.random.write_wakeup_threshold = 3072 14 | # security restrictions 15 | kernel.kptr_restrict = 2 16 | kernel.dmesg_restrict = 1 17 | kernel.perf_event_paranoid = 3 18 | fs.protected_hardlinks = 1 19 | fs.protected_symlinks = 1 20 | # Prevent ebpf privilege escalation 21 | # see: https://lwn.net/Articles/742170 22 | kernel.unprivileged_bpf_disabled=1 23 | -------------------------------------------------------------------------------- /overlay/etc/topdefaultrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazzy89/k3os/a002b282697e5b60a39bc1b5a153556b892d1c2a/overlay/etc/topdefaultrc -------------------------------------------------------------------------------- /overlay/etc/wpa_supplicant/wpa_supplicant.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazzy89/k3os/a002b282697e5b60a39bc1b5a153556b892d1c2a/overlay/etc/wpa_supplicant/wpa_supplicant.conf -------------------------------------------------------------------------------- /overlay/init: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | rescue() { 5 | echo ERROR "Something went wrong, run with cmdline k3os.debug for more logging" 6 | echo Dropping to shell 7 | exec bash 8 | } 9 | 10 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin 11 | 12 | . /usr/libexec/k3os/functions 13 | . /usr/lib/os-release 14 | 15 | pinfo Welcome to $PRETTY_NAME 16 | 17 | if [ "$K3OS_DEBUG" = "true" ]; then 18 | set -x 19 | fi 20 | 21 | if ! ${SCRIPTS}/bootstrap; then 22 | rescue 23 | fi 24 | 25 | exec >/dev/console &1 26 | 27 | reinit_debug 28 | 29 | if ! ${SCRIPTS}/mode; then 30 | rescue 31 | fi 32 | 33 | trap rescue EXIT 34 | 35 | export K3OS_MODE=$(> /etc/motd 6 | echo 'You can configure this system or install to disk using "sudo k3os install"' >> /etc/motd 7 | } 8 | 9 | setup_base() 10 | { 11 | K3OS_ISO=$(blkid -L K3OS || true) 12 | if [ -n "$K3OS_ISO" ]; then 13 | mount -o ro $(blkid -L K3OS) /.base 14 | else 15 | success=false 16 | for (( j=0; j < 5 ; j++ )); do 17 | for i in $(lsblk -o NAME,TYPE -n | grep -w disk | awk '{print $1}'); do 18 | if mount /dev/$i /.base; then 19 | success=true 20 | break 21 | fi 22 | done 23 | if [ "$success" = "true" ]; then 24 | break 25 | else 26 | pinfo "Waiting for USB for $((j+1)) seconds" 27 | sleep 1 28 | fi 29 | done 30 | fi 31 | } 32 | 33 | setup_passwd() 34 | { 35 | # no passwords in live mode 36 | passwd -d rancher >/dev/null 2>&1 37 | } 38 | 39 | setup_base 40 | setup_kernel 41 | setup_passwd 42 | setup_motd 43 | -------------------------------------------------------------------------------- /overlay/libexec/k3os/mode-install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $SCRIPTS/live 4 | -------------------------------------------------------------------------------- /overlay/libexec/k3os/mode-live: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ${SCRIPTS}/live 4 | -------------------------------------------------------------------------------- /overlay/libexec/k3os/mode-local: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | setup_ssh() 4 | { 5 | if [ ! -e /var/lib/rancher/k3os/ssh ]; then 6 | mkdir -p /var/lib/rancher/k3os 7 | cp -rf /etc/ssh /var/lib/rancher/k3os/ssh 8 | fi 9 | rm -rf /etc/ssh 10 | ln -s /var/lib/rancher/k3os/ssh /etc/ssh 11 | } 12 | 13 | setup_rancher_node() 14 | { 15 | mkdir -p /etc/rancher 16 | mkdir -p /var/lib/rancher/k3os/node 17 | ln -s /var/lib/rancher/k3os/node /etc/rancher/ 18 | } 19 | 20 | setup_ssh 21 | setup_rancher_node 22 | -------------------------------------------------------------------------------- /overlay/libexec/k3os/mode-shell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $SCRIPTS/live 4 | 5 | pinfo Dropping to shell 6 | exec bash 7 | -------------------------------------------------------------------------------- /overlay/sbin/update-issue: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . /etc/os-release 4 | cat > /etc/issue << "COW" 5 | , , 6 | ,------------|'------'| _ ____ 7 | / . '-' |-' | | |___ \\ 8 | \\/| | | | | __ __) | ___ ___ 9 | | .________.'----' | |/ / |__ < / _ \\ / __| 10 | | | | | | < ___) || (_) |\\__ \\ 11 | \\___/ \\___/ |_|\\_\\|____/ \\___/ |___/ 12 | 13 | COW 14 | 15 | cat >> /etc/issue << EOF 16 | $PRETTY_NAME 17 | Kernel \r on an \m (\l) 18 | 19 | ================================================================================ 20 | NIC State Address 21 | $(ip -br addr show | grep -E -v '^(lo|flannel|cni|veth)') 22 | ================================================================================ 23 | EOF 24 | cat >> /etc/issue << "EOF" 25 | 26 | Welcome to k3OS (login with user: rancher) 27 | EOF 28 | -------------------------------------------------------------------------------- /overlay/share/rancher/k3os/scripts/k3os-upgrade-rootfs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(whoami) != "root" ] 6 | then 7 | echo "This script must be run as root." 8 | exit 1 9 | fi 10 | 11 | PROC=$(uname -m) 12 | 13 | # Take a parameter of the version number (i.e. v0.4.0) if it is given, otherwise use latest 14 | if [ -z $K3OS_VERSION ] 15 | then 16 | K3OS_VERSION=$(curl -sL api.github.com/repos/rancher/k3os/releases/latest | jq .tag_name -r) 17 | fi 18 | 19 | if [ $PROC == "x86_64" ] 20 | then 21 | ARCH="amd64" 22 | elif [ $PROC == "aarch64" ] 23 | then 24 | ARCH="arm64" 25 | elif [[ $PROC == arm* ]] # catches armv7l and armhf 26 | then 27 | ARCH="arm" 28 | else 29 | echo "Unsupported CPU architecture." 30 | exit 1 31 | fi 32 | 33 | echo "Upgrading k3os to ${K3OS_VERSION}" 34 | 35 | cd /k3os/system 36 | mount -o remount,rw . 37 | curl -fsSL "https://github.com/rancher/k3os/releases/download/${K3OS_VERSION}/k3os-rootfs-${ARCH}.tar.gz" | tar xz --strip-components=3 38 | sync 39 | 40 | echo "Upgrade complete! Please reboot." 41 | -------------------------------------------------------------------------------- /package/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | COPY build/k3os/system/ /k3os/system/ 3 | ENV PATH /k3os/system/k3os/current:/k3os/system/k3s/current:${PATH} 4 | ENTRYPOINT ["k3os"] 5 | CMD ["help"] 6 | -------------------------------------------------------------------------------- /package/packer/aws/README.md: -------------------------------------------------------------------------------- 1 | # package/packer/aws 2 | 3 | ## Setup 4 | 5 | First, setup your AWS environment for Packer as per your preferred method: 6 | - https://www.packer.io/docs/builders/amazon/#static-credentials 7 | - https://www.packer.io/docs/builders/amazon/#environment-variables 8 | - https://www.packer.io/docs/builders/amazon/#shared-credentials-file 9 | 10 | ## Build AMD64 11 | 12 | ```shell script 13 | packer build template.json 14 | ``` 15 | 16 | ## Build ARM64 17 | 18 | ```shell script 19 | packer build template-arm64.json 20 | ``` 21 | -------------------------------------------------------------------------------- /package/packer/aws/config.yaml: -------------------------------------------------------------------------------- 1 | k3os: 2 | datasource: aws 3 | -------------------------------------------------------------------------------- /package/packer/gcp/.gitignore: -------------------------------------------------------------------------------- 1 | account.json 2 | -------------------------------------------------------------------------------- /package/packer/gcp/README.md: -------------------------------------------------------------------------------- 1 | # package/packer/gcp 2 | 3 | ## Setup 4 | 5 | Configure a Compute Engine Service Account (`account.json`): 6 | - https://www.packer.io/docs/builders/googlecompute/#running-without-a-compute-engine-service-account 7 | 8 | Configure `${GCP_PROJECT_ID}`. 9 | 10 | ## Build AMD64 11 | 12 | ```shell script 13 | packer build template.json 14 | ``` 15 | -------------------------------------------------------------------------------- /package/packer/gcp/config.yaml: -------------------------------------------------------------------------------- 1 | k3os: 2 | datasource: gcp 3 | -------------------------------------------------------------------------------- /package/packer/hetzner/README.md: -------------------------------------------------------------------------------- 1 | # package/packer/hetzner 2 | 3 | ## Setup 4 | 5 | Select a project in Hetzner Cloud console and create an API token: 6 | 7 | Security --> API Tokens --> Generate API token (Read & Write permisions) 8 | 9 | Copy token 10 | 11 | ## Build 12 | 13 | ```shell script 14 | export HCLOUD_TOKEN="TOKEN" # Token from Setup 15 | packer build template.json 16 | ``` 17 | -------------------------------------------------------------------------------- /package/packer/hetzner/config.yaml: -------------------------------------------------------------------------------- 1 | k3os: 2 | datasource: hetzner 3 | -------------------------------------------------------------------------------- /package/packer/openstack/config.yaml: -------------------------------------------------------------------------------- 1 | k3os: 2 | datasource: openstack 3 | -------------------------------------------------------------------------------- /package/packer/proxmox/README.md: -------------------------------------------------------------------------------- 1 | # k3os on Proxmox VE 2 | 3 | ## Quick Start 4 | 5 | 1. Build Proxmox VE image using [Packer](https://www.packer.io/): 6 | 7 | ``` 8 | packer build -var-file=vars.json template.json 9 | ``` 10 | 11 | ## Notes 12 | 13 | Can define IP and other parameter on config/cloud.yml, according to [Configuration Reference](https://github.com/rancher/k3os/blob/master/README.md#configuration-reference) 14 | -------------------------------------------------------------------------------- /package/packer/proxmox/config/cloud.yml: -------------------------------------------------------------------------------- 1 | write_files: 2 | - path: /etc/ssh/sshd_config 3 | content: | 4 | AllowTcpForwarding no 5 | GatewayPorts no 6 | PasswordAuthentication yes # necessary for access from packer build 7 | X11Forwarding no 8 | PermitRootLogin no 9 | LoginGraceTime 30s 10 | MaxAuthTries 5 11 | 12 | Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr 13 | MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com 14 | KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256 15 | Subsystem sftp internal-sftp 16 | - path: /etc/conf.d/qemu-guest-agent 17 | content: |- 18 | GA_PATH=/dev/vport1p1 19 | owner: root 20 | permissions: '0644' 21 | 22 | k3os: 23 | datasource: cdrom 24 | password: YourSSHPasswordReplaceIt 25 | -------------------------------------------------------------------------------- /package/packer/proxmox/vars.json: -------------------------------------------------------------------------------- 1 | { 2 | "template_name":"k3os-v020-template", 3 | "pve_server":"{{env `pve_server`}}", 4 | "pve_username":"{{env `pve_username`}}", 5 | "pve_password":"{{env `pve_password`}}", 6 | "pve_node":"{{env `pve_node`}}", 7 | 8 | "network-vlan": "{{env `network_vlan`}}", 9 | 10 | "vm-cpu-num": "1", 11 | "vm-mem-size": "2048", 12 | "vm-disk-size": "8G", 13 | "vm-disk-pool": "{{env `vm_disk_pool`}}", 14 | 15 | "ssh_username": "{{env `ssh_username`}}", 16 | "ssh_password": "{{env `ssh_password`}}", 17 | 18 | "iso-url": "https://github.com/rancher/k3os/releases/download/v0.20.4-k3s1r0/k3os-amd64.iso", 19 | "iso-storage-pool": "{{env `iso_storage_pool`}}", 20 | "iso-checksum": "d4733f747e95c4f07130bd10e27a14fc37d0584364ae5966e6564aa91c237e27cadcd5617e6130583629e963eb7d52f5a4f4fbd009e5fa3fc658ffff16bf2675", 21 | "iso-checksum-type": "sha512" 22 | } 23 | -------------------------------------------------------------------------------- /package/packer/vagrant-libvirt/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.define "k3os" 6 | config.vm.box = "k3os" 7 | config.vm.guest = :linux 8 | config.vm.provider "libvirt" do |lv| 9 | lv.random_hostname = true 10 | lv.memory = 2048 11 | lv.cpus = 2 12 | end 13 | 14 | # Disable conflicting plugins 15 | config.vbguest.auto_update = false if Vagrant.has_plugin?("vagrant-vbguest") 16 | 17 | # Disable default file syncing 18 | config.vm.synced_folder '.', '/vagrant', disabled: true 19 | end 20 | -------------------------------------------------------------------------------- /package/packer/vagrant-libvirt/config.yml: -------------------------------------------------------------------------------- 1 | run_cmd: 2 | # Duplicate rancher as vagrant user to let ssh the system with vagrant login 3 | - "sudo sed -e '/^rancher/p' -e 's/^rancher/vagrant/' -i /etc/passwd" 4 | ssh_authorized_keys: 5 | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCm4mvO91LnMIEusfofrsICXdh3eirAuA/z+YX6CDNLuL0O7tZvaCC6g8J2F5bGCTB7qsAzTamDC1p9i6vJJKvzOvkpYiLrugI0f59EERBxudGUw6hsBaDaFgMMH+UQdlg3HKSA34uXEgIzo0HgPCVjw1IT9yLiBRXcb55CKi0l9fQbreC4DDUKl/VX+CVtw2Z8cUx+IxbYet0ehpS6dXqsDoYpSRayrNgSD69Ty+DjINgvzKHog6PMtxC+pghPwztx0GM3fITOkQC9lZfrFxmRfoyWyHcASr9KPBmtPPfKyyQ3SWQAjQ8rEV13i0T4WEUCMqY26PBUZwC5qE5YUyGT 6 | # Vagrant key, from https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub 7 | - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key 8 | k3os: 9 | password: rancher 10 | -------------------------------------------------------------------------------- /package/packer/vagrant-libvirt/packer_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCm4mvO91LnMIEusfofrsICXdh3eirAuA/z+YX6CDNLuL0O7tZvaCC6g8J2F5bGCTB7qsAzTamDC1p9i6vJJKvzOvkpYiLrugI0f59EERBxudGUw6hsBaDaFgMMH+UQdlg3HKSA34uXEgIzo0HgPCVjw1IT9yLiBRXcb55CKi0l9fQbreC4DDUKl/VX+CVtw2Z8cUx+IxbYet0ehpS6dXqsDoYpSRayrNgSD69Ty+DjINgvzKHog6PMtxC+pghPwztx0GM3fITOkQC9lZfrFxmRfoyWyHcASr9KPBmtPPfKyyQ3SWQAjQ8rEV13i0T4WEUCMqY26PBUZwC5qE5YUyGT rancher@localhost 2 | -------------------------------------------------------------------------------- /package/packer/vagrant/config.yml: -------------------------------------------------------------------------------- 1 | run_cmd: 2 | # Duplicate rancher as vagrant user to let ssh the system with vagrant login 3 | - "sudo sed -e '/^rancher/p' -e 's/^rancher/vagrant/' -i /etc/passwd" 4 | ssh_authorized_keys: 5 | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCm4mvO91LnMIEusfofrsICXdh3eirAuA/z+YX6CDNLuL0O7tZvaCC6g8J2F5bGCTB7qsAzTamDC1p9i6vJJKvzOvkpYiLrugI0f59EERBxudGUw6hsBaDaFgMMH+UQdlg3HKSA34uXEgIzo0HgPCVjw1IT9yLiBRXcb55CKi0l9fQbreC4DDUKl/VX+CVtw2Z8cUx+IxbYet0ehpS6dXqsDoYpSRayrNgSD69Ty+DjINgvzKHog6PMtxC+pghPwztx0GM3fITOkQC9lZfrFxmRfoyWyHcASr9KPBmtPPfKyyQ3SWQAjQ8rEV13i0T4WEUCMqY26PBUZwC5qE5YUyGT 6 | # Vagrant key, from https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub 7 | - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key 8 | k3os: 9 | password: rancher 10 | 11 | -------------------------------------------------------------------------------- /package/packer/vagrant/packer_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCm4mvO91LnMIEusfofrsICXdh3eirAuA/z+YX6CDNLuL0O7tZvaCC6g8J2F5bGCTB7qsAzTamDC1p9i6vJJKvzOvkpYiLrugI0f59EERBxudGUw6hsBaDaFgMMH+UQdlg3HKSA34uXEgIzo0HgPCVjw1IT9yLiBRXcb55CKi0l9fQbreC4DDUKl/VX+CVtw2Z8cUx+IxbYet0ehpS6dXqsDoYpSRayrNgSD69Ty+DjINgvzKHog6PMtxC+pghPwztx0GM3fITOkQC9lZfrFxmRfoyWyHcASr9KPBmtPPfKyyQ3SWQAjQ8rEV13i0T4WEUCMqY26PBUZwC5qE5YUyGT rancher@localhost 2 | -------------------------------------------------------------------------------- /package/packer/vagrant/vagrantfile.template: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.define "k3os" 6 | config.vm.box = "k3os" 7 | config.vm.guest = :linux 8 | 9 | config.ssh.username = 'rancher' 10 | config.ssh.password = 'rancher' 11 | 12 | # Disable conflicting plugins 13 | config.vbguest.auto_update = false if Vagrant.has_plugin?("vagrant-vbguest") 14 | 15 | # Disable default file syncing 16 | config.vm.synced_folder '.', '/vagrant', disabled: true 17 | end 18 | -------------------------------------------------------------------------------- /package/packer/vsphere/agent/k3os-agent-variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "vcenter_server":"vcenter.example.com", 3 | "vcenter_username":"administrator@vsphere.local", 4 | "vcenter_password":"YourPasswordHere1!", 5 | "vcenter_datastore":"datastore0", 6 | "vcenter_folder": "Packer_Images", 7 | "vcenter_host":"esxi_hostname/IP", 8 | "vcenter_network": "192.168.50.x-24", 9 | "vcenter_iso_path": "[raid0] ISOs/k3os-amd64.iso", 10 | "template_name": "k3os-agent-template", 11 | "ssh_username": "rancher", 12 | "rancher_password": "YourPasswordHere", 13 | "server_url": "https://k3s.server:6443", 14 | "server_token": "YourTokenHere" 15 | } 16 | -------------------------------------------------------------------------------- /package/packer/vsphere/server/k3os-server-variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "vcenter_server":"vcenter.example.com", 3 | "vcenter_username":"administrator@vsphere.local", 4 | "vcenter_password":"YourPasswordHere1!", 5 | "vcenter_datastore":"datastore0", 6 | "vcenter_folder": "Packer_Images", 7 | "vcenter_host":"esxi_hostname/IP", 8 | "vcenter_network": "192.168.50.x-24", 9 | "vcenter_iso_path": "[raid0] ISOs/k3os-amd64.iso", 10 | "template_name": "k3os-server-template", 11 | "ssh_username": "rancher", 12 | "rancher_password": "YourPasswordHere", 13 | "server_token": "YourTokenHere" 14 | } 15 | -------------------------------------------------------------------------------- /pkg/cli/install/install.go: -------------------------------------------------------------------------------- 1 | package install 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/rancher/k3os/pkg/cliinstall" 8 | "github.com/rancher/k3os/pkg/mode" 9 | "github.com/sirupsen/logrus" 10 | "github.com/urfave/cli" 11 | ) 12 | 13 | func Command() cli.Command { 14 | mode, _ := mode.Get() 15 | return cli.Command{ 16 | Name: "install", 17 | Usage: "install k3OS", 18 | Flags: []cli.Flag{}, 19 | Before: func(c *cli.Context) error { 20 | if os.Getuid() != 0 { 21 | return fmt.Errorf("must be run as root") 22 | } 23 | return nil 24 | }, 25 | Action: func(*cli.Context) { 26 | if err := cliinstall.Run(); err != nil { 27 | logrus.Error(err) 28 | } 29 | }, 30 | Hidden: mode == "local", 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pkg/command/command.go: -------------------------------------------------------------------------------- 1 | package command 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "os" 7 | "os/exec" 8 | "strings" 9 | 10 | "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func ExecuteCommand(commands []string) error { 14 | for _, cmd := range commands { 15 | logrus.Debugf("running cmd `%s`", cmd) 16 | c := exec.Command("sh", "-c", cmd) 17 | c.Stdout = os.Stdout 18 | c.Stderr = os.Stderr 19 | if err := c.Run(); err != nil { 20 | return fmt.Errorf("failed to run %s: %v", cmd, err) 21 | } 22 | } 23 | return nil 24 | } 25 | 26 | func SetPassword(password string) error { 27 | if password == "" { 28 | return nil 29 | } 30 | cmd := exec.Command("chpasswd") 31 | if strings.HasPrefix(password, "$") { 32 | cmd.Args = append(cmd.Args, "-e") 33 | } 34 | cmd.Stdin = strings.NewReader(fmt.Sprint("rancher:", password)) 35 | cmd.Stdout = os.Stdout 36 | errBuffer := &bytes.Buffer{} 37 | cmd.Stderr = errBuffer 38 | err := cmd.Run() 39 | if err != nil { 40 | os.Stderr.Write(errBuffer.Bytes()) 41 | } 42 | return err 43 | } 44 | -------------------------------------------------------------------------------- /pkg/config/read_test.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "testing" 4 | 5 | func TestDataSource(t *testing.T) { 6 | cc, err := readersToObject(func() (map[string]interface{}, error) { 7 | return map[string]interface{}{ 8 | "k3os": map[string]interface{}{ 9 | "datasource": "foo", 10 | }, 11 | }, nil 12 | }) 13 | if err != nil { 14 | t.Fatal(err) 15 | } 16 | if len(cc.K3OS.DataSources) != 1 { 17 | t.Fatal("no datasources") 18 | } 19 | if cc.K3OS.DataSources[0] != "foo" { 20 | t.Fatalf("%s != foo", cc.K3OS.DataSources[0]) 21 | } 22 | } 23 | 24 | func TestAuthorizedKeys(t *testing.T) { 25 | c1 := map[string]interface{}{ 26 | "ssh_authorized_keys": []string{ 27 | "one...", 28 | }, 29 | } 30 | c2 := map[string]interface{}{ 31 | "ssh_authorized_keys": []string{ 32 | "two...", 33 | }, 34 | } 35 | cc, err := readersToObject( 36 | func() (map[string]interface{}, error) { 37 | return c1, nil 38 | }, 39 | func() (map[string]interface{}, error) { 40 | return c2, nil 41 | }, 42 | ) 43 | if len(cc.SSHAuthorizedKeys) != 1 { 44 | t.Fatal(err, "got %d keys, expected 2", len(cc.SSHAuthorizedKeys)) 45 | } 46 | if err != nil { 47 | t.Fatal(err) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /pkg/config/write.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/ghodss/yaml" 8 | "github.com/rancher/mapper/convert" 9 | ) 10 | 11 | func PrintInstall(cfg CloudConfig) ([]byte, error) { 12 | data, err := convert.EncodeToMap(cfg.K3OS.Install) 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | toYAMLKeys(data) 18 | return yaml.Marshal(data) 19 | } 20 | 21 | func Write(cfg CloudConfig, writer io.Writer) error { 22 | bytes, err := ToBytes(cfg) 23 | if err != nil { 24 | return fmt.Errorf("failed to marshal [%s]: %v", string(bytes), err) 25 | } 26 | _, err = writer.Write(bytes) 27 | return err 28 | } 29 | 30 | func ToBytes(cfg CloudConfig) ([]byte, error) { 31 | cfg.K3OS.Install = nil 32 | data, err := convert.EncodeToMap(cfg) 33 | if err != nil { 34 | return nil, err 35 | } 36 | 37 | toYAMLKeys(data) 38 | return yaml.Marshal(data) 39 | } 40 | 41 | func toYAMLKeys(data map[string]interface{}) { 42 | for k, v := range data { 43 | if sub, ok := v.(map[string]interface{}); ok { 44 | toYAMLKeys(sub) 45 | } 46 | newK := convert.ToYAMLKey(k) 47 | if newK != k { 48 | delete(data, k) 49 | data[newK] = v 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /pkg/mode/mode.go: -------------------------------------------------------------------------------- 1 | package mode 2 | 3 | import ( 4 | "io/ioutil" 5 | "os" 6 | "path/filepath" 7 | "strings" 8 | 9 | "github.com/rancher/k3os/pkg/system" 10 | ) 11 | 12 | func Get(prefix ...string) (string, error) { 13 | bytes, err := ioutil.ReadFile(filepath.Join(filepath.Join(prefix...), system.StatePath("mode"))) 14 | if os.IsNotExist(err) { 15 | return "", nil 16 | } else if err != nil { 17 | return "", err 18 | } 19 | return strings.TrimSpace(string(bytes)), nil 20 | } 21 | -------------------------------------------------------------------------------- /pkg/module/module.go: -------------------------------------------------------------------------------- 1 | package module 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "os" 7 | "strings" 8 | 9 | "github.com/paultag/go-modprobe" 10 | "github.com/rancher/k3os/pkg/config" 11 | "github.com/sirupsen/logrus" 12 | ) 13 | 14 | const ( 15 | procModulesFile = "/proc/modules" 16 | ) 17 | 18 | func LoadModules(cfg *config.CloudConfig) error { 19 | loaded := map[string]bool{} 20 | f, err := os.Open(procModulesFile) 21 | if err != nil { 22 | return err 23 | } 24 | defer f.Close() 25 | sc := bufio.NewScanner(f) 26 | for sc.Scan() { 27 | loaded[strings.SplitN(sc.Text(), " ", 2)[0]] = true 28 | } 29 | modules := cfg.K3OS.Modules 30 | for _, m := range modules { 31 | if loaded[m] { 32 | continue 33 | } 34 | params := strings.SplitN(m, " ", -1) 35 | logrus.Debugf("module %s with parameters [%s] is loading", m, params) 36 | if err := modprobe.Load(params[0], strings.Join(params[1:], " ")); err != nil { 37 | return fmt.Errorf("could not load module %s with parameters [%s], err %v", m, params, err) 38 | } 39 | logrus.Debugf("module %s is loaded", m) 40 | } 41 | return sc.Err() 42 | } 43 | -------------------------------------------------------------------------------- /pkg/sysctl/sysctl.go: -------------------------------------------------------------------------------- 1 | package sysctl 2 | 3 | import ( 4 | "io/ioutil" 5 | "path" 6 | "strings" 7 | 8 | "github.com/rancher/k3os/pkg/config" 9 | ) 10 | 11 | func ConfigureSysctl(cfg *config.CloudConfig) error { 12 | for k, v := range cfg.K3OS.Sysctls { 13 | elements := []string{"/proc", "sys"} 14 | elements = append(elements, strings.Split(k, ".")...) 15 | path := path.Join(elements...) 16 | if err := ioutil.WriteFile(path, []byte(v), 0644); err != nil { 17 | return err 18 | } 19 | } 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /pkg/version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | var ( 4 | Version = "HEAD" 5 | ) 6 | -------------------------------------------------------------------------------- /scripts/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source $(dirname $0)/version 5 | source $(dirname $0)/images 6 | 7 | cd $(dirname $0)/.. 8 | 9 | cd images 10 | 11 | build_all "$@" 12 | -------------------------------------------------------------------------------- /scripts/ci: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0) 5 | 6 | ./build 7 | ./test 8 | ./validate 9 | ./package 10 | -------------------------------------------------------------------------------- /scripts/default: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0) 5 | 6 | ./build 7 | ./package 8 | -------------------------------------------------------------------------------- /scripts/entry: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | mkdir -p bin dist 5 | if [ -e ./scripts/$1 ]; then 6 | ./scripts/"$@" 7 | else 8 | exec "$@" 9 | fi 10 | 11 | chown -R $DAPPER_UID:$DAPPER_GID . 12 | -------------------------------------------------------------------------------- /scripts/package: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source $(dirname $0)/version 5 | source $(dirname $0)/images 6 | 7 | cd $(dirname $0)/.. 8 | 9 | DIST=$(pwd)/dist/artifacts 10 | 11 | pushd images/output 12 | build_all "$@" 13 | mkdir -p ${DIST} 14 | copy_all ${DIST} "$@" 15 | popd 16 | 17 | mkdir -p ./build 18 | ID=$(docker create ${REPO}/k3os-package:${TAG}) 19 | docker cp ${ID}:/output/k3os ./build/ 20 | docker rm -fv $ID 21 | 22 | docker build \ 23 | --build-arg ARCH=${ARCH} \ 24 | --build-arg REPO=${REPO} \ 25 | --build-arg TAG=${TAG} \ 26 | --build-arg VERSION=${VERSION} \ 27 | --file package/Dockerfile \ 28 | --tag ${REPO}/k3os:${TAG} \ 29 | --tag ${REPO}/k3os:latest \ 30 | . 31 | docker image save --output ./dist/images.tar \ 32 | ${REPO}/k3os:${TAG} \ 33 | ${REPO}/k3os:latest 34 | echo ${REPO}/k3os:${TAG} > ./dist/images.txt 35 | echo Built ${REPO}/k3os:${TAG} 36 | -------------------------------------------------------------------------------- /scripts/release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec $(dirname $0)/ci 4 | -------------------------------------------------------------------------------- /scripts/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | source $(dirname $0)/version 5 | 6 | cd $(dirname $0)/.. 7 | 8 | mkdir -p build 9 | 10 | bash -x ./scripts/build 11 | 12 | ID=$(docker run --net=host --privileged --rm -itd $REPO/k3os-iso:$TAG) 13 | docker attach $ID || docker kill $ID 14 | -------------------------------------------------------------------------------- /scripts/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0)/.. 5 | 6 | echo Running tests 7 | 8 | PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')" 9 | 10 | go test -cover -tags=test ${PACKAGES} 11 | -------------------------------------------------------------------------------- /scripts/validate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0)/.. 5 | 6 | if ! command -v golangci-lint; then 7 | echo Skipping validation: no golangci-lint available 8 | exit 9 | fi 10 | echo Running validation 11 | 12 | if [ ! -e build/data ];then 13 | mkdir -p build/data 14 | fi 15 | 16 | echo Running: go generate 17 | go generate 18 | 19 | echo Running: golangci-lint 20 | golangci-lint run 21 | 22 | . ./scripts/version 23 | 24 | if [ -n "$DIRTY" ]; then 25 | echo Source dir is dirty 26 | git status --porcelain --untracked-files=no 27 | exit 1 28 | fi 29 | 30 | GO111MODULE=on go mod verify 31 | -------------------------------------------------------------------------------- /scripts/version: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$(git status --porcelain --untracked-files=no)" ]; then 4 | DIRTY="-dirty" 5 | fi 6 | 7 | COMMIT=$(git rev-parse --short HEAD) 8 | GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)} 9 | 10 | if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then 11 | VERSION=$GIT_TAG 12 | else 13 | VERSION="$(git describe --always --tags)${DIRTY}" 14 | fi 15 | 16 | if [ -z "$ARCH" ]; then 17 | ARCH=$(go env GOHOSTARCH) 18 | fi 19 | 20 | ARCH=${ARCH:-"amd64"} 21 | TAG=${TAG:-"${VERSION}-${ARCH}"} 22 | REPO=${REPO:-rancher} 23 | 24 | if echo $TAG | grep -q dirty; then 25 | TAG=dev 26 | fi 27 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Brian Goff 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "github.com/russross/blackfriday/v2" 5 | ) 6 | 7 | // Render converts a markdown document into a roff formatted document. 8 | func Render(doc []byte) []byte { 9 | renderer := NewRoffRenderer() 10 | 11 | return blackfriday.Run(doc, 12 | []blackfriday.Option{blackfriday.WithRenderer(renderer), 13 | blackfriday.WithExtensions(renderer.GetExtensions())}...) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2016 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | This product contains software (https://github.com/kr/pty) developed 7 | by Keith Rarick, licensed under the MIT License. 8 | 9 | The following is courtesy of our legal counsel: 10 | 11 | 12 | Use and transfer of Docker may be subject to certain restrictions by the 13 | United States and other governments. 14 | It is your responsibility to ensure that your use and/or transfer does not 15 | violate applicable laws. 16 | 17 | For more information, please see https://www.bis.doc.gov 18 | 19 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | // These flags are unsupported. 6 | const ( 7 | BIND = 0 8 | DIRSYNC = 0 9 | MANDLOCK = 0 10 | NOATIME = 0 11 | NODEV = 0 12 | NODIRATIME = 0 13 | NOEXEC = 0 14 | NOSUID = 0 15 | UNBINDABLE = 0 16 | RUNBINDABLE = 0 17 | PRIVATE = 0 18 | RPRIVATE = 0 19 | SHARED = 0 20 | RSHARED = 0 21 | SLAVE = 0 22 | RSLAVE = 0 23 | RBIND = 0 24 | RELATIME = 0 25 | RELATIVE = 0 26 | REMOUNT = 0 27 | STRICTATIME = 0 28 | SYNCHRONOUS = 0 29 | RDONLY = 0 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_linux.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | func mount(device, target, mType string, flag uintptr, data string) error { 8 | if err := syscall.Mount(device, target, mType, flag, data); err != nil { 9 | return err 10 | } 11 | 12 | // If we have a bind mount or remount, remount... 13 | if flag&syscall.MS_BIND == syscall.MS_BIND && flag&syscall.MS_RDONLY == syscall.MS_RDONLY { 14 | return syscall.Mount(device, target, mType, flag|syscall.MS_REMOUNT, data) 15 | } 16 | return nil 17 | } 18 | 19 | func unmount(target string, flag int) error { 20 | return syscall.Unmount(target, flag) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | "unsafe" 8 | ) 9 | 10 | // #include 11 | // #include 12 | // #include 13 | // int Mount(const char *spec, const char *dir, int mflag, 14 | // char *fstype, char *dataptr, int datalen, char *optptr, int optlen) { 15 | // return mount(spec, dir, mflag, fstype, dataptr, datalen, optptr, optlen); 16 | // } 17 | import "C" 18 | 19 | func mount(device, target, mType string, flag uintptr, data string) error { 20 | spec := C.CString(device) 21 | dir := C.CString(target) 22 | fstype := C.CString(mType) 23 | _, err := C.Mount(spec, dir, C.int(flag), fstype, nil, 0, nil, 0) 24 | C.free(unsafe.Pointer(spec)) 25 | C.free(unsafe.Pointer(dir)) 26 | C.free(unsafe.Pointer(fstype)) 27 | return err 28 | } 29 | 30 | func unmount(target string, flag int) error { 31 | err := unix.Unmount(target, flag) 32 | return err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | func mount(device, target, mType string, flag uintptr, data string) error { 6 | panic("Not implemented") 7 | } 8 | 9 | func unmount(target string, flag int) error { 10 | panic("Not implemented") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | /* 4 | #include 5 | #include 6 | #include 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | "reflect" 13 | "unsafe" 14 | ) 15 | 16 | // Parse /proc/self/mountinfo because comparing Dev and ino does not work from 17 | // bind mounts. 18 | func parseMountTable() ([]*Info, error) { 19 | var rawEntries *C.struct_statfs 20 | 21 | count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) 22 | if count == 0 { 23 | return nil, fmt.Errorf("Failed to call getmntinfo") 24 | } 25 | 26 | var entries []C.struct_statfs 27 | header := (*reflect.SliceHeader)(unsafe.Pointer(&entries)) 28 | header.Cap = count 29 | header.Len = count 30 | header.Data = uintptr(unsafe.Pointer(rawEntries)) 31 | 32 | var out []*Info 33 | for _, entry := range entries { 34 | var mountinfo Info 35 | mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) 36 | mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) 37 | mountinfo.Fstype = C.GoString(&entry.f_fstypename[0]) 38 | out = append(out, &mountinfo) 39 | } 40 | return out, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | import ( 12 | "fmt" 13 | ) 14 | 15 | func parseMountTable() ([]*Info, error) { 16 | mnttab := C.fopen(C.CString(C.MNTTAB), C.CString("r")) 17 | if mnttab == nil { 18 | return nil, fmt.Errorf("Failed to open %s", C.MNTTAB) 19 | } 20 | 21 | var out []*Info 22 | var mp C.struct_mnttab 23 | 24 | ret := C.getmntent(mnttab, &mp) 25 | for ret == 0 { 26 | var mountinfo Info 27 | mountinfo.Mountpoint = C.GoString(mp.mnt_mountp) 28 | mountinfo.Source = C.GoString(mp.mnt_special) 29 | mountinfo.Fstype = C.GoString(mp.mnt_fstype) 30 | mountinfo.Opts = C.GoString(mp.mnt_mntopts) 31 | out = append(out, &mountinfo) 32 | ret = C.getmntent(mnttab, &mp) 33 | } 34 | 35 | C.fclose(mnttab) 36 | return out, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "fmt" 7 | "runtime" 8 | ) 9 | 10 | func parseMountTable() ([]*Info, error) { 11 | return nil, fmt.Errorf("mount.parseMountTable is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_windows.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | func parseMountTable() ([]*Info, error) { 4 | // Do NOT return an error! 5 | return nil, nil 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/README.md: -------------------------------------------------------------------------------- 1 | ## reexec 2 | 3 | The `reexec` package facilitates the busybox style reexec of the docker binary that we require because 4 | of the forking limitations of using Go. Handlers can be registered with a name and the argv 0 of 5 | the exec of the binary will be used to find and execute custom init paths. 6 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | "syscall" 8 | ) 9 | 10 | // Self returns the path to the current process's binary. 11 | // Returns "/proc/self/exe". 12 | func Self() string { 13 | return "/proc/self/exe" 14 | } 15 | 16 | // Command returns *exec.Cmd which has Path as current binary. Also it setting 17 | // SysProcAttr.Pdeathsig to SIGTERM. 18 | // This will use the in-memory version (/proc/self/exe) of the current binary, 19 | // it is thus safe to delete or replace the on-disk binary (os.Args[0]). 20 | func Command(args ...string) *exec.Cmd { 21 | return &exec.Cmd{ 22 | Path: Self(), 23 | Args: args, 24 | SysProcAttr: &syscall.SysProcAttr{ 25 | Pdeathsig: syscall.SIGTERM, 26 | }, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd solaris darwin 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Self returns the path to the current process's binary. 10 | // Uses os.Args[0]. 11 | func Self() string { 12 | return naiveSelf() 13 | } 14 | 15 | // Command returns *exec.Cmd which has Path as current binary. 16 | // For example if current binary is "docker" at "/usr/bin/", then cmd.Path will 17 | // be set to "/usr/bin/docker". 18 | func Command(args ...string) *exec.Cmd { 19 | return &exec.Cmd{ 20 | Path: Self(), 21 | Args: args, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd,!solaris,!darwin 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Command is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin. 10 | func Command(args ...string) *exec.Cmd { 11 | return nil 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Self returns the path to the current process's binary. 10 | // Uses os.Args[0]. 11 | func Self() string { 12 | return naiveSelf() 13 | } 14 | 15 | // Command returns *exec.Cmd which has Path as current binary. 16 | // For example if current binary is "docker.exe" at "C:\", then cmd.Path will 17 | // be set to "C:\docker.exe". 18 | func Command(args ...string) *exec.Cmd { 19 | return &exec.Cmd{ 20 | Path: Self(), 21 | Args: args, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. 14 | 15 | go-units is licensed under the Apache License, Version 2.0. 16 | See [LICENSE](LICENSE) for the full text of the license. 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | post: 3 | # install golint 4 | - go get golang.org/x/lint/golint 5 | 6 | test: 7 | pre: 8 | # run analysis before tests 9 | - go vet ./... 10 | - test -z "$(golint ./... | tee /dev/stderr)" 11 | - test -z "$(gofmt -s -l . | tee /dev/stderr)" 12 | -------------------------------------------------------------------------------- /vendor/github.com/ghodss/yaml/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX leaves these everywhere on SMB shares 2 | ._* 3 | 4 | # Eclipse files 5 | .classpath 6 | .project 7 | .settings/** 8 | 9 | # Emacs save files 10 | *~ 11 | 12 | # Vim-related files 13 | [._]*.s[a-w][a-z] 14 | [._]s[a-w][a-z] 15 | *.un~ 16 | Session.vim 17 | .netrwhist 18 | 19 | # Go test binaries 20 | *.test 21 | -------------------------------------------------------------------------------- /vendor/github.com/ghodss/yaml/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4 5 | script: 6 | - go test 7 | - go build 8 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/konsorten/go-windows-terminal-sequences 2 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package sequences 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | var ( 11 | kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll") 12 | setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode") 13 | ) 14 | 15 | func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error { 16 | const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4 17 | 18 | var mode uint32 19 | err := syscall.GetConsoleMode(syscall.Stdout, &mode) 20 | if err != nil { 21 | return err 22 | } 23 | 24 | if enable { 25 | mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING 26 | } else { 27 | mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING 28 | } 29 | 30 | ret, _, err := setConsoleMode.Call(uintptr(unsafe.Pointer(stream)), uintptr(mode)) 31 | if ret == 0 { 32 | return err 33 | } 34 | 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin 2 | 3 | package sequences 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error { 10 | return fmt.Errorf("windows only package") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | 5 | os: 6 | - linux 7 | - osx 8 | 9 | before_install: 10 | - go get github.com/mattn/goveralls 11 | - go get golang.org/x/tools/cmd/cover 12 | script: 13 | - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mattn/go-isatty 2 | 3 | require golang.org/x/sys v0.0.0-20191008105621-543471e840be 4 | 5 | go 1.14 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= 2 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 3 | golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= 4 | golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_android.go: -------------------------------------------------------------------------------- 1 | // +build android 2 | 3 | package isatty 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | // IsTerminal return true if the file descriptor is terminal. 13 | func IsTerminal(fd uintptr) bool { 14 | var termios syscall.Termios 15 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 16 | return err == 0 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | 20 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 21 | // terminal. This is also always false on this environment. 22 | func IsCygwinTerminal(fd uintptr) bool { 23 | return false 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build appengine js nacl 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on js and appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | // +build plan9 2 | 3 | package isatty 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // IsTerminal returns true if the given file descriptor is a terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | path, err := syscall.Fd2path(fd) 12 | if err != nil { 13 | return false 14 | } 15 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 16 | } 17 | 18 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 | // terminal. This is also always false on this environment. 20 | func IsCygwinTerminal(fd uintptr) bool { 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | 18 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 | // terminal. This is also always false on this environment. 20 | func IsCygwinTerminal(fd uintptr) bool { 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | // +build linux aix 2 | // +build !appengine 3 | // +build !android 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | before_install: 5 | - go get github.com/mattn/goveralls 6 | - go get golang.org/x/tools/cmd/cover 7 | script: 8 | - $HOME/gopath/bin/goveralls -repotoken 2FMhp57u8LcstKL9B190fLTcEnBtAAiEL 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mattn/go-shellwords 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/util_go15.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6 2 | 3 | package shellwords 4 | 5 | import ( 6 | "os" 7 | "os/exec" 8 | "runtime" 9 | "strings" 10 | ) 11 | 12 | func shellRun(line string) (string, error) { 13 | var b []byte 14 | var err error 15 | if runtime.GOOS == "windows" { 16 | b, err = exec.Command(os.Getenv("COMSPEC"), "/c", line).Output() 17 | } else { 18 | b, err = exec.Command(os.Getenv("SHELL"), "-c", line).Output() 19 | } 20 | if err != nil { 21 | return "", err 22 | } 23 | return strings.TrimSpace(string(b)), nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/util_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,go1.6 2 | 3 | package shellwords 4 | 5 | import ( 6 | "errors" 7 | "os" 8 | "os/exec" 9 | "strings" 10 | ) 11 | 12 | func shellRun(line string) (string, error) { 13 | shell := os.Getenv("SHELL") 14 | b, err := exec.Command(shell, "-c", line).Output() 15 | if err != nil { 16 | if eerr, ok := err.(*exec.ExitError); ok { 17 | b = eerr.Stderr 18 | } 19 | return "", errors.New(err.Error() + ":" + string(b)) 20 | } 21 | return strings.TrimSpace(string(b)), nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/util_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows,go1.6 2 | 3 | package shellwords 4 | 5 | import ( 6 | "errors" 7 | "os" 8 | "os/exec" 9 | "strings" 10 | ) 11 | 12 | func shellRun(line string) (string, error) { 13 | shell := os.Getenv("COMSPEC") 14 | b, err := exec.Command(shell, "/c", line).Output() 15 | if err != nil { 16 | if eerr, ok := err.(*exec.ExitError); ok { 17 | b = eerr.Stderr 18 | } 19 | return "", errors.New(err.Error() + ":" + string(b)) 20 | } 21 | return strings.TrimSpace(string(b)), nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/otiai10/copy/.gitignore: -------------------------------------------------------------------------------- 1 | testdata.copy 2 | coverage.txt 3 | vendor 4 | -------------------------------------------------------------------------------- /vendor/github.com/otiai10/copy/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.9 4 | - tip 5 | before_script: 6 | - go get -t ./... 7 | script: 8 | - go test ./... -v 9 | - go test -race -coverprofile=coverage.txt -covermode=atomic 10 | after_success: 11 | - bash <(curl -s https://codecov.io/bash) 12 | -------------------------------------------------------------------------------- /vendor/github.com/otiai10/copy/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 otiai10 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/otiai10/copy/README.md: -------------------------------------------------------------------------------- 1 | # copy 2 | 3 | [![Build Status](https://travis-ci.org/otiai10/copy.svg?branch=master)](https://travis-ci.org/otiai10/copy) 4 | [![codecov](https://codecov.io/gh/otiai10/copy/branch/master/graph/badge.svg)](https://codecov.io/gh/otiai10/copy) 5 | [![GoDoc](https://godoc.org/github.com/otiai10/copy?status.svg)](https://godoc.org/github.com/otiai10/copy) 6 | [![Go Report Card](https://goreportcard.com/badge/github.com/otiai10/copy)](https://goreportcard.com/report/github.com/otiai10/copy) 7 | 8 | `copy` copies directories recursively. 9 | 10 | Example: 11 | 12 | ```go 13 | err := Copy("your/directory", "your/directory.copy") 14 | ``` 15 | -------------------------------------------------------------------------------- /vendor/github.com/otiai10/copy/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/otiai10/copy 2 | 3 | go 1.12 4 | 5 | require github.com/otiai10/mint v1.3.0 6 | -------------------------------------------------------------------------------- /vendor/github.com/otiai10/copy/go.sum: -------------------------------------------------------------------------------- 1 | github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= 2 | github.com/otiai10/mint v1.3.0 h1:Ady6MKVezQwHBkGzLFbrsywyp09Ah7rkmfjV3Bcr5uc= 3 | github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= 4 | -------------------------------------------------------------------------------- /vendor/github.com/paultag/go-modprobe/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /vendor/github.com/paultag/go-modprobe/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, Paul R. Tagliamonte 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/paultag/go-modprobe/README.md: -------------------------------------------------------------------------------- 1 | # go-modprobe 2 | 3 | Load an unload Linux kernel modules using the Linux module syscalls. 4 | 5 | This package is Linux specific. Loading a module uses the `finit` variant, 6 | which allows loading of modules by a file descriptor, rather than having to 7 | load an ELF into the process memory before loading. 8 | 9 | The ability to load and unload modules is dependent on either the `CAP_SYS_MODULE` 10 | capability, or running as root. Care should be taken to understand what security 11 | implications this has on processes that use this library. 12 | 13 | ## Setting the capability on a binary using this package 14 | 15 | ``` 16 | $ sudo setcap cap_sys_module+ep /path/to/binary 17 | ``` 18 | -------------------------------------------------------------------------------- /vendor/github.com/paultag/go-modprobe/docs.go: -------------------------------------------------------------------------------- 1 | // modprobe allows users to load and unload Linux kernel modules by calling 2 | // the relevent Linux syscalls. 3 | package modprobe 4 | -------------------------------------------------------------------------------- /vendor/github.com/paultag/go-modprobe/load.go: -------------------------------------------------------------------------------- 1 | package modprobe 2 | 3 | import ( 4 | "os" 5 | 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Given a short module name (such as `g_ether`), determine where the kernel 10 | // module is located, determine any dependencies, and load all required modules. 11 | func Load(module, params string) error { 12 | path, err := ResolveName(module) 13 | if err != nil { 14 | return err 15 | } 16 | 17 | order, err := Dependencies(path) 18 | if err != nil { 19 | return err 20 | } 21 | 22 | paramList := make([]string, len(order)) 23 | paramList[len(order)-1] = params 24 | 25 | for i, module := range order { 26 | fd, err := os.Open(module) 27 | if err != nil { 28 | return err 29 | } 30 | /* not doing a defer since we're in a loop */ 31 | param := paramList[i] 32 | if err := Init(fd, param); err != nil && err != unix.EEXIST { 33 | fd.Close() 34 | return err 35 | } 36 | fd.Close() 37 | } 38 | 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - 1.9.x 10 | - 1.10.x 11 | - 1.11.x 12 | - tip 13 | 14 | script: 15 | - go test -v ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/README.md: -------------------------------------------------------------------------------- 1 | Framework to move fields around 2 | =============================== 3 | 4 | Not really in a state for public consumption. 5 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/convert/ref.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import "fmt" 4 | 5 | func ToReference(typeName string) string { 6 | return fmt.Sprintf("reference[%s]", typeName) 7 | } 8 | 9 | func ToFullReference(path, typeName string) string { 10 | return fmt.Sprintf("reference[%s/schemas/%s]", path, typeName) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/convert/transform.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | const ( 4 | ArrayKey = "{ARRAY}" 5 | MapKey = "{MAP}" 6 | ) 7 | 8 | type TransformerFunc func(input interface{}) interface{} 9 | 10 | func Transform(data map[string]interface{}, path []string, transformer TransformerFunc) { 11 | if len(path) == 0 || len(data) == 0 { 12 | return 13 | } 14 | 15 | key := path[0] 16 | path = path[1:] 17 | value := data[key] 18 | 19 | if value == nil { 20 | return 21 | } 22 | 23 | if len(path) == 0 { 24 | data[key] = transformer(value) 25 | return 26 | } 27 | 28 | // You can't end a path with ARRAY/MAP. Not supported right now 29 | if len(path) > 1 { 30 | switch path[0] { 31 | case ArrayKey: 32 | for _, valueMap := range ToMapSlice(value) { 33 | Transform(valueMap, path[1:], transformer) 34 | } 35 | return 36 | case MapKey: 37 | for _, valueMap := range ToMapInterface(value) { 38 | Transform(ToMapInterface(valueMap), path[1:], transformer) 39 | } 40 | return 41 | } 42 | } 43 | 44 | Transform(ToMapInterface(value), path, transformer) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/convert/value_set_string.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "regexp" 5 | "strings" 6 | ) 7 | 8 | var ( 9 | splitRegexp = regexp.MustCompile("[[:space:]]*,[[:space:]]*") 10 | ) 11 | 12 | func ToValuesSlice(value string) []string { 13 | value = strings.TrimSpace(value) 14 | if strings.HasPrefix(value, "(") && strings.HasSuffix(value, ")") { 15 | return splitRegexp.Split(value[1:len(value)-1], -1) 16 | } 17 | return []string{value} 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/definition/definition.go: -------------------------------------------------------------------------------- 1 | package definition 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/rancher/mapper/convert" 7 | ) 8 | 9 | func IsMapType(fieldType string) bool { 10 | return strings.HasPrefix(fieldType, "map[") && strings.HasSuffix(fieldType, "]") 11 | } 12 | 13 | func IsArrayType(fieldType string) bool { 14 | return strings.HasPrefix(fieldType, "array[") && strings.HasSuffix(fieldType, "]") 15 | } 16 | 17 | func IsReferenceType(fieldType string) bool { 18 | return strings.HasPrefix(fieldType, "reference[") && strings.HasSuffix(fieldType, "]") 19 | } 20 | 21 | func SubType(fieldType string) string { 22 | i := strings.Index(fieldType, "[") 23 | if i <= 0 || i >= len(fieldType)-1 { 24 | return fieldType 25 | } 26 | 27 | return fieldType[i+1 : len(fieldType)-1] 28 | } 29 | 30 | func GetType(data map[string]interface{}) string { 31 | return GetShortTypeFromFull(GetFullType(data)) 32 | } 33 | 34 | func GetShortTypeFromFull(fullType string) string { 35 | parts := strings.Split(fullType, "/") 36 | return parts[len(parts)-1] 37 | } 38 | 39 | func GetFullType(data map[string]interface{}) string { 40 | return convert.ToString(data["type"]) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/encoder.go: -------------------------------------------------------------------------------- 1 | package mapper 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | "regexp" 7 | 8 | "github.com/ghodss/yaml" 9 | ) 10 | 11 | var ( 12 | commenter = regexp.MustCompile("(?m)^( *)zzz#\\((.*)\\)\\((.*)\\)([a-z]+.*):(.*)") 13 | ) 14 | 15 | func JSONEncoder(writer io.Writer, v interface{}) error { 16 | return json.NewEncoder(writer).Encode(v) 17 | } 18 | 19 | func YAMLEncoder(writer io.Writer, v interface{}) error { 20 | data, err := json.Marshal(v) 21 | if err != nil { 22 | return err 23 | } 24 | buf, err := yaml.JSONToYAML(data) 25 | if err != nil { 26 | return err 27 | } 28 | //buf = commenter.ReplaceAll(buf, []byte("${1}# ${2}type: ${3}\n${1}# ${4}:${5}")) 29 | buf = commenter.ReplaceAll(buf, []byte("${1}# ${4}:${5}")) 30 | _, err = writer.Write(buf) 31 | return err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/rancher/mapper 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/docker/go-units v0.3.3 7 | github.com/ghodss/yaml v1.0.0 8 | github.com/mattn/go-shellwords v1.0.5 9 | github.com/rancher/wrangler v0.0.0-20190426050201-5946f0eaed19 10 | github.com/sirupsen/logrus v1.4.1 11 | github.com/stretchr/testify v1.3.0 12 | k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/access.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "strings" 5 | 6 | types "github.com/rancher/mapper" 7 | ) 8 | 9 | type Access struct { 10 | Fields map[string]string 11 | Optional bool 12 | } 13 | 14 | func (e Access) FromInternal(data map[string]interface{}) { 15 | } 16 | 17 | func (e Access) ToInternal(data map[string]interface{}) error { 18 | return nil 19 | } 20 | 21 | func (e Access) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 22 | for name, access := range e.Fields { 23 | if err := ValidateField(name, schema); err != nil { 24 | if e.Optional { 25 | continue 26 | } 27 | return err 28 | } 29 | 30 | field := schema.ResourceFields[name] 31 | field.Create = strings.Contains(access, "c") 32 | field.Update = strings.Contains(access, "u") 33 | field.WriteOnly = strings.Contains(access, "o") 34 | 35 | schema.ResourceFields[name] = field 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/alias_field.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "github.com/rancher/mapper" 5 | ) 6 | 7 | type AliasField struct { 8 | Field string 9 | Names []string 10 | } 11 | 12 | func NewAlias(field string, names ...string) AliasField { 13 | return AliasField{ 14 | Field: field, 15 | Names: names, 16 | } 17 | } 18 | 19 | func (d AliasField) FromInternal(data map[string]interface{}) { 20 | } 21 | 22 | func (d AliasField) ToInternal(data map[string]interface{}) error { 23 | for _, name := range d.Names { 24 | if v, ok := data[name]; ok { 25 | delete(data, name) 26 | data[d.Field] = v 27 | } 28 | } 29 | return nil 30 | } 31 | 32 | func (d AliasField) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error { 33 | for _, name := range d.Names { 34 | schema.ResourceFields[name] = mapper.Field{} 35 | } 36 | 37 | return ValidateField(d.Field, schema) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/alias_value.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "strings" 5 | 6 | types "github.com/rancher/mapper" 7 | "github.com/rancher/mapper/convert" 8 | ) 9 | 10 | type AliasValue struct { 11 | Field string 12 | Alias map[string][]string 13 | } 14 | 15 | func (d AliasValue) FromInternal(data map[string]interface{}) { 16 | } 17 | 18 | func (d AliasValue) ToInternal(data map[string]interface{}) error { 19 | v, ok := data[d.Field] 20 | if !ok { 21 | return nil 22 | } 23 | 24 | for name, values := range d.Alias { 25 | for _, value := range values { 26 | if strings.EqualFold(value, convert.ToString(v)) { 27 | data[d.Field] = name 28 | } 29 | } 30 | } 31 | 32 | return nil 33 | } 34 | 35 | func (d AliasValue) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 36 | return ValidateField(d.Field, schema) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/bytes.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "github.com/docker/go-units" 5 | types "github.com/rancher/mapper" 6 | "github.com/rancher/mapper/convert" 7 | ) 8 | 9 | var abbrs = []string{"", "k", "m", "g", "t", "p"} 10 | 11 | type Bytes struct { 12 | Field string 13 | } 14 | 15 | func (d Bytes) FromInternal(data map[string]interface{}) { 16 | v, ok := data[d.Field] 17 | if !ok { 18 | return 19 | } 20 | 21 | n, err := convert.ToNumber(v) 22 | if err != nil { 23 | return 24 | } 25 | 26 | data[d.Field] = units.CustomSize("%.4g%s", float64(n), 1024.0, abbrs) 27 | } 28 | 29 | func (d Bytes) ToInternal(data map[string]interface{}) error { 30 | v, ok := data[d.Field] 31 | if !ok { 32 | return nil 33 | } 34 | 35 | if str, ok := v.(string); ok { 36 | sec, err := units.RAMInBytes(str) 37 | if err != nil { 38 | return err 39 | } 40 | data[d.Field] = sec 41 | } 42 | 43 | return nil 44 | } 45 | 46 | func (d Bytes) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 47 | return ValidateField(d.Field, schema) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/changetype.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type ChangeType struct { 8 | Field string 9 | Type string 10 | } 11 | 12 | func (c ChangeType) FromInternal(data map[string]interface{}) { 13 | } 14 | 15 | func (c ChangeType) ToInternal(data map[string]interface{}) error { 16 | return nil 17 | } 18 | 19 | func (c ChangeType) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 20 | if err := ValidateField(c.Field, schema); err != nil { 21 | return err 22 | } 23 | 24 | f := schema.ResourceFields[c.Field] 25 | f.Type = c.Type 26 | schema.ResourceFields[c.Field] = f 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/check.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "fmt" 5 | 6 | types "github.com/rancher/mapper" 7 | ) 8 | 9 | func ValidateFields(schemas *types.Schema, fields ...string) error { 10 | for _, f := range fields { 11 | if err := ValidateField(f, schemas); err != nil { 12 | return err 13 | } 14 | } 15 | 16 | return nil 17 | } 18 | 19 | func ValidateField(field string, schema *types.Schema) error { 20 | if _, ok := schema.ResourceFields[field]; !ok { 21 | return fmt.Errorf("field %s missing on schema %s", field, schema.ID) 22 | } 23 | 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/colon_map.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "fmt" 5 | 6 | types "github.com/rancher/mapper" 7 | ) 8 | 9 | type MapToSlice struct { 10 | Field string 11 | Sep string 12 | } 13 | 14 | func (d MapToSlice) FromInternal(data map[string]interface{}) { 15 | } 16 | 17 | func (d MapToSlice) ToInternal(data map[string]interface{}) error { 18 | v, ok := data[d.Field] 19 | if !ok { 20 | return nil 21 | } 22 | 23 | if m, ok := v.(map[string]interface{}); ok { 24 | var result []interface{} 25 | for k, v := range m { 26 | result = append(result, fmt.Sprintf("%s%s%v", k, d.Sep, v)) 27 | } 28 | data[d.Field] = result 29 | } 30 | 31 | return nil 32 | } 33 | 34 | func (d MapToSlice) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 35 | return ValidateField(d.Field, schema) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/condition.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type Condition struct { 8 | Field string 9 | Value interface{} 10 | Mapper types.Mapper 11 | } 12 | 13 | func (m Condition) FromInternal(data map[string]interface{}) { 14 | if data[m.Field] == m.Value { 15 | m.Mapper.FromInternal(data) 16 | } 17 | } 18 | 19 | func (m Condition) ToInternal(data map[string]interface{}) error { 20 | if data[m.Field] == m.Value { 21 | return m.Mapper.ToInternal(data) 22 | } 23 | return nil 24 | } 25 | 26 | func (m Condition) ModifySchema(s *types.Schema, schemas *types.Schemas) error { 27 | return m.Mapper.ModifySchema(s, schemas) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/copy.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "fmt" 5 | 6 | types "github.com/rancher/mapper" 7 | ) 8 | 9 | type Copy struct { 10 | From, To string 11 | } 12 | 13 | func (c Copy) FromInternal(data map[string]interface{}) { 14 | if data == nil { 15 | return 16 | } 17 | v, ok := data[c.From] 18 | if ok { 19 | data[c.To] = v 20 | } 21 | } 22 | 23 | func (c Copy) ToInternal(data map[string]interface{}) error { 24 | if data == nil { 25 | return nil 26 | } 27 | t, tok := data[c.To] 28 | _, fok := data[c.From] 29 | if tok && !fok { 30 | data[c.From] = t 31 | } 32 | 33 | return nil 34 | } 35 | 36 | func (c Copy) ModifySchema(s *types.Schema, schemas *types.Schemas) error { 37 | f, ok := s.ResourceFields[c.From] 38 | if !ok { 39 | return fmt.Errorf("field %s missing on schema %s", c.From, s.ID) 40 | } 41 | 42 | s.ResourceFields[c.To] = f 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/default_mapper.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import "github.com/rancher/mapper" 4 | 5 | type DefaultMapper struct { 6 | Field string 7 | } 8 | 9 | func (d DefaultMapper) FromInternal(data map[string]interface{}) { 10 | } 11 | 12 | func (d DefaultMapper) ToInternal(data map[string]interface{}) error { 13 | return nil 14 | } 15 | 16 | func (d DefaultMapper) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error { 17 | if d.Field != "" { 18 | return ValidateField(d.Field, schema) 19 | } 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/default_missing.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type DefaultMissing struct { 8 | Field string 9 | Default interface{} 10 | } 11 | 12 | func (d DefaultMissing) FromInternal(data map[string]interface{}) { 13 | } 14 | 15 | func (d DefaultMissing) ToInternal(data map[string]interface{}) error { 16 | if _, ok := data[d.Field]; !ok && data != nil { 17 | data[d.Field] = d.Default 18 | } 19 | 20 | return nil 21 | } 22 | 23 | func (d DefaultMissing) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 24 | return ValidateField(d.Field, schema) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/display_name.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | var displayNameMappers = types.Mappers{ 8 | &Move{From: "name", To: "id"}, 9 | &Move{From: "displayName", To: "name"}, 10 | Access{Fields: map[string]string{ 11 | "id": "", 12 | "name": "cru", 13 | }}, 14 | } 15 | 16 | type DisplayName struct { 17 | } 18 | 19 | func (d DisplayName) FromInternal(data map[string]interface{}) { 20 | displayNameMappers.FromInternal(data) 21 | } 22 | 23 | func (d DisplayName) ToInternal(data map[string]interface{}) error { 24 | return displayNameMappers.ToInternal(data) 25 | } 26 | 27 | func (d DisplayName) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 28 | return displayNameMappers.ModifySchema(schema, schemas) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/drop.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "fmt" 5 | 6 | types "github.com/rancher/mapper" 7 | ) 8 | 9 | type Drop struct { 10 | Field string 11 | IgnoreDefinition bool 12 | } 13 | 14 | func (d Drop) FromInternal(data map[string]interface{}) { 15 | delete(data, d.Field) 16 | } 17 | 18 | func (d Drop) ToInternal(data map[string]interface{}) error { 19 | return nil 20 | } 21 | 22 | func (d Drop) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 23 | if _, ok := schema.ResourceFields[d.Field]; !ok { 24 | if !d.IgnoreDefinition { 25 | return fmt.Errorf("can not drop missing field %s on %s", d.Field, schema.ID) 26 | } 27 | } 28 | 29 | delete(schema.ResourceFields, d.Field) 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/enum.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type Enum struct { 8 | Field string 9 | Options []string 10 | } 11 | 12 | func (e Enum) FromInternal(data map[string]interface{}) { 13 | } 14 | 15 | func (e Enum) ToInternal(data map[string]interface{}) error { 16 | return nil 17 | } 18 | 19 | func (e Enum) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 20 | if err := ValidateField(e.Field, schema); err != nil { 21 | return err 22 | } 23 | 24 | f := schema.ResourceFields[e.Field] 25 | f.Type = "enum" 26 | f.Options = e.Options 27 | schema.ResourceFields[e.Field] = f 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/json_keys.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | "github.com/rancher/mapper/convert" 6 | ) 7 | 8 | type JSONKeys struct { 9 | } 10 | 11 | func (d JSONKeys) FromInternal(data map[string]interface{}) { 12 | } 13 | 14 | func (d JSONKeys) ToInternal(data map[string]interface{}) error { 15 | for key, value := range data { 16 | newKey := convert.ToJSONKey(key) 17 | if newKey != key { 18 | data[newKey] = value 19 | delete(data, key) 20 | } 21 | } 22 | return nil 23 | } 24 | 25 | func (d JSONKeys) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/label_field.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | "github.com/rancher/mapper/values" 6 | ) 7 | 8 | type LabelField struct { 9 | Field string 10 | } 11 | 12 | func (e LabelField) FromInternal(data map[string]interface{}) { 13 | v, ok := values.RemoveValue(data, "labels", "field.cattle.io/"+e.Field) 14 | if ok { 15 | data[e.Field] = v 16 | } 17 | } 18 | 19 | func (e LabelField) ToInternal(data map[string]interface{}) error { 20 | v, ok := data[e.Field] 21 | if ok { 22 | values.PutValue(data, v, "labels", "field.cattle.io/"+e.Field) 23 | } 24 | return nil 25 | } 26 | 27 | func (e LabelField) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 28 | return ValidateField(e.Field, schema) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/metadata.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | func NewMetadataMapper() types.Mapper { 8 | return types.Mappers{ 9 | ChangeType{Field: "name", Type: "dnsLabel"}, 10 | Drop{Field: "generateName"}, 11 | Move{From: "uid", To: "uuid", CodeName: "UUID"}, 12 | Drop{Field: "resourceVersion"}, 13 | Drop{Field: "generation"}, 14 | Move{From: "creationTimestamp", To: "created"}, 15 | Move{From: "deletionTimestamp", To: "removed"}, 16 | Drop{Field: "deletionGracePeriodSeconds"}, 17 | Drop{Field: "initializers"}, 18 | Drop{Field: "clusterName"}, 19 | ReadOnly{Field: "*"}, 20 | Access{ 21 | Fields: map[string]string{ 22 | "name": "c", 23 | "namespace": "c", 24 | "labels": "cu", 25 | "annotations": "cu", 26 | }, 27 | }, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/object.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type Object struct { 8 | types.Mappers 9 | } 10 | 11 | func NewObject(mappers ...types.Mapper) Object { 12 | return Object{ 13 | Mappers: append([]types.Mapper{ 14 | &Embed{Field: "metadata"}, 15 | &Embed{Field: "spec", Optional: true}, 16 | &ReadOnly{Field: "status", Optional: true, SubFields: true}, 17 | Drop{Field: "kind"}, 18 | Drop{Field: "apiVersion"}, 19 | Move{From: "selfLink", To: ".selfLink", DestDefined: true}, 20 | &Namespaced{ 21 | IfNot: true, 22 | Mappers: []types.Mapper{ 23 | &Drop{Field: "namespace"}, 24 | }, 25 | }, 26 | Drop{Field: "finalizers", IgnoreDefinition: true}, 27 | }, mappers...), 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/pendingstatus.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | "github.com/rancher/mapper/convert" 6 | "github.com/rancher/mapper/values" 7 | ) 8 | 9 | type PendingStatus struct { 10 | } 11 | 12 | func (s PendingStatus) FromInternal(data map[string]interface{}) { 13 | if data == nil { 14 | return 15 | } 16 | 17 | if data["state"] != "active" { 18 | return 19 | } 20 | 21 | conditions := convert.ToMapSlice(values.GetValueN(data, "status", "conditions")) 22 | if len(conditions) > 0 { 23 | return 24 | } 25 | 26 | data["state"] = "pending" 27 | } 28 | 29 | func (s PendingStatus) ToInternal(data map[string]interface{}) error { 30 | return nil 31 | } 32 | 33 | func (s PendingStatus) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/required.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type Required struct { 8 | Fields []string 9 | } 10 | 11 | func (e Required) FromInternal(data map[string]interface{}) { 12 | } 13 | 14 | func (e Required) ToInternal(data map[string]interface{}) error { 15 | return nil 16 | } 17 | 18 | func (e Required) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 19 | for _, field := range e.Fields { 20 | if err := ValidateField(field, schema); err != nil { 21 | return err 22 | } 23 | 24 | f := schema.ResourceFields[field] 25 | f.Required = true 26 | schema.ResourceFields[field] = f 27 | } 28 | 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/root.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type Root struct { 8 | enabled bool 9 | Mapper types.Mapper 10 | } 11 | 12 | func (m *Root) FromInternal(data map[string]interface{}) { 13 | if m.enabled { 14 | m.Mapper.FromInternal(data) 15 | } 16 | } 17 | 18 | func (m *Root) ToInternal(data map[string]interface{}) error { 19 | if m.enabled { 20 | return m.Mapper.ToInternal(data) 21 | } 22 | return nil 23 | } 24 | 25 | func (m *Root) ModifySchema(s *types.Schema, schemas *types.Schemas) error { 26 | if s.Object { 27 | m.enabled = true 28 | return m.Mapper.ModifySchema(s, schemas) 29 | } 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/scope.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type Namespaced struct { 8 | IfNot bool 9 | Mappers []types.Mapper 10 | run bool 11 | } 12 | 13 | func (s *Namespaced) FromInternal(data map[string]interface{}) { 14 | if s.run { 15 | types.Mappers(s.Mappers).FromInternal(data) 16 | } 17 | } 18 | 19 | func (s *Namespaced) ToInternal(data map[string]interface{}) error { 20 | if s.run { 21 | return types.Mappers(s.Mappers).ToInternal(data) 22 | } 23 | return nil 24 | } 25 | 26 | func (s *Namespaced) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 27 | if s.IfNot { 28 | if schema.NonNamespaced { 29 | s.run = true 30 | } 31 | } else { 32 | if !schema.NonNamespaced { 33 | s.run = true 34 | } 35 | } 36 | if s.run { 37 | return types.Mappers(s.Mappers).ModifySchema(schema, schemas) 38 | } 39 | 40 | return nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/setvalue.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | ) 6 | 7 | type SetValue struct { 8 | Field string 9 | InternalValue interface{} 10 | ExternalValue interface{} 11 | } 12 | 13 | func (d SetValue) FromInternal(data map[string]interface{}) { 14 | if d.ExternalValue != nil { 15 | data[d.Field] = d.ExternalValue 16 | } 17 | } 18 | 19 | func (d SetValue) ToInternal(data map[string]interface{}) error { 20 | if d.InternalValue != nil { 21 | data[d.Field] = d.InternalValue 22 | } 23 | return nil 24 | } 25 | 26 | func (d SetValue) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 27 | return ValidateField(d.Field, schema) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/shlex.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | "github.com/mattn/go-shellwords" 5 | types "github.com/rancher/mapper" 6 | "github.com/rancher/mapper/convert" 7 | ) 8 | 9 | type Shlex struct { 10 | Field string 11 | } 12 | 13 | func (d Shlex) FromInternal(data map[string]interface{}) { 14 | v, ok := data[d.Field] 15 | if !ok { 16 | return 17 | } 18 | 19 | parts := convert.ToStringSlice(v) 20 | if len(parts) == 1 { 21 | data[d.Field] = parts[0] 22 | } 23 | } 24 | 25 | func (d Shlex) ToInternal(data map[string]interface{}) error { 26 | v, ok := data[d.Field] 27 | if !ok { 28 | return nil 29 | } 30 | 31 | if str, ok := v.(string); ok { 32 | parts, err := shellwords.Parse(str) 33 | if err != nil { 34 | return err 35 | } 36 | data[d.Field] = parts 37 | } 38 | 39 | return nil 40 | } 41 | 42 | func (d Shlex) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 43 | return ValidateField(d.Field, schema) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/single_slice.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | "github.com/rancher/mapper/convert" 6 | ) 7 | 8 | type SingleSlice struct { 9 | Field string 10 | DontForceString bool 11 | } 12 | 13 | func (d SingleSlice) FromInternal(data map[string]interface{}) { 14 | if d.DontForceString { 15 | return 16 | } 17 | 18 | v, ok := data[d.Field] 19 | if !ok { 20 | return 21 | } 22 | 23 | ss := convert.ToInterfaceSlice(v) 24 | if len(ss) == 1 { 25 | if _, ok := ss[0].(string); ok { 26 | data[d.Field] = ss[0] 27 | } 28 | } 29 | } 30 | 31 | func (d SingleSlice) ToInternal(data map[string]interface{}) error { 32 | v, ok := data[d.Field] 33 | if !ok { 34 | return nil 35 | } 36 | 37 | if str, ok := v.(string); ok { 38 | data[d.Field] = []interface{}{str} 39 | } 40 | 41 | return nil 42 | } 43 | 44 | func (d SingleSlice) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 45 | return ValidateField(d.Field, schema) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/mapper/mappers/slice_merge.go: -------------------------------------------------------------------------------- 1 | package mappers 2 | 3 | import ( 4 | types "github.com/rancher/mapper" 5 | "github.com/rancher/mapper/convert" 6 | ) 7 | 8 | type SliceMerge struct { 9 | From []string 10 | To string 11 | IgnoreDefinition bool 12 | } 13 | 14 | func (s SliceMerge) FromInternal(data map[string]interface{}) { 15 | var result []interface{} 16 | for _, name := range s.From { 17 | val, ok := data[name] 18 | if !ok { 19 | continue 20 | } 21 | result = append(result, convert.ToInterfaceSlice(val)...) 22 | } 23 | 24 | if result != nil { 25 | data[s.To] = result 26 | } 27 | } 28 | 29 | func (s SliceMerge) ToInternal(data map[string]interface{}) error { 30 | return nil 31 | } 32 | 33 | func (s SliceMerge) ModifySchema(schema *types.Schema, schemas *types.Schemas) error { 34 | if s.IgnoreDefinition { 35 | return nil 36 | } 37 | 38 | for _, from := range s.From { 39 | if err := ValidateField(from, schema); err != nil { 40 | return err 41 | } 42 | if from != s.To { 43 | delete(schema.ResourceFields, from) 44 | } 45 | } 46 | 47 | return ValidateField(s.To, schema) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.swp 3 | *.8 4 | *.6 5 | _obj 6 | _test* 7 | markdown 8 | tags 9 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - "1.10.x" 5 | - "1.11.x" 6 | - tip 7 | matrix: 8 | fast_finish: true 9 | allow_failures: 10 | - go: tip 11 | install: 12 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 13 | script: 14 | - go get -t -v ./... 15 | - diff -u <(echo -n) <(gofmt -d -s .) 16 | - go tool vet . 17 | - go test -v ./... 18 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package blackfriday is a markdown processor. 2 | // 3 | // It translates plain text with simple formatting rules into an AST, which can 4 | // then be further processed to HTML (provided by Blackfriday itself) or other 5 | // formats (provided by the community). 6 | // 7 | // The simplest way to invoke Blackfriday is to call the Run function. It will 8 | // take a text input and produce a text output in HTML (or other format). 9 | // 10 | // A slightly more sophisticated way to use Blackfriday is to create a Markdown 11 | // processor and to call Parse, which returns a syntax tree for the input 12 | // document. You can leverage Blackfriday's parsing for content extraction from 13 | // markdown documents. You can assign a custom renderer and set various options 14 | // to the Markdown processor. 15 | // 16 | // If you're interested in calling Blackfriday from command line, see 17 | // https://github.com/russross/blackfriday-tool. 18 | package blackfriday 19 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/esc.go: -------------------------------------------------------------------------------- 1 | package blackfriday 2 | 3 | import ( 4 | "html" 5 | "io" 6 | ) 7 | 8 | var htmlEscaper = [256][]byte{ 9 | '&': []byte("&"), 10 | '<': []byte("<"), 11 | '>': []byte(">"), 12 | '"': []byte("""), 13 | } 14 | 15 | func escapeHTML(w io.Writer, s []byte) { 16 | var start, end int 17 | for end < len(s) { 18 | escSeq := htmlEscaper[s[end]] 19 | if escSeq != nil { 20 | w.Write(s[start:end]) 21 | w.Write(escSeq) 22 | start = end + 1 23 | } 24 | end++ 25 | } 26 | if start < len(s) && end <= len(s) { 27 | w.Write(s[start:end]) 28 | } 29 | } 30 | 31 | func escLink(w io.Writer, text []byte) { 32 | unesc := html.UnescapeString(string(text)) 33 | escapeHTML(w, []byte(unesc)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/russross/blackfriday/v2 2 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.x 5 | - master 6 | matrix: 7 | allow_failures: 8 | - go: master 9 | fast_finish: true 10 | install: 11 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 12 | script: 13 | - go get -t -v ./... 14 | - diff -u <(echo -n) <(gofmt -d -s .) 15 | - go tool vet . 16 | - go test -v -race ./... 17 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/README.md: -------------------------------------------------------------------------------- 1 | sanitized_anchor_name 2 | ===================== 3 | 4 | [![Build Status](https://travis-ci.org/shurcooL/sanitized_anchor_name.svg?branch=master)](https://travis-ci.org/shurcooL/sanitized_anchor_name) [![GoDoc](https://godoc.org/github.com/shurcooL/sanitized_anchor_name?status.svg)](https://godoc.org/github.com/shurcooL/sanitized_anchor_name) 5 | 6 | Package sanitized_anchor_name provides a func to create sanitized anchor names. 7 | 8 | Its logic can be reused by multiple packages to create interoperable anchor names 9 | and links to those anchors. 10 | 11 | At this time, it does not try to ensure that generated anchor names 12 | are unique, that responsibility falls on the caller. 13 | 14 | Installation 15 | ------------ 16 | 17 | ```bash 18 | go get -u github.com/shurcooL/sanitized_anchor_name 19 | ``` 20 | 21 | Example 22 | ------- 23 | 24 | ```Go 25 | anchorName := sanitized_anchor_name.Create("This is a header") 26 | 27 | fmt.Println(anchorName) 28 | 29 | // Output: 30 | // this-is-a-header 31 | ``` 32 | 33 | License 34 | ------- 35 | 36 | - [MIT License](LICENSE) 37 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/shurcooL/sanitized_anchor_name 2 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/main.go: -------------------------------------------------------------------------------- 1 | // Package sanitized_anchor_name provides a func to create sanitized anchor names. 2 | // 3 | // Its logic can be reused by multiple packages to create interoperable anchor names 4 | // and links to those anchors. 5 | // 6 | // At this time, it does not try to ensure that generated anchor names 7 | // are unique, that responsibility falls on the caller. 8 | package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" 9 | 10 | import "unicode" 11 | 12 | // Create returns a sanitized anchor name for the given text. 13 | func Create(text string) string { 14 | var anchorName []rune 15 | var futureDash = false 16 | for _, r := range text { 17 | switch { 18 | case unicode.IsLetter(r) || unicode.IsNumber(r): 19 | if futureDash && len(anchorName) > 0 { 20 | anchorName = append(anchorName, '-') 21 | } 22 | futureDash = false 23 | anchorName = append(anchorName, unicode.ToLower(r)) 24 | default: 25 | futureDash = true 26 | } 27 | } 28 | return string(anchorName) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | vendor 3 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/sirupsen/logrus 3 | git: 4 | depth: 1 5 | env: 6 | - GO111MODULE=on 7 | - GO111MODULE=off 8 | go: [ 1.11.x, 1.12.x ] 9 | os: [ linux, osx ] 10 | matrix: 11 | exclude: 12 | - go: 1.12.x 13 | env: GO111MODULE=off 14 | - go: 1.11.x 15 | os: osx 16 | install: 17 | - ./travis/install.sh 18 | - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi 19 | - if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi 20 | script: 21 | - ./travis/cross_build.sh 22 | - export GOMAXPROCS=4 23 | - export GORACE=halt_on_error=1 24 | - go test -race -v ./... 25 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi 26 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | platform: x64 3 | clone_folder: c:\gopath\src\github.com\sirupsen\logrus 4 | environment: 5 | GOPATH: c:\gopath 6 | branches: 7 | only: 8 | - master 9 | install: 10 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 11 | - go version 12 | build_script: 13 | - go get -t 14 | - go test 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/sirupsen/logrus 2 | 3 | require ( 4 | github.com/davecgh/go-spew v1.1.1 // indirect 5 | github.com/konsorten/go-windows-terminal-sequences v1.0.1 6 | github.com/pmezard/go-difflib v1.0.0 // indirect 7 | github.com/stretchr/objx v0.1.1 // indirect 8 | github.com/stretchr/testify v1.2.2 9 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd netbsd openbsd 2 | 3 | package logrus 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | const ioctlReadTermios = unix.TIOCGETA 8 | 9 | func isTerminal(fd int) bool { 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 11 | return err == nil 12 | } 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go: -------------------------------------------------------------------------------- 1 | // +build js nacl plan9 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,!windows,!nacl,!plan9 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func checkIfTerminal(w io.Writer) bool { 11 | switch v := w.(type) { 12 | case *os.File: 13 | return isTerminal(int(v.Fd())) 14 | default: 15 | return false 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_solaris.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | // IsTerminal returns true if the given file descriptor is a terminal. 8 | func isTerminal(fd int) bool { 9 | _, err := unix.IoctlGetTermio(fd, unix.TCGETA) 10 | return err == nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux aix 2 | 3 | package logrus 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | const ioctlReadTermios = unix.TCGETS 8 | 9 | func isTerminal(fd int) bool { 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 11 | return err == nil 12 | } 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | 10 | sequences "github.com/konsorten/go-windows-terminal-sequences" 11 | ) 12 | 13 | func initTerminal(w io.Writer) { 14 | switch v := w.(type) { 15 | case *os.File: 16 | sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) 17 | } 18 | } 19 | 20 | func checkIfTerminal(w io.Writer) bool { 21 | var ret bool 22 | switch v := w.(type) { 23 | case *os.File: 24 | var mode uint32 25 | err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) 26 | ret = (err == nil) 27 | default: 28 | ret = false 29 | } 30 | if ret { 31 | initTerminal(w) 32 | } 33 | return ret 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/.gitignore: -------------------------------------------------------------------------------- 1 | *.coverprofile 2 | node_modules/ 3 | vendor -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | dist: bionic 4 | osx_image: xcode10 5 | go: 6 | - 1.11.x 7 | - 1.12.x 8 | - 1.13.x 9 | 10 | os: 11 | - linux 12 | - osx 13 | 14 | env: 15 | GO111MODULE=on 16 | GOPROXY=https://proxy.golang.org 17 | 18 | cache: 19 | directories: 20 | - node_modules 21 | 22 | before_script: 23 | - go get github.com/urfave/gfmrun/cmd/gfmrun 24 | - go get golang.org/x/tools/cmd/goimports 25 | - npm install markdown-toc 26 | - go mod tidy 27 | 28 | script: 29 | - go run build.go vet 30 | - go run build.go test 31 | - go run build.go gfmrun docs/v1/manual.md 32 | - go run build.go toc docs/v1/manual.md 33 | 34 | after_success: 35 | - bash <(curl -s https://codecov.io/bash) 36 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jeremy Saenz & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2016 4 | 5 | image: Visual Studio 2017 6 | 7 | clone_folder: c:\gopath\src\github.com\urfave\cli 8 | 9 | cache: 10 | - node_modules 11 | 12 | environment: 13 | GOPATH: C:\gopath 14 | GOVERSION: 1.11.x 15 | GO111MODULE: on 16 | GOPROXY: https://proxy.golang.org 17 | 18 | install: 19 | - set PATH=%GOPATH%\bin;C:\go\bin;%PATH% 20 | - go version 21 | - go env 22 | - go get github.com/urfave/gfmrun/cmd/gfmrun 23 | - go mod vendor 24 | 25 | build_script: 26 | - go run build.go vet 27 | - go run build.go test 28 | - go run build.go gfmrun docs/v1/manual.md 29 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // return nil 16 | // } 17 | // 18 | // app.Run(os.Args) 19 | // } 20 | package cli 21 | 22 | //go:generate go run flag-gen/main.go flag-gen/assets_vfsdata.go 23 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/urfave/cli 2 | 3 | go 1.11 4 | 5 | require ( 6 | github.com/BurntSushi/toml v0.3.1 7 | github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d 8 | gopkg.in/yaml.v2 v2.2.2 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/sort.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import "unicode" 4 | 5 | // lexicographicLess compares strings alphabetically considering case. 6 | func lexicographicLess(i, j string) bool { 7 | iRunes := []rune(i) 8 | jRunes := []rune(j) 9 | 10 | lenShared := len(iRunes) 11 | if lenShared > len(jRunes) { 12 | lenShared = len(jRunes) 13 | } 14 | 15 | for index := 0; index < lenShared; index++ { 16 | ir := iRunes[index] 17 | jr := jRunes[index] 18 | 19 | if lir, ljr := unicode.ToLower(ir), unicode.ToLower(jr); lir != ljr { 20 | return lir < ljr 21 | } 22 | 23 | if ir != jr { 24 | return ir < jr 25 | } 26 | } 27 | 28 | return i < j 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_aix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TCGETS 12 | const ioctlWriteTermios = unix.TCSETS 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for arm64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le riscv64 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | } 36 | 37 | return (salen + salign - 1) & ^(salign - 1) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,go1.12,!go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 14 | // To implement this using libSystem we'd need syscall_syscallPtr for 15 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 16 | // back to raw syscalls for this func on Go 1.12. 17 | var p unsafe.Pointer 18 | if len(buf) > 0 { 19 | p = unsafe.Pointer(&buf[0]) 20 | } else { 21 | p = unsafe.Pointer(&_zero) 22 | } 23 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 24 | n = int(r0) 25 | if e1 != 0 { 26 | return n, errnoErr(e1) 27 | } 28 | return n, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,386,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,amd64,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,386,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,arm64,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go 386 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/empty.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.12 6 | 7 | // This file is here to allow bodyless functions with go:linkname for Go 1.11 8 | // and earlier (see https://golang.org/issue/23311). 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/freddierice/go-losetup.v1/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/freddierice/go-losetup.v1/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Freddie Rice 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/gopkg.in/freddierice/go-losetup.v1/README.md: -------------------------------------------------------------------------------- 1 | # go-losetup 2 | A losetup implementation for go-lang 3 | 4 | ## how to get it 5 | ``` 6 | go get gopkg.in/freddierice/go-losetup.v1 7 | ``` 8 | 9 | ## example usage 10 | ```go 11 | // attach a raw file to a loop device 12 | dev, err := losetup.Attach("rawfile.img", 0, false) 13 | if err != nil { 14 | // error checking 15 | } 16 | 17 | fmt.Printf("attached rawfile.img to %v\n", dev.Path()) 18 | 19 | err := dev.Detach() 20 | if err != nil { 21 | // error checking 22 | } 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/freddierice/go-losetup.v1/constants.go: -------------------------------------------------------------------------------- 1 | package losetup 2 | 3 | const ( 4 | // general constants 5 | NameSize = 64 6 | KeySize = 32 7 | Major = 7 8 | 9 | // paths 10 | LoopControlPath = "/dev/loop-control" 11 | 12 | // loop flags 13 | FlagsReadOnly = 1 14 | FlagsAutoClear = 4 15 | FlagsPartScan = 8 16 | FlagsDirectIO = 16 17 | 18 | // loop filter types 19 | CryptNone = 0 20 | CryptXor = 1 21 | CryptDes = 2 22 | CryptFish2 = 3 23 | CryptBlow = 4 24 | CryptCast128 = 5 25 | CryptIdea = 6 26 | CryptDummy = 9 27 | CryptSkipjack = 10 28 | CryptCryptoApi = 18 29 | MaxCrypt = 20 30 | 31 | // ioctl commands 32 | SetFd = 0x4C00 33 | ClrFd = 0x4C01 34 | SetStatus = 0x4C02 35 | GetStatus = 0x4C03 36 | SetStatus64 = 0x4C04 37 | GetStatus64 = 0x4C05 38 | ChangeFd = 0x4C06 39 | SetCapacity = 0x4C07 40 | SetDirectIO = 0x4C08 41 | 42 | CtlAdd = 0x4C80 43 | CtlRemove = 0x4C81 44 | CtlGetFree = 0x4C82 45 | ) 46 | -------------------------------------------------------------------------------- /vendor/gopkg.in/freddierice/go-losetup.v1/device.go: -------------------------------------------------------------------------------- 1 | package losetup 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | // Device represents a loop device /dev/loop# 9 | type Device struct { 10 | // device number (i.e. 7 if /dev/loop7) 11 | number uint64 12 | 13 | // flags with which to open the device with 14 | flags int 15 | } 16 | 17 | // open returns a file handle to /dev/loop# and returns an error if it cannot 18 | // be opened. 19 | func (device Device) open() (*os.File, error) { 20 | return os.OpenFile(device.Path(), device.flags, 0660) 21 | } 22 | 23 | // Path returns the path to the loopback device 24 | func (device Device) Path() string { 25 | return fmt.Sprintf(DeviceFormatString, device.number) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/gopkg.in/freddierice/go-losetup.v1/format.go: -------------------------------------------------------------------------------- 1 | package losetup 2 | 3 | import "fmt" 4 | 5 | // DeviceFormatString holds the format of loopback devices 6 | const DeviceFormatString = "/dev/loop%d" 7 | 8 | // String implements the Stringer interface for Device 9 | func (device Device) String() string { 10 | return device.Path() 11 | } 12 | 13 | // String implements the Stringer interface for Info 14 | func (info Info) String() string { 15 | return fmt.Sprintf("") 16 | } 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - 1.7 8 | - 1.8 9 | - 1.9 10 | - tip 11 | 12 | go_import_path: gopkg.in/yaml.v2 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /vendor/pault.ag/go/topsort/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Paul R. Tagliamonte , 2015 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/pault.ag/go/topsort/README.md: -------------------------------------------------------------------------------- 1 | topsort 2 | ======= 3 | 4 | This package provides a handy interface to do a topological sort of 5 | some data in a pretty lightweight way. 6 | 7 | Example 8 | ------- 9 | 10 | ```go 11 | package main 12 | 13 | import ( 14 | "fmt" 15 | 16 | "pault.ag/go/topsort" 17 | ) 18 | 19 | func main() { 20 | network := topsort.NewNetwork() 21 | 22 | network.AddNode("watch tv while eating", nil) 23 | network.AddNode("make dinner", nil) 24 | network.AddNode("clean my kitchen", nil) 25 | 26 | /* Right, so the order of operations is next */ 27 | 28 | network.AddEdge("clean my kitchen", "make dinner") 29 | // I need to clean the kitchen before I make dinner. 30 | 31 | network.AddEdge("make dinner", "watch tv while eating") 32 | // Need to make dinner before I can eat it. 33 | 34 | nodes, err := network.Sort() 35 | if err != nil { 36 | panic(err) 37 | } 38 | 39 | for _, step := range nodes { 40 | fmt.Printf(" -> %s\n", step.Name) 41 | } 42 | /* Output is: 43 | * 44 | * -> clean my kitchen 45 | * -> make dinner 46 | * -> watch tv while eating 47 | */ 48 | } 49 | ``` 50 | --------------------------------------------------------------------------------