util

package
v0.0.0-...-8dc4a41 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilesystemSuperMagicTmpfs = 0x01021994
	FilesystemSuperMagicExt4  = 0xEF53
	FilesystemSuperMagicXfs   = 0x58465342
	FilesystemSuperMagicNfs   = 0x6969
	FilesystemSuperMagicZfs   = 0x2fc12fc1
)

Filesystem magic numbers

View Source
const (
	FilesystemSuperMagicBtrfs = 0x9123683E
)

Variables

This section is empty.

Functions

func FilesystemDetect

func FilesystemDetect(path string) (string, error)

FilesystemDetect returns the filesystem on which the passed-in path sits.

func GetArchitectures

func GetArchitectures() ([]int, error)

GetArchitectures returns the list of supported architectures.

func GetIdmapSet

func GetIdmapSet() *idmap.IdmapSet

GetIdmapSet reads the uid/gid allocation.

func GetListeners

func GetListeners() []net.Listener

func HTTPClient

func HTTPClient(certificate string, proxy proxyFunc) (*http.Client, error)

HTTPClient returns an http.Client using the given certificate and proxy.

func IsRecursionRequest

func IsRecursionRequest(r *http.Request) bool

IsRecursionRequest checks whether the given HTTP request is marked with the "recursion" flag in its form values.

func IsTrustedClient

func IsTrustedClient(r *http.Request, trustedCerts []x509.Certificate) bool

IsTrustedClient checks if the given HTTP request comes from a trusted client (i.e. either it's received via Unix socket, or via TLS with a trusted certificate).

func ListenAddresses

func ListenAddresses(value string) ([]string, error)

func LoadModule

func LoadModule(module string) error

LoadModule loads the kernel module with the given name, by invoking modprobe.

func PasswordCheck

func PasswordCheck(secret, password string) error

func WriteJSON

func WriteJSON(w http.ResponseWriter, body interface{}, debug bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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