//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements.  See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License.  You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.9
// 	protoc        v6.32.0
// source: cluster_msg.proto

package api

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 MessageType int32

const (
	// heartbeat message
	MessageType_HEARTBEAT MessageType = 0
	// collector go online to master message
	MessageType_GO_ONLINE MessageType = 1
	// collector go offline to master message
	MessageType_GO_OFFLINE MessageType = 2
	// collector go close to master
	MessageType_GO_CLOSE MessageType = 3
	// issue cyclic collect task
	MessageType_ISSUE_CYCLIC_TASK MessageType = 4
	// delete cyclic collect task
	MessageType_DELETE_CYCLIC_TASK MessageType = 5
	// issue one-time collect task
	MessageType_ISSUE_ONE_TIME_TASK MessageType = 6
	// response one-time collect data
	MessageType_RESPONSE_ONE_TIME_TASK_DATA MessageType = 7
	// response cyclic collect data
	MessageType_RESPONSE_CYCLIC_TASK_DATA MessageType = 8
	// response cyclic service discovery data
	MessageType_RESPONSE_CYCLIC_TASK_SD_DATA MessageType = 9
)

// Enum value maps for MessageType.
var (
	MessageType_name = map[int32]string{
		0: "HEARTBEAT",
		1: "GO_ONLINE",
		2: "GO_OFFLINE",
		3: "GO_CLOSE",
		4: "ISSUE_CYCLIC_TASK",
		5: "DELETE_CYCLIC_TASK",
		6: "ISSUE_ONE_TIME_TASK",
		7: "RESPONSE_ONE_TIME_TASK_DATA",
		8: "RESPONSE_CYCLIC_TASK_DATA",
		9: "RESPONSE_CYCLIC_TASK_SD_DATA",
	}
	MessageType_value = map[string]int32{
		"HEARTBEAT":                    0,
		"GO_ONLINE":                    1,
		"GO_OFFLINE":                   2,
		"GO_CLOSE":                     3,
		"ISSUE_CYCLIC_TASK":            4,
		"DELETE_CYCLIC_TASK":           5,
		"ISSUE_ONE_TIME_TASK":          6,
		"RESPONSE_ONE_TIME_TASK_DATA":  7,
		"RESPONSE_CYCLIC_TASK_DATA":    8,
		"RESPONSE_CYCLIC_TASK_SD_DATA": 9,
	}
)

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

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

func (MessageType) Descriptor() protoreflect.EnumDescriptor {
	return file_cluster_msg_proto_enumTypes[0].Descriptor()
}

func (MessageType) Type() protoreflect.EnumType {
	return &file_cluster_msg_proto_enumTypes[0]
}

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

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

type Direction int32

const (
	// request message
	Direction_REQUEST Direction = 0
	// request response
	Direction_RESPONSE Direction = 1
)

// Enum value maps for Direction.
var (
	Direction_name = map[int32]string{
		0: "REQUEST",
		1: "RESPONSE",
	}
	Direction_value = map[string]int32{
		"REQUEST":  0,
		"RESPONSE": 1,
	}
)

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

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

func (Direction) Descriptor() protoreflect.EnumDescriptor {
	return file_cluster_msg_proto_enumTypes[1].Descriptor()
}

func (Direction) Type() protoreflect.EnumType {
	return &file_cluster_msg_proto_enumTypes[1]
}

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

// Deprecated: Use Direction.Descriptor instead.
func (Direction) EnumDescriptor() ([]byte, []int) {
	return file_cluster_msg_proto_rawDescGZIP(), []int{1}
}

type Message struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// collector identity
	Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
	// message direction
	Direction Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=hertzbeat.apache.org.api.msg.Direction" json:"direction,omitempty"`
	// message type
	Type MessageType `protobuf:"varint,3,opt,name=type,proto3,enum=hertzbeat.apache.org.api.msg.MessageType" json:"type,omitempty"`
	// message content
	Msg           []byte `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Message) Reset() {
	*x = Message{}
	mi := &file_cluster_msg_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_cluster_msg_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_cluster_msg_proto_rawDescGZIP(), []int{0}
}

func (x *Message) GetIdentity() string {
	if x != nil {
		return x.Identity
	}
	return ""
}

func (x *Message) GetDirection() Direction {
	if x != nil {
		return x.Direction
	}
	return Direction_REQUEST
}

func (x *Message) GetType() MessageType {
	if x != nil {
		return x.Type
	}
	return MessageType_HEARTBEAT
}

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

var File_cluster_msg_proto protoreflect.FileDescriptor

const file_cluster_msg_proto_rawDesc = "" +
	"\n" +
	"\x11cluster_msg.proto\x12\x1chertzbeat.apache.org.api.msg\"\xbd\x01\n" +
	"\aMessage\x12\x1a\n" +
	"\bidentity\x18\x01 \x01(\tR\bidentity\x12E\n" +
	"\tdirection\x18\x02 \x01(\x0e2'.hertzbeat.apache.org.api.msg.DirectionR\tdirection\x12=\n" +
	"\x04type\x18\x03 \x01(\x0e2).hertzbeat.apache.org.api.msg.MessageTypeR\x04type\x12\x10\n" +
	"\x03msg\x18\x04 \x01(\fR\x03msg*\xf3\x01\n" +
	"\vMessageType\x12\r\n" +
	"\tHEARTBEAT\x10\x00\x12\r\n" +
	"\tGO_ONLINE\x10\x01\x12\x0e\n" +
	"\n" +
	"GO_OFFLINE\x10\x02\x12\f\n" +
	"\bGO_CLOSE\x10\x03\x12\x15\n" +
	"\x11ISSUE_CYCLIC_TASK\x10\x04\x12\x16\n" +
	"\x12DELETE_CYCLIC_TASK\x10\x05\x12\x17\n" +
	"\x13ISSUE_ONE_TIME_TASK\x10\x06\x12\x1f\n" +
	"\x1bRESPONSE_ONE_TIME_TASK_DATA\x10\a\x12\x1d\n" +
	"\x19RESPONSE_CYCLIC_TASK_DATA\x10\b\x12 \n" +
	"\x1cRESPONSE_CYCLIC_TASK_SD_DATA\x10\t*&\n" +
	"\tDirection\x12\v\n" +
	"\aREQUEST\x10\x00\x12\f\n" +
	"\bRESPONSE\x10\x012\xcb\x01\n" +
	"\x11ClusterMsgService\x12W\n" +
	"\aSendMsg\x12%.hertzbeat.apache.org.api.msg.Message\x1a%.hertzbeat.apache.org.api.msg.Message\x12]\n" +
	"\tStreamMsg\x12%.hertzbeat.apache.org.api.msg.Message\x1a%.hertzbeat.apache.org.api.msg.Message(\x010\x01B[\n" +
	"$org.apache.hertzbeat.api.cluster_msgZ3hertzbeat.apache.org/hertzbeat-collector-go/api;apib\x06proto3"

var (
	file_cluster_msg_proto_rawDescOnce sync.Once
	file_cluster_msg_proto_rawDescData []byte
)

func file_cluster_msg_proto_rawDescGZIP() []byte {
	file_cluster_msg_proto_rawDescOnce.Do(func() {
		file_cluster_msg_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cluster_msg_proto_rawDesc), len(file_cluster_msg_proto_rawDesc)))
	})
	return file_cluster_msg_proto_rawDescData
}

var file_cluster_msg_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_cluster_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_cluster_msg_proto_goTypes = []any{
	(MessageType)(0), // 0: hertzbeat.apache.org.api.msg.MessageType
	(Direction)(0),   // 1: hertzbeat.apache.org.api.msg.Direction
	(*Message)(nil),  // 2: hertzbeat.apache.org.api.msg.Message
}
var file_cluster_msg_proto_depIdxs = []int32{
	1, // 0: hertzbeat.apache.org.api.msg.Message.direction:type_name -> hertzbeat.apache.org.api.msg.Direction
	0, // 1: hertzbeat.apache.org.api.msg.Message.type:type_name -> hertzbeat.apache.org.api.msg.MessageType
	2, // 2: hertzbeat.apache.org.api.msg.ClusterMsgService.SendMsg:input_type -> hertzbeat.apache.org.api.msg.Message
	2, // 3: hertzbeat.apache.org.api.msg.ClusterMsgService.StreamMsg:input_type -> hertzbeat.apache.org.api.msg.Message
	2, // 4: hertzbeat.apache.org.api.msg.ClusterMsgService.SendMsg:output_type -> hertzbeat.apache.org.api.msg.Message
	2, // 5: hertzbeat.apache.org.api.msg.ClusterMsgService.StreamMsg:output_type -> hertzbeat.apache.org.api.msg.Message
	4, // [4:6] is the sub-list for method output_type
	2, // [2:4] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_cluster_msg_proto_init() }
func file_cluster_msg_proto_init() {
	if File_cluster_msg_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_cluster_msg_proto_rawDesc), len(file_cluster_msg_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_cluster_msg_proto_goTypes,
		DependencyIndexes: file_cluster_msg_proto_depIdxs,
		EnumInfos:         file_cluster_msg_proto_enumTypes,
		MessageInfos:      file_cluster_msg_proto_msgTypes,
	}.Build()
	File_cluster_msg_proto = out.File
	file_cluster_msg_proto_goTypes = nil
	file_cluster_msg_proto_depIdxs = nil
}
