Documentation ¶
Index ¶
- func AssertRowsEqual(t *testing.T, db *sqlx.DB, expectedRows []map[string]interface{}, query string, ...)
- func ConvertDbRowsToMapSlice(dbRows *sqlx.Rows) ([]map[string]interface{}, error)
- func Md5Hash(input string) []byte
- func NewMockChannel() (*ReadWriter, *ReadWriter)
- type ChannelMock
- type ConnMock
- func (c *ConnMock) InputSendRequest() (name string, wantReply bool, payload []byte)
- func (c *ConnMock) OpenChannel(name string, data []byte) (ssh.Channel, <-chan *ssh.Request, error)
- func (c *ConnMock) RemoteAddr() net.Addr
- func (c *ConnMock) SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error)
- type FileAPIMock
- func (f *FileAPIMock) ChangeMode(path string, targetMode os.FileMode) error
- func (f *FileAPIMock) ChangeOwner(path, owner, group string) error
- func (f *FileAPIMock) CreateDirIfNotExists(path string, mode os.FileMode) (wasCreated bool, err error)
- func (f *FileAPIMock) CreateFile(path string, sourceReader io.Reader) (writtenBytes int64, err error)
- func (f *FileAPIMock) Exist(path string) (bool, error)
- func (f *FileAPIMock) GetFileMode(file string) (os.FileMode, error)
- func (f *FileAPIMock) GetFileOwnerAndGroup(file string) (uid, gid uint32, err error)
- func (f *FileAPIMock) MakeDirAll(dir string) error
- func (f *FileAPIMock) Open(file string) (io.ReadWriteCloser, error)
- func (f *FileAPIMock) ReadDir(dir string) ([]os.FileInfo, error)
- func (f *FileAPIMock) ReadJSON(file string, dest interface{}) error
- func (f *FileAPIMock) Remove(name string) error
- func (f *FileAPIMock) Rename(oldPath, newPath string) error
- func (f *FileAPIMock) Write(fileName string, content string) error
- func (f *FileAPIMock) WriteJSON(file string, content interface{}) error
- type FileMock
- type ReadCloserMock
- type ReadWriteCloserMock
- type ReadWriter
- type SysUserProviderMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertRowsEqual ¶
func ConvertDbRowsToMapSlice ¶
func NewMockChannel ¶
func NewMockChannel() (*ReadWriter, *ReadWriter)
Types ¶
type ChannelMock ¶
func (*ChannelMock) Close ¶
func (c *ChannelMock) Close() error
type ConnMock ¶
type ConnMock struct { ssh.Conn DoneChannel chan bool ReturnOk bool ReturnResponsePayload []byte ReturnErr error ReturnRemoteAddr net.Addr ChannelMocks map[string]*ChannelMock // contains filtered or unexported fields }
func NewConnMock ¶
func NewConnMock() *ConnMock
func (*ConnMock) InputSendRequest ¶
func (*ConnMock) OpenChannel ¶
func (*ConnMock) RemoteAddr ¶
type FileAPIMock ¶
func NewFileAPIMock ¶
func NewFileAPIMock() *FileAPIMock
func (*FileAPIMock) ChangeMode ¶
func (f *FileAPIMock) ChangeMode(path string, targetMode os.FileMode) error
func (*FileAPIMock) ChangeOwner ¶
func (f *FileAPIMock) ChangeOwner(path, owner, group string) error
func (*FileAPIMock) CreateDirIfNotExists ¶
func (*FileAPIMock) CreateFile ¶
func (*FileAPIMock) GetFileMode ¶
func (f *FileAPIMock) GetFileMode(file string) (os.FileMode, error)
func (*FileAPIMock) GetFileOwnerAndGroup ¶
func (f *FileAPIMock) GetFileOwnerAndGroup(file string) (uid, gid uint32, err error)
func (*FileAPIMock) MakeDirAll ¶
func (f *FileAPIMock) MakeDirAll(dir string) error
func (*FileAPIMock) Open ¶
func (f *FileAPIMock) Open(file string) (io.ReadWriteCloser, error)
func (*FileAPIMock) ReadJSON ¶
func (f *FileAPIMock) ReadJSON(file string, dest interface{}) error
func (*FileAPIMock) Remove ¶
func (f *FileAPIMock) Remove(name string) error
func (*FileAPIMock) Rename ¶
func (f *FileAPIMock) Rename(oldPath, newPath string) error
func (*FileAPIMock) WriteJSON ¶
func (f *FileAPIMock) WriteJSON(file string, content interface{}) error
type ReadCloserMock ¶
func (*ReadCloserMock) Close ¶
func (rcm *ReadCloserMock) Close() error
type ReadWriteCloserMock ¶
type ReadWriteCloserMock struct { ReadCloserMock Writer io.Writer }
type ReadWriter ¶
type ReadWriter struct { io.Reader io.WriteCloser }
type SysUserProviderMock ¶
func (*SysUserProviderMock) GetCurrentUserAndGroup ¶
func (*SysUserProviderMock) GetGidByName ¶
func (supm *SysUserProviderMock) GetGidByName(group string) (gid uint32, err error)
func (*SysUserProviderMock) GetUIDByName ¶
func (supm *SysUserProviderMock) GetUIDByName(user string) (uid uint32, err error)
Click to show internal directories.
Click to hide internal directories.