github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/transport/internet/request/request.go (about)

     1  package request
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/v2fly/v2ray-core/v5/common/net"
     7  )
     8  
     9  type TransportClientAssembly interface {
    10  	Tripper() Tripper
    11  	AutoImplDialer() Dialer
    12  }
    13  
    14  type TransportClientAssemblyReceiver interface {
    15  	OnTransportClientAssemblyReady(TransportClientAssembly)
    16  }
    17  
    18  type TransportServerAssembly interface {
    19  	TripperReceiver() TripperReceiver
    20  	SessionReceiver() SessionReceiver
    21  	AutoImplListener() Listener
    22  }
    23  
    24  type TransportServerAssemblyReceiver interface {
    25  	OnTransportServerAssemblyReady(TransportServerAssembly)
    26  }
    27  
    28  type SessionCreator interface {
    29  	NewSession(ctx context.Context, opts ...SessionOption) (Session, error)
    30  }
    31  
    32  type SessionReceiver interface {
    33  	OnNewSession(ctx context.Context, sess Session, opts ...SessionOption) error
    34  }
    35  
    36  type Dialer interface {
    37  	Dial(ctx context.Context) (net.Conn, error)
    38  }
    39  
    40  type Listener interface {
    41  	Listen(ctx context.Context) (net.Listener, error)
    42  }