Documentation ¶
Index ¶
- Variables
- type ContentType
- func (ContentType) Descriptor() protoreflect.EnumDescriptor
- func (x ContentType) Enum() *ContentType
- func (ContentType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ContentType) Number() protoreflect.EnumNumber
- func (x ContentType) String() string
- func (ContentType) Type() protoreflect.EnumType
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetBody() *anypb.Any
- func (x *Event) GetHeader() *Header
- func (x *Event) GetId() string
- func (e *Event) GetMetaKey(key string) (string, bool)
- func (x *Event) GetType() Type
- func (e *Event) ParseBoby(body proto.Message) (err error)
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (e *Event) SetLevel(l Level)
- func (e *Event) SetMeta(key, value string)
- func (e *Event) SetSource(src string)
- func (x *Event) String() string
- func (e *Event) Validate() error
- type Header
- func (*Header) Descriptor() ([]byte, []int)deprecated
- func (x *Header) GetContentType() ContentType
- func (x *Header) GetIpAddress() string
- func (x *Header) GetLevel() Level
- func (x *Header) GetMeta() map[string]string
- func (x *Header) GetRequestId() string
- func (x *Header) GetSource() string
- func (x *Header) GetTime() int64
- func (x *Header) GetUserAgent() string
- func (*Header) ProtoMessage()
- func (x *Header) ProtoReflect() protoreflect.Message
- func (x *Header) Reset()
- func (x *Header) String() string
- type Level
- type OperateEvent
- func (*OperateEvent) Descriptor() ([]byte, []int)deprecated
- func (x *OperateEvent) GetBody() *OperateEventData
- func (x *OperateEvent) GetHeader() *Header
- func (x *OperateEvent) GetId() string
- func (x *OperateEvent) GetSaveAt() int64
- func (x *OperateEvent) GetType() Type
- func (*OperateEvent) ProtoMessage()
- func (x *OperateEvent) ProtoReflect() protoreflect.Message
- func (x *OperateEvent) Reset()
- func (x *OperateEvent) String() string
- type OperateEventData
- func (*OperateEventData) Descriptor() ([]byte, []int)deprecated
- func (x *OperateEventData) GetAccount() string
- func (x *OperateEventData) GetAction() string
- func (x *OperateEventData) GetCost() int64
- func (x *OperateEventData) GetFeaturePath() string
- func (x *OperateEventData) GetRequest() string
- func (x *OperateEventData) GetResourceType() string
- func (x *OperateEventData) GetResponse() string
- func (x *OperateEventData) GetServiceName() string
- func (x *OperateEventData) GetSession() string
- func (x *OperateEventData) GetUserDomain() string
- func (x *OperateEventData) GetUserName() string
- func (x *OperateEventData) GetUserType() string
- func (*OperateEventData) ProtoMessage()
- func (x *OperateEventData) ProtoReflect() protoreflect.Message
- func (x *OperateEventData) Reset()
- func (x *OperateEventData) String() string
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Level_name = map[int32]string{ 0: "Trace", 1: "Debug", 2: "Info", 3: "Warn", 4: "Error", 5: "Critical", 6: "Disaster", } Level_value = map[string]int32{ "Trace": 0, "Debug": 1, "Info": 2, "Warn": 3, "Error": 4, "Critical": 5, "Disaster": 6, } )
Enum value maps for Level.
View Source
var ( Type_name = map[int32]string{ 0: "Operate", 1: "Status", } Type_value = map[string]int32{ "Operate": 0, "Status": 1, } )
Enum value maps for Type.
View Source
var ( ContentType_name = map[int32]string{ 0: "Protobuf", 1: "Json", } ContentType_value = map[string]int32{ "Protobuf": 0, "Json": 1, } )
Enum value maps for ContentType.
View Source
var File_pb_event_event_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ContentType ¶ added in v1.3.1
type ContentType int32
const ( // Body采用probuf编码, 默认 ContentType_Protobuf ContentType = 0 // 采用Json编码 ContentType_Json ContentType = 1 )
func (ContentType) Descriptor ¶ added in v1.3.1
func (ContentType) Descriptor() protoreflect.EnumDescriptor
func (ContentType) Enum ¶ added in v1.3.1
func (x ContentType) Enum() *ContentType
func (ContentType) EnumDescriptor
deprecated
added in
v1.3.1
func (ContentType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ContentType.Descriptor instead.
func (ContentType) Number ¶ added in v1.3.1
func (x ContentType) Number() protoreflect.EnumNumber
func (ContentType) String ¶ added in v1.3.1
func (x ContentType) String() string
func (ContentType) Type ¶ added in v1.3.1
func (ContentType) Type() protoreflect.EnumType
type Event ¶
type Event struct { // 事件ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 事件类型 Type Type `protobuf:"varint,3,opt,name=type,proto3,enum=mcube.event.Type" json:"type" bson:"type"` // 事件头 Header *Header `protobuf:"bytes,4,opt,name=header,proto3" json:"header" bson:"header"` // data 具体的数据 Body *anypb.Any `protobuf:"bytes,5,opt,name=body,proto3" json:"body" bson:"-"` // contains filtered or unexported fields }
Event to be used by controllers.
func NewJsonOperateEvent ¶ added in v1.3.1
func NewJsonOperateEvent(e *OperateEventData) (*Event, error)
func NewOperateEvent ¶ added in v0.4.0
func NewOperateEvent(t ContentType, e *OperateEventData) (*Event, error)
NewOperateEvent 实例
func NewProtoOperateEvent ¶ added in v1.3.1
func NewProtoOperateEvent(e *OperateEventData) (*Event, error)
func (*Event) Descriptor
deprecated
added in
v0.9.2
func (*Event) GetMetaKey ¶ added in v0.9.2
GetMetaKey 获取meta信息
func (*Event) ProtoMessage ¶ added in v0.9.2
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶ added in v0.9.2
func (x *Event) ProtoReflect() protoreflect.Message
type Header ¶
type Header struct { // 事件发送时间 Time int64 `protobuf:"varint,7,opt,name=time,proto3" json:"time" bson:"time"` // 请求ID RequestId string `protobuf:"bytes,6,opt,name=request_id,json=requestId,proto3" json:"request_id" bson:"request_id"` // 事件来源 Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source" bson:"source"` // 用户UA UserAgent string `protobuf:"bytes,2,opt,name=user_agent,json=userAgent,proto3" json:"user_agent" bson:"user_agent"` // 操作者IP IpAddress string `protobuf:"bytes,3,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address" bson:"ip_address"` // 事件等级 Level Level `protobuf:"varint,4,opt,name=level,proto3,enum=mcube.event.Level" json:"level" bson:"level"` // Body编码格式 ContentType ContentType `` /* 134-byte string literal not displayed */ // 数据metas Meta map[string]string `` /* 151-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Header) Descriptor
deprecated
added in
v0.9.3
func (*Header) GetContentType ¶ added in v1.3.1
func (x *Header) GetContentType() ContentType
func (*Header) GetIpAddress ¶ added in v0.9.5
func (*Header) GetRequestId ¶ added in v0.9.6
func (*Header) GetUserAgent ¶ added in v0.9.5
func (*Header) ProtoMessage ¶ added in v0.9.3
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶ added in v0.9.3
func (x *Header) ProtoReflect() protoreflect.Message
type Level ¶
type Level int32
func (Level) Descriptor ¶ added in v0.9.2
func (Level) Descriptor() protoreflect.EnumDescriptor
func (Level) EnumDescriptor
deprecated
added in
v0.9.2
func (Level) Number ¶ added in v0.9.2
func (x Level) Number() protoreflect.EnumNumber
func (Level) Type ¶ added in v0.9.2
func (Level) Type() protoreflect.EnumType
type OperateEvent ¶ added in v0.4.0
type OperateEvent struct { // 事件ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 事件保存时间 SaveAt int64 `protobuf:"varint,2,opt,name=save_at,json=saveAt,proto3" json:"save_at" bson:"save_at"` // 事件类型 Type Type `protobuf:"varint,3,opt,name=type,proto3,enum=mcube.event.Type" json:"type" bson:"type"` // 事件头 Header *Header `protobuf:"bytes,4,opt,name=header,proto3" json:"header" bson:"header"` // 操作事件数据 Body *OperateEventData `protobuf:"bytes,5,opt,name=body,proto3" json:"body" bson:"body"` // contains filtered or unexported fields }
func (*OperateEvent) Descriptor
deprecated
added in
v0.9.3
func (*OperateEvent) Descriptor() ([]byte, []int)
Deprecated: Use OperateEvent.ProtoReflect.Descriptor instead.
func (*OperateEvent) GetBody ¶ added in v0.9.3
func (x *OperateEvent) GetBody() *OperateEventData
func (*OperateEvent) GetHeader ¶ added in v0.9.3
func (x *OperateEvent) GetHeader() *Header
func (*OperateEvent) GetId ¶ added in v0.9.5
func (x *OperateEvent) GetId() string
func (*OperateEvent) GetSaveAt ¶ added in v1.3.3
func (x *OperateEvent) GetSaveAt() int64
func (*OperateEvent) GetType ¶ added in v0.9.5
func (x *OperateEvent) GetType() Type
func (*OperateEvent) ProtoMessage ¶ added in v0.9.3
func (*OperateEvent) ProtoMessage()
func (*OperateEvent) ProtoReflect ¶ added in v0.9.3
func (x *OperateEvent) ProtoReflect() protoreflect.Message
func (*OperateEvent) Reset ¶ added in v0.9.3
func (x *OperateEvent) Reset()
func (*OperateEvent) String ¶ added in v0.9.3
func (x *OperateEvent) String() string
type OperateEventData ¶ added in v0.9.2
type OperateEventData struct { // 回话ID Session string `protobuf:"bytes,1,opt,name=session,proto3" json:"session" bson:"session"` // 操作人 Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account" bson:"account"` // 用户名称 UserName string `protobuf:"bytes,4,opt,name=user_name,json=userName,proto3" json:"user_name" bson:"user_name"` // 用户类型 UserType string `protobuf:"bytes,5,opt,name=user_type,json=userType,proto3" json:"user_type" bson:"user_type"` // 操作的域 UserDomain string `protobuf:"bytes,6,opt,name=user_domain,json=userDomain,proto3" json:"user_domain" bson:"user_domain"` // 服务名称 ServiceName string `protobuf:"bytes,7,opt,name=service_name,json=serviceName,proto3" json:"service_name" bson:"service_name"` // 功能路径 FeaturePath string `protobuf:"bytes,8,opt,name=feature_path,json=featurePath,proto3" json:"feature_path" bson:"feature_path"` // 资源类型 ResourceType string `protobuf:"bytes,9,opt,name=resource_type,json=resourceType,proto3" json:"resource_type" bson:"resource_type"` // 操作动作 Action string `protobuf:"bytes,10,opt,name=action,proto3" json:"action" bson:"action"` // 操作耗时, 单位毫秒 Cost int64 `protobuf:"varint,13,opt,name=cost,proto3" json:"cost" bson:"cost"` // 事件数据 Request string `protobuf:"bytes,11,opt,name=request,proto3" json:"request,omitempty" bson:"request"` // 事件数据 Response string `protobuf:"bytes,12,opt,name=response,proto3" json:"response,omitempty" bson:"response"` // contains filtered or unexported fields }
OperateEvent 事件具体数据
func (*OperateEventData) Descriptor
deprecated
added in
v0.9.2
func (*OperateEventData) Descriptor() ([]byte, []int)
Deprecated: Use OperateEventData.ProtoReflect.Descriptor instead.
func (*OperateEventData) GetAccount ¶ added in v0.9.2
func (x *OperateEventData) GetAccount() string
func (*OperateEventData) GetAction ¶ added in v0.9.2
func (x *OperateEventData) GetAction() string
func (*OperateEventData) GetCost ¶ added in v0.9.7
func (x *OperateEventData) GetCost() int64
func (*OperateEventData) GetFeaturePath ¶ added in v0.9.2
func (x *OperateEventData) GetFeaturePath() string
func (*OperateEventData) GetRequest ¶ added in v0.9.2
func (x *OperateEventData) GetRequest() string
func (*OperateEventData) GetResourceType ¶ added in v0.9.2
func (x *OperateEventData) GetResourceType() string
func (*OperateEventData) GetResponse ¶ added in v0.9.2
func (x *OperateEventData) GetResponse() string
func (*OperateEventData) GetServiceName ¶ added in v0.9.2
func (x *OperateEventData) GetServiceName() string
func (*OperateEventData) GetSession ¶ added in v0.9.2
func (x *OperateEventData) GetSession() string
func (*OperateEventData) GetUserDomain ¶ added in v0.9.2
func (x *OperateEventData) GetUserDomain() string
func (*OperateEventData) GetUserName ¶ added in v0.9.2
func (x *OperateEventData) GetUserName() string
func (*OperateEventData) GetUserType ¶ added in v0.9.2
func (x *OperateEventData) GetUserType() string
func (*OperateEventData) ProtoMessage ¶ added in v0.9.2
func (*OperateEventData) ProtoMessage()
func (*OperateEventData) ProtoReflect ¶ added in v0.9.2
func (x *OperateEventData) ProtoReflect() protoreflect.Message
func (*OperateEventData) Reset ¶ added in v0.9.2
func (x *OperateEventData) Reset()
func (*OperateEventData) String ¶ added in v0.9.2
func (x *OperateEventData) String() string
type Type ¶ added in v0.4.0
type Type int32
func (Type) Descriptor ¶ added in v0.9.2
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
added in
v0.9.2
func (Type) Number ¶ added in v0.9.2
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶ added in v0.9.2
func (Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.