protocol

package
v0.0.0-...-d547b85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 1 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance string

Instance defines network protocols for ports

const (
	// GRPC declares that the port carries gRPC traffic.
	GRPC Instance = "GRPC"
	// GRPCWeb declares that the port carries gRPC traffic.
	GRPCWeb Instance = "GRPC-Web"
	// HTTP declares that the port carries HTTP/1.1 traffic.
	// Note that HTTP/1.0 or earlier may not be supported by the proxy.
	HTTP Instance = "HTTP"
	// HTTP_PROXY declares that the port is a generic outbound proxy port.
	// Note that this is currently applicable only for defining sidecar egress listeners.
	// nolint
	HTTP_PROXY Instance = "HTTP_PROXY"
	// HTTP2 declares that the port carries HTTP/2 traffic.
	HTTP2 Instance = "HTTP2"
	// HTTPS declares that the port carries HTTPS traffic.
	HTTPS Instance = "HTTPS"
	// TCP declares the port uses TCP.
	// This is the default protocol for a service port.
	TCP Instance = "TCP"
	// TLS declares that the port carries TLS traffic.
	// TLS traffic is assumed to contain SNI as part of the handshake.
	TLS Instance = "TLS"
	// UDP declares that the port uses UDP.
	// Note that UDP protocol is not currently supported by the proxy.
	UDP Instance = "UDP"
	// Mongo declares that the port carries MongoDB traffic.
	Mongo Instance = "Mongo"
	// Redis declares that the port carries Redis traffic.
	Redis Instance = "Redis"
	// MySQL declares that the port carries MySQL traffic.
	MySQL Instance = "MySQL"
	// HBONE declares that the port carries HBONE traffic.
	// This cannot be declared by Services, but is used for some internal code that uses Protocol
	HBONE Instance = "HBONE"
	// Unsupported - value to signify that the protocol is unsupported.
	Unsupported Instance = "UnsupportedProtocol"
)

func Parse

func Parse(s string) Instance

Parse from string ignoring case

func (Instance) AfterTLSTermination

func (i Instance) AfterTLSTermination() Instance

AfterTLSTermination returns the protocol that will be used if TLS is terminated on the current protocol.

func (Instance) IsGRPC

func (i Instance) IsGRPC() bool

IsGRPC is true for GRPC protocols.

func (Instance) IsHTTP

func (i Instance) IsHTTP() bool

IsHTTP is true for protocols that use HTTP as transport protocol

func (Instance) IsHTTP2

func (i Instance) IsHTTP2() bool

IsHTTP2 is true for protocols that use HTTP/2 as transport protocol

func (Instance) IsHTTPOrSniffed

func (i Instance) IsHTTPOrSniffed() bool

IsHTTPOrSniffed is true for protocols that use HTTP as transport protocol, or *can* use it if sniffed to be HTTP

func (Instance) IsHTTPS

func (i Instance) IsHTTPS() bool

IsHTTPS is true if protocol is HTTPS

func (Instance) IsTCP

func (i Instance) IsTCP() bool

IsTCP is true for protocols that use TCP as transport protocol

func (Instance) IsTLS

func (i Instance) IsTLS() bool

IsTLS is true for protocols on top of TLS (e.g. HTTPS)

func (Instance) IsUnsupported

func (i Instance) IsUnsupported() bool

func (Instance) String

func (i Instance) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL