log

package
v0.0.0-...-7bc4f86 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogLevel_name = map[int32]string{
		0: "LOG_LEVEL_INVALID",
		1: "LOG_LEVEL_DEBUG",
		2: "LOG_LEVEL_INFO",
		3: "LOG_LEVEL_WARNING",
		4: "LOG_LEVEL_ERROR",
		5: "LOG_LEVEL_FATAL",
	}
	LogLevel_value = map[string]int32{
		"LOG_LEVEL_INVALID": 0,
		"LOG_LEVEL_DEBUG":   1,
		"LOG_LEVEL_INFO":    2,
		"LOG_LEVEL_WARNING": 3,
		"LOG_LEVEL_ERROR":   4,
		"LOG_LEVEL_FATAL":   5,
	}
)

Enum value maps for LogLevel.

View Source
var File_log_base_proto protoreflect.FileDescriptor
View Source
var File_log_log_proto protoreflect.FileDescriptor
View Source
var LogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "log.LogService",
	HandlerType: (*LogServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddLog",
			Handler:    _LogService_AddLog_Handler,
		},
		{
			MethodName: "GetLogs",
			Handler:    _LogService_GetLogs_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "log/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 RegisterLogServiceServer

func RegisterLogServiceServer(s grpc.ServiceRegistrar, srv LogServiceServer)

Types

type AddLogReq

type AddLogReq struct {
	ServiceName string   `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	Level       LogLevel `protobuf:"varint,2,opt,name=level,proto3,enum=log.LogLevel" json:"level,omitempty"`
	Content     []byte   `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	TraceId     string   `protobuf:"bytes,4,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddLogReq) Descriptor deprecated

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

Deprecated: Use AddLogReq.ProtoReflect.Descriptor instead.

func (*AddLogReq) GetContent

func (x *AddLogReq) GetContent() []byte

func (*AddLogReq) GetLevel

func (x *AddLogReq) GetLevel() LogLevel

func (*AddLogReq) GetServiceName

func (x *AddLogReq) GetServiceName() string

func (*AddLogReq) GetTraceId

func (x *AddLogReq) GetTraceId() string

func (*AddLogReq) ProtoMessage

func (*AddLogReq) ProtoMessage()

func (*AddLogReq) ProtoReflect

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

func (*AddLogReq) Reset

func (x *AddLogReq) Reset()

func (*AddLogReq) String

func (x *AddLogReq) String() string

type AddLogRes

type AddLogRes struct {
	Log *LogInfo `protobuf:"bytes,1,opt,name=log,proto3" json:"log,omitempty"`
	// contains filtered or unexported fields
}

func (*AddLogRes) Descriptor deprecated

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

Deprecated: Use AddLogRes.ProtoReflect.Descriptor instead.

func (*AddLogRes) GetLog

func (x *AddLogRes) GetLog() *LogInfo

func (*AddLogRes) ProtoMessage

func (*AddLogRes) ProtoMessage()

func (*AddLogRes) ProtoReflect

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

func (*AddLogRes) Reset

func (x *AddLogRes) Reset()

func (*AddLogRes) String

func (x *AddLogRes) String() string

type GetLogsReq

type GetLogsReq struct {
	ServiceName string         `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	Level       LogLevel       `protobuf:"varint,2,opt,name=level,proto3,enum=log.LogLevel" json:"level,omitempty"`
	TraceId     string         `protobuf:"bytes,3,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	CreatedFrom int64          `protobuf:"varint,4,opt,name=created_from,json=createdFrom,proto3" json:"created_from,omitempty"`
	CreatedTo   int64          `protobuf:"varint,5,opt,name=created_to,json=createdTo,proto3" json:"created_to,omitempty"`
	Pagination  *PaginationReq `protobuf:"bytes,6,opt,name=pagination,proto3" json:"pagination,omitempty"`
	Sort        *SortReq       `protobuf:"bytes,7,opt,name=sort,proto3" json:"sort,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLogsReq) Descriptor deprecated

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

Deprecated: Use GetLogsReq.ProtoReflect.Descriptor instead.

func (*GetLogsReq) GetCreatedFrom

func (x *GetLogsReq) GetCreatedFrom() int64

func (*GetLogsReq) GetCreatedTo

func (x *GetLogsReq) GetCreatedTo() int64

func (*GetLogsReq) GetLevel

func (x *GetLogsReq) GetLevel() LogLevel

func (*GetLogsReq) GetPagination

func (x *GetLogsReq) GetPagination() *PaginationReq

func (*GetLogsReq) GetServiceName

func (x *GetLogsReq) GetServiceName() string

func (*GetLogsReq) GetSort

func (x *GetLogsReq) GetSort() *SortReq

func (*GetLogsReq) GetTraceId

func (x *GetLogsReq) GetTraceId() string

func (*GetLogsReq) ProtoMessage

func (*GetLogsReq) ProtoMessage()

func (*GetLogsReq) ProtoReflect

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

func (*GetLogsReq) Reset

func (x *GetLogsReq) Reset()

func (*GetLogsReq) String

func (x *GetLogsReq) String() string

type GetLogsRes

type GetLogsRes struct {
	Logs       []*LogInfo     `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
	Pagination *PaginationRes `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLogsRes) Descriptor deprecated

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

Deprecated: Use GetLogsRes.ProtoReflect.Descriptor instead.

func (*GetLogsRes) GetLogs

func (x *GetLogsRes) GetLogs() []*LogInfo

func (*GetLogsRes) GetPagination

func (x *GetLogsRes) GetPagination() *PaginationRes

func (*GetLogsRes) ProtoMessage

func (*GetLogsRes) ProtoMessage()

func (*GetLogsRes) ProtoReflect

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

func (*GetLogsRes) Reset

func (x *GetLogsRes) Reset()

func (*GetLogsRes) String

func (x *GetLogsRes) String() string

type LogInfo

type LogInfo struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	Level       string `protobuf:"bytes,3,opt,name=level,proto3" json:"level,omitempty"`
	Content     []byte `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	TraceId     string `protobuf:"bytes,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	CreatedAt   string `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*LogInfo) Descriptor deprecated

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

Deprecated: Use LogInfo.ProtoReflect.Descriptor instead.

func (*LogInfo) GetContent

func (x *LogInfo) GetContent() []byte

func (*LogInfo) GetCreatedAt

func (x *LogInfo) GetCreatedAt() string

func (*LogInfo) GetId

func (x *LogInfo) GetId() string

func (*LogInfo) GetLevel

func (x *LogInfo) GetLevel() string

func (*LogInfo) GetServiceName

func (x *LogInfo) GetServiceName() string

func (*LogInfo) GetTraceId

func (x *LogInfo) GetTraceId() string

func (*LogInfo) ProtoMessage

func (*LogInfo) ProtoMessage()

func (*LogInfo) ProtoReflect

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

func (*LogInfo) Reset

func (x *LogInfo) Reset()

func (*LogInfo) String

func (x *LogInfo) String() string

type LogLevel

type LogLevel int32
const (
	LogLevel_LOG_LEVEL_INVALID LogLevel = 0
	LogLevel_LOG_LEVEL_DEBUG   LogLevel = 1
	LogLevel_LOG_LEVEL_INFO    LogLevel = 2
	LogLevel_LOG_LEVEL_WARNING LogLevel = 3
	LogLevel_LOG_LEVEL_ERROR   LogLevel = 4
	LogLevel_LOG_LEVEL_FATAL   LogLevel = 5
)

func (LogLevel) Descriptor

func (LogLevel) Descriptor() protoreflect.EnumDescriptor

func (LogLevel) Enum

func (x LogLevel) Enum() *LogLevel

func (LogLevel) EnumDescriptor deprecated

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

Deprecated: Use LogLevel.Descriptor instead.

func (LogLevel) Number

func (x LogLevel) Number() protoreflect.EnumNumber

func (LogLevel) String

func (x LogLevel) String() string

func (LogLevel) Type

type LogServiceClient

type LogServiceClient interface {
	AddLog(ctx context.Context, in *AddLogReq, opts ...grpc.CallOption) (*AddLogRes, error)
	GetLogs(ctx context.Context, in *GetLogsReq, opts ...grpc.CallOption) (*GetLogsRes, 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 LogServiceServer

type LogServiceServer interface {
	AddLog(context.Context, *AddLogReq) (*AddLogRes, error)
	GetLogs(context.Context, *GetLogsReq) (*GetLogsRes, error)
	// contains filtered or unexported methods
}

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

type PaginationReq

type PaginationReq struct {
	Page  int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*PaginationReq) Descriptor deprecated

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

Deprecated: Use PaginationReq.ProtoReflect.Descriptor instead.

func (*PaginationReq) GetLimit

func (x *PaginationReq) GetLimit() int64

func (*PaginationReq) GetPage

func (x *PaginationReq) GetPage() int64

func (*PaginationReq) ProtoMessage

func (*PaginationReq) ProtoMessage()

func (*PaginationReq) ProtoReflect

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

func (*PaginationReq) Reset

func (x *PaginationReq) Reset()

func (*PaginationReq) String

func (x *PaginationReq) String() string

type PaginationRes

type PaginationRes struct {
	CurrentPage int64 `protobuf:"varint,1,opt,name=current_page,json=currentPage,proto3" json:"current_page,omitempty"`
	TotalPage   int64 `protobuf:"varint,2,opt,name=total_page,json=totalPage,proto3" json:"total_page,omitempty"`
	Skip        int64 `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"`
	Limit       int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
	Total       int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*PaginationRes) Descriptor deprecated

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

Deprecated: Use PaginationRes.ProtoReflect.Descriptor instead.

func (*PaginationRes) GetCurrentPage

func (x *PaginationRes) GetCurrentPage() int64

func (*PaginationRes) GetLimit

func (x *PaginationRes) GetLimit() int64

func (*PaginationRes) GetSkip

func (x *PaginationRes) GetSkip() int64

func (*PaginationRes) GetTotal

func (x *PaginationRes) GetTotal() int64

func (*PaginationRes) GetTotalPage

func (x *PaginationRes) GetTotalPage() int64

func (*PaginationRes) ProtoMessage

func (*PaginationRes) ProtoMessage()

func (*PaginationRes) ProtoReflect

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

func (*PaginationRes) Reset

func (x *PaginationRes) Reset()

func (*PaginationRes) String

func (x *PaginationRes) String() string

type SortReq

type SortReq struct {
	Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
	Desc  bool   `protobuf:"varint,2,opt,name=desc,proto3" json:"desc,omitempty"`
	// contains filtered or unexported fields
}

func (*SortReq) Descriptor deprecated

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

Deprecated: Use SortReq.ProtoReflect.Descriptor instead.

func (*SortReq) GetDesc

func (x *SortReq) GetDesc() bool

func (*SortReq) GetField

func (x *SortReq) GetField() string

func (*SortReq) ProtoMessage

func (*SortReq) ProtoMessage()

func (*SortReq) ProtoReflect

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

func (*SortReq) Reset

func (x *SortReq) Reset()

func (*SortReq) String

func (x *SortReq) String() string

type UnimplementedLogServiceServer

type UnimplementedLogServiceServer struct {
}

UnimplementedLogServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedLogServiceServer) AddLog

func (UnimplementedLogServiceServer) GetLogs

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