HomeBlogAbout Me

Vssh 1 10



package vssh

import 'github.com/yahoo/vssh'

Share your thoughts, experiences and the tales behind the art. VSSH Go library to handle tens of thousands SSH connections and execute the command(s) with higher-level API for building network device / server automation. Documentation and examples are available via godoc. Jixipix pastello 1 1 5 download free.

Package vssh is a Go library to handle tens of thousands SSH connections and executethe command with higher-level API for building network device / server automation.

By calling the run method vssh sends the given command to all available clients orbased on your query it runs the command on the specific clients and the results ofthe ran command can be received in two options, streaming or final result.In streamingyou can get line by line from command’s stdout / stderr in real time or in case ofnon-real time you can get the whole of the lines together.

This example demonstrates integration vSSH with AWS EC2

Code:

Index ¶

Examples ¶

func GetConfigPEM¶Uses

GetConfigPEM returns SSH configuration that uses the given private key.the keyfile should be unencrypted PEM-encoded private key file.

func GetConfigUserPass¶Uses

GetConfigUserPass returns SSH configuration that uses the givenusername and password.

func SetClientsShardNumber¶Uses

SetClientsShardNumber sets the clients shard number.

vSSH uses map data structure to keep the clientsdata in the memory. Sharding helps to have better performanceon write/read with mutex. This setting can be tuned if needed.

type ClientOption¶Uses

ClientOption represents client optional parameters.

func DisableRequestPty¶Uses

DisableRequestPty disables the pty.

func RequestPty¶Uses

RequestPty sets the pty parameters.

func SetLabels¶Uses

SetLabels sets labels for a client.

func SetMaxSessions¶Uses

SetMaxSessions sets maximum sessions for given client.

type MaxSessionsError¶Uses

MaxSessionsError represents max sessions error.

type Response¶Uses

Response represents the response for given session.

This example demonstrates the use of GetText() for two hosts.

Code:

func (*Response) Err¶Uses

Err returns response error.

func (*Response) ExitStatus¶Uses

Affinity designer 1 5 4 – vector graphic design software. ExitStatus returns the exit status of the remote command.

func (*Response) GetStream¶Uses

GetStream constructs a new stream from a response.

func (*Response) GetText¶Uses

GetText gets the final result of the given response.

func (*Response) ID¶Uses

ID returns response identification.

type RunOption¶Uses

RunOption represents run optional parameters.

func SetLimitReaderStderr¶Uses

SetLimitReaderStderr sets limit for stderr reader.

func SetLimitReaderStdout¶Uses

SetLimitReaderStdout sets limit for stdout reader.

This example demonstrates how to set limit the amount of returned data

Code:

type Stream¶Uses

King slot machine. Stream represents data stream for given response.It provides convenient interfaces to get the returneddata real-time.

func (*Stream) BytesStderr¶Uses

BytesStderr returns the most recent data scanned by ScanStderr as bytes.

func (*Stream) BytesStdout¶Uses

BytesStdout returns the most recent data scanned by ScanStdout as bytes.

func (*Stream) Close¶Uses

Gif recorder 1 0 – record your screen. Close cleans up the stream's response.

func (*Stream) Err¶Uses

Err returns stream response error.

func (*Stream) Input¶Uses

Mobile app mockup sketch. Input writes the given reader to remote command's standardinput when the command starts.

func (*Stream) ScanStderr¶Uses

ScanStderr provides a convenient interface for reading stderrwhich it connected to remote host. It reads a line and buffersit. The TextStdout() or BytesStdout() methods return the bufferin string or bytes.

func (*Stream) ScanStdout¶Uses

ScanStdout provides a convenient interface for reading stdoutwhich it connected to remote host. It reads a line and buffersit. The TextStdout() or BytesStdout() methods return the bufferin string or bytes.

func (*Stream) Signal¶Uses

Vssh 1 100000

Signal sends the given signal to remote process.

func (*Stream) TextStderr¶Uses

TextStderr returns the most recent data scanned by ScanStderr as string.

func (*Stream) TextStdout¶Uses

TextStdout returns the most recent data scanned by ScanStdout as string.

type TimeoutError¶Uses

TimeoutError represents timeout error.

type VSSH¶Uses

VSSH represents VSSH instance.

func New¶Uses

New constructs a new VSSH instance.

func (*VSSH) AddClient¶Uses

AddClient adds a new SSH client to VSSH.

func (*VSSH) CurrentProc¶Uses

CurrentProc returns number of running processes / workers.

func (*VSSH) DecreaseProc¶Uses

DecreaseProc destroys the idle processes / workers.

func (*VSSH) ForceReConn¶Uses

ForceReConn reconnects the client immediately.

func (*VSSH) IncreaseProc¶Uses

IncreaseProc adds more processes / workers.

func (*VSSH) OnDemand¶Uses

OnDemand changes VSSH connection behavior. By default VSSHconnects to all of the clients before any run request andit maintains the authenticated SSH connection to all clients.We can call this 'persistent SSH connection' but withOnDemand it tries to connect to clients once the run requestedand it closes the appropriate connection once the response data returned.

func (*VSSH) Run¶Uses

Run sends a new run query with given context, command and timeout.

Adobe xd cc 19 0 22 pistol. timeout allows you to set a limit on the length of time the commandwill run for. You can cancel the running command by context.WithCancel.

func (*VSSH) RunWithLabel¶Uses

RunWithLabel runs the command on the specific clients whichthey matched with given query statement.

100000

func (*VSSH) SetInitNumProc¶Uses

SetInitNumProc sets the initial number of processes / workers.

You need to set this number right after creating vssh.

There are two other methods in case you need to changethe settings in the middle of your code.

Vssh 1 1000

func (*VSSH) SetLogger¶Uses

Vssh 1 100000

SetLogger sets external logger.

func (*VSSH) Start¶Uses

Start starts vSSH, including action queue and re-connect procedures.You can construct and start the vssh like below:

func (*VSSH) StartWithContext¶Uses

StartWithContext is same as Run but it accepts external context.

func (*VSSH) Wait¶Uses

Wait stands by until percentage of the clients have been processed.An optional percentage can be passed as an argument - otherwise the defaultvalue of 100% is used.

Package vssh imports 18 packages (graph). Updated 2020-10-23. Refresh now. Tools for package owners.





Vssh 1 10
Back to posts
This post has no comments - be the first one!

UNDER MAINTENANCE

XtGem Forum catalog