Documentation ¶
Index ¶
- Constants
- func AppArmorProfile() string
- func CPUResource() (*api.ResourcesCPU, error)
- func CanonicalNetworkAddress(address string) string
- func CheckTrustState(cert x509.Certificate, trustedCerts []x509.Certificate) bool
- func EtagCheck(r *http.Request, data interface{}) error
- func EtagHash(data interface{}) (string, error)
- func FilesystemDetect(path string) (string, error)
- func GetArchitectures() ([]int, error)
- func GetExecPath() string
- func GetIdmapSet() *idmap.IdmapSet
- func GetListeners(start int) []net.Listener
- func HTTPClient(certificate string, proxy proxyFunc) (*http.Client, error)
- func IsRecursionRequest(r *http.Request) bool
- func ListenAddresses(value string) ([]string, error)
- func LoadModule(module string) error
- func MemoryResource() (*api.ResourcesMemory, error)
- func PasswordCheck(secret string, password string) error
- func RuntimeLiblxcVersionAtLeast(major int, minor int, micro int) bool
- func WriteJSON(w http.ResponseWriter, body interface{}, debug bool) error
- type ContextAwareRequest
Constants ¶
const ( FilesystemSuperMagicTmpfs = 0x01021994 FilesystemSuperMagicExt4 = 0xEF53 FilesystemSuperMagicXfs = 0x58465342 FilesystemSuperMagicNfs = 0x6969 FilesystemSuperMagicZfs = 0x2fc12fc1 )
Filesystem magic numbers
const (
// FilesystemSuperMagicBtrfs is the 64bit magic for Btrfs
FilesystemSuperMagicBtrfs = 0x9123683E
)
const SystemdListenFDsStart = 3
SystemdListenFDsStart is the number of the first file descriptor that might have been opened by systemd when socket activation is enabled. It's always 3 in real-world usage (i.e. the first file descriptor opened after stdin, stdout and stderr), so this constant should always be the value passed to GetListeners, except for unit tests.
Variables ¶
This section is empty.
Functions ¶
func AppArmorProfile ¶
func AppArmorProfile() string
AppArmorProfile returns the current apparmor profile.
func CPUResource ¶
func CPUResource() (*api.ResourcesCPU, error)
CPUResource returns the system CPU information
func CanonicalNetworkAddress ¶
CanonicalNetworkAddress parses the given network address and returns a string of the form "host:port", possibly filling it with the default port if it's missing.
func CheckTrustState ¶
func CheckTrustState(cert x509.Certificate, trustedCerts []x509.Certificate) bool
CheckTrustState checks whether the given client certificate is trusted (i.e. it has a valid time span and it belongs to the given list of trusted certificates).
func EtagCheck ¶
EtagCheck validates the hash of the current state with the hash provided by the client
func FilesystemDetect ¶
FilesystemDetect returns the filesystem on which the passed-in path sits.
func GetArchitectures ¶
GetArchitectures returns the list of supported architectures.
func GetListeners ¶
GetListeners returns the socket-activated network listeners, if any.
The 'start' parameter must be SystemdListenFDsStart, except in unit tests, see the docstring of SystemdListenFDsStart below.
func HTTPClient ¶
HTTPClient returns an http.Client using the given certificate and proxy.
func IsRecursionRequest ¶
IsRecursionRequest checks whether the given HTTP request is marked with the "recursion" flag in its form values.
func ListenAddresses ¶
ListenAddresses returns a list of host:port combinations at which this machine can be reached
func LoadModule ¶
LoadModule loads the kernel module with the given name, by invoking modprobe.
func MemoryResource ¶
func MemoryResource() (*api.ResourcesMemory, error)
MemoryResource returns the system memory information
func PasswordCheck ¶
PasswordCheck validates the provided password against the encoded secret
func RuntimeLiblxcVersionAtLeast ¶
RuntimeLiblxcVersionAtLeast checks if the system's liblxc matches the provided version requirement