mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rebase: vendor files required for kmip
Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
15
vendor/github.com/mattn/go-colorable/.travis.yml
generated
vendored
15
vendor/github.com/mattn/go-colorable/.travis.yml
generated
vendored
@ -1,15 +0,0 @@
|
||||
language: go
|
||||
sudo: false
|
||||
go:
|
||||
- 1.13.x
|
||||
- tip
|
||||
|
||||
before_install:
|
||||
- go get -t -v ./...
|
||||
|
||||
script:
|
||||
- ./go.test.sh
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
2
vendor/github.com/mattn/go-colorable/README.md
generated
vendored
2
vendor/github.com/mattn/go-colorable/README.md
generated
vendored
@ -1,6 +1,6 @@
|
||||
# go-colorable
|
||||
|
||||
[](https://travis-ci.org/mattn/go-colorable)
|
||||
[](https://github.com/mattn/go-colorable/actions?query=workflow%3Atest)
|
||||
[](https://codecov.io/gh/mattn/go-colorable)
|
||||
[](http://godoc.org/github.com/mattn/go-colorable)
|
||||
[](https://goreportcard.com/report/mattn/go-colorable)
|
||||
|
1
vendor/github.com/mattn/go-colorable/colorable_appengine.go
generated
vendored
1
vendor/github.com/mattn/go-colorable/colorable_appengine.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build appengine
|
||||
// +build appengine
|
||||
|
||||
package colorable
|
||||
|
4
vendor/github.com/mattn/go-colorable/colorable_others.go
generated
vendored
4
vendor/github.com/mattn/go-colorable/colorable_others.go
generated
vendored
@ -1,5 +1,5 @@
|
||||
// +build !windows
|
||||
// +build !appengine
|
||||
//go:build !windows && !appengine
|
||||
// +build !windows,!appengine
|
||||
|
||||
package colorable
|
||||
|
||||
|
42
vendor/github.com/mattn/go-colorable/colorable_windows.go
generated
vendored
42
vendor/github.com/mattn/go-colorable/colorable_windows.go
generated
vendored
@ -1,5 +1,5 @@
|
||||
// +build windows
|
||||
// +build !appengine
|
||||
//go:build windows && !appengine
|
||||
// +build windows,!appengine
|
||||
|
||||
package colorable
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
@ -27,6 +28,7 @@ const (
|
||||
backgroundRed = 0x40
|
||||
backgroundIntensity = 0x80
|
||||
backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity)
|
||||
commonLvbUnderscore = 0x8000
|
||||
|
||||
cENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4
|
||||
)
|
||||
@ -93,6 +95,7 @@ type Writer struct {
|
||||
oldattr word
|
||||
oldpos coord
|
||||
rest bytes.Buffer
|
||||
mutex sync.Mutex
|
||||
}
|
||||
|
||||
// NewColorable returns new instance of Writer which handles escape sequence from File.
|
||||
@ -432,6 +435,8 @@ func atoiWithDefault(s string, def int) (int, error) {
|
||||
|
||||
// Write writes data on console
|
||||
func (w *Writer) Write(data []byte) (n int, err error) {
|
||||
w.mutex.Lock()
|
||||
defer w.mutex.Unlock()
|
||||
var csbi consoleScreenBufferInfo
|
||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||
|
||||
@ -447,18 +452,22 @@ func (w *Writer) Write(data []byte) (n int, err error) {
|
||||
} else {
|
||||
er = bytes.NewReader(data)
|
||||
}
|
||||
var bw [1]byte
|
||||
var plaintext bytes.Buffer
|
||||
loop:
|
||||
for {
|
||||
c1, err := er.ReadByte()
|
||||
if err != nil {
|
||||
plaintext.WriteTo(w.out)
|
||||
break loop
|
||||
}
|
||||
if c1 != 0x1b {
|
||||
bw[0] = c1
|
||||
w.out.Write(bw[:])
|
||||
plaintext.WriteByte(c1)
|
||||
continue
|
||||
}
|
||||
_, err = plaintext.WriteTo(w.out)
|
||||
if err != nil {
|
||||
break loop
|
||||
}
|
||||
c2, err := er.ReadByte()
|
||||
if err != nil {
|
||||
break loop
|
||||
@ -683,14 +692,19 @@ loop:
|
||||
switch {
|
||||
case n == 0 || n == 100:
|
||||
attr = w.oldattr
|
||||
case 1 <= n && n <= 5:
|
||||
case n == 4:
|
||||
attr |= commonLvbUnderscore
|
||||
case (1 <= n && n <= 3) || n == 5:
|
||||
attr |= foregroundIntensity
|
||||
case n == 7:
|
||||
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
||||
case n == 22 || n == 25:
|
||||
attr |= foregroundIntensity
|
||||
case n == 27:
|
||||
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
||||
case n == 7 || n == 27:
|
||||
attr =
|
||||
(attr &^ (foregroundMask | backgroundMask)) |
|
||||
((attr & foregroundMask) << 4) |
|
||||
((attr & backgroundMask) >> 4)
|
||||
case n == 22:
|
||||
attr &^= foregroundIntensity
|
||||
case n == 24:
|
||||
attr &^= commonLvbUnderscore
|
||||
case 30 <= n && n <= 37:
|
||||
attr &= backgroundMask
|
||||
if (n-30)&1 != 0 {
|
||||
@ -709,7 +723,7 @@ loop:
|
||||
n256setup()
|
||||
}
|
||||
attr &= backgroundMask
|
||||
attr |= n256foreAttr[n256]
|
||||
attr |= n256foreAttr[n256%len(n256foreAttr)]
|
||||
i += 2
|
||||
}
|
||||
} else if len(token) == 5 && token[i+1] == "2" {
|
||||
@ -751,7 +765,7 @@ loop:
|
||||
n256setup()
|
||||
}
|
||||
attr &= foregroundMask
|
||||
attr |= n256backAttr[n256]
|
||||
attr |= n256backAttr[n256%len(n256backAttr)]
|
||||
i += 2
|
||||
}
|
||||
} else if len(token) == 5 && token[i+1] == "2" {
|
||||
|
12
vendor/github.com/mattn/go-colorable/noncolorable.go
generated
vendored
12
vendor/github.com/mattn/go-colorable/noncolorable.go
generated
vendored
@ -18,18 +18,22 @@ func NewNonColorable(w io.Writer) io.Writer {
|
||||
// Write writes data on console
|
||||
func (w *NonColorable) Write(data []byte) (n int, err error) {
|
||||
er := bytes.NewReader(data)
|
||||
var bw [1]byte
|
||||
var plaintext bytes.Buffer
|
||||
loop:
|
||||
for {
|
||||
c1, err := er.ReadByte()
|
||||
if err != nil {
|
||||
plaintext.WriteTo(w.out)
|
||||
break loop
|
||||
}
|
||||
if c1 != 0x1b {
|
||||
bw[0] = c1
|
||||
w.out.Write(bw[:])
|
||||
plaintext.WriteByte(c1)
|
||||
continue
|
||||
}
|
||||
_, err = plaintext.WriteTo(w.out)
|
||||
if err != nil {
|
||||
break loop
|
||||
}
|
||||
c2, err := er.ReadByte()
|
||||
if err != nil {
|
||||
break loop
|
||||
@ -38,7 +42,6 @@ loop:
|
||||
continue
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
for {
|
||||
c, err := er.ReadByte()
|
||||
if err != nil {
|
||||
@ -47,7 +50,6 @@ loop:
|
||||
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
|
||||
break
|
||||
}
|
||||
buf.Write([]byte(string(c)))
|
||||
}
|
||||
}
|
||||
|
||||
|
14
vendor/github.com/mattn/go-isatty/.travis.yml
generated
vendored
14
vendor/github.com/mattn/go-isatty/.travis.yml
generated
vendored
@ -1,14 +0,0 @@
|
||||
language: go
|
||||
sudo: false
|
||||
go:
|
||||
- 1.13.x
|
||||
- tip
|
||||
|
||||
before_install:
|
||||
- go get -t -v ./...
|
||||
|
||||
script:
|
||||
- ./go.test.sh
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
1
vendor/github.com/mattn/go-isatty/isatty_bsd.go
generated
vendored
1
vendor/github.com/mattn/go-isatty/isatty_bsd.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build (darwin || freebsd || openbsd || netbsd || dragonfly) && !appengine
|
||||
// +build darwin freebsd openbsd netbsd dragonfly
|
||||
// +build !appengine
|
||||
|
||||
|
3
vendor/github.com/mattn/go-isatty/isatty_others.go
generated
vendored
3
vendor/github.com/mattn/go-isatty/isatty_others.go
generated
vendored
@ -1,4 +1,5 @@
|
||||
// +build appengine js nacl
|
||||
//go:build appengine || js || nacl || wasm
|
||||
// +build appengine js nacl wasm
|
||||
|
||||
package isatty
|
||||
|
||||
|
1
vendor/github.com/mattn/go-isatty/isatty_plan9.go
generated
vendored
1
vendor/github.com/mattn/go-isatty/isatty_plan9.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build plan9
|
||||
// +build plan9
|
||||
|
||||
package isatty
|
||||
|
9
vendor/github.com/mattn/go-isatty/isatty_solaris.go
generated
vendored
9
vendor/github.com/mattn/go-isatty/isatty_solaris.go
generated
vendored
@ -1,5 +1,5 @@
|
||||
// +build solaris
|
||||
// +build !appengine
|
||||
//go:build solaris && !appengine
|
||||
// +build solaris,!appengine
|
||||
|
||||
package isatty
|
||||
|
||||
@ -8,10 +8,9 @@ import (
|
||||
)
|
||||
|
||||
// IsTerminal returns true if the given file descriptor is a terminal.
|
||||
// see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c
|
||||
// see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c
|
||||
func IsTerminal(fd uintptr) bool {
|
||||
var termio unix.Termio
|
||||
err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)
|
||||
_, err := unix.IoctlGetTermio(int(fd), unix.TCGETA)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
|
3
vendor/github.com/mattn/go-isatty/isatty_tcgets.go
generated
vendored
3
vendor/github.com/mattn/go-isatty/isatty_tcgets.go
generated
vendored
@ -1,4 +1,5 @@
|
||||
// +build linux aix
|
||||
//go:build (linux || aix || zos) && !appengine
|
||||
// +build linux aix zos
|
||||
// +build !appengine
|
||||
|
||||
package isatty
|
||||
|
6
vendor/github.com/mattn/go-isatty/isatty_windows.go
generated
vendored
6
vendor/github.com/mattn/go-isatty/isatty_windows.go
generated
vendored
@ -1,5 +1,5 @@
|
||||
// +build windows
|
||||
// +build !appengine
|
||||
//go:build windows && !appengine
|
||||
// +build windows,!appengine
|
||||
|
||||
package isatty
|
||||
|
||||
@ -76,7 +76,7 @@ func isCygwinPipeName(name string) bool {
|
||||
}
|
||||
|
||||
// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
|
||||
// since GetFileInformationByHandleEx is not avilable under windows Vista and still some old fashion
|
||||
// since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion
|
||||
// guys are using Windows XP, this is a workaround for those guys, it will also work on system from
|
||||
// Windows vista to 10
|
||||
// see https://stackoverflow.com/a/18792477 for details
|
||||
|
8
vendor/github.com/mattn/go-isatty/renovate.json
generated
vendored
8
vendor/github.com/mattn/go-isatty/renovate.json
generated
vendored
@ -1,8 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"postUpdateOptions": [
|
||||
"gomodTidy"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user