event

package
v0.0.0-...-cdd6459 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Rpc_CreateEvent_FullMethodName = "/maudit.event.Rpc/CreateEvent"
	Rpc_QueryEvent_FullMethodName  = "/maudit.event.Rpc/QueryEvent"
)
View Source
const AppName = "event"

Variables

View Source
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.

View Source
var File_apps_event_pb_model_proto protoreflect.FileDescriptor
View Source
var File_apps_event_pb_rpc_proto protoreflect.FileDescriptor
View Source
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 NewEvent

func NewEvent() *Event

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetAction

func (x *Event) GetAction() string

func (*Event) GetAgent

func (x *Event) GetAgent() string

func (*Event) GetId

func (x *Event) GetId() int64

func (*Event) GetLocation

func (x *Event) GetLocation() string

func (*Event) GetResource

func (x *Event) GetResource() string

func (*Event) GetResponseCode

func (x *Event) GetResponseCode() int64

func (*Event) GetService

func (x *Event) GetService() string

func (*Event) GetSource

func (x *Event) GetSource() string

func (*Event) GetTime

func (x *Event) GetTime() int64

func (*Event) GetUser

func (x *Event) GetUser() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use EventSet.ProtoReflect.Descriptor instead.

func (*EventSet) GetItems

func (x *EventSet) GetItems() []*Event

func (*EventSet) GetTotal

func (x *EventSet) GetTotal() int64

func (*EventSet) ProtoMessage

func (*EventSet) ProtoMessage()

func (*EventSet) ProtoReflect

func (x *EventSet) ProtoReflect() protoreflect.Message

func (*EventSet) Reset

func (x *EventSet) Reset()

func (*EventSet) String

func (x *EventSet) String() string

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

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 Service

type Service interface {
	RpcServer
	CreateTable(ctx context.Context) error
}

func GetSvc

func GetSvc() Service

type UnimplementedRpcServer

type UnimplementedRpcServer struct {
}

UnimplementedRpcServer must be embedded to have forward compatible implementations.

func (UnimplementedRpcServer) CreateEvent

func (UnimplementedRpcServer) QueryEvent

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL