go vendor
This commit is contained in:
13
vendor/github.com/inconshreveable/log15/LICENSE
generated
vendored
Normal file
13
vendor/github.com/inconshreveable/log15/LICENSE
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
Copyright 2014 Alan Shreve
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
21
vendor/github.com/inconshreveable/log15/term/LICENSE
generated
vendored
Normal file
21
vendor/github.com/inconshreveable/log15/term/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Simon Eskildsen
|
||||
|
||||
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.
|
5
vendor/github.com/inconshreveable/log15/term/doc.go
generated
vendored
Normal file
5
vendor/github.com/inconshreveable/log15/term/doc.go
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Package term provides utilities for working with terminals.
|
||||
//
|
||||
// Deprecated: This package is no longer used by log15. Please use
|
||||
// github.com/mattn/go-isatty instead.
|
||||
package term
|
13
vendor/github.com/inconshreveable/log15/term/terminal_appengine.go
generated
vendored
Normal file
13
vendor/github.com/inconshreveable/log15/term/terminal_appengine.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Based on ssh/terminal:
|
||||
// Copyright 2013 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.
|
||||
|
||||
// +build appengine
|
||||
|
||||
package term
|
||||
|
||||
// IsTty always returns false on AppEngine.
|
||||
func IsTty(fd uintptr) bool {
|
||||
return false
|
||||
}
|
15
vendor/github.com/inconshreveable/log15/term/terminal_darwin.go
generated
vendored
Normal file
15
vendor/github.com/inconshreveable/log15/term/terminal_darwin.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// Based on ssh/terminal:
|
||||
// Copyright 2013 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.
|
||||
// +build !appengine
|
||||
|
||||
package term
|
||||
|
||||
import "syscall"
|
||||
|
||||
const ioctlReadTermios = syscall.TIOCGETA
|
||||
|
||||
// Termios functions describe a general terminal interface that is
|
||||
// provided to control asynchronous communications ports.
|
||||
type Termios syscall.Termios
|
20
vendor/github.com/inconshreveable/log15/term/terminal_freebsd.go
generated
vendored
Normal file
20
vendor/github.com/inconshreveable/log15/term/terminal_freebsd.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
package term
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const ioctlReadTermios = syscall.TIOCGETA
|
||||
|
||||
// Termios functions describe a general terminal interface that is
|
||||
// provided to control asynchronous communications ports.
|
||||
// Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin.
|
||||
type Termios struct {
|
||||
Iflag uint32
|
||||
Oflag uint32
|
||||
Cflag uint32
|
||||
Lflag uint32
|
||||
Cc [20]uint8
|
||||
Ispeed uint32
|
||||
Ospeed uint32
|
||||
}
|
16
vendor/github.com/inconshreveable/log15/term/terminal_linux.go
generated
vendored
Normal file
16
vendor/github.com/inconshreveable/log15/term/terminal_linux.go
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Based on ssh/terminal:
|
||||
// Copyright 2013 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.
|
||||
|
||||
// +build !appengine
|
||||
|
||||
package term
|
||||
|
||||
import "syscall"
|
||||
|
||||
const ioctlReadTermios = syscall.TCGETS
|
||||
|
||||
// Termios functions describe a general terminal interface that is
|
||||
// provided to control asynchronous communications ports.
|
||||
type Termios syscall.Termios
|
9
vendor/github.com/inconshreveable/log15/term/terminal_netbsd.go
generated
vendored
Normal file
9
vendor/github.com/inconshreveable/log15/term/terminal_netbsd.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package term
|
||||
|
||||
import "syscall"
|
||||
|
||||
const ioctlReadTermios = syscall.TIOCGETA
|
||||
|
||||
// Termios functions describe a general terminal interface that is
|
||||
// provided to control asynchronous communications ports.
|
||||
type Termios syscall.Termios
|
20
vendor/github.com/inconshreveable/log15/term/terminal_notwindows.go
generated
vendored
Normal file
20
vendor/github.com/inconshreveable/log15/term/terminal_notwindows.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Based on ssh/terminal:
|
||||
// Copyright 2011 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.
|
||||
|
||||
// +build linux,!appengine darwin freebsd openbsd netbsd
|
||||
|
||||
package term
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// IsTty returns true if the given file descriptor is a terminal.
|
||||
func IsTty(fd uintptr) bool {
|
||||
var termios Termios
|
||||
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
|
||||
return err == 0
|
||||
}
|
9
vendor/github.com/inconshreveable/log15/term/terminal_openbsd.go
generated
vendored
Normal file
9
vendor/github.com/inconshreveable/log15/term/terminal_openbsd.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package term
|
||||
|
||||
import "syscall"
|
||||
|
||||
const ioctlReadTermios = syscall.TIOCGETA
|
||||
|
||||
// Termios functions describe a general terminal interface that is
|
||||
// provided to control asynchronous communications ports.
|
||||
type Termios syscall.Termios
|
9
vendor/github.com/inconshreveable/log15/term/terminal_solaris.go
generated
vendored
Normal file
9
vendor/github.com/inconshreveable/log15/term/terminal_solaris.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package term
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
// IsTty returns true if the given file descriptor is a terminal.
|
||||
func IsTty(fd uintptr) bool {
|
||||
_, err := unix.IoctlGetTermios(int(fd), unix.TCGETA)
|
||||
return err == nil
|
||||
}
|
26
vendor/github.com/inconshreveable/log15/term/terminal_windows.go
generated
vendored
Normal file
26
vendor/github.com/inconshreveable/log15/term/terminal_windows.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// Based on ssh/terminal:
|
||||
// Copyright 2011 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.
|
||||
|
||||
// +build windows
|
||||
|
||||
package term
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var kernel32 = syscall.NewLazyDLL("kernel32.dll")
|
||||
|
||||
var (
|
||||
procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
|
||||
)
|
||||
|
||||
// IsTty returns true if the given file descriptor is a terminal.
|
||||
func IsTty(fd uintptr) bool {
|
||||
var st uint32
|
||||
r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0)
|
||||
return r != 0 && e == 0
|
||||
}
|
Reference in New Issue
Block a user