mirror of
https://github.com/lightningequipment/circuitbreaker.git
synced 2026-08-13 12:33:02 +02:00
multi: surface forwarding history on rpc
This commit is contained in:
parent
e38dedddc6
commit
ae4703c9b6
6 changed files with 1008 additions and 82 deletions
|
|
@ -752,6 +752,281 @@ func (x *Counter) GetReject() int64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
type ListForwardingHistoryRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The inclusive start time for the query, used to filter HTLCs by the time they were added
|
||||
// to local incoming channel. If this value is zero, it will be treated as the unix epoch.
|
||||
AddStartTimeNs int64 `protobuf:"varint,1,opt,name=add_start_time_ns,json=addStartTimeNs,proto3" json:"add_start_time_ns,omitempty"`
|
||||
// The exclusive end time for the query, used to filter HTLCs by the time they were added to
|
||||
// the local incoming channel. If this value is zero, it will be assumed to be the current time.
|
||||
AddEndTimeNs int64 `protobuf:"varint,2,opt,name=add_end_time_ns,json=addEndTimeNs,proto3" json:"add_end_time_ns,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryRequest) Reset() {
|
||||
*x = ListForwardingHistoryRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListForwardingHistoryRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListForwardingHistoryRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[13]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListForwardingHistoryRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListForwardingHistoryRequest) Descriptor() ([]byte, []int) {
|
||||
return file_circuitbreaker_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryRequest) GetAddStartTimeNs() int64 {
|
||||
if x != nil {
|
||||
return x.AddStartTimeNs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryRequest) GetAddEndTimeNs() int64 {
|
||||
if x != nil {
|
||||
return x.AddEndTimeNs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListForwardingHistoryResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Forwards []*Forward `protobuf:"bytes,1,rep,name=forwards,proto3" json:"forwards,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryResponse) Reset() {
|
||||
*x = ListForwardingHistoryResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListForwardingHistoryResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListForwardingHistoryResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[14]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListForwardingHistoryResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListForwardingHistoryResponse) Descriptor() ([]byte, []int) {
|
||||
return file_circuitbreaker_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
func (x *ListForwardingHistoryResponse) GetForwards() []*Forward {
|
||||
if x != nil {
|
||||
return x.Forwards
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CircuitKey struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ShortChannelId uint64 `protobuf:"varint,1,opt,name=short_channel_id,json=shortChannelId,proto3" json:"short_channel_id,omitempty"`
|
||||
HtlcIndex uint32 `protobuf:"varint,2,opt,name=htlc_index,json=htlcIndex,proto3" json:"htlc_index,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CircuitKey) Reset() {
|
||||
*x = CircuitKey{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[15]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CircuitKey) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CircuitKey) ProtoMessage() {}
|
||||
|
||||
func (x *CircuitKey) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[15]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CircuitKey.ProtoReflect.Descriptor instead.
|
||||
func (*CircuitKey) Descriptor() ([]byte, []int) {
|
||||
return file_circuitbreaker_proto_rawDescGZIP(), []int{15}
|
||||
}
|
||||
|
||||
func (x *CircuitKey) GetShortChannelId() uint64 {
|
||||
if x != nil {
|
||||
return x.ShortChannelId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CircuitKey) GetHtlcIndex() uint32 {
|
||||
if x != nil {
|
||||
return x.HtlcIndex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Forward struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The time that the htlc was added to the incoming channel. Note that this value
|
||||
// may be zero if circuitbreaker restarted while the htlc was in flight - this
|
||||
// indicates that the value is unknown.
|
||||
AddTimeNs uint64 `protobuf:"varint,1,opt,name=add_time_ns,json=addTimeNs,proto3" json:"add_time_ns,omitempty"`
|
||||
ResolveTimeNs uint64 `protobuf:"varint,2,opt,name=resolve_time_ns,json=resolveTimeNs,proto3" json:"resolve_time_ns,omitempty"`
|
||||
Settled bool `protobuf:"varint,3,opt,name=settled,proto3" json:"settled,omitempty"`
|
||||
IncomingAmount uint64 `protobuf:"varint,4,opt,name=incoming_amount,json=incomingAmount,proto3" json:"incoming_amount,omitempty"`
|
||||
OutgoingAmount uint64 `protobuf:"varint,5,opt,name=outgoing_amount,json=outgoingAmount,proto3" json:"outgoing_amount,omitempty"`
|
||||
IncomingPeer string `protobuf:"bytes,6,opt,name=incoming_peer,json=incomingPeer,proto3" json:"incoming_peer,omitempty"`
|
||||
IncomingCircuit *CircuitKey `protobuf:"bytes,7,opt,name=incoming_circuit,json=incomingCircuit,proto3" json:"incoming_circuit,omitempty"`
|
||||
OutgoingPeer string `protobuf:"bytes,8,opt,name=outgoing_peer,json=outgoingPeer,proto3" json:"outgoing_peer,omitempty"`
|
||||
OutgoingCircuit *CircuitKey `protobuf:"bytes,9,opt,name=outgoing_circuit,json=outgoingCircuit,proto3" json:"outgoing_circuit,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Forward) Reset() {
|
||||
*x = Forward{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[16]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Forward) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Forward) ProtoMessage() {}
|
||||
|
||||
func (x *Forward) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_circuitbreaker_proto_msgTypes[16]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Forward.ProtoReflect.Descriptor instead.
|
||||
func (*Forward) Descriptor() ([]byte, []int) {
|
||||
return file_circuitbreaker_proto_rawDescGZIP(), []int{16}
|
||||
}
|
||||
|
||||
func (x *Forward) GetAddTimeNs() uint64 {
|
||||
if x != nil {
|
||||
return x.AddTimeNs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Forward) GetResolveTimeNs() uint64 {
|
||||
if x != nil {
|
||||
return x.ResolveTimeNs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Forward) GetSettled() bool {
|
||||
if x != nil {
|
||||
return x.Settled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Forward) GetIncomingAmount() uint64 {
|
||||
if x != nil {
|
||||
return x.IncomingAmount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Forward) GetOutgoingAmount() uint64 {
|
||||
if x != nil {
|
||||
return x.OutgoingAmount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Forward) GetIncomingPeer() string {
|
||||
if x != nil {
|
||||
return x.IncomingPeer
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Forward) GetIncomingCircuit() *CircuitKey {
|
||||
if x != nil {
|
||||
return x.IncomingCircuit
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Forward) GetOutgoingPeer() string {
|
||||
if x != nil {
|
||||
return x.OutgoingPeer
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Forward) GetOutgoingCircuit() *CircuitKey {
|
||||
if x != nil {
|
||||
return x.OutgoingCircuit
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_circuitbreaker_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_circuitbreaker_proto_rawDesc = []byte{
|
||||
|
|
@ -833,53 +1108,105 @@ var file_circuitbreaker_proto_rawDesc = []byte{
|
|||
0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6a,
|
||||
0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63,
|
||||
0x74, 0x2a, 0x54, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x4f, 0x44,
|
||||
0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x44, 0x45,
|
||||
0x5f, 0x51, 0x55, 0x45, 0x55, 0x45, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x4f, 0x44, 0x45,
|
||||
0x5f, 0x51, 0x55, 0x45, 0x55, 0x45, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54,
|
||||
0x49, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x44, 0x45, 0x5f,
|
||||
0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x32, 0xbe, 0x04, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e,
|
||||
0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e,
|
||||
0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f,
|
||||
0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e,
|
||||
0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x73,
|
||||
0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x23,
|
||||
0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e,
|
||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65,
|
||||
0x61, 0x6b, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||
0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x73, 0x12, 0x6f, 0x0a, 0x0b, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x69, 0x6d, 0x69,
|
||||
0x74, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61,
|
||||
0x6b, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74,
|
||||
0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4,
|
||||
0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x22, 0x0c, 0x2f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x6c, 0x69,
|
||||
0x6d, 0x69, 0x74, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44,
|
||||
0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x29, 0x2e, 0x63, 0x69,
|
||||
0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74,
|
||||
0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65,
|
||||
0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f,
|
||||
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x6c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x12, 0x64, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73,
|
||||
0x12, 0x21, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65,
|
||||
0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65,
|
||||
0x61, 0x6b, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12,
|
||||
0x07, 0x2f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67,
|
||||
0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69,
|
||||
0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74,
|
||||
0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
0x74, 0x22, 0x70, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64,
|
||||
0x69, 0x6e, 0x67, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x29, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74,
|
||||
0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x61, 0x64,
|
||||
0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x12, 0x25, 0x0a, 0x0f,
|
||||
0x61, 0x64, 0x64, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x64, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x4e, 0x73, 0x22, 0x54, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61,
|
||||
0x72, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x73,
|
||||
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74,
|
||||
0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52,
|
||||
0x08, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x55, 0x0a, 0x0a, 0x43, 0x69, 0x72,
|
||||
0x63, 0x75, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x68, 0x6f, 0x72, 0x74,
|
||||
0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x0e, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49,
|
||||
0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x68, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x64, 0x65, 0x78,
|
||||
0x22, 0x95, 0x03, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0b,
|
||||
0x61, 0x64, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x09, 0x61, 0x64, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x12, 0x26, 0x0a, 0x0f,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x4e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x27,
|
||||
0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e,
|
||||
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e,
|
||||
0x67, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x75, 0x74, 0x67, 0x6f,
|
||||
0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x0e, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x65,
|
||||
0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e,
|
||||
0x67, 0x50, 0x65, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e,
|
||||
0x67, 0x5f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x1a, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72,
|
||||
0x2e, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0f, 0x69, 0x6e, 0x63,
|
||||
0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d,
|
||||
0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x65,
|
||||
0x72, 0x12, 0x45, 0x0a, 0x10, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x69,
|
||||
0x72, 0x63, 0x75, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x69,
|
||||
0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x43, 0x69, 0x72,
|
||||
0x63, 0x75, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e,
|
||||
0x67, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x2a, 0x54, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x00, 0x12,
|
||||
0x0e, 0x0a, 0x0a, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x55, 0x45, 0x10, 0x01, 0x12,
|
||||
0x1d, 0x0a, 0x19, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x55, 0x45, 0x5f, 0x50, 0x45,
|
||||
0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0e,
|
||||
0x0a, 0x0a, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x32, 0xd2,
|
||||
0x05, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x07, 0x47, 0x65,
|
||||
0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62,
|
||||
0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62,
|
||||
0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05,
|
||||
0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x73, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c,
|
||||
0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62,
|
||||
0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x69, 0x72,
|
||||
0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x75, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x6f, 0x0a, 0x0b, 0x43, 0x6c,
|
||||
0x65, 0x61, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x69, 0x72, 0x63,
|
||||
0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72,
|
||||
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e,
|
||||
0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x43,
|
||||
0x6c, 0x65, 0x61, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x22, 0x0c, 0x2f,
|
||||
0x63, 0x6c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x12,
|
||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x12, 0x29, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61,
|
||||
0x6b, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||
0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e,
|
||||
0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x6d, 0x69,
|
||||
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||
0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x65, 0x66,
|
||||
0x61, 0x75, 0x6c, 0x74, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x64, 0x0a, 0x0a, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69,
|
||||
0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x69, 0x6d,
|
||||
0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x69, 0x72,
|
||||
0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f,
|
||||
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12,
|
||||
0x91, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69,
|
||||
0x6e, 0x67, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x69, 0x72, 0x63,
|
||||
0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46,
|
||||
0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69,
|
||||
0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72,
|
||||
0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13,
|
||||
0x2f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x69, 0x73, 0x74,
|
||||
0x6f, 0x72, 0x79, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x65, 0x71, 0x75, 0x69, 0x70,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61,
|
||||
0x6b, 0x65, 0x72, 0x2f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b,
|
||||
0x65, 0x72, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -895,26 +1222,30 @@ func file_circuitbreaker_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_circuitbreaker_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_circuitbreaker_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
|
||||
var file_circuitbreaker_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
|
||||
var file_circuitbreaker_proto_goTypes = []interface{}{
|
||||
(Mode)(0), // 0: circuitbreaker.Mode
|
||||
(*GetInfoRequest)(nil), // 1: circuitbreaker.GetInfoRequest
|
||||
(*GetInfoResponse)(nil), // 2: circuitbreaker.GetInfoResponse
|
||||
(*ClearLimitsRequest)(nil), // 3: circuitbreaker.ClearLimitsRequest
|
||||
(*ClearLimitsResponse)(nil), // 4: circuitbreaker.ClearLimitsResponse
|
||||
(*UpdateLimitsRequest)(nil), // 5: circuitbreaker.UpdateLimitsRequest
|
||||
(*UpdateLimitsResponse)(nil), // 6: circuitbreaker.UpdateLimitsResponse
|
||||
(*UpdateDefaultLimitRequest)(nil), // 7: circuitbreaker.UpdateDefaultLimitRequest
|
||||
(*UpdateDefaultLimitResponse)(nil), // 8: circuitbreaker.UpdateDefaultLimitResponse
|
||||
(*ListLimitsRequest)(nil), // 9: circuitbreaker.ListLimitsRequest
|
||||
(*ListLimitsResponse)(nil), // 10: circuitbreaker.ListLimitsResponse
|
||||
(*NodeLimit)(nil), // 11: circuitbreaker.NodeLimit
|
||||
(*Limit)(nil), // 12: circuitbreaker.Limit
|
||||
(*Counter)(nil), // 13: circuitbreaker.Counter
|
||||
nil, // 14: circuitbreaker.UpdateLimitsRequest.LimitsEntry
|
||||
(Mode)(0), // 0: circuitbreaker.Mode
|
||||
(*GetInfoRequest)(nil), // 1: circuitbreaker.GetInfoRequest
|
||||
(*GetInfoResponse)(nil), // 2: circuitbreaker.GetInfoResponse
|
||||
(*ClearLimitsRequest)(nil), // 3: circuitbreaker.ClearLimitsRequest
|
||||
(*ClearLimitsResponse)(nil), // 4: circuitbreaker.ClearLimitsResponse
|
||||
(*UpdateLimitsRequest)(nil), // 5: circuitbreaker.UpdateLimitsRequest
|
||||
(*UpdateLimitsResponse)(nil), // 6: circuitbreaker.UpdateLimitsResponse
|
||||
(*UpdateDefaultLimitRequest)(nil), // 7: circuitbreaker.UpdateDefaultLimitRequest
|
||||
(*UpdateDefaultLimitResponse)(nil), // 8: circuitbreaker.UpdateDefaultLimitResponse
|
||||
(*ListLimitsRequest)(nil), // 9: circuitbreaker.ListLimitsRequest
|
||||
(*ListLimitsResponse)(nil), // 10: circuitbreaker.ListLimitsResponse
|
||||
(*NodeLimit)(nil), // 11: circuitbreaker.NodeLimit
|
||||
(*Limit)(nil), // 12: circuitbreaker.Limit
|
||||
(*Counter)(nil), // 13: circuitbreaker.Counter
|
||||
(*ListForwardingHistoryRequest)(nil), // 14: circuitbreaker.ListForwardingHistoryRequest
|
||||
(*ListForwardingHistoryResponse)(nil), // 15: circuitbreaker.ListForwardingHistoryResponse
|
||||
(*CircuitKey)(nil), // 16: circuitbreaker.CircuitKey
|
||||
(*Forward)(nil), // 17: circuitbreaker.Forward
|
||||
nil, // 18: circuitbreaker.UpdateLimitsRequest.LimitsEntry
|
||||
}
|
||||
var file_circuitbreaker_proto_depIdxs = []int32{
|
||||
14, // 0: circuitbreaker.UpdateLimitsRequest.limits:type_name -> circuitbreaker.UpdateLimitsRequest.LimitsEntry
|
||||
18, // 0: circuitbreaker.UpdateLimitsRequest.limits:type_name -> circuitbreaker.UpdateLimitsRequest.LimitsEntry
|
||||
12, // 1: circuitbreaker.UpdateDefaultLimitRequest.limit:type_name -> circuitbreaker.Limit
|
||||
11, // 2: circuitbreaker.ListLimitsResponse.limits:type_name -> circuitbreaker.NodeLimit
|
||||
12, // 3: circuitbreaker.ListLimitsResponse.default_limit:type_name -> circuitbreaker.Limit
|
||||
|
|
@ -922,22 +1253,27 @@ var file_circuitbreaker_proto_depIdxs = []int32{
|
|||
13, // 5: circuitbreaker.NodeLimit.counter_1h:type_name -> circuitbreaker.Counter
|
||||
13, // 6: circuitbreaker.NodeLimit.counter_24h:type_name -> circuitbreaker.Counter
|
||||
0, // 7: circuitbreaker.Limit.mode:type_name -> circuitbreaker.Mode
|
||||
12, // 8: circuitbreaker.UpdateLimitsRequest.LimitsEntry.value:type_name -> circuitbreaker.Limit
|
||||
1, // 9: circuitbreaker.Service.GetInfo:input_type -> circuitbreaker.GetInfoRequest
|
||||
5, // 10: circuitbreaker.Service.UpdateLimits:input_type -> circuitbreaker.UpdateLimitsRequest
|
||||
3, // 11: circuitbreaker.Service.ClearLimits:input_type -> circuitbreaker.ClearLimitsRequest
|
||||
7, // 12: circuitbreaker.Service.UpdateDefaultLimit:input_type -> circuitbreaker.UpdateDefaultLimitRequest
|
||||
9, // 13: circuitbreaker.Service.ListLimits:input_type -> circuitbreaker.ListLimitsRequest
|
||||
2, // 14: circuitbreaker.Service.GetInfo:output_type -> circuitbreaker.GetInfoResponse
|
||||
6, // 15: circuitbreaker.Service.UpdateLimits:output_type -> circuitbreaker.UpdateLimitsResponse
|
||||
4, // 16: circuitbreaker.Service.ClearLimits:output_type -> circuitbreaker.ClearLimitsResponse
|
||||
8, // 17: circuitbreaker.Service.UpdateDefaultLimit:output_type -> circuitbreaker.UpdateDefaultLimitResponse
|
||||
10, // 18: circuitbreaker.Service.ListLimits:output_type -> circuitbreaker.ListLimitsResponse
|
||||
14, // [14:19] is the sub-list for method output_type
|
||||
9, // [9:14] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
17, // 8: circuitbreaker.ListForwardingHistoryResponse.forwards:type_name -> circuitbreaker.Forward
|
||||
16, // 9: circuitbreaker.Forward.incoming_circuit:type_name -> circuitbreaker.CircuitKey
|
||||
16, // 10: circuitbreaker.Forward.outgoing_circuit:type_name -> circuitbreaker.CircuitKey
|
||||
12, // 11: circuitbreaker.UpdateLimitsRequest.LimitsEntry.value:type_name -> circuitbreaker.Limit
|
||||
1, // 12: circuitbreaker.Service.GetInfo:input_type -> circuitbreaker.GetInfoRequest
|
||||
5, // 13: circuitbreaker.Service.UpdateLimits:input_type -> circuitbreaker.UpdateLimitsRequest
|
||||
3, // 14: circuitbreaker.Service.ClearLimits:input_type -> circuitbreaker.ClearLimitsRequest
|
||||
7, // 15: circuitbreaker.Service.UpdateDefaultLimit:input_type -> circuitbreaker.UpdateDefaultLimitRequest
|
||||
9, // 16: circuitbreaker.Service.ListLimits:input_type -> circuitbreaker.ListLimitsRequest
|
||||
14, // 17: circuitbreaker.Service.ListForwardingHistory:input_type -> circuitbreaker.ListForwardingHistoryRequest
|
||||
2, // 18: circuitbreaker.Service.GetInfo:output_type -> circuitbreaker.GetInfoResponse
|
||||
6, // 19: circuitbreaker.Service.UpdateLimits:output_type -> circuitbreaker.UpdateLimitsResponse
|
||||
4, // 20: circuitbreaker.Service.ClearLimits:output_type -> circuitbreaker.ClearLimitsResponse
|
||||
8, // 21: circuitbreaker.Service.UpdateDefaultLimit:output_type -> circuitbreaker.UpdateDefaultLimitResponse
|
||||
10, // 22: circuitbreaker.Service.ListLimits:output_type -> circuitbreaker.ListLimitsResponse
|
||||
15, // 23: circuitbreaker.Service.ListForwardingHistory:output_type -> circuitbreaker.ListForwardingHistoryResponse
|
||||
18, // [18:24] is the sub-list for method output_type
|
||||
12, // [12:18] is the sub-list for method input_type
|
||||
12, // [12:12] is the sub-list for extension type_name
|
||||
12, // [12:12] is the sub-list for extension extendee
|
||||
0, // [0:12] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_circuitbreaker_proto_init() }
|
||||
|
|
@ -1102,6 +1438,54 @@ func file_circuitbreaker_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_circuitbreaker_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListForwardingHistoryRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_circuitbreaker_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListForwardingHistoryResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_circuitbreaker_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CircuitKey); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_circuitbreaker_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Forward); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
|
@ -1109,7 +1493,7 @@ func file_circuitbreaker_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_circuitbreaker_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 14,
|
||||
NumMessages: 18,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -169,6 +169,42 @@ func local_request_Service_ListLimits_0(ctx context.Context, marshaler runtime.M
|
|||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Service_ListForwardingHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Service_ListForwardingHistory_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListForwardingHistoryRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_ListForwardingHistory_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListForwardingHistory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Service_ListForwardingHistory_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListForwardingHistoryRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_ListForwardingHistory_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListForwardingHistory(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterServiceHandlerServer registers the http handlers for service Service to "mux".
|
||||
// UnaryRPC :call ServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
|
|
@ -290,6 +326,29 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Service_ListForwardingHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/circuitbreaker.Service/ListForwardingHistory", runtime.WithHTTPPathPattern("/forwarding_history"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Service_ListForwardingHistory_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Service_ListForwardingHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -431,6 +490,26 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Service_ListForwardingHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/circuitbreaker.Service/ListForwardingHistory", runtime.WithHTTPPathPattern("/forwarding_history"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Service_ListForwardingHistory_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Service_ListForwardingHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -444,6 +523,8 @@ var (
|
|||
pattern_Service_UpdateDefaultLimit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"updatedefaultlimit"}, ""))
|
||||
|
||||
pattern_Service_ListLimits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"limits"}, ""))
|
||||
|
||||
pattern_Service_ListForwardingHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"forwarding_history"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -456,4 +537,6 @@ var (
|
|||
forward_Service_UpdateDefaultLimit_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Service_ListLimits_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Service_ListForwardingHistory_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1000,3 +1000,324 @@ var _ interface {
|
|||
Cause() error
|
||||
ErrorName() string
|
||||
} = CounterValidationError{}
|
||||
|
||||
// Validate checks the field values on ListForwardingHistoryRequest with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, an error is returned.
|
||||
func (m *ListForwardingHistoryRequest) Validate() error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// no validation rules for AddStartTimeNs
|
||||
|
||||
// no validation rules for AddEndTimeNs
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListForwardingHistoryRequestValidationError is the validation error returned
|
||||
// by ListForwardingHistoryRequest.Validate if the designated constraints
|
||||
// aren't met.
|
||||
type ListForwardingHistoryRequestValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ListForwardingHistoryRequestValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ListForwardingHistoryRequestValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ListForwardingHistoryRequestValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ListForwardingHistoryRequestValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ListForwardingHistoryRequestValidationError) ErrorName() string {
|
||||
return "ListForwardingHistoryRequestValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ListForwardingHistoryRequestValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sListForwardingHistoryRequest.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ListForwardingHistoryRequestValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ListForwardingHistoryRequestValidationError{}
|
||||
|
||||
// Validate checks the field values on ListForwardingHistoryResponse with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, an error is returned.
|
||||
func (m *ListForwardingHistoryResponse) Validate() error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
for idx, item := range m.GetForwards() {
|
||||
_, _ = idx, item
|
||||
|
||||
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ListForwardingHistoryResponseValidationError{
|
||||
field: fmt.Sprintf("Forwards[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListForwardingHistoryResponseValidationError is the validation error
|
||||
// returned by ListForwardingHistoryResponse.Validate if the designated
|
||||
// constraints aren't met.
|
||||
type ListForwardingHistoryResponseValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ListForwardingHistoryResponseValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ListForwardingHistoryResponseValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ListForwardingHistoryResponseValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ListForwardingHistoryResponseValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ListForwardingHistoryResponseValidationError) ErrorName() string {
|
||||
return "ListForwardingHistoryResponseValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ListForwardingHistoryResponseValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sListForwardingHistoryResponse.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ListForwardingHistoryResponseValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ListForwardingHistoryResponseValidationError{}
|
||||
|
||||
// Validate checks the field values on CircuitKey with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, an error is returned.
|
||||
func (m *CircuitKey) Validate() error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// no validation rules for ShortChannelId
|
||||
|
||||
// no validation rules for HtlcIndex
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CircuitKeyValidationError is the validation error returned by
|
||||
// CircuitKey.Validate if the designated constraints aren't met.
|
||||
type CircuitKeyValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CircuitKeyValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CircuitKeyValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CircuitKeyValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CircuitKeyValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CircuitKeyValidationError) ErrorName() string { return "CircuitKeyValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CircuitKeyValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCircuitKey.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CircuitKeyValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CircuitKeyValidationError{}
|
||||
|
||||
// Validate checks the field values on Forward with the rules defined in the
|
||||
// proto definition for this message. If any rules are violated, an error is returned.
|
||||
func (m *Forward) Validate() error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// no validation rules for AddTimeNs
|
||||
|
||||
// no validation rules for ResolveTimeNs
|
||||
|
||||
// no validation rules for Settled
|
||||
|
||||
// no validation rules for IncomingAmount
|
||||
|
||||
// no validation rules for OutgoingAmount
|
||||
|
||||
// no validation rules for IncomingPeer
|
||||
|
||||
if v, ok := interface{}(m.GetIncomingCircuit()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ForwardValidationError{
|
||||
field: "IncomingCircuit",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no validation rules for OutgoingPeer
|
||||
|
||||
if v, ok := interface{}(m.GetOutgoingCircuit()).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ForwardValidationError{
|
||||
field: "OutgoingCircuit",
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ForwardValidationError is the validation error returned by Forward.Validate
|
||||
// if the designated constraints aren't met.
|
||||
type ForwardValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ForwardValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ForwardValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ForwardValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ForwardValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ForwardValidationError) ErrorName() string { return "ForwardValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ForwardValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sForward.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ForwardValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ForwardValidationError{}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,12 @@ service Service {
|
|||
get:"/limits"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListForwardingHistory (ListForwardingHistoryRequest) returns (ListForwardingHistoryResponse) {
|
||||
option (google.api.http) = {
|
||||
get:"/forwarding_history"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message GetInfoRequest {}
|
||||
|
|
@ -108,4 +114,38 @@ message Counter {
|
|||
int64 fail = 1;
|
||||
int64 success = 2;
|
||||
int64 reject = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message ListForwardingHistoryRequest {
|
||||
// The inclusive start time for the query, used to filter HTLCs by the time they were added
|
||||
// to local incoming channel. If this value is zero, it will be treated as the unix epoch.
|
||||
int64 add_start_time_ns = 1;
|
||||
|
||||
// The exclusive end time for the query, used to filter HTLCs by the time they were added to
|
||||
// the local incoming channel. If this value is zero, it will be assumed to be the current time.
|
||||
int64 add_end_time_ns = 2;
|
||||
}
|
||||
|
||||
message ListForwardingHistoryResponse {
|
||||
repeated Forward forwards = 1;
|
||||
}
|
||||
|
||||
message CircuitKey {
|
||||
uint64 short_channel_id = 1;
|
||||
uint32 htlc_index = 2;
|
||||
}
|
||||
|
||||
message Forward {
|
||||
// The time that the htlc was added to the incoming channel. Note that this value
|
||||
// may be zero if circuitbreaker restarted while the htlc was in flight - this
|
||||
// indicates that the value is unknown.
|
||||
uint64 add_time_ns = 1;
|
||||
uint64 resolve_time_ns = 2;
|
||||
bool settled = 3;
|
||||
uint64 incoming_amount = 4;
|
||||
uint64 outgoing_amount = 5;
|
||||
string incoming_peer = 6;
|
||||
CircuitKey incoming_circuit = 7;
|
||||
string outgoing_peer = 8;
|
||||
CircuitKey outgoing_circuit = 9;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ type ServiceClient interface {
|
|||
ClearLimits(ctx context.Context, in *ClearLimitsRequest, opts ...grpc.CallOption) (*ClearLimitsResponse, error)
|
||||
UpdateDefaultLimit(ctx context.Context, in *UpdateDefaultLimitRequest, opts ...grpc.CallOption) (*UpdateDefaultLimitResponse, error)
|
||||
ListLimits(ctx context.Context, in *ListLimitsRequest, opts ...grpc.CallOption) (*ListLimitsResponse, error)
|
||||
ListForwardingHistory(ctx context.Context, in *ListForwardingHistoryRequest, opts ...grpc.CallOption) (*ListForwardingHistoryResponse, error)
|
||||
}
|
||||
|
||||
type serviceClient struct {
|
||||
|
|
@ -79,6 +80,15 @@ func (c *serviceClient) ListLimits(ctx context.Context, in *ListLimitsRequest, o
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) ListForwardingHistory(ctx context.Context, in *ListForwardingHistoryRequest, opts ...grpc.CallOption) (*ListForwardingHistoryResponse, error) {
|
||||
out := new(ListForwardingHistoryResponse)
|
||||
err := c.cc.Invoke(ctx, "/circuitbreaker.Service/ListForwardingHistory", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceServer is the server API for Service service.
|
||||
// All implementations must embed UnimplementedServiceServer
|
||||
// for forward compatibility
|
||||
|
|
@ -89,6 +99,7 @@ type ServiceServer interface {
|
|||
ClearLimits(context.Context, *ClearLimitsRequest) (*ClearLimitsResponse, error)
|
||||
UpdateDefaultLimit(context.Context, *UpdateDefaultLimitRequest) (*UpdateDefaultLimitResponse, error)
|
||||
ListLimits(context.Context, *ListLimitsRequest) (*ListLimitsResponse, error)
|
||||
ListForwardingHistory(context.Context, *ListForwardingHistoryRequest) (*ListForwardingHistoryResponse, error)
|
||||
mustEmbedUnimplementedServiceServer()
|
||||
}
|
||||
|
||||
|
|
@ -111,6 +122,9 @@ func (UnimplementedServiceServer) UpdateDefaultLimit(context.Context, *UpdateDef
|
|||
func (UnimplementedServiceServer) ListLimits(context.Context, *ListLimitsRequest) (*ListLimitsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListLimits not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) ListForwardingHistory(context.Context, *ListForwardingHistoryRequest) (*ListForwardingHistoryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListForwardingHistory not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
|
||||
|
||||
// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
|
|
@ -214,6 +228,24 @@ func _Service_ListLimits_Handler(srv interface{}, ctx context.Context, dec func(
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_ListForwardingHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListForwardingHistoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).ListForwardingHistory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/circuitbreaker.Service/ListForwardingHistory",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).ListForwardingHistory(ctx, req.(*ListForwardingHistoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
|
@ -241,6 +273,10 @@ var Service_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "ListLimits",
|
||||
Handler: _Service_ListLimits_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListForwardingHistory",
|
||||
Handler: _Service_ListForwardingHistory_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "circuitbreaker.proto",
|
||||
|
|
|
|||
62
server.go
62
server.go
|
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/lightningequipment/circuitbreaker/circuitbreakerrpc"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
|
|
@ -311,3 +312,64 @@ func (s *server) ListLimits(ctx context.Context,
|
|||
Limits: rpcLimits,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListForwardingHistory(ctx context.Context,
|
||||
req *circuitbreakerrpc.ListForwardingHistoryRequest) (
|
||||
*circuitbreakerrpc.ListForwardingHistoryResponse, error) {
|
||||
|
||||
var (
|
||||
// By default query from the epoch until now.
|
||||
startTime = time.Time{}
|
||||
endTime = time.Now()
|
||||
)
|
||||
|
||||
if req.AddStartTimeNs != 0 {
|
||||
startTime = time.Unix(0, req.AddStartTimeNs)
|
||||
}
|
||||
|
||||
if req.AddEndTimeNs != 0 {
|
||||
endTime = time.Unix(0, req.AddEndTimeNs)
|
||||
}
|
||||
|
||||
if startTime.After(endTime) {
|
||||
return nil, fmt.Errorf("start time: %v after end time: %v", startTime,
|
||||
endTime)
|
||||
}
|
||||
|
||||
htlcs, err := s.db.ListForwardingHistory(ctx, startTime, endTime)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &circuitbreakerrpc.ListForwardingHistoryResponse{
|
||||
Forwards: s.marshalFwdHistory(htlcs),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *server) marshalFwdHistory(htlcs []*HtlcInfo) []*circuitbreakerrpc.Forward {
|
||||
rpcHtlcs := make([]*circuitbreakerrpc.Forward, len(htlcs))
|
||||
|
||||
for i, htlc := range htlcs {
|
||||
forward := &circuitbreakerrpc.Forward{
|
||||
AddTimeNs: uint64(htlc.addTime.UnixNano()),
|
||||
ResolveTimeNs: uint64(htlc.resolveTime.UnixNano()),
|
||||
Settled: htlc.settled,
|
||||
IncomingAmount: uint64(htlc.incomingMsat),
|
||||
OutgoingAmount: uint64(htlc.outgoingMsat),
|
||||
IncomingPeer: htlc.incomingPeer.String(),
|
||||
IncomingCircuit: &circuitbreakerrpc.CircuitKey{
|
||||
ShortChannelId: htlc.incomingCircuit.channel,
|
||||
HtlcIndex: uint32(htlc.incomingCircuit.htlc),
|
||||
},
|
||||
OutgoingPeer: htlc.outgoingPeer.String(),
|
||||
OutgoingCircuit: &circuitbreakerrpc.CircuitKey{
|
||||
ShortChannelId: htlc.outgoingCircuit.channel,
|
||||
HtlcIndex: uint32(htlc.outgoingCircuit.htlc),
|
||||
},
|
||||
}
|
||||
|
||||
rpcHtlcs[i] = forward
|
||||
}
|
||||
|
||||
return rpcHtlcs
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue