├── .gitignore ├── vendor ├── github.com │ ├── buger │ │ └── goterm │ │ │ ├── .gitignore │ │ │ ├── terminal_nosysioctl.go │ │ │ ├── terminal_sysioctl.go │ │ │ ├── table.go │ │ │ ├── terminal_windows.go │ │ │ └── LICENSE │ ├── jinzhu │ │ └── copier │ │ │ ├── .gitignore │ │ │ ├── errors.go │ │ │ └── License │ ├── gorilla │ │ └── websocket │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── .editorconfig │ │ │ ├── tls_handshake.go │ │ │ ├── mask_safe.go │ │ │ ├── join.go │ │ │ ├── Makefile │ │ │ ├── LICENSE │ │ │ ├── mask.go │ │ │ ├── json.go │ │ │ └── README.md │ ├── luthermonson │ │ └── go-proxmox │ │ │ ├── .gitignore │ │ │ ├── build.go │ │ │ ├── .golangci.yaml │ │ │ ├── mage │ │ │ ├── install │ │ │ │ └── install.go │ │ │ └── test │ │ │ │ └── test.go │ │ │ ├── options.go │ │ │ ├── pools.go │ │ │ ├── cluster.go │ │ │ ├── magefile.go │ │ │ ├── cluster_firewall.go │ │ │ └── nodes_network.go │ ├── traefik │ │ └── genconf │ │ │ └── dynamic │ │ │ ├── plugins.go │ │ │ ├── types │ │ │ ├── domains.go │ │ │ └── tls.go │ │ │ ├── tls │ │ │ ├── certificate.go │ │ │ └── tls.go │ │ │ ├── marshaler.go │ │ │ ├── tcp_middlewares.go │ │ │ ├── config.go │ │ │ ├── udp_config.go │ │ │ └── tcp_config.go │ ├── diskfs │ │ └── go-diskfs │ │ │ ├── util │ │ │ ├── version.go │ │ │ └── file.go │ │ │ ├── filesystem │ │ │ ├── iso9660 │ │ │ │ ├── statt_windows.go │ │ │ │ ├── doc.go │ │ │ │ ├── statt_others.go │ │ │ │ ├── directory.go │ │ │ │ └── util.go │ │ │ ├── file.go │ │ │ └── filesystem.go │ │ │ ├── partition │ │ │ ├── part │ │ │ │ └── partition.go │ │ │ └── mbr │ │ │ │ ├── types.go │ │ │ │ └── doc.go │ │ │ └── LICENSE │ └── magefile │ │ └── mage │ │ ├── mg │ │ ├── color_string.go │ │ └── errors.go │ │ └── sh │ │ └── helpers.go ├── golang.org │ └── x │ │ ├── sys │ │ ├── unix │ │ │ ├── .gitignore │ │ │ ├── ptrace_ios.go │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ ├── endian_big.go │ │ │ ├── ptrace_darwin.go │ │ │ ├── constants.go │ │ │ ├── mmap_nomremap.go │ │ │ ├── endian_little.go │ │ │ ├── aliases.go │ │ │ ├── pagesize_unix.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── sysvshm_unix_other.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── syscall_linux_gc_arm.go │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── syscall_linux_alarm.go │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── syscall_linux_gc.go │ │ │ ├── syscall_hurd_386.go │ │ │ ├── sysvshm_linux.go │ │ │ ├── sockcmsg_dragonfly.go │ │ │ ├── race0.go │ │ │ ├── syscall_linux_gc_386.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── race.go │ │ │ ├── syscall_hurd.go │ │ │ ├── env_unix.go │ │ │ ├── readdirent_getdirentries.go │ │ │ ├── asm_bsd_arm.s │ │ │ ├── zptrace_linux_arm64.go │ │ │ ├── asm_openbsd_mips64.s │ │ │ ├── asm_bsd_386.s │ │ │ ├── asm_bsd_arm64.s │ │ │ ├── asm_bsd_riscv64.s │ │ │ ├── asm_bsd_amd64.s │ │ │ ├── asm_bsd_ppc64.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── dev_aix_ppc.go │ │ │ ├── dev_darwin.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── fdset.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── dev_zos.go │ │ │ ├── dev_aix_ppc64.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_arm64.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── dev_netbsd.go │ │ │ ├── dev_openbsd.go │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── syscall_linux_gccgo_386.go │ │ │ ├── dev_freebsd.go │ │ │ ├── syscall_openbsd_mips64.go │ │ │ ├── dev_dragonfly.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_openbsd_arm64.go │ │ │ ├── syscall_openbsd_ppc64.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ ├── syscall_openbsd_riscv64.go │ │ │ ├── fcntl.go │ │ │ ├── asm_linux_riscv64.s │ │ │ ├── syscall_openbsd_libc.go │ │ │ ├── asm_linux_arm64.s │ │ │ ├── syscall_darwin_libSystem.go │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── zptrace_armnn_linux.go │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_loong64.s │ │ │ ├── sockcmsg_unix_other.go │ │ │ ├── asm_linux_amd64.s │ │ │ ├── unveil_openbsd.go │ │ │ ├── syscall_aix_ppc.go │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ ├── mremap.go │ │ │ ├── zptrace_mipsnn_linux.go │ │ │ ├── syscall_freebsd_arm64.go │ │ │ ├── syscall_freebsd_riscv64.go │ │ │ ├── syscall_freebsd_arm.go │ │ │ ├── zptrace_mipsnnle_linux.go │ │ │ ├── syscall_darwin_arm64.go │ │ │ ├── sysvshm_unix.go │ │ │ ├── gccgo_c.c │ │ │ ├── asm_linux_386.s │ │ │ ├── dev_linux.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_freebsd_amd64.go │ │ │ ├── syscall_freebsd_386.go │ │ │ ├── syscall_illumos.go │ │ │ ├── gccgo.go │ │ │ └── zptrace_x86_linux.go │ │ ├── windows │ │ │ ├── empty.s │ │ │ ├── aliases.go │ │ │ ├── mksyscall.go │ │ │ ├── race0.go │ │ │ ├── str.go │ │ │ ├── race.go │ │ │ ├── eventlog.go │ │ │ ├── types_windows_amd64.go │ │ │ ├── types_windows_arm64.go │ │ │ ├── types_windows_386.go │ │ │ ├── types_windows_arm.go │ │ │ ├── mkknownfolderids.bash │ │ │ ├── memory_windows.go │ │ │ └── env_windows.go │ │ ├── PATENTS │ │ └── LICENSE │ │ └── net │ │ ├── proxy │ │ ├── direct.go │ │ ├── socks5.go │ │ └── dial.go │ │ ├── PATENTS │ │ └── LICENSE ├── gopkg.in │ └── djherbis │ │ └── times.v1 │ │ ├── js.cover.sh │ │ ├── js.cover.dockerfile │ │ ├── use_generic_stat.go │ │ ├── .travis.yml │ │ ├── .travis.sh │ │ ├── times_plan9.go │ │ ├── times_windows.go │ │ ├── times_aix.go │ │ ├── times_linux.go │ │ ├── times_openbsd.go │ │ ├── times_solaris.go │ │ ├── times_dragonfly.go │ │ ├── times_nacl.go │ │ ├── times_js.go │ │ ├── times_darwin.go │ │ ├── times_freebsd.go │ │ ├── times_netbsd.go │ │ ├── LICENSE │ │ └── times.go └── modules.txt ├── .assets └── icon.png ├── .envrc.example ├── Makefile ├── .traefik.yml ├── go.mod ├── .github └── workflows │ └── go-cross.yml ├── internal └── models.go └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | tmp 2 | proxmox-plugin 3 | .envrc 4 | .vscode -------------------------------------------------------------------------------- /vendor/github.com/buger/goterm/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .idea -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/copier/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | ttt/ 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.gitignore: -------------------------------------------------------------------------------- 1 | coverage.coverprofile 2 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | coverage.txt -------------------------------------------------------------------------------- /.assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaus/traefik-proxmox-plugin/HEAD/.assets/icon.png -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | skip-dirs: 3 | - examples/*.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/build.go: -------------------------------------------------------------------------------- 1 | //go:build test 2 | // +build test 3 | 4 | package proxmox 5 | 6 | func main() {} 7 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/plugins.go: -------------------------------------------------------------------------------- 1 | package dynamic 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | type PluginConf map[string]any 6 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/util/version.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | const ( 4 | // AppNameVersion name and URL to app 5 | AppNameVersion = "https://github.com/diskfs/go-diskfs" 6 | ) 7 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/statt_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package iso9660 4 | 5 | func statt(sys interface{}) (uint32, uint32, uint32) { 6 | return uint32(0), uint32(0), uint32(0) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/types/domains.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | type Domain struct { 6 | Main string `json:"main,omitempty"` 7 | SANs []string `json:"sans,omitempty"` 8 | } 9 | -------------------------------------------------------------------------------- /.envrc.example: -------------------------------------------------------------------------------- 1 | export API_ENDPOINT=https://192.168.168.101:8006 2 | export API_TOKEN_ID= 3 | export API_TOKEN= 4 | # valid values info/debug - default info 5 | export API_LOGGING=debug 6 | # valid values true/false - default true 7 | export API_VALIDATE_SSL=false 8 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/file.go: -------------------------------------------------------------------------------- 1 | package filesystem 2 | 3 | import "io" 4 | 5 | // File a reference to a single file on disk 6 | type File interface { 7 | io.ReadWriteSeeker 8 | io.Closer 9 | // io.ReaderAt 10 | // io.WriterAt 11 | } 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: lint test vendor clean 2 | 3 | export GO111MODULE=on 4 | 5 | default: lint test 6 | 7 | lint: 8 | golangci-lint run 9 | 10 | test: 11 | go test -v -cover ./... 12 | 13 | yaegi_test: 14 | yaegi test . 15 | 16 | vendor: 17 | go mod vendor 18 | 19 | clean: 20 | rm -rf ./vendor -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/js.cover.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | docker build -f js.cover.dockerfile -t js.cover.djherbis.times . 5 | docker create --name js.cover.djherbis.times js.cover.djherbis.times 6 | docker cp js.cover.djherbis.times:/go/src/github.com/djherbis/times/profile.cov . 7 | docker rm -v js.cover.djherbis.times -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/tls/certificate.go: -------------------------------------------------------------------------------- 1 | package tls 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | type Certificate struct { 6 | CertFile string `json:"certFile,omitempty"` 7 | KeyFile string `json:"keyFile,omitempty"` 8 | } 9 | 10 | type Certificates []Certificate 11 | 12 | type FileOrContent string 13 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/marshaler.go: -------------------------------------------------------------------------------- 1 | package dynamic 2 | 3 | import "encoding/json" 4 | 5 | type JSONPayload struct { 6 | *Configuration 7 | } 8 | 9 | func (c JSONPayload) MarshalJSON() ([]byte, error) { 10 | if c.Configuration == nil { 11 | return nil, nil 12 | } 13 | 14 | return json.Marshal(c.Configuration) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /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 | //go: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 | -------------------------------------------------------------------------------- /.traefik.yml: -------------------------------------------------------------------------------- 1 | displayName: Proxmox Provider Plugin 2 | type: provider 3 | iconPath: .assets/icon.png 4 | 5 | import: github.com/phaus/traefik-proxmox-plugin 6 | 7 | summary: 'Proxmox Provider Plugin' 8 | 9 | testData: 10 | pollInterval: 5s 11 | apiEndpoint: http://127.0.0.1:8006 12 | apiTokenId: 13 | apiToken: 14 | apiLogging: info 15 | apiValidateSSL: false 16 | -------------------------------------------------------------------------------- /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 | //go:build windows && go1.9 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/js.cover.dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.16 2 | 3 | RUN curl -sL https://deb.nodesource.com/setup_8.x | bash 4 | RUN apt-get install --yes nodejs 5 | 6 | WORKDIR /go/src/github.com/djherbis/times 7 | COPY . . 8 | 9 | RUN GO111MODULE=auto GOOS=js GOARCH=wasm go test -covermode=count -coverprofile=profile.cov -exec="$(go env GOROOT)/misc/wasm/go_js_wasm_exec" 10 | -------------------------------------------------------------------------------- /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 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /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 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/partition/part/partition.go: -------------------------------------------------------------------------------- 1 | package part 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/diskfs/go-diskfs/util" 7 | ) 8 | 9 | // Partition reference to an individual partition on disk 10 | type Partition interface { 11 | GetSize() int64 12 | GetStart() int64 13 | ReadContents(util.File, io.Writer) (int64, error) 14 | WriteContents(util.File, io.Reader) (uint64, error) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /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 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /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 | //go: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 setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/use_generic_stat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package times 4 | 5 | import "os" 6 | 7 | // Stat returns the Timespec for the given filename. 8 | func Stat(name string) (Timespec, error) { 9 | return stat(name, os.Stat) 10 | } 11 | 12 | // Lstat returns the Timespec for the given filename, and does not follow Symlinks. 13 | func Lstat(name string) (Timespec, error) { 14 | return stat(name, os.Lstat) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/buger/goterm/terminal_nosysioctl.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 || solaris 2 | // +build plan9 solaris 3 | 4 | package goterm 5 | 6 | func getWinsize() (*winsize, error) { 7 | ws := new(winsize) 8 | 9 | ws.Col = 80 10 | ws.Row = 24 11 | 12 | return ws, nil 13 | } 14 | 15 | // Height gets console height 16 | func Height() int { 17 | ws, err := getWinsize() 18 | if err != nil { 19 | return -1 20 | } 21 | return int(ws.Row) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/types/tls.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | type ClientTLS struct { 6 | CA string `json:"ca,omitempty"` 7 | CAOptional bool `json:"caOptional,omitempty"` 8 | Cert string `json:"cert,omitempty"` 9 | Key string `json:"key,omitempty"` 10 | InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.editorconfig: -------------------------------------------------------------------------------- 1 | ; https://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | insert_final_newline = true 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [{Makefile,go.mod,go.sum,*.go,.gitmodules}] 13 | indent_style = tab 14 | indent_size = 4 15 | 16 | [*.md] 17 | indent_size = 4 18 | trim_trailing_whitespace = false 19 | 20 | eclint_indent_style = unset 21 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/tls_handshake.go: -------------------------------------------------------------------------------- 1 | package websocket 2 | 3 | import ( 4 | "context" 5 | "crypto/tls" 6 | ) 7 | 8 | func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error { 9 | if err := tlsConn.HandshakeContext(ctx); err != nil { 10 | return err 11 | } 12 | if !cfg.InsecureSkipVerify { 13 | if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil { 14 | return err 15 | } 16 | } 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/util/file.go: -------------------------------------------------------------------------------- 1 | // Package util common utilities or other elements shared across github.com/diskfs/go-diskfs packages 2 | package util 3 | 4 | import "io" 5 | 6 | // File interface that can be read from and written to. 7 | // Normally implemented as actual os.File, but useful as a separate interface so can easily 8 | // use alternate implementations. 9 | type File interface { 10 | io.ReaderAt 11 | io.WriterAt 12 | io.Seeker 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask_safe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | //go:build appengine 6 | // +build appengine 7 | 8 | package websocket 9 | 10 | func maskBytes(key [4]byte, pos int, b []byte) int { 11 | for i := range b { 12 | b[i] ^= key[pos&3] 13 | pos++ 14 | } 15 | return pos & 3 16 | } 17 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/.golangci.yaml: -------------------------------------------------------------------------------- 1 | linters: 2 | disable-all: true 3 | enable: 4 | - govet 5 | - revive 6 | - goimports 7 | - misspell 8 | - ineffassign 9 | linters-settings: 10 | govet: 11 | check-shadowing: false 12 | gofmt: 13 | simplify: false 14 | run: 15 | skip-dirs: [] 16 | tests: false 17 | timeout: 10m 18 | issues: 19 | exclude-rules: 20 | - linters: 21 | - revive 22 | text: should have comment 23 | -------------------------------------------------------------------------------- /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 | //go: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/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 | //go: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/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /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 | //go:build gc 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/syscall_linux_gc_arm.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 | //go:build arm && gc && linux 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 | -------------------------------------------------------------------------------- /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 | //go:build gc 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/fcntl_linux_32bit.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 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 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/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/copier/errors.go: -------------------------------------------------------------------------------- 1 | package copier 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrInvalidCopyDestination = errors.New("copy destination must be non-nil and addressable") 7 | ErrInvalidCopyFrom = errors.New("copy from must be non-nil and addressable") 8 | ErrMapKeyNotMatch = errors.New("map's key type doesn't match") 9 | ErrNotSupported = errors.New("not supported") 10 | ErrFieldNameTagStartNotUpperCase = errors.New("copier field name tag must be start upper case") 11 | ) 12 | -------------------------------------------------------------------------------- /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 | //go: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/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 | //go:build linux && gc 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 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/phaus/traefik-proxmox-plugin 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/luthermonson/go-proxmox v0.0.0-beta5 7 | github.com/traefik/genconf v0.5.2 8 | ) 9 | 10 | require ( 11 | github.com/buger/goterm v1.0.4 // indirect 12 | github.com/diskfs/go-diskfs v1.4.0 // indirect 13 | github.com/gorilla/websocket v1.5.1 // indirect 14 | github.com/jinzhu/copier v0.4.0 // indirect 15 | github.com/magefile/mage v1.15.0 // indirect 16 | golang.org/x/net v0.22.0 // indirect 17 | golang.org/x/sys v0.18.0 // indirect 18 | gopkg.in/djherbis/times.v1 v1.3.0 // indirect 19 | ) 20 | -------------------------------------------------------------------------------- /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 | //go: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/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/doc.go: -------------------------------------------------------------------------------- 1 | // Package iso9660 provides utilities to interact with, manipulate and create an iso9660 filesystem on a block device or 2 | // a disk image. 3 | // 4 | // Reference documentation 5 | // 6 | // ISO9660 https://wiki.osdev.org/ISO_9660 7 | // ISO9660 / ECMA-119 http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf 8 | // System Use Sharing Protocol http://cdrtools.sourceforge.net/private/RRIP/susp.ps 9 | // Rock Ridge http://cdrtools.sourceforge.net/private/RRIP/rrip.ps 10 | // El Torito https://wiki.osdev.org/El-Torito 11 | package iso9660 12 | -------------------------------------------------------------------------------- /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 | //go: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/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /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/github.com/traefik/genconf/dynamic/tcp_middlewares.go: -------------------------------------------------------------------------------- 1 | package dynamic 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | type TCPIPAllowList struct { 6 | SourceRange []string `json:"sourceRange,omitempty"` 7 | } 8 | 9 | type TCPIPWhiteList struct { 10 | SourceRange []string `json:"sourceRange,omitempty"` 11 | } 12 | 13 | type TCPInFlightConn struct { 14 | Amount int64 `json:"amount,omitempty"` 15 | } 16 | 17 | type TCPMiddleware struct { 18 | InFlightConn *TCPInFlightConn `json:"inFlightConn,omitempty"` 19 | IPWhiteList *TCPIPWhiteList `json:"ipWhiteList,omitempty"` 20 | IPAllowList *TCPIPAllowList `json:"ipAllowList,omitempty"` 21 | } 22 | -------------------------------------------------------------------------------- /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 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 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/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 | //go:build linux && gc && 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/github.com/luthermonson/go-proxmox/mage/install/install.go: -------------------------------------------------------------------------------- 1 | package install 2 | 3 | import ( 4 | "fmt" 5 | "os/exec" 6 | 7 | "github.com/magefile/mage/mg" 8 | ) 9 | 10 | const ( 11 | GolangCILintVersion = "v1.50.1" 12 | ) 13 | 14 | // Dependencies install all dependencies 15 | func Dependencies() error { 16 | fmt.Println("Installing Dependencies...") 17 | mg.Deps(Golangcilint) 18 | 19 | return nil 20 | } 21 | 22 | // Golangcilint install golangci-lint 23 | func Golangcilint() error { 24 | fmt.Println("Installing GolangCI Lint...") 25 | cmd := exec.Command("go", "install", "github.com/golangci/golangci-lint/cmd/golangci-lint@"+GolangCILintVersion) 26 | return cmd.Run() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/config.go: -------------------------------------------------------------------------------- 1 | package dynamic 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/traefik/genconf/dynamic/tls" 7 | ) 8 | 9 | type Configuration struct { 10 | HTTP *HTTPConfiguration `json:"http,omitempty"` 11 | TCP *TCPConfiguration `json:"tcp,omitempty"` 12 | UDP *UDPConfiguration `json:"udp,omitempty"` 13 | TLS *TLSConfiguration `json:"tls,omitempty"` 14 | } 15 | 16 | type TLSConfiguration struct { 17 | Certificates []*tls.CertAndStores `json:"certificates,omitempty"` 18 | Options map[string]tls.Options `json:"options,omitempty"` 19 | Stores map[string]tls.Store `json:"stores,omitempty"` 20 | } 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | matrix: 3 | include: 4 | - os: linux 5 | go: tip 6 | - os: linux 7 | go: tip 8 | env: 9 | - JS=1 10 | - os: osx 11 | go: tip 12 | - os: windows 13 | go: 1.x 14 | #Added power jobs 15 | - os: linux 16 | go: tip 17 | arch: ppc64le 18 | - os: linux 19 | go: tip 20 | arch: ppc64le 21 | env: 22 | - JS=1 23 | script: bash .travis.sh script 24 | notifications: 25 | webhooks: https://coveralls.io/webhook 26 | email: 27 | on_success: never 28 | on_failure: change 29 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/statt_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | //nolint:unconvert // linter gets confused in this file 5 | package iso9660 6 | 7 | import ( 8 | "os" 9 | "syscall" 10 | ) 11 | 12 | func statt(fi os.FileInfo) (links, uid, gid uint32) { 13 | if sys := fi.Sys(); sys != nil { 14 | if stat, ok := sys.(*syscall.Stat_t); ok { 15 | links, uid, gid = uint32(stat.Nlink), stat.Uid, stat.Gid 16 | } 17 | } 18 | 19 | return links, uid, gid 20 | } 21 | 22 | //nolint:deadcode // this is here solely so that linter does not complain on darwin about unconvert 23 | func unused() uint32 { 24 | var f uint32 = 25 25 | return uint32(f) 26 | } 27 | -------------------------------------------------------------------------------- /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 | //go: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_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 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /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 | //go: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/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 | //go: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/gopkg.in/djherbis/times.v1/.travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | script() { 5 | if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; 6 | then 7 | COVERALLS_PARALLEL=true 8 | 9 | if [ ! -z "$JS" ]; 10 | then 11 | bash js.cover.sh 12 | else 13 | go test -covermode=count -coverprofile=profile.cov 14 | fi 15 | 16 | go get github.com/axw/gocov/gocov github.com/mattn/goveralls golang.org/x/tools/cmd/cover 17 | $HOME/gopath/bin/goveralls --coverprofile=profile.cov -service=travis-ci 18 | fi 19 | 20 | if [ -z "$JS" ]; 21 | then 22 | go get golang.org/x/lint/golint && golint ./... 23 | go vet 24 | go test -bench=.* -v ./... 25 | fi 26 | } 27 | 28 | "$@" -------------------------------------------------------------------------------- /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 | //go: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/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | 15 | func ioctl(fd int, req uint, arg uintptr) (err error) { 16 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 17 | if r0 == -1 && er != nil { 18 | err = er 19 | } 20 | return 21 | } 22 | 23 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 24 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 25 | if r0 == -1 && er != nil { 26 | err = er 27 | } 28 | return 29 | } 30 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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/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 | //go: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/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.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 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, 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/gopkg.in/djherbis/times.v1/times_plan9.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 | // http://golang.org/src/os/stat_plan9.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = false 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | noctime 26 | nobtime 27 | } 28 | 29 | func getTimespec(fi os.FileInfo) (t timespec) { 30 | stat := fi.Sys().(*syscall.Dir) 31 | t.atime.v = time.Unix(int64(stat.Atime), 0) 32 | t.mtime.v = time.Unix(int64(stat.Mtime), 0) 33 | return t 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 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/github.com/buger/goterm/terminal_sysioctl.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !plan9 && !solaris 2 | // +build !windows,!plan9,!solaris 3 | 4 | package goterm 5 | 6 | import ( 7 | "errors" 8 | "math" 9 | "os" 10 | 11 | "golang.org/x/sys/unix" 12 | ) 13 | 14 | func getWinsize() (*unix.Winsize, error) { 15 | 16 | ws, err := unix.IoctlGetWinsize(int(os.Stdout.Fd()), unix.TIOCGWINSZ) 17 | if err != nil { 18 | return nil, os.NewSyscallError("GetWinsize", err) 19 | } 20 | 21 | return ws, nil 22 | } 23 | 24 | // Height gets console height 25 | func Height() int { 26 | ws, err := getWinsize() 27 | if err != nil { 28 | // returns math.MinInt32 if we could not retrieve the height of console window, 29 | // like VSCode debugging console 30 | if errors.Is(err, unix.EOPNOTSUPP) { 31 | return math.MinInt32 32 | } 33 | return -1 34 | } 35 | return int(ws.Row) 36 | } 37 | -------------------------------------------------------------------------------- /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/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 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /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/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 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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/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 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /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 | //go: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/github.com/buger/goterm/table.go: -------------------------------------------------------------------------------- 1 | package goterm 2 | 3 | import ( 4 | "bytes" 5 | "text/tabwriter" 6 | ) 7 | 8 | // Tabwriter with own buffer: 9 | // 10 | // totals := tm.NewTable(0, 10, 5, ' ', 0) 11 | // fmt.Fprintf(totals, "Time\tStarted\tActive\tFinished\n") 12 | // fmt.Fprintf(totals, "%s\t%d\t%d\t%d\n", "All", started, started-finished, finished) 13 | // tm.Println(totals) 14 | // 15 | // Based on http://golang.org/pkg/text/tabwriter 16 | type Table struct { 17 | tabwriter.Writer 18 | 19 | Buf *bytes.Buffer 20 | } 21 | 22 | // Same as here http://golang.org/pkg/text/tabwriter/#Writer.Init 23 | func NewTable(minwidth, tabwidth, padding int, padchar byte, flags uint) *Table { 24 | tbl := new(Table) 25 | tbl.Buf = new(bytes.Buffer) 26 | tbl.Init(tbl.Buf, minwidth, tabwidth, padding, padchar, flags) 27 | 28 | return tbl 29 | } 30 | 31 | func (t *Table) String() string { 32 | t.Flush() 33 | return t.Buf.String() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // http://golang.org/src/os/stat_windows.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = false 19 | HasBirthTime = true 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | noctime 26 | btime 27 | } 28 | 29 | func getTimespec(fi os.FileInfo) Timespec { 30 | var t timespec 31 | stat := fi.Sys().(*syscall.Win32FileAttributeData) 32 | t.atime.v = time.Unix(0, stat.LastAccessTime.Nanoseconds()) 33 | t.mtime.v = time.Unix(0, stat.LastWriteTime.Nanoseconds()) 34 | t.btime.v = time.Unix(0, stat.CreationTime.Nanoseconds()) 35 | return t 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_aix.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 | // https://golang.org/src/os/stat_aix.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | nobtime 27 | } 28 | 29 | func timespecToTime(ts syscall.StTimespec_t) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atim) 36 | t.mtime.v = timespecToTime(stat.Mtim) 37 | t.ctime.v = timespecToTime(stat.Ctim) 38 | return t 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_linux.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 | // http://golang.org/src/os/stat_linux.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | nobtime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atim) 36 | t.mtime.v = timespecToTime(stat.Mtim) 37 | t.ctime.v = timespecToTime(stat.Ctim) 38 | return t 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_openbsd.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 | // http://golang.org/src/os/stat_openbsd.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | nobtime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atim) 36 | t.mtime.v = timespecToTime(stat.Mtim) 37 | t.ctime.v = timespecToTime(stat.Ctim) 38 | return t 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_solaris.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 | // http://golang.org/src/os/stat_solaris.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | nobtime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atim) 36 | t.mtime.v = timespecToTime(stat.Mtim) 37 | t.ctime.v = timespecToTime(stat.Ctim) 38 | return t 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.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 proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | ) 11 | 12 | type direct struct{} 13 | 14 | // Direct implements Dialer by making network connections directly using net.Dial or net.DialContext. 15 | var Direct = direct{} 16 | 17 | var ( 18 | _ Dialer = Direct 19 | _ ContextDialer = Direct 20 | ) 21 | 22 | // Dial directly invokes net.Dial with the supplied parameters. 23 | func (direct) Dial(network, addr string) (net.Conn, error) { 24 | return net.Dial(network, addr) 25 | } 26 | 27 | // DialContext instantiates a net.Dialer and invokes its DialContext receiver with the supplied parameters. 28 | func (direct) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { 29 | var d net.Dialer 30 | return d.DialContext(ctx, network, addr) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_dragonfly.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 | // http://golang.org/src/os/stat_dragonfly.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | nobtime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atim) 36 | t.mtime.v = timespecToTime(stat.Mtim) 37 | t.ctime.v = timespecToTime(stat.Ctim) 38 | return t 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/mage/test/test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/magefile/mage/sh" 7 | ) 8 | 9 | // Unit run all unit tests 10 | func Unit() error { 11 | fmt.Println("Running Tests...") 12 | return sh.RunV("go", "test") 13 | } 14 | 15 | // Build run a test build to confirm no compilation errors 16 | func Build() error { 17 | fmt.Println("Running Build...") 18 | return sh.RunV("go", "build", "-tags", "test") 19 | } 20 | 21 | // Coverage run all unit tests and output coverage 22 | func Coverage() error { 23 | fmt.Println("Running Tests with Coverage...") 24 | return sh.RunV("go", "test", "-race", "-coverprofile=coverage.txt", "-covermode=atomic") 25 | } 26 | 27 | // Integration run all integration tests against a pve node, see ./tests/integration 28 | func Integration() error { 29 | fmt.Println("Running Integration Tests against a PVE Cluster...") 30 | return sh.RunV("go", "test", "./tests/integration", "-tags", "nodes containers vms") 31 | } 32 | -------------------------------------------------------------------------------- /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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /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 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_nacl.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 | // https://golang.org/src/os/stat_nacljs.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = false 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | nobtime 27 | } 28 | 29 | func timespecToTime(sec, nsec int64) time.Time { 30 | return time.Unix(sec, nsec) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atime, stat.AtimeNsec) 36 | t.mtime.v = timespecToTime(stat.Mtime, stat.MtimeNsec) 37 | t.ctime.v = timespecToTime(stat.Ctime, stat.CtimeNsec) 38 | return t 39 | } 40 | -------------------------------------------------------------------------------- /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 | //go: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_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 | //go: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/github.com/buger/goterm/terminal_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package goterm 5 | 6 | import ( 7 | "errors" 8 | "math" 9 | "os" 10 | 11 | "golang.org/x/sys/windows" 12 | ) 13 | 14 | func getWinsize() (*winsize, error) { 15 | ws := new(winsize) 16 | fd := os.Stdout.Fd() 17 | var info windows.ConsoleScreenBufferInfo 18 | if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { 19 | return nil, err 20 | } 21 | 22 | ws.Col = uint16(info.Window.Right - info.Window.Left + 1) 23 | ws.Row = uint16(info.Window.Bottom - info.Window.Top + 1) 24 | 25 | return ws, nil 26 | } 27 | 28 | // Height gets console height 29 | func Height() int { 30 | ws, err := getWinsize() 31 | if err != nil { 32 | // returns math.MinInt32 if we could not retrieve the height of console window, 33 | // like VSCode debugging console 34 | if errors.Is(err, windows.WSAEOPNOTSUPP) { 35 | return math.MinInt32 36 | } 37 | return -1 38 | } 39 | return int(ws.Row) 40 | } 41 | -------------------------------------------------------------------------------- /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 | //go: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_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 | //go: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/gopkg.in/djherbis/times.v1/times_js.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 | // https://golang.org/src/os/stat_nacljs.go 6 | 7 | // +build js,wasm 8 | 9 | package times 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | "time" 15 | ) 16 | 17 | // HasChangeTime and HasBirthTime are true if and only if 18 | // the target OS supports them. 19 | const ( 20 | HasChangeTime = true 21 | HasBirthTime = false 22 | ) 23 | 24 | type timespec struct { 25 | atime 26 | mtime 27 | ctime 28 | nobtime 29 | } 30 | 31 | func timespecToTime(sec, nsec int64) time.Time { 32 | return time.Unix(sec, nsec) 33 | } 34 | 35 | func getTimespec(fi os.FileInfo) (t timespec) { 36 | stat := fi.Sys().(*syscall.Stat_t) 37 | t.atime.v = timespecToTime(stat.Atime, stat.AtimeNsec) 38 | t.mtime.v = timespecToTime(stat.Mtime, stat.MtimeNsec) 39 | t.ctime.v = timespecToTime(stat.Ctime, stat.CtimeNsec) 40 | return t 41 | } 42 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_darwin.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 | // http://golang.org/src/os/stat_darwin.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = true 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | btime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atimespec) 36 | t.mtime.v = timespecToTime(stat.Mtimespec) 37 | t.ctime.v = timespecToTime(stat.Ctimespec) 38 | t.btime.v = timespecToTime(stat.Birthtimespec) 39 | return t 40 | } 41 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_freebsd.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 | // http://golang.org/src/os/stat_freebsd.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = true 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | btime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atimespec) 36 | t.mtime.v = timespecToTime(stat.Mtimespec) 37 | t.ctime.v = timespecToTime(stat.Ctimespec) 38 | t.btime.v = timespecToTime(stat.Birthtimespec) 39 | return t 40 | } 41 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times_netbsd.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 | // http://golang.org/src/os/stat_netbsd.go 6 | 7 | package times 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | "time" 13 | ) 14 | 15 | // HasChangeTime and HasBirthTime are true if and only if 16 | // the target OS supports them. 17 | const ( 18 | HasChangeTime = true 19 | HasBirthTime = true 20 | ) 21 | 22 | type timespec struct { 23 | atime 24 | mtime 25 | ctime 26 | btime 27 | } 28 | 29 | func timespecToTime(ts syscall.Timespec) time.Time { 30 | return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 31 | } 32 | 33 | func getTimespec(fi os.FileInfo) (t timespec) { 34 | stat := fi.Sys().(*syscall.Stat_t) 35 | t.atime.v = timespecToTime(stat.Atimespec) 36 | t.mtime.v = timespecToTime(stat.Mtimespec) 37 | t.ctime.v = timespecToTime(stat.Ctimespec) 38 | t.btime.v = timespecToTime(stat.Birthtimespec) 39 | return t 40 | } 41 | -------------------------------------------------------------------------------- /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/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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/udp_config.go: -------------------------------------------------------------------------------- 1 | package dynamic 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | type UDPConfiguration struct { 6 | Routers map[string]*UDPRouter `json:"routers,omitempty"` 7 | Services map[string]*UDPService `json:"services,omitempty"` 8 | } 9 | 10 | type UDPRouter struct { 11 | EntryPoints []string `json:"entryPoints,omitempty"` 12 | Service string `json:"service,omitempty"` 13 | } 14 | 15 | type UDPServer struct { 16 | Address string `json:"address,omitempty"` 17 | } 18 | 19 | type UDPServersLoadBalancer struct { 20 | Servers []UDPServer `json:"servers,omitempty"` 21 | } 22 | 23 | type UDPService struct { 24 | LoadBalancer *UDPServersLoadBalancer `json:"loadBalancer,omitempty"` 25 | Weighted *UDPWeightedRoundRobin `json:"weighted,omitempty"` 26 | } 27 | 28 | type UDPWRRService struct { 29 | Name string `json:"name,omitempty"` 30 | Weight *int `json:"weight,omitempty"` 31 | } 32 | 33 | type UDPWeightedRoundRobin struct { 34 | Services []UDPWRRService `json:"services,omitempty"` 35 | } 36 | -------------------------------------------------------------------------------- /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/github.com/diskfs/go-diskfs/partition/mbr/types.go: -------------------------------------------------------------------------------- 1 | package mbr 2 | 3 | // Type constants for the GUID for type of partition, see https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries 4 | type Type byte 5 | 6 | // List of GUID partition types 7 | const ( 8 | Empty Type = 0x00 9 | Fat12 Type = 0x01 10 | XenixRoot Type = 0x02 11 | XenixUsr Type = 0x03 12 | Fat16 Type = 0x04 13 | ExtendedCHS Type = 0x05 14 | Fat16b Type = 0x06 15 | NTFS Type = 0x07 16 | CommodoreFAT Type = 0x08 17 | Fat32CHS Type = 0x0b 18 | Fat32LBA Type = 0x0c 19 | Fat16bLBA Type = 0x0e 20 | ExtendedLBA Type = 0x0f 21 | LinuxSwap Type = 0x82 22 | Linux Type = 0x83 23 | LinuxExtended Type = 0x85 24 | LinuxLVM Type = 0x8e 25 | Iso9660 Type = 0x96 26 | MacOSXUFS Type = 0xa8 27 | MacOSXBoot Type = 0xab 28 | HFS Type = 0xaf 29 | Solaris8Boot Type = 0xbe 30 | GPTProtective Type = 0xee 31 | EFISystem Type = 0xef 32 | VMWareFS Type = 0xfb 33 | VMWareSwap Type = 0xfc 34 | ) 35 | -------------------------------------------------------------------------------- /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 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/join.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Gorilla WebSocket Authors. All rights reserved. 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 websocket 6 | 7 | import ( 8 | "io" 9 | "strings" 10 | ) 11 | 12 | // JoinMessages concatenates received messages to create a single io.Reader. 13 | // The string term is appended to each message. The returned reader does not 14 | // support concurrent calls to the Read method. 15 | func JoinMessages(c *Conn, term string) io.Reader { 16 | return &joinReader{c: c, term: term} 17 | } 18 | 19 | type joinReader struct { 20 | c *Conn 21 | term string 22 | r io.Reader 23 | } 24 | 25 | func (r *joinReader) Read(p []byte) (int, error) { 26 | if r.r == nil { 27 | var err error 28 | _, r.r, err = r.c.NextReader() 29 | if err != nil { 30 | return 0, err 31 | } 32 | if r.term != "" { 33 | r.r = io.MultiReader(r.r, strings.NewReader(r.term)) 34 | } 35 | } 36 | n, err := r.r.Read(p) 37 | if err == io.EOF { 38 | err = nil 39 | r.r = nil 40 | } 41 | return n, err 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/partition/mbr/doc.go: -------------------------------------------------------------------------------- 1 | // Package mbr provides an interface to Master Boot Record (MBR) partitioned disks. 2 | // 3 | // You can use this package to manipulate existing MBR disks, read existing disks, or create entirely 4 | // new partition tables on disks or disk files. 5 | // 6 | // mbr.Table implements the Table interface in github.com/diskfs/go-diskfs/partition 7 | // 8 | // Normally, the best way to interact with a disk is to use the github.com/diskfs/go-diskfs package, 9 | // which, when necessary, will call this one. When creating a new disk or manipulating an existing one, 10 | // You will, however, need to interact with an mbr.Table and mbr.Partition structs. 11 | // 12 | // Here is a simple example of an MBR Table with a single 10MB Linux partition: 13 | // 14 | // table := &mbr.Table{ 15 | // LogicalSectorSize: 512, 16 | // PhysicalSectorSize: 512, 17 | // Partitions: []*mbr.Partition{ 18 | // { 19 | // Bootable: false, 20 | // Type: Linux, 21 | // Start: 2048, 22 | // Size: 20480, 23 | // }, 24 | // }, 25 | // } 26 | package mbr 27 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/Makefile: -------------------------------------------------------------------------------- 1 | GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '') 2 | GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest 3 | 4 | GO_SEC=$(shell which gosec 2> /dev/null || echo '') 5 | GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest 6 | 7 | GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '') 8 | GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest 9 | 10 | .PHONY: golangci-lint 11 | golangci-lint: 12 | $(if $(GO_LINT), ,go install $(GO_LINT_URI)) 13 | @echo "##### Running golangci-lint" 14 | golangci-lint run -v 15 | 16 | .PHONY: gosec 17 | gosec: 18 | $(if $(GO_SEC), ,go install $(GO_SEC_URI)) 19 | @echo "##### Running gosec" 20 | gosec -exclude-dir examples ./... 21 | 22 | .PHONY: govulncheck 23 | govulncheck: 24 | $(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI)) 25 | @echo "##### Running govulncheck" 26 | govulncheck ./... 27 | 28 | .PHONY: verify 29 | verify: golangci-lint gosec govulncheck 30 | 31 | .PHONY: test 32 | test: 33 | @echo "##### Running tests" 34 | go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./... 35 | -------------------------------------------------------------------------------- /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 | //go: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/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/syscall_openbsd_mips64.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 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/copier/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/buger/goterm/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Leonid Bugaev 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/diskfs/go-diskfs/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Avi Deitcher 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/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/gopkg.in/djherbis/times.v1/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dustin H 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_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 | //go:build arm64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.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 | //go:build ppc64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.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 | //go:build riscv64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/mg/color_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Color"; DO NOT EDIT. 2 | 3 | package mg 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[Black-0] 12 | _ = x[Red-1] 13 | _ = x[Green-2] 14 | _ = x[Yellow-3] 15 | _ = x[Blue-4] 16 | _ = x[Magenta-5] 17 | _ = x[Cyan-6] 18 | _ = x[White-7] 19 | _ = x[BrightBlack-8] 20 | _ = x[BrightRed-9] 21 | _ = x[BrightGreen-10] 22 | _ = x[BrightYellow-11] 23 | _ = x[BrightBlue-12] 24 | _ = x[BrightMagenta-13] 25 | _ = x[BrightCyan-14] 26 | _ = x[BrightWhite-15] 27 | } 28 | 29 | const _Color_name = "BlackRedGreenYellowBlueMagentaCyanWhiteBrightBlackBrightRedBrightGreenBrightYellowBrightBlueBrightMagentaBrightCyanBrightWhite" 30 | 31 | var _Color_index = [...]uint8{0, 5, 8, 13, 19, 23, 30, 34, 39, 50, 59, 70, 82, 92, 105, 115, 126} 32 | 33 | func (i Color) String() string { 34 | if i < 0 || i >= Color(len(_Color_index)-1) { 35 | return "Color(" + strconv.FormatInt(int64(i), 10) + ")" 36 | } 37 | return _Color_name[_Color_index[i]:_Color_index[i+1]] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/sh/helpers.go: -------------------------------------------------------------------------------- 1 | package sh 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | ) 8 | 9 | // Rm removes the given file or directory even if non-empty. It will not return 10 | // an error if the target doesn't exist, only if the target cannot be removed. 11 | func Rm(path string) error { 12 | err := os.RemoveAll(path) 13 | if err == nil || os.IsNotExist(err) { 14 | return nil 15 | } 16 | return fmt.Errorf(`failed to remove %s: %v`, path, err) 17 | } 18 | 19 | // Copy robustly copies the source file to the destination, overwriting the destination if necessary. 20 | func Copy(dst string, src string) error { 21 | from, err := os.Open(src) 22 | if err != nil { 23 | return fmt.Errorf(`can't copy %s: %v`, src, err) 24 | } 25 | defer from.Close() 26 | finfo, err := from.Stat() 27 | if err != nil { 28 | return fmt.Errorf(`can't stat %s: %v`, src, err) 29 | } 30 | to, err := os.OpenFile(dst, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, finfo.Mode()) 31 | if err != nil { 32 | return fmt.Errorf(`can't copy to %s: %v`, dst, err) 33 | } 34 | defer to.Close() 35 | _, err = io.Copy(to, from) 36 | if err != nil { 37 | return fmt.Errorf(`error copying %s to %s: %v`, src, dst, err) 38 | } 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /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 | //go:build dragonfly || freebsd || linux || netbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build openbsd 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 17 | 18 | //go:linkname syscall_syscall syscall.syscall 19 | //go:linkname syscall_syscall6 syscall.syscall6 20 | //go:linkname syscall_syscall10 syscall.syscall10 21 | //go:linkname syscall_rawSyscall syscall.rawSyscall 22 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 23 | 24 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 25 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/mg/errors.go: -------------------------------------------------------------------------------- 1 | package mg 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | type fatalErr struct { 9 | code int 10 | error 11 | } 12 | 13 | func (f fatalErr) ExitStatus() int { 14 | return f.code 15 | } 16 | 17 | type exitStatus interface { 18 | ExitStatus() int 19 | } 20 | 21 | // Fatal returns an error that will cause mage to print out the 22 | // given args and exit with the given exit code. 23 | func Fatal(code int, args ...interface{}) error { 24 | return fatalErr{ 25 | code: code, 26 | error: errors.New(fmt.Sprint(args...)), 27 | } 28 | } 29 | 30 | // Fatalf returns an error that will cause mage to print out the 31 | // given message and exit with the given exit code. 32 | func Fatalf(code int, format string, args ...interface{}) error { 33 | return fatalErr{ 34 | code: code, 35 | error: fmt.Errorf(format, args...), 36 | } 37 | } 38 | 39 | // ExitStatus queries the error for an exit status. If the error is nil, it 40 | // returns 0. If the error does not implement ExitStatus() int, it returns 1. 41 | // Otherwise it retiurns the value from ExitStatus(). 42 | func ExitStatus(err error) int { 43 | if err == nil { 44 | return 0 45 | } 46 | exit, ok := err.(exitStatus) 47 | if !ok { 48 | return 1 49 | } 50 | return exit.ExitStatus() 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // Just jump to package syscall's implementation for all these functions. 10 | // The runtime may know about them. 11 | 12 | TEXT ·Syscall(SB),NOSPLIT,$0-56 13 | B syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 16 | B syscall·Syscall6(SB) 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R0 21 | MOVD a2+16(FP), R1 22 | MOVD a3+24(FP), R2 23 | MOVD $0, R3 24 | MOVD $0, R4 25 | MOVD $0, R5 26 | MOVD trap+0(FP), R8 // syscall entry 27 | SVC 28 | MOVD R0, r1+32(FP) // r1 29 | MOVD R1, r2+40(FP) // r2 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | B syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | B syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOVD a1+8(FP), R0 41 | MOVD a2+16(FP), R1 42 | MOVD a3+24(FP), R2 43 | MOVD $0, R3 44 | MOVD $0, R4 45 | MOVD $0, R5 46 | MOVD trap+0(FP), R8 // syscall entry 47 | SVC 48 | MOVD R0, r1+32(FP) 49 | MOVD R1, r2+40(FP) 50 | RET 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_darwin.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 19 | 20 | //go:linkname syscall_syscall syscall.syscall 21 | //go:linkname syscall_syscall6 syscall.syscall6 22 | //go:linkname syscall_syscall6X syscall.syscall6X 23 | //go:linkname syscall_syscall9 syscall.syscall9 24 | //go:linkname syscall_rawSyscall syscall.rawSyscall 25 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 26 | //go:linkname syscall_syscallPtr syscall.syscallPtr 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/socks5.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 proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | 11 | "golang.org/x/net/internal/socks" 12 | ) 13 | 14 | // SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given 15 | // address with an optional username and password. 16 | // See RFC 1928 and RFC 1929. 17 | func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error) { 18 | d := socks.NewDialer(network, address) 19 | if forward != nil { 20 | if f, ok := forward.(ContextDialer); ok { 21 | d.ProxyDial = func(ctx context.Context, network string, address string) (net.Conn, error) { 22 | return f.DialContext(ctx, network, address) 23 | } 24 | } else { 25 | d.ProxyDial = func(ctx context.Context, network string, address string) (net.Conn, error) { 26 | return dialContext(ctx, forward, network, address) 27 | } 28 | } 29 | } 30 | if auth != nil { 31 | up := socks.UsernamePassword{ 32 | Username: auth.User, 33 | Password: auth.Password, 34 | } 35 | d.AuthMethods = []socks.AuthMethod{ 36 | socks.AuthMethodNotRequired, 37 | socks.AuthMethodUsernamePassword, 38 | } 39 | d.Authenticate = up.Authenticate 40 | } 41 | return d, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && s390x && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for s390x, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | BR syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | BR syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | BL runtime·entersyscall(SB) 24 | MOVD a1+8(FP), R2 25 | MOVD a2+16(FP), R3 26 | MOVD a3+24(FP), R4 27 | MOVD $0, R5 28 | MOVD $0, R6 29 | MOVD $0, R7 30 | MOVD trap+0(FP), R1 // syscall entry 31 | SYSCALL 32 | MOVD R2, r1+32(FP) 33 | MOVD R3, r2+40(FP) 34 | BL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | BR syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | BR syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVD a1+8(FP), R2 45 | MOVD a2+16(FP), R3 46 | MOVD a3+24(FP), R4 47 | MOVD $0, R5 48 | MOVD $0, R6 49 | MOVD $0, R7 50 | MOVD trap+0(FP), R1 // syscall entry 51 | SYSCALL 52 | MOVD R2, r1+32(FP) 53 | MOVD R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/filesystem.go: -------------------------------------------------------------------------------- 1 | // Package filesystem provides interfaces and constants required for filesystem implementations. 2 | // All interesting implementations are in subpackages, e.g. github.com/diskfs/go-diskfs/filesystem/fat32 3 | package filesystem 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // FileSystem is a reference to a single filesystem on a disk 10 | type FileSystem interface { 11 | // Type return the type of filesystem 12 | Type() Type 13 | // Mkdir make a directory 14 | Mkdir(string) error 15 | // ReadDir read the contents of a directory 16 | ReadDir(string) ([]os.FileInfo, error) 17 | // OpenFile open a handle to read or write to a file 18 | OpenFile(string, int) (File, error) 19 | // Label get the label for the filesystem, or "" if none. Be careful to trim it, as it may contain 20 | // leading or following whitespace. The label is passed as-is and not cleaned up at all. 21 | Label() string 22 | // SetLabel changes the label on the writable filesystem. Different file system may hav different 23 | // length constraints. 24 | SetLabel(string) error 25 | } 26 | 27 | // Type represents the type of disk this is 28 | type Type int 29 | 30 | const ( 31 | // TypeFat32 is a FAT32 compatible filesystem 32 | TypeFat32 Type = iota 33 | // TypeISO9660 is an iso filesystem 34 | TypeISO9660 35 | // TypeSquashfs is a squashfs filesystem 36 | TypeSquashfs 37 | ) 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsArm is the registers used by arm binaries. 10 | type PtraceRegsArm struct { 11 | Uregs [18]uint32 12 | } 13 | 14 | // PtraceGetRegsArm fetches the registers used by arm binaries. 15 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 16 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 17 | } 18 | 19 | // PtraceSetRegsArm sets the registers used by arm binaries. 20 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 21 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 22 | } 23 | 24 | // PtraceRegsArm64 is the registers used by arm64 binaries. 25 | type PtraceRegsArm64 struct { 26 | Regs [31]uint64 27 | Sp uint64 28 | Pc uint64 29 | Pstate uint64 30 | } 31 | 32 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 33 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 34 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 35 | } 36 | 37 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 38 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 39 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips || mipsle) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | 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 ·SyscallNoError(SB),NOSPLIT,$0-24 26 | JAL runtime·entersyscall(SB) 27 | MOVW a1+4(FP), R4 28 | MOVW a2+8(FP), R5 29 | MOVW a3+12(FP), R6 30 | MOVW R0, R7 31 | MOVW trap+0(FP), R2 // syscall entry 32 | SYSCALL 33 | MOVW R2, r1+16(FP) // r1 34 | MOVW R3, r2+20(FP) // r2 35 | JAL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW a1+4(FP), R4 46 | MOVW a2+8(FP), R5 47 | MOVW a3+12(FP), R6 48 | MOVW trap+0(FP), R2 // syscall entry 49 | SYSCALL 50 | MOVW R2, r1+16(FP) 51 | MOVW R3, r2+20(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R2 // syscall entry 31 | SYSCALL 32 | MOVV R2, r1+32(FP) 33 | MOVV R3, r2+40(FP) 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVV R2, r1+32(FP) 53 | MOVV R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/tls/tls.go: -------------------------------------------------------------------------------- 1 | package tls 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/traefik/genconf/dynamic/types" 7 | ) 8 | 9 | type CertAndStores struct { 10 | Certificate 11 | Stores []string `json:"stores,omitempty"` 12 | } 13 | 14 | type ClientAuth struct { 15 | CAFiles []string `json:"caFiles,omitempty"` 16 | ClientAuthType string `json:"clientAuthType,omitempty"` 17 | } 18 | 19 | type GeneratedCert struct { 20 | Resolver string `json:"resolver,omitempty"` 21 | Domain *types.Domain `json:"domain,omitempty"` 22 | } 23 | 24 | type Options struct { 25 | MinVersion string `json:"minVersion,omitempty"` 26 | MaxVersion string `json:"maxVersion,omitempty"` 27 | CipherSuites []string `json:"cipherSuites,omitempty"` 28 | CurvePreferences []string `json:"curvePreferences,omitempty"` 29 | ClientAuth ClientAuth `json:"clientAuth,omitempty"` 30 | SniStrict bool `json:"sniStrict,omitempty"` 31 | PreferServerCipherSuites bool `json:"preferServerCipherSuites,omitempty"` 32 | ALPNProtocols []string `json:"alpnProtocols,omitempty"` 33 | } 34 | 35 | type Store struct { 36 | DefaultCertificate *Certificate `json:"defaultCertificate,omitempty"` 37 | DefaultGeneratedCert *GeneratedCert `json:"defaultGeneratedCert,omitempty"` 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | 10 | // Just jump to package syscall's implementation for all these functions. 11 | // The runtime may know about them. 12 | 13 | TEXT ·Syscall(SB),NOSPLIT,$0-56 14 | JMP syscall·Syscall(SB) 15 | 16 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 17 | JMP syscall·Syscall6(SB) 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | JAL runtime·entersyscall(SB) 21 | MOVV a1+8(FP), R4 22 | MOVV a2+16(FP), R5 23 | MOVV a3+24(FP), R6 24 | MOVV R0, R7 25 | MOVV R0, R8 26 | MOVV R0, R9 27 | MOVV trap+0(FP), R11 // syscall entry 28 | SYSCALL 29 | MOVV R4, r1+32(FP) 30 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 31 | JAL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 35 | JMP syscall·RawSyscall(SB) 36 | 37 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 38 | JMP syscall·RawSyscall6(SB) 39 | 40 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 41 | MOVV a1+8(FP), R4 42 | MOVV a2+16(FP), R5 43 | MOVV a3+24(FP), R6 44 | MOVV R0, R7 45 | MOVV R0, R8 46 | MOVV R0, R9 47 | MOVV trap+0(FP), R11 // syscall entry 48 | SYSCALL 49 | MOVV R4, r1+32(FP) 50 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 51 | RET 52 | -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/buger/goterm v1.0.4 2 | ## explicit; go 1.15 3 | github.com/buger/goterm 4 | # github.com/diskfs/go-diskfs v1.4.0 5 | ## explicit; go 1.19 6 | github.com/diskfs/go-diskfs/filesystem 7 | github.com/diskfs/go-diskfs/filesystem/iso9660 8 | github.com/diskfs/go-diskfs/partition/mbr 9 | github.com/diskfs/go-diskfs/partition/part 10 | github.com/diskfs/go-diskfs/util 11 | # github.com/gorilla/websocket v1.5.1 12 | ## explicit; go 1.20 13 | github.com/gorilla/websocket 14 | # github.com/jinzhu/copier v0.4.0 15 | ## explicit; go 1.13 16 | github.com/jinzhu/copier 17 | # github.com/luthermonson/go-proxmox v0.0.0-beta5 18 | ## explicit; go 1.20 19 | github.com/luthermonson/go-proxmox 20 | github.com/luthermonson/go-proxmox/mage/install 21 | github.com/luthermonson/go-proxmox/mage/test 22 | # github.com/magefile/mage v1.15.0 23 | ## explicit; go 1.12 24 | github.com/magefile/mage/mg 25 | github.com/magefile/mage/sh 26 | # github.com/traefik/genconf v0.5.2 27 | ## explicit; go 1.19 28 | github.com/traefik/genconf/dynamic 29 | github.com/traefik/genconf/dynamic/tls 30 | github.com/traefik/genconf/dynamic/types 31 | # golang.org/x/net v0.22.0 32 | ## explicit; go 1.18 33 | golang.org/x/net/internal/socks 34 | golang.org/x/net/proxy 35 | # golang.org/x/sys v0.18.0 36 | ## explicit; go 1.18 37 | golang.org/x/sys/unix 38 | golang.org/x/sys/windows 39 | # gopkg.in/djherbis/times.v1 v1.3.0 40 | ## explicit 41 | gopkg.in/djherbis/times.v1 42 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/options.go: -------------------------------------------------------------------------------- 1 | package proxmox 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type Option func(*Client) 9 | 10 | // Deprecated: Use WithHTTPClient 11 | func WithClient(client *http.Client) Option { 12 | return WithHTTPClient(client) 13 | } 14 | 15 | func WithHTTPClient(client *http.Client) Option { 16 | return func(c *Client) { 17 | c.httpClient = client 18 | } 19 | } 20 | 21 | // Deprecated: Use WithCredential 22 | func WithLogins(username, password string) Option { 23 | return WithCredentials(&Credentials{ 24 | Username: username, 25 | Password: password, 26 | }) 27 | } 28 | 29 | func WithCredentials(credentials *Credentials) Option { 30 | return func(c *Client) { 31 | c.credentials = credentials 32 | } 33 | } 34 | 35 | func WithAPIToken(tokenID, secret string) Option { 36 | return func(c *Client) { 37 | c.token = fmt.Sprintf("%s=%s", tokenID, secret) 38 | } 39 | } 40 | 41 | // WithSession experimental 42 | func WithSession(ticket, CSRFPreventionToken string) Option { 43 | return func(c *Client) { 44 | c.session = &Session{ 45 | Ticket: ticket, 46 | CSRFPreventionToken: CSRFPreventionToken, 47 | } 48 | } 49 | } 50 | 51 | func WithUserAgent(ua string) Option { 52 | return func(c *Client) { 53 | c.userAgent = ua 54 | } 55 | } 56 | 57 | func WithLogger(logger LeveledLoggerInterface) Option { 58 | return func(c *Client) { 59 | c.log = logger 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos 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", "ios", "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 | // NetBSD aarch64 requires 128-bit alignment. 36 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 37 | salign = 16 38 | } 39 | case "zos": 40 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 41 | // not pointer width. 42 | salign = SizeofInt 43 | } 44 | 45 | return (salen + salign - 1) & ^(salign - 1) 46 | } 47 | -------------------------------------------------------------------------------- /.github/workflows/go-cross.yml: -------------------------------------------------------------------------------- 1 | name: Go Matrix 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | 6 | cross: 7 | name: Go 8 | runs-on: ${{ matrix.os }} 9 | env: 10 | CGO_ENABLED: 0 11 | 12 | strategy: 13 | matrix: 14 | go-version: [ 1.19, 1.x ] 15 | os: [ubuntu-latest, macos-latest, windows-latest] 16 | 17 | steps: 18 | # https://github.com/marketplace/actions/setup-go-environment 19 | - name: Set up Go ${{ matrix.go-version }} 20 | uses: actions/setup-go@v4 21 | with: 22 | go-version: ${{ matrix.go-version }} 23 | 24 | # https://github.com/marketplace/actions/checkout 25 | - name: Checkout code 26 | uses: actions/checkout@v4 27 | 28 | # https://github.com/marketplace/actions/cache 29 | - name: Cache Go modules 30 | uses: actions/cache@v4 31 | with: 32 | # In order: 33 | # * Module download cache 34 | # * Build cache (Linux) 35 | # * Build cache (Mac) 36 | # * Build cache (Windows) 37 | path: | 38 | ~/go/pkg/mod 39 | ~/.cache/go-build 40 | ~/Library/Caches/go-build 41 | %LocalAppData%\go-build 42 | key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} 43 | restore-keys: | 44 | ${{ runner.os }}-${{ matrix.go-version }}-go- 45 | 46 | - name: Test 47 | run: go test -v -cover ./... -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "fmt" 8 | 9 | // Unveil implements the unveil syscall. 10 | // For more information see unveil(2). 11 | // Note that the special case of blocking further 12 | // unveil calls is handled by UnveilBlock. 13 | func Unveil(path string, flags string) error { 14 | if err := supportsUnveil(); err != nil { 15 | return err 16 | } 17 | pathPtr, err := BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | return unveil(pathPtr, flagsPtr) 26 | } 27 | 28 | // UnveilBlock blocks future unveil calls. 29 | // For more information see unveil(2). 30 | func UnveilBlock() error { 31 | if err := supportsUnveil(); err != nil { 32 | return err 33 | } 34 | return unveil(nil, nil) 35 | } 36 | 37 | // supportsUnveil checks for availability of the unveil(2) system call based 38 | // on the running OpenBSD version. 39 | func supportsUnveil() error { 40 | maj, min, err := majmin() 41 | if err != nil { 42 | return err 43 | } 44 | 45 | // unveil is not available before 6.4 46 | if maj < 6 || (maj == 6 && min <= 3) { 47 | return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mkknownfolderids.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 The Go Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style 5 | # license that can be found in the LICENSE file. 6 | 7 | set -e 8 | shopt -s nullglob 9 | 10 | knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" 11 | [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } 12 | 13 | { 14 | echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." 15 | echo 16 | echo "package windows" 17 | echo "type KNOWNFOLDERID GUID" 18 | echo "var (" 19 | while read -r line; do 20 | [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue 21 | printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ 22 | "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ 23 | $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ 24 | $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) 25 | done < "$knownfolders" 26 | echo ")" 27 | } | gofmt > "zknownfolderids_windows.go" 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | 7 | package unix 8 | 9 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 10 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 11 | 12 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func (iov *Iovec) SetLen(length int) { 23 | iov.Len = uint32(length) 24 | } 25 | 26 | func (msghdr *Msghdr) SetControllen(length int) { 27 | msghdr.Controllen = uint32(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetIovlen(length int) { 31 | msghdr.Iovlen = int32(length) 32 | } 33 | 34 | func (cmsg *Cmsghdr) SetLen(length int) { 35 | cmsg.Len = uint32(length) 36 | } 37 | 38 | func Fstat(fd int, stat *Stat_t) error { 39 | return fstat(fd, stat) 40 | } 41 | 42 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 43 | return fstatat(dirfd, path, stat, flags) 44 | } 45 | 46 | func Lstat(path string, stat *Stat_t) error { 47 | return lstat(path, stat) 48 | } 49 | 50 | func Stat(path string, statptr *Stat_t) error { 51 | return stat(path, statptr) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 45 | var writtenOut uint64 = 0 46 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 47 | 48 | written = int(writtenOut) 49 | 50 | if e1 != 0 { 51 | err = e1 52 | } 53 | return 54 | } 55 | 56 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023 The Gorilla Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux || netbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | type mremapMmapper struct { 12 | mmapper 13 | mremap func(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) 14 | } 15 | 16 | var mapper = &mremapMmapper{ 17 | mmapper: mmapper{ 18 | active: make(map[*byte][]byte), 19 | mmap: mmap, 20 | munmap: munmap, 21 | }, 22 | mremap: mremap, 23 | } 24 | 25 | func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { 26 | if newLength <= 0 || len(oldData) == 0 || len(oldData) != cap(oldData) || flags&mremapFixed != 0 { 27 | return nil, EINVAL 28 | } 29 | 30 | pOld := &oldData[cap(oldData)-1] 31 | m.Lock() 32 | defer m.Unlock() 33 | bOld := m.active[pOld] 34 | if bOld == nil || &bOld[0] != &oldData[0] { 35 | return nil, EINVAL 36 | } 37 | newAddr, errno := m.mremap(uintptr(unsafe.Pointer(&bOld[0])), uintptr(len(bOld)), uintptr(newLength), flags, 0) 38 | if errno != nil { 39 | return nil, errno 40 | } 41 | bNew := unsafe.Slice((*byte)(unsafe.Pointer(newAddr)), newLength) 42 | pNew := &bNew[cap(bNew)-1] 43 | if flags&mremapDontunmap == 0 { 44 | delete(m.active, pOld) 45 | } 46 | m.active[pNew] = bNew 47 | return bNew, nil 48 | } 49 | 50 | func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { 51 | return mapper.Mremap(oldData, newLength, flags) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. 2 | 3 | //go:build linux && (mips || mips64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMips is the registers used by mips binaries. 10 | type PtraceRegsMips struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMips fetches the registers used by mips binaries. 21 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMips sets the registers used by mips binaries. 26 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64 is the registers used by mips64 binaries. 31 | type PtraceRegsMips64 struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 42 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 47 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | //go:build !appengine 6 | // +build !appengine 7 | 8 | package websocket 9 | 10 | import "unsafe" 11 | 12 | // #nosec G103 -- (CWE-242) Has been audited 13 | const wordSize = int(unsafe.Sizeof(uintptr(0))) 14 | 15 | func maskBytes(key [4]byte, pos int, b []byte) int { 16 | // Mask one byte at a time for small buffers. 17 | if len(b) < 2*wordSize { 18 | for i := range b { 19 | b[i] ^= key[pos&3] 20 | pos++ 21 | } 22 | return pos & 3 23 | } 24 | 25 | // Mask one byte at a time to word boundary. 26 | //#nosec G103 -- (CWE-242) Has been audited 27 | if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 { 28 | n = wordSize - n 29 | for i := range b[:n] { 30 | b[i] ^= key[pos&3] 31 | pos++ 32 | } 33 | b = b[n:] 34 | } 35 | 36 | // Create aligned word size key. 37 | var k [wordSize]byte 38 | for i := range k { 39 | k[i] = key[(pos+i)&3] 40 | } 41 | //#nosec G103 -- (CWE-242) Has been audited 42 | kw := *(*uintptr)(unsafe.Pointer(&k)) 43 | 44 | // Mask one word at a time. 45 | n := (len(b) / wordSize) * wordSize 46 | for i := 0; i < n; i += wordSize { 47 | //#nosec G103 -- (CWE-242) Has been audited 48 | *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw 49 | } 50 | 51 | // Mask one byte at a time for remaining bytes. 52 | b = b[n:] 53 | for i := range b { 54 | b[i] ^= key[pos&3] 55 | pos++ 56 | } 57 | 58 | return pos & 3 59 | } 60 | -------------------------------------------------------------------------------- /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 = 0x00000001 20 | PAGE_READONLY = 0x00000002 21 | PAGE_READWRITE = 0x00000004 22 | PAGE_WRITECOPY = 0x00000008 23 | PAGE_EXECUTE = 0x00000010 24 | PAGE_EXECUTE_READ = 0x00000020 25 | PAGE_EXECUTE_READWRITE = 0x00000040 26 | PAGE_EXECUTE_WRITECOPY = 0x00000080 27 | PAGE_GUARD = 0x00000100 28 | PAGE_NOCACHE = 0x00000200 29 | PAGE_WRITECOMBINE = 0x00000400 30 | PAGE_TARGETS_INVALID = 0x40000000 31 | PAGE_TARGETS_NO_UPDATE = 0x40000000 32 | 33 | QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002 34 | QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001 35 | QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 36 | QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 37 | ) 38 | 39 | type MemoryBasicInformation struct { 40 | BaseAddress uintptr 41 | AllocationBase uintptr 42 | AllocationProtect uint32 43 | PartitionId uint16 44 | RegionSize uintptr 45 | State uint32 46 | Protect uint32 47 | Type uint32 48 | } 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | // Returns a default environment associated with the token, rather than the current 31 | // process. If inheritExisting is true, then this environment also inherits the 32 | // environment of the current process. 33 | func (token Token) Environ(inheritExisting bool) (env []string, err error) { 34 | var block *uint16 35 | err = CreateEnvironmentBlock(&block, token, inheritExisting) 36 | if err != nil { 37 | return nil, err 38 | } 39 | defer DestroyEnvironmentBlock(block) 40 | size := unsafe.Sizeof(*block) 41 | for *block != 0 { 42 | // find NUL terminator 43 | end := unsafe.Pointer(block) 44 | for *(*uint16)(end) != 0 { 45 | end = unsafe.Add(end, size) 46 | } 47 | 48 | entry := unsafe.Slice(block, (uintptr(end)-uintptr(unsafe.Pointer(block)))/size) 49 | env = append(env, UTF16ToString(entry)) 50 | block = (*uint16)(unsafe.Add(end, size)) 51 | } 52 | return env, nil 53 | } 54 | 55 | func Unsetenv(key string) error { 56 | return syscall.Unsetenv(key) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/pools.go: -------------------------------------------------------------------------------- 1 | package proxmox 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | func (c *Client) NewPool(ctx context.Context, poolid, comment string) error { 11 | return c.Post(ctx, "/pools", map[string]string{ 12 | "poolid": poolid, 13 | "comment": comment, 14 | }, nil) 15 | } 16 | 17 | func (c *Client) Pools(ctx context.Context) (pools Pools, err error) { 18 | err = c.Get(ctx, "/pools", &pools) 19 | for _, pool := range pools { 20 | pool.client = c 21 | } 22 | return 23 | } 24 | 25 | // Pool optional filter of cluster resources by type, enum can be "qemu", "lxc", "storage". 26 | func (c *Client) Pool(ctx context.Context, poolid string, filters ...string) (pool *Pool, err error) { 27 | u := url.URL{Path: fmt.Sprintf("/pools/%s", poolid)} 28 | 29 | // filters are variadic because they're optional, munging everything passed into one big string to make 30 | // a good request and the api will error out if there's an issue 31 | if f := strings.Replace(strings.Join(filters, ""), " ", "", -1); f != "" { 32 | params := url.Values{} 33 | params.Add("type", f) 34 | u.RawQuery = params.Encode() 35 | } 36 | 37 | if err = c.Get(ctx, u.String(), &pool); err != nil { 38 | return nil, err 39 | } 40 | pool.PoolID = poolid 41 | pool.client = c 42 | 43 | return 44 | } 45 | 46 | func (p *Pool) Update(ctx context.Context, opt *PoolUpdateOption) error { 47 | return p.client.Put(ctx, fmt.Sprintf("/pools/%s", p.PoolID), opt, nil) 48 | } 49 | 50 | func (p *Pool) Delete(ctx context.Context) error { 51 | return p.client.Delete(ctx, fmt.Sprintf("/pools/%s", p.PoolID), nil) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/cluster.go: -------------------------------------------------------------------------------- 1 | package proxmox 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | "strconv" 7 | "strings" 8 | ) 9 | 10 | func (c *Client) Cluster(ctx context.Context) (*Cluster, error) { 11 | cluster := &Cluster{ 12 | client: c, 13 | } 14 | 15 | // requires (/, Sys.Audit), do not error out if no access to still get the cluster 16 | if err := cluster.Status(ctx); !IsNotAuthorized(err) { 17 | return cluster, err 18 | } 19 | 20 | return cluster, nil 21 | } 22 | 23 | func (cl *Cluster) Status(ctx context.Context) error { 24 | return cl.client.Get(ctx, "/cluster/status", cl) 25 | } 26 | 27 | func (cl *Cluster) NextID(ctx context.Context) (int, error) { 28 | var ret string 29 | if err := cl.client.Get(ctx, "/cluster/nextid", &ret); err != nil { 30 | return 0, err 31 | } 32 | return strconv.Atoi(ret) 33 | } 34 | 35 | // Resources retrieves a summary list of all resources in the cluster. 36 | // It calls /cluster/resources api v2 endpoint with an optional "type" parameter 37 | // to filter searched values. 38 | // It returns a list of ClusterResources. 39 | func (cl *Cluster) Resources(ctx context.Context, filters ...string) (rs ClusterResources, err error) { 40 | u := url.URL{Path: "/cluster/resources"} 41 | 42 | // filters are variadic because they're optional, munging everything passed into one big string to make 43 | // a good request and the api will error out if there's an issue 44 | if f := strings.Replace(strings.Join(filters, ""), " ", "", -1); f != "" { 45 | params := url.Values{} 46 | params.Add("type", f) 47 | u.RawQuery = params.Encode() 48 | } 49 | 50 | return rs, cl.client.Get(ctx, u.String(), &rs) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint32(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. 2 | 3 | //go:build linux && (mipsle || mips64le) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMipsle is the registers used by mipsle binaries. 10 | type PtraceRegsMipsle struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 21 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 26 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64le is the registers used by mips64le binaries. 31 | type PtraceRegsMips64le struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 42 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 47 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && darwin 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func setTimespec(sec, nsec int64) Timespec { 12 | return Timespec{Sec: sec, Nsec: nsec} 13 | } 14 | 15 | func setTimeval(sec, usec int64) Timeval { 16 | return Timeval{Sec: sec, Usec: int32(usec)} 17 | } 18 | 19 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 20 | k.Ident = uint64(fd) 21 | k.Filter = int16(mode) 22 | k.Flags = uint16(flags) 23 | } 24 | 25 | func (iov *Iovec) SetLen(length int) { 26 | iov.Len = uint64(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetControllen(length int) { 30 | msghdr.Controllen = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetIovlen(length int) { 34 | msghdr.Iovlen = int32(length) 35 | } 36 | 37 | func (cmsg *Cmsghdr) SetLen(length int) { 38 | cmsg.Len = uint32(length) 39 | } 40 | 41 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 42 | 43 | //sys Fstat(fd int, stat *Stat_t) (err error) 44 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 45 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) 46 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT 47 | //sys Lstat(path string, stat *Stat_t) (err error) 48 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 49 | //sys Stat(path string, stat *Stat_t) (err error) 50 | //sys Statfs(path string, stat *Statfs_t) (err error) 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || linux 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // SysvShmAttach attaches the Sysv shared memory segment associated with the 12 | // shared memory identifier id. 13 | func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { 14 | addr, errno := shmat(id, addr, flag) 15 | if errno != nil { 16 | return nil, errno 17 | } 18 | 19 | // Retrieve the size of the shared memory to enable slice creation 20 | var info SysvShmDesc 21 | 22 | _, err := SysvShmCtl(id, IPC_STAT, &info) 23 | if err != nil { 24 | // release the shared memory if we can't find the size 25 | 26 | // ignoring error from shmdt as there's nothing sensible to return here 27 | shmdt(addr) 28 | return nil, err 29 | } 30 | 31 | // Use unsafe to convert addr into a []byte. 32 | b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz)) 33 | return b, nil 34 | } 35 | 36 | // SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach. 37 | // 38 | // It is not safe to use the slice after calling this function. 39 | func SysvShmDetach(data []byte) error { 40 | if len(data) == 0 { 41 | return EINVAL 42 | } 43 | 44 | return shmdt(uintptr(unsafe.Pointer(&data[0]))) 45 | } 46 | 47 | // SysvShmGet returns the Sysv shared memory identifier associated with key. 48 | // If the IPC_CREAT flag is specified a new segment is created. 49 | func SysvShmGet(key, size, flag int) (id int, err error) { 50 | return shmget(key, size, flag) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directory.go: -------------------------------------------------------------------------------- 1 | package iso9660 2 | 3 | // Directory represents a single directory in a FAT32 filesystem 4 | type Directory struct { 5 | directoryEntry 6 | entries []*directoryEntry 7 | } 8 | 9 | // dirEntriesFromBytes loads the directory entries from the raw bytes 10 | func (d *Directory) entriesFromBytes(b []byte, f *FileSystem) error { 11 | entries, err := parseDirEntries(b, f) 12 | if err != nil { 13 | return err 14 | } 15 | d.entries = entries 16 | return nil 17 | } 18 | 19 | // entriesToBytes convert our entries to raw bytes 20 | func (d *Directory) entriesToBytes(ceBlockLocations []uint32) ([][]byte, error) { 21 | b := make([]byte, 0) 22 | ceBlocks := make([][]byte, 0) 23 | blocksize := int(d.filesystem.blocksize) 24 | for _, de := range d.entries { 25 | b2, err := de.toBytes(false, ceBlockLocations) 26 | if err != nil { 27 | return nil, err 28 | } 29 | recBytes := b2[0] 30 | // a directory entry cannot cross a block boundary 31 | // so if adding this puts us past it, then pad it 32 | // but only if we are not already exactly at the boundary 33 | newlength := len(b) + len(recBytes) 34 | left := blocksize - len(b)%blocksize 35 | if left != 0 && newlength/blocksize > len(b)/blocksize { 36 | b = append(b, make([]byte, left)...) 37 | } 38 | b = append(b, recBytes...) 39 | if len(b2) > 1 { 40 | ceBlocks = append(ceBlocks, b2[1:]...) 41 | } 42 | } 43 | // in the end, must pad to exact blocks 44 | left := blocksize - len(b)%blocksize 45 | if left > 0 { 46 | b = append(b, make([]byte, left)...) 47 | } 48 | ret := [][]byte{b} 49 | if len(ceBlocks) > 0 { 50 | ret = append(ret, ceBlocks...) 51 | } 52 | return ret, nil 53 | } 54 | -------------------------------------------------------------------------------- /internal/models.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/luthermonson/go-proxmox" 7 | ) 8 | 9 | type ParsedConfig struct { 10 | Description string `json:"description,omitempty"` 11 | } 12 | 13 | type ParsedAgentInterfaces struct { 14 | Result []struct { 15 | IPAddresses []IP `json:"ip-addresses"` 16 | } `json:"result"` 17 | } 18 | 19 | type Node struct { 20 | ID string `json:"id,omitempty"` 21 | Name string `json:"node,omitempty"` 22 | Status string `json:"status,omitempty"` 23 | } 24 | 25 | type Service struct { 26 | ID uint64 27 | Name string 28 | IPs []IP 29 | Config map[string]string 30 | } 31 | 32 | type IP struct { 33 | Address string `json:"ip-address,omitempty"` 34 | AddressType string `json:"ip-address-type,omitempty"` 35 | Prefix uint64 `json:"prefix,omitempty"` 36 | } 37 | 38 | func NewService(id proxmox.StringOrUint64, name string, config map[string]string) Service { 39 | return Service{ID: uint64(id), Name: name, Config: config, IPs: make([]IP, 0)} 40 | } 41 | 42 | func (pc *ParsedConfig) GetTraefikMap() map[string]string { 43 | m := make(map[string]string) 44 | lines := strings.Split(pc.Description, "\n") 45 | for _, l := range lines { 46 | parts := strings.Split(l, ":") 47 | if len(parts) > 1 { 48 | k := strings.Replace(parts[0], "\"", "", -1) 49 | v := strings.Replace(parts[1], "\"", "", -1) 50 | if strings.HasPrefix(k, "traefik") { 51 | m[strings.TrimSpace(k)] = strings.TrimSpace(v) 52 | } 53 | } 54 | } 55 | return m 56 | } 57 | 58 | func (pai *ParsedAgentInterfaces) GetIPs() []IP { 59 | ips := make([]IP, 0) 60 | for _, r := range pai.Result { 61 | ips = append(ips, r.IPAddresses...) 62 | } 63 | return ips 64 | } 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && !aix && !hurd 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 24 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); 25 | 26 | struct ret 27 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 28 | { 29 | struct ret r; 30 | 31 | errno = 0; 32 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 33 | r.err = errno; 34 | return r; 35 | } 36 | 37 | uintptr_t gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 38 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); 39 | 40 | uintptr_t 41 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 42 | { 43 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 14 | // instead of the glibc-specific "CALL 0x10(GS)". 15 | #define INVOKE_SYSCALL INT $0x80 16 | 17 | // Just jump to package syscall's implementation for all these functions. 18 | // The runtime may know about them. 19 | 20 | TEXT ·Syscall(SB),NOSPLIT,$0-28 21 | JMP syscall·Syscall(SB) 22 | 23 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·Syscall6(SB) 25 | 26 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 27 | CALL runtime·entersyscall(SB) 28 | MOVL trap+0(FP), AX // syscall entry 29 | MOVL a1+4(FP), BX 30 | MOVL a2+8(FP), CX 31 | MOVL a3+12(FP), DX 32 | MOVL $0, SI 33 | MOVL $0, DI 34 | INVOKE_SYSCALL 35 | MOVL AX, r1+16(FP) 36 | MOVL DX, r2+20(FP) 37 | CALL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVL trap+0(FP), AX // syscall entry 48 | MOVL a1+4(FP), BX 49 | MOVL a2+8(FP), CX 50 | MOVL a3+12(FP), DX 51 | MOVL $0, SI 52 | MOVL $0, DI 53 | INVOKE_SYSCALL 54 | MOVL AX, r1+16(FP) 55 | MOVL DX, r2+20(FP) 56 | RET 57 | 58 | TEXT ·socketcall(SB),NOSPLIT,$0-36 59 | JMP syscall·socketcall(SB) 60 | 61 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 62 | JMP syscall·rawsocketcall(SB) 63 | 64 | TEXT ·seek(SB),NOSPLIT,$0-28 65 | JMP syscall·seek(SB) 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && darwin 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func setTimespec(sec, nsec int64) Timespec { 12 | return Timespec{Sec: sec, Nsec: nsec} 13 | } 14 | 15 | func setTimeval(sec, usec int64) Timeval { 16 | return Timeval{Sec: sec, Usec: int32(usec)} 17 | } 18 | 19 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 20 | k.Ident = uint64(fd) 21 | k.Filter = int16(mode) 22 | k.Flags = uint16(flags) 23 | } 24 | 25 | func (iov *Iovec) SetLen(length int) { 26 | iov.Len = uint64(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetControllen(length int) { 30 | msghdr.Controllen = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetIovlen(length int) { 34 | msghdr.Iovlen = int32(length) 35 | } 36 | 37 | func (cmsg *Cmsghdr) SetLen(length int) { 38 | cmsg.Len = uint32(length) 39 | } 40 | 41 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 42 | 43 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 44 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 45 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 46 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 47 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 48 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 49 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 50 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | 62 | func PtraceGetFsBase(pid int, fsbase *int64) (err error) { 63 | return ptracePtr(PT_GETFSBASE, pid, unsafe.Pointer(fsbase), 0) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 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 websocket 6 | 7 | import ( 8 | "encoding/json" 9 | "io" 10 | ) 11 | 12 | // WriteJSON writes the JSON encoding of v as a message. 13 | // 14 | // Deprecated: Use c.WriteJSON instead. 15 | func WriteJSON(c *Conn, v interface{}) error { 16 | return c.WriteJSON(v) 17 | } 18 | 19 | // WriteJSON writes the JSON encoding of v as a message. 20 | // 21 | // See the documentation for encoding/json Marshal for details about the 22 | // conversion of Go values to JSON. 23 | func (c *Conn) WriteJSON(v interface{}) error { 24 | w, err := c.NextWriter(TextMessage) 25 | if err != nil { 26 | return err 27 | } 28 | err1 := json.NewEncoder(w).Encode(v) 29 | err2 := w.Close() 30 | if err1 != nil { 31 | return err1 32 | } 33 | return err2 34 | } 35 | 36 | // ReadJSON reads the next JSON-encoded message from the connection and stores 37 | // it in the value pointed to by v. 38 | // 39 | // Deprecated: Use c.ReadJSON instead. 40 | func ReadJSON(c *Conn, v interface{}) error { 41 | return c.ReadJSON(v) 42 | } 43 | 44 | // ReadJSON reads the next JSON-encoded message from the connection and stores 45 | // it in the value pointed to by v. 46 | // 47 | // See the documentation for the encoding/json Unmarshal function for details 48 | // about the conversion of JSON to a Go value. 49 | func (c *Conn) ReadJSON(v interface{}) error { 50 | _, r, err := c.NextReader() 51 | if err != nil { 52 | return err 53 | } 54 | err = json.NewDecoder(r).Decode(v) 55 | if err == io.EOF { 56 | // One value is expected in the message. 57 | err = io.ErrUnexpectedEOF 58 | } 59 | return err 60 | } 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint32(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | 62 | func PtraceGetFsBase(pid int, fsbase *int64) (err error) { 63 | return ptracePtr(PT_GETFSBASE, pid, unsafe.Pointer(fsbase), 0) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/magefile.go: -------------------------------------------------------------------------------- 1 | //go:build mage 2 | // +build mage 3 | 4 | package main 5 | 6 | import ( 7 | "fmt" 8 | "os" 9 | "strings" 10 | 11 | "github.com/magefile/mage/mg" 12 | "github.com/magefile/mage/sh" 13 | 14 | //mage:import install 15 | "github.com/luthermonson/go-proxmox/mage/install" 16 | 17 | //mage:import test 18 | "github.com/luthermonson/go-proxmox/mage/test" 19 | ) 20 | 21 | var ( 22 | envConfig = map[string]struct{}{ 23 | "PROXMOX_URL": {}, 24 | "PROXMOX_USERNAME": {}, 25 | "PROXMOX_PASSWORD": {}, 26 | "PROXMOX_OTP": {}, 27 | "PROXMOX_TOKENID": {}, 28 | "PROXMOX_SECRET": {}, 29 | "PROXMOX_NODE_NAME": {}, 30 | "PROXMOX_NODE_STORAGE": {}, 31 | "PROXMOX_APPLIANCE_PREFIX": {}, 32 | "PROXMOX_ISO_URL": {}, 33 | } 34 | ) 35 | 36 | var Aliases = map[string]interface{}{ 37 | "test": test.Unit, 38 | "install": install.Dependencies, 39 | } 40 | 41 | // run everything for ci process (install deps, lint, coverage, build) 42 | func Ci() error { 43 | fmt.Println("Running Continuous Integration...") 44 | mg.Deps( 45 | install.Dependencies, 46 | Lint, 47 | test.Coverage, 48 | test.Build) 49 | return nil 50 | } 51 | 52 | // run the linter 53 | func Lint() error { 54 | mg.Deps(install.Golangcilint) 55 | fmt.Println("Running Linter...") 56 | return sh.RunV("golangci-lint", "run") 57 | } 58 | 59 | // validate env vars to run the testing suite 60 | func Env() error { 61 | for k := range envConfig { 62 | if strings.Contains(strings.ToLower(k), "password") || strings.Contains(strings.ToLower(k), "secret") { 63 | fmt.Printf("%s: %s\n", k, strings.Repeat("*", len(os.Getenv(k)))) 64 | } else { 65 | fmt.Printf("%s: %s\n", k, os.Getenv(k)) 66 | } 67 | } 68 | 69 | return nil 70 | } 71 | -------------------------------------------------------------------------------- /vendor/gopkg.in/djherbis/times.v1/times.go: -------------------------------------------------------------------------------- 1 | // Package times provides a platform-independent way to get atime, mtime, ctime and btime for files. 2 | package times 3 | 4 | import ( 5 | "os" 6 | "time" 7 | ) 8 | 9 | // Get returns the Timespec for the given FileInfo 10 | func Get(fi os.FileInfo) Timespec { 11 | return getTimespec(fi) 12 | } 13 | 14 | type statFunc func(string) (os.FileInfo, error) 15 | 16 | func stat(name string, sf statFunc) (Timespec, error) { 17 | fi, err := sf(name) 18 | if err != nil { 19 | return nil, err 20 | } 21 | return getTimespec(fi), nil 22 | } 23 | 24 | // Timespec provides access to file times. 25 | // ChangeTime() panics unless HasChangeTime() is true and 26 | // BirthTime() panics unless HasBirthTime() is true. 27 | type Timespec interface { 28 | ModTime() time.Time 29 | AccessTime() time.Time 30 | ChangeTime() time.Time 31 | BirthTime() time.Time 32 | HasChangeTime() bool 33 | HasBirthTime() bool 34 | } 35 | 36 | type atime struct { 37 | v time.Time 38 | } 39 | 40 | func (a atime) AccessTime() time.Time { return a.v } 41 | 42 | type ctime struct { 43 | v time.Time 44 | } 45 | 46 | func (ctime) HasChangeTime() bool { return true } 47 | 48 | func (c ctime) ChangeTime() time.Time { return c.v } 49 | 50 | type mtime struct { 51 | v time.Time 52 | } 53 | 54 | func (m mtime) ModTime() time.Time { return m.v } 55 | 56 | type btime struct { 57 | v time.Time 58 | } 59 | 60 | func (btime) HasBirthTime() bool { return true } 61 | 62 | func (b btime) BirthTime() time.Time { return b.v } 63 | 64 | type noctime struct{} 65 | 66 | func (noctime) HasChangeTime() bool { return false } 67 | 68 | func (noctime) ChangeTime() time.Time { panic("ctime not available") } 69 | 70 | type nobtime struct{} 71 | 72 | func (nobtime) HasBirthTime() bool { return false } 73 | 74 | func (nobtime) BirthTime() time.Time { panic("birthtime not available") } 75 | -------------------------------------------------------------------------------- /vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/util.go: -------------------------------------------------------------------------------- 1 | package iso9660 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | const ( 8 | // KB represents one KB 9 | KB int64 = 1024 10 | // MB represents one MB 11 | MB int64 = 1024 * KB 12 | // GB represents one GB 13 | GB int64 = 1024 * MB 14 | // TB represents one TB 15 | TB int64 = 1024 * GB 16 | ) 17 | 18 | func universalizePath(p string) string { 19 | // globalize the separator 20 | return strings.ReplaceAll(p, `\`, "/") 21 | } 22 | func splitPath(p string) []string { 23 | ps := universalizePath(p) 24 | // we need to split such that each one ends in "/", except possibly the last one 25 | parts := strings.Split(ps, "/") 26 | // eliminate empty parts 27 | ret := make([]string, 0) 28 | for _, sub := range parts { 29 | if sub != "" { 30 | ret = append(ret, sub) 31 | } 32 | } 33 | return ret 34 | } 35 | 36 | func ucs2StringToBytes(s string) []byte { 37 | rs := []rune(s) 38 | l := len(rs) 39 | b := make([]byte, 0, 2*l) 40 | // big endian 41 | for _, r := range rs { 42 | tmpb := []byte{byte(r >> 8), byte(r & 0x00ff)} 43 | b = append(b, tmpb...) 44 | } 45 | return b 46 | } 47 | 48 | // bytesToUCS2String convert bytes to UCS-2. We aren't 100% sure that this is right, 49 | // as it is possible to pass it an odd number of characters. But good enough for now. 50 | func bytesToUCS2String(b []byte) string { 51 | r := make([]rune, 0, 30) 52 | // now we can iterate - be careful in case we were given an odd number of bytes 53 | for i := 0; i < len(b); { 54 | // little endian 55 | var val uint16 56 | if i >= len(b)-1 { 57 | val = uint16(b[i]) 58 | } else { 59 | val = uint16(b[i])<<8 + uint16(b[i+1]) 60 | } 61 | r = append(r, rune(val)) 62 | i += 2 63 | } 64 | return string(r) 65 | } 66 | 67 | // maxInt returns the larger of x or y. 68 | func maxInt(x, y int) int { 69 | if x < y { 70 | return y 71 | } 72 | return x 73 | } 74 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/dial.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 proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | ) 11 | 12 | // A ContextDialer dials using a context. 13 | type ContextDialer interface { 14 | DialContext(ctx context.Context, network, address string) (net.Conn, error) 15 | } 16 | 17 | // Dial works like DialContext on net.Dialer but using a dialer returned by FromEnvironment. 18 | // 19 | // The passed ctx is only used for returning the Conn, not the lifetime of the Conn. 20 | // 21 | // Custom dialers (registered via RegisterDialerType) that do not implement ContextDialer 22 | // can leak a goroutine for as long as it takes the underlying Dialer implementation to timeout. 23 | // 24 | // A Conn returned from a successful Dial after the context has been cancelled will be immediately closed. 25 | func Dial(ctx context.Context, network, address string) (net.Conn, error) { 26 | d := FromEnvironment() 27 | if xd, ok := d.(ContextDialer); ok { 28 | return xd.DialContext(ctx, network, address) 29 | } 30 | return dialContext(ctx, d, network, address) 31 | } 32 | 33 | // WARNING: this can leak a goroutine for as long as the underlying Dialer implementation takes to timeout 34 | // A Conn returned from a successful Dial after the context has been cancelled will be immediately closed. 35 | func dialContext(ctx context.Context, d Dialer, network, address string) (net.Conn, error) { 36 | var ( 37 | conn net.Conn 38 | done = make(chan struct{}, 1) 39 | err error 40 | ) 41 | go func() { 42 | conn, err = d.Dial(network, address) 43 | close(done) 44 | if conn != nil && ctx.Err() != nil { 45 | conn.Close() 46 | } 47 | }() 48 | select { 49 | case <-ctx.Done(): 50 | err = ctx.Err() 51 | case <-done: 52 | } 53 | return conn, err 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/cluster_firewall.go: -------------------------------------------------------------------------------- 1 | package proxmox 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | ) 7 | 8 | func (cl *Cluster) FWGroups(ctx context.Context) (groups []*FirewallSecurityGroup, err error) { 9 | err = cl.client.Get(ctx, "/cluster/firewall/groups", &groups) 10 | 11 | if nil == err { 12 | for _, g := range groups { 13 | g.client = cl.client 14 | } 15 | } 16 | return 17 | } 18 | 19 | func (cl *Cluster) FWGroup(ctx context.Context, name string) (group *FirewallSecurityGroup, err error) { 20 | group = &FirewallSecurityGroup{} 21 | err = cl.client.Get(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", name), &group.Rules) 22 | if nil == err { 23 | group.Group = name 24 | group.client = cl.client 25 | } 26 | return 27 | } 28 | 29 | func (cl *Cluster) NewFWGroup(ctx context.Context, group *FirewallSecurityGroup) error { 30 | return cl.client.Post(ctx, fmt.Sprintf("/cluster/firewall/groups"), group, &group) 31 | } 32 | 33 | func (g *FirewallSecurityGroup) GetRules(ctx context.Context) ([]*FirewallRule, error) { 34 | return g.Rules, g.client.Get(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", g.Group), &g.Rules) 35 | } 36 | 37 | func (g *FirewallSecurityGroup) Delete(ctx context.Context) error { 38 | return g.client.Delete(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", g.Group), nil) 39 | } 40 | 41 | func (g *FirewallSecurityGroup) RuleCreate(ctx context.Context, rule *FirewallRule) error { 42 | return g.client.Post(ctx, fmt.Sprintf("/cluster/firewall/groups/%s", g.Group), rule, nil) 43 | } 44 | 45 | func (g *FirewallSecurityGroup) RuleUpdate(ctx context.Context, rule *FirewallRule) error { 46 | return g.client.Put(ctx, fmt.Sprintf("/cluster/firewall/groups/%s/%d", g.Group, rule.Pos), rule, nil) 47 | } 48 | 49 | func (g *FirewallSecurityGroup) RuleDelete(ctx context.Context, rulePos int) error { 50 | return g.client.Delete(ctx, fmt.Sprintf("/cluster/firewall/groups/%s/%d", g.Group, rulePos), nil) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/README.md: -------------------------------------------------------------------------------- 1 | # gorilla/websocket 2 | 3 | ![testing](https://github.com/gorilla/websocket/actions/workflows/test.yml/badge.svg) 4 | [![codecov](https://codecov.io/github/gorilla/websocket/branch/main/graph/badge.svg)](https://codecov.io/github/gorilla/websocket) 5 | [![godoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) 6 | [![sourcegraph](https://sourcegraph.com/github.com/gorilla/websocket/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/websocket?badge) 7 | 8 | Gorilla WebSocket is a [Go](http://golang.org/) implementation of the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. 9 | 10 | ![Gorilla Logo](https://github.com/gorilla/.github/assets/53367916/d92caabf-98e0-473e-bfbf-ab554ba435e5) 11 | 12 | 13 | ### Documentation 14 | 15 | * [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc) 16 | * [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat) 17 | * [Command example](https://github.com/gorilla/websocket/tree/master/examples/command) 18 | * [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo) 19 | * [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch) 20 | * [Write buffer pool example](https://github.com/gorilla/websocket/tree/master/examples/bufferpool) 21 | 22 | ### Status 23 | 24 | The Gorilla WebSocket package provides a complete and tested implementation of 25 | the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The 26 | package API is stable. 27 | 28 | ### Installation 29 | 30 | go get github.com/gorilla/websocket 31 | 32 | ### Protocol Compliance 33 | 34 | The Gorilla WebSocket package passes the server tests in the [Autobahn Test 35 | Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn 36 | subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn). 37 | -------------------------------------------------------------------------------- /vendor/github.com/traefik/genconf/dynamic/tcp_config.go: -------------------------------------------------------------------------------- 1 | package dynamic 2 | 3 | // Code generated by centrifuge. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/traefik/genconf/dynamic/types" 7 | ) 8 | 9 | type ProxyProtocol struct { 10 | Version int `json:"version,omitempty"` 11 | } 12 | 13 | type RouterTCPTLSConfig struct { 14 | Passthrough bool `json:"passthrough"` 15 | Options string `json:"options,omitempty"` 16 | CertResolver string `json:"certResolver,omitempty"` 17 | Domains []types.Domain `json:"domains,omitempty"` 18 | } 19 | 20 | type TCPConfiguration struct { 21 | Routers map[string]*TCPRouter `json:"routers,omitempty"` 22 | Services map[string]*TCPService `json:"services,omitempty"` 23 | Middlewares map[string]*TCPMiddleware `json:"middlewares,omitempty"` 24 | } 25 | 26 | type TCPRouter struct { 27 | EntryPoints []string `json:"entryPoints,omitempty"` 28 | Middlewares []string `json:"middlewares,omitempty"` 29 | Service string `json:"service,omitempty"` 30 | Rule string `json:"rule,omitempty"` 31 | Priority int `json:"priority,omitempty"` 32 | TLS *RouterTCPTLSConfig `json:"tls,omitempty"` 33 | } 34 | 35 | type TCPServer struct { 36 | Address string `json:"address,omitempty"` 37 | } 38 | 39 | type TCPServersLoadBalancer struct { 40 | TerminationDelay *int `json:"terminationDelay,omitempty"` 41 | ProxyProtocol *ProxyProtocol `json:"proxyProtocol,omitempty"` 42 | Servers []TCPServer `json:"servers,omitempty"` 43 | } 44 | 45 | type TCPService struct { 46 | LoadBalancer *TCPServersLoadBalancer `json:"loadBalancer,omitempty"` 47 | Weighted *TCPWeightedRoundRobin `json:"weighted,omitempty"` 48 | } 49 | 50 | type TCPWRRService struct { 51 | Name string `json:"name,omitempty"` 52 | Weight *int `json:"weight,omitempty"` 53 | } 54 | 55 | type TCPWeightedRoundRobin struct { 56 | Services []TCPWRRService `json:"services,omitempty"` 57 | } 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Traefik Plugin for Proxmox 2 | 3 | This plugin analyses all configured VMs and CTs running in a specific Proxmox Cluster. 4 | Based on specific formattet content in the description (Notes) field, Traefik configurations can be exstracted. 5 | All lines in the format: 6 | 7 | ```ini 8 | "traefik.…":"value" 9 | ``` 10 | 11 | Will be parsed as Traefik values. 12 | 13 | Example: 14 | 15 | ```ini 16 | "traefik.enable": "true" 17 | "traefik.http.routers.umbrelvm.entrypoints": "http" 18 | "traefik.http.routers.umbrelvm.rule": "Host(`example.com`)" 19 | "traefik.http.services.umbrelvm.loadbalancer.server.port": "80" 20 | ``` 21 | 22 | This Content will be parsed as: 23 | 24 | ```json 25 | { 26 | "traefik.enable": "true", 27 | "traefik.http.routers.umbrelvm.entrypoints": "http", 28 | "traefik.http.routers.umbrelvm.rule": "Host(`example.com`)", 29 | "traefik.http.services.umbrelvm.loadbalancer.server.port": "80" 30 | } 31 | ``` 32 | 33 | The plugin tries to get IPs from running VMs. This does only work, if the QEMU Guest Agent is installed, running and configured in Proxmox. 34 | 35 | For running containers, the IP has to be set via the config like this: 36 | 37 | ```ini 38 | "traefik.enable": "true" 39 | "traefik.http.routers.web.entrypoints": "http" 40 | "traefik.http.routers.web.rule": "Host(`web.example.com`)" 41 | "traefik.http.services.web.loadbalancer.server.port": "80" 42 | "traefik.http.services.web.loadbalancer.server.ipv4": "192.168.168.131" 43 | ``` 44 | 45 | ## Required Permissions 46 | 47 | For this plugin to be able to access all PVE API Endpoints, the following permissions need to be setup: 48 | 49 | ```txt 50 | token:root@pam!traefik:0:0:: 51 | role:API-READER:Datastore.Audit,SDN.Audit,Sys.Audit,VM.Audit,VM.Config.Options: 52 | acl:1:/:root@pam!traefik:API-READER: 53 | ``` 54 | 55 | ## Config Values 56 | 57 | You can configure the plugin using env variables. 58 | At the moment they are injected using [direnv](https://direnv.net/). 59 | For a detailed description have a look into the [.envrc.example](.envrc.example) file. 60 | -------------------------------------------------------------------------------- /vendor/github.com/luthermonson/go-proxmox/nodes_network.go: -------------------------------------------------------------------------------- 1 | package proxmox 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | ) 7 | 8 | func (n *Node) NewNetwork(ctx context.Context, network *NodeNetwork) (task *Task, err error) { 9 | err = n.client.Post(ctx, fmt.Sprintf("/nodes/%s/network", n.Name), network, network) 10 | if nil != err { 11 | return 12 | } 13 | 14 | network.client = n.client 15 | network.Node = n.Name 16 | network.NodeAPI = n 17 | return n.NetworkReload(ctx) 18 | } 19 | 20 | func (n *Node) Network(ctx context.Context, iface string) (network *NodeNetwork, err error) { 21 | err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/network/%s", n.Name, iface), &network) 22 | if err != nil { 23 | return 24 | } 25 | 26 | if nil != network { 27 | network.client = n.client 28 | network.Node = n.Name 29 | network.NodeAPI = n 30 | network.Iface = iface 31 | } 32 | 33 | return 34 | } 35 | 36 | func (n *Node) Networks(ctx context.Context) (networks NodeNetworks, err error) { 37 | err = n.client.Get(ctx, fmt.Sprintf("/nodes/%s/network", n.Name), &networks) 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | for _, v := range networks { 43 | v.client = n.client 44 | v.Node = n.Name 45 | v.NodeAPI = n 46 | } 47 | 48 | return 49 | } 50 | 51 | func (n *Node) NetworkReload(ctx context.Context) (*Task, error) { 52 | var upid UPID 53 | err := n.client.Put(ctx, fmt.Sprintf("/nodes/%s/network", n.Name), nil, &upid) 54 | if err != nil { 55 | return nil, err 56 | } 57 | 58 | return NewTask(upid, n.client), nil 59 | } 60 | 61 | func (nw *NodeNetwork) Update(ctx context.Context) error { 62 | if "" == nw.Iface { 63 | return nil 64 | } 65 | return nw.client.Put(ctx, fmt.Sprintf("/nodes/%s/network/%s", nw.Node, nw.Iface), nw, nil) 66 | } 67 | 68 | func (nw *NodeNetwork) Delete(ctx context.Context) (task *Task, err error) { 69 | var upid UPID 70 | if "" == nw.Iface { 71 | return 72 | } 73 | err = nw.client.Delete(ctx, fmt.Sprintf("/nodes/%s/network/%s", nw.Node, nw.Iface), &upid) 74 | if err != nil { 75 | return 76 | } 77 | 78 | return nw.NodeAPI.NetworkReload(ctx) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_illumos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // illumos system calls not present on Solaris. 6 | 7 | //go:build amd64 && illumos 8 | 9 | package unix 10 | 11 | import ( 12 | "unsafe" 13 | ) 14 | 15 | func bytes2iovec(bs [][]byte) []Iovec { 16 | iovecs := make([]Iovec, len(bs)) 17 | for i, b := range bs { 18 | iovecs[i].SetLen(len(b)) 19 | if len(b) > 0 { 20 | iovecs[i].Base = &b[0] 21 | } else { 22 | iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero)) 23 | } 24 | } 25 | return iovecs 26 | } 27 | 28 | //sys readv(fd int, iovs []Iovec) (n int, err error) 29 | 30 | func Readv(fd int, iovs [][]byte) (n int, err error) { 31 | iovecs := bytes2iovec(iovs) 32 | n, err = readv(fd, iovecs) 33 | return n, err 34 | } 35 | 36 | //sys preadv(fd int, iovs []Iovec, off int64) (n int, err error) 37 | 38 | func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) { 39 | iovecs := bytes2iovec(iovs) 40 | n, err = preadv(fd, iovecs, off) 41 | return n, err 42 | } 43 | 44 | //sys writev(fd int, iovs []Iovec) (n int, err error) 45 | 46 | func Writev(fd int, iovs [][]byte) (n int, err error) { 47 | iovecs := bytes2iovec(iovs) 48 | n, err = writev(fd, iovecs) 49 | return n, err 50 | } 51 | 52 | //sys pwritev(fd int, iovs []Iovec, off int64) (n int, err error) 53 | 54 | func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) { 55 | iovecs := bytes2iovec(iovs) 56 | n, err = pwritev(fd, iovecs, off) 57 | return n, err 58 | } 59 | 60 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = libsocket.accept4 61 | 62 | func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { 63 | var rsa RawSockaddrAny 64 | var len _Socklen = SizeofSockaddrAny 65 | nfd, err = accept4(fd, &rsa, &len, flags) 66 | if err != nil { 67 | return 68 | } 69 | if len > SizeofSockaddrAny { 70 | panic("RawSockaddrAny too small") 71 | } 72 | sa, err = anyToSockaddr(fd, &rsa) 73 | if err != nil { 74 | Close(nfd) 75 | nfd = 0 76 | } 77 | return 78 | } 79 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && !aix && !hurd 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr) 15 | 16 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 17 | 18 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { 19 | syscall.Entersyscall() 20 | r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 21 | syscall.Exitsyscall() 22 | return r, 0 23 | } 24 | 25 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 26 | syscall.Entersyscall() 27 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 28 | syscall.Exitsyscall() 29 | return r, 0, syscall.Errno(errno) 30 | } 31 | 32 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 33 | syscall.Entersyscall() 34 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 35 | syscall.Exitsyscall() 36 | return r, 0, syscall.Errno(errno) 37 | } 38 | 39 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 40 | syscall.Entersyscall() 41 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 42 | syscall.Exitsyscall() 43 | return r, 0, syscall.Errno(errno) 44 | } 45 | 46 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { 47 | r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 48 | return r, 0 49 | } 50 | 51 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 52 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 53 | return r, 0, syscall.Errno(errno) 54 | } 55 | 56 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 57 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 58 | return r, 0, syscall.Errno(errno) 59 | } 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_x86_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT. 2 | 3 | //go:build linux && (386 || amd64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegs386 is the registers used by 386 binaries. 10 | type PtraceRegs386 struct { 11 | Ebx int32 12 | Ecx int32 13 | Edx int32 14 | Esi int32 15 | Edi int32 16 | Ebp int32 17 | Eax int32 18 | Xds int32 19 | Xes int32 20 | Xfs int32 21 | Xgs int32 22 | Orig_eax int32 23 | Eip int32 24 | Xcs int32 25 | Eflags int32 26 | Esp int32 27 | Xss int32 28 | } 29 | 30 | // PtraceGetRegs386 fetches the registers used by 386 binaries. 31 | func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error { 32 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 33 | } 34 | 35 | // PtraceSetRegs386 sets the registers used by 386 binaries. 36 | func PtraceSetRegs386(pid int, regs *PtraceRegs386) error { 37 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 38 | } 39 | 40 | // PtraceRegsAmd64 is the registers used by amd64 binaries. 41 | type PtraceRegsAmd64 struct { 42 | R15 uint64 43 | R14 uint64 44 | R13 uint64 45 | R12 uint64 46 | Rbp uint64 47 | Rbx uint64 48 | R11 uint64 49 | R10 uint64 50 | R9 uint64 51 | R8 uint64 52 | Rax uint64 53 | Rcx uint64 54 | Rdx uint64 55 | Rsi uint64 56 | Rdi uint64 57 | Orig_rax uint64 58 | Rip uint64 59 | Cs uint64 60 | Eflags uint64 61 | Rsp uint64 62 | Ss uint64 63 | Fs_base uint64 64 | Gs_base uint64 65 | Ds uint64 66 | Es uint64 67 | Fs uint64 68 | Gs uint64 69 | } 70 | 71 | // PtraceGetRegsAmd64 fetches the registers used by amd64 binaries. 72 | func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error { 73 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 74 | } 75 | 76 | // PtraceSetRegsAmd64 sets the registers used by amd64 binaries. 77 | func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error { 78 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 79 | } 80 | --------------------------------------------------------------------------------