Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterLsmdbHTTPServer(s *http.Server, srv LsmdbHTTPServer)
- func RegisterLsmdbServer(s grpc.ServiceRegistrar, srv LsmdbServer)
- type GetReply
- type GetRequest
- type LsmdbClient
- type LsmdbHTTPClient
- type LsmdbHTTPClientImpl
- func (c *LsmdbHTTPClientImpl) Get(ctx context.Context, in *GetRequest, opts ...http.CallOption) (*GetReply, error)
- func (c *LsmdbHTTPClientImpl) OpenDB(ctx context.Context, in *OpenDBRequest, opts ...http.CallOption) (*OpenDBReply, error)
- func (c *LsmdbHTTPClientImpl) Put(ctx context.Context, in *PutRequest, opts ...http.CallOption) (*PutReply, error)
- func (c *LsmdbHTTPClientImpl) PutStr(ctx context.Context, in *PutStrRequest, opts ...http.CallOption) (*PutStrReply, error)
- type LsmdbHTTPServer
- type LsmdbServer
- type OpenDBReply
- type OpenDBRequest
- type PutReply
- type PutRequest
- type PutStrReply
- type PutStrRequest
- func (*PutStrRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PutStrRequest) GetKey() string
- func (x *PutStrRequest) GetValue() string
- func (*PutStrRequest) ProtoMessage()
- func (x *PutStrRequest) ProtoReflect() protoreflect.Message
- func (x *PutStrRequest) Reset()
- func (x *PutStrRequest) String() string
- type UnimplementedLsmdbServer
- func (UnimplementedLsmdbServer) Get(context.Context, *GetRequest) (*GetReply, error)
- func (UnimplementedLsmdbServer) OpenDB(context.Context, *OpenDBRequest) (*OpenDBReply, error)
- func (UnimplementedLsmdbServer) Put(context.Context, *PutRequest) (*PutReply, error)
- func (UnimplementedLsmdbServer) PutStr(context.Context, *PutStrRequest) (*PutStrReply, error)
- type UnsafeLsmdbServer
Constants ¶
const ( Lsmdb_OpenDB_FullMethodName = "/lsmdb.v1.Lsmdb/OpenDB" Lsmdb_Put_FullMethodName = "/lsmdb.v1.Lsmdb/Put" Lsmdb_PutStr_FullMethodName = "/lsmdb.v1.Lsmdb/PutStr" Lsmdb_Get_FullMethodName = "/lsmdb.v1.Lsmdb/Get" )
const OperationLsmdbGet = "/lsmdb.v1.Lsmdb/Get"
const OperationLsmdbOpenDB = "/lsmdb.v1.Lsmdb/OpenDB"
const OperationLsmdbPut = "/lsmdb.v1.Lsmdb/Put"
const OperationLsmdbPutStr = "/lsmdb.v1.Lsmdb/PutStr"
Variables ¶
var File_api_lsmdb_v1_lsmdb_proto protoreflect.FileDescriptor
var Lsmdb_ServiceDesc = grpc.ServiceDesc{ ServiceName: "lsmdb.v1.Lsmdb", HandlerType: (*LsmdbServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "OpenDB", Handler: _Lsmdb_OpenDB_Handler, }, { MethodName: "Put", Handler: _Lsmdb_Put_Handler, }, { MethodName: "PutStr", Handler: _Lsmdb_PutStr_Handler, }, { MethodName: "Get", Handler: _Lsmdb_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/lsmdb/v1/lsmdb.proto", }
Lsmdb_ServiceDesc is the grpc.ServiceDesc for Lsmdb service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterLsmdbHTTPServer ¶
func RegisterLsmdbHTTPServer(s *http.Server, srv LsmdbHTTPServer)
func RegisterLsmdbServer ¶
func RegisterLsmdbServer(s grpc.ServiceRegistrar, srv LsmdbServer)
Types ¶
type GetReply ¶
type GetReply struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
The response message containing the value about register success or not .
func (*GetReply) Descriptor
deprecated
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
The request message containing mac addr and ip.
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetKey ¶
func (x *GetRequest) GetKey() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type LsmdbClient ¶
type LsmdbClient interface { // Sends a register OpenDB(ctx context.Context, in *OpenDBRequest, opts ...grpc.CallOption) (*OpenDBReply, error) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutReply, error) PutStr(ctx context.Context, in *PutStrRequest, opts ...grpc.CallOption) (*PutStrReply, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error) }
LsmdbClient is the client API for Lsmdb 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 NewLsmdbClient ¶
func NewLsmdbClient(cc grpc.ClientConnInterface) LsmdbClient
type LsmdbHTTPClient ¶
type LsmdbHTTPClient interface { Get(ctx context.Context, req *GetRequest, opts ...http.CallOption) (rsp *GetReply, err error) OpenDB(ctx context.Context, req *OpenDBRequest, opts ...http.CallOption) (rsp *OpenDBReply, err error) Put(ctx context.Context, req *PutRequest, opts ...http.CallOption) (rsp *PutReply, err error) PutStr(ctx context.Context, req *PutStrRequest, opts ...http.CallOption) (rsp *PutStrReply, err error) }
func NewLsmdbHTTPClient ¶
func NewLsmdbHTTPClient(client *http.Client) LsmdbHTTPClient
type LsmdbHTTPClientImpl ¶
type LsmdbHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*LsmdbHTTPClientImpl) Get ¶
func (c *LsmdbHTTPClientImpl) Get(ctx context.Context, in *GetRequest, opts ...http.CallOption) (*GetReply, error)
func (*LsmdbHTTPClientImpl) OpenDB ¶
func (c *LsmdbHTTPClientImpl) OpenDB(ctx context.Context, in *OpenDBRequest, opts ...http.CallOption) (*OpenDBReply, error)
func (*LsmdbHTTPClientImpl) Put ¶
func (c *LsmdbHTTPClientImpl) Put(ctx context.Context, in *PutRequest, opts ...http.CallOption) (*PutReply, error)
func (*LsmdbHTTPClientImpl) PutStr ¶
func (c *LsmdbHTTPClientImpl) PutStr(ctx context.Context, in *PutStrRequest, opts ...http.CallOption) (*PutStrReply, error)
type LsmdbHTTPServer ¶
type LsmdbHTTPServer interface { Get(context.Context, *GetRequest) (*GetReply, error) // OpenDB Sends a register OpenDB(context.Context, *OpenDBRequest) (*OpenDBReply, error) Put(context.Context, *PutRequest) (*PutReply, error) PutStr(context.Context, *PutStrRequest) (*PutStrReply, error) }
type LsmdbServer ¶
type LsmdbServer interface { // Sends a register OpenDB(context.Context, *OpenDBRequest) (*OpenDBReply, error) Put(context.Context, *PutRequest) (*PutReply, error) PutStr(context.Context, *PutStrRequest) (*PutStrReply, error) Get(context.Context, *GetRequest) (*GetReply, error) // contains filtered or unexported methods }
LsmdbServer is the server API for Lsmdb service. All implementations must embed UnimplementedLsmdbServer for forward compatibility
type OpenDBReply ¶
type OpenDBReply struct { Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
The response message containing the value about register success or not .
func (*OpenDBReply) Descriptor
deprecated
func (*OpenDBReply) Descriptor() ([]byte, []int)
Deprecated: Use OpenDBReply.ProtoReflect.Descriptor instead.
func (*OpenDBReply) GetValue ¶
func (x *OpenDBReply) GetValue() bool
func (*OpenDBReply) ProtoMessage ¶
func (*OpenDBReply) ProtoMessage()
func (*OpenDBReply) ProtoReflect ¶
func (x *OpenDBReply) ProtoReflect() protoreflect.Message
func (*OpenDBReply) Reset ¶
func (x *OpenDBReply) Reset()
func (*OpenDBReply) String ¶
func (x *OpenDBReply) String() string
type OpenDBRequest ¶
type OpenDBRequest struct { DbName string `protobuf:"bytes,1,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` // contains filtered or unexported fields }
命名必须使用下划线,否则出现传递不了参数的情况
func (*OpenDBRequest) Descriptor
deprecated
func (*OpenDBRequest) Descriptor() ([]byte, []int)
Deprecated: Use OpenDBRequest.ProtoReflect.Descriptor instead.
func (*OpenDBRequest) GetDbName ¶
func (x *OpenDBRequest) GetDbName() string
func (*OpenDBRequest) ProtoMessage ¶
func (*OpenDBRequest) ProtoMessage()
func (*OpenDBRequest) ProtoReflect ¶
func (x *OpenDBRequest) ProtoReflect() protoreflect.Message
func (*OpenDBRequest) Reset ¶
func (x *OpenDBRequest) Reset()
func (*OpenDBRequest) String ¶
func (x *OpenDBRequest) String() string
type PutReply ¶
type PutReply struct { Data bool `protobuf:"varint,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*PutReply) Descriptor
deprecated
func (*PutReply) ProtoMessage ¶
func (*PutReply) ProtoMessage()
func (*PutReply) ProtoReflect ¶
func (x *PutReply) ProtoReflect() protoreflect.Message
type PutRequest ¶
type PutRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*PutRequest) Descriptor
deprecated
func (*PutRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) GetKey ¶
func (x *PutRequest) GetKey() string
func (*PutRequest) GetValue ¶
func (x *PutRequest) GetValue() []byte
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) ProtoReflect ¶
func (x *PutRequest) ProtoReflect() protoreflect.Message
func (*PutRequest) Reset ¶
func (x *PutRequest) Reset()
func (*PutRequest) String ¶
func (x *PutRequest) String() string
type PutStrReply ¶
type PutStrReply struct { Data bool `protobuf:"varint,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*PutStrReply) Descriptor
deprecated
func (*PutStrReply) Descriptor() ([]byte, []int)
Deprecated: Use PutStrReply.ProtoReflect.Descriptor instead.
func (*PutStrReply) GetData ¶
func (x *PutStrReply) GetData() bool
func (*PutStrReply) ProtoMessage ¶
func (*PutStrReply) ProtoMessage()
func (*PutStrReply) ProtoReflect ¶
func (x *PutStrReply) ProtoReflect() protoreflect.Message
func (*PutStrReply) Reset ¶
func (x *PutStrReply) Reset()
func (*PutStrReply) String ¶
func (x *PutStrReply) String() string
type PutStrRequest ¶
type PutStrRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*PutStrRequest) Descriptor
deprecated
func (*PutStrRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutStrRequest.ProtoReflect.Descriptor instead.
func (*PutStrRequest) GetKey ¶
func (x *PutStrRequest) GetKey() string
func (*PutStrRequest) GetValue ¶
func (x *PutStrRequest) GetValue() string
func (*PutStrRequest) ProtoMessage ¶
func (*PutStrRequest) ProtoMessage()
func (*PutStrRequest) ProtoReflect ¶
func (x *PutStrRequest) ProtoReflect() protoreflect.Message
func (*PutStrRequest) Reset ¶
func (x *PutStrRequest) Reset()
func (*PutStrRequest) String ¶
func (x *PutStrRequest) String() string
type UnimplementedLsmdbServer ¶
type UnimplementedLsmdbServer struct { }
UnimplementedLsmdbServer must be embedded to have forward compatible implementations.
func (UnimplementedLsmdbServer) Get ¶
func (UnimplementedLsmdbServer) Get(context.Context, *GetRequest) (*GetReply, error)
func (UnimplementedLsmdbServer) OpenDB ¶
func (UnimplementedLsmdbServer) OpenDB(context.Context, *OpenDBRequest) (*OpenDBReply, error)
func (UnimplementedLsmdbServer) Put ¶
func (UnimplementedLsmdbServer) Put(context.Context, *PutRequest) (*PutReply, error)
func (UnimplementedLsmdbServer) PutStr ¶
func (UnimplementedLsmdbServer) PutStr(context.Context, *PutStrRequest) (*PutStrReply, error)
type UnsafeLsmdbServer ¶
type UnsafeLsmdbServer interface {
// contains filtered or unexported methods
}
UnsafeLsmdbServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LsmdbServer will result in compilation errors.