v1alpha1

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dlock_Lock_FullMethodName = "/dlock.Dlock/Lock"
)

Variables

View Source
var (
	LockEvent_name = map[int32]string{
		0: "Acquired",
		1: "Failed",
	}
	LockEvent_value = map[string]int32{
		"Acquired": 0,
		"Failed":   1,
	}
)

Enum value maps for LockEvent.

View Source
var Dlock_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dlock.Dlock",
	HandlerType: (*DlockServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Lock",
			Handler:       _Dlock_Lock_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/v1alpha1/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)

View Source
var File_api_v1alpha1_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 *LockRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[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 DlockServer

type DlockServer interface {
	Lock(*LockRequest, grpc.ServerStreamingServer[LockResponse]) error
}

DlockServer is the server API for Dlock service. All implementations should embed UnimplementedDlockServer for forward compatibility.

type Dlock_LockClient

type Dlock_LockClient = grpc.ServerStreamingClient[LockResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Dlock_LockServer

type Dlock_LockServer = grpc.ServerStreamingServer[LockResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type LockEvent

type LockEvent int32
const (
	LockEvent_Acquired LockEvent = 0
	LockEvent_Failed   LockEvent = 1
)

func (LockEvent) Descriptor

func (LockEvent) Descriptor() protoreflect.EnumDescriptor

func (LockEvent) Enum

func (x LockEvent) Enum() *LockEvent

func (LockEvent) EnumDescriptor deprecated

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

Deprecated: Use LockEvent.Descriptor instead.

func (LockEvent) Number

func (x LockEvent) Number() protoreflect.EnumNumber

func (LockEvent) String

func (x LockEvent) String() string

func (LockEvent) Type

type LockRequest

type LockRequest struct {
	Key     string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	TryLock bool   `protobuf:"varint,2,opt,name=tryLock,proto3" json:"tryLock,omitempty"`
	// contains filtered or unexported fields
}

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

func (x *LockRequest) GetTryLock() bool

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

func (*LockRequest) Validate

func (in *LockRequest) Validate() error

type LockResponse

type LockResponse struct {
	Event LockEvent `protobuf:"varint,1,opt,name=event,proto3,enum=dlock.LockEvent" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*LockResponse) Descriptor deprecated

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

Deprecated: Use LockResponse.ProtoReflect.Descriptor instead.

func (*LockResponse) GetEvent

func (x *LockResponse) GetEvent() LockEvent

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 should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedDlockServer) Lock

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.

Jump to

Keyboard shortcuts

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