Documentation
¶
Index ¶
- Constants
- func LogClose(info CloseInfo, metadata LogMetadata)
- func RunManaged(opts RunManagedOptions) error
- type Addr
- type Callback
- type CallbackConnOptions
- type CloseInfo
- type CloseReason
- type CloseWriter
- type LogMetadata
- type ManagedConn
- type PersistentLifecycle
- type ProcessInfo
- type ProcessSpec
- type RunManagedOptions
- type Side
Constants ¶
View Source
const ( TransportSideUnknown = SideUnknown TransportSideProvider = SideProvider TransportSideSSH = SideSSH TransportSideParent = SideParent )
View Source
const ( TransportCloseUnknown = CloseUnknown TransportClosePeerEOF = ClosePeerEOF TransportCloseContextCancelled = CloseContextCancelled TransportCloseLocalShutdown = CloseLocalShutdown TransportCloseProviderExit = CloseProviderExit TransportCloseProviderError = CloseProviderError TransportCloseSSHTransportError = CloseSSHTransportError TransportCloseSessionExit = CloseSessionExit TransportCloseKeepaliveTimeout = CloseKeepaliveTimeout )
Variables ¶
This section is empty.
Functions ¶
func LogClose ¶
func LogClose(info CloseInfo, metadata LogMetadata)
func RunManaged ¶
func RunManaged(opts RunManagedOptions) error
Types ¶
type CallbackConnOptions ¶
type CloseInfo ¶
type CloseInfo struct {
Reason CloseReason
Err error
Side Side
}
type CloseReason ¶
type CloseReason string
const ( CloseUnknown CloseReason = "unknown" ClosePeerEOF CloseReason = "peer_eof" CloseContextCancelled CloseReason = "context_cancelled" CloseLocalShutdown CloseReason = "local_shutdown" CloseProviderExit CloseReason = "provider_exit" CloseProviderError CloseReason = "provider_error" CloseSSHTransportError CloseReason = "ssh_transport_error" CloseSessionExit CloseReason = "session_exit" CloseKeepaliveTimeout CloseReason = "keepalive_timeout" )
type CloseWriter ¶
type CloseWriter interface {
CloseWrite() error
}
CloseWriter is optionally implemented by transports that support half-close.
type LogMetadata ¶
type ManagedConn ¶
ManagedConn is a net.Conn with an observable terminal result.
func OpenCallbackConn ¶
func OpenCallbackConn( ctx context.Context, callback Callback, opts CallbackConnOptions, ) (ManagedConn, error)
func StartProcessConn ¶
func StartProcessConn(ctx context.Context, spec ProcessSpec) (ManagedConn, error)
type PersistentLifecycle ¶
type PersistentLifecycle struct {
// contains filtered or unexported fields
}
func NewPersistentLifecycle ¶
func NewPersistentLifecycle(parent context.Context) (*PersistentLifecycle, context.Context)
NewPersistentLifecycle derives a cancellable context from parent and returns it alongside the lifecycle that controls it.
func (*PersistentLifecycle) Close ¶
func (l *PersistentLifecycle) Close(info CloseInfo)
func (*PersistentLifecycle) CloseInfo ¶
func (l *PersistentLifecycle) CloseInfo() CloseInfo
func (*PersistentLifecycle) Done ¶
func (l *PersistentLifecycle) Done() <-chan struct{}
type ProcessInfo ¶
type ProcessInfo interface {
PID() int
}
ProcessInfo is optionally implemented by process-backed transports.
type ProcessSpec ¶
type RunManagedOptions ¶
type RunManagedOptions struct {
Parent context.Context
Conn ManagedConn
Handler func(context.Context) error
Metadata LogMetadata
TransportSide Side
}
Click to show internal directories.
Click to hide internal directories.