transport

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 44

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientTLSConfig

func NewClientTLSConfig(certPath, keyPath, caPath, serverName string) (*tls.Config, error)

func NewClientTLSConfigWithSystemCA added in v0.72.0

func NewClientTLSConfigWithSystemCA(certPath, keyPath, caPath, serverName string, useSystemCa bool) (*tls.Config, error)

NewClientTLSConfigWithSystemCA enables verification against system CAs when useSystemCa is true, adding certificates from caPath if it is also set. Without either trust source, server certificate verification remains disabled.

func NewRandomPrivateKey added in v0.53.0

func NewRandomPrivateKey() ([]byte, error)

func NewServerTLSConfig

func NewServerTLSConfig(certPath, keyPath, caPath string) (*tls.Config, error)

Types

type MessageSender added in v0.66.0

type MessageSender interface {
	Send(msg.Message) error
}

type MessageTransporter added in v0.49.0

type MessageTransporter interface {
	Send(msg.Message) error
	// Recv(ctx context.Context, laneKey string, msgType string) (Message, error)
	// Do will first send msg, then recv msg with the same laneKey and specified msgType.
	Do(ctx context.Context, req msg.Message, laneKey, recvMsgType string) (msg.Message, error)
	// Dispatch will dispatch message to related channel registered in Do function by its message type and laneKey.
	Dispatch(m msg.Message, laneKey string) bool
	// Same with Dispatch but with specified message type.
	DispatchWithType(m msg.Message, msgType, laneKey string) bool
}

func NewMessageTransporter added in v0.49.0

func NewMessageTransporter(sender MessageSender) MessageTransporter

Jump to

Keyboard shortcuts

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