log

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Log_CreateDeviceLog_FullMethodName = "/api.log.Log/CreateDeviceLog"
	Log_ListDeviceLog_FullMethodName   = "/api.log.Log/ListDeviceLog"
)
View Source
const OperationLogCreateDeviceLog = "/api.log.Log/CreateDeviceLog"
View Source
const OperationLogListDeviceLog = "/api.log.Log/ListDeviceLog"

Variables

View Source
var (
	DeviceLogOrder_name = map[int32]string{
		0: "TIMESTAMP",
		1: "CREATED_AT",
	}
	DeviceLogOrder_value = map[string]int32{
		"TIMESTAMP":  0,
		"CREATED_AT": 1,
	}
)

Enum value maps for DeviceLogOrder.

View Source
var (
	Sort_name = map[int32]string{
		0: "DESC",
		1: "ASC",
	}
	Sort_value = map[string]int32{
		"DESC": 0,
		"ASC":  1,
	}
)

Enum value maps for Sort.

View Source
var File_log_log_proto protoreflect.FileDescriptor
View Source
var Log_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.log.Log",
	HandlerType: (*LogServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateDeviceLog",
			Handler:    _Log_CreateDeviceLog_Handler,
		},
		{
			MethodName: "ListDeviceLog",
			Handler:    _Log_ListDeviceLog_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "log/log.proto",
}

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

Functions

func RegisterLogHTTPServer

func RegisterLogHTTPServer(s *http.Server, srv LogHTTPServer)

func RegisterLogServer

func RegisterLogServer(s grpc.ServiceRegistrar, srv LogServer)

Types

type DeviceLog

type DeviceLog struct {
	Id   uint64         `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Data *DeviceLogData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*DeviceLog) Descriptor deprecated

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

Deprecated: Use DeviceLog.ProtoReflect.Descriptor instead.

func (*DeviceLog) GetData added in v0.2.4

func (x *DeviceLog) GetData() *DeviceLogData

func (*DeviceLog) GetId added in v0.2.2

func (x *DeviceLog) GetId() uint64

func (*DeviceLog) ProtoMessage

func (*DeviceLog) ProtoMessage()

func (*DeviceLog) ProtoReflect

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

func (*DeviceLog) Reset

func (x *DeviceLog) Reset()

func (*DeviceLog) String

func (x *DeviceLog) String() string

type DeviceLogData added in v0.2.4

type DeviceLogData struct {
	DeviceId  uint64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"deviceId"` // @gotags: json:"deviceId"
	Topic     string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	Message   string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Level     uint32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"`
	Timestamp int64  `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*DeviceLogData) Descriptor deprecated added in v0.2.4

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

Deprecated: Use DeviceLogData.ProtoReflect.Descriptor instead.

func (*DeviceLogData) GetDeviceId added in v0.2.4

func (x *DeviceLogData) GetDeviceId() uint64

func (*DeviceLogData) GetLevel added in v0.2.4

func (x *DeviceLogData) GetLevel() uint32

func (*DeviceLogData) GetMessage added in v0.2.4

func (x *DeviceLogData) GetMessage() string

func (*DeviceLogData) GetTimestamp added in v0.2.4

func (x *DeviceLogData) GetTimestamp() int64

func (*DeviceLogData) GetTopic added in v0.2.4

func (x *DeviceLogData) GetTopic() string

func (*DeviceLogData) ProtoMessage added in v0.2.4

func (*DeviceLogData) ProtoMessage()

func (*DeviceLogData) ProtoReflect added in v0.2.4

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

func (*DeviceLogData) Reset added in v0.2.4

func (x *DeviceLogData) Reset()

func (*DeviceLogData) String added in v0.2.4

func (x *DeviceLogData) String() string

type DeviceLogOrder added in v0.2.2

type DeviceLogOrder int32
const (
	DeviceLogOrder_TIMESTAMP  DeviceLogOrder = 0
	DeviceLogOrder_CREATED_AT DeviceLogOrder = 1
)

func (DeviceLogOrder) Descriptor added in v0.2.2

func (DeviceLogOrder) Enum added in v0.2.2

func (x DeviceLogOrder) Enum() *DeviceLogOrder

func (DeviceLogOrder) EnumDescriptor deprecated added in v0.2.2

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

Deprecated: Use DeviceLogOrder.Descriptor instead.

func (DeviceLogOrder) Number added in v0.2.2

func (DeviceLogOrder) String added in v0.2.2

func (x DeviceLogOrder) String() string

func (DeviceLogOrder) Type added in v0.2.2

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type ListDeviceLogReq added in v0.2.2

type ListDeviceLogReq struct {
	DeviceId    uint64         `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"deviceId" form:"deviceId"`               // @gotags: form:"deviceId" json:"deviceId"
	Page        int64          `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty" form:"page"`                                // @gotags: form:"page"
	Size        int64          `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty" form:"size"`                                // @gotags: form:"size"
	Before      int64          `protobuf:"varint,4,opt,name=before,proto3" json:"before,omitempty" form:"before"`                          // @gotags: form:"before"
	After       int64          `protobuf:"varint,5,opt,name=after,proto3" json:"after,omitempty" form:"after"`                             // @gotags: form:"after"
	LevelFilter string         `protobuf:"bytes,6,opt,name=level_filter,json=levelFilter,proto3" json:"levelFilter" form:"levelFilter"`    // @gotags: form:"levelFilter" json:"levelFilter"
	Order       DeviceLogOrder `protobuf:"varint,7,opt,name=order,proto3,enum=api.log.DeviceLogOrder" json:"order,omitempty" form:"order"` // @gotags: form:"order"
	Sort        Sort           `protobuf:"varint,8,opt,name=sort,proto3,enum=api.log.Sort" json:"sort,omitempty" form:"sort"`              // @gotags: form:"sort"
	// contains filtered or unexported fields
}

func (*ListDeviceLogReq) Descriptor deprecated added in v0.2.2

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

Deprecated: Use ListDeviceLogReq.ProtoReflect.Descriptor instead.

func (*ListDeviceLogReq) GetAfter added in v0.2.2

func (x *ListDeviceLogReq) GetAfter() int64

func (*ListDeviceLogReq) GetBefore added in v0.2.2

func (x *ListDeviceLogReq) GetBefore() int64

func (*ListDeviceLogReq) GetDeviceId added in v0.2.2

func (x *ListDeviceLogReq) GetDeviceId() uint64

func (*ListDeviceLogReq) GetLevelFilter added in v0.2.2

func (x *ListDeviceLogReq) GetLevelFilter() string

func (*ListDeviceLogReq) GetOrder added in v0.2.2

func (x *ListDeviceLogReq) GetOrder() DeviceLogOrder

func (*ListDeviceLogReq) GetPage added in v0.2.2

func (x *ListDeviceLogReq) GetPage() int64

func (*ListDeviceLogReq) GetSize added in v0.2.2

func (x *ListDeviceLogReq) GetSize() int64

func (*ListDeviceLogReq) GetSort added in v0.2.2

func (x *ListDeviceLogReq) GetSort() Sort

func (*ListDeviceLogReq) ProtoMessage added in v0.2.2

func (*ListDeviceLogReq) ProtoMessage()

func (*ListDeviceLogReq) ProtoReflect added in v0.2.2

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

func (*ListDeviceLogReq) Reset added in v0.2.2

func (x *ListDeviceLogReq) Reset()

func (*ListDeviceLogReq) String added in v0.2.2

func (x *ListDeviceLogReq) String() string

type ListDeviceLogResp added in v0.2.2

type ListDeviceLogResp struct {
	Logs  []*DeviceLog `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
	Total int64        `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDeviceLogResp) Descriptor deprecated added in v0.2.2

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

Deprecated: Use ListDeviceLogResp.ProtoReflect.Descriptor instead.

func (*ListDeviceLogResp) GetLogs added in v0.2.2

func (x *ListDeviceLogResp) GetLogs() []*DeviceLog

func (*ListDeviceLogResp) GetTotal added in v0.2.2

func (x *ListDeviceLogResp) GetTotal() int64

func (*ListDeviceLogResp) ProtoMessage added in v0.2.2

func (*ListDeviceLogResp) ProtoMessage()

func (*ListDeviceLogResp) ProtoReflect added in v0.2.2

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

func (*ListDeviceLogResp) Reset added in v0.2.2

func (x *ListDeviceLogResp) Reset()

func (*ListDeviceLogResp) String added in v0.2.2

func (x *ListDeviceLogResp) String() string

type LogClient

type LogClient interface {
	CreateDeviceLog(ctx context.Context, in *DeviceLog, opts ...grpc.CallOption) (*Empty, error)
	ListDeviceLog(ctx context.Context, in *ListDeviceLogReq, opts ...grpc.CallOption) (*ListDeviceLogResp, error)
}

LogClient is the client API for Log 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 NewLogClient

func NewLogClient(cc grpc.ClientConnInterface) LogClient

type LogHTTPClient

type LogHTTPClient interface {
	CreateDeviceLog(ctx context.Context, req *DeviceLog, opts ...http.CallOption) (rsp *Empty, err error)
	ListDeviceLog(ctx context.Context, req *ListDeviceLogReq, opts ...http.CallOption) (rsp *ListDeviceLogResp, err error)
}

func NewLogHTTPClient

func NewLogHTTPClient(client *http.Client) LogHTTPClient

type LogHTTPClientImpl

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

func (*LogHTTPClientImpl) CreateDeviceLog added in v0.2.2

func (c *LogHTTPClientImpl) CreateDeviceLog(ctx context.Context, in *DeviceLog, opts ...http.CallOption) (*Empty, error)

func (*LogHTTPClientImpl) ListDeviceLog added in v0.2.2

func (c *LogHTTPClientImpl) ListDeviceLog(ctx context.Context, in *ListDeviceLogReq, opts ...http.CallOption) (*ListDeviceLogResp, error)

type LogHTTPServer

type LogHTTPServer interface {
	CreateDeviceLog(context.Context, *DeviceLog) (*Empty, error)
	ListDeviceLog(context.Context, *ListDeviceLogReq) (*ListDeviceLogResp, error)
}

type LogServer

type LogServer interface {
	CreateDeviceLog(context.Context, *DeviceLog) (*Empty, error)
	ListDeviceLog(context.Context, *ListDeviceLogReq) (*ListDeviceLogResp, error)
	// contains filtered or unexported methods
}

LogServer is the server API for Log service. All implementations must embed UnimplementedLogServer for forward compatibility.

type Sort added in v0.2.2

type Sort int32
const (
	Sort_DESC Sort = 0
	Sort_ASC  Sort = 1
)

func (Sort) Descriptor added in v0.2.2

func (Sort) Descriptor() protoreflect.EnumDescriptor

func (Sort) Enum added in v0.2.2

func (x Sort) Enum() *Sort

func (Sort) EnumDescriptor deprecated added in v0.2.2

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

Deprecated: Use Sort.Descriptor instead.

func (Sort) Number added in v0.2.2

func (x Sort) Number() protoreflect.EnumNumber

func (Sort) String added in v0.2.2

func (x Sort) String() string

func (Sort) Type added in v0.2.2

func (Sort) Type() protoreflect.EnumType

type UnimplementedLogServer

type UnimplementedLogServer struct{}

UnimplementedLogServer 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 (UnimplementedLogServer) CreateDeviceLog added in v0.2.2

func (UnimplementedLogServer) CreateDeviceLog(context.Context, *DeviceLog) (*Empty, error)

func (UnimplementedLogServer) ListDeviceLog added in v0.2.2

type UnsafeLogServer

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

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

Jump to

Keyboard shortcuts

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