user

package
v0.0.0-...-27baac2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Gid  string // group ID
	Name string // group name
}

Group represents a grouping of users.

On POSIX systems Gid contains a decimal number representing the group ID.

type MockOSUser

type MockOSUser struct {
	mock.Mock
}

MockOSUser is an autogenerated mock type for the OSUser type

func NewMockOSUser

func NewMockOSUser(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockOSUser

NewMockOSUser creates a new instance of MockOSUser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockOSUser) EXPECT

func (_m *MockOSUser) EXPECT() *MockOSUser_Expecter

func (*MockOSUser) GetGroupNameFromID

func (_m *MockOSUser) GetGroupNameFromID(gid string, groupFilePath string) (string, error)

GetGroupNameFromID provides a mock function with given fields: gid, groupFilePath

func (*MockOSUser) GetUserNameFromID

func (_m *MockOSUser) GetUserNameFromID(uid string, userFilePath string) (string, error)

GetUserNameFromID provides a mock function with given fields: uid, userFilePath

type MockOSUser_Expecter

type MockOSUser_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockOSUser_Expecter) GetGroupNameFromID

func (_e *MockOSUser_Expecter) GetGroupNameFromID(gid interface{}, groupFilePath interface{}) *MockOSUser_GetGroupNameFromID_Call

GetGroupNameFromID is a helper method to define mock.On call

  • gid string
  • groupFilePath string

func (*MockOSUser_Expecter) GetUserNameFromID

func (_e *MockOSUser_Expecter) GetUserNameFromID(uid interface{}, userFilePath interface{}) *MockOSUser_GetUserNameFromID_Call

GetUserNameFromID is a helper method to define mock.On call

  • uid string
  • userFilePath string

type MockOSUser_GetGroupNameFromID_Call

type MockOSUser_GetGroupNameFromID_Call struct {
	*mock.Call
}

MockOSUser_GetGroupNameFromID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGroupNameFromID'

func (*MockOSUser_GetGroupNameFromID_Call) Return

func (*MockOSUser_GetGroupNameFromID_Call) Run

func (*MockOSUser_GetGroupNameFromID_Call) RunAndReturn

type MockOSUser_GetUserNameFromID_Call

type MockOSUser_GetUserNameFromID_Call struct {
	*mock.Call
}

MockOSUser_GetUserNameFromID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserNameFromID'

func (*MockOSUser_GetUserNameFromID_Call) Return

func (*MockOSUser_GetUserNameFromID_Call) Run

func (*MockOSUser_GetUserNameFromID_Call) RunAndReturn

type OSUser

type OSUser interface {
	GetUserNameFromID(uid string, userFilePath string) (string, error)
	GetGroupNameFromID(gid string, groupFilePath string) (string, error)
}

func NewOSUserUtil

func NewOSUserUtil() OSUser

type OSUserUtil

type OSUserUtil struct{}

func (*OSUserUtil) GetGroupNameFromID

func (*OSUserUtil) GetGroupNameFromID(gid string, groupFilePath string) (string, error)

func (*OSUserUtil) GetUserNameFromID

func (*OSUserUtil) GetUserNameFromID(uid string, userFilePath string) (string, error)

type User

type User struct {
	// Uid is the user ID.
	// On POSIX systems, this is a decimal number representing the uid.
	// On Windows, this is a security identifier (SID) in a string format.
	// On Plan 9, this is the contents of /dev/user.
	Uid string
	// Gid is the primary group ID.
	// On POSIX systems, this is a decimal number representing the gid.
	// On Windows, this is a SID in a string format.
	// On Plan 9, this is the contents of /dev/user.
	Gid string
	// Username is the login name.
	Username string
	// Name is the user's real or display name.
	// It might be blank.
	// On POSIX systems, this is the first (or only) entry in the GECOS field
	// list.
	// On Windows, this is the user's display name.
	// On Plan 9, this is the contents of /dev/user.
	Name string
	// HomeDir is the path to the user's home directory (if they have one).
	HomeDir string
}

User represents a user account.

Jump to

Keyboard shortcuts

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