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

     1  package request
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/v2fly/v2ray-core/v5/common"
     7  )
     8  
     9  type RoundTripperClient interface {
    10  	Tripper
    11  	TransportClientAssemblyReceiver
    12  }
    13  
    14  type RoundTripperServer interface {
    15  	common.Runnable
    16  	TransportServerAssemblyReceiver
    17  }
    18  
    19  type Tripper interface {
    20  	RoundTrip(ctx context.Context, req Request, opts ...RoundTripperOption) (resp Response, err error)
    21  }
    22  
    23  type TripperReceiver interface {
    24  	OnRoundTrip(ctx context.Context, req Request, opts ...RoundTripperOption) (resp Response, err error)
    25  }
    26  
    27  type RoundTripperOption interface {
    28  	RoundTripperOption()
    29  }
    30  
    31  type Request struct {
    32  	Data          []byte
    33  	ConnectionTag []byte
    34  }
    35  
    36  type Response struct {
    37  	Data []byte
    38  }