transport.go raw

   1  // Package transport defines the interface for pluggable network transports.
   2  package transport
   3  
   4  import "context"
   5  
   6  // Transport represents a network transport that serves the relay.
   7  type Transport interface {
   8  	// Name returns the transport identifier (e.g., "tcp", "tls", "tor").
   9  	Name() string
  10  	// Start begins accepting connections through this transport.
  11  	Start(ctx context.Context) error
  12  	// Stop gracefully shuts down the transport.
  13  	Stop(ctx context.Context) error
  14  	// Addresses returns the addresses this transport is reachable on.
  15  	Addresses() []string
  16  }
  17