// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v5.29.2
// source: p2p/transport/webrtc/pb/message.proto

package pb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type Message_Flag int32

const (
	// The sender will no longer send messages on the stream.
	Message_FIN Message_Flag = 0
	// The sender will no longer read messages on the stream. Incoming data is
	// being discarded on receipt.
	Message_STOP_SENDING Message_Flag = 1
	// The sender abruptly terminates the sending part of the stream. The
	// receiver can discard any data that it already received on that stream.
	Message_RESET Message_Flag = 2
	// Sending the FIN_ACK flag acknowledges the previous receipt of a message
	// with the FIN flag set. Receiving a FIN_ACK flag gives the recipient
	// confidence that the remote has received all sent messages.
	Message_FIN_ACK Message_Flag = 3
)

// Enum value maps for Message_Flag.
var (
	Message_Flag_name = map[int32]string{
		0: "FIN",
		1: "STOP_SENDING",
		2: "RESET",
		3: "FIN_ACK",
	}
	Message_Flag_value = map[string]int32{
		"FIN":          0,
		"STOP_SENDING": 1,
		"RESET":        2,
		"FIN_ACK":      3,
	}
)

func (x Message_Flag) Enum() *Message_Flag {
	p := new(Message_Flag)
	*p = x
	return p
}

func (x Message_Flag) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (Message_Flag) Descriptor() protoreflect.EnumDescriptor {
	return file_p2p_transport_webrtc_pb_message_proto_enumTypes[0].Descriptor()
}

func (Message_Flag) Type() protoreflect.EnumType {
	return &file_p2p_transport_webrtc_pb_message_proto_enumTypes[0]
}

func (x Message_Flag) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Do not use.
func (x *Message_Flag) UnmarshalJSON(b []byte) error {
	num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b)
	if err != nil {
		return err
	}
	*x = Message_Flag(num)
	return nil
}

// Deprecated: Use Message_Flag.Descriptor instead.
func (Message_Flag) EnumDescriptor() ([]byte, []int) {
	return file_p2p_transport_webrtc_pb_message_proto_rawDescGZIP(), []int{0, 0}
}

type Message struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Flag          *Message_Flag          `protobuf:"varint,1,opt,name=flag,enum=Message_Flag" json:"flag,omitempty"`
	Message       []byte                 `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
	ErrorCode     *uint32                `protobuf:"varint,3,opt,name=errorCode" json:"errorCode,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Message) Reset() {
	*x = Message{}
	mi := &file_p2p_transport_webrtc_pb_message_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Message) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Message) ProtoMessage() {}

func (x *Message) ProtoReflect() protoreflect.Message {
	mi := &file_p2p_transport_webrtc_pb_message_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)
}

// Deprecated: Use Message.ProtoReflect.Descriptor instead.
func (*Message) Descriptor() ([]byte, []int) {
	return file_p2p_transport_webrtc_pb_message_proto_rawDescGZIP(), []int{0}
}

func (x *Message) GetFlag() Message_Flag {
	if x != nil && x.Flag != nil {
		return *x.Flag
	}
	return Message_FIN
}

func (x *Message) GetMessage() []byte {
	if x != nil {
		return x.Message
	}
	return nil
}

func (x *Message) GetErrorCode() uint32 {
	if x != nil && x.ErrorCode != nil {
		return *x.ErrorCode
	}
	return 0
}

var File_p2p_transport_webrtc_pb_message_proto protoreflect.FileDescriptor

const file_p2p_transport_webrtc_pb_message_proto_rawDesc = "" +
	"\n" +
	"%p2p/transport/webrtc/pb/message.proto\"\x9f\x01\n" +
	"\aMessage\x12!\n" +
	"\x04flag\x18\x01 \x01(\x0e2\r.Message.FlagR\x04flag\x12\x18\n" +
	"\amessage\x18\x02 \x01(\fR\amessage\x12\x1c\n" +
	"\terrorCode\x18\x03 \x01(\rR\terrorCode\"9\n" +
	"\x04Flag\x12\a\n" +
	"\x03FIN\x10\x00\x12\x10\n" +
	"\fSTOP_SENDING\x10\x01\x12\t\n" +
	"\x05RESET\x10\x02\x12\v\n" +
	"\aFIN_ACK\x10\x03B5Z3github.com/libp2p/go-libp2p/p2p/transport/webrtc/pb"

var (
	file_p2p_transport_webrtc_pb_message_proto_rawDescOnce sync.Once
	file_p2p_transport_webrtc_pb_message_proto_rawDescData []byte
)

func file_p2p_transport_webrtc_pb_message_proto_rawDescGZIP() []byte {
	file_p2p_transport_webrtc_pb_message_proto_rawDescOnce.Do(func() {
		file_p2p_transport_webrtc_pb_message_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_p2p_transport_webrtc_pb_message_proto_rawDesc), len(file_p2p_transport_webrtc_pb_message_proto_rawDesc)))
	})
	return file_p2p_transport_webrtc_pb_message_proto_rawDescData
}

var file_p2p_transport_webrtc_pb_message_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_p2p_transport_webrtc_pb_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_p2p_transport_webrtc_pb_message_proto_goTypes = []any{
	(Message_Flag)(0), // 0: Message.Flag
	(*Message)(nil),   // 1: Message
}
var file_p2p_transport_webrtc_pb_message_proto_depIdxs = []int32{
	0, // 0: Message.flag:type_name -> Message.Flag
	1, // [1:1] is the sub-list for method output_type
	1, // [1:1] is the sub-list for method input_type
	1, // [1:1] is the sub-list for extension type_name
	1, // [1:1] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_p2p_transport_webrtc_pb_message_proto_init() }
func file_p2p_transport_webrtc_pb_message_proto_init() {
	if File_p2p_transport_webrtc_pb_message_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_p2p_transport_webrtc_pb_message_proto_rawDesc), len(file_p2p_transport_webrtc_pb_message_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_p2p_transport_webrtc_pb_message_proto_goTypes,
		DependencyIndexes: file_p2p_transport_webrtc_pb_message_proto_depIdxs,
		EnumInfos:         file_p2p_transport_webrtc_pb_message_proto_enumTypes,
		MessageInfos:      file_p2p_transport_webrtc_pb_message_proto_msgTypes,
	}.Build()
	File_p2p_transport_webrtc_pb_message_proto = out.File
	file_p2p_transport_webrtc_pb_message_proto_goTypes = nil
	file_p2p_transport_webrtc_pb_message_proto_depIdxs = nil
}
