Documentation
¶
Index ¶
- Variables
- type AMQP
- func (a *AMQP) Close(ctx context.Context) error
- func (a *AMQP) ReceiveTaskRequest(ctx context.Context) (orbital.TaskRequest, error)
- func (a *AMQP) ReceiveTaskResponse(ctx context.Context) (orbital.TaskResponse, error)
- func (a *AMQP) SendTaskRequest(ctx context.Context, req orbital.TaskRequest) error
- func (a *AMQP) SendTaskResponse(ctx context.Context, resp orbital.TaskResponse) error
- type ClientOption
- type ConnectionInfo
Constants ¶
This section is empty.
Variables ¶
var ( // ErrApplyOption indicates that applying a ClientOption failed. ErrApplyOption = errors.New("amqp: failed to apply client option") // ErrTLSPairLoad indicates that loading the TLS certificate/key pair failed. ErrTLSPairLoad = errors.New("amqp: failed to load TLS key pair") // ErrCARead indicates that reading the CA certificate file failed. ErrCARead = errors.New("amqp: failed to read CA certificate file") // ErrInvalidCACert indicates that the CA certificate PEM could not be parsed. ErrInvalidCACert = errors.New("amqp: invalid CA certificate") )
var ErrCodecNotProvided = errors.New("codec not provided")
Functions ¶
This section is empty.
Types ¶
type AMQP ¶
type AMQP struct {
// contains filtered or unexported fields
}
AMQP is a client for sending and receiving messages using the AMQP protocol.
func NewClient ¶
func NewClient(ctx context.Context, codec orbital.Codec, connInfo ConnectionInfo, opts ...ClientOption) (*AMQP, error)
NewClient initializes and returns a new AMQP client instance configured with the provided codec for encoding and decoding messages, connection information (URL, target, and source), and optional client options.
func (*AMQP) ReceiveTaskRequest ¶
ReceiveTaskRequest receives, decodes and acknowledges a TaskRequest message.
func (*AMQP) ReceiveTaskResponse ¶
ReceiveTaskResponse receives, decodes and acknowledges a TaskResponse message.
func (*AMQP) SendTaskRequest ¶
SendTaskRequest sends an encoded TaskRequest message.
func (*AMQP) SendTaskResponse ¶
SendTaskResponse sends an encoded TaskResponse message.
type ClientOption ¶
type ClientOption func(*amqp.ConnOptions) error
ClientOption configures how the AMQP connection is established.
func WithBasicAuth ¶
func WithBasicAuth(username, password string) ClientOption
WithBasicAuth tells the client to use SASL PLAIN with user/password.
func WithExternalMTLS ¶
func WithExternalMTLS(certFile, keyFile, caFile, serverName string) ClientOption
WithExternalMTLS sets up mutual TLS + SASL EXTERNAL authentication.
func WithNoAuth ¶
func WithNoAuth() ClientOption
WithNoAuth tells the client to use SASL ANONYMOUS (no credentials).
func WithProperties ¶
func WithProperties(props map[string]any) ClientOption
WithProperties lets you set custom connection properties (e.g., vpn-name).
type ConnectionInfo ¶
ConnectionInfo holds the connection details for the AMQP client.