audit

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "audit"
)
View Source
const (
	RPC_AuditOperator_FullMethodName = "/keyauth.audit.RPC/AuditOperator"
)

Variables

View Source
var File_apps_audit_pb_audit_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyauth.audit.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AuditOperator",
			Handler:    _RPC_AuditOperator_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 AuditOperatorLogResponse

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

func (*AuditOperatorLogResponse) Descriptor deprecated

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

Deprecated: Use AuditOperatorLogResponse.ProtoReflect.Descriptor instead.

func (*AuditOperatorLogResponse) ProtoMessage

func (*AuditOperatorLogResponse) ProtoMessage()

func (*AuditOperatorLogResponse) ProtoReflect

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

func (*AuditOperatorLogResponse) Reset

func (x *AuditOperatorLogResponse) Reset()

func (*AuditOperatorLogResponse) String

func (x *AuditOperatorLogResponse) String() string

type OperatorLog

type OperatorLog 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 NewOperatorLog

func NewOperatorLog(who, resource, action string) *OperatorLog

func (*OperatorLog) Descriptor deprecated

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

Deprecated: Use OperatorLog.ProtoReflect.Descriptor instead.

func (*OperatorLog) GetAction

func (x *OperatorLog) GetAction() string

func (*OperatorLog) GetCost

func (x *OperatorLog) GetCost() int64

func (*OperatorLog) GetMeta

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

func (*OperatorLog) GetRemoteIp

func (x *OperatorLog) GetRemoteIp() string

func (*OperatorLog) GetRequest

func (x *OperatorLog) GetRequest() string

func (*OperatorLog) GetResource

func (x *OperatorLog) GetResource() string

func (*OperatorLog) GetResponse

func (x *OperatorLog) GetResponse() string

func (*OperatorLog) GetService

func (x *OperatorLog) GetService() string

func (*OperatorLog) GetStatusCode

func (x *OperatorLog) GetStatusCode() int64

func (*OperatorLog) GetUrl

func (x *OperatorLog) GetUrl() string

func (*OperatorLog) GetUserAgent

func (x *OperatorLog) GetUserAgent() string

func (*OperatorLog) GetUsername

func (x *OperatorLog) GetUsername() string

func (*OperatorLog) GetWhen

func (x *OperatorLog) GetWhen() int64

func (*OperatorLog) ProtoMessage

func (*OperatorLog) ProtoMessage()

func (*OperatorLog) ProtoReflect

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

func (*OperatorLog) Reset

func (x *OperatorLog) Reset()

func (*OperatorLog) String

func (x *OperatorLog) String() string

type RPCClient

type RPCClient interface {
	AuditOperator(ctx context.Context, in *OperatorLog, opts ...grpc.CallOption) (*AuditOperatorLogResponse, 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 {
	AuditOperator(context.Context, *OperatorLog) (*AuditOperatorLogResponse, 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) AuditOperator

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