Movatterモバイル変換


[0]ホーム

URL:


usershell

package
v2.23.0Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:4Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcGet

func Get(usernamestring) (string,error)

Get returns the /etc/passwd entry for the username provided.Deprecated: use SystemEnvInfo.UserShell instead.

funcHomeDiradded inv2.21.0

func HomeDir() (string,error)

HomeDir returns the home directory of the current user, givingpriority to the $HOME environment variable.Deprecated: use EnvInfoer.HomeDir() instead.

Types

typeEnvInfoeradded inv2.21.0

type EnvInfoer interface {// User returns the current user.User() (*user.User,error)// Environ returns the environment variables of the current process.Environ() []string// HomeDir returns the home directory of the current user.HomeDir() (string,error)// Shell returns the shell of the given user.Shell(usernamestring) (string,error)// ModifyCommand modifies the command and arguments before execution based on// the environment. This is useful for executing a command inside a container.// In the default case, the command and arguments are returned unchanged.ModifyCommand(namestring, args ...string) (string, []string)}

EnvInfoer encapsulates external information about the environment.

typeSystemEnvInfoadded inv2.21.0

type SystemEnvInfo struct{}

SystemEnvInfo encapsulates the information about the environmentjust using the default Go implementations.

func (SystemEnvInfo)Environadded inv2.21.0

func (SystemEnvInfo) Environ() []string

func (SystemEnvInfo)HomeDiradded inv2.21.0

func (SystemEnvInfo) HomeDir() (string,error)

func (SystemEnvInfo)ModifyCommandadded inv2.21.0

func (SystemEnvInfo) ModifyCommand(namestring, args ...string) (string, []string)

func (SystemEnvInfo)Shelladded inv2.21.0

func (SystemEnvInfo) Shell(usernamestring) (string,error)

func (SystemEnvInfo)Useradded inv2.21.0

func (SystemEnvInfo) User() (*user.User,error)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp