From fbedf4acda9ff659a69fe577465db9617ec94ba1 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 4 Oct 2018 18:04:48 -0700 Subject: remove vendored dependencies for some things, vgo is coming --- irc/kcpd/.gitignore | 1 - irc/kcpd/README.md | 4 - irc/kcpd/client.go | 93 - irc/kcpd/gopreload.go | 9 - irc/kcpd/gops.go | 13 - irc/kcpd/main.go | 110 - irc/kcpd/server.go | 97 - irc/kcpd/stdlibsvc/README.md | 81 - irc/kcpd/stdlibsvc/env.json | 8 - irc/kcpd/stdlibsvc/functions/main/function.json | 15 - irc/kcpd/stdlibsvc/functions/main/index.js | 32 - irc/kcpd/stdlibsvc/package.json | 19 - irc/kcpd/util.go | 21 - irc/kcpd/vendor-log | 26 - irc/kcpd/vendor/github.com/Xe/gopreload/doc.go | 7 - irc/kcpd/vendor/github.com/Xe/gopreload/preload.go | 26 - irc/kcpd/vendor/github.com/caarlos0/env/env.go | 275 -- .../vendor/github.com/google/gops/agent/agent.go | 237 -- .../github.com/google/gops/internal/internal.go | 52 - .../vendor/github.com/google/gops/signal/signal.go | 35 - .../github.com/joho/godotenv/autoload/autoload.go | 15 - .../vendor/github.com/joho/godotenv/godotenv.go | 229 -- .../vendor/github.com/kardianos/osext/osext.go | 33 - .../github.com/kardianos/osext/osext_plan9.go | 20 - .../github.com/kardianos/osext/osext_procfs.go | 36 - .../github.com/kardianos/osext/osext_sysctl.go | 126 - .../github.com/kardianos/osext/osext_windows.go | 34 - .../vendor/github.com/klauspost/cpuid/cpuid.go | 1022 -------- .../github.com/klauspost/cpuid/cpuid_amd64.s | 42 - .../github.com/klauspost/cpuid/detect_intel.go | 17 - .../github.com/klauspost/cpuid/detect_ref.go | 23 - .../vendor/github.com/klauspost/cpuid/generate.go | 3 - .../github.com/klauspost/cpuid/private-gen.go | 476 ---- .../github.com/klauspost/reedsolomon/galois.go | 134 - .../klauspost/reedsolomon/galois_amd64.go | 73 - .../klauspost/reedsolomon/galois_amd64.s | 164 -- .../klauspost/reedsolomon/galois_noasm.go | 19 - .../github.com/klauspost/reedsolomon/gentables.go | 132 - .../klauspost/reedsolomon/inversion_tree.go | 160 -- .../github.com/klauspost/reedsolomon/matrix.go | 279 -- .../github.com/klauspost/reedsolomon/options.go | 67 - .../klauspost/reedsolomon/reedsolomon.go | 596 ----- .../github.com/klauspost/reedsolomon/streaming.go | 575 ----- irc/kcpd/vendor/github.com/pkg/errors/errors.go | 269 -- irc/kcpd/vendor/github.com/pkg/errors/stack.go | 178 -- irc/kcpd/vendor/github.com/xtaci/kcp-go/crypt.go | 263 -- irc/kcpd/vendor/github.com/xtaci/kcp-go/fec.go | 303 --- irc/kcpd/vendor/github.com/xtaci/kcp-go/kcp.go | 1007 -------- irc/kcpd/vendor/github.com/xtaci/kcp-go/sess.go | 937 ------- irc/kcpd/vendor/github.com/xtaci/kcp-go/snmp.go | 164 -- irc/kcpd/vendor/github.com/xtaci/kcp-go/updater.go | 107 - irc/kcpd/vendor/github.com/xtaci/kcp-go/xor.go | 110 - irc/kcpd/vendor/github.com/xtaci/smux/frame.go | 60 - irc/kcpd/vendor/github.com/xtaci/smux/mux.go | 80 - irc/kcpd/vendor/github.com/xtaci/smux/session.go | 334 --- irc/kcpd/vendor/github.com/xtaci/smux/stream.go | 261 -- .../vendor/golang.org/x/crypto/blowfish/block.go | 159 -- .../vendor/golang.org/x/crypto/blowfish/cipher.go | 91 - .../vendor/golang.org/x/crypto/blowfish/const.go | 199 -- irc/kcpd/vendor/golang.org/x/crypto/cast5/cast5.go | 526 ---- .../vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go | 77 - .../golang.org/x/crypto/salsa20/salsa/hsalsa20.go | 144 -- .../x/crypto/salsa20/salsa/salsa2020_amd64.s | 889 ------- .../golang.org/x/crypto/salsa20/salsa/salsa208.go | 199 -- .../x/crypto/salsa20/salsa/salsa20_amd64.go | 23 - .../x/crypto/salsa20/salsa/salsa20_ref.go | 234 -- .../vendor/golang.org/x/crypto/salsa20/salsa20.go | 54 - irc/kcpd/vendor/golang.org/x/crypto/tea/cipher.go | 109 - .../vendor/golang.org/x/crypto/twofish/twofish.go | 342 --- irc/kcpd/vendor/golang.org/x/crypto/xtea/block.go | 66 - irc/kcpd/vendor/golang.org/x/crypto/xtea/cipher.go | 82 - irc/kcpd/vendor/golang.org/x/net/bpf/asm.go | 41 - irc/kcpd/vendor/golang.org/x/net/bpf/constants.go | 218 -- irc/kcpd/vendor/golang.org/x/net/bpf/doc.go | 82 - .../vendor/golang.org/x/net/bpf/instructions.go | 704 ----- irc/kcpd/vendor/golang.org/x/net/bpf/vm.go | 140 - .../vendor/golang.org/x/net/bpf/vm_instructions.go | 174 -- .../vendor/golang.org/x/net/internal/iana/const.go | 180 -- .../vendor/golang.org/x/net/internal/iana/gen.go | 293 --- .../golang.org/x/net/internal/netreflect/socket.go | 41 - .../x/net/internal/netreflect/socket_19.go | 37 - .../x/net/internal/netreflect/socket_posix.go | 31 - .../x/net/internal/netreflect/socket_stub.go | 12 - .../vendor/golang.org/x/net/ipv4/bpfopt_linux.go | 28 - .../vendor/golang.org/x/net/ipv4/bpfopt_stub.go | 16 - irc/kcpd/vendor/golang.org/x/net/ipv4/control.go | 70 - .../vendor/golang.org/x/net/ipv4/control_bsd.go | 40 - .../golang.org/x/net/ipv4/control_pktinfo.go | 37 - .../vendor/golang.org/x/net/ipv4/control_stub.go | 23 - .../vendor/golang.org/x/net/ipv4/control_unix.go | 148 -- .../golang.org/x/net/ipv4/control_windows.go | 27 - .../vendor/golang.org/x/net/ipv4/defs_darwin.go | 77 - .../vendor/golang.org/x/net/ipv4/defs_dragonfly.go | 38 - .../vendor/golang.org/x/net/ipv4/defs_freebsd.go | 75 - .../vendor/golang.org/x/net/ipv4/defs_linux.go | 120 - .../vendor/golang.org/x/net/ipv4/defs_netbsd.go | 37 - .../vendor/golang.org/x/net/ipv4/defs_openbsd.go | 37 - .../vendor/golang.org/x/net/ipv4/defs_solaris.go | 84 - .../vendor/golang.org/x/net/ipv4/dgramopt_posix.go | 253 -- .../vendor/golang.org/x/net/ipv4/dgramopt_stub.go | 106 - irc/kcpd/vendor/golang.org/x/net/ipv4/doc.go | 244 -- irc/kcpd/vendor/golang.org/x/net/ipv4/endpoint.go | 194 -- irc/kcpd/vendor/golang.org/x/net/ipv4/gen.go | 199 -- .../golang.org/x/net/ipv4/genericopt_posix.go | 63 - .../golang.org/x/net/ipv4/genericopt_stub.go | 29 - irc/kcpd/vendor/golang.org/x/net/ipv4/go19_test.go | 11 - irc/kcpd/vendor/golang.org/x/net/ipv4/header.go | 145 -- irc/kcpd/vendor/golang.org/x/net/ipv4/helper.go | 59 - irc/kcpd/vendor/golang.org/x/net/ipv4/iana.go | 34 - irc/kcpd/vendor/golang.org/x/net/ipv4/icmp.go | 57 - .../vendor/golang.org/x/net/ipv4/icmp_linux.go | 25 - irc/kcpd/vendor/golang.org/x/net/ipv4/icmp_stub.go | 25 - irc/kcpd/vendor/golang.org/x/net/ipv4/packet.go | 100 - irc/kcpd/vendor/golang.org/x/net/ipv4/payload.go | 18 - .../vendor/golang.org/x/net/ipv4/payload_cmsg.go | 81 - .../vendor/golang.org/x/net/ipv4/payload_nocmsg.go | 42 - irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt.go | 46 - .../vendor/golang.org/x/net/ipv4/sockopt_asmreq.go | 83 - .../golang.org/x/net/ipv4/sockopt_asmreq_posix.go | 46 - .../golang.org/x/net/ipv4/sockopt_asmreq_stub.go | 21 - .../golang.org/x/net/ipv4/sockopt_asmreqn_stub.go | 17 - .../golang.org/x/net/ipv4/sockopt_asmreqn_unix.go | 42 - .../vendor/golang.org/x/net/ipv4/sockopt_posix.go | 122 - .../golang.org/x/net/ipv4/sockopt_ssmreq_stub.go | 17 - .../golang.org/x/net/ipv4/sockopt_ssmreq_unix.go | 61 - .../vendor/golang.org/x/net/ipv4/sockopt_stub.go | 11 - irc/kcpd/vendor/golang.org/x/net/ipv4/sys_bsd.go | 34 - .../vendor/golang.org/x/net/ipv4/sys_darwin.go | 97 - .../vendor/golang.org/x/net/ipv4/sys_freebsd.go | 73 - irc/kcpd/vendor/golang.org/x/net/ipv4/sys_linux.go | 55 - .../vendor/golang.org/x/net/ipv4/sys_openbsd.go | 32 - .../vendor/golang.org/x/net/ipv4/sys_solaris.go | 54 - irc/kcpd/vendor/golang.org/x/net/ipv4/sys_stub.go | 13 - .../vendor/golang.org/x/net/ipv4/sys_windows.go | 62 - .../golang.org/x/net/ipv4/syscall_linux_386.go | 31 - .../golang.org/x/net/ipv4/syscall_solaris.go | 38 - .../vendor/golang.org/x/net/ipv4/syscall_unix.go | 26 - .../golang.org/x/net/ipv4/syscall_windows.go | 18 - .../vendor/golang.org/x/net/ipv4/zsys_darwin.go | 99 - .../vendor/golang.org/x/net/ipv4/zsys_dragonfly.go | 31 - .../golang.org/x/net/ipv4/zsys_freebsd_386.go | 93 - .../golang.org/x/net/ipv4/zsys_freebsd_amd64.go | 95 - .../golang.org/x/net/ipv4/zsys_freebsd_arm.go | 95 - .../vendor/golang.org/x/net/ipv4/zsys_linux_386.go | 146 -- .../golang.org/x/net/ipv4/zsys_linux_amd64.go | 148 -- .../vendor/golang.org/x/net/ipv4/zsys_linux_arm.go | 146 -- .../golang.org/x/net/ipv4/zsys_linux_arm64.go | 148 -- .../golang.org/x/net/ipv4/zsys_linux_mips.go | 146 -- .../golang.org/x/net/ipv4/zsys_linux_mips64.go | 148 -- .../golang.org/x/net/ipv4/zsys_linux_mips64le.go | 148 -- .../golang.org/x/net/ipv4/zsys_linux_mipsle.go | 146 -- .../vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go | 146 -- .../golang.org/x/net/ipv4/zsys_linux_ppc64.go | 148 -- .../golang.org/x/net/ipv4/zsys_linux_ppc64le.go | 148 -- .../golang.org/x/net/ipv4/zsys_linux_s390x.go | 148 -- .../vendor/golang.org/x/net/ipv4/zsys_netbsd.go | 30 - .../vendor/golang.org/x/net/ipv4/zsys_openbsd.go | 30 - .../vendor/golang.org/x/net/ipv4/zsys_solaris.go | 100 - irc/kcpd/vendor/gopkg.in/yaml.v1/apic.go | 742 ------ irc/kcpd/vendor/gopkg.in/yaml.v1/decode.go | 566 ---- irc/kcpd/vendor/gopkg.in/yaml.v1/emitterc.go | 1685 ------------ irc/kcpd/vendor/gopkg.in/yaml.v1/encode.go | 265 -- irc/kcpd/vendor/gopkg.in/yaml.v1/parserc.go | 1096 -------- irc/kcpd/vendor/gopkg.in/yaml.v1/readerc.go | 391 --- irc/kcpd/vendor/gopkg.in/yaml.v1/resolve.go | 190 -- irc/kcpd/vendor/gopkg.in/yaml.v1/scannerc.go | 2710 -------------------- irc/kcpd/vendor/gopkg.in/yaml.v1/sorter.go | 104 - irc/kcpd/vendor/gopkg.in/yaml.v1/writerc.go | 89 - irc/kcpd/vendor/gopkg.in/yaml.v1/yaml.go | 301 --- irc/kcpd/vendor/gopkg.in/yaml.v1/yamlh.go | 716 ------ irc/kcpd/vendor/gopkg.in/yaml.v1/yamlprivateh.go | 173 -- 171 files changed, 29564 deletions(-) delete mode 100644 irc/kcpd/.gitignore delete mode 100644 irc/kcpd/README.md delete mode 100644 irc/kcpd/client.go delete mode 100644 irc/kcpd/gopreload.go delete mode 100644 irc/kcpd/gops.go delete mode 100644 irc/kcpd/main.go delete mode 100644 irc/kcpd/server.go delete mode 100644 irc/kcpd/stdlibsvc/README.md delete mode 100644 irc/kcpd/stdlibsvc/env.json delete mode 100644 irc/kcpd/stdlibsvc/functions/main/function.json delete mode 100644 irc/kcpd/stdlibsvc/functions/main/index.js delete mode 100644 irc/kcpd/stdlibsvc/package.json delete mode 100644 irc/kcpd/util.go delete mode 100644 irc/kcpd/vendor-log delete mode 100644 irc/kcpd/vendor/github.com/Xe/gopreload/doc.go delete mode 100644 irc/kcpd/vendor/github.com/Xe/gopreload/preload.go delete mode 100644 irc/kcpd/vendor/github.com/caarlos0/env/env.go delete mode 100644 irc/kcpd/vendor/github.com/google/gops/agent/agent.go delete mode 100644 irc/kcpd/vendor/github.com/google/gops/internal/internal.go delete mode 100644 irc/kcpd/vendor/github.com/google/gops/signal/signal.go delete mode 100644 irc/kcpd/vendor/github.com/joho/godotenv/autoload/autoload.go delete mode 100644 irc/kcpd/vendor/github.com/joho/godotenv/godotenv.go delete mode 100644 irc/kcpd/vendor/github.com/kardianos/osext/osext.go delete mode 100644 irc/kcpd/vendor/github.com/kardianos/osext/osext_plan9.go delete mode 100644 irc/kcpd/vendor/github.com/kardianos/osext/osext_procfs.go delete mode 100644 irc/kcpd/vendor/github.com/kardianos/osext/osext_sysctl.go delete mode 100644 irc/kcpd/vendor/github.com/kardianos/osext/osext_windows.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/cpuid/cpuid.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/cpuid/cpuid_amd64.s delete mode 100644 irc/kcpd/vendor/github.com/klauspost/cpuid/detect_intel.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/cpuid/detect_ref.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/cpuid/generate.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/cpuid/private-gen.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/galois.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/galois_amd64.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/galois_amd64.s delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/galois_noasm.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/gentables.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/inversion_tree.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/matrix.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/options.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/reedsolomon.go delete mode 100644 irc/kcpd/vendor/github.com/klauspost/reedsolomon/streaming.go delete mode 100644 irc/kcpd/vendor/github.com/pkg/errors/errors.go delete mode 100644 irc/kcpd/vendor/github.com/pkg/errors/stack.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/crypt.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/fec.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/kcp.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/sess.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/snmp.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/updater.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/kcp-go/xor.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/smux/frame.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/smux/mux.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/smux/session.go delete mode 100644 irc/kcpd/vendor/github.com/xtaci/smux/stream.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/blowfish/block.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/blowfish/cipher.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/blowfish/const.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/cast5/cast5.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/salsa20/salsa/salsa2020_amd64.s delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/salsa20/salsa20.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/tea/cipher.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/twofish/twofish.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/xtea/block.go delete mode 100644 irc/kcpd/vendor/golang.org/x/crypto/xtea/cipher.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/bpf/asm.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/bpf/constants.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/bpf/doc.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/bpf/instructions.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/bpf/vm.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/bpf/vm_instructions.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/internal/iana/const.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/internal/iana/gen.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/internal/netreflect/socket.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/internal/netreflect/socket_19.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/internal/netreflect/socket_posix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/internal/netreflect/socket_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/bpfopt_linux.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/bpfopt_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/control.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/control_bsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/control_pktinfo.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/control_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/control_unix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/control_windows.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_darwin.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_dragonfly.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_freebsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_linux.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_netbsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_openbsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/defs_solaris.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/dgramopt_posix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/dgramopt_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/doc.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/endpoint.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/gen.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/genericopt_posix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/genericopt_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/go19_test.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/header.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/helper.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/iana.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/icmp.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/icmp_linux.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/icmp_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/packet.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/payload.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/payload_cmsg.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/payload_nocmsg.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_asmreq.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_asmreq_posix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_asmreq_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_asmreqn_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_asmreqn_unix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_posix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_ssmreq_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_ssmreq_unix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sockopt_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_bsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_darwin.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_freebsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_linux.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_openbsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_solaris.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_stub.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/sys_windows.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/syscall_linux_386.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/syscall_solaris.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/syscall_unix.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/syscall_windows.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_darwin.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_386.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_netbsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_openbsd.go delete mode 100644 irc/kcpd/vendor/golang.org/x/net/ipv4/zsys_solaris.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/apic.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/decode.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/emitterc.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/encode.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/parserc.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/readerc.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/resolve.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/scannerc.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/sorter.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/writerc.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/yaml.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/yamlh.go delete mode 100644 irc/kcpd/vendor/gopkg.in/yaml.v1/yamlprivateh.go (limited to 'irc') diff --git a/irc/kcpd/.gitignore b/irc/kcpd/.gitignore deleted file mode 100644 index 31bb52e..0000000 --- a/irc/kcpd/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cfg \ No newline at end of file diff --git a/irc/kcpd/README.md b/irc/kcpd/README.md deleted file mode 100644 index 85e39ae..0000000 --- a/irc/kcpd/README.md +++ /dev/null @@ -1,4 +0,0 @@ -kcpd -==== - -A simple relay for multiplexing IRC sessions. Useful for bouncers or proxies. diff --git a/irc/kcpd/client.go b/irc/kcpd/client.go deleted file mode 100644 index 0f744dc..0000000 --- a/irc/kcpd/client.go +++ /dev/null @@ -1,93 +0,0 @@ -package main - -import ( - "crypto/tls" - "errors" - "io" - "net" - - kcp "github.com/xtaci/kcp-go" - "github.com/xtaci/smux" -) - -// Client opens a TCP listener and forwards traffic to the remote server over KCP. -type Client struct { - cfg *Config - - listener net.Listener -} - -// ErrBadConfig means the configuration is not correctly defined. -var ErrBadConfig = errors.New("kcpd: bad configuration file") - -// NewClient constructs a new client with a given config. -func NewClient(cfg *Config) (*Client, error) { - if cfg.Mode != "client" { - return nil, ErrBadConfig - } - - if cfg.ClientServerAddress == "" && cfg.ClientUsername == "" && cfg.ClientPassword == "" && cfg.ClientBindaddr == "" { - return nil, ErrBadConfig - } - - return &Client{cfg: cfg}, nil -} - -// Dial blockingly connects to the remote server and relays TCP traffic. -func (c *Client) Dial() error { - conn, err := kcp.Dial(c.cfg.ClientServerAddress) - if err != nil { - return err - } - defer conn.Close() - - tlsConn := tls.Client(conn, &tls.Config{ - InsecureSkipVerify: true, // XXX hack please remove - }) - defer tlsConn.Close() - - session, err := smux.Client(tlsConn, smux.DefaultConfig()) - if err != nil { - return err - } - defer session.Close() - - l, err := net.Listen("tcp", c.cfg.ClientBindaddr) - if err != nil { - return err - } - defer l.Close() - c.listener = l - - for { - cconn, err := l.Accept() - if err != nil { - break - } - - cstream, err := session.OpenStream() - if err != nil { - break - } - - go copyConn(cconn, cstream) - } - - return nil -} - -// Close frees resouces acquired in the client. -func (c *Client) Close() error { - return c.listener.Close() -} - -// copyConn copies one connection to another bidirectionally. -func copyConn(left, right net.Conn) error { - defer left.Close() - defer right.Close() - - go io.Copy(left, right) - io.Copy(right, left) - - return nil -} diff --git a/irc/kcpd/gopreload.go b/irc/kcpd/gopreload.go deleted file mode 100644 index 6829ae5..0000000 --- a/irc/kcpd/gopreload.go +++ /dev/null @@ -1,9 +0,0 @@ -// gopreload.go -package main - -/* - This file is separate to make it very easy to both add into an application, but - also very easy to remove. -*/ - -import _ "github.com/Xe/gopreload" diff --git a/irc/kcpd/gops.go b/irc/kcpd/gops.go deleted file mode 100644 index 184b656..0000000 --- a/irc/kcpd/gops.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import ( - "log" - - "github.com/google/gops/agent" -) - -func init() { - if err := agent.Listen(nil); err != nil { - log.Fatal(err) - } -} diff --git a/irc/kcpd/main.go b/irc/kcpd/main.go deleted file mode 100644 index 4ec913c..0000000 --- a/irc/kcpd/main.go +++ /dev/null @@ -1,110 +0,0 @@ -package main - -import ( - "flag" - "io/ioutil" - "log" - "os" - "time" - - "github.com/caarlos0/env" - _ "github.com/joho/godotenv/autoload" - yaml "gopkg.in/yaml.v1" -) - -// Config is the configuration for kcpd -type Config struct { - Mode string `env:"KCPD_MODE,required" envDefault:"server" yaml:"mode"` - - // Client mode config - - // What IP the client should connect to - ClientServerAddress string `env:"KCPD_SERVER_ADDRESS" yaml:"server"` - // Administrator's NickServ username - ClientUsername string `env:"KCPD_ADMIN_USERNAME" yaml:"admin_username"` - // Administrator's NickServ password - ClientPassword string `env:"KCPD_ADMIN_PASSWORD" yaml:"admin_password"` - // Local bindaddr - ClientBindaddr string `env:"KCPD_CLIENT_BINDADDR" yaml:"client_bind"` - - // Server mode config - - // What UDP port/address should kcpd bind on? - ServerBindAddr string `env:"KCPD_BIND" yaml:"bind"` - // Atheme URL for Nickserv authentication of the administrator for setting up KCP sessions - ServerAthemeURL string `env:"KCPD_ATHEME_URL" yaml:"atheme_url"` - // URL endpoint for allowing/denying users - ServerAllowListEndpoint string `env:"KCPD_ALLOWLIST_ENDPOINT" yaml:"allow_list_endpoint"` - // local ircd (unsecure) endpoint - ServerLocalIRCd string `env:"KCPD_LOCAL_IRCD" yaml:"local_ircd"` - // WEBIRC password to use for local sockets - ServerWEBIRCPassword string `env:"KCPD_WEBIRC_PASSWORD" yaml:"webirc_password"` - // ServerTLSCert is the TLS cert file - ServerTLSCert string `env:"KCPD_TLS_CERT" yaml:"tls_cert"` - // ServerTLSKey is the TLS key file - ServerTLSKey string `env:"KCPD_TLS_KEY" yaml:"tls_key"` -} - -var ( - configFname = flag.String("config", "", "configuration file to use (if unset config will be pulled from the environment)") -) - -func main() { - flag.Parse() - - cfg := &Config{} - - if *configFname != "" { - fin, err := os.Open(*configFname) - if err != nil { - log.Fatal(err) - } - defer fin.Close() - - data, err := ioutil.ReadAll(fin) - if err != nil { - log.Fatal(err) - } - - err = yaml.Unmarshal(data, cfg) - if err != nil { - log.Fatal(err) - } - } else { - err := env.Parse(cfg) - if err != nil { - log.Fatal(err) - } - } - - switch cfg.Mode { - case "client": - c, err := NewClient(cfg) - if err != nil { - log.Fatal(err) - } - - for { - err = c.Dial() - if err != nil { - log.Println(err) - } - - time.Sleep(time.Second) - } - - case "server": - s, err := NewServer(cfg) - if err != nil { - log.Fatal(err) - } - - err = s.ListenAndServe() - if err != nil { - log.Fatal(err) - } - - default: - log.Fatal(ErrBadConfig) - } -} diff --git a/irc/kcpd/server.go b/irc/kcpd/server.go deleted file mode 100644 index c44f040..0000000 --- a/irc/kcpd/server.go +++ /dev/null @@ -1,97 +0,0 @@ -package main - -import ( - "crypto/tls" - "fmt" - "log" - "net" - - kcp "github.com/xtaci/kcp-go" - "github.com/xtaci/smux" -) - -// Server represents the server side of kcpd. It listens on KCP and emits TCP connections from KCP streams. -type Server struct { - cfg *Config -} - -// NewServer creates a new Server and validates config. -func NewServer(cfg *Config) (*Server, error) { - if cfg.Mode != "server" { - return nil, ErrBadConfig - } - - if cfg.ServerBindAddr == "" && cfg.ServerAthemeURL == "" && cfg.ServerAllowListEndpoint == "" && cfg.ServerLocalIRCd == "" && cfg.ServerWEBIRCPassword == "" && cfg.ServerTLSCert == "" && cfg.ServerTLSKey == "" { - return nil, ErrBadConfig - } - - return &Server{cfg: cfg}, nil -} - -// ListenAndServe blockingly listens on the UDP port and relays KCP streams to TCP sockets. -func (s *Server) ListenAndServe() error { - l, err := kcp.Listen(s.cfg.ServerBindAddr) - if err != nil { - return err - } - defer l.Close() - - log.Printf("listening on KCP: %v", l.Addr()) - - for { - conn, err := l.Accept() - if err != nil { - log.Println(err) - continue - } - - go s.handleConn(conn) - } -} - -func (s *Server) handleConn(conn net.Conn) error { - defer conn.Close() - - log.Printf("new client: %v", conn.RemoteAddr()) - - cert, err := tls.LoadX509KeyPair(s.cfg.ServerTLSCert, s.cfg.ServerTLSKey) - if err != nil { - return err - } - - tcfg := &tls.Config{ - InsecureSkipVerify: true, // XXX hack remove - Certificates: []tls.Certificate{cert}, - } - - tlsConn := tls.Server(conn, tcfg) - defer tlsConn.Close() - - session, err := smux.Server(tlsConn, smux.DefaultConfig()) - if err != nil { - return err - } - defer session.Close() - - for { - cstream, err := session.AcceptStream() - if err != nil { - log.Printf("client at %s error: %v", conn.RemoteAddr(), err) - return err - } - - ircConn, err := net.Dial("tcp", s.cfg.ServerLocalIRCd) - if err != nil { - log.Printf("client at %s error: %v", conn.RemoteAddr(), err) - return err - } - - host, _, _ := net.SplitHostPort(conn.RemoteAddr().String()) - - fmt.Fprintf(ircConn, "WEBIRC %s %s %s %s\r\n", s.cfg.ServerWEBIRCPassword, RandStringRunes(8), host, host) - - go copyConn(cstream, ircConn) - } - - return nil -} diff --git a/irc/kcpd/stdlibsvc/README.md b/irc/kcpd/stdlibsvc/README.md deleted file mode 100644 index b378de4..0000000 --- a/irc/kcpd/stdlibsvc/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# Your stdlib service: xena/kcpdwhitelist - -This is the README for your service. - -A few notes; - -`package.json` is NPM-compatible and contains some stdlib configuration details. -`.gitignore` has also been provided for your convenience. - -# package.json - -This is a standard `package.json`. You'll notice an additional `"stdlib"` field. -You can configure your service for the stdlib registry using; - -`name` - The name to register on stdlib, in the format of `/`. -In order to compile to the registry you must have permission to compile to the -provided username's account. - -`defaultFunction` - Execute if provided no function route (root service). -If not specified, your base service route will provide a list of available -functions in JSON format. - -`timeout` - The time in ms at which to kill service execution. Free accounts are -limited to 30 seconds (30000). - -`publish` - Whether to publish releases (versioned) to the stdlib public - directory. Packages pushed to the registry in non-release environments will - never be published. - -# env.json - -Environment configuration for your service. Each top level key (i.e. - `"dev"` and `"release"`) specifies their own set of key-value - pairs for a specific execution environment. The keys and values specified - are automatically added to the `process.env` variable in Node.js. - -`"dev"` is the *non-configurable* name of the local environment, but can -also be used as an environment name for compilation -(i.e. `$ lib up development`). - -`"release"` is the *non-configurable* name of the production environment when -you create releases with `$ lib release`. - -You can add additional environments and key-value pairs, and use them for -compilation with `lib up `. Note that free accounts are -restricted to one compilation environment (aside from `"release"`). - -*We recommend against checking this file in to version control*. It will be -saved with your tarball and is privately retrievable from the stdlib registry -using your account credentials. It has been added to `.gitignore` by default. - -# f/main/function.json - -This is your function definition file. The following fields can be used for -execution configuration of specific functions within your service. - -`name` - The function name. This maps to an execution route over HTTP. For -example, `xena/kcpdwhitelist/main` would map to the first -function you've created. - -`description` - A brief description of the function. To provide detailed -information about function execution, overwrite this README. - -`args` - An `Array` describing each argument as you expect them to be passed to -`params.args`. - -`kwargs` - An `Object` describing each keyword argument as you expect them to be -passed to `params.kwargs` - -`http` - Information to provide to function requests over HTTP. - -`http.headers` - HTTP headers to return in the response. Examples are -`"Content-Type"` to specify file type if your function returns a `Buffer` or -`"Access-Control-Allow-Origin"` to restrict browser-based function requests. - -# f/main/index.js - -The entry point to your function described in `f/main/function.json`. -This is *non-configurable*. You may add as many subdirectories and supportive -files as you like, but `index.js` will remain the entry point and *must* -export a function to be active. diff --git a/irc/kcpd/stdlibsvc/env.json b/irc/kcpd/stdlibsvc/env.json deleted file mode 100644 index d8f72e9..0000000 --- a/irc/kcpd/stdlibsvc/env.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dev": { - "key": "value" - }, - "release": { - "key": "value" - } -} diff --git a/irc/kcpd/stdlibsvc/functions/main/function.json b/irc/kcpd/stdlibsvc/functions/main/function.json deleted file mode 100644 index 3fa3c9f..0000000 --- a/irc/kcpd/stdlibsvc/functions/main/function.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "main", - "description": "Function", - "args": [ - "First argument", - "Second argument" - ], - "kwargs": { - "alpha": "Keyword argument alpha", - "beta": "Keyword argument beta" - }, - "http": { - "headers": {} - } -} \ No newline at end of file diff --git a/irc/kcpd/stdlibsvc/functions/main/index.js b/irc/kcpd/stdlibsvc/functions/main/index.js deleted file mode 100644 index a843dd1..0000000 --- a/irc/kcpd/stdlibsvc/functions/main/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* Import dependencies, declare constants */ - -win = (callback) => { - callback(null, "allowed"); -}; - -fail = (callback) => { - callback("not allowed"); -}; - -/** -* Your function call -* @param {Object} params Execution parameters -* Members -* - {Array} args Arguments passed to function -* - {Object} kwargs Keyword arguments (key-value pairs) passed to function -* - {String} remoteAddress The IPv4 or IPv6 address of the caller -* -* @param {Function} callback Execute this to end the function call -* Arguments -* - {Error} error The error to show if function fails -* - {Any} returnValue JSON serializable (or Buffer) return value -*/ -module.exports = (params, callback) => { - switch (params.kwargs.user) { - case "Xena": - win(callback); - - default: - fail(callback); - } -}; diff --git a/irc/kcpd/stdlibsvc/package.json b/irc/kcpd/stdlibsvc/package.json deleted file mode 100644 index 7986c05..0000000 --- a/irc/kcpd/stdlibsvc/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "kcpdwhitelist", - "version": "0.0.2", - "description": "Service", - "author": "xena ", - "main": "functions/main/index.js", - "dependencies": {}, - "private": true, - "stdlib": { - "name": "xena/kcpdwhitelist", - "defaultFunction": "main", - "timeout": 10000, - "publish": true, - "personalize": { - "keys": [], - "user": [] - } - } -} diff --git a/irc/kcpd/util.go b/irc/kcpd/util.go deleted file mode 100644 index a2c7b3f..0000000 --- a/irc/kcpd/util.go +++ /dev/null @@ -1,21 +0,0 @@ -package main - -import ( - "math/rand" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") - -// RandStringRunes creates a new random string of length n. -func RandStringRunes(n int) string { - b := make([]rune, n) - for i := range b { - b[i] = letterRunes[rand.Intn(len(letterRunes))] - } - return string(b) -} diff --git a/irc/kcpd/vendor-log b/irc/kcpd/vendor-log deleted file mode 100644 index 190fa7e..0000000 --- a/irc/kcpd/vendor-log +++ /dev/null @@ -1,26 +0,0 @@ -9474f19b515f52326c7d197d2d097caa7fc7485e github.com/caarlos0/env -4ed13390c0acd2ff4e371e64d8b97c8954138243 github.com/joho/godotenv -4ed13390c0acd2ff4e371e64d8b97c8954138243 github.com/joho/godotenv/autoload -09cded8978dc9e80714c4d85b0322337b0a1e5e0 github.com/klauspost/cpuid -5abf0ee302ccf4834e84f63ff74eca3e8b88e4e2 github.com/klauspost/reedsolomon -ff09b135c25aae272398c51a07235b90a75aa4f0 github.com/pkg/errors -f75e45921594f847a073eb5637b01a8fe5d21e43 github.com/xtaci/kcp-go -a1a5df8f92af764f378f07d6a3dd8eb3f7aa190a github.com/xtaci/smux -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/blowfish -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/cast5 -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/pbkdf2 -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/salsa20 -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/salsa20/salsa -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/tea -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/twofish -459e26527287adbc2adcc5d0d49abff9a5f315a7 golang.org/x/crypto/xtea -ffcf1bedda3b04ebb15a168a59800a73d6dc0f4d golang.org/x/net/bpf -ffcf1bedda3b04ebb15a168a59800a73d6dc0f4d golang.org/x/net/internal/iana -ffcf1bedda3b04ebb15a168a59800a73d6dc0f4d golang.org/x/net/internal/netreflect -ffcf1bedda3b04ebb15a168a59800a73d6dc0f4d golang.org/x/net/ipv4 -9f9df34309c04878acc86042b16630b0f696e1de (dirty) gopkg.in/yaml.v1 -a00a8beb369cafd88bb7b32f31fc4ff3219c3565 github.com/Xe/gopreload -62f833fc9f6c4d3223bdb37bd0c2f8951bed8596 github.com/google/gops/agent -62f833fc9f6c4d3223bdb37bd0c2f8951bed8596 github.com/google/gops/internal -62f833fc9f6c4d3223bdb37bd0c2f8951bed8596 github.com/google/gops/signal -c2c54e542fb797ad986b31721e1baedf214ca413 github.com/kardianos/osext diff --git a/irc/kcpd/vendor/github.com/Xe/gopreload/doc.go b/irc/kcpd/vendor/github.com/Xe/gopreload/doc.go deleted file mode 100644 index 720c5c1..0000000 --- a/irc/kcpd/vendor/github.com/Xe/gopreload/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -/* -Package gopreload is a bit of a hack to emulate the behavior of LD_PRELOAD [ld-preload]. -This allows you to have automatically starting instrumentation, etc. - -[ld-preload]: http://man7.org/linux/man-pages/man8/ld.so.8.html (see LD_PRELOAD section) -*/ -package gopreload diff --git a/irc/kcpd/vendor/github.com/Xe/gopreload/preload.go b/irc/kcpd/vendor/github.com/Xe/gopreload/preload.go deleted file mode 100644 index 1b5a0c9..0000000 --- a/irc/kcpd/vendor/github.com/Xe/gopreload/preload.go +++ /dev/null @@ -1,26 +0,0 @@ -//+build linux,go1.8 - -package gopreload - -import ( - "log" - "os" - "plugin" - "strings" -) - -func init() { - gpv := os.Getenv("GO_PRELOAD") - if gpv == "" { - return - } - - for _, elem := range strings.Split(gpv, ",") { - log.Printf("gopreload: trying to open: %s", elem) - _, err := plugin.Open(elem) - if err != nil { - log.Printf("%v from GO_PRELOAD cannot be loaded: %v", elem, err) - continue - } - } -} diff --git a/irc/kcpd/vendor/github.com/caarlos0/env/env.go b/irc/kcpd/vendor/github.com/caarlos0/env/env.go deleted file mode 100644 index 25e5117..0000000 --- a/irc/kcpd/vendor/github.com/caarlos0/env/env.go +++ /dev/null @@ -1,275 +0,0 @@ -package env - -import ( - "errors" - "os" - "reflect" - "strconv" - "strings" - "time" -) - -var ( - // ErrNotAStructPtr is returned if you pass something that is not a pointer to a - // Struct to Parse - ErrNotAStructPtr = errors.New("Expected a pointer to a Struct") - // ErrUnsupportedType if the struct field type is not supported by env - ErrUnsupportedType = errors.New("Type is not supported") - // ErrUnsupportedSliceType if the slice element type is not supported by env - ErrUnsupportedSliceType = errors.New("Unsupported slice type") - // Friendly names for reflect types - sliceOfInts = reflect.TypeOf([]int(nil)) - sliceOfInt64s = reflect.TypeOf([]int64(nil)) - sliceOfStrings = reflect.TypeOf([]string(nil)) - sliceOfBools = reflect.TypeOf([]bool(nil)) - sliceOfFloat32s = reflect.TypeOf([]float32(nil)) - sliceOfFloat64s = reflect.TypeOf([]float64(nil)) -) - -// Parse parses a struct containing `env` tags and loads its values from -// environment variables. -func Parse(v interface{}) error { - ptrRef := reflect.ValueOf(v) - if ptrRef.Kind() != reflect.Ptr { - return ErrNotAStructPtr - } - ref := ptrRef.Elem() - if ref.Kind() != reflect.Struct { - return ErrNotAStructPtr - } - return doParse(ref) -} - -func doParse(ref reflect.Value) error { - refType := ref.Type() - for i := 0; i < refType.NumField(); i++ { - value, err := get(refType.Field(i)) - if err != nil { - return err - } - if value == "" { - continue - } - if err := set(ref.Field(i), refType.Field(i), value); err != nil { - return err - } - } - return nil -} - -func get(field reflect.StructField) (string, error) { - var ( - val string - err error - ) - - key, opts := parseKeyForOption(field.Tag.Get("env")) - - defaultValue := field.Tag.Get("envDefault") - val = getOr(key, defaultValue) - - if len(opts) > 0 { - for _, opt := range opts { - // The only option supported is "required". - switch opt { - case "": - break - case "required": - val, err = getRequired(key) - default: - err = errors.New("Env tag option " + opt + " not supported.") - } - } - } - - return val, err -} - -// split the env tag's key into the expected key and desired option, if any. -func parseKeyForOption(key string) (string, []string) { - opts := strings.Split(key, ",") - return opts[0], opts[1:] -} - -func getRequired(key string) (string, error) { - if value := os.Getenv(key); value != "" { - return value, nil - } - // We do not use fmt.Errorf to avoid another import. - return "", errors.New("Required environment variable " + key + " is not set") -} - -func getOr(key, defaultValue string) string { - value := os.Getenv(key) - if value != "" { - return value - } - return defaultValue -} - -func set(field reflect.Value, refType reflect.StructField, value string) error { - switch field.Kind() { - case reflect.Slice: - separator := refType.Tag.Get("envSeparator") - return handleSlice(field, value, separator) - case reflect.String: - field.SetString(value) - case reflect.Bool: - bvalue, err := strconv.ParseBool(value) - if err != nil { - return err - } - field.SetBool(bvalue) - case reflect.Int: - intValue, err := strconv.ParseInt(value, 10, 32) - if err != nil { - return err - } - field.SetInt(intValue) - case reflect.Float32: - v, err := strconv.ParseFloat(value, 32) - if err != nil { - return err - } - field.SetFloat(v) - case reflect.Float64: - v, err := strconv.ParseFloat(value, 64) - if err != nil { - return err - } - field.Set(reflect.ValueOf(v)) - case reflect.Int64: - if refType.Type.String() == "time.Duration" { - dValue, err := time.ParseDuration(value) - if err != nil { - return err - } - field.Set(reflect.ValueOf(dValue)) - } else { - intValue, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return err - } - field.SetInt(intValue) - } - default: - return ErrUnsupportedType - } - return nil -} - -func handleSlice(field reflect.Value, value, separator string) error { - if separator == "" { - separator = "," - } - - splitData := strings.Split(value, separator) - - switch field.Type() { - case sliceOfStrings: - field.Set(reflect.ValueOf(splitData)) - case sliceOfInts: - intData, err := parseInts(splitData) - if err != nil { - return err - } - field.Set(reflect.ValueOf(intData)) - case sliceOfInt64s: - int64Data, err := parseInt64s(splitData) - if err != nil { - return err - } - field.Set(reflect.ValueOf(int64Data)) - - case sliceOfFloat32s: - data, err := parseFloat32s(splitData) - if err != nil { - return err - } - field.Set(reflect.ValueOf(data)) - case sliceOfFloat64s: - data, err := parseFloat64s(splitData) - if err != nil { - return err - } - field.Set(reflect.ValueOf(data)) - case sliceOfBools: - boolData, err := parseBools(splitData) - if err != nil { - return err - } - field.Set(reflect.ValueOf(boolData)) - default: - return ErrUnsupportedSliceType - } - return nil -} - -func parseInts(data []string) ([]int, error) { - var intSlice []int - - for _, v := range data { - intValue, err := strconv.ParseInt(v, 10, 32) - if err != nil { - return nil, err - } - intSlice = append(intSlice, int(intValue)) - } - return intSlice, nil -} - - -func parseInt64s(data []string) ([]int64, error) { - var intSlice []int64 - - for _, v := range data { - intValue, err := strconv.ParseInt(v, 10, 64) - if err != nil { - return nil, err - } - intSlice = append(intSlice, int64(intValue)) - } - return intSlice, nil -} - - - -func parseFloat32s(data []string) ([]float32, error) { - var float32Slice []float32 - - for _, v := range data { - data, err := strconv.ParseFloat(v, 32) - if err != nil { - return nil, err - } - float32Slice = append(float32Slice, float32(data)) - } - return float32Slice, nil -} - -func parseFloat64s(data []string) ([]float64, error) { - var float64Slice []float64 - - for _, v := range data { - data, err := strconv.ParseFloat(v, 64) - if err != nil { - return nil, err - } - float64Slice = append(float64Slice, float64(data)) - } - return float64Slice, nil -} - -func parseBools(data []string) ([]bool, error) { - var boolSlice []bool - - for _, v := range data { - bvalue, err := strconv.ParseBool(v) - if err != nil { - return nil, err - } - - boolSlice = append(boolSlice, bvalue) - } - return boolSlice, nil -} diff --git a/irc/kcpd/vendor/github.com/google/gops/agent/agent.go b/irc/kcpd/vendor/github.com/google/gops/agent/agent.go deleted file mode 100644 index 5708391..0000000 --- a/irc/kcpd/vendor/github.com/google/gops/agent/agent.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package agent provides hooks programs can register to retrieve -// diagnostics data by using gops. -package agent - -import ( - "fmt" - "io" - "io/ioutil" - "net" - "os" - gosignal "os/signal" - "runtime" - "runtime/pprof" - "runtime/trace" - "strconv" - "sync" - "time" - - "bufio" - - "github.com/google/gops/internal" - "github.com/google/gops/signal" - "github.com/kardianos/osext" -) - -const defaultAddr = "127.0.0.1:0" - -var ( - mu sync.Mutex - portfile string - listener net.Listener - - units = []string{" bytes", "KB", "MB", "GB", "TB", "PB"} -) - -// Options allows configuring the started agent. -type Options struct { - // Addr is the host:port the agent will be listening at. - // Optional. - Addr string - - // NoShutdownCleanup tells the agent not to automatically cleanup - // resources if the running process receives an interrupt. - // Optional. - NoShutdownCleanup bool -} - -// Listen starts the gops agent on a host process. Once agent started, users -// can use the advanced gops features. The agent will listen to Interrupt -// signals and exit the process, if you need to perform further work on the -// Interrupt signal use the options parameter to configure the agent -// accordingly. -// -// Note: The agent exposes an endpoint via a TCP connection that can be used by -// any program on the system. Review your security requirements before starting -// the agent. -func Listen(opts *Options) error { - mu.Lock() - defer mu.Unlock() - - if opts == nil { - opts = &Options{} - } - if portfile != "" { - return fmt.Errorf("gops: agent already listening at: %v", listener.Addr()) - } - - gopsdir, err := internal.ConfigDir() - if err != nil { - return err - } - err = os.MkdirAll(gopsdir, os.ModePerm) - if err != nil { - return err - } - if !opts.NoShutdownCleanup { - gracefulShutdown() - } - - addr := opts.Addr - if addr == "" { - addr = defaultAddr - } - ln, err := net.Listen("tcp", addr) - if err != nil { - return err - } - listener = ln - port := listener.Addr().(*net.TCPAddr).Port - portfile = fmt.Sprintf("%s/%d", gopsdir, os.Getpid()) - err = ioutil.WriteFile(portfile, []byte(strconv.Itoa(port)), os.ModePerm) - if err != nil { - return err - } - - go listen() - return nil -} - -func listen() { - buf := make([]byte, 1) - for { - fd, err := listener.Accept() - if err != nil { - fmt.Fprintf(os.Stderr, "gops: %v", err) - if netErr, ok := err.(net.Error); ok && !netErr.Temporary() { - break - } - continue - } - if _, err := fd.Read(buf); err != nil { - fmt.Fprintf(os.Stderr, "gops: %v", err) - continue - } - if err := handle(fd, buf); err != nil { - fmt.Fprintf(os.Stderr, "gops: %v", err) - continue - } - fd.Close() - } -} - -func gracefulShutdown() { - c := make(chan os.Signal, 1) - gosignal.Notify(c, os.Interrupt) - go func() { - // cleanup the socket on shutdown. - <-c - Close() - os.Exit(1) - }() -} - -// Close closes the agent, removing temporary files and closing the TCP listener. -// If no agent is listening, Close does nothing. -func Close() { - mu.Lock() - defer mu.Unlock() - - if portfile != "" { - os.Remove(portfile) - portfile = "" - } - if listener != nil { - listener.Close() - } -} - -func formatBytes(val uint64) string { - var i int - var target uint64 - for i = range units { - target = 1 << uint(10*(i+1)) - if val < target { - break - } - } - if i > 0 { - return fmt.Sprintf("%0.2f%s (%d bytes)", float64(val)/(float64(target)/1024), units[i], val) - } - return fmt.Sprintf("%d bytes", val) -} - -func handle(conn io.Writer, msg []byte) error { - switch msg[0] { - case signal.StackTrace: - return pprof.Lookup("goroutine").WriteTo(conn, 2) - case signal.GC: - runtime.GC() - _, err := conn.Write([]byte("ok")) - return err - case signal.MemStats: - var s runtime.MemStats - runtime.ReadMemStats(&s) - fmt.Fprintf(conn, "alloc: %v\n", formatBytes(s.Alloc)) - fmt.Fprintf(conn, "total-alloc: %v\n", formatBytes(s.TotalAlloc)) - fmt.Fprintf(conn, "sys: %v\n", formatBytes(s.Sys)) - fmt.Fprintf(conn, "lookups: %v\n", s.Lookups) - fmt.Fprintf(conn, "mallocs: %v\n", s.Mallocs) - fmt.Fprintf(conn, "frees: %v\n", s.Frees) - fmt.Fprintf(conn, "heap-alloc: %v\n", formatBytes(s.HeapAlloc)) - fmt.Fprintf(conn, "heap-sys: %v\n", formatBytes(s.HeapSys)) - fmt.Fprintf(conn, "heap-idle: %v\n", formatBytes(s.HeapIdle)) - fmt.Fprintf(conn, "heap-in-use: %v\n", formatBytes(s.HeapInuse)) - fmt.Fprintf(conn, "heap-released: %v\n", formatBytes(s.HeapReleased)) - fmt.Fprintf(conn, "heap-objects: %v\n", s.HeapObjects) - fmt.Fprintf(conn, "stack-in-use: %v\n", formatBytes(s.StackInuse)) - fmt.Fprintf(conn, "stack-sys: %v\n", formatBytes(s.StackSys)) - fmt.Fprintf(conn, "next-gc: when heap-alloc >= %v\n", formatBytes(s.NextGC)) - lastGC := "-" - if s.LastGC != 0 { - lastGC = fmt.Sprint(time.Unix(0, int64(s.LastGC))) - } - fmt.Fprintf(conn, "last-gc: %v\n", lastGC) - fmt.Fprintf(conn, "gc-pause: %v\n", time.Duration(s.PauseTotalNs)) - fmt.Fprintf(conn, "num-gc: %v\n", s.NumGC) - fmt.Fprintf(conn, "enable-gc: %v\n", s.EnableGC) - fmt.Fprintf(conn, "debug-gc: %v\n", s.DebugGC) - case signal.Version: - fmt.Fprintf(conn, "%v\n", runtime.Version()) - case signal.HeapProfile: - pprof.WriteHeapProfile(conn) - case signal.CPUProfile: - if err := pprof.StartCPUProfile(conn); err != nil { - return err - } - time.Sleep(30 * time.Second) - pprof.StopCPUProfile() - case signal.Stats: - fmt.Fprintf(conn, "goroutines: %v\n", runtime.NumGoroutine()) - fmt.Fprintf(conn, "OS threads: %v\n", pprof.Lookup("threadcreate").Count()) - fmt.Fprintf(conn, "GOMAXPROCS: %v\n", runtime.GOMAXPROCS(0)) - fmt.Fprintf(conn, "num CPU: %v\n", runtime.NumCPU()) - case signal.BinaryDump: - path, err := osext.Executable() - if err != nil { - return err - } - f, err := os.Open(path) - if err != nil { - return err - } - defer f.Close() - - _, err = bufio.NewReader(f).WriteTo(conn) - return err - case signal.Trace: - trace.Start(conn) - time.Sleep(5 * time.Second) - trace.Stop() - } - return nil -} diff --git a/irc/kcpd/vendor/github.com/google/gops/internal/internal.go b/irc/kcpd/vendor/github.com/google/gops/internal/internal.go deleted file mode 100644 index 1382822..0000000 --- a/irc/kcpd/vendor/github.com/google/gops/internal/internal.go +++ /dev/null @@ -1,52 +0,0 @@ -package internal - -import ( - "errors" - "fmt" - "io/ioutil" - "os" - "os/user" - "path/filepath" - "runtime" - "strings" -) - -func ConfigDir() (string, error) { - if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "gops"), nil - } - homeDir := guessUnixHomeDir() - if homeDir == "" { - return "", errors.New("unable to get current user home directory: os/user lookup failed; $HOME is empty") - } - return filepath.Join(homeDir, ".config", "gops"), nil -} - -func guessUnixHomeDir() string { - usr, err := user.Current() - if err == nil { - return usr.HomeDir - } - return os.Getenv("HOME") -} - -func PIDFile(pid int) (string, error) { - gopsdir, err := ConfigDir() - if err != nil { - return "", err - } - return fmt.Sprintf("%s/%d", gopsdir, pid), nil -} - -func GetPort(pid int) (string, error) { - portfile, err := PIDFile(pid) - if err != nil { - return "", err - } - b, err := ioutil.ReadFile(portfile) - if err != nil { - return "", err - } - port := strings.TrimSpace(string(b)) - return port, nil -} diff --git a/irc/kcpd/vendor/github.com/google/gops/signal/signal.go b/irc/kcpd/vendor/github.com/google/gops/signal/signal.go deleted file mode 100644 index b2bfbe1..0000000 --- a/irc/kcpd/vendor/github.com/google/gops/signal/signal.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package signal contains signals used to communicate to the gops agents. -package signal - -const ( - // StackTrace represents a command to print stack trace. - StackTrace = byte(0x1) - - // GC runs the garbage collector. - GC = byte(0x2) - - // MemStats reports memory stats. - MemStats = byte(0x3) - - // Version prints the Go version. - Version = byte(0x4) - - // HeapProfile starts `go tool pprof` with the current memory profile. - HeapProfile = byte(0x5) - - // CPUProfile starts `go tool pprof` with the current CPU profile - CPUProfile = byte(0x6) - - // Stats returns Go runtime statistics such as number of goroutines, GOMAXPROCS, and NumCPU. - Stats = byte(0x7) - - // Trace starts the Go execution tracer, waits 5 seconds and launches the trace tool. - Trace = byte(0x8) - - // BinaryDump returns running binary file. - BinaryDump = byte(0x9) -) diff --git a/irc/kcpd/vendor/github.com/joho/godotenv/autoload/autoload.go b/irc/kcpd/vendor/github.com/joho/godotenv/autoload/autoload.go deleted file mode 100644 index fbcd2bd..0000000 --- a/irc/kcpd/vendor/github.com/joho/godotenv/autoload/autoload.go +++ /dev/null @@ -1,15 +0,0 @@ -package autoload - -/* - You can just read the .env file on import just by doing - - import _ "github.com/joho/godotenv/autoload" - - And bob's your mother's brother -*/ - -import "github.com/joho/godotenv" - -func init() { - godotenv.Load() -} diff --git a/irc/kcpd/vendor/github.com/joho/godotenv/godotenv.go b/irc/kcpd/vendor/github.com/joho/godotenv/godotenv.go deleted file mode 100644 index 94b2676..0000000 --- a/irc/kcpd/vendor/github.com/joho/godotenv/godotenv.go +++ /dev/null @@ -1,229 +0,0 @@ -// Package godotenv is a go port of the ruby dotenv library (https://github.com/bkeepers/dotenv) -// -// Examples/readme can be found on the github page at https://github.com/joho/godotenv -// -// The TL;DR is that you make a .env file that looks something like -// -// SOME_ENV_VAR=somevalue -// -// and then in your go code you can call -// -// godotenv.Load() -// -// and all the env vars declared in .env will be avaiable through os.Getenv("SOME_ENV_VAR") -package godotenv - -import ( - "bufio" - "errors" - "os" - "os/exec" - "strings" -) - -// Load will read your env file(s) and load them into ENV for this process. -// -// Call this function as close as possible to the start of your program (ideally in main) -// -// If you call Load without any args it will default to loading .env in the current path -// -// You can otherwise tell it which files to load (there can be more than one) like -// -// godotenv.Load("fileone", "filetwo") -// -// It's important to note that it WILL NOT OVERRIDE an env variable that already exists - consider the .env file to set dev vars or sensible defaults -func Load(filenames ...string) (err error) { - filenames = filenamesOrDefault(filenames) - - for _, filename := range filenames { - err = loadFile(filename, false) - if err != nil { - return // return early on a spazout - } - } - return -} - -// Overload will read your env file(s) and load them into ENV for this process. -// -// Call this function as close as possible to the start of your program (ideally in main) -// -// If you call Overload without any args it will default to loading .env in the current path -// -// You can otherwise tell it which files to load (there can be more than one) like -// -// godotenv.Overload("fileone", "filetwo") -// -// It's important to note this WILL OVERRIDE an env variable that already exists - consider the .env file to forcefilly set all vars. -func Overload(filenames ...string) (err error) { - filenames = filenamesOrDefault(filenames) - - for _, filename := range filenames { - err = loadFile(filename, true) - if err != nil { - return // return early on a spazout - } - } - return -} - -// Read all env (with same file loading semantics as Load) but return values as -// a map rather than automatically writing values into env -func Read(filenames ...string) (envMap map[string]string, err error) { - filenames = filenamesOrDefault(filenames) - envMap = make(map[string]string) - - for _, filename := range filenames { - individualEnvMap, individualErr := readFile(filename) - - if individualErr != nil { - err = individualErr - return // return early on a spazout - } - - for key, value := range individualEnvMap { - envMap[key] = value - } - } - - return -} - -// Exec loads env vars from the specified filenames (empty map falls back to default) -// then executes the cmd specified. -// -// Simply hooks up os.Stdin/err/out to the command and calls Run() -// -// If you want more fine grained control over your command it's recommended -// that you use `Load()` or `Read()` and the `os/exec` package yourself. -func Exec(filenames []string, cmd string, cmdArgs []string) error { - Load(filenames...) - - command := exec.Command(cmd, cmdArgs...) - command.Stdin = os.Stdin - command.Stdout = os.Stdout - command.Stderr = os.Stderr - return command.Run() -} - -func filenamesOrDefault(filenames []string) []string { - if len(filenames) == 0 { - return []string{".env"} - } - return filenames -} - -func loadFile(filename string, overload bool) error { - envMap, err := readFile(filename) - if err != nil { - return err - } - - for key, value := range envMap { - if os.Getenv(key) == "" || overload { - os.Setenv(key, value) - } - } - - return nil -} - -func readFile(filename string) (envMap map[string]string, err error) { - file, err := os.Open(filename) - if err != nil { - return - } - defer file.Close() - - envMap = make(map[string]string) - - var lines []string - scanner := bufio.NewScanner(file) - for scanner.Scan() { - lines = append(lines, scanner.Text()) - } - - for _, fullLine := range lines { - if !isIgnoredLine(fullLine) { - key, value, err := parseLine(fullLine) - - if err == nil { - envMap[key] = value - } - } - } - return -} - -func parseLine(line string) (key string, value string, err error) { - if len(line) == 0 { - err = errors.New("zero length string") - return - } - - // ditch the comments (but keep quoted hashes) - if strings.Contains(line, "#") { - segmentsBetweenHashes := strings.Split(line, "#") - quotesAreOpen := false - var segmentsToKeep []string - for _, segment := range segmentsBetweenHashes { - if strings.Count(segment, "\"") == 1 || strings.Count(segment, "'") == 1 { - if quotesAreOpen { - quotesAreOpen = false - segmentsToKeep = append(segmentsToKeep, segment) - } else { - quotesAreOpen = true - } - } - - if len(segmentsToKeep) == 0 || quotesAreOpen { - segmentsToKeep = append(segmentsToKeep, segment) - } - } - - line = strings.Join(segmentsToKeep, "#") - } - - // now split key from value - splitString := strings.SplitN(line, "=", 2) - - if len(splitString) != 2 { - // try yaml mode! - splitString = strings.SplitN(line, ":", 2) - } - - if len(splitString) != 2 { - err = errors.New("Can't separate key from value") - return - } - - // Parse the key - key = splitString[0] - if strings.HasPrefix(key, "export") { - key = strings.TrimPrefix(key, "export") - } - key = strings.Trim(key, " ") - - // Parse the value - value = splitString[1] - // trim - value = strings.Trim(value, " ") - - // check if we've got quoted values - if strings.Count(value, "\"") == 2 || strings.Count(value, "'") == 2 { - // pull the quotes off the edges - value = strings.Trim(value, "\"'") - - // expand quotes - value = strings.Replace(value, "\\\"", "\"", -1) - // expand newlines - value = strings.Replace(value, "\\n", "\n", -1) - } - - return -} - -func isIgnoredLine(line string) bool { - trimmedLine := strings.Trim(line, " \n\t") - return len(trimmedLine) == 0 || strings.HasPrefix(trimmedLine, "#") -} diff --git a/irc/kcpd/vendor/github.com/kardianos/osext/osext.go b/irc/kcpd/vendor/github.com/kardianos/osext/osext.go deleted file mode 100644 index 17f380f..0000000 --- a/irc/kcpd/vendor/github.com/kardianos/osext/osext.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Extensions to the standard "os" package. -package osext // import "github.com/kardianos/osext" - -import "path/filepath" - -var cx, ce = executableClean() - -func executableClean() (string, error) { - p, err := executable() - return filepath.Clean(p), err -} - -// Executable returns an absolute path that can be used to -// re-invoke the current program. -// It may not be valid after the current program exits. -func Executable() (string, error) { - return cx, ce -} - -// Returns same path as Executable, returns just the folder -// path. Excludes the executable name and any trailing slash. -func ExecutableFolder() (string, error) { - p, err := Executable() - if err != nil { - return "", err - } - - return filepath.Dir(p), nil -} diff --git a/irc/kcpd/vendor/github.com/kardianos/osext/osext_plan9.go b/irc/kcpd/vendor/github.com/kardianos/osext/osext_plan9.go deleted file mode 100644 index 655750c..0000000 --- a/irc/kcpd/vendor/github.com/kardianos/osext/osext_plan9.go +++ /dev/null @@ -1,20