mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-22 19:08:07 +00:00
* simv2: wip * simulation: exec adapter start/stop * simulation: add node status to exec adapter * simulation: initial simulation code * simulation: exec adapter, configure path to executable * simulation: initial docker adapter * simulation: wip kubernetes adapter * simulation: kubernetes adapter proxy * simulation: implement GetAll/StartAll/StopAll * simulation: kuberentes adapter - set env vars and resource limits * simulation: discovery test * simulation: remove port definitions within docker adapter * simulation: simplify wait for healthy loop * simulation: get nat ip addr from interface * simulation: pull docker images automatically * simulation: NodeStatus -> NodeInfo * simulation: move discovery test to example dir * simulation: example snapshot usage * simulation: add goclient specific simulation * simulation: add peer connections to snapshot * simulation: close rpc client * simulation: don't export kubernetes proxy server * simulation: merge simulation code * simulation: don't export nodemap * simulation: rename SimulationSnapshot -> Snapshot * simulation: linting fixes * simulation: add k8s available helper func * simulation: vendor * simulation: fix 'no non-test Go files' when building * simulation: remove errors from interface methods where non were returned * simulation: run getHealthInfo check in parallel
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package user
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
// The current operating system does not provide the required data for user lookups.
|
|
ErrUnsupported = errors.New("user lookup: operating system does not provide passwd-formatted data")
|
|
// No matching entries found in file.
|
|
ErrNoPasswdEntries = errors.New("no matching entries in passwd file")
|
|
ErrNoGroupEntries = errors.New("no matching entries in group file")
|
|
)
|
|
|
|
// LookupUser looks up a user by their username in /etc/passwd. If the user
|
|
// cannot be found (or there is no /etc/passwd file on the filesystem), then
|
|
// LookupUser returns an error.
|
|
func LookupUser(username string) (User, error) {
|
|
return lookupUser(username)
|
|
}
|
|
|
|
// LookupUid looks up a user by their user id in /etc/passwd. If the user cannot
|
|
// be found (or there is no /etc/passwd file on the filesystem), then LookupId
|
|
// returns an error.
|
|
func LookupUid(uid int) (User, error) {
|
|
return lookupUid(uid)
|
|
}
|
|
|
|
// LookupGroup looks up a group by its name in /etc/group. If the group cannot
|
|
// be found (or there is no /etc/group file on the filesystem), then LookupGroup
|
|
// returns an error.
|
|
func LookupGroup(groupname string) (Group, error) {
|
|
return lookupGroup(groupname)
|
|
}
|
|
|
|
// LookupGid looks up a group by its group id in /etc/group. If the group cannot
|
|
// be found (or there is no /etc/group file on the filesystem), then LookupGid
|
|
// returns an error.
|
|
func LookupGid(gid int) (Group, error) {
|
|
return lookupGid(gid)
|
|
}
|