402 lines
13 KiB
Go
402 lines
13 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: event.proto
|
|
|
|
/*
|
|
Package event is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
event.proto
|
|
|
|
It has these top-level messages:
|
|
TaskResultEvent
|
|
AgentEvent
|
|
*/
|
|
package event
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import commons "loafle.com/overflow/central_api_gateway/commons"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type TaskResultState int32
|
|
|
|
const (
|
|
TaskResultState_FAILED TaskResultState = 0
|
|
TaskResultState_SUCCEED TaskResultState = 1
|
|
TaskResultState_PROCEEDING TaskResultState = 2
|
|
)
|
|
|
|
var TaskResultState_name = map[int32]string{
|
|
0: "FAILED",
|
|
1: "SUCCEED",
|
|
2: "PROCEEDING",
|
|
}
|
|
var TaskResultState_value = map[string]int32{
|
|
"FAILED": 0,
|
|
"SUCCEED": 1,
|
|
"PROCEEDING": 2,
|
|
}
|
|
|
|
func (x TaskResultState) String() string {
|
|
return proto.EnumName(TaskResultState_name, int32(x))
|
|
}
|
|
func (TaskResultState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
type AgentEvent_AgentEventType int32
|
|
|
|
const (
|
|
AgentEvent_AGENT_STARTED AgentEvent_AgentEventType = 0
|
|
AgentEvent_AGENT_ERROR AgentEvent_AgentEventType = 1
|
|
AgentEvent_AGENT_STOP AgentEvent_AgentEventType = 2
|
|
)
|
|
|
|
var AgentEvent_AgentEventType_name = map[int32]string{
|
|
0: "AGENT_STARTED",
|
|
1: "AGENT_ERROR",
|
|
2: "AGENT_STOP",
|
|
}
|
|
var AgentEvent_AgentEventType_value = map[string]int32{
|
|
"AGENT_STARTED": 0,
|
|
"AGENT_ERROR": 1,
|
|
"AGENT_STOP": 2,
|
|
}
|
|
|
|
func (x AgentEvent_AgentEventType) String() string {
|
|
return proto.EnumName(AgentEvent_AgentEventType_name, int32(x))
|
|
}
|
|
func (AgentEvent_AgentEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} }
|
|
|
|
type TaskResultEvent struct {
|
|
AgentId string `protobuf:"bytes,1,opt,name=agentId" json:"agentId,omitempty"`
|
|
TaskId string `protobuf:"bytes,2,opt,name=taskId" json:"taskId,omitempty"`
|
|
EvtType commons.TaskEventType `protobuf:"varint,3,opt,name=evtType,enum=TaskEventType" json:"evtType,omitempty"`
|
|
OccurredDate int64 `protobuf:"varint,4,opt,name=occurredDate" json:"occurredDate,omitempty"`
|
|
Result TaskResultState `protobuf:"varint,5,opt,name=result,enum=TaskResultState" json:"result,omitempty"`
|
|
Data map[string]string `protobuf:"bytes,6,rep,name=data" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
|
}
|
|
|
|
func (m *TaskResultEvent) Reset() { *m = TaskResultEvent{} }
|
|
func (m *TaskResultEvent) String() string { return proto.CompactTextString(m) }
|
|
func (*TaskResultEvent) ProtoMessage() {}
|
|
func (*TaskResultEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
func (m *TaskResultEvent) GetAgentId() string {
|
|
if m != nil {
|
|
return m.AgentId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *TaskResultEvent) GetTaskId() string {
|
|
if m != nil {
|
|
return m.TaskId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *TaskResultEvent) GetEvtType() commons.TaskEventType {
|
|
if m != nil {
|
|
return m.EvtType
|
|
}
|
|
return commons.TaskEventType_TASK_POL_INTERVAL_UPDATE
|
|
}
|
|
|
|
func (m *TaskResultEvent) GetOccurredDate() int64 {
|
|
if m != nil {
|
|
return m.OccurredDate
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *TaskResultEvent) GetResult() TaskResultState {
|
|
if m != nil {
|
|
return m.Result
|
|
}
|
|
return TaskResultState_FAILED
|
|
}
|
|
|
|
func (m *TaskResultEvent) GetData() map[string]string {
|
|
if m != nil {
|
|
return m.Data
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type AgentEvent struct {
|
|
AgentId string `protobuf:"bytes,1,opt,name=agentId" json:"agentId,omitempty"`
|
|
EvtType AgentEvent_AgentEventType `protobuf:"varint,2,opt,name=evtType,enum=AgentEvent_AgentEventType" json:"evtType,omitempty"`
|
|
OccurredDate int64 `protobuf:"varint,3,opt,name=occurredDate" json:"occurredDate,omitempty"`
|
|
Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"`
|
|
ErrInfo *AgentEvent_ErrorInfo `protobuf:"bytes,5,opt,name=errInfo" json:"errInfo,omitempty"`
|
|
}
|
|
|
|
func (m *AgentEvent) Reset() { *m = AgentEvent{} }
|
|
func (m *AgentEvent) String() string { return proto.CompactTextString(m) }
|
|
func (*AgentEvent) ProtoMessage() {}
|
|
func (*AgentEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *AgentEvent) GetAgentId() string {
|
|
if m != nil {
|
|
return m.AgentId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *AgentEvent) GetEvtType() AgentEvent_AgentEventType {
|
|
if m != nil {
|
|
return m.EvtType
|
|
}
|
|
return AgentEvent_AGENT_STARTED
|
|
}
|
|
|
|
func (m *AgentEvent) GetOccurredDate() int64 {
|
|
if m != nil {
|
|
return m.OccurredDate
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *AgentEvent) GetDescription() string {
|
|
if m != nil {
|
|
return m.Description
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *AgentEvent) GetErrInfo() *AgentEvent_ErrorInfo {
|
|
if m != nil {
|
|
return m.ErrInfo
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type AgentEvent_ErrorInfo struct {
|
|
ErrorNum int32 `protobuf:"varint,1,opt,name=errorNum" json:"errorNum,omitempty"`
|
|
From string `protobuf:"bytes,2,opt,name=from" json:"from,omitempty"`
|
|
ErrorMessage string `protobuf:"bytes,3,opt,name=errorMessage" json:"errorMessage,omitempty"`
|
|
}
|
|
|
|
func (m *AgentEvent_ErrorInfo) Reset() { *m = AgentEvent_ErrorInfo{} }
|
|
func (m *AgentEvent_ErrorInfo) String() string { return proto.CompactTextString(m) }
|
|
func (*AgentEvent_ErrorInfo) ProtoMessage() {}
|
|
func (*AgentEvent_ErrorInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} }
|
|
|
|
func (m *AgentEvent_ErrorInfo) GetErrorNum() int32 {
|
|
if m != nil {
|
|
return m.ErrorNum
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *AgentEvent_ErrorInfo) GetFrom() string {
|
|
if m != nil {
|
|
return m.From
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *AgentEvent_ErrorInfo) GetErrorMessage() string {
|
|
if m != nil {
|
|
return m.ErrorMessage
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*TaskResultEvent)(nil), "TaskResultEvent")
|
|
proto.RegisterType((*AgentEvent)(nil), "AgentEvent")
|
|
proto.RegisterType((*AgentEvent_ErrorInfo)(nil), "AgentEvent.ErrorInfo")
|
|
proto.RegisterEnum("TaskResultState", TaskResultState_name, TaskResultState_value)
|
|
proto.RegisterEnum("AgentEvent_AgentEventType", AgentEvent_AgentEventType_name, AgentEvent_AgentEventType_value)
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for TaskResult service
|
|
|
|
type TaskResultClient interface {
|
|
Event(ctx context.Context, in *TaskResultEvent, opts ...grpc.CallOption) (*commons.Void, error)
|
|
}
|
|
|
|
type taskResultClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewTaskResultClient(cc *grpc.ClientConn) TaskResultClient {
|
|
return &taskResultClient{cc}
|
|
}
|
|
|
|
func (c *taskResultClient) Event(ctx context.Context, in *TaskResultEvent, opts ...grpc.CallOption) (*commons.Void, error) {
|
|
out := new(commons.Void)
|
|
err := grpc.Invoke(ctx, "/TaskResult/event", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for TaskResult service
|
|
|
|
type TaskResultServer interface {
|
|
Event(context.Context, *TaskResultEvent) (*commons.Void, error)
|
|
}
|
|
|
|
func RegisterTaskResultServer(s *grpc.Server, srv TaskResultServer) {
|
|
s.RegisterService(&_TaskResult_serviceDesc, srv)
|
|
}
|
|
|
|
func _TaskResult_Event_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TaskResultEvent)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TaskResultServer).Event(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/TaskResult/Event",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TaskResultServer).Event(ctx, req.(*TaskResultEvent))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _TaskResult_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "TaskResult",
|
|
HandlerType: (*TaskResultServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "event",
|
|
Handler: _TaskResult_Event_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "event.proto",
|
|
}
|
|
|
|
// Client API for Event service
|
|
|
|
type EventClient interface {
|
|
Event(ctx context.Context, in *AgentEvent, opts ...grpc.CallOption) (*commons.Void, error)
|
|
}
|
|
|
|
type eventClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewEventClient(cc *grpc.ClientConn) EventClient {
|
|
return &eventClient{cc}
|
|
}
|
|
|
|
func (c *eventClient) Event(ctx context.Context, in *AgentEvent, opts ...grpc.CallOption) (*commons.Void, error) {
|
|
out := new(commons.Void)
|
|
err := grpc.Invoke(ctx, "/Event/event", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Event service
|
|
|
|
type EventServer interface {
|
|
Event(context.Context, *AgentEvent) (*commons.Void, error)
|
|
}
|
|
|
|
func RegisterEventServer(s *grpc.Server, srv EventServer) {
|
|
s.RegisterService(&_Event_serviceDesc, srv)
|
|
}
|
|
|
|
func _Event_Event_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AgentEvent)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(EventServer).Event(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/Event/Event",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(EventServer).Event(ctx, req.(*AgentEvent))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Event_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "Event",
|
|
HandlerType: (*EventServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "event",
|
|
Handler: _Event_Event_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "event.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("event.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 500 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x5d, 0x8b, 0xd3, 0x40,
|
|
0x14, 0xdd, 0xa4, 0x4d, 0x6b, 0x6f, 0xb4, 0x1b, 0x07, 0x95, 0x10, 0x10, 0x42, 0x1e, 0x24, 0xf8,
|
|
0x90, 0x4a, 0x14, 0x94, 0x05, 0x1f, 0xca, 0x26, 0x2e, 0x01, 0x6d, 0x97, 0x69, 0xf4, 0xb5, 0x8c,
|
|
0xc9, 0xb4, 0x94, 0x26, 0x99, 0x32, 0x99, 0x76, 0xe9, 0xff, 0xf1, 0x57, 0xfa, 0x24, 0x99, 0x24,
|
|
0x6d, 0xba, 0x88, 0x3e, 0xf5, 0x9e, 0x73, 0x3f, 0x7a, 0xcf, 0xc9, 0x1d, 0xd0, 0xe9, 0x81, 0x16,
|
|
0xc2, 0xdb, 0x71, 0x26, 0x98, 0xf5, 0x39, 0x63, 0x64, 0x95, 0x51, 0x2f, 0x61, 0xf9, 0x84, 0x1d,
|
|
0x28, 0x5f, 0x65, 0xec, 0x61, 0x92, 0xd0, 0x42, 0x70, 0x92, 0x2d, 0xc9, 0x6e, 0xb3, 0x5c, 0x13,
|
|
0x41, 0x1f, 0xc8, 0x71, 0x92, 0xb0, 0x3c, 0x67, 0x45, 0xd9, 0xfe, 0xd6, 0xed, 0xce, 0x2f, 0x15,
|
|
0xae, 0x63, 0x52, 0x6e, 0x31, 0x2d, 0xf7, 0x99, 0x08, 0xab, 0xc1, 0xc8, 0x84, 0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