utils

package
v0.0.0-...-1e97fd4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PasswdFile keeps user passwd information
	PasswdFile = "/etc/passwd"
	// GroupFile keeps group information
	GroupFile = "/etc/group"
)

Functions

func Get

func Get(passwdPath, groupPath, username string, groups []string) (uint32, uint32, []uint32, error)

Get accepts user and group slice, return valid uid, gid and additional gids. Through Get is a interface returns all user informations runtime-spec need.

func GetAdditionalGids

func GetAdditionalGids(groups []string) []uint32

GetAdditionalGids parse supplementary gids from slice groups.

func GetListener

func GetListener(addr string, tlsConfig *tls.Config) (net.Listener, error)

GetListener get a listener for an address.

func ParseID

func ParseID(file, str string, parserFilter filterFunc) (uint32, error)

ParseID parses id or name from given file.

func ParseString

func ParseString(line string, v ...interface{})

ParseString parses line in format a:b:c.

Types

This section is empty.

Jump to

Keyboard shortcuts

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