package env
import "github.com/tredoe/osutil/config/env"
Package env implements the setting of persistent environment variables.
The environment variables must be named with only English capital letters and underscore signs (_).
Index ¶
- Variables
- func MSet(keys, values []string) error
- func MSetForUid(id int, keys, values []string) error
- func MSetsys(keys, values []string) error
- func MSetsysForUid(id int, keys, values []string) error
- func Set(key, value string) error
- func SetForUid(id int, key, value string) error
- func Setsys(key, value string) error
- func SetsysForUid(id int, key, value string) error
- type NoHomeError
- type NoShellError
Variables ¶
Functions ¶
func MSet ¶
MSet sets multiple values of the environment variables named by the keys that affects the current user. It returns an error, if any.
func MSetForUid ¶
MSetForUid sets multiple values of the environment variables named by the keys that affects a particular user. It returns an error, if any.
func MSetsys ¶
MSetsys sets multiple values of the environment variables named by the keys that affects the system as a whole. You must be Root. It returns an error, if any.
func MSetsysForUid ¶
MSetsysForUid sets multiple values of the environment variables named by the keys that affects the system as a whole. You must be Root. It returns an error, if any.
func Set ¶
Set sets the value of the environment variable named by the key that affects the current user. It returns an error, if any.
func SetForUid ¶
SetForUid sets the value of the environment variable named by the key that affects a particular user. It returns an error, if any.
func Setsys ¶
Setsys sets the value of the environment variable named by the key that affects the system as a whole. You must be Root. It returns an error, if any.
func SetsysForUid ¶
SetsysForUid sets the value of the environment variable named by the key that affects the system as a whole. You must be Root. It returns an error, if any.
Types ¶
type NoHomeError ¶
type NoHomeError string
NoHomeError represents an account without home directory.
func (NoHomeError) Error ¶
func (e NoHomeError) Error() string
type NoShellError ¶
type NoShellError string
NoShellError represents an account without shell.
func (NoShellError) Error ¶
func (e NoShellError) Error() string
Source Files ¶
- Version
- v1.5.0 (latest)
- Published
- Jun 4, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 day ago –
Tools for package owners.