cap

package
v0.7.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cap implements inspections of OS capabilities.

Index

Constants

This section is empty.

Variables

View Source
var (
	CapWindows WindowsInterface
	CapTTY     TTYInterface
	CapSymlink SymlinkInterface
	CapGit     GitInterface
)

Instance of interface, which can be overridden for test by mocking.

Functions

func CanSymlink() bool

CanSymlink indicates whether symlink is available for current OS.

func GetRlimitNoFile

func GetRlimitNoFile() (uint64, error)

GetRlimitNoFile calls syscall to get RLIMIT_NOFILE.

func GitCanPushOptions

func GitCanPushOptions() bool

GitCanPushOptions indicates whether git can sent push options.

func IsWindows

func IsWindows() bool

IsWindows indicates whether current OS is windows.

func Isatty

func Isatty() bool

Isatty indicates whether program has a valid terminal attached.

Types

type GitInterface

type GitInterface interface {
	GitCanPushOptions() bool
}

GitInterface is the interface to implement Git related capabilities.

type SymlinkInterface

type SymlinkInterface interface {
	CanSymlink() bool
}

SymlinkInterface is the interface to implement CanSymink(), which indicates symlink is available on current OS.

type TTYInterface

type TTYInterface interface {
	Isatty() bool
}

TTYInterface is the interface to implement Isatty(), which checks whether a valid terminal is attached.

type WindowsInterface

type WindowsInterface interface {
	IsWindows() bool
}

WindowsInterface is the interface to implement IsWindows(), which checks whether current OS is Windows.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL