package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
_ = protoimpl .EnforceVersion (20 - protoimpl .MinVersion )
_ = protoimpl .EnforceVersion (protoimpl .MaxVersion - 20 )
)
type Status int32
const (
Status_UNUSED Status = 0
Status_OK Status = 100
Status_RESERVATION_REFUSED Status = 200
Status_RESOURCE_LIMIT_EXCEEDED Status = 201
Status_PERMISSION_DENIED Status = 202
Status_CONNECTION_FAILED Status = 203
Status_NO_RESERVATION Status = 204
Status_MALFORMED_MESSAGE Status = 400
Status_UNEXPECTED_MESSAGE Status = 401
)
var (
Status_name = map [int32 ]string {
0 : "UNUSED" ,
100 : "OK" ,
200 : "RESERVATION_REFUSED" ,
201 : "RESOURCE_LIMIT_EXCEEDED" ,
202 : "PERMISSION_DENIED" ,
203 : "CONNECTION_FAILED" ,
204 : "NO_RESERVATION" ,
400 : "MALFORMED_MESSAGE" ,
401 : "UNEXPECTED_MESSAGE" ,
}
Status_value = map [string ]int32 {
"UNUSED" : 0 ,
"OK" : 100 ,
"RESERVATION_REFUSED" : 200 ,
"RESOURCE_LIMIT_EXCEEDED" : 201 ,
"PERMISSION_DENIED" : 202 ,
"CONNECTION_FAILED" : 203 ,
"NO_RESERVATION" : 204 ,
"MALFORMED_MESSAGE" : 400 ,
"UNEXPECTED_MESSAGE" : 401 ,
}
)
func (x Status ) Enum () *Status {
p := new (Status )
*p = x
return p
}
func (x Status ) String () string {
return protoimpl .X .EnumStringOf (x .Descriptor (), protoreflect .EnumNumber (x ))
}
func (Status ) Descriptor () protoreflect .EnumDescriptor {
return file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes [0 ].Descriptor ()
}
func (Status ) Type () protoreflect .EnumType {
return &file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes [0 ]
}
func (x Status ) Number () protoreflect .EnumNumber {
return protoreflect .EnumNumber (x )
}
func (Status ) EnumDescriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {0 }
}
type HopMessage_Type int32
const (
HopMessage_RESERVE HopMessage_Type = 0
HopMessage_CONNECT HopMessage_Type = 1
HopMessage_STATUS HopMessage_Type = 2
)
var (
HopMessage_Type_name = map [int32 ]string {
0 : "RESERVE" ,
1 : "CONNECT" ,
2 : "STATUS" ,
}
HopMessage_Type_value = map [string ]int32 {
"RESERVE" : 0 ,
"CONNECT" : 1 ,
"STATUS" : 2 ,
}
)
func (x HopMessage_Type ) Enum () *HopMessage_Type {
p := new (HopMessage_Type )
*p = x
return p
}
func (x HopMessage_Type ) String () string {
return protoimpl .X .EnumStringOf (x .Descriptor (), protoreflect .EnumNumber (x ))
}
func (HopMessage_Type ) Descriptor () protoreflect .EnumDescriptor {
return file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes [1 ].Descriptor ()
}
func (HopMessage_Type ) Type () protoreflect .EnumType {
return &file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes [1 ]
}
func (x HopMessage_Type ) Number () protoreflect .EnumNumber {
return protoreflect .EnumNumber (x )
}
func (HopMessage_Type ) EnumDescriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {0 , 0 }
}
type StopMessage_Type int32
const (
StopMessage_CONNECT StopMessage_Type = 0
StopMessage_STATUS StopMessage_Type = 1
)
var (
StopMessage_Type_name = map [int32 ]string {
0 : "CONNECT" ,
1 : "STATUS" ,
}
StopMessage_Type_value = map [string ]int32 {
"CONNECT" : 0 ,
"STATUS" : 1 ,
}
)
func (x StopMessage_Type ) Enum () *StopMessage_Type {
p := new (StopMessage_Type )
*p = x
return p
}
func (x StopMessage_Type ) String () string {
return protoimpl .X .EnumStringOf (x .Descriptor (), protoreflect .EnumNumber (x ))
}
func (StopMessage_Type ) Descriptor () protoreflect .EnumDescriptor {
return file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes [2 ].Descriptor ()
}
func (StopMessage_Type ) Type () protoreflect .EnumType {
return &file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes [2 ]
}
func (x StopMessage_Type ) Number () protoreflect .EnumNumber {
return protoreflect .EnumNumber (x )
}
func (StopMessage_Type ) EnumDescriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {1 , 0 }
}
type HopMessage struct {
state protoimpl .MessageState `protogen:"open.v1"`
Type *HopMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=circuit.pb.HopMessage_Type,oneof" json:"type,omitempty"`
Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"`
Reservation *Reservation `protobuf:"bytes,3,opt,name=reservation,proto3,oneof" json:"reservation,omitempty"`
Limit *Limit `protobuf:"bytes,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
Status *Status `protobuf:"varint,5,opt,name=status,proto3,enum=circuit.pb.Status,oneof" json:"status,omitempty"`
unknownFields protoimpl .UnknownFields
sizeCache protoimpl .SizeCache
}
func (x *HopMessage ) Reset () {
*x = HopMessage {}
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [0 ]
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
ms .StoreMessageInfo (mi )
}
func (x *HopMessage ) String () string {
return protoimpl .X .MessageStringOf (x )
}
func (*HopMessage ) ProtoMessage () {}
func (x *HopMessage ) ProtoReflect () protoreflect .Message {
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [0 ]
if x != nil {
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
if ms .LoadMessageInfo () == nil {
ms .StoreMessageInfo (mi )
}
return ms
}
return mi .MessageOf (x )
}
func (*HopMessage ) Descriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {0 }
}
func (x *HopMessage ) GetType () HopMessage_Type {
if x != nil && x .Type != nil {
return *x .Type
}
return HopMessage_RESERVE
}
func (x *HopMessage ) GetPeer () *Peer {
if x != nil {
return x .Peer
}
return nil
}
func (x *HopMessage ) GetReservation () *Reservation {
if x != nil {
return x .Reservation
}
return nil
}
func (x *HopMessage ) GetLimit () *Limit {
if x != nil {
return x .Limit
}
return nil
}
func (x *HopMessage ) GetStatus () Status {
if x != nil && x .Status != nil {
return *x .Status
}
return Status_UNUSED
}
type StopMessage struct {
state protoimpl .MessageState `protogen:"open.v1"`
Type *StopMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=circuit.pb.StopMessage_Type,oneof" json:"type,omitempty"`
Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"`
Limit *Limit `protobuf:"bytes,3,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
Status *Status `protobuf:"varint,4,opt,name=status,proto3,enum=circuit.pb.Status,oneof" json:"status,omitempty"`
unknownFields protoimpl .UnknownFields
sizeCache protoimpl .SizeCache
}
func (x *StopMessage ) Reset () {
*x = StopMessage {}
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [1 ]
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
ms .StoreMessageInfo (mi )
}
func (x *StopMessage ) String () string {
return protoimpl .X .MessageStringOf (x )
}
func (*StopMessage ) ProtoMessage () {}
func (x *StopMessage ) ProtoReflect () protoreflect .Message {
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [1 ]
if x != nil {
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
if ms .LoadMessageInfo () == nil {
ms .StoreMessageInfo (mi )
}
return ms
}
return mi .MessageOf (x )
}
func (*StopMessage ) Descriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {1 }
}
func (x *StopMessage ) GetType () StopMessage_Type {
if x != nil && x .Type != nil {
return *x .Type
}
return StopMessage_CONNECT
}
func (x *StopMessage ) GetPeer () *Peer {
if x != nil {
return x .Peer
}
return nil
}
func (x *StopMessage ) GetLimit () *Limit {
if x != nil {
return x .Limit
}
return nil
}
func (x *StopMessage ) GetStatus () Status {
if x != nil && x .Status != nil {
return *x .Status
}
return Status_UNUSED
}
type Peer struct {
state protoimpl .MessageState `protogen:"open.v1"`
Id []byte `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"`
unknownFields protoimpl .UnknownFields
sizeCache protoimpl .SizeCache
}
func (x *Peer ) Reset () {
*x = Peer {}
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [2 ]
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
ms .StoreMessageInfo (mi )
}
func (x *Peer ) String () string {
return protoimpl .X .MessageStringOf (x )
}
func (*Peer ) ProtoMessage () {}
func (x *Peer ) ProtoReflect () protoreflect .Message {
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [2 ]
if x != nil {
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
if ms .LoadMessageInfo () == nil {
ms .StoreMessageInfo (mi )
}
return ms
}
return mi .MessageOf (x )
}
func (*Peer ) Descriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {2 }
}
func (x *Peer ) GetId () []byte {
if x != nil {
return x .Id
}
return nil
}
func (x *Peer ) GetAddrs () [][]byte {
if x != nil {
return x .Addrs
}
return nil
}
type Reservation struct {
state protoimpl .MessageState `protogen:"open.v1"`
Expire *uint64 `protobuf:"varint,1,opt,name=expire,proto3,oneof" json:"expire,omitempty"`
Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"`
Voucher []byte `protobuf:"bytes,3,opt,name=voucher,proto3,oneof" json:"voucher,omitempty"`
unknownFields protoimpl .UnknownFields
sizeCache protoimpl .SizeCache
}
func (x *Reservation ) Reset () {
*x = Reservation {}
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [3 ]
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
ms .StoreMessageInfo (mi )
}
func (x *Reservation ) String () string {
return protoimpl .X .MessageStringOf (x )
}
func (*Reservation ) ProtoMessage () {}
func (x *Reservation ) ProtoReflect () protoreflect .Message {
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [3 ]
if x != nil {
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
if ms .LoadMessageInfo () == nil {
ms .StoreMessageInfo (mi )
}
return ms
}
return mi .MessageOf (x )
}
func (*Reservation ) Descriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {3 }
}
func (x *Reservation ) GetExpire () uint64 {
if x != nil && x .Expire != nil {
return *x .Expire
}
return 0
}
func (x *Reservation ) GetAddrs () [][]byte {
if x != nil {
return x .Addrs
}
return nil
}
func (x *Reservation ) GetVoucher () []byte {
if x != nil {
return x .Voucher
}
return nil
}
type Limit struct {
state protoimpl .MessageState `protogen:"open.v1"`
Duration *uint32 `protobuf:"varint,1,opt,name=duration,proto3,oneof" json:"duration,omitempty"`
Data *uint64 `protobuf:"varint,2,opt,name=data,proto3,oneof" json:"data,omitempty"`
unknownFields protoimpl .UnknownFields
sizeCache protoimpl .SizeCache
}
func (x *Limit ) Reset () {
*x = Limit {}
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [4 ]
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
ms .StoreMessageInfo (mi )
}
func (x *Limit ) String () string {
return protoimpl .X .MessageStringOf (x )
}
func (*Limit ) ProtoMessage () {}
func (x *Limit ) ProtoReflect () protoreflect .Message {
mi := &file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [4 ]
if x != nil {
ms := protoimpl .X .MessageStateOf (protoimpl .Pointer (x ))
if ms .LoadMessageInfo () == nil {
ms .StoreMessageInfo (mi )
}
return ms
}
return mi .MessageOf (x )
}
func (*Limit ) Descriptor () ([]byte , []int ) {
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP (), []int {4 }
}
func (x *Limit ) GetDuration () uint32 {
if x != nil && x .Duration != nil {
return *x .Duration
}
return 0
}
func (x *Limit ) GetData () uint64 {
if x != nil && x .Data != nil {
return *x .Data
}
return 0
}
var File_p2p_protocol_circuitv2_pb_circuit_proto protoreflect .FileDescriptor
const file_p2p_protocol_circuitv2_pb_circuit_proto_rawDesc = "" +
"\n" +
"'p2p/protocol/circuitv2/pb/circuit.proto\x12\n" +
"circuit.pb\"\xf1\x02\n" +
"\n" +
"HopMessage\x124\n" +
"\x04type\x18\x01 \x01(\x0e2\x1b.circuit.pb.HopMessage.TypeH\x00R\x04type\x88\x01\x01\x12)\n" +
"\x04peer\x18\x02 \x01(\v2\x10.circuit.pb.PeerH\x01R\x04peer\x88\x01\x01\x12>\n" +
"\vreservation\x18\x03 \x01(\v2\x17.circuit.pb.ReservationH\x02R\vreservation\x88\x01\x01\x12,\n" +
"\x05limit\x18\x04 \x01(\v2\x11.circuit.pb.LimitH\x03R\x05limit\x88\x01\x01\x12/\n" +
"\x06status\x18\x05 \x01(\x0e2\x12.circuit.pb.StatusH\x04R\x06status\x88\x01\x01\",\n" +
"\x04Type\x12\v\n" +
"\aRESERVE\x10\x00\x12\v\n" +
"\aCONNECT\x10\x01\x12\n" +
"\n" +
"\x06STATUS\x10\x02B\a\n" +
"\x05_typeB\a\n" +
"\x05_peerB\x0e\n" +
"\f_reservationB\b\n" +
"\x06_limitB\t\n" +
"\a_status\"\x96\x02\n" +
"\vStopMessage\x125\n" +
"\x04type\x18\x01 \x01(\x0e2\x1c.circuit.pb.StopMessage.TypeH\x00R\x04type\x88\x01\x01\x12)\n" +
"\x04peer\x18\x02 \x01(\v2\x10.circuit.pb.PeerH\x01R\x04peer\x88\x01\x01\x12,\n" +
"\x05limit\x18\x03 \x01(\v2\x11.circuit.pb.LimitH\x02R\x05limit\x88\x01\x01\x12/\n" +
"\x06status\x18\x04 \x01(\x0e2\x12.circuit.pb.StatusH\x03R\x06status\x88\x01\x01\"\x1f\n" +
"\x04Type\x12\v\n" +
"\aCONNECT\x10\x00\x12\n" +
"\n" +
"\x06STATUS\x10\x01B\a\n" +
"\x05_typeB\a\n" +
"\x05_peerB\b\n" +
"\x06_limitB\t\n" +
"\a_status\"8\n" +
"\x04Peer\x12\x13\n" +
"\x02id\x18\x01 \x01(\fH\x00R\x02id\x88\x01\x01\x12\x14\n" +
"\x05addrs\x18\x02 \x03(\fR\x05addrsB\x05\n" +
"\x03_id\"v\n" +
"\vReservation\x12\x1b\n" +
"\x06expire\x18\x01 \x01(\x04H\x00R\x06expire\x88\x01\x01\x12\x14\n" +
"\x05addrs\x18\x02 \x03(\fR\x05addrs\x12\x1d\n" +
"\avoucher\x18\x03 \x01(\fH\x01R\avoucher\x88\x01\x01B\t\n" +
"\a_expireB\n" +
"\n" +
"\b_voucher\"W\n" +
"\x05Limit\x12\x1f\n" +
"\bduration\x18\x01 \x01(\rH\x00R\bduration\x88\x01\x01\x12\x17\n" +
"\x04data\x18\x02 \x01(\x04H\x01R\x04data\x88\x01\x01B\v\n" +
"\t_durationB\a\n" +
"\x05_data*\xca\x01\n" +
"\x06Status\x12\n" +
"\n" +
"\x06UNUSED\x10\x00\x12\x06\n" +
"\x02OK\x10d\x12\x18\n" +
"\x13RESERVATION_REFUSED\x10\xc8\x01\x12\x1c\n" +
"\x17RESOURCE_LIMIT_EXCEEDED\x10\xc9\x01\x12\x16\n" +
"\x11PERMISSION_DENIED\x10\xca\x01\x12\x16\n" +
"\x11CONNECTION_FAILED\x10\xcb\x01\x12\x13\n" +
"\x0eNO_RESERVATION\x10\xcc\x01\x12\x16\n" +
"\x11MALFORMED_MESSAGE\x10\x90\x03\x12\x17\n" +
"\x12UNEXPECTED_MESSAGE\x10\x91\x03B7Z5github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pbb\x06proto3"
var (
file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescOnce sync .Once
file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescData []byte
)
func file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescGZIP() []byte {
file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescOnce .Do (func () {
file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescData = protoimpl .X .CompressGZIP (unsafe .Slice (unsafe .StringData (file_p2p_protocol_circuitv2_pb_circuit_proto_rawDesc ), len (file_p2p_protocol_circuitv2_pb_circuit_proto_rawDesc )))
})
return file_p2p_protocol_circuitv2_pb_circuit_proto_rawDescData
}
var file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes = make ([]protoimpl .EnumInfo , 3 )
var file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes = make ([]protoimpl .MessageInfo , 5 )
var file_p2p_protocol_circuitv2_pb_circuit_proto_goTypes = []any {
(Status )(0 ),
(HopMessage_Type )(0 ),
(StopMessage_Type )(0 ),
(*HopMessage )(nil ),
(*StopMessage )(nil ),
(*Peer )(nil ),
(*Reservation )(nil ),
(*Limit )(nil ),
}
var file_p2p_protocol_circuitv2_pb_circuit_proto_depIdxs = []int32 {
1 ,
5 ,
6 ,
7 ,
0 ,
2 ,
5 ,
7 ,
0 ,
9 ,
9 ,
9 ,
9 ,
0 ,
}
func init() { file_p2p_protocol_circuitv2_pb_circuit_proto_init () }
func file_p2p_protocol_circuitv2_pb_circuit_proto_init() {
if File_p2p_protocol_circuitv2_pb_circuit_proto != nil {
return
}
file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [0 ].OneofWrappers = []any {}
file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [1 ].OneofWrappers = []any {}
file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [2 ].OneofWrappers = []any {}
file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [3 ].OneofWrappers = []any {}
file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes [4 ].OneofWrappers = []any {}
type x struct {}
out := protoimpl .TypeBuilder {
File : protoimpl .DescBuilder {
GoPackagePath : reflect .TypeOf (x {}).PkgPath (),
RawDescriptor : unsafe .Slice (unsafe .StringData (file_p2p_protocol_circuitv2_pb_circuit_proto_rawDesc ), len (file_p2p_protocol_circuitv2_pb_circuit_proto_rawDesc )),
NumEnums : 3 ,
NumMessages : 5 ,
NumExtensions : 0 ,
NumServices : 0 ,
},
GoTypes : file_p2p_protocol_circuitv2_pb_circuit_proto_goTypes ,
DependencyIndexes : file_p2p_protocol_circuitv2_pb_circuit_proto_depIdxs ,
EnumInfos : file_p2p_protocol_circuitv2_pb_circuit_proto_enumTypes ,
MessageInfos : file_p2p_protocol_circuitv2_pb_circuit_proto_msgTypes ,
}.Build ()
File_p2p_protocol_circuitv2_pb_circuit_proto = out .File
file_p2p_protocol_circuitv2_pb_circuit_proto_goTypes = nil
file_p2p_protocol_circuitv2_pb_circuit_proto_depIdxs = nil
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .