winrm

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: LGPL-2.1 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWinRMUser = "Administrator"
	DefaultWinRMPort = 5985
)

Variables

View Source
var (
	ErrAlreadyStarted = errors.New("cmd already started")
	ErrNotStarted     = errors.New("cmd not started")
)

Functions

This section is empty.

Types

type Cmd

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

func (*Cmd) Close

func (c *Cmd) Close() error

func (*Cmd) CombinedOutput

func (c *Cmd) CombinedOutput() ([]byte, error)

func (*Cmd) Run

func (c *Cmd) Run() error

func (*Cmd) Start

func (c *Cmd) Start() error

func (*Cmd) StderrPipe

func (c *Cmd) StderrPipe() (io.Reader, error)

func (*Cmd) StdinPipe

func (c *Cmd) StdinPipe() (io.WriteCloser, error)

func (*Cmd) StdoutPipe

func (c *Cmd) StdoutPipe() (io.Reader, error)

func (*Cmd) Wait

func (c *Cmd) Wait() error

type Config

type Config struct {
	winrm.Endpoint

	Username string
	Password string

	Logger *zap.Logger
}

func NewConfig

func NewConfig(lg *zap.Logger, host, username, password string) *Config

func (*Config) Validate

func (cfg *Config) Validate() error

type WinRM

type WinRM struct {
	Config
	// contains filtered or unexported fields
}

func NewWinRM

func NewWinRM(cfg Config) (*WinRM, error)

func (*WinRM) Close

func (wr *WinRM) Close() error

func (*WinRM) Copy

func (wr *WinRM) Copy(ctx context.Context, fromPath, toPath string, fn client.IOTraceFn) error

func (*WinRM) Execute

func (wr *WinRM) Execute(ctx context.Context, shell string, opts ...client.ExecOption) (client.ICmd, error)

func (*WinRM) Get

func (wr *WinRM) Get(ctx context.Context, src, dst string, opts ...client.GetOption) error

func (*WinRM) Name

func (wr *WinRM) Name() string

func (*WinRM) Put

func (wr *WinRM) Put(ctx context.Context, src, dst string, opts ...client.PutOption) error

func (*WinRM) ReadFile added in v0.2.0

func (wr *WinRM) ReadFile(ctx context.Context, name string) ([]byte, error)

func (*WinRM) Stat

func (wr *WinRM) Stat(ctx context.Context, name string) (*client.Stat, error)

func (*WinRM) Write

func (wr *WinRM) Write(ctx context.Context, toPath string, src *os.File, fn client.IOTraceFn) error

Jump to

Keyboard shortcuts

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