device_model

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package device_model is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package device_model is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_device_model_model_group_proto protoreflect.FileDescriptor
View Source
var File_proto_device_model_model_proto protoreflect.FileDescriptor

Functions

func RegisterModelGroupHandler added in v1.1.1

func RegisterModelGroupHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterModelGroupHandler registers the http handlers for service ModelGroup to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterModelGroupHandlerClient added in v1.1.1

func RegisterModelGroupHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelGroupClient) error

RegisterModelGroupHandlerClient registers the http handlers for service ModelGroup to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ModelGroupClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ModelGroupClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ModelGroupClient" to call the correct interceptors.

func RegisterModelGroupHandlerFromEndpoint added in v1.1.1

func RegisterModelGroupHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterModelGroupHandlerFromEndpoint is same as RegisterModelGroupHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterModelGroupHandlerServer added in v1.1.1

func RegisterModelGroupHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelGroupServer) error

RegisterModelGroupHandlerServer registers the http handlers for service ModelGroup to "mux". UnaryRPC :call ModelGroupServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterModelGroupHandlerFromEndpoint instead.

func RegisterModelGroupServer added in v1.1.1

func RegisterModelGroupServer(s *grpc.Server, srv ModelGroupServer)

func RegisterModelModbusHandler added in v1.1.4

func RegisterModelModbusHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterModelModbusHandler registers the http handlers for service ModelModbus to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterModelModbusHandlerClient added in v1.1.4

func RegisterModelModbusHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelModbusClient) error

RegisterModelModbusHandlerClient registers the http handlers for service ModelModbus to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ModelModbusClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ModelModbusClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ModelModbusClient" to call the correct interceptors.

func RegisterModelModbusHandlerFromEndpoint added in v1.1.4

func RegisterModelModbusHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterModelModbusHandlerFromEndpoint is same as RegisterModelModbusHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterModelModbusHandlerServer added in v1.1.4

func RegisterModelModbusHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelModbusServer) error

RegisterModelModbusHandlerServer registers the http handlers for service ModelModbus to "mux". UnaryRPC :call ModelModbusServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterModelModbusHandlerFromEndpoint instead.

func RegisterModelModbusServer added in v1.1.4

func RegisterModelModbusServer(s *grpc.Server, srv ModelModbusServer)

Types

type AddGroupRequest

type AddGroupRequest struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"`
	// contains filtered or unexported fields
}

func (*AddGroupRequest) Descriptor deprecated

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

Deprecated: Use AddGroupRequest.ProtoReflect.Descriptor instead.

func (*AddGroupRequest) GetDetail added in v1.2.0

func (x *AddGroupRequest) GetDetail() string

func (*AddGroupRequest) GetName

func (x *AddGroupRequest) GetName() string

func (*AddGroupRequest) ProtoMessage

func (*AddGroupRequest) ProtoMessage()

func (*AddGroupRequest) ProtoReflect

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

func (*AddGroupRequest) Reset

func (x *AddGroupRequest) Reset()

func (*AddGroupRequest) String

func (x *AddGroupRequest) String() string

type AddModelRequest

type AddModelRequest struct {
	Name            string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                                 //设备名称
	GroupId         string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`                            //组号
	LinkType        uint32 `protobuf:"varint,3,opt,name=link_type,json=linkType,proto3" json:"link_type,omitempty"`                        //通讯类型,1为modbus485
	IsNegativeValue bool   `protobuf:"varint,4,opt,name=is_negative_value,json=isNegativeValue,proto3" json:"is_negative_value,omitempty"` //是否有负值
	Unit            string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"`                                                 //单位
	Detail          string `protobuf:"bytes,6,opt,name=detail,proto3" json:"detail,omitempty"`                                             //描述
	// contains filtered or unexported fields
}

func (*AddModelRequest) Descriptor deprecated

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

Deprecated: Use AddModelRequest.ProtoReflect.Descriptor instead.

func (*AddModelRequest) GetDetail added in v1.2.0

func (x *AddModelRequest) GetDetail() string

func (*AddModelRequest) GetGroupId

func (x *AddModelRequest) GetGroupId() string

func (*AddModelRequest) GetIsNegativeValue added in v1.1.10

func (x *AddModelRequest) GetIsNegativeValue() bool

func (*AddModelRequest) GetLinkType

func (x *AddModelRequest) GetLinkType() uint32

func (*AddModelRequest) GetName

func (x *AddModelRequest) GetName() string

func (*AddModelRequest) GetUnit added in v1.1.10

func (x *AddModelRequest) GetUnit() string

func (*AddModelRequest) ProtoMessage

func (*AddModelRequest) ProtoMessage()

func (*AddModelRequest) ProtoReflect

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

func (*AddModelRequest) Reset

func (x *AddModelRequest) Reset()

func (*AddModelRequest) String

func (x *AddModelRequest) String() string

type AddModelResponse

type AddModelResponse struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //设备名称
	Id   string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`     //设备模型唯一码
	// contains filtered or unexported fields
}

func (*AddModelResponse) Descriptor deprecated

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

Deprecated: Use AddModelResponse.ProtoReflect.Descriptor instead.

func (*AddModelResponse) GetId added in v1.1.7

func (x *AddModelResponse) GetId() string

func (*AddModelResponse) GetName added in v1.1.4

func (x *AddModelResponse) GetName() string

func (*AddModelResponse) ProtoMessage

func (*AddModelResponse) ProtoMessage()

func (*AddModelResponse) ProtoReflect

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

func (*AddModelResponse) Reset

func (x *AddModelResponse) Reset()

func (*AddModelResponse) String

func (x *AddModelResponse) String() string

type DeleteGroupRequest

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

func (*DeleteGroupRequest) Descriptor deprecated

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

Deprecated: Use DeleteGroupRequest.ProtoReflect.Descriptor instead.

func (*DeleteGroupRequest) GetId

func (x *DeleteGroupRequest) GetId() string

func (*DeleteGroupRequest) ProtoMessage

func (*DeleteGroupRequest) ProtoMessage()

func (*DeleteGroupRequest) ProtoReflect

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

func (*DeleteGroupRequest) Reset

func (x *DeleteGroupRequest) Reset()

func (*DeleteGroupRequest) String

func (x *DeleteGroupRequest) String() string

type DeleteGroupResponse

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

func (*DeleteGroupResponse) Descriptor deprecated

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

Deprecated: Use DeleteGroupResponse.ProtoReflect.Descriptor instead.

func (*DeleteGroupResponse) ProtoMessage

func (*DeleteGroupResponse) ProtoMessage()

func (*DeleteGroupResponse) ProtoReflect

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

func (*DeleteGroupResponse) Reset

func (x *DeleteGroupResponse) Reset()

func (*DeleteGroupResponse) String

func (x *DeleteGroupResponse) String() string

type DeleteModelRequest

type DeleteModelRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //设备模型唯一码
	// contains filtered or unexported fields
}

删除硬件模型

func (*DeleteModelRequest) Descriptor deprecated

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

Deprecated: Use DeleteModelRequest.ProtoReflect.Descriptor instead.

func (*DeleteModelRequest) GetId added in v1.1.7

func (x *DeleteModelRequest) GetId() string

func (*DeleteModelRequest) ProtoMessage

func (*DeleteModelRequest) ProtoMessage()

func (*DeleteModelRequest) ProtoReflect

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

func (*DeleteModelRequest) Reset

func (x *DeleteModelRequest) Reset()

func (*DeleteModelRequest) String

func (x *DeleteModelRequest) String() string

type DeleteModelResponse

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

func (*DeleteModelResponse) Descriptor deprecated

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

Deprecated: Use DeleteModelResponse.ProtoReflect.Descriptor instead.

func (*DeleteModelResponse) ProtoMessage

func (*DeleteModelResponse) ProtoMessage()

func (*DeleteModelResponse) ProtoReflect

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

func (*DeleteModelResponse) Reset

func (x *DeleteModelResponse) Reset()

func (*DeleteModelResponse) String

func (x *DeleteModelResponse) String() string

type Group

type Group struct {
	Id         string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name       string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Detail     string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
	CreateTime string `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Group) Descriptor deprecated

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

Deprecated: Use Group.ProtoReflect.Descriptor instead.

func (*Group) GetCreateTime added in v1.2.0

func (x *Group) GetCreateTime() string

func (*Group) GetDetail added in v1.2.0

func (x *Group) GetDetail() string

func (*Group) GetId

func (x *Group) GetId() string

func (*Group) GetName

func (x *Group) GetName() string

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) ProtoReflect

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

func (*Group) Reset

func (x *Group) Reset()

func (*Group) String

func (x *Group) String() string

type ListGroupRequest

type ListGroupRequest struct {
	PageNum  uint32 `protobuf:"varint,1,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty"`
	PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

当不传page_num和page_size或等于0相当查询全部

func (*ListGroupRequest) Descriptor deprecated

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

Deprecated: Use ListGroupRequest.ProtoReflect.Descriptor instead.

func (*ListGroupRequest) GetPageNum added in v1.1.10

func (x *ListGroupRequest) GetPageNum() uint32

func (*ListGroupRequest) GetPageSize added in v1.1.10

func (x *ListGroupRequest) GetPageSize() uint32

func (*ListGroupRequest) ProtoMessage

func (*ListGroupRequest) ProtoMessage()

func (*ListGroupRequest) ProtoReflect

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

func (*ListGroupRequest) Reset

func (x *ListGroupRequest) Reset()

func (*ListGroupRequest) String

func (x *ListGroupRequest) String() string

type ListGroupResponse

type ListGroupResponse struct {
	Total uint32   `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Group []*Group `protobuf:"bytes,2,rep,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*ListGroupResponse) Descriptor deprecated

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

Deprecated: Use ListGroupResponse.ProtoReflect.Descriptor instead.

func (*ListGroupResponse) GetGroup

func (x *ListGroupResponse) GetGroup() []*Group

func (*ListGroupResponse) GetTotal added in v1.2.0

func (x *ListGroupResponse) GetTotal() uint32

func (*ListGroupResponse) ProtoMessage

func (*ListGroupResponse) ProtoMessage()

func (*ListGroupResponse) ProtoReflect

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

func (*ListGroupResponse) Reset

func (x *ListGroupResponse) Reset()

func (*ListGroupResponse) String

func (x *ListGroupResponse) String() string

type ListModelRequest

type ListModelRequest struct {
	PageNum  uint32 `protobuf:"varint,1,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty"`
	PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

当不传page_num和page_size或等于0相当查询全部

func (*ListModelRequest) Descriptor deprecated

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

Deprecated: Use ListModelRequest.ProtoReflect.Descriptor instead.

func (*ListModelRequest) GetPageNum added in v1.1.10

func (x *ListModelRequest) GetPageNum() uint32

func (*ListModelRequest) GetPageSize added in v1.1.10

func (x *ListModelRequest) GetPageSize() uint32

func (*ListModelRequest) ProtoMessage

func (*ListModelRequest) ProtoMessage()

func (*ListModelRequest) ProtoReflect

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

func (*ListModelRequest) Reset

func (x *ListModelRequest) Reset()

func (*ListModelRequest) String

func (x *ListModelRequest) String() string

type ListModelResponse

type ListModelResponse struct {
	Total uint32   `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Model []*Model `protobuf:"bytes,2,rep,name=model,proto3" json:"model,omitempty"`
	// contains filtered or unexported fields
}

func (*ListModelResponse) Descriptor deprecated

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

Deprecated: Use ListModelResponse.ProtoReflect.Descriptor instead.

func (*ListModelResponse) GetModel

func (x *ListModelResponse) GetModel() []*Model

func (*ListModelResponse) GetTotal added in v1.2.0

func (x *ListModelResponse) GetTotal() uint32

func (*ListModelResponse) ProtoMessage

func (*ListModelResponse) ProtoMessage()

func (*ListModelResponse) ProtoReflect

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

func (*ListModelResponse) Reset

func (x *ListModelResponse) Reset()

func (*ListModelResponse) String

func (x *ListModelResponse) String() string

type Model added in v1.1.7

type Model struct {
	Name            string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                                 //设备名称
	Id              string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`                                                     //设备模型唯一码
	GroupName       string `protobuf:"bytes,3,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"`                      //组号
	GroupId         string `protobuf:"bytes,4,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`                            //组号
	LinkType        uint32 `protobuf:"varint,5,opt,name=link_type,json=linkType,proto3" json:"link_type,omitempty"`                        //通讯类型 1为modbus485
	IsNegativeValue bool   `protobuf:"varint,6,opt,name=is_negative_value,json=isNegativeValue,proto3" json:"is_negative_value,omitempty"` //是否有负值
	Unit            string `protobuf:"bytes,7,opt,name=unit,proto3" json:"unit,omitempty"`                                                 //单位
	Detail          string `protobuf:"bytes,8,opt,name=detail,proto3" json:"detail,omitempty"`                                             //描述
	CreateTime      string `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`                   //创建时间
	// contains filtered or unexported fields
}

func (*Model) Descriptor deprecated added in v1.1.7

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

Deprecated: Use Model.ProtoReflect.Descriptor instead.

func (*Model) GetCreateTime added in v1.2.0

func (x *Model) GetCreateTime() string

func (*Model) GetDetail added in v1.2.0

func (x *Model) GetDetail() string

func (*Model) GetGroupId added in v1.1.7

func (x *Model) GetGroupId() string

func (*Model) GetGroupName added in v1.2.0

func (x *Model) GetGroupName() string

func (*Model) GetId added in v1.1.7

func (x *Model) GetId() string

func (*Model) GetIsNegativeValue added in v1.1.10

func (x *Model) GetIsNegativeValue() bool

func (*Model) GetLinkType added in v1.1.7

func (x *Model) GetLinkType() uint32

func (*Model) GetName added in v1.1.7

func (x *Model) GetName() string

func (*Model) GetUnit added in v1.1.10

func (x *Model) GetUnit() string

func (*Model) ProtoMessage added in v1.1.7

func (*Model) ProtoMessage()

func (*Model) ProtoReflect added in v1.1.7

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

func (*Model) Reset added in v1.1.7

func (x *Model) Reset()

func (*Model) String added in v1.1.7

func (x *Model) String() string

type ModelGroupClient added in v1.1.1

type ModelGroupClient interface {
	AddGroup(ctx context.Context, in *AddGroupRequest, opts ...grpc.CallOption) (*Group, error)
	DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*DeleteGroupResponse, error)
	ListGroup(ctx context.Context, in *ListGroupRequest, opts ...grpc.CallOption) (*ListGroupResponse, error)
	UpdateGroup(ctx context.Context, in *Group, opts ...grpc.CallOption) (*Group, error)
}

ModelGroupClient is the client API for ModelGroup service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewModelGroupClient added in v1.1.1

func NewModelGroupClient(cc grpc.ClientConnInterface) ModelGroupClient

type ModelGroupServer added in v1.1.1

type ModelGroupServer interface {
	AddGroup(context.Context, *AddGroupRequest) (*Group, error)
	DeleteGroup(context.Context, *DeleteGroupRequest) (*DeleteGroupResponse, error)
	ListGroup(context.Context, *ListGroupRequest) (*ListGroupResponse, error)
	UpdateGroup(context.Context, *Group) (*Group, error)
}

ModelGroupServer is the server API for ModelGroup service.

type ModelModbusClient added in v1.1.4

type ModelModbusClient interface {
	AddModel(ctx context.Context, in *AddModelRequest, opts ...grpc.CallOption) (*AddModelResponse, error)
	DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*DeleteModelResponse, error)
	ListModel(ctx context.Context, in *ListModelRequest, opts ...grpc.CallOption) (*ListModelResponse, error)
	UpdateModel(ctx context.Context, in *Model, opts ...grpc.CallOption) (*Model, error)
}

ModelModbusClient is the client API for ModelModbus service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewModelModbusClient added in v1.1.4

func NewModelModbusClient(cc grpc.ClientConnInterface) ModelModbusClient

type ModelModbusServer added in v1.1.4

type ModelModbusServer interface {
	AddModel(context.Context, *AddModelRequest) (*AddModelResponse, error)
	DeleteModel(context.Context, *DeleteModelRequest) (*DeleteModelResponse, error)
	ListModel(context.Context, *ListModelRequest) (*ListModelResponse, error)
	UpdateModel(context.Context, *Model) (*Model, error)
}

ModelModbusServer is the server API for ModelModbus service.

type UnimplementedModelGroupServer added in v1.1.1

type UnimplementedModelGroupServer struct {
}

UnimplementedModelGroupServer can be embedded to have forward compatible implementations.

func (*UnimplementedModelGroupServer) AddGroup added in v1.1.1

func (*UnimplementedModelGroupServer) DeleteGroup added in v1.1.1

func (*UnimplementedModelGroupServer) ListGroup added in v1.1.1

func (*UnimplementedModelGroupServer) UpdateGroup added in v1.1.1

type UnimplementedModelModbusServer added in v1.1.4

type UnimplementedModelModbusServer struct {
}

UnimplementedModelModbusServer can be embedded to have forward compatible implementations.

func (*UnimplementedModelModbusServer) AddModel added in v1.1.4

func (*UnimplementedModelModbusServer) DeleteModel added in v1.1.4

func (*UnimplementedModelModbusServer) ListModel added in v1.1.4

func (*UnimplementedModelModbusServer) UpdateModel added in v1.1.4

Jump to

Keyboard shortcuts

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