task

package
v0.0.0-...-d18c366 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Overview

Package task implements various Task plugins that can be run over Hosts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RemoteCommand

type RemoteCommand struct {
	Command string               // Command to execute
	Meta    *gornir.TaskMetadata // Task metadata
}

RemoteCommand will open a new Session on an already opened ssh connection and execute the given command

func (*RemoteCommand) Metadata

func (t *RemoteCommand) Metadata() *gornir.TaskMetadata

Metadata returns the task metadata

func (*RemoteCommand) Run

Run runs a command on a remote device via ssh

type RemoteCommandResults

type RemoteCommandResults struct {
	Stdout []byte // Stdout written by the command
	Stderr []byte // Stderr written by the command
}

RemoteCommandResults is the result of calling RemoteCommand

func (RemoteCommandResults) String

func (r RemoteCommandResults) String() string

String implemente Stringer interface

type SFTPUpload

type SFTPUpload struct {
	Src  string
	Dst  string
	Meta *gornir.TaskMetadata // Task metadata
}

SFTPUpload will open a new SFTP session on an already opened ssh and upload a file

func (*SFTPUpload) Metadata

func (t *SFTPUpload) Metadata() *gornir.TaskMetadata

Metadata returns the task metadata

func (*SFTPUpload) Run

Run implements will upload a file via sftp

type SFTPUploadResult

type SFTPUploadResult struct {
	Bytes int64 // Bytes written
}

SFTPUploadResult is the result of calling SFTPUpload

func (SFTPUploadResult) String

func (r SFTPUploadResult) String() string

String implemente Stringer interface

Jump to

Keyboard shortcuts

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