protos

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LDLM_Lock_FullMethodName        = "/ldlm.LDLM/Lock"
	LDLM_Unlock_FullMethodName      = "/ldlm.LDLM/Unlock"
	LDLM_TryLock_FullMethodName     = "/ldlm.LDLM/TryLock"
	LDLM_RefreshLock_FullMethodName = "/ldlm.LDLM/RefreshLock"
)

Variables

View Source
var (
	ErrorCode_name = map[int32]string{
		0: "Unknown",
		1: "LockDoesNotExist",
		2: "InvalidLockKey",
		3: "LockWaitTimeout",
		4: "NotLocked",
		5: "LockDoesNotExistOrInvalidKey",
	}
	ErrorCode_value = map[string]int32{
		"Unknown":                      0,
		"LockDoesNotExist":             1,
		"InvalidLockKey":               2,
		"LockWaitTimeout":              3,
		"NotLocked":                    4,
		"LockDoesNotExistOrInvalidKey": 5,
	}
)

Enum value maps for ErrorCode.

View Source
var LDLM_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ldlm.LDLM",
	HandlerType: (*LDLMServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Lock",
			Handler:    _LDLM_Lock_Handler,
		},
		{
			MethodName: "Unlock",
			Handler:    _LDLM_Unlock_Handler,
		},
		{
			MethodName: "TryLock",
			Handler:    _LDLM_TryLock_Handler,
		},
		{
			MethodName: "RefreshLock",
			Handler:    _LDLM_RefreshLock_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ldlm.proto",
}

LDLM_ServiceDesc is the grpc.ServiceDesc for LDLM service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLDLMServer

func RegisterLDLMServer(s grpc.ServiceRegistrar, srv LDLMServer)

Types

type Error

type Error struct {
	Code    ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ldlm.ErrorCode" json:"code,omitempty"`
	Message string    `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() ErrorCode

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type ErrorCode

type ErrorCode int32
const (
	ErrorCode_Unknown                      ErrorCode = 0
	ErrorCode_LockDoesNotExist             ErrorCode = 1
	ErrorCode_InvalidLockKey               ErrorCode = 2
	ErrorCode_LockWaitTimeout              ErrorCode = 3
	ErrorCode_NotLocked                    ErrorCode = 4
	ErrorCode_LockDoesNotExistOrInvalidKey ErrorCode = 5
)

func (ErrorCode) Descriptor

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor deprecated

func (ErrorCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String

func (x ErrorCode) String() string

func (ErrorCode) Type

type LDLMClient

type LDLMClient interface {
	Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error)
	Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error)
	TryLock(ctx context.Context, in *TryLockRequest, opts ...grpc.CallOption) (*LockResponse, error)
	RefreshLock(ctx context.Context, in *RefreshLockRequest, opts ...grpc.CallOption) (*LockResponse, error)
}

LDLMClient is the client API for LDLM 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 NewLDLMClient

func NewLDLMClient(cc grpc.ClientConnInterface) LDLMClient

type LDLMServer

type LDLMServer interface {
	Lock(context.Context, *LockRequest) (*LockResponse, error)
	Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error)
	TryLock(context.Context, *TryLockRequest) (*LockResponse, error)
	RefreshLock(context.Context, *RefreshLockRequest) (*LockResponse, error)
	// contains filtered or unexported methods
}

LDLMServer is the server API for LDLM service. All implementations must embed UnimplementedLDLMServer for forward compatibility

type LockRequest

type LockRequest struct {
	Name               string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	WaitTimeoutSeconds *uint32 `protobuf:"varint,3,opt,name=wait_timeout_seconds,json=waitTimeoutSeconds,proto3,oneof" json:"wait_timeout_seconds,omitempty"`
	LockTimeoutSeconds *uint32 `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*LockRequest) Descriptor deprecated

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

Deprecated: Use LockRequest.ProtoReflect.Descriptor instead.

func (*LockRequest) GetLockTimeoutSeconds

func (x *LockRequest) GetLockTimeoutSeconds() uint32

func (*LockRequest) GetName

func (x *LockRequest) GetName() string

func (*LockRequest) GetWaitTimeoutSeconds

func (x *LockRequest) GetWaitTimeoutSeconds() uint32

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 LockResponse

type LockResponse struct {
	Locked bool   `protobuf:"varint,1,opt,name=locked,proto3" json:"locked,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Key    string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	Error  *Error `protobuf:"bytes,4,opt,name=error,proto3,oneof" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*LockResponse) Descriptor deprecated

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

Deprecated: Use LockResponse.ProtoReflect.Descriptor instead.

func (*LockResponse) GetError

func (x *LockResponse) GetError() *Error

func (*LockResponse) GetKey

func (x *LockResponse) GetKey() string

func (*LockResponse) GetLocked

func (x *LockResponse) GetLocked() bool

func (*LockResponse) GetName

func (x *LockResponse) GetName() string

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 RefreshLockRequest

type RefreshLockRequest struct {
	Name               string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Key                string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	LockTimeoutSeconds uint32 `protobuf:"varint,100,opt,name=lock_timeout_seconds,json=lockTimeoutSeconds,proto3" json:"lock_timeout_seconds,omitempty"`
	// contains filtered or unexported fields
}

func (*RefreshLockRequest) Descriptor deprecated

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

Deprecated: Use RefreshLockRequest.ProtoReflect.Descriptor instead.

func (*RefreshLockRequest) GetKey

func (x *RefreshLockRequest) GetKey() string

func (*RefreshLockRequest) GetLockTimeoutSeconds

func (x *RefreshLockRequest) GetLockTimeoutSeconds() uint32

func (*RefreshLockRequest) GetName

func (x *RefreshLockRequest) GetName() string

func (*RefreshLockRequest) ProtoMessage

func (*RefreshLockRequest) ProtoMessage()

func (*RefreshLockRequest) ProtoReflect

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

func (*RefreshLockRequest) Reset

func (x *RefreshLockRequest) Reset()

func (*RefreshLockRequest) String

func (x *RefreshLockRequest) String() string

type TryLockRequest

type TryLockRequest struct {
	Name               string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	LockTimeoutSeconds *uint32 `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TryLockRequest) Descriptor deprecated

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

Deprecated: Use TryLockRequest.ProtoReflect.Descriptor instead.

func (*TryLockRequest) GetLockTimeoutSeconds

func (x *TryLockRequest) GetLockTimeoutSeconds() uint32

func (*TryLockRequest) GetName

func (x *TryLockRequest) GetName() string

func (*TryLockRequest) ProtoMessage

func (*TryLockRequest) ProtoMessage()

func (*TryLockRequest) ProtoReflect

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

func (*TryLockRequest) Reset

func (x *TryLockRequest) Reset()

func (*TryLockRequest) String

func (x *TryLockRequest) String() string

type UnimplementedLDLMServer

type UnimplementedLDLMServer struct {
}

UnimplementedLDLMServer must be embedded to have forward compatible implementations.

func (UnimplementedLDLMServer) Lock

func (UnimplementedLDLMServer) RefreshLock

func (UnimplementedLDLMServer) TryLock

func (UnimplementedLDLMServer) Unlock

type UnlockRequest

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

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) GetName

func (x *UnlockRequest) GetName() 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 UnlockResponse

type UnlockResponse struct {
	Unlocked bool   `protobuf:"varint,1,opt,name=unlocked,proto3" json:"unlocked,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Error    *Error `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*UnlockResponse) Descriptor deprecated

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

Deprecated: Use UnlockResponse.ProtoReflect.Descriptor instead.

func (*UnlockResponse) GetError

func (x *UnlockResponse) GetError() *Error

func (*UnlockResponse) GetName

func (x *UnlockResponse) GetName() string

func (*UnlockResponse) GetUnlocked

func (x *UnlockResponse) GetUnlocked() bool

func (*UnlockResponse) ProtoMessage

func (*UnlockResponse) ProtoMessage()

func (*UnlockResponse) ProtoReflect

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

func (*UnlockResponse) Reset

func (x *UnlockResponse) Reset()

func (*UnlockResponse) String

func (x *UnlockResponse) String() string

type UnsafeLDLMServer

type UnsafeLDLMServer interface {
	// contains filtered or unexported methods
}

UnsafeLDLMServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LDLMServer will result in compilation errors.

Jump to

Keyboard shortcuts

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