forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rpc.go
31 lines (26 loc) · 959 Bytes
/
rpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package amqpwrap
import (
"context"
"github.com/Azure/go-amqp"
)
// RPCResponse is the simplified response structure from an RPC like call
type RPCResponse struct {
// Code is the response code - these originate from Service Bus. Some
// common values are called out below, with the RPCResponseCode* constants.
//
// NOTE: These status codes are intended to mirror HTTP status codes. For instance
// peeking messages returns http.StatusOK, etc...
//
// See https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response
// for more details about the ins and outs of each operation.
Code int
Description string
Message *amqp.Message
}
// RPCLink is implemented by *rpc.Link
type RPCLink interface {
Close(ctx context.Context) error
RPC(ctx context.Context, msg *amqp.Message) (*RPCResponse, error)
}