Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetAction() string
- func (x *Event) GetAgent() string
- func (x *Event) GetId() int64
- func (x *Event) GetLocation() string
- func (x *Event) GetResource() string
- func (x *Event) GetResponseCode() int64
- func (x *Event) GetService() string
- func (x *Event) GetSource() string
- func (x *Event) GetTime() int64
- func (x *Event) GetUser() string
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type EventSet
- type QUERY_TYPE
- type QueryEventRequest
- func (*QueryEventRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryEventRequest) GetKeyword() string
- func (x *QueryEventRequest) GetPageNum() int64
- func (x *QueryEventRequest) GetPageSize() int64
- func (x *QueryEventRequest) GetQueryType() QUERY_TYPE
- func (*QueryEventRequest) ProtoMessage()
- func (x *QueryEventRequest) ProtoReflect() protoreflect.Message
- func (x *QueryEventRequest) Reset()
- func (x *QueryEventRequest) String() string
- type RpcClient
- type RpcServer
- type Service
- type UnimplementedRpcServer
- type UnsafeRpcServer
Constants ¶
const ( Rpc_CreateEvent_FullMethodName = "/maudit.event.Rpc/CreateEvent" Rpc_QueryEvent_FullMethodName = "/maudit.event.Rpc/QueryEvent" )
const AppName = "event"
Variables ¶
var ( QUERY_TYPE_name = map[int32]string{ 0: "QUERY_TYPE_UNSPECIFIED", 1: "QUERY_TYPE_ALL", 2: "QUERY_TYPE_USERNAME", 3: "QUERY_TYPE_SERVICE", } QUERY_TYPE_value = map[string]int32{ "QUERY_TYPE_UNSPECIFIED": 0, "QUERY_TYPE_ALL": 1, "QUERY_TYPE_USERNAME": 2, "QUERY_TYPE_SERVICE": 3, } )
Enum value maps for QUERY_TYPE.
var File_apps_event_pb_model_proto protoreflect.FileDescriptor
var File_apps_event_pb_rpc_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "maudit.event.Rpc", HandlerType: (*RpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateEvent", Handler: _Rpc_CreateEvent_Handler, }, { MethodName: "QueryEvent", Handler: _Rpc_QueryEvent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/event/pb/rpc.proto", }
Rpc_ServiceDesc is the grpc.ServiceDesc for Rpc service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRpcServer ¶
func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
Types ¶
type Event ¶
type Event struct { // @gotags: json:"created_at" gorm:"primaryKey" Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"created_at" gorm:"primaryKey"` // @gotags: validate:"required" Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty" validate:"required"` // @gotags: validate:"required" User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty" validate:"required"` // @gotags: validate:"required" Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty" validate:"required"` // @gotags: validate:"required" Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty" validate:"required"` // @gotags: validate:"required" Agent string `protobuf:"bytes,6,opt,name=agent,proto3" json:"agent,omitempty" validate:"required"` // @gotags: validate:"required" Service string `protobuf:"bytes,7,opt,name=service,proto3" json:"service,omitempty" validate:"required"` // @gotags: validate:"required" Resource string `protobuf:"bytes,8,opt,name=resource,proto3" json:"resource,omitempty" validate:"required"` // @gotags: validate:"required" Action string `protobuf:"bytes,9,opt,name=action,proto3" json:"action,omitempty" validate:"required"` // @gotags: validate:"required" ResponseCode int64 `protobuf:"varint,10,opt,name=response_code,json=responseCode,proto3" json:"response_code,omitempty" validate:"required"` // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
func (*Event) GetLocation ¶
func (*Event) GetResource ¶
func (*Event) GetResponseCode ¶
func (*Event) GetService ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventSet ¶
type EventSet struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Items []*Event `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func NewEventSet ¶
func NewEventSet() *EventSet
func (*EventSet) Descriptor
deprecated
func (*EventSet) ProtoMessage ¶
func (*EventSet) ProtoMessage()
func (*EventSet) ProtoReflect ¶
func (x *EventSet) ProtoReflect() protoreflect.Message
type QUERY_TYPE ¶
type QUERY_TYPE int32
const ( QUERY_TYPE_QUERY_TYPE_UNSPECIFIED QUERY_TYPE = 0 QUERY_TYPE_QUERY_TYPE_ALL QUERY_TYPE = 1 QUERY_TYPE_QUERY_TYPE_USERNAME QUERY_TYPE = 2 QUERY_TYPE_QUERY_TYPE_SERVICE QUERY_TYPE = 3 )
func (QUERY_TYPE) Descriptor ¶
func (QUERY_TYPE) Descriptor() protoreflect.EnumDescriptor
func (QUERY_TYPE) Enum ¶
func (x QUERY_TYPE) Enum() *QUERY_TYPE
func (QUERY_TYPE) EnumDescriptor
deprecated
func (QUERY_TYPE) EnumDescriptor() ([]byte, []int)
Deprecated: Use QUERY_TYPE.Descriptor instead.
func (QUERY_TYPE) Number ¶
func (x QUERY_TYPE) Number() protoreflect.EnumNumber
func (QUERY_TYPE) String ¶
func (x QUERY_TYPE) String() string
func (QUERY_TYPE) Type ¶
func (QUERY_TYPE) Type() protoreflect.EnumType
type QueryEventRequest ¶
type QueryEventRequest struct { // @gotags: validate:"required" schema:"pageNum" PageNum int64 `protobuf:"varint,1,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty" validate:"required" schema:"pageNum"` // @gotags: validate:"required" schema:"pageSize" PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty" validate:"required" schema:"pageSize"` // @gotags: validate:"required" schema:"queryType" QueryType QUERY_TYPE `` /* 157-byte string literal not displayed */ Keyword string `protobuf:"bytes,4,opt,name=keyword,proto3" json:"keyword,omitempty"` // contains filtered or unexported fields }
func (*QueryEventRequest) Descriptor
deprecated
func (*QueryEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryEventRequest.ProtoReflect.Descriptor instead.
func (*QueryEventRequest) GetKeyword ¶
func (x *QueryEventRequest) GetKeyword() string
func (*QueryEventRequest) GetPageNum ¶
func (x *QueryEventRequest) GetPageNum() int64
func (*QueryEventRequest) GetPageSize ¶
func (x *QueryEventRequest) GetPageSize() int64
func (*QueryEventRequest) GetQueryType ¶
func (x *QueryEventRequest) GetQueryType() QUERY_TYPE
func (*QueryEventRequest) ProtoMessage ¶
func (*QueryEventRequest) ProtoMessage()
func (*QueryEventRequest) ProtoReflect ¶
func (x *QueryEventRequest) ProtoReflect() protoreflect.Message
func (*QueryEventRequest) Reset ¶
func (x *QueryEventRequest) Reset()
func (*QueryEventRequest) String ¶
func (x *QueryEventRequest) String() string
type RpcClient ¶
type RpcClient interface { // 对Event 表进行操作 CreateEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*Event, error) QueryEvent(ctx context.Context, in *QueryEventRequest, opts ...grpc.CallOption) (*EventSet, error) }
RpcClient is the client API for Rpc service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewRpcClient ¶
func NewRpcClient(cc grpc.ClientConnInterface) RpcClient
type RpcServer ¶
type RpcServer interface { // 对Event 表进行操作 CreateEvent(context.Context, *Event) (*Event, error) QueryEvent(context.Context, *QueryEventRequest) (*EventSet, error) // contains filtered or unexported methods }
RpcServer is the server API for Rpc service. All implementations must embed UnimplementedRpcServer for forward compatibility
type UnimplementedRpcServer ¶
type UnimplementedRpcServer struct { }
UnimplementedRpcServer must be embedded to have forward compatible implementations.
func (UnimplementedRpcServer) CreateEvent ¶
func (UnimplementedRpcServer) QueryEvent ¶
func (UnimplementedRpcServer) QueryEvent(context.Context, *QueryEventRequest) (*EventSet, error)
type UnsafeRpcServer ¶
type UnsafeRpcServer interface {
// contains filtered or unexported methods
}
UnsafeRpcServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RpcServer will result in compilation errors.