operate

package
v0.0.0-...-055c0a6 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: MulanPSL-2.0 Imports: 10 Imported by: 0

README

操作审计

Documentation

Index

Constants

View Source
const (
	AppName = "operate"
)

Variables

View Source
var File_apps_operate_pb_operate_proto protoreflect.FileDescriptor
View Source
var File_apps_operate_pb_rpc_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "devcloud.maudit.operate.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SaveOperateLog",
			Handler:    _RPC_SaveOperateLog_Handler,
		},
		{
			MethodName: "QueryOperateLog",
			Handler:    _RPC_QueryOperateLog_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/operate/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 OperateLog

type OperateLog struct {

	// 用户域
	// @gotags: json:"domain" bson:"domain" validate:"required"
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain" bson:"domain" validate:"required"`
	// 用户所处空间
	// @gotags: json:"namespace" bson:"namespace" validate:"required"
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace" bson:"namespace" validate:"required"`
	// 操作人
	// @gotags: json:"username" bson:"username" validate:"required"
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username" bson:"username" validate:"required"`
	// 操作人
	// @gotags: json:"user_agent" bson:"user_agent"
	UserAgent string `protobuf:"bytes,4,opt,name=user_agent,json=userAgent,proto3" json:"user_agent" bson:"user_agent"`
	// 操作时间, 毫秒的时间戳
	// @gotags: json:"time" bson:"time"
	Time int64 `protobuf:"varint,5,opt,name=time,proto3" json:"time" bson:"time"`
	// 操作资源类型
	// @gotags: json:"resource_type" bson:"resource_type" validate:"required"
	ResourceType string `` /* 128-byte string literal not displayed */
	// 操作资源类型
	// @gotags: json:"resource_id" bson:"resource_id"
	ResourceId string `protobuf:"bytes,7,opt,name=resource_id,json=resourceId,proto3" json:"resource_id" bson:"resource_id"`
	// 执行的操作
	// @gotags: json:"action" bson:"action" validate:"required"
	Action string `protobuf:"bytes,8,opt,name=action,proto3" json:"action" bson:"action" validate:"required"`
	// 执行的操作
	// @gotags: json:"detail" bson:"detail"
	Detail string `protobuf:"bytes,9,opt,name=detail,proto3" json:"detail" bson:"detail"`
	// 请求参数 json string
	// @gotags: json:"request" bson:"request"
	Request string `protobuf:"bytes,11,opt,name=request,proto3" json:"request" bson:"request"`
	// 响应参数 json string
	// @gotags: json:"response" bson:"response"
	Response string `protobuf:"bytes,12,opt,name=response,proto3" json:"response" bson:"response"`
	// 执行的操作
	// @gotags: json:"external" bson:"external"
	External map[string]string `` /* 164-byte string literal not displayed */
	// contains filtered or unexported fields
}

操作日志 Who When What(操作)

func NewOperateLog

func NewOperateLog() *OperateLog

func (*OperateLog) Descriptor deprecated

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

Deprecated: Use OperateLog.ProtoReflect.Descriptor instead.

func (*OperateLog) GetAction

func (x *OperateLog) GetAction() string

func (*OperateLog) GetDetail

func (x *OperateLog) GetDetail() string

func (*OperateLog) GetDomain

func (x *OperateLog) GetDomain() string

func (*OperateLog) GetExternal

func (x *OperateLog) GetExternal() map[string]string

func (*OperateLog) GetNamespace

func (x *OperateLog) GetNamespace() string

func (*OperateLog) GetRequest

func (x *OperateLog) GetRequest() string

func (*OperateLog) GetResourceId

func (x *OperateLog) GetResourceId() string

func (*OperateLog) GetResourceType

func (x *OperateLog) GetResourceType() string

func (*OperateLog) GetResponse

func (x *OperateLog) GetResponse() string

func (*OperateLog) GetTime

func (x *OperateLog) GetTime() int64

func (*OperateLog) GetUserAgent

func (x *OperateLog) GetUserAgent() string

func (*OperateLog) GetUsername

func (x *OperateLog) GetUsername() string

func (*OperateLog) ProtoMessage

func (*OperateLog) ProtoMessage()

func (*OperateLog) ProtoReflect

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

func (*OperateLog) Reset

func (x *OperateLog) Reset()

func (*OperateLog) String

func (x *OperateLog) String() string

func (*OperateLog) Validate

func (l *OperateLog) Validate() error

type OperateLogSet

type OperateLogSet struct {

	// 总量
	// @gotags: json:"total" bson:"total"
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"`
	// 数据
	// @gotags: json:"items" bson:"items"
	Items []*OperateLog `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"`
	// contains filtered or unexported fields
}

func NewOperateLogSet

func NewOperateLogSet() *OperateLogSet

func (*OperateLogSet) Add

func (s *OperateLogSet) Add(item *OperateLog)

func (*OperateLogSet) Descriptor deprecated

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

Deprecated: Use OperateLogSet.ProtoReflect.Descriptor instead.

func (*OperateLogSet) GetItems

func (x *OperateLogSet) GetItems() []*OperateLog

func (*OperateLogSet) GetTotal

func (x *OperateLogSet) GetTotal() int64

func (*OperateLogSet) ProtoMessage

func (*OperateLogSet) ProtoMessage()

func (*OperateLogSet) ProtoReflect

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

func (*OperateLogSet) Reset

func (x *OperateLogSet) Reset()

func (*OperateLogSet) String

func (x *OperateLogSet) String() string

type QueryOperateLogRequest

type QueryOperateLogRequest struct {

	// 分页参数
	// @gotags: json:"page"
	Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// 返回的消息
	// @gotags: json:"username" bson:"username"
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username" bson:"username"`
	// contains filtered or unexported fields
}

func NewQueryOperateLogRequest

func NewQueryOperateLogRequest() *QueryOperateLogRequest

func (*QueryOperateLogRequest) Descriptor deprecated

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

Deprecated: Use QueryOperateLogRequest.ProtoReflect.Descriptor instead.

func (*QueryOperateLogRequest) GetPage

func (*QueryOperateLogRequest) GetUsername

func (x *QueryOperateLogRequest) GetUsername() string

func (*QueryOperateLogRequest) ProtoMessage

func (*QueryOperateLogRequest) ProtoMessage()

func (*QueryOperateLogRequest) ProtoReflect

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

func (*QueryOperateLogRequest) Reset

func (x *QueryOperateLogRequest) Reset()

func (*QueryOperateLogRequest) String

func (x *QueryOperateLogRequest) String() string

func (*QueryOperateLogRequest) Validate

func (req *QueryOperateLogRequest) Validate() error

type RPCClient

type RPCClient interface {
	SaveOperateLog(ctx context.Context, in *OperateLog, opts ...grpc.CallOption) (*SaveOperateLogResponse, error)
	QueryOperateLog(ctx context.Context, in *QueryOperateLogRequest, opts ...grpc.CallOption) (*OperateLogSet, 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 {
	SaveOperateLog(context.Context, *OperateLog) (*SaveOperateLogResponse, error)
	QueryOperateLog(context.Context, *QueryOperateLogRequest) (*OperateLogSet, error)
	// contains filtered or unexported methods
}

RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility

type SaveOperateLogResponse

type SaveOperateLogResponse struct {

	// 返回的消息
	// @gotags: json:"message" bson:"message"
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message" bson:"message"`
	// contains filtered or unexported fields
}

func (*SaveOperateLogResponse) Descriptor deprecated

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

Deprecated: Use SaveOperateLogResponse.ProtoReflect.Descriptor instead.

func (*SaveOperateLogResponse) GetMessage

func (x *SaveOperateLogResponse) GetMessage() string

func (*SaveOperateLogResponse) ProtoMessage

func (*SaveOperateLogResponse) ProtoMessage()

func (*SaveOperateLogResponse) ProtoReflect

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

func (*SaveOperateLogResponse) Reset

func (x *SaveOperateLogResponse) Reset()

func (*SaveOperateLogResponse) String

func (x *SaveOperateLogResponse) String() string

type Service

type Service interface {
	RPCServer
}

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedRPCServer) QueryOperateLog

func (UnimplementedRPCServer) SaveOperateLog

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