audit

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 9 Imported by: 0

README

用户行为审计

Who When What

谁 什么时候 干什么

认证 事件发生时间 对那个接口, 发起了什么请求

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_g7.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:"service" bson:"service"
	Service string `protobuf:"bytes,3,opt,name=service,proto3" json:"service" bson:"service"`
	// 对那种资源
	// @gotags: json:"resource" bson:"resource"
	Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource" bson:"resource"`
	// 对那种资源
	// @gotags: json:"action" bson:"action"
	Action string `protobuf:"bytes,5,opt,name=action,proto3" json:"action" bson:"action"`
	// 请求参数, URL部分
	// @gotags: json:"url" bson:"url"
	Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url" bson:"url"`
	// 请求参数, body部分
	// @gotags: json:"request" bson:"request"
	Request string `protobuf:"bytes,7,opt,name=request,proto3" json:"request" bson:"request"`
	// 请求响应
	// @gotags: json:"response" bson:"response"
	Response string `protobuf:"bytes,8,opt,name=response,proto3" json:"response" bson:"response"`
	// 调用时间
	// @gotags: json:"cost" bson:"cost"
	Cost int64 `protobuf:"varint,9,opt,name=cost,proto3" json:"cost" bson:"cost"`
	// 状态码
	// @gotags: json:"status_code" bson:"status_code"
	StatusCode int64 `protobuf:"varint,10,opt,name=status_code,json=statusCode,proto3" json:"status_code" bson:"status_code"`
	// 状态码
	// @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:"meta" bson:"meta"
	Meta map[string]string `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

操作日志

func NewOperateLog

func NewOperateLog(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 added in v0.0.8

func (x *OperateLog) GetCost() int64

func (*OperateLog) GetMeta

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

func (*OperateLog) GetRemoteIp added in v0.0.8

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 added in v0.0.8

func (x *OperateLog) GetService() string

func (*OperateLog) GetStatusCode added in v0.0.8

func (x *OperateLog) GetStatusCode() int64

func (*OperateLog) GetUrl added in v0.0.8

func (x *OperateLog) GetUrl() string

func (*OperateLog) GetUserAgent added in v0.0.8

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 {
	RPCServer
}

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