database

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Database_CreateCollectionInfo_FullMethodName = "/api.database.Database/CreateCollectionInfo"
	Database_ListCollectionInfo_FullMethodName   = "/api.database.Database/ListCollectionInfo"
	Database_GetDevice_FullMethodName            = "/api.database.Database/GetDevice"
	Database_GetDeviceWithMac_FullMethodName     = "/api.database.Database/GetDeviceWithMac"
	Database_CreateDevice_FullMethodName         = "/api.database.Database/CreateDevice"
	Database_FirstOrCreateDevice_FullMethodName  = "/api.database.Database/FirstOrCreateDevice"
)
View Source
const OperationDatabaseCreateCollectionInfo = "/api.database.Database/CreateCollectionInfo"
View Source
const OperationDatabaseCreateDevice = "/api.database.Database/CreateDevice"
View Source
const OperationDatabaseFirstOrCreateDevice = "/api.database.Database/FirstOrCreateDevice"
View Source
const OperationDatabaseGetDevice = "/api.database.Database/GetDevice"
View Source
const OperationDatabaseGetDeviceWithMac = "/api.database.Database/GetDeviceWithMac"
View Source
const OperationDatabaseListCollectionInfo = "/api.database.Database/ListCollectionInfo"

Variables

View Source
var Database_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.database.Database",
	HandlerType: (*DatabaseServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateCollectionInfo",
			Handler:    _Database_CreateCollectionInfo_Handler,
		},
		{
			MethodName: "ListCollectionInfo",
			Handler:    _Database_ListCollectionInfo_Handler,
		},
		{
			MethodName: "GetDevice",
			Handler:    _Database_GetDevice_Handler,
		},
		{
			MethodName: "GetDeviceWithMac",
			Handler:    _Database_GetDeviceWithMac_Handler,
		},
		{
			MethodName: "CreateDevice",
			Handler:    _Database_CreateDevice_Handler,
		},
		{
			MethodName: "FirstOrCreateDevice",
			Handler:    _Database_FirstOrCreateDevice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "database/database.proto",
}

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

View Source
var File_database_database_proto protoreflect.FileDescriptor

Functions

func RegisterDatabaseHTTPServer

func RegisterDatabaseHTTPServer(s *http.Server, srv DatabaseHTTPServer)

func RegisterDatabaseServer

func RegisterDatabaseServer(s grpc.ServiceRegistrar, srv DatabaseServer)

Types

type CollectionInfo

type CollectionInfo struct {
	DeviceId  uint64    `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	Timestamp uint64    `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	GeoPoint  *GeoPoint `protobuf:"bytes,3,opt,name=geo_point,json=geoPoint,proto3" json:"geo_point,omitempty"`
	// contains filtered or unexported fields
}

func (*CollectionInfo) Descriptor deprecated

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

Deprecated: Use CollectionInfo.ProtoReflect.Descriptor instead.

func (*CollectionInfo) GetDeviceId

func (x *CollectionInfo) GetDeviceId() uint64

func (*CollectionInfo) GetGeoPoint

func (x *CollectionInfo) GetGeoPoint() *GeoPoint

func (*CollectionInfo) GetTimestamp

func (x *CollectionInfo) GetTimestamp() uint64

func (*CollectionInfo) ProtoMessage

func (*CollectionInfo) ProtoMessage()

func (*CollectionInfo) ProtoReflect

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

func (*CollectionInfo) Reset

func (x *CollectionInfo) Reset()

func (*CollectionInfo) String

func (x *CollectionInfo) String() string

type CreateDeviceReq

type CreateDeviceReq struct {
	Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateDeviceReq) Descriptor deprecated

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

Deprecated: Use CreateDeviceReq.ProtoReflect.Descriptor instead.

func (*CreateDeviceReq) GetMac

func (x *CreateDeviceReq) GetMac() string

func (*CreateDeviceReq) ProtoMessage

func (*CreateDeviceReq) ProtoMessage()

func (*CreateDeviceReq) ProtoReflect

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

func (*CreateDeviceReq) Reset

func (x *CreateDeviceReq) Reset()

func (*CreateDeviceReq) String

func (x *CreateDeviceReq) String() string

type DatabaseClient

type DatabaseClient interface {
	CreateCollectionInfo(ctx context.Context, in *CollectionInfo, opts ...grpc.CallOption) (*Empty, error)
	ListCollectionInfo(ctx context.Context, in *ListCollectionInfoReq, opts ...grpc.CallOption) (*ListCollectionInfoResp, error)
	GetDevice(ctx context.Context, in *GetDeviceReq, opts ...grpc.CallOption) (*Device, error)
	GetDeviceWithMac(ctx context.Context, in *GetDeviceWithMacReq, opts ...grpc.CallOption) (*Device, error)
	CreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...grpc.CallOption) (*Device, error)
	FirstOrCreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...grpc.CallOption) (*Device, error)
}

DatabaseClient is the client API for Database 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 NewDatabaseClient

func NewDatabaseClient(cc grpc.ClientConnInterface) DatabaseClient

type DatabaseHTTPClient

type DatabaseHTTPClient interface {
	CreateCollectionInfo(ctx context.Context, req *CollectionInfo, opts ...http.CallOption) (rsp *Empty, err error)
	CreateDevice(ctx context.Context, req *CreateDeviceReq, opts ...http.CallOption) (rsp *Device, err error)
	FirstOrCreateDevice(ctx context.Context, req *CreateDeviceReq, opts ...http.CallOption) (rsp *Device, err error)
	GetDevice(ctx context.Context, req *GetDeviceReq, opts ...http.CallOption) (rsp *Device, err error)
	GetDeviceWithMac(ctx context.Context, req *GetDeviceWithMacReq, opts ...http.CallOption) (rsp *Device, err error)
	ListCollectionInfo(ctx context.Context, req *ListCollectionInfoReq, opts ...http.CallOption) (rsp *ListCollectionInfoResp, err error)
}

func NewDatabaseHTTPClient

func NewDatabaseHTTPClient(client *http.Client) DatabaseHTTPClient

type DatabaseHTTPClientImpl

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

func (*DatabaseHTTPClientImpl) CreateCollectionInfo

func (c *DatabaseHTTPClientImpl) CreateCollectionInfo(ctx context.Context, in *CollectionInfo, opts ...http.CallOption) (*Empty, error)

func (*DatabaseHTTPClientImpl) CreateDevice

func (c *DatabaseHTTPClientImpl) CreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...http.CallOption) (*Device, error)

func (*DatabaseHTTPClientImpl) FirstOrCreateDevice

func (c *DatabaseHTTPClientImpl) FirstOrCreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...http.CallOption) (*Device, error)

func (*DatabaseHTTPClientImpl) GetDevice

func (c *DatabaseHTTPClientImpl) GetDevice(ctx context.Context, in *GetDeviceReq, opts ...http.CallOption) (*Device, error)

func (*DatabaseHTTPClientImpl) GetDeviceWithMac

func (c *DatabaseHTTPClientImpl) GetDeviceWithMac(ctx context.Context, in *GetDeviceWithMacReq, opts ...http.CallOption) (*Device, error)

func (*DatabaseHTTPClientImpl) ListCollectionInfo

type DatabaseHTTPServer

type DatabaseHTTPServer interface {
	CreateCollectionInfo(context.Context, *CollectionInfo) (*Empty, error)
	CreateDevice(context.Context, *CreateDeviceReq) (*Device, error)
	FirstOrCreateDevice(context.Context, *CreateDeviceReq) (*Device, error)
	GetDevice(context.Context, *GetDeviceReq) (*Device, error)
	GetDeviceWithMac(context.Context, *GetDeviceWithMacReq) (*Device, error)
	ListCollectionInfo(context.Context, *ListCollectionInfoReq) (*ListCollectionInfoResp, error)
}

type DatabaseServer

type DatabaseServer interface {
	CreateCollectionInfo(context.Context, *CollectionInfo) (*Empty, error)
	ListCollectionInfo(context.Context, *ListCollectionInfoReq) (*ListCollectionInfoResp, error)
	GetDevice(context.Context, *GetDeviceReq) (*Device, error)
	GetDeviceWithMac(context.Context, *GetDeviceWithMacReq) (*Device, error)
	CreateDevice(context.Context, *CreateDeviceReq) (*Device, error)
	FirstOrCreateDevice(context.Context, *CreateDeviceReq) (*Device, error)
	// contains filtered or unexported methods
}

DatabaseServer is the server API for Database service. All implementations must embed UnimplementedDatabaseServer for forward compatibility

type Device

type Device struct {
	DeviceId  uint64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	CreatedAt uint64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt uint64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	Mac       string `protobuf:"bytes,4,opt,name=mac,proto3" json:"mac,omitempty"`
	// contains filtered or unexported fields
}

func (*Device) Descriptor deprecated

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

Deprecated: Use Device.ProtoReflect.Descriptor instead.

func (*Device) GetCreatedAt

func (x *Device) GetCreatedAt() uint64

func (*Device) GetDeviceId

func (x *Device) GetDeviceId() uint64

func (*Device) GetMac

func (x *Device) GetMac() string

func (*Device) GetUpdatedAt

func (x *Device) GetUpdatedAt() uint64

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) ProtoReflect

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

func (*Device) Reset

func (x *Device) Reset()

func (*Device) String

func (x *Device) String() string

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 GeoPoint

type GeoPoint struct {
	Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"`
	Lng float64 `protobuf:"fixed64,2,opt,name=lng,proto3" json:"lng,omitempty"`
	// contains filtered or unexported fields
}

func (*GeoPoint) Descriptor deprecated

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

Deprecated: Use GeoPoint.ProtoReflect.Descriptor instead.

func (*GeoPoint) GetLat

func (x *GeoPoint) GetLat() float64

func (*GeoPoint) GetLng

func (x *GeoPoint) GetLng() float64

func (*GeoPoint) ProtoMessage

func (*GeoPoint) ProtoMessage()

func (*GeoPoint) ProtoReflect

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

func (*GeoPoint) Reset

func (x *GeoPoint) Reset()

func (*GeoPoint) String

func (x *GeoPoint) String() string

type GetDeviceReq

type GetDeviceReq struct {
	DeviceId uint64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDeviceReq) Descriptor deprecated

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

Deprecated: Use GetDeviceReq.ProtoReflect.Descriptor instead.

func (*GetDeviceReq) GetDeviceId

func (x *GetDeviceReq) GetDeviceId() uint64

func (*GetDeviceReq) ProtoMessage

func (*GetDeviceReq) ProtoMessage()

func (*GetDeviceReq) ProtoReflect

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

func (*GetDeviceReq) Reset

func (x *GetDeviceReq) Reset()

func (*GetDeviceReq) String

func (x *GetDeviceReq) String() string

type GetDeviceWithMacReq

type GetDeviceWithMacReq struct {
	Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDeviceWithMacReq) Descriptor deprecated

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

Deprecated: Use GetDeviceWithMacReq.ProtoReflect.Descriptor instead.

func (*GetDeviceWithMacReq) GetMac

func (x *GetDeviceWithMacReq) GetMac() string

func (*GetDeviceWithMacReq) ProtoMessage

func (*GetDeviceWithMacReq) ProtoMessage()

func (*GetDeviceWithMacReq) ProtoReflect

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

func (*GetDeviceWithMacReq) Reset

func (x *GetDeviceWithMacReq) Reset()

func (*GetDeviceWithMacReq) String

func (x *GetDeviceWithMacReq) String() string

type ListCollectionInfoReq

type ListCollectionInfoReq struct {
	Page           uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	PageSize       uint64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	DeviceId       uint64 `protobuf:"varint,3,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	StartTimestamp uint64 `protobuf:"varint,4,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"`
	EndTimestamp   uint64 `protobuf:"varint,5,opt,name=end_timestamp,json=endTimestamp,proto3" json:"end_timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCollectionInfoReq) Descriptor deprecated

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

Deprecated: Use ListCollectionInfoReq.ProtoReflect.Descriptor instead.

func (*ListCollectionInfoReq) GetDeviceId

func (x *ListCollectionInfoReq) GetDeviceId() uint64

func (*ListCollectionInfoReq) GetEndTimestamp

func (x *ListCollectionInfoReq) GetEndTimestamp() uint64

func (*ListCollectionInfoReq) GetPage

func (x *ListCollectionInfoReq) GetPage() uint64

func (*ListCollectionInfoReq) GetPageSize

func (x *ListCollectionInfoReq) GetPageSize() uint64

func (*ListCollectionInfoReq) GetStartTimestamp

func (x *ListCollectionInfoReq) GetStartTimestamp() uint64

func (*ListCollectionInfoReq) ProtoMessage

func (*ListCollectionInfoReq) ProtoMessage()

func (*ListCollectionInfoReq) ProtoReflect

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

func (*ListCollectionInfoReq) Reset

func (x *ListCollectionInfoReq) Reset()

func (*ListCollectionInfoReq) String

func (x *ListCollectionInfoReq) String() string

type ListCollectionInfoResp

type ListCollectionInfoResp struct {
	CollectionInfos []*ListCollectionInfoResp_CollectionInfo `protobuf:"bytes,1,rep,name=collection_infos,json=collectionInfos,proto3" json:"collection_infos,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCollectionInfoResp) Descriptor deprecated

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

Deprecated: Use ListCollectionInfoResp.ProtoReflect.Descriptor instead.

func (*ListCollectionInfoResp) GetCollectionInfos

func (*ListCollectionInfoResp) ProtoMessage

func (*ListCollectionInfoResp) ProtoMessage()

func (*ListCollectionInfoResp) ProtoReflect

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

func (*ListCollectionInfoResp) Reset

func (x *ListCollectionInfoResp) Reset()

func (*ListCollectionInfoResp) String

func (x *ListCollectionInfoResp) String() string

type ListCollectionInfoResp_CollectionInfo

type ListCollectionInfoResp_CollectionInfo struct {
	CreatedAt uint64    `protobuf:"varint,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	DeviceId  uint64    `protobuf:"varint,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	Timestamp uint64    `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	GeoPoint  *GeoPoint `protobuf:"bytes,4,opt,name=geo_point,json=geoPoint,proto3" json:"geo_point,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCollectionInfoResp_CollectionInfo) Descriptor deprecated

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

Deprecated: Use ListCollectionInfoResp_CollectionInfo.ProtoReflect.Descriptor instead.

func (*ListCollectionInfoResp_CollectionInfo) GetCreatedAt

func (*ListCollectionInfoResp_CollectionInfo) GetDeviceId

func (*ListCollectionInfoResp_CollectionInfo) GetGeoPoint

func (*ListCollectionInfoResp_CollectionInfo) GetTimestamp

func (*ListCollectionInfoResp_CollectionInfo) ProtoMessage

func (*ListCollectionInfoResp_CollectionInfo) ProtoMessage()

func (*ListCollectionInfoResp_CollectionInfo) ProtoReflect

func (*ListCollectionInfoResp_CollectionInfo) Reset

func (*ListCollectionInfoResp_CollectionInfo) String

type UnimplementedDatabaseServer

type UnimplementedDatabaseServer struct {
}

UnimplementedDatabaseServer must be embedded to have forward compatible implementations.

func (UnimplementedDatabaseServer) CreateCollectionInfo

func (UnimplementedDatabaseServer) CreateDevice

func (UnimplementedDatabaseServer) FirstOrCreateDevice

func (UnimplementedDatabaseServer) GetDevice

func (UnimplementedDatabaseServer) GetDeviceWithMac

func (UnimplementedDatabaseServer) ListCollectionInfo

type UnsafeDatabaseServer

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

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

Jump to

Keyboard shortcuts

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