Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_puff_proto protoreflect.FileDescriptor
var Puff_ServiceDesc = grpc.ServiceDesc{ ServiceName: "puff.puff", HandlerType: (*PuffServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Lock", Handler: _Puff_Lock_Handler, }, { MethodName: "Unlock", Handler: _Puff_Unlock_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "puff.proto", }
Puff_ServiceDesc is the grpc.ServiceDesc for Puff service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPuffServer ¶
func RegisterPuffServer(s grpc.ServiceRegistrar, srv PuffServer)
Types ¶
type LockReply ¶
type LockReply struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*LockReply) Descriptor
deprecated
func (*LockReply) ProtoMessage ¶
func (*LockReply) ProtoMessage()
func (*LockReply) ProtoReflect ¶
func (x *LockReply) ProtoReflect() protoreflect.Message
type LockRequest ¶
type LockRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
The request message containing the lock's name.
func (*LockRequest) Descriptor
deprecated
func (*LockRequest) Descriptor() ([]byte, []int)
Deprecated: Use LockRequest.ProtoReflect.Descriptor instead.
func (*LockRequest) GetKey ¶
func (x *LockRequest) GetKey() string
func (*LockRequest) ProtoMessage ¶
func (*LockRequest) ProtoMessage()
func (*LockRequest) ProtoReflect ¶
func (x *LockRequest) ProtoReflect() protoreflect.Message
func (*LockRequest) Reset ¶
func (x *LockRequest) Reset()
func (*LockRequest) String ¶
func (x *LockRequest) String() string
type PuffClient ¶
type PuffClient interface { // Sends a get lock request Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockReply, error) // Sends a unlock request Unlock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*UnlockReply, error) }
PuffClient is the client API for Puff 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 NewPuffClient ¶
func NewPuffClient(cc grpc.ClientConnInterface) PuffClient
type PuffServer ¶
type PuffServer interface { // Sends a get lock request Lock(context.Context, *LockRequest) (*LockReply, error) // Sends a unlock request Unlock(context.Context, *LockRequest) (*UnlockReply, error) // contains filtered or unexported methods }
PuffServer is the server API for Puff service. All implementations must embed UnimplementedPuffServer for forward compatibility
type UnimplementedPuffServer ¶
type UnimplementedPuffServer struct { }
UnimplementedPuffServer must be embedded to have forward compatible implementations.
func (UnimplementedPuffServer) Lock ¶
func (UnimplementedPuffServer) Lock(context.Context, *LockRequest) (*LockReply, error)
func (UnimplementedPuffServer) Unlock ¶
func (UnimplementedPuffServer) Unlock(context.Context, *LockRequest) (*UnlockReply, error)
type UnlockReply ¶
type UnlockReply struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*UnlockReply) Descriptor
deprecated
func (*UnlockReply) Descriptor() ([]byte, []int)
Deprecated: Use UnlockReply.ProtoReflect.Descriptor instead.
func (*UnlockReply) GetResult ¶
func (x *UnlockReply) GetResult() bool
func (*UnlockReply) ProtoMessage ¶
func (*UnlockReply) ProtoMessage()
func (*UnlockReply) ProtoReflect ¶
func (x *UnlockReply) ProtoReflect() protoreflect.Message
func (*UnlockReply) Reset ¶
func (x *UnlockReply) Reset()
func (*UnlockReply) String ¶
func (x *UnlockReply) String() string
type UnlockRequest ¶
type UnlockRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
The request message containing the lock's name.
func (*UnlockRequest) Descriptor
deprecated
func (*UnlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnlockRequest.ProtoReflect.Descriptor instead.
func (*UnlockRequest) GetKey ¶
func (x *UnlockRequest) GetKey() string
func (*UnlockRequest) ProtoMessage ¶
func (*UnlockRequest) ProtoMessage()
func (*UnlockRequest) ProtoReflect ¶
func (x *UnlockRequest) ProtoReflect() protoreflect.Message
func (*UnlockRequest) Reset ¶
func (x *UnlockRequest) Reset()
func (*UnlockRequest) String ¶
func (x *UnlockRequest) String() string
type UnsafePuffServer ¶
type UnsafePuffServer interface {
// contains filtered or unexported methods
}
UnsafePuffServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PuffServer will result in compilation errors.