Documentation ¶
Index ¶
- func AsUint16(val int) uint16
- func Constrain(val int, min int, max int) int
- func Constrain32(val int32, min int32, max int32) int32
- func DurWithin(val time.Duration, min time.Duration, max time.Duration) time.Duration
- func ExecCommand(command string, setpgid bool) *exec.Cmd
- func ExecCommandWith(shell string, command string, setpgid bool) *exec.Cmd
- func IsTty() bool
- func IsWindows() bool
- func KillCommand(cmd *exec.Cmd) error
- func Max(first int, second int) int
- func Max16(first int16, second int16) int16
- func Max32(first int32, second int32) int32
- func Min(first int, second int) int
- func Min32(first int32, second int32) int32
- func Once(nextResponse bool) func() bool
- func Read(fd int, b []byte) (int, error)
- func RunesWidth(runes []rune, prefixWidth int, tabstop int, limit int) (int, int)
- func SetNonblock(file *os.File, nonblock bool)
- func ToTty() bool
- func Truncate(input string, limit int) ([]rune, int)
- type AtomicBool
- type Chars
- func (chars *Chars) Bytes() []byte
- func (chars *Chars) CopyRunes(dest []rune)
- func (chars *Chars) Get(i int) rune
- func (chars *Chars) IsBytes() bool
- func (chars *Chars) LeadingWhitespaces() int
- func (chars *Chars) Length() int
- func (chars *Chars) Prepend(prefix string)
- func (chars *Chars) String() string
- func (chars *Chars) ToRunes() []rune
- func (chars *Chars) ToString() string
- func (chars *Chars) TrailingWhitespaces() int
- func (chars *Chars) TrimLength() uint16
- func (chars *Chars) TrimTrailingWhitespaces()
- type EventBox
- type EventType
- type Events
- type Slab
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Constrain32 ¶
Constrain32 limits the given 32-bit integer with the upper and lower bounds
func ExecCommand ¶
ExecCommand executes the given command with $SHELL
func ExecCommandWith ¶
ExecCommandWith executes the given command with the specified shell
func KillCommand ¶
KillCommand kills the process for the given command
func RunesWidth ¶
RunesWidth returns runes width
func SetNonblock ¶
SetNonblock executes syscall.SetNonblock on file descriptor
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
AtomicBool is a boxed-class that provides synchronized access to the underlying boolean value
func NewAtomicBool ¶
func NewAtomicBool(initialState bool) *AtomicBool
NewAtomicBool returns a new AtomicBool
func (*AtomicBool) Get ¶
func (a *AtomicBool) Get() bool
Get returns the current boolean value synchronously
func (*AtomicBool) Set ¶
func (a *AtomicBool) Set(newState bool) bool
Set updates the boolean value synchronously
type Chars ¶
type Chars struct { // XXX Piggybacking item index here is a horrible idea. But I'm trying to // minimize the memory footprint by not wasting padded spaces. Index int32 // contains filtered or unexported fields }
func RunesToChars ¶
func (*Chars) LeadingWhitespaces ¶
func (*Chars) TrailingWhitespaces ¶
func (*Chars) TrimLength ¶
TrimLength returns the length after trimming leading and trailing whitespaces
func (*Chars) TrimTrailingWhitespaces ¶
func (chars *Chars) TrimTrailingWhitespaces()
type EventBox ¶
type EventBox struct {
// contains filtered or unexported fields
}
EventBox is used for coordinating events