v1

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogService_GetLogList_FullMethodName = "/log.v1.LogService/GetLogList"
	LogService_CreateLog_FullMethodName  = "/log.v1.LogService/CreateLog"
)
View Source
const OperationLogServiceCreateLog = "/log.v1.LogService/CreateLog"
View Source
const OperationLogServiceGetLogList = "/log.v1.LogService/GetLogList"

Variables

View Source
var (
	ErrorReason_name = map[int32]string{
		0: "RECORD_NOT_FOUND",
		1: "BAD_REQUEST",
		2: "SYSTEM_ERROR",
	}
	ErrorReason_value = map[string]int32{
		"RECORD_NOT_FOUND": 0,
		"BAD_REQUEST":      1,
		"SYSTEM_ERROR":     2,
	}
)

Enum value maps for ErrorReason.

View Source
var File_log_v1_error_reason_proto protoreflect.FileDescriptor
View Source
var File_log_v1_log_proto protoreflect.FileDescriptor
View Source
var LogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "log.v1.LogService",
	HandlerType: (*LogServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetLogList",
			Handler:    _LogService_GetLogList_Handler,
		},
		{
			MethodName: "CreateLog",
			Handler:    _LogService_CreateLog_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "log/v1/log.proto",
}

LogService_ServiceDesc is the grpc.ServiceDesc for LogService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func ErrorBadRequest

func ErrorBadRequest(format string, args ...interface{}) *errors.Error

func ErrorRecordNotFound

func ErrorRecordNotFound(format string, args ...interface{}) *errors.Error

func ErrorSystemError

func ErrorSystemError(format string, args ...interface{}) *errors.Error

func IsBadRequest

func IsBadRequest(err error) bool

func IsRecordNotFound

func IsRecordNotFound(err error) bool

func IsSystemError

func IsSystemError(err error) bool

func RegisterLogServiceHTTPServer

func RegisterLogServiceHTTPServer(s *http.Server, srv LogServiceHTTPServer)

func RegisterLogServiceServer

func RegisterLogServiceServer(s grpc.ServiceRegistrar, srv LogServiceServer)

Types

type CreateLogReq

type CreateLogReq struct {

	// trace id
	TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	// http/rpc
	Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"`
	// 表
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// 响应时长
	Latency string `protobuf:"bytes,5,opt,name=latency,proto3" json:"latency,omitempty"`
	// 用户id
	UserId string `protobuf:"bytes,6,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// 请求方式
	Method string `protobuf:"bytes,7,opt,name=method,proto3" json:"method,omitempty"`
	// 请求路径
	Path string `protobuf:"bytes,8,opt,name=path,proto3" json:"path,omitempty"`
	// 请求内容
	Request string `protobuf:"bytes,9,opt,name=request,proto3" json:"request,omitempty"`
	// 响应编码
	Code string `protobuf:"bytes,10,opt,name=code,proto3" json:"code,omitempty"`
	// 提示信息
	Reason string `protobuf:"bytes,11,opt,name=reason,proto3" json:"reason,omitempty"`
	// 请求ip
	Ip string `protobuf:"bytes,12,opt,name=ip,proto3" json:"ip,omitempty"`
	// 创建时间
	CreatedAt string `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// kratos操作路径
	Operation string `protobuf:"bytes,14,opt,name=operation,proto3" json:"operation,omitempty"`
	// 用户名
	Username string `protobuf:"bytes,15,opt,name=username,proto3" json:"username,omitempty"`
	// 角色
	Role string `protobuf:"bytes,16,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

请求 - 创建

func (*CreateLogReq) Descriptor deprecated

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

Deprecated: Use CreateLogReq.ProtoReflect.Descriptor instead.

func (*CreateLogReq) GetCode

func (x *CreateLogReq) GetCode() string

func (*CreateLogReq) GetComponent

func (x *CreateLogReq) GetComponent() string

func (*CreateLogReq) GetCreatedAt

func (x *CreateLogReq) GetCreatedAt() string

func (*CreateLogReq) GetIp

func (x *CreateLogReq) GetIp() string

func (*CreateLogReq) GetLatency

func (x *CreateLogReq) GetLatency() string

func (*CreateLogReq) GetMethod

func (x *CreateLogReq) GetMethod() string

func (*CreateLogReq) GetName

func (x *CreateLogReq) GetName() string

func (*CreateLogReq) GetOperation

func (x *CreateLogReq) GetOperation() string

func (*CreateLogReq) GetPath

func (x *CreateLogReq) GetPath() string

func (*CreateLogReq) GetReason

func (x *CreateLogReq) GetReason() string

func (*CreateLogReq) GetRequest

func (x *CreateLogReq) GetRequest() string

func (*CreateLogReq) GetRole

func (x *CreateLogReq) GetRole() string

func (*CreateLogReq) GetTraceId

func (x *CreateLogReq) GetTraceId() string

func (*CreateLogReq) GetUserId

func (x *CreateLogReq) GetUserId() string

func (*CreateLogReq) GetUsername

func (x *CreateLogReq) GetUsername() string

func (*CreateLogReq) ProtoMessage

func (*CreateLogReq) ProtoMessage()

func (*CreateLogReq) ProtoReflect

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

func (*CreateLogReq) Reset

func (x *CreateLogReq) Reset()

func (*CreateLogReq) String

func (x *CreateLogReq) String() string

type ErrorReason

type ErrorReason int32
const (
	ErrorReason_RECORD_NOT_FOUND ErrorReason = 0
	ErrorReason_BAD_REQUEST      ErrorReason = 1
	ErrorReason_SYSTEM_ERROR     ErrorReason = 2
)

func (ErrorReason) Descriptor

func (ErrorReason) Enum

func (x ErrorReason) Enum() *ErrorReason

func (ErrorReason) EnumDescriptor deprecated

func (ErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use ErrorReason.Descriptor instead.

func (ErrorReason) Number

func (x ErrorReason) Number() protoreflect.EnumNumber

func (ErrorReason) String

func (x ErrorReason) String() string

func (ErrorReason) Type

type GetLogListPageRes

type GetLogListPageRes struct {

	// 总数
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	// 列表
	List []*Log `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

响应 - 分页

func (*GetLogListPageRes) Descriptor deprecated

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

Deprecated: Use GetLogListPageRes.ProtoReflect.Descriptor instead.

func (*GetLogListPageRes) GetList

func (x *GetLogListPageRes) GetList() []*Log

func (*GetLogListPageRes) GetTotal

func (x *GetLogListPageRes) GetTotal() int64

func (*GetLogListPageRes) ProtoMessage

func (*GetLogListPageRes) ProtoMessage()

func (*GetLogListPageRes) ProtoReflect

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

func (*GetLogListPageRes) Reset

func (x *GetLogListPageRes) Reset()

func (*GetLogListPageRes) String

func (x *GetLogListPageRes) String() string

type GetLogListReq

type GetLogListReq struct {

	// 主键id
	Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	// 页记录数
	PageSize int64 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
	// 名称
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// userId
	UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// 用户名
	Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"`
	// 角色
	Role string `protobuf:"bytes,6,opt,name=role,proto3" json:"role,omitempty"`
	// 路径
	Operation string `protobuf:"bytes,7,opt,name=operation,proto3" json:"operation,omitempty"`
	// ip
	Ip string `protobuf:"bytes,8,opt,name=ip,proto3" json:"ip,omitempty"`
	// trace_id
	TraceId string `protobuf:"bytes,9,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	// contains filtered or unexported fields
}

请求 - 分页列表

func (*GetLogListReq) Descriptor deprecated

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

Deprecated: Use GetLogListReq.ProtoReflect.Descriptor instead.

func (*GetLogListReq) GetIp

func (x *GetLogListReq) GetIp() string

func (*GetLogListReq) GetName

func (x *GetLogListReq) GetName() string

func (*GetLogListReq) GetOperation

func (x *GetLogListReq) GetOperation() string

func (*GetLogListReq) GetPage

func (x *GetLogListReq) GetPage() int64

func (*GetLogListReq) GetPageSize

func (x *GetLogListReq) GetPageSize() int64

func (*GetLogListReq) GetRole

func (x *GetLogListReq) GetRole() string

func (*GetLogListReq) GetTraceId

func (x *GetLogListReq) GetTraceId() string

func (*GetLogListReq) GetUserId

func (x *GetLogListReq) GetUserId() string

func (*GetLogListReq) GetUsername

func (x *GetLogListReq) GetUsername() string

func (*GetLogListReq) ProtoMessage

func (*GetLogListReq) ProtoMessage()

func (*GetLogListReq) ProtoReflect

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

func (*GetLogListReq) Reset

func (x *GetLogListReq) Reset()

func (*GetLogListReq) String

func (x *GetLogListReq) String() string

type Log

type Log struct {

	// 日志id
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// trace id
	TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	// http/rpc
	Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"`
	// kratos操作路径
	Operation string `protobuf:"bytes,5,opt,name=operation,proto3" json:"operation,omitempty"`
	// 用户id
	UserId string `protobuf:"bytes,6,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// 请求方式
	Method string `protobuf:"bytes,7,opt,name=method,proto3" json:"method,omitempty"`
	// 请求路径
	Path string `protobuf:"bytes,8,opt,name=path,proto3" json:"path,omitempty"`
	// 请求内容
	Request string `protobuf:"bytes,9,opt,name=request,proto3" json:"request,omitempty"`
	// 响应内容
	Code string `protobuf:"bytes,10,opt,name=code,proto3" json:"code,omitempty"`
	// 提示信息
	Reason string `protobuf:"bytes,11,opt,name=reason,proto3" json:"reason,omitempty"`
	// 请求ip
	Ip string `protobuf:"bytes,12,opt,name=ip,proto3" json:"ip,omitempty"`
	// 创建时间
	CreatedAt string `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// 名称
	Name string `protobuf:"bytes,14,opt,name=name,proto3" json:"name,omitempty"`
	// 响应时长
	Latency string `protobuf:"bytes,15,opt,name=latency,proto3" json:"latency,omitempty"`
	// 用户名
	Username string `protobuf:"bytes,16,opt,name=username,proto3" json:"username,omitempty"`
	// 角色
	Role string `protobuf:"bytes,17,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

响应 - 日志信息

func (*Log) Descriptor deprecated

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

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetCode

func (x *Log) GetCode() string

func (*Log) GetComponent

func (x *Log) GetComponent() string

func (*Log) GetCreatedAt

func (x *Log) GetCreatedAt() string

func (*Log) GetId

func (x *Log) GetId() int64

func (*Log) GetIp

func (x *Log) GetIp() string

func (*Log) GetLatency

func (x *Log) GetLatency() string

func (*Log) GetMethod

func (x *Log) GetMethod() string

func (*Log) GetName

func (x *Log) GetName() string

func (*Log) GetOperation

func (x *Log) GetOperation() string

func (*Log) GetPath

func (x *Log) GetPath() string

func (*Log) GetReason

func (x *Log) GetReason() string

func (*Log) GetRequest

func (x *Log) GetRequest() string

func (*Log) GetRole

func (x *Log) GetRole() string

func (*Log) GetTraceId

func (x *Log) GetTraceId() string

func (*Log) GetUserId

func (x *Log) GetUserId() string

func (*Log) GetUsername

func (x *Log) GetUsername() string

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

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

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

type LogServiceClient

type LogServiceClient interface {
	// 列表
	GetLogList(ctx context.Context, in *GetLogListReq, opts ...grpc.CallOption) (*GetLogListPageRes, error)
	// 创建
	CreateLog(ctx context.Context, in *CreateLogReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

LogServiceClient is the client API for LogService 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 NewLogServiceClient

func NewLogServiceClient(cc grpc.ClientConnInterface) LogServiceClient

type LogServiceHTTPClient

type LogServiceHTTPClient interface {
	CreateLog(ctx context.Context, req *CreateLogReq, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
	GetLogList(ctx context.Context, req *GetLogListReq, opts ...http.CallOption) (rsp *GetLogListPageRes, err error)
}

func NewLogServiceHTTPClient

func NewLogServiceHTTPClient(client *http.Client) LogServiceHTTPClient

type LogServiceHTTPClientImpl

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

func (*LogServiceHTTPClientImpl) CreateLog

func (*LogServiceHTTPClientImpl) GetLogList

type LogServiceHTTPServer

type LogServiceHTTPServer interface {
	// CreateLog 创建
	CreateLog(context.Context, *CreateLogReq) (*emptypb.Empty, error)
	// GetLogList 列表
	GetLogList(context.Context, *GetLogListReq) (*GetLogListPageRes, error)
}

type LogServiceServer

type LogServiceServer interface {
	// 列表
	GetLogList(context.Context, *GetLogListReq) (*GetLogListPageRes, error)
	// 创建
	CreateLog(context.Context, *CreateLogReq) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

LogServiceServer is the server API for LogService service. All implementations must embed UnimplementedLogServiceServer for forward compatibility.

日志服务

type UnimplementedLogServiceServer

type UnimplementedLogServiceServer struct{}

UnimplementedLogServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedLogServiceServer) CreateLog

func (UnimplementedLogServiceServer) GetLogList

type UnsafeLogServiceServer

type UnsafeLogServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeLogServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LogServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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