Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDisloServer(s grpc.ServiceRegistrar, srv DisloServer)
- type DisloClient
- type DisloServer
- type Errors
- type Label
- type Lock
- func (*Lock) Descriptor() ([]byte, []int)deprecated
- func (x *Lock) GetId() string
- func (x *Lock) GetLabels() []*Label
- func (x *Lock) GetNamespace() string
- func (x *Lock) GetStatus() LockStatus
- func (*Lock) ProtoMessage()
- func (x *Lock) ProtoReflect() protoreflect.Message
- func (x *Lock) Reset()
- func (x *Lock) String() string
- type LockStatus
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetClientId() string
- func (x *Request) GetCorrelationId() string
- func (x *Request) GetInstance() int32
- func (x *Request) GetLock() bool
- func (x *Request) GetLocks() []*Lock
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetCorrelationId() string
- func (x *Response) GetError() Errors
- func (x *Response) GetFailedOnLock() string
- func (x *Response) GetLocks() []*Lock
- func (x *Response) GetQueuePosition() int32
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type UnimplementedDisloServer
- func (UnimplementedDisloServer) Create(context.Context, *Request) (*Response, error)
- func (UnimplementedDisloServer) Delete(context.Context, *Request) (*Response, error)
- func (UnimplementedDisloServer) List(context.Context, *Request) (*Response, error)
- func (UnimplementedDisloServer) Lock(context.Context, *Request) (*Response, error)
- func (UnimplementedDisloServer) Status(context.Context, *Request) (*Response, error)
- func (UnimplementedDisloServer) Unlock(context.Context, *Request) (*Response, error)
- type UnsafeDisloServer
Constants ¶
const ( Dislo_Lock_FullMethodName = "/dislo.Dislo/Lock" Dislo_Unlock_FullMethodName = "/dislo.Dislo/Unlock" Dislo_Create_FullMethodName = "/dislo.Dislo/Create" Dislo_Delete_FullMethodName = "/dislo.Dislo/Delete" Dislo_Status_FullMethodName = "/dislo.Dislo/Status" Dislo_List_FullMethodName = "/dislo.Dislo/List" )
Variables ¶
var ( Errors_name = map[int32]string{ 0: "UNKNOWN_ERROR", 1: "LOCK_NOT_FOUND", 2: "LOCK_ALREADY_EXISTS", 3: "INTERNAL_SERVER_ERROR", 4: "NAMESPACE_NOT_FOUND", 5: "NO_LOCKS_PROVIDED", 6: "NO_CORRELATION_ID_PROVIDED", 7: "NO_INSTANCE_PROVIDED", 8: "INSTANCE_OUTSIDE_SERVER_RANGE", 9: "LOCK_NAMESPACE_IS_EMPTY", 10: "LOCK_ID_IS_EMPTY", 11: "CLIENT_ID_NOT_IN_UUID_FORMAT", 12: "CLIENT_ID_IS_EMPTY", 13: "INSTANCE_IS_RESERVED", } Errors_value = map[string]int32{ "UNKNOWN_ERROR": 0, "LOCK_NOT_FOUND": 1, "LOCK_ALREADY_EXISTS": 2, "INTERNAL_SERVER_ERROR": 3, "NAMESPACE_NOT_FOUND": 4, "NO_LOCKS_PROVIDED": 5, "NO_CORRELATION_ID_PROVIDED": 6, "NO_INSTANCE_PROVIDED": 7, "INSTANCE_OUTSIDE_SERVER_RANGE": 8, "LOCK_NAMESPACE_IS_EMPTY": 9, "LOCK_ID_IS_EMPTY": 10, "CLIENT_ID_NOT_IN_UUID_FORMAT": 11, "CLIENT_ID_IS_EMPTY": 12, "INSTANCE_IS_RESERVED": 13, } )
Enum value maps for Errors.
var ( LockStatus_name = map[int32]string{ 0: "UNKNOWN_STATUS", 1: "LOCKED", 2: "UNLOCKED", 3: "PENDING_DELETION", 4: "PENDING_CREATION", } LockStatus_value = map[string]int32{ "UNKNOWN_STATUS": 0, "LOCKED": 1, "UNLOCKED": 2, "PENDING_DELETION": 3, "PENDING_CREATION": 4, } )
Enum value maps for LockStatus.
var Dislo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dislo.Dislo", HandlerType: (*DisloServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Lock", Handler: _Dislo_Lock_Handler, }, { MethodName: "Unlock", Handler: _Dislo_Unlock_Handler, }, { MethodName: "Create", Handler: _Dislo_Create_Handler, }, { MethodName: "Delete", Handler: _Dislo_Delete_Handler, }, { MethodName: "Status", Handler: _Dislo_Status_Handler, }, { MethodName: "List", Handler: _Dislo_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "dislo.proto", }
Dislo_ServiceDesc is the grpc.ServiceDesc for Dislo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_dislo_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDisloServer ¶
func RegisterDisloServer(s grpc.ServiceRegistrar, srv DisloServer)
Types ¶
type DisloClient ¶
type DisloClient interface {
Lock(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
Unlock(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
Create(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
Delete(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
Status(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
List(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
DisloClient is the client API for Dislo 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 NewDisloClient ¶
func NewDisloClient(cc grpc.ClientConnInterface) DisloClient
type DisloServer ¶
type DisloServer interface {
Lock(context.Context, *Request) (*Response, error)
Unlock(context.Context, *Request) (*Response, error)
Create(context.Context, *Request) (*Response, error)
Delete(context.Context, *Request) (*Response, error)
Status(context.Context, *Request) (*Response, error)
List(context.Context, *Request) (*Response, error)
// contains filtered or unexported methods
}
DisloServer is the server API for Dislo service. All implementations must embed UnimplementedDisloServer for forward compatibility.
type Errors ¶
type Errors int32
const ( Errors_UNKNOWN_ERROR Errors = 0 Errors_LOCK_NOT_FOUND Errors = 1 Errors_LOCK_ALREADY_EXISTS Errors = 2 Errors_INTERNAL_SERVER_ERROR Errors = 3 Errors_NAMESPACE_NOT_FOUND Errors = 4 Errors_NO_LOCKS_PROVIDED Errors = 5 Errors_NO_CORRELATION_ID_PROVIDED Errors = 6 Errors_NO_INSTANCE_PROVIDED Errors = 7 Errors_INSTANCE_OUTSIDE_SERVER_RANGE Errors = 8 Errors_LOCK_NAMESPACE_IS_EMPTY Errors = 9 Errors_LOCK_ID_IS_EMPTY Errors = 10 Errors_CLIENT_ID_NOT_IN_UUID_FORMAT Errors = 11 Errors_CLIENT_ID_IS_EMPTY Errors = 12 Errors_INSTANCE_IS_RESERVED Errors = 13 )
func (Errors) Descriptor ¶
func (Errors) Descriptor() protoreflect.EnumDescriptor
func (Errors) EnumDescriptor
deprecated
func (Errors) Number ¶
func (x Errors) Number() protoreflect.EnumNumber
func (Errors) Type ¶
func (Errors) Type() protoreflect.EnumType
type Label ¶
type Label 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 (*Label) Descriptor
deprecated
func (*Label) ProtoMessage ¶
func (*Label) ProtoMessage()
func (*Label) ProtoReflect ¶
func (x *Label) ProtoReflect() protoreflect.Message
type Lock ¶
type Lock struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Status LockStatus `protobuf:"varint,2,opt,name=status,proto3,enum=dislo.LockStatus" json:"status,omitempty"`
Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"`
Labels []*Label `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"`
// contains filtered or unexported fields
}
func (*Lock) Descriptor
deprecated
func (*Lock) GetNamespace ¶
func (*Lock) GetStatus ¶
func (x *Lock) GetStatus() LockStatus
func (*Lock) ProtoMessage ¶
func (*Lock) ProtoMessage()
func (*Lock) ProtoReflect ¶
func (x *Lock) ProtoReflect() protoreflect.Message
type LockStatus ¶
type LockStatus int32
const ( LockStatus_UNKNOWN_STATUS LockStatus = 0 LockStatus_LOCKED LockStatus = 1 LockStatus_UNLOCKED LockStatus = 2 LockStatus_PENDING_DELETION LockStatus = 3 LockStatus_PENDING_CREATION LockStatus = 4 )
func (LockStatus) Descriptor ¶
func (LockStatus) Descriptor() protoreflect.EnumDescriptor
func (LockStatus) Enum ¶
func (x LockStatus) Enum() *LockStatus
func (LockStatus) EnumDescriptor
deprecated
func (LockStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use LockStatus.Descriptor instead.
func (LockStatus) Number ¶
func (x LockStatus) Number() protoreflect.EnumNumber
func (LockStatus) String ¶
func (x LockStatus) String() string
func (LockStatus) Type ¶
func (LockStatus) Type() protoreflect.EnumType
type Request ¶
type Request struct {
Locks []*Lock `protobuf:"bytes,1,rep,name=locks,proto3" json:"locks,omitempty"` // List of locks to be processed
Lock bool `protobuf:"varint,2,opt,name=lock,proto3" json:"lock,omitempty"` // To lock or unlock
Instance int32 `protobuf:"varint,3,opt,name=instance,proto3" json:"instance,omitempty"` // Instance within Dislo (0-9; Default: 0)
CorrelationId string `protobuf:"bytes,4,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"` // Correlation ID for tracking
ClientId string `protobuf:"bytes,5,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // Client ID for tracking
// contains filtered or unexported fields
}
func (*Request) Descriptor
deprecated
func (*Request) GetClientId ¶
func (*Request) GetCorrelationId ¶
func (*Request) GetInstance ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct {
Error Errors `protobuf:"varint,1,opt,name=error,proto3,enum=dislo.Errors" json:"error,omitempty"` // Error code
Locks []*Lock `protobuf:"bytes,2,rep,name=locks,proto3" json:"locks,omitempty"` // List of locks returned
QueuePosition int32 `protobuf:"varint,3,opt,name=queue_position,json=queuePosition,proto3" json:"queue_position,omitempty"` // Position in the queue for the lock
CorrelationId string `protobuf:"bytes,4,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"` // Correlation ID for tracking
FailedOnLock string `protobuf:"bytes,5,opt,name=failed_on_lock,json=failedOnLock,proto3" json:"failed_on_lock,omitempty"` // Lock that failed the request
// contains filtered or unexported fields
}
func (*Response) Descriptor
deprecated
func (*Response) GetCorrelationId ¶
func (*Response) GetFailedOnLock ¶
func (*Response) GetQueuePosition ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedDisloServer ¶
type UnimplementedDisloServer struct{}
UnimplementedDisloServer must 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.
type UnsafeDisloServer ¶
type UnsafeDisloServer interface {
// contains filtered or unexported methods
}
UnsafeDisloServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DisloServer will result in compilation errors.