| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 |
- // Code generated by protoc-gen-go. DO NOT EDIT.
- // versions:
- // protoc-gen-go v1.36.11
- // protoc (unknown)
- // source: broadannounce/v1/ingest.proto
- package broadannouncev1
- 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)
- )
- // Code classifies the error so the client can act programmatically.
- type Error_Code int32
- const (
- Error_UNKNOWN Error_Code = 0 // catch-all; include message
- Error_UNAUTHENTICATED Error_Code = 1 // API key missing or invalid
- Error_RATE_LIMITED Error_Code = 2 // per-source or per-company rate limit hit
- Error_INVALID Error_Code = 3 // schema validation failed;修复 check message
- Error_INTERNAL Error_Code = 4 // server-side error; do not retry immediately
- )
- // Enum value maps for Error_Code.
- var (
- Error_Code_name = map[int32]string{
- 0: "UNKNOWN",
- 1: "UNAUTHENTICATED",
- 2: "RATE_LIMITED",
- 3: "INVALID",
- 4: "INTERNAL",
- }
- Error_Code_value = map[string]int32{
- "UNKNOWN": 0,
- "UNAUTHENTICATED": 1,
- "RATE_LIMITED": 2,
- "INVALID": 3,
- "INTERNAL": 4,
- }
- )
- func (x Error_Code) Enum() *Error_Code {
- p := new(Error_Code)
- *p = x
- return p
- }
- func (x Error_Code) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
- }
- func (Error_Code) Descriptor() protoreflect.EnumDescriptor {
- return file_broadannounce_v1_ingest_proto_enumTypes[0].Descriptor()
- }
- func (Error_Code) Type() protoreflect.EnumType {
- return &file_broadannounce_v1_ingest_proto_enumTypes[0]
- }
- func (x Error_Code) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
- }
- // Deprecated: Use Error_Code.Descriptor instead.
- func (Error_Code) EnumDescriptor() ([]byte, []int) {
- return file_broadannounce_v1_ingest_proto_rawDescGZIP(), []int{3, 0}
- }
- // Alert is what a first-party service sends to BroadAnnounce.
- type Alert struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- CompanyId string `protobuf:"bytes,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` // required; maps to sources.company_id
- SourceId string `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` // required; maps to sources.source_id
- Severity string `protobuf:"bytes,3,opt,name=severity,proto3" json:"severity,omitempty"` // "info" | "warning" | "critical" | "inminent_colapse"
- Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` // arbitrary category tag
- Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` // pre-localized alert title
- Body string `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"` // pre-localized alert body
- Data map[string]string `protobuf:"bytes,7,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // arbitrary key-value metadata
- DedupeKey string `protobuf:"bytes,8,opt,name=dedupe_key,json=dedupeKey,proto3" json:"dedupe_key,omitempty"` // opaque string; if set, dedupe applies within the window
- ClientTsMs int64 `protobuf:"varint,9,opt,name=client_ts_ms,json=clientTsMs,proto3" json:"client_ts_ms,omitempty"` // Unix-ms timestamp set by the client; used for skew detection
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
- }
- func (x *Alert) Reset() {
- *x = Alert{}
- mi := &file_broadannounce_v1_ingest_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
- func (x *Alert) String() string {
- return protoimpl.X.MessageStringOf(x)
- }
- func (*Alert) ProtoMessage() {}
- func (x *Alert) ProtoReflect() protoreflect.Message {
- mi := &file_broadannounce_v1_ingest_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 Alert.ProtoReflect.Descriptor instead.
- func (*Alert) Descriptor() ([]byte, []int) {
- return file_broadannounce_v1_ingest_proto_rawDescGZIP(), []int{0}
- }
- func (x *Alert) GetCompanyId() string {
- if x != nil {
- return x.CompanyId
- }
- return ""
- }
- func (x *Alert) GetSourceId() string {
- if x != nil {
- return x.SourceId
- }
- return ""
- }
- func (x *Alert) GetSeverity() string {
- if x != nil {
- return x.Severity
- }
- return ""
- }
- func (x *Alert) GetCategory() string {
- if x != nil {
- return x.Category
- }
- return ""
- }
- func (x *Alert) GetTitle() string {
- if x != nil {
- return x.Title
- }
- return ""
- }
- func (x *Alert) GetBody() string {
- if x != nil {
- return x.Body
- }
- return ""
- }
- func (x *Alert) GetData() map[string]string {
- if x != nil {
- return x.Data
- }
- return nil
- }
- func (x *Alert) GetDedupeKey() string {
- if x != nil {
- return x.DedupeKey
- }
- return ""
- }
- func (x *Alert) GetClientTsMs() int64 {
- if x != nil {
- return x.ClientTsMs
- }
- return 0
- }
- // Ack is what the server sends back after processing an Alert.
- type Ack struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // alert_id is an opaque server-assigned identifier for the alert.
- // It may be empty if the alert was rejected before NATS publish.
- AlertId string `protobuf:"bytes,1,opt,name=alert_id,json=alertId,proto3" json:"alert_id,omitempty"`
- // dedupe_key echoes back the client's dedupe_key.
- DedupeKey string `protobuf:"bytes,2,opt,name=dedupe_key,json=dedupeKey,proto3" json:"dedupe_key,omitempty"`
- // dedupe_count is 1 on first arrival; >1 when the server collapsed a
- // burst of identical dedupe_keys within the dedupe window.
- DedupeCount uint32 `protobuf:"varint,3,opt,name=dedupe_count,json=dedupeCount,proto3" json:"dedupe_count,omitempty"`
- // accepted_at_ms is the server-side Unix-ms timestamp at which the alert
- // was accepted (i.e. after all protection layers passed).
- AcceptedAtMs int64 `protobuf:"varint,4,opt,name=accepted_at_ms,json=acceptedAtMs,proto3" json:"accepted_at_ms,omitempty"`
- // result is the processing outcome.
- //
- // Types that are valid to be assigned to Result:
- //
- // *Ack_Ok
- // *Ack_Error
- Result isAck_Result `protobuf_oneof:"result"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
- }
- func (x *Ack) Reset() {
- *x = Ack{}
- mi := &file_broadannounce_v1_ingest_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
- func (x *Ack) String() string {
- return protoimpl.X.MessageStringOf(x)
- }
- func (*Ack) ProtoMessage() {}
- func (x *Ack) ProtoReflect() protoreflect.Message {
- mi := &file_broadannounce_v1_ingest_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)
- }
- // Deprecated: Use Ack.ProtoReflect.Descriptor instead.
- func (*Ack) Descriptor() ([]byte, []int) {
- return file_broadannounce_v1_ingest_proto_rawDescGZIP(), []int{1}
- }
- func (x *Ack) GetAlertId() string {
- if x != nil {
- return x.AlertId
- }
- return ""
- }
- func (x *Ack) GetDedupeKey() string {
- if x != nil {
- return x.DedupeKey
- }
- return ""
- }
- func (x *Ack) GetDedupeCount() uint32 {
- if x != nil {
- return x.DedupeCount
- }
- return 0
- }
- func (x *Ack) GetAcceptedAtMs() int64 {
- if x != nil {
- return x.AcceptedAtMs
- }
- return 0
- }
- func (x *Ack) GetResult() isAck_Result {
- if x != nil {
- return x.Result
- }
- return nil
- }
- func (x *Ack) GetOk() *Ok {
- if x != nil {
- if x, ok := x.Result.(*Ack_Ok); ok {
- return x.Ok
- }
- }
- return nil
- }
- func (x *Ack) GetError() *Error {
- if x != nil {
- if x, ok := x.Result.(*Ack_Error); ok {
- return x.Error
- }
- }
- return nil
- }
- type isAck_Result interface {
- isAck_Result()
- }
- type Ack_Ok struct {
- Ok *Ok `protobuf:"bytes,10,opt,name=ok,proto3,oneof"` // alert accepted
- }
- type Ack_Error struct {
- Error *Error `protobuf:"bytes,11,opt,name=error,proto3,oneof"` // alert rejected or rate-limited
- }
- func (*Ack_Ok) isAck_Result() {}
- func (*Ack_Error) isAck_Result() {}
- // Ok is returned when an Alert was accepted.
- type Ok struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
- }
- func (x *Ok) Reset() {
- *x = Ok{}
- mi := &file_broadannounce_v1_ingest_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
- func (x *Ok) String() string {
- return protoimpl.X.MessageStringOf(x)
- }
- func (*Ok) ProtoMessage() {}
- func (x *Ok) ProtoReflect() protoreflect.Message {
- mi := &file_broadannounce_v1_ingest_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)
- }
- // Deprecated: Use Ok.ProtoReflect.Descriptor instead.
- func (*Ok) Descriptor() ([]byte, []int) {
- return file_broadannounce_v1_ingest_proto_rawDescGZIP(), []int{2}
- }
- // Error is returned when an Alert was rejected.
- type Error struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- Code Error_Code `protobuf:"varint,1,opt,name=code,proto3,enum=broadannounce.v1.Error_Code" json:"code,omitempty"`
- Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // human-readable; never parse this
- // retry_after_ms is non-zero when Code == RATE_LIMITED.
- // The client MUST wait at least this long before sending the next message.
- // A value of 0 means "do not retry" (permanent failure).
- RetryAfterMs int32 `protobuf:"varint,3,opt,name=retry_after_ms,json=retryAfterMs,proto3" json:"retry_after_ms,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
- }
- func (x *Error) Reset() {
- *x = Error{}
- mi := &file_broadannounce_v1_ingest_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
- func (x *Error) String() string {
- return protoimpl.X.MessageStringOf(x)
- }
- func (*Error) ProtoMessage() {}
- func (x *Error) ProtoReflect() protoreflect.Message {
- mi := &file_broadannounce_v1_ingest_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)
- }
- // Deprecated: Use Error.ProtoReflect.Descriptor instead.
- func (*Error) Descriptor() ([]byte, []int) {
- return file_broadannounce_v1_ingest_proto_rawDescGZIP(), []int{3}
- }
- func (x *Error) GetCode() Error_Code {
- if x != nil {
- return x.Code
- }
- return Error_UNKNOWN
- }
- func (x *Error) GetMessage() string {
- if x != nil {
- return x.Message
- }
- return ""
- }
- func (x *Error) GetRetryAfterMs() int32 {
- if x != nil {
- return x.RetryAfterMs
- }
- return 0
- }
- var File_broadannounce_v1_ingest_proto protoreflect.FileDescriptor
- const file_broadannounce_v1_ingest_proto_rawDesc = "" +
- "\n" +
- "\x1dbroadannounce/v1/ingest.proto\x12\x10broadannounce.v1\"\xd6\x02\n" +
- "\x05Alert\x12\x1d\n" +
- "\n" +
- "company_id\x18\x01 \x01(\tR\tcompanyId\x12\x1b\n" +
- "\tsource_id\x18\x02 \x01(\tR\bsourceId\x12\x1a\n" +
- "\bseverity\x18\x03 \x01(\tR\bseverity\x12\x1a\n" +
- "\bcategory\x18\x04 \x01(\tR\bcategory\x12\x14\n" +
- "\x05title\x18\x05 \x01(\tR\x05title\x12\x12\n" +
- "\x04body\x18\x06 \x01(\tR\x04body\x125\n" +
- "\x04data\x18\a \x03(\v2!.broadannounce.v1.Alert.DataEntryR\x04data\x12\x1d\n" +
- "\n" +
- "dedupe_key\x18\b \x01(\tR\tdedupeKey\x12 \n" +
- "\fclient_ts_ms\x18\t \x01(\x03R\n" +
- "clientTsMs\x1a7\n" +
- "\tDataEntry\x12\x10\n" +
- "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xeb\x01\n" +
- "\x03Ack\x12\x19\n" +
- "\balert_id\x18\x01 \x01(\tR\aalertId\x12\x1d\n" +
- "\n" +
- "dedupe_key\x18\x02 \x01(\tR\tdedupeKey\x12!\n" +
- "\fdedupe_count\x18\x03 \x01(\rR\vdedupeCount\x12$\n" +
- "\x0eaccepted_at_ms\x18\x04 \x01(\x03R\facceptedAtMs\x12&\n" +
- "\x02ok\x18\n" +
- " \x01(\v2\x14.broadannounce.v1.OkH\x00R\x02ok\x12/\n" +
- "\x05error\x18\v \x01(\v2\x17.broadannounce.v1.ErrorH\x00R\x05errorB\b\n" +
- "\x06result\"\x04\n" +
- "\x02Ok\"\xd0\x01\n" +
- "\x05Error\x120\n" +
- "\x04code\x18\x01 \x01(\x0e2\x1c.broadannounce.v1.Error.CodeR\x04code\x12\x18\n" +
- "\amessage\x18\x02 \x01(\tR\amessage\x12$\n" +
- "\x0eretry_after_ms\x18\x03 \x01(\x05R\fretryAfterMs\"U\n" +
- "\x04Code\x12\v\n" +
- "\aUNKNOWN\x10\x00\x12\x13\n" +
- "\x0fUNAUTHENTICATED\x10\x01\x12\x10\n" +
- "\fRATE_LIMITED\x10\x02\x12\v\n" +
- "\aINVALID\x10\x03\x12\f\n" +
- "\bINTERNAL\x10\x042L\n" +
- "\x06Ingest\x12B\n" +
- "\fStreamAlerts\x12\x17.broadannounce.v1.Alert\x1a\x15.broadannounce.v1.Ack(\x010\x01B\xdb\x01\n" +
- "\x14com.broadannounce.v1B\vIngestProtoP\x01ZUgit3.techno-world.net/lrosales/broad-announce/gen/go/broadannounce/v1;broadannouncev1\xa2\x02\x03BXX\xaa\x02\x10Broadannounce.V1\xca\x02\x10Broadannounce\\V1\xe2\x02\x1cBroadannounce\\V1\\GPBMetadata\xea\x02\x11Broadannounce::V1b\x06proto3"
- var (
- file_broadannounce_v1_ingest_proto_rawDescOnce sync.Once
- file_broadannounce_v1_ingest_proto_rawDescData []byte
- )
- func file_broadannounce_v1_ingest_proto_rawDescGZIP() []byte {
- file_broadannounce_v1_ingest_proto_rawDescOnce.Do(func() {
- file_broadannounce_v1_ingest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_broadannounce_v1_ingest_proto_rawDesc), len(file_broadannounce_v1_ingest_proto_rawDesc)))
- })
- return file_broadannounce_v1_ingest_proto_rawDescData
- }
- var file_broadannounce_v1_ingest_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
- var file_broadannounce_v1_ingest_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
- var file_broadannounce_v1_ingest_proto_goTypes = []any{
- (Error_Code)(0), // 0: broadannounce.v1.Error.Code
- (*Alert)(nil), // 1: broadannounce.v1.Alert
- (*Ack)(nil), // 2: broadannounce.v1.Ack
- (*Ok)(nil), // 3: broadannounce.v1.Ok
- (*Error)(nil), // 4: broadannounce.v1.Error
- nil, // 5: broadannounce.v1.Alert.DataEntry
- }
- var file_broadannounce_v1_ingest_proto_depIdxs = []int32{
- 5, // 0: broadannounce.v1.Alert.data:type_name -> broadannounce.v1.Alert.DataEntry
- 3, // 1: broadannounce.v1.Ack.ok:type_name -> broadannounce.v1.Ok
- 4, // 2: broadannounce.v1.Ack.error:type_name -> broadannounce.v1.Error
- 0, // 3: broadannounce.v1.Error.code:type_name -> broadannounce.v1.Error.Code
- 1, // 4: broadannounce.v1.Ingest.StreamAlerts:input_type -> broadannounce.v1.Alert
- 2, // 5: broadannounce.v1.Ingest.StreamAlerts:output_type -> broadannounce.v1.Ack
- 5, // [5:6] is the sub-list for method output_type
- 4, // [4:5] is the sub-list for method input_type
- 4, // [4:4] is the sub-list for extension type_name
- 4, // [4:4] is the sub-list for extension extendee
- 0, // [0:4] is the sub-list for field type_name
- }
- func init() { file_broadannounce_v1_ingest_proto_init() }
- func file_broadannounce_v1_ingest_proto_init() {
- if File_broadannounce_v1_ingest_proto != nil {
- return
- }
- file_broadannounce_v1_ingest_proto_msgTypes[1].OneofWrappers = []any{
- (*Ack_Ok)(nil),
- (*Ack_Error)(nil),
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: unsafe.Slice(unsafe.StringData(file_broadannounce_v1_ingest_proto_rawDesc), len(file_broadannounce_v1_ingest_proto_rawDesc)),
- NumEnums: 1,
- NumMessages: 5,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_broadannounce_v1_ingest_proto_goTypes,
- DependencyIndexes: file_broadannounce_v1_ingest_proto_depIdxs,
- EnumInfos: file_broadannounce_v1_ingest_proto_enumTypes,
- MessageInfos: file_broadannounce_v1_ingest_proto_msgTypes,
- }.Build()
- File_broadannounce_v1_ingest_proto = out.File
- file_broadannounce_v1_ingest_proto_goTypes = nil
- file_broadannounce_v1_ingest_proto_depIdxs = nil
- }
|