mirror of
https://github.com/containers/podman.git
synced 2025-09-10 15:46:07 +08:00
vendor: update everything
* If possible, update each dependency to the latest available version. * Use releases over commit IDs and avoid vendoring branches. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
21
vendor/github.com/buger/goterm/LICENSE
generated
vendored
Normal file
21
vendor/github.com/buger/goterm/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Leonid Bugaev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
10
vendor/github.com/buger/goterm/README.md
generated
vendored
10
vendor/github.com/buger/goterm/README.md
generated
vendored
@ -93,13 +93,13 @@ Chart example:
|
||||
chart := tm.NewLineChart(100, 20)
|
||||
|
||||
data := new(tm.DataTable)
|
||||
data.addColumn("Time")
|
||||
data.addColumn("Sin(x)")
|
||||
data.addColumn("Cos(x+1)")
|
||||
data.AddColumn("Time")
|
||||
data.AddColumn("Sin(x)")
|
||||
data.AddColumn("Cos(x+1)")
|
||||
|
||||
for i := 0.1; i < 10; i += 0.1 {
|
||||
data.addRow(i, math.Sin(i), math.Cos(i+1))
|
||||
}
|
||||
data.AddRow(i, math.Sin(i), math.Cos(i+1))
|
||||
}
|
||||
|
||||
tm.Println(chart.Draw(data))
|
||||
```
|
||||
|
8
vendor/github.com/buger/goterm/plot.go
generated
vendored
8
vendor/github.com/buger/goterm/plot.go
generated
vendored
@ -242,10 +242,10 @@ func (c *LineChart) DrawLine(x0, y0, x1, y1 int, symbol string) {
|
||||
}
|
||||
|
||||
func getBoundaryValues(data *DataTable, index int) (maxX, minX, maxY, minY float64) {
|
||||
maxX = data.rows[0][0]
|
||||
minX = data.rows[0][0]
|
||||
maxY = data.rows[0][1]
|
||||
minY = data.rows[0][1]
|
||||
maxX = math.Inf(-1)
|
||||
minX = math.Inf(1)
|
||||
maxY = math.Inf(-1)
|
||||
minY = math.Inf(1)
|
||||
|
||||
for _, r := range data.rows {
|
||||
maxX = math.Max(maxX, r[0])
|
||||
|
14
vendor/github.com/buger/goterm/terminal.go
generated
vendored
14
vendor/github.com/buger/goterm/terminal.go
generated
vendored
@ -27,7 +27,7 @@ const RESET = "\033[0m"
|
||||
// Reset to default color
|
||||
const RESET_COLOR = "\033[32m"
|
||||
|
||||
// Return curor to start of line and clean it
|
||||
// Return cursor to start of line and clean it
|
||||
const RESET_LINE = "\r\033[K"
|
||||
|
||||
// List of possible colors
|
||||
@ -68,10 +68,10 @@ type winsize struct {
|
||||
}
|
||||
|
||||
// Global screen buffer
|
||||
// Its not recommented write to buffer dirrectly, use package Print,Printf,Println fucntions instead.
|
||||
// Its not recommended write to buffer dirrectly, use package Print,Printf,Println fucntions instead.
|
||||
var Screen *bytes.Buffer = new(bytes.Buffer)
|
||||
|
||||
// Get relative or absolute coorditantes
|
||||
// Get relative or absolute coordinates
|
||||
// To get relative, set PCT flag to number:
|
||||
//
|
||||
// // Get 10% of total width to `x` and 20 to y
|
||||
@ -113,7 +113,7 @@ func Clear() {
|
||||
|
||||
// Move cursor to given position
|
||||
func MoveCursor(x int, y int) {
|
||||
fmt.Fprintf(Screen, "\033[%d;%dH", x, y)
|
||||
fmt.Fprintf(Screen, "\033[%d;%dH", y, x)
|
||||
}
|
||||
|
||||
// Move cursor up relative the current position
|
||||
@ -148,7 +148,7 @@ func MoveTo(str string, x int, y int) (out string) {
|
||||
// Return carrier to start of line
|
||||
func ResetLine(str string) (out string) {
|
||||
return applyTransform(str, func(idx int, line string) string {
|
||||
return fmt.Sprintf(RESET_LINE, line)
|
||||
return fmt.Sprintf("%s%s", RESET_LINE, line)
|
||||
})
|
||||
}
|
||||
|
||||
@ -215,12 +215,12 @@ func CurrentHeight() int {
|
||||
|
||||
// Flush buffer and ensure that it will not overflow screen
|
||||
func Flush() {
|
||||
for idx, str := range strings.Split(Screen.String(), "\n") {
|
||||
for idx, str := range strings.SplitAfter(Screen.String(), "\n") {
|
||||
if idx > Height() {
|
||||
return
|
||||
}
|
||||
|
||||
Output.WriteString(str + "\n")
|
||||
Output.WriteString(str)
|
||||
}
|
||||
|
||||
Output.Flush()
|
||||
|
28
vendor/github.com/buger/goterm/terminal_sysioctl.go
generated
vendored
28
vendor/github.com/buger/goterm/terminal_sysioctl.go
generated
vendored
@ -3,34 +3,16 @@
|
||||
package goterm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func getWinsize() (*winsize, error) {
|
||||
ws := new(winsize)
|
||||
func getWinsize() (*unix.Winsize, error) {
|
||||
|
||||
var _TIOCGWINSZ int64
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
_TIOCGWINSZ = 0x5413
|
||||
case "darwin":
|
||||
_TIOCGWINSZ = 1074295912
|
||||
ws, err := unix.IoctlGetWinsize(int(os.Stdout.Fd()), unix.TIOCGWINSZ)
|
||||
if err != nil {
|
||||
return nil, os.NewSyscallError("GetWinsize", err)
|
||||
}
|
||||
|
||||
r1, _, errno := syscall.Syscall(syscall.SYS_IOCTL,
|
||||
uintptr(syscall.Stdin),
|
||||
uintptr(_TIOCGWINSZ),
|
||||
uintptr(unsafe.Pointer(ws)),
|
||||
)
|
||||
|
||||
if int(r1) == -1 {
|
||||
fmt.Println("Error:", os.NewSyscallError("GetWinsize", errno))
|
||||
return nil, os.NewSyscallError("GetWinsize", errno)
|
||||
}
|
||||
return ws, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user