Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterDlockServer(s grpc.ServiceRegistrar, srv DlockServer)
- type DlockClient
- type DlockGRPC
- func (d *DlockGRPC) GetLockServer() *dlock.DLockServer
- func (d *DlockGRPC) IsPresent(_ context.Context, params *Lockparams) (*Lockresponse, error)
- func (d *DlockGRPC) Lock(_ context.Context, params *Lockparams) (*Lockresponse, error)
- func (d *DlockGRPC) Unlock(_ context.Context, params *Lockparams) (*Lockresponse, error)
- type DlockServer
- type Lockparams
- type Lockresponse
- type UnimplementedDlockServer
- type UnsafeDlockServer
Constants ¶
const ( Dlock_Lock_FullMethodName = "/dlock/Lock" Dlock_Unlock_FullMethodName = "/dlock/Unlock" Dlock_IsPresent_FullMethodName = "/dlock/IsPresent" )
const Version = "0.0.2"
Variables ¶
var Dlock_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dlock", HandlerType: (*DlockServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Lock", Handler: _Dlock_Lock_Handler, }, { MethodName: "Unlock", Handler: _Dlock_Unlock_Handler, }, { MethodName: "IsPresent", Handler: _Dlock_IsPresent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "dlock.proto", }
Dlock_ServiceDesc is the grpc.ServiceDesc for Dlock service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_dlock_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDlockServer ¶
func RegisterDlockServer(s grpc.ServiceRegistrar, srv DlockServer)
Types ¶
type DlockClient ¶
type DlockClient interface { Lock(ctx context.Context, in *Lockparams, opts ...grpc.CallOption) (*Lockresponse, error) Unlock(ctx context.Context, in *Lockparams, opts ...grpc.CallOption) (*Lockresponse, error) IsPresent(ctx context.Context, in *Lockparams, opts ...grpc.CallOption) (*Lockresponse, error) }
DlockClient is the client API for Dlock 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 NewDlockClient ¶
func NewDlockClient(cc grpc.ClientConnInterface) DlockClient
type DlockGRPC ¶
type DlockGRPC struct { UnimplementedDlockServer // contains filtered or unexported fields }
DlockGRPC is the struct that represents a gRPC server object
func NewDlockGRPC ¶
func NewDlockGRPC(opts ...dlock.ServerOption) *DlockGRPC
NewDlockGRPC returns a new gRPC server object
func (*DlockGRPC) GetLockServer ¶
func (d *DlockGRPC) GetLockServer() *dlock.DLockServer
GetLockServer returns the underlying lock server object
func (*DlockGRPC) IsPresent ¶
func (d *DlockGRPC) IsPresent(_ context.Context, params *Lockparams) (*Lockresponse, error)
IsPresent checks if a lock is present
func (*DlockGRPC) Lock ¶
func (d *DlockGRPC) Lock(_ context.Context, params *Lockparams) (*Lockresponse, error)
Lock tries to lock the object by the given name
func (*DlockGRPC) Unlock ¶
func (d *DlockGRPC) Unlock(_ context.Context, params *Lockparams) (*Lockresponse, error)
Unlock unlocks (releases) an object and returns true if the object was released
type DlockServer ¶
type DlockServer interface { Lock(context.Context, *Lockparams) (*Lockresponse, error) Unlock(context.Context, *Lockparams) (*Lockresponse, error) IsPresent(context.Context, *Lockparams) (*Lockresponse, error) // contains filtered or unexported methods }
DlockServer is the server API for Dlock service. All implementations must embed UnimplementedDlockServer for forward compatibility
type Lockparams ¶
type Lockparams struct { Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Lockparams) Descriptor
deprecated
func (*Lockparams) Descriptor() ([]byte, []int)
Deprecated: Use Lockparams.ProtoReflect.Descriptor instead.
func (*Lockparams) GetName ¶
func (x *Lockparams) GetName() string
func (*Lockparams) ProtoMessage ¶
func (*Lockparams) ProtoMessage()
func (*Lockparams) ProtoReflect ¶
func (x *Lockparams) ProtoReflect() protoreflect.Message
func (*Lockparams) Reset ¶
func (x *Lockparams) Reset()
func (*Lockparams) String ¶
func (x *Lockparams) String() string
type Lockresponse ¶
type Lockresponse struct { IsLocked *bool `protobuf:"varint,1,req,name=isLocked" json:"isLocked,omitempty"` // contains filtered or unexported fields }
func (*Lockresponse) Descriptor
deprecated
func (*Lockresponse) Descriptor() ([]byte, []int)
Deprecated: Use Lockresponse.ProtoReflect.Descriptor instead.
func (*Lockresponse) GetIsLocked ¶
func (x *Lockresponse) GetIsLocked() bool
func (*Lockresponse) ProtoMessage ¶
func (*Lockresponse) ProtoMessage()
func (*Lockresponse) ProtoReflect ¶
func (x *Lockresponse) ProtoReflect() protoreflect.Message
func (*Lockresponse) Reset ¶
func (x *Lockresponse) Reset()
func (*Lockresponse) String ¶
func (x *Lockresponse) String() string
type UnimplementedDlockServer ¶
type UnimplementedDlockServer struct { }
UnimplementedDlockServer must be embedded to have forward compatible implementations.
func (UnimplementedDlockServer) IsPresent ¶
func (UnimplementedDlockServer) IsPresent(context.Context, *Lockparams) (*Lockresponse, error)
func (UnimplementedDlockServer) Lock ¶
func (UnimplementedDlockServer) Lock(context.Context, *Lockparams) (*Lockresponse, error)
func (UnimplementedDlockServer) Unlock ¶
func (UnimplementedDlockServer) Unlock(context.Context, *Lockparams) (*Lockresponse, error)
type UnsafeDlockServer ¶
type UnsafeDlockServer interface {
// contains filtered or unexported methods
}
UnsafeDlockServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DlockServer will result in compilation errors.