Documentation
¶
Index ¶
- Variables
- func CloserCTX(ctx context.Context, fn func()) context.CancelFunc
- func GetLastBytes(data []byte, last int) []byte
- func NetReader(ctx context.Context, buff chan []byte, conn net.Conn, logger *zap.Logger) error
- func NewTimerWithDefault(duration time.Duration) *time.Timer
- func StopTimer(timer *time.Timer)
- func TCPDialCtx(ctx context.Context, network, addr string) (net.Conn, error)
- func ThrowCmdTimeoutException(lastRead []byte) error
- func ThrowEOFException(lastRead []byte) error
- func ThrowReadTimeoutException(lastRead []byte, cause ...error) error
- type Chmod
- type CmdTimeoutException
- type Connector
- type Const
- type EOFException
- type File
- type GenericReadConfig
- type GenericReadOption
- type ReadRes
- type ReadResImpl
- type ReadTimeoutException
- type ReadXRes
- type ReadXType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupported = errors.New("not supported")
Functions ¶
func CloserCTX ¶
func CloserCTX(ctx context.Context, fn func()) context.CancelFunc
CloserCTX calls fn if ctx is cancelled. Returns cancel function.
func GetLastBytes ¶
func TCPDialCtx ¶
TCPDialCtx net.Dial version with context arg
func ThrowEOFException ¶
Types ¶
type CmdTimeoutException ¶
type CmdTimeoutException struct {
// contains filtered or unexported fields
}
func (*CmdTimeoutException) Error ¶
func (e *CmdTimeoutException) Error() string
type Connector ¶
type Connector interface {
Init(context.Context) error
GetCredentials() credentials.Credentials
SetCredentialsInterceptor(func(credentials.Credentials) credentials.Credentials)
SetTrace(trace.CB)
SetReadTimeout(time.Duration) time.Duration
PrependBuffer([]byte) error
Close()
ReadTo(context.Context, expr.Expr) (ReadRes, error)
Read(ctx context.Context, n int) ([]byte, error)
Cmd(ctx context.Context, cmd string) (cmd.CmdRes, error)
Write([]byte) error
HasFeature(Const) bool
Download(paths []string, recurse bool) (map[string]File, error)
Upload(map[string]File) error
InitAgentForward() error
}
type EOFException ¶
type EOFException struct {
LastRead []byte
}
func (*EOFException) Error ¶
func (m *EOFException) Error() string
func (*EOFException) Is ¶
func (m *EOFException) Is(target error) bool
type GenericReadConfig ¶ added in v1.3.11
type GenericReadConfig struct {
// contains filtered or unexported fields
}
type GenericReadOption ¶ added in v1.3.11
type GenericReadOption func(*GenericReadConfig)
func WithMaxDuration ¶ added in v1.3.11
func WithMaxDuration(maxDuration time.Duration) GenericReadOption
WithMaxDuration specifies maximum time for reading. Results in timeout result without error
func WithMaxReadSize ¶ added in v1.3.11
func WithMaxReadSize(maxReadSize int) GenericReadOption
WithMaxReadSize specifies maximum size of bytes returned. Any leftover bytes from read will be returned as left bytes
func WithRegExpr ¶ added in v1.3.11
func WithRegExpr(regExpr expr.Expr) GenericReadOption
WithRegExpr stops read on regExpr match
type ReadResImpl ¶
type ReadResImpl struct {
// contains filtered or unexported fields
}
func NewReadResImpl ¶
func NewReadResImplWithUnder ¶ added in v1.0.7
func (ReadResImpl) GetAfter ¶
func (m ReadResImpl) GetAfter() []byte
func (ReadResImpl) GetBefore ¶
func (m ReadResImpl) GetBefore() []byte
func (ReadResImpl) GetMatched ¶
func (m ReadResImpl) GetMatched() []byte
func (ReadResImpl) GetMatchedGroups ¶
func (m ReadResImpl) GetMatchedGroups() map[string][]byte
func (ReadResImpl) GetPatternNo ¶
func (m ReadResImpl) GetPatternNo() int
func (ReadResImpl) GetUnderlyingRes ¶ added in v1.0.7
func (m ReadResImpl) GetUnderlyingRes() ReadRes
type ReadTimeoutException ¶
func (*ReadTimeoutException) Error ¶
func (m *ReadTimeoutException) Error() string
func (*ReadTimeoutException) Is ¶
func (m *ReadTimeoutException) Is(target error) bool
func (*ReadTimeoutException) Unwrap ¶ added in v1.3.6
func (m *ReadTimeoutException) Unwrap() error
type ReadXRes ¶
func GenericReadX ¶
func GenericReadX(ctx context.Context, inBuffer []byte, readCh chan []byte, readSize int, readTimeout time.Duration, requiredOpt GenericReadOption, opts ...GenericReadOption) (*ReadXRes, []byte, []byte, error)
GenericReadX reads from readCh till expr matched, exceeded time or read more than size. Returns error if nothing was read during readTimeout or ctx was Done Returns read res, left bytes, read bytes, error
Directories
¶
| Path | Synopsis |
|---|---|
|
https://www.rfc-editor.org/rfc/rfc2217.html
|
https://www.rfc-editor.org/rfc/rfc2217.html |
|
Package ssh implements SSH transport.
|
Package ssh implements SSH transport. |
|
Package telnet implements telnet transport at very basic level.
|
Package telnet implements telnet transport at very basic level. |
Click to show internal directories.
Click to hide internal directories.