Documentation ¶
Index ¶
- Constants
- Variables
- func Spawn(command string, in io.ReadCloser, out, err io.WriteCloser, noTTY bool) func(ch *Channel)
- type Channel
- type ChannelSink
- type Client
- type ClientChannels
- type ClientOption
- type Decoder
- func (p *Decoder) Byte(d *byte) *Decoder
- func (p *Decoder) End()
- func (p *Decoder) IsEnd() bool
- func (p *Decoder) NBytes(n int, d *[]byte) *Decoder
- func (p *Decoder) NString(n int, s *string) *Decoder
- func (p *Decoder) U16(d *uint16) *Decoder
- func (p *Decoder) U16String(d *string) *Decoder
- func (p *Decoder) U32(d *uint32) *Decoder
- func (p *Decoder) U32Bytes(d *[]byte) *Decoder
- func (p *Decoder) U32String(d *string) *Decoder
- func (p *Decoder) U64(d *uint64) *Decoder
- func (p *Decoder) U8String(d *string) *Decoder
- type Encoder
- func (p *Encoder) Byte(d byte) *Encoder
- func (p *Encoder) Bytes(d []byte) *Encoder
- func (p *Encoder) Commit() (int, error)
- func (p *Encoder) Out() []byte
- func (p *Encoder) String(d string) *Encoder
- func (p *Encoder) String0(d string) *Encoder
- func (p *Encoder) U16(d uint16) *Encoder
- func (p *Encoder) U16String(d string) *Encoder
- func (p *Encoder) U32(d uint32) *Encoder
- func (p *Encoder) U32Bytes(d []byte) *Encoder
- func (p *Encoder) U32String(d string) *Encoder
- func (p *Encoder) U64(d uint64) *Encoder
- func (p *Encoder) U8String(d string) *Encoder
- type NullCrypto
- type NullHash
- type TunnelConn
Constants ¶
View Source
const ( // RFC4252 (Authentication Protocol)/6 MsgUserauthRequest = 50 MsgUserauthFailure = 51 MsgUserauthSuccess = 52 MsgUserauthBanner = 53 // RFC4253 (Transport Layer Protocol)/12 MsgDisconnect = 1 MsgIgnore = 2 MsgUnimplemented = 3 MsgDebug = 4 MsgServiceRequest = 5 MsgServiceAccept = 6 MsgKexinit = 20 MsgNewkeys = 21 MsgKexdhInit = 30 MsgKexdhReply = 31 // RFC4253/6.1 MaxPacketSize = 32768 // RFC4254 (Connection Protocol)/9 MsgGlobalRequest = 80 MsgRequestSuccess = 81 MsgRequestFailure = 82 MsgChannelOpen = 90 MsgChannelOpenConfirmation = 91 MsgChannelOpenFailure = 92 MsgChannelWindowAdjust = 93 MsgChannelData = 94 MsgChannelExtendedData = 95 MsgChannelEOF = 96 MsgChannelClose = 97 MsgChannelRequest = 98 MsgChannelSuccess = 99 MsgChannelFailure = 100 NameListKexAlgorithms = "diffie-hellman-group14-sha1,diffie-hellman-group1-sha1" NameListServerHostKeyAlgorithms = "ssh-rsa" NameListEncryptionAlgorithms1 = "aes128-ctr,aes128-cbc" NameListEncryptionAlgorithms2 = "aes128-ctr,aes128-cbc" NameListMacAlgorithms1 = "hmac-sha1" NameListMacAlgorithms2 = "hmac-sha1" NameListCompressionAlgorithms1 = "none" NameListCompressionAlgorithms2 = "none" NameListLanguages1 = "" NameListLanguages2 = "" )
Variables ¶
View Source
var Log = func(int, string, ...interface{}) {
}
Functions ¶
func Spawn ¶
func Spawn(command string, in io.ReadCloser, out, err io.WriteCloser, noTTY bool) func(ch *Channel)
Types ¶
type Channel ¶
type Channel struct { *ChannelSink // contains filtered or unexported fields }
type ChannelSink ¶
type ChannelSink struct { OnChannelFailure func(ch *Channel) OnChannelClose func(ch *Channel) OnChannelEOF func(ch *Channel) OnChannelExtendedData func(ch *Channel, data []byte, dataType uint32) OnChannelData func(ch *Channel, data []byte) OnChannelOpenConfirmation func(ch *Channel) OnChannelOpenFailure func(ch *Channel, reason uint32, description, lang string) }
type Client ¶
type Client struct { ClientChannels // contains filtered or unexported fields }
func NewClient ¶
func NewClient(conn io.ReadWriteCloser, option *ClientOption) (*Client, error)
func (*Client) ChannelCount ¶
type ClientChannels ¶
type ClientChannels struct {
// contains filtered or unexported fields
}
type ClientOption ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder type.
func (*Decoder) U16String ¶
Parse a string with a 2 byte bigendian length prefix to a string pointer.
func (*Decoder) U32Bytes ¶
Parse a string with a 4 byte bigendian length prefix to a []byte pointer.
func (*Decoder) U32String ¶
Parse a string with a 4 byte bigendian length prefix to a string pointer.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder type. Don't touch the internals.
func NewEncoderWith ¶
Create a new printer with output prefixed with the given byte slice.
func NewEncoderWithCommit ¶
func (*Encoder) U16String ¶
Output a string with a 2 byte bigendian length prefix and no trailing null.
type NullCrypto ¶
type NullCrypto struct { }
func (NullCrypto) BlockSize ¶
func (NullCrypto) BlockSize() int
func (NullCrypto) CryptBlocks ¶
func (NullCrypto) CryptBlocks(dst, src []byte)
type TunnelConn ¶
type TunnelConn struct { *Channel // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.