device

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeviceSrv_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dtalk.device.DeviceSrv",
	HandlerType: (*DeviceSrvServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddDevice",
			Handler:    _DeviceSrv_AddDevice_Handler,
		},
		{
			MethodName: "EnableThreadPushDevice",
			Handler:    _DeviceSrv_EnableThreadPushDevice_Handler,
		},
		{
			MethodName: "GetUserAllDevices",
			Handler:    _DeviceSrv_GetUserAllDevices_Handler,
		},
		{
			MethodName: "GetDeviceByConnId",
			Handler:    _DeviceSrv_GetDeviceByConnId_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api.proto",
}

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

Functions

func RegisterDeviceSrvServer

func RegisterDeviceSrvServer(s grpc.ServiceRegistrar, srv DeviceSrvServer)

Types

type Client

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

func New

func New(etcdAddr, schema, srvName string, dial time.Duration) *Client

func (*Client) AddDevice

func (c *Client) AddDevice(ctx context.Context, in *Device) error

func (*Client) EnableThreadPushDevice

func (c *Client) EnableThreadPushDevice(ctx context.Context, in *EnableThreadPushDeviceRequest) error

func (*Client) GetDeviceByConnID added in v0.1.0

func (c *Client) GetDeviceByConnID(ctx context.Context, in *GetDeviceByConnIdRequest) (*Device, error)

func (*Client) GetUserAllDevices

func (c *Client) GetUserAllDevices(ctx context.Context, in *GetUserAllDevicesRequest) (*GetUserAllDevicesReply, error)

type Device

type Device struct {
	Uid         string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	ConnectId   string `protobuf:"bytes,2,opt,name=connectId,proto3" json:"connectId,omitempty"`
	DeviceUUid  string `protobuf:"bytes,3,opt,name=deviceUUid,proto3" json:"deviceUUid,omitempty"`
	DeviceType  int32  `protobuf:"varint,4,opt,name=deviceType,proto3" json:"deviceType,omitempty"`
	DeviceName  string `protobuf:"bytes,5,opt,name=deviceName,proto3" json:"deviceName,omitempty"`
	Username    string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"`
	DeviceToken string `protobuf:"bytes,7,opt,name=deviceToken,proto3" json:"deviceToken,omitempty"`
	IsEnabled   bool   `protobuf:"varint,8,opt,name=isEnabled,proto3" json:"isEnabled,omitempty"`
	AddTime     uint64 `protobuf:"varint,9,opt,name=addTime,proto3" json:"addTime,omitempty"`
	DTUid       string `protobuf:"bytes,10,opt,name=DTUid,proto3" json:"DTUid,omitempty"`
	// contains filtered or unexported fields
}

func (*Device) Descriptor deprecated

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

Deprecated: Use Device.ProtoReflect.Descriptor instead.

func (*Device) GetAddTime

func (x *Device) GetAddTime() uint64

func (*Device) GetConnectId

func (x *Device) GetConnectId() string

func (*Device) GetDTUid

func (x *Device) GetDTUid() string

func (*Device) GetDeviceName

func (x *Device) GetDeviceName() string

func (*Device) GetDeviceToken

func (x *Device) GetDeviceToken() string

func (*Device) GetDeviceType

func (x *Device) GetDeviceType() int32

func (*Device) GetDeviceUUid

func (x *Device) GetDeviceUUid() string

func (*Device) GetIsEnabled

func (x *Device) GetIsEnabled() bool

func (*Device) GetUid

func (x *Device) GetUid() string

func (*Device) GetUsername

func (x *Device) GetUsername() string

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 DeviceSrvClient

type DeviceSrvClient interface {
	AddDevice(ctx context.Context, in *Device, opts ...grpc.CallOption) (*Empty, error)
	EnableThreadPushDevice(ctx context.Context, in *EnableThreadPushDeviceRequest, opts ...grpc.CallOption) (*Empty, error)
	GetUserAllDevices(ctx context.Context, in *GetUserAllDevicesRequest, opts ...grpc.CallOption) (*GetUserAllDevicesReply, error)
	GetDeviceByConnId(ctx context.Context, in *GetDeviceByConnIdRequest, opts ...grpc.CallOption) (*Device, error)
}

DeviceSrvClient is the client API for DeviceSrv 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 NewDeviceSrvClient

func NewDeviceSrvClient(cc grpc.ClientConnInterface) DeviceSrvClient

type DeviceSrvServer

type DeviceSrvServer interface {
	AddDevice(context.Context, *Device) (*Empty, error)
	EnableThreadPushDevice(context.Context, *EnableThreadPushDeviceRequest) (*Empty, error)
	GetUserAllDevices(context.Context, *GetUserAllDevicesRequest) (*GetUserAllDevicesReply, error)
	GetDeviceByConnId(context.Context, *GetDeviceByConnIdRequest) (*Device, error)
	// contains filtered or unexported methods
}

DeviceSrvServer is the server API for DeviceSrv service. All implementations must embed UnimplementedDeviceSrvServer for forward compatibility

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 EnableThreadPushDeviceRequest

type EnableThreadPushDeviceRequest struct {
	Uid    string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	ConnId string `protobuf:"bytes,2,opt,name=connId,proto3" json:"connId,omitempty"`
	// contains filtered or unexported fields
}

func (*EnableThreadPushDeviceRequest) Descriptor deprecated

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

Deprecated: Use EnableThreadPushDeviceRequest.ProtoReflect.Descriptor instead.

func (*EnableThreadPushDeviceRequest) GetConnId

func (x *EnableThreadPushDeviceRequest) GetConnId() string

func (*EnableThreadPushDeviceRequest) GetUid

func (*EnableThreadPushDeviceRequest) ProtoMessage

func (*EnableThreadPushDeviceRequest) ProtoMessage()

func (*EnableThreadPushDeviceRequest) ProtoReflect

func (*EnableThreadPushDeviceRequest) Reset

func (x *EnableThreadPushDeviceRequest) Reset()

func (*EnableThreadPushDeviceRequest) String

type GetDeviceByConnIdReply added in v0.1.0

type GetDeviceByConnIdReply struct {
	Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDeviceByConnIdReply) Descriptor deprecated added in v0.1.0

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

Deprecated: Use GetDeviceByConnIdReply.ProtoReflect.Descriptor instead.

func (*GetDeviceByConnIdReply) GetDevice added in v0.1.0

func (x *GetDeviceByConnIdReply) GetDevice() *Device

func (*GetDeviceByConnIdReply) ProtoMessage added in v0.1.0

func (*GetDeviceByConnIdReply) ProtoMessage()

func (*GetDeviceByConnIdReply) ProtoReflect added in v0.1.0

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

func (*GetDeviceByConnIdReply) Reset added in v0.1.0

func (x *GetDeviceByConnIdReply) Reset()

func (*GetDeviceByConnIdReply) String added in v0.1.0

func (x *GetDeviceByConnIdReply) String() string

type GetDeviceByConnIdRequest added in v0.1.0

type GetDeviceByConnIdRequest struct {
	Uid    string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	ConnID string `protobuf:"bytes,2,opt,name=connID,proto3" json:"connID,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDeviceByConnIdRequest) Descriptor deprecated added in v0.1.0

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

Deprecated: Use GetDeviceByConnIdRequest.ProtoReflect.Descriptor instead.

func (*GetDeviceByConnIdRequest) GetConnID added in v0.1.0

func (x *GetDeviceByConnIdRequest) GetConnID() string

func (*GetDeviceByConnIdRequest) GetUid added in v0.1.0

func (x *GetDeviceByConnIdRequest) GetUid() string

func (*GetDeviceByConnIdRequest) ProtoMessage added in v0.1.0

func (*GetDeviceByConnIdRequest) ProtoMessage()

func (*GetDeviceByConnIdRequest) ProtoReflect added in v0.1.0

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

func (*GetDeviceByConnIdRequest) Reset added in v0.1.0

func (x *GetDeviceByConnIdRequest) Reset()

func (*GetDeviceByConnIdRequest) String added in v0.1.0

func (x *GetDeviceByConnIdRequest) String() string

type GetUserAllDevicesReply

type GetUserAllDevicesReply struct {
	Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserAllDevicesReply) Descriptor deprecated

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

Deprecated: Use GetUserAllDevicesReply.ProtoReflect.Descriptor instead.

func (*GetUserAllDevicesReply) GetDevices

func (x *GetUserAllDevicesReply) GetDevices() []*Device

func (*GetUserAllDevicesReply) ProtoMessage

func (*GetUserAllDevicesReply) ProtoMessage()

func (*GetUserAllDevicesReply) ProtoReflect

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

func (*GetUserAllDevicesReply) Reset

func (x *GetUserAllDevicesReply) Reset()

func (*GetUserAllDevicesReply) String

func (x *GetUserAllDevicesReply) String() string

type GetUserAllDevicesRequest

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

func (*GetUserAllDevicesRequest) Descriptor deprecated

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

Deprecated: Use GetUserAllDevicesRequest.ProtoReflect.Descriptor instead.

func (*GetUserAllDevicesRequest) GetUid

func (x *GetUserAllDevicesRequest) GetUid() string

func (*GetUserAllDevicesRequest) ProtoMessage

func (*GetUserAllDevicesRequest) ProtoMessage()

func (*GetUserAllDevicesRequest) ProtoReflect

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

func (*GetUserAllDevicesRequest) Reset

func (x *GetUserAllDevicesRequest) Reset()

func (*GetUserAllDevicesRequest) String

func (x *GetUserAllDevicesRequest) String() string

type UnimplementedDeviceSrvServer

type UnimplementedDeviceSrvServer struct {
}

UnimplementedDeviceSrvServer must be embedded to have forward compatible implementations.

func (UnimplementedDeviceSrvServer) AddDevice

func (UnimplementedDeviceSrvServer) EnableThreadPushDevice

func (UnimplementedDeviceSrvServer) GetDeviceByConnId added in v0.1.0

func (UnimplementedDeviceSrvServer) GetUserAllDevices

type UnsafeDeviceSrvServer

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

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

Jump to

Keyboard shortcuts

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