audit

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MulanPSL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "audit"
)

Variables

View Source
var File_apps_audit_pb_audit_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyauth.apps.audit.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AuditOperate",
			Handler:    _RPC_AuditOperate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/audit/pb/audit.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 AuditOperateLogResponse

type AuditOperateLogResponse struct {
	// contains filtered or unexported fields
}

func (*AuditOperateLogResponse) Descriptor deprecated

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

Deprecated: Use AuditOperateLogResponse.ProtoReflect.Descriptor instead.

func (*AuditOperateLogResponse) ProtoMessage

func (*AuditOperateLogResponse) ProtoMessage()

func (*AuditOperateLogResponse) ProtoReflect

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

func (*AuditOperateLogResponse) Reset

func (x *AuditOperateLogResponse) Reset()

func (*AuditOperateLogResponse) String

func (x *AuditOperateLogResponse) String() string

type OperateLog

type OperateLog struct {

	//	谁
	//
	// @gotags: json:"username" bson:"username"
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username" bson:"username"`
	//	什么时间
	//
	// @gotags: json:"when" bson:"when"
	When int64 `protobuf:"varint,2,opt,name=when,proto3" json:"when" bson:"when"`
	//	什么资源
	//
	// @gotags: json:"resource" bson:"resource"
	Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource" bson:"resource"`
	//	什么服务
	//
	// @gotags: json:"service" bson:"service"
	Service string `protobuf:"bytes,8,opt,name=service,proto3" json:"service" bson:"service"`
	//	什么操作
	//
	// @gotags: json:"action" bson:"action"
	Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action" bson:"action"`
	//	请求参数 url 部分
	//
	// @gotags: json:"url" bson:"url"
	Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url" bson:"url"`
	//	请求参数  body部分
	//
	// @gotags: json:"request" bson:"request"
	Request string `protobuf:"bytes,6,opt,name=request,proto3" json:"request" bson:"request"`
	//	请求参数  请求使用时间
	//
	// @gotags: json:"cost" bson:"cost"
	Cost int64 `protobuf:"varint,9,opt,name=cost,proto3" json:"cost" bson:"cost"`
	//	请求相应
	//
	// @gotags: json:"response" bson:"response"
	Response string `protobuf:"bytes,7,opt,name=response,proto3" json:"response" bson:"response"`
	//	返回状态码
	//
	// @gotags: json:"user_agent" bson:"user_agent"
	UserAgent string `protobuf:"bytes,11,opt,name=user_agent,json=userAgent,proto3" json:"user_agent" bson:"user_agent"`
	//	返回状态码
	//
	// @gotags: json:"remote_ip" bson:"remote_ip"
	RemoteIp string `protobuf:"bytes,12,opt,name=remote_ip,json=remoteIp,proto3" json:"remote_ip" bson:"remote_ip"`
	//	返回状态码
	//
	// @gotags: json:"status_code" bson:"status_code"
	StatusCode int64             `protobuf:"varint,13,opt,name=status_code,json=statusCode,proto3" json:"status_code" bson:"status_code"`
	Meta       map[string]string `` /* 150-byte string literal not displayed */
	// contains filtered or unexported fields
}

func NewOperateLog

func NewOperateLog(service, who, resource, action string) *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) GetCost

func (x *OperateLog) GetCost() int64

func (*OperateLog) GetMeta

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

func (*OperateLog) GetRemoteIp

func (x *OperateLog) GetRemoteIp() string

func (*OperateLog) GetRequest

func (x *OperateLog) GetRequest() string

func (*OperateLog) GetResource

func (x *OperateLog) GetResource() string

func (*OperateLog) GetResponse

func (x *OperateLog) GetResponse() string

func (*OperateLog) GetService

func (x *OperateLog) GetService() string

func (*OperateLog) GetStatusCode

func (x *OperateLog) GetStatusCode() int64

func (*OperateLog) GetUrl

func (x *OperateLog) GetUrl() string

func (*OperateLog) GetUserAgent

func (x *OperateLog) GetUserAgent() string

func (*OperateLog) GetUsername

func (x *OperateLog) GetUsername() string

func (*OperateLog) GetWhen

func (x *OperateLog) GetWhen() int64

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

type RPCClient

type RPCClient interface {
	AuditOperate(ctx context.Context, in *OperateLog, opts ...grpc.CallOption) (*AuditOperateLogResponse, 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 {
	AuditOperate(context.Context, *OperateLog) (*AuditOperateLogResponse, 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 {
	RPCClient
}

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedRPCServer) AuditOperate

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