localhost

package
v0.0.0-...-84310d3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	*server.Host
}

Backend for localhost

func (Backend) NewSession

func (b Backend) NewSession(s server.Session, h *server.Host) (server.HostSession, error)

NewSession returns a session wrapping host

type Session

type Session struct {
	Host    *server.Host
	Session server.Session
}

Session has a pointer to host

func (*Session) Chmod

func (s *Session) Chmod(path string, mode int) (server.CmdErr, error)

Chmod changes file mode

func (*Session) Chown

func (s *Session) Chown(path, u, g string) (server.CmdErr, error)

Chown changes file owner

func (*Session) Close

func (s *Session) Close()

Close closes a session

func (*Session) GetFileInfo

func (s *Session) GetFileInfo(file string) (server.FileOwner, os.FileInfo, server.CmdErr, error)

GetFileInfo retrieves file info from a host

func (*Session) MkDir

func (s *Session) MkDir(path string) (server.CmdErr, error)

MkDir creates dir

func (*Session) ReadFile

func (s *Session) ReadFile(name string) (os.FileInfo, []byte, server.CmdErr, error)

ReadFile reads a local file

func (*Session) Run

func (s *Session) Run(cmd string, env map[string]string) (server.HostCommandResponse, error)

Run runs cmd

func (*Session) WriteFile

func (s *Session) WriteFile(name string, perms os.FileMode, content []byte) (server.CmdErr, error)

WriteFile writes a file on the host

Jump to

Keyboard shortcuts

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