permvar

package
v0.0.0-...-d459dd1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package permvar implements the setting of persistent environment variables.

The environment variables must be named with only English capital letters and underscore (_) signs.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRoot = errors.New("you have to be Root")

Functions

func MSet

func MSet(keys, values []string) error

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

func MSetForUid(id int, keys, values []string) error

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

func MSetsys(keys, values []string) error

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

func MSetsysForUid(id int, keys, values []string) error

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

func Set(key, value string) error

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

func SetForUid(id int, key, value string) error

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

func Setsys(key, value string) error

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

func SetsysForUid(id int, key, value string) error

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

Jump to

Keyboard shortcuts

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