protos

package
v0.0.0-...-cd92494 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package protos is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterWasteServiceHandler

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

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

func RegisterWasteServiceHandlerClient

func RegisterWasteServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WasteServiceClient) error

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

func RegisterWasteServiceHandlerFromEndpoint

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

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

func RegisterWasteServiceServer

func RegisterWasteServiceServer(s *grpc.Server, srv WasteServiceServer)

Types

type BinRegisterReply

type BinRegisterReply struct {
	BinId                int32    `protobuf:"varint,1,opt,name=bin_id,json=binId,proto3" json:"bin_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BinRegisterReply) Descriptor

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

func (*BinRegisterReply) GetBinId

func (m *BinRegisterReply) GetBinId() int32

func (*BinRegisterReply) ProtoMessage

func (*BinRegisterReply) ProtoMessage()

func (*BinRegisterReply) Reset

func (m *BinRegisterReply) Reset()

func (*BinRegisterReply) String

func (m *BinRegisterReply) String() string

func (*BinRegisterReply) XXX_DiscardUnknown

func (m *BinRegisterReply) XXX_DiscardUnknown()

func (*BinRegisterReply) XXX_Marshal

func (m *BinRegisterReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BinRegisterReply) XXX_Merge

func (m *BinRegisterReply) XXX_Merge(src proto.Message)

func (*BinRegisterReply) XXX_Size

func (m *BinRegisterReply) XXX_Size() int

func (*BinRegisterReply) XXX_Unmarshal

func (m *BinRegisterReply) XXX_Unmarshal(b []byte) error

type BinRegisterRequest

type BinRegisterRequest struct {
	UserId               int32    `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	IpAddress            string   `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
	BinId                int32    `protobuf:"varint,3,opt,name=bin_id,json=binId,proto3" json:"bin_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BinRegisterRequest) Descriptor

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

func (*BinRegisterRequest) GetBinId

func (m *BinRegisterRequest) GetBinId() int32

func (*BinRegisterRequest) GetIpAddress

func (m *BinRegisterRequest) GetIpAddress() string

func (*BinRegisterRequest) GetUserId

func (m *BinRegisterRequest) GetUserId() int32

func (*BinRegisterRequest) ProtoMessage

func (*BinRegisterRequest) ProtoMessage()

func (*BinRegisterRequest) Reset

func (m *BinRegisterRequest) Reset()

func (*BinRegisterRequest) String

func (m *BinRegisterRequest) String() string

func (*BinRegisterRequest) XXX_DiscardUnknown

func (m *BinRegisterRequest) XXX_DiscardUnknown()

func (*BinRegisterRequest) XXX_Marshal

func (m *BinRegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BinRegisterRequest) XXX_Merge

func (m *BinRegisterRequest) XXX_Merge(src proto.Message)

func (*BinRegisterRequest) XXX_Size

func (m *BinRegisterRequest) XXX_Size() int

func (*BinRegisterRequest) XXX_Unmarshal

func (m *BinRegisterRequest) XXX_Unmarshal(b []byte) error

type BinStatusRequest

type BinStatusRequest struct {
	BinId                int32    `protobuf:"varint,1,opt,name=bin_id,json=binId,proto3" json:"bin_id,omitempty"`
	Status               int32    `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	Angel                float32  `protobuf:"fixed32,3,opt,name=angel,proto3" json:"angel,omitempty"`
	Temp                 float32  `protobuf:"fixed32,4,opt,name=temp,proto3" json:"temp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BinStatusRequest) Descriptor

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

func (*BinStatusRequest) GetAngel

func (m *BinStatusRequest) GetAngel() float32

func (*BinStatusRequest) GetBinId

func (m *BinStatusRequest) GetBinId() int32

func (*BinStatusRequest) GetStatus

func (m *BinStatusRequest) GetStatus() int32

func (*BinStatusRequest) GetTemp

func (m *BinStatusRequest) GetTemp() float32

func (*BinStatusRequest) ProtoMessage

func (*BinStatusRequest) ProtoMessage()

func (*BinStatusRequest) Reset

func (m *BinStatusRequest) Reset()

func (*BinStatusRequest) String

func (m *BinStatusRequest) String() string

func (*BinStatusRequest) XXX_DiscardUnknown

func (m *BinStatusRequest) XXX_DiscardUnknown()

func (*BinStatusRequest) XXX_Marshal

func (m *BinStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BinStatusRequest) XXX_Merge

func (m *BinStatusRequest) XXX_Merge(src proto.Message)

func (*BinStatusRequest) XXX_Size

func (m *BinStatusRequest) XXX_Size() int

func (*BinStatusRequest) XXX_Unmarshal

func (m *BinStatusRequest) XXX_Unmarshal(b []byte) error

type Null

type Null struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Null) Descriptor

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

func (*Null) ProtoMessage

func (*Null) ProtoMessage()

func (*Null) Reset

func (m *Null) Reset()

func (*Null) String

func (m *Null) String() string

func (*Null) XXX_DiscardUnknown

func (m *Null) XXX_DiscardUnknown()

func (*Null) XXX_Marshal

func (m *Null) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Null) XXX_Merge

func (m *Null) XXX_Merge(src proto.Message)

func (*Null) XXX_Size

func (m *Null) XXX_Size() int

func (*Null) XXX_Unmarshal

func (m *Null) XXX_Unmarshal(b []byte) error

type UnimplementedWasteServiceServer

type UnimplementedWasteServiceServer struct {
}

UnimplementedWasteServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedWasteServiceServer) BinRegister

func (*UnimplementedWasteServiceServer) BinStatus

func (*UnimplementedWasteServiceServer) WasteDetect

type WasteReply

type WasteReply struct {
	ResId                int64    `protobuf:"varint,1,opt,name=res_id,json=resId,proto3" json:"res_id,omitempty"`
	WasteName            string   `protobuf:"bytes,2,opt,name=waste_name,json=wasteName,proto3" json:"waste_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WasteReply) Descriptor

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

func (*WasteReply) GetResId

func (m *WasteReply) GetResId() int64

func (*WasteReply) GetWasteName

func (m *WasteReply) GetWasteName() string

func (*WasteReply) ProtoMessage

func (*WasteReply) ProtoMessage()

func (*WasteReply) Reset

func (m *WasteReply) Reset()

func (*WasteReply) String

func (m *WasteReply) String() string

func (*WasteReply) XXX_DiscardUnknown

func (m *WasteReply) XXX_DiscardUnknown()

func (*WasteReply) XXX_Marshal

func (m *WasteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WasteReply) XXX_Merge

func (m *WasteReply) XXX_Merge(src proto.Message)

func (*WasteReply) XXX_Size

func (m *WasteReply) XXX_Size() int

func (*WasteReply) XXX_Unmarshal

func (m *WasteReply) XXX_Unmarshal(b []byte) error

type WasteRequest

type WasteRequest struct {
	BinId                string   `protobuf:"bytes,1,opt,name=bin_id,json=binId,proto3" json:"bin_id,omitempty"`
	WasteImage           string   `protobuf:"bytes,2,opt,name=waste_image,json=wasteImage,proto3" json:"waste_image,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WasteRequest) Descriptor

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

func (*WasteRequest) GetBinId

func (m *WasteRequest) GetBinId() string

func (*WasteRequest) GetWasteImage

func (m *WasteRequest) GetWasteImage() string

func (*WasteRequest) ProtoMessage

func (*WasteRequest) ProtoMessage()

func (*WasteRequest) Reset

func (m *WasteRequest) Reset()

func (*WasteRequest) String

func (m *WasteRequest) String() string

func (*WasteRequest) XXX_DiscardUnknown

func (m *WasteRequest) XXX_DiscardUnknown()

func (*WasteRequest) XXX_Marshal

func (m *WasteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WasteRequest) XXX_Merge

func (m *WasteRequest) XXX_Merge(src proto.Message)

func (*WasteRequest) XXX_Size

func (m *WasteRequest) XXX_Size() int

func (*WasteRequest) XXX_Unmarshal

func (m *WasteRequest) XXX_Unmarshal(b []byte) error

type WasteServiceClient

type WasteServiceClient interface {
	// 传输实时图片 返回识别结果
	WasteDetect(ctx context.Context, in *WasteRequest, opts ...grpc.CallOption) (*WasteReply, error)
	// 状态上报
	BinStatus(ctx context.Context, in *BinStatusRequest, opts ...grpc.CallOption) (*Null, error)
	// 垃圾桶注册
	BinRegister(ctx context.Context, in *BinRegisterRequest, opts ...grpc.CallOption) (*BinRegisterReply, error)
}

WasteServiceClient is the client API for WasteService service.

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

func NewWasteServiceClient

func NewWasteServiceClient(cc *grpc.ClientConn) WasteServiceClient

type WasteServiceServer

type WasteServiceServer interface {
	// 传输实时图片 返回识别结果
	WasteDetect(context.Context, *WasteRequest) (*WasteReply, error)
	// 状态上报
	BinStatus(context.Context, *BinStatusRequest) (*Null, error)
	// 垃圾桶注册
	BinRegister(context.Context, *BinRegisterRequest) (*BinRegisterReply, error)
}

WasteServiceServer is the server API for WasteService service.

Jump to

Keyboard shortcuts

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