github.com/imannamdari/v2ray-core/v5@v5.0.5/transport/internet/security/security.go (about)

     1  package security
     2  
     3  //go:generate go run github.com/imannamdari/v2ray-core/v5/common/errors/errorgen
     4  
     5  import (
     6  	"github.com/imannamdari/v2ray-core/v5/common/net"
     7  )
     8  
     9  type Engine interface {
    10  	Client(conn net.Conn, opts ...Option) (Conn, error)
    11  }
    12  
    13  type Conn interface {
    14  	net.Conn
    15  }
    16  
    17  type Option interface {
    18  	isSecurityOption()
    19  }
    20  
    21  type OptionWithALPN struct {
    22  	ALPNs []string
    23  }
    24  
    25  func (a OptionWithALPN) isSecurityOption() {
    26  }
    27  
    28  type OptionWithDestination struct {
    29  	Dest net.Destination
    30  }
    31  
    32  func (a OptionWithDestination) isSecurityOption() {
    33  }