Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDeviceHTTPServer(s *http.Server, srv DeviceHTTPServer)
- func RegisterDeviceServer(s grpc.ServiceRegistrar, srv DeviceServer)
- type CreateDeviceReq
- type DeviceClient
- type DeviceHTTPClient
- type DeviceHTTPClientImpl
- func (c *DeviceHTTPClientImpl) CreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...http.CallOption) (*DeviceRecord, error)
- func (c *DeviceHTTPClientImpl) GetDevice(ctx context.Context, in *GetDeviceReq, opts ...http.CallOption) (*DeviceRecord, error)
- func (c *DeviceHTTPClientImpl) GetDeviceByMac(ctx context.Context, in *GetDeviceByMacReq, opts ...http.CallOption) (*DeviceRecord, error)
- func (c *DeviceHTTPClientImpl) GetOrCreateDevice(ctx context.Context, in *GetOrCreateDeviceReq, opts ...http.CallOption) (*DeviceRecord, error)
- type DeviceHTTPServer
- type DeviceRecord
- func (*DeviceRecord) Descriptor() ([]byte, []int)deprecated
- func (x *DeviceRecord) GetComment() string
- func (x *DeviceRecord) GetCreatedAt() int64
- func (x *DeviceRecord) GetId() uint64
- func (x *DeviceRecord) GetMac() string
- func (x *DeviceRecord) GetUpdatedAt() int64
- func (*DeviceRecord) ProtoMessage()
- func (x *DeviceRecord) ProtoReflect() protoreflect.Message
- func (x *DeviceRecord) Reset()
- func (x *DeviceRecord) String() string
- type DeviceServer
- type GetDeviceByMacReq
- type GetDeviceReq
- type GetOrCreateDeviceReq
- func (*GetOrCreateDeviceReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetOrCreateDeviceReq) GetMac() string
- func (*GetOrCreateDeviceReq) ProtoMessage()
- func (x *GetOrCreateDeviceReq) ProtoReflect() protoreflect.Message
- func (x *GetOrCreateDeviceReq) Reset()
- func (x *GetOrCreateDeviceReq) String() string
- type UnimplementedDeviceServer
- func (UnimplementedDeviceServer) CreateDevice(context.Context, *CreateDeviceReq) (*DeviceRecord, error)
- func (UnimplementedDeviceServer) GetDevice(context.Context, *GetDeviceReq) (*DeviceRecord, error)
- func (UnimplementedDeviceServer) GetDeviceByMac(context.Context, *GetDeviceByMacReq) (*DeviceRecord, error)
- func (UnimplementedDeviceServer) GetOrCreateDevice(context.Context, *GetOrCreateDeviceReq) (*DeviceRecord, error)
- type UnsafeDeviceServer
Constants ¶
const ( Device_GetDevice_FullMethodName = "/api.device.Device/GetDevice" Device_GetDeviceByMac_FullMethodName = "/api.device.Device/GetDeviceByMac" Device_CreateDevice_FullMethodName = "/api.device.Device/CreateDevice" Device_GetOrCreateDevice_FullMethodName = "/api.device.Device/GetOrCreateDevice" )
const OperationDeviceCreateDevice = "/api.device.Device/CreateDevice"
const OperationDeviceGetDevice = "/api.device.Device/GetDevice"
const OperationDeviceGetDeviceByMac = "/api.device.Device/GetDeviceByMac"
const OperationDeviceGetOrCreateDevice = "/api.device.Device/GetOrCreateDevice"
Variables ¶
var Device_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.device.Device", HandlerType: (*DeviceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetDevice", Handler: _Device_GetDevice_Handler, }, { MethodName: "GetDeviceByMac", Handler: _Device_GetDeviceByMac_Handler, }, { MethodName: "CreateDevice", Handler: _Device_CreateDevice_Handler, }, { MethodName: "GetOrCreateDevice", Handler: _Device_GetOrCreateDevice_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "device/device.proto", }
Device_ServiceDesc is the grpc.ServiceDesc for Device service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_device_device_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDeviceHTTPServer ¶
func RegisterDeviceHTTPServer(s *http.Server, srv DeviceHTTPServer)
func RegisterDeviceServer ¶
func RegisterDeviceServer(s grpc.ServiceRegistrar, srv DeviceServer)
Types ¶
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 DeviceClient ¶
type DeviceClient interface {
GetDevice(ctx context.Context, in *GetDeviceReq, opts ...grpc.CallOption) (*DeviceRecord, error)
GetDeviceByMac(ctx context.Context, in *GetDeviceByMacReq, opts ...grpc.CallOption) (*DeviceRecord, error)
CreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...grpc.CallOption) (*DeviceRecord, error)
GetOrCreateDevice(ctx context.Context, in *GetOrCreateDeviceReq, opts ...grpc.CallOption) (*DeviceRecord, error)
}
DeviceClient is the client API for Device 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 NewDeviceClient ¶
func NewDeviceClient(cc grpc.ClientConnInterface) DeviceClient
type DeviceHTTPClient ¶
type DeviceHTTPClient interface {
CreateDevice(ctx context.Context, req *CreateDeviceReq, opts ...http.CallOption) (rsp *DeviceRecord, err error)
GetDevice(ctx context.Context, req *GetDeviceReq, opts ...http.CallOption) (rsp *DeviceRecord, err error)
GetDeviceByMac(ctx context.Context, req *GetDeviceByMacReq, opts ...http.CallOption) (rsp *DeviceRecord, err error)
GetOrCreateDevice(ctx context.Context, req *GetOrCreateDeviceReq, opts ...http.CallOption) (rsp *DeviceRecord, err error)
}
func NewDeviceHTTPClient ¶
func NewDeviceHTTPClient(client *http.Client) DeviceHTTPClient
type DeviceHTTPClientImpl ¶
type DeviceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*DeviceHTTPClientImpl) CreateDevice ¶
func (c *DeviceHTTPClientImpl) CreateDevice(ctx context.Context, in *CreateDeviceReq, opts ...http.CallOption) (*DeviceRecord, error)
func (*DeviceHTTPClientImpl) GetDevice ¶
func (c *DeviceHTTPClientImpl) GetDevice(ctx context.Context, in *GetDeviceReq, opts ...http.CallOption) (*DeviceRecord, error)
func (*DeviceHTTPClientImpl) GetDeviceByMac ¶
func (c *DeviceHTTPClientImpl) GetDeviceByMac(ctx context.Context, in *GetDeviceByMacReq, opts ...http.CallOption) (*DeviceRecord, error)
func (*DeviceHTTPClientImpl) GetOrCreateDevice ¶
func (c *DeviceHTTPClientImpl) GetOrCreateDevice(ctx context.Context, in *GetOrCreateDeviceReq, opts ...http.CallOption) (*DeviceRecord, error)
type DeviceHTTPServer ¶
type DeviceHTTPServer interface {
CreateDevice(context.Context, *CreateDeviceReq) (*DeviceRecord, error)
GetDevice(context.Context, *GetDeviceReq) (*DeviceRecord, error)
GetDeviceByMac(context.Context, *GetDeviceByMacReq) (*DeviceRecord, error)
GetOrCreateDevice(context.Context, *GetOrCreateDeviceReq) (*DeviceRecord, error)
}
type DeviceRecord ¶
type DeviceRecord struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt int64 `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"`
Comment string `protobuf:"bytes,5,opt,name=comment,proto3" json:"comment,omitempty"`
// contains filtered or unexported fields
}
func (*DeviceRecord) Descriptor
deprecated
func (*DeviceRecord) Descriptor() ([]byte, []int)
Deprecated: Use DeviceRecord.ProtoReflect.Descriptor instead.
func (*DeviceRecord) GetComment ¶
func (x *DeviceRecord) GetComment() string
func (*DeviceRecord) GetCreatedAt ¶
func (x *DeviceRecord) GetCreatedAt() int64
func (*DeviceRecord) GetId ¶
func (x *DeviceRecord) GetId() uint64
func (*DeviceRecord) GetMac ¶
func (x *DeviceRecord) GetMac() string
func (*DeviceRecord) GetUpdatedAt ¶
func (x *DeviceRecord) GetUpdatedAt() int64
func (*DeviceRecord) ProtoMessage ¶
func (*DeviceRecord) ProtoMessage()
func (*DeviceRecord) ProtoReflect ¶
func (x *DeviceRecord) ProtoReflect() protoreflect.Message
func (*DeviceRecord) Reset ¶
func (x *DeviceRecord) Reset()
func (*DeviceRecord) String ¶
func (x *DeviceRecord) String() string
type DeviceServer ¶
type DeviceServer interface {
GetDevice(context.Context, *GetDeviceReq) (*DeviceRecord, error)
GetDeviceByMac(context.Context, *GetDeviceByMacReq) (*DeviceRecord, error)
CreateDevice(context.Context, *CreateDeviceReq) (*DeviceRecord, error)
GetOrCreateDevice(context.Context, *GetOrCreateDeviceReq) (*DeviceRecord, error)
// contains filtered or unexported methods
}
DeviceServer is the server API for Device service. All implementations must embed UnimplementedDeviceServer for forward compatibility
type GetDeviceByMacReq ¶
type GetDeviceByMacReq struct {
Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"`
// contains filtered or unexported fields
}
func (*GetDeviceByMacReq) Descriptor
deprecated
func (*GetDeviceByMacReq) Descriptor() ([]byte, []int)
Deprecated: Use GetDeviceByMacReq.ProtoReflect.Descriptor instead.
func (*GetDeviceByMacReq) GetMac ¶
func (x *GetDeviceByMacReq) GetMac() string
func (*GetDeviceByMacReq) ProtoMessage ¶
func (*GetDeviceByMacReq) ProtoMessage()
func (*GetDeviceByMacReq) ProtoReflect ¶
func (x *GetDeviceByMacReq) ProtoReflect() protoreflect.Message
func (*GetDeviceByMacReq) Reset ¶
func (x *GetDeviceByMacReq) Reset()
func (*GetDeviceByMacReq) String ¶
func (x *GetDeviceByMacReq) String() string
type GetDeviceReq ¶
type GetDeviceReq struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*GetDeviceReq) Descriptor
deprecated
func (*GetDeviceReq) Descriptor() ([]byte, []int)
Deprecated: Use GetDeviceReq.ProtoReflect.Descriptor instead.
func (*GetDeviceReq) GetId ¶
func (x *GetDeviceReq) GetId() 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 GetOrCreateDeviceReq ¶
type GetOrCreateDeviceReq struct {
Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"`
// contains filtered or unexported fields
}
func (*GetOrCreateDeviceReq) Descriptor
deprecated
func (*GetOrCreateDeviceReq) Descriptor() ([]byte, []int)
Deprecated: Use GetOrCreateDeviceReq.ProtoReflect.Descriptor instead.
func (*GetOrCreateDeviceReq) GetMac ¶
func (x *GetOrCreateDeviceReq) GetMac() string
func (*GetOrCreateDeviceReq) ProtoMessage ¶
func (*GetOrCreateDeviceReq) ProtoMessage()
func (*GetOrCreateDeviceReq) ProtoReflect ¶
func (x *GetOrCreateDeviceReq) ProtoReflect() protoreflect.Message
func (*GetOrCreateDeviceReq) Reset ¶
func (x *GetOrCreateDeviceReq) Reset()
func (*GetOrCreateDeviceReq) String ¶
func (x *GetOrCreateDeviceReq) String() string
type UnimplementedDeviceServer ¶
type UnimplementedDeviceServer struct {
}
UnimplementedDeviceServer must be embedded to have forward compatible implementations.
func (UnimplementedDeviceServer) CreateDevice ¶
func (UnimplementedDeviceServer) CreateDevice(context.Context, *CreateDeviceReq) (*DeviceRecord, error)
func (UnimplementedDeviceServer) GetDevice ¶
func (UnimplementedDeviceServer) GetDevice(context.Context, *GetDeviceReq) (*DeviceRecord, error)
func (UnimplementedDeviceServer) GetDeviceByMac ¶
func (UnimplementedDeviceServer) GetDeviceByMac(context.Context, *GetDeviceByMacReq) (*DeviceRecord, error)
func (UnimplementedDeviceServer) GetOrCreateDevice ¶
func (UnimplementedDeviceServer) GetOrCreateDevice(context.Context, *GetOrCreateDeviceReq) (*DeviceRecord, error)
type UnsafeDeviceServer ¶
type UnsafeDeviceServer interface {
// contains filtered or unexported methods
}
UnsafeDeviceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DeviceServer will result in compilation errors.