Documentation
¶
Index ¶
- type Group
- type MockOSUser
- type MockOSUser_Expecter
- type MockOSUser_GetGroupNameFromID_Call
- func (_c *MockOSUser_GetGroupNameFromID_Call) Return(_a0 string, _a1 error) *MockOSUser_GetGroupNameFromID_Call
- func (_c *MockOSUser_GetGroupNameFromID_Call) Run(run func(gid string, groupFilePath string)) *MockOSUser_GetGroupNameFromID_Call
- func (_c *MockOSUser_GetGroupNameFromID_Call) RunAndReturn(run func(string, string) (string, error)) *MockOSUser_GetGroupNameFromID_Call
- type MockOSUser_GetUserNameFromID_Call
- func (_c *MockOSUser_GetUserNameFromID_Call) Return(_a0 string, _a1 error) *MockOSUser_GetUserNameFromID_Call
- func (_c *MockOSUser_GetUserNameFromID_Call) Run(run func(uid string, userFilePath string)) *MockOSUser_GetUserNameFromID_Call
- func (_c *MockOSUser_GetUserNameFromID_Call) RunAndReturn(run func(string, string) (string, error)) *MockOSUser_GetUserNameFromID_Call
- type OSUser
- type OSUserUtil
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
Group represents a grouping of users.
On POSIX systems Gid contains a decimal number representing the group ID.
type MockOSUser ¶
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 ¶
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 (_c *MockOSUser_GetGroupNameFromID_Call) Return(_a0 string, _a1 error) *MockOSUser_GetGroupNameFromID_Call
func (*MockOSUser_GetGroupNameFromID_Call) Run ¶
func (_c *MockOSUser_GetGroupNameFromID_Call) Run(run func(gid string, groupFilePath string)) *MockOSUser_GetGroupNameFromID_Call
func (*MockOSUser_GetGroupNameFromID_Call) RunAndReturn ¶
func (_c *MockOSUser_GetGroupNameFromID_Call) RunAndReturn(run func(string, string) (string, error)) *MockOSUser_GetGroupNameFromID_Call
type MockOSUser_GetUserNameFromID_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 (_c *MockOSUser_GetUserNameFromID_Call) Return(_a0 string, _a1 error) *MockOSUser_GetUserNameFromID_Call
func (*MockOSUser_GetUserNameFromID_Call) Run ¶
func (_c *MockOSUser_GetUserNameFromID_Call) Run(run func(uid string, userFilePath string)) *MockOSUser_GetUserNameFromID_Call
func (*MockOSUser_GetUserNameFromID_Call) RunAndReturn ¶
func (_c *MockOSUser_GetUserNameFromID_Call) RunAndReturn(run func(string, string) (string, error)) *MockOSUser_GetUserNameFromID_Call
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.