dislo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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.

View Source
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.

View Source
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)

View Source
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) Enum

func (x Errors) Enum() *Errors

func (Errors) EnumDescriptor deprecated

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

Deprecated: Use Errors.Descriptor instead.

func (Errors) Number

func (x Errors) Number() protoreflect.EnumNumber

func (Errors) String

func (x Errors) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Label.ProtoReflect.Descriptor instead.

func (*Label) GetKey

func (x *Label) GetKey() string

func (*Label) GetValue

func (x *Label) GetValue() string

func (*Label) ProtoMessage

func (*Label) ProtoMessage()

func (*Label) ProtoReflect

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

func (*Label) Reset

func (x *Label) Reset()

func (*Label) String

func (x *Label) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Lock.ProtoReflect.Descriptor instead.

func (*Lock) GetId

func (x *Lock) GetId() string

func (*Lock) GetLabels

func (x *Lock) GetLabels() []*Label

func (*Lock) GetNamespace

func (x *Lock) GetNamespace() string

func (*Lock) GetStatus

func (x *Lock) GetStatus() LockStatus

func (*Lock) ProtoMessage

func (*Lock) ProtoMessage()

func (*Lock) ProtoReflect

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

func (*Lock) Reset

func (x *Lock) Reset()

func (*Lock) String

func (x *Lock) String() string

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetClientId

func (x *Request) GetClientId() string

func (*Request) GetCorrelationId

func (x *Request) GetCorrelationId() string

func (*Request) GetInstance

func (x *Request) GetInstance() int32

func (*Request) GetLock

func (x *Request) GetLock() bool

func (*Request) GetLocks

func (x *Request) GetLocks() []*Lock

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetCorrelationId

func (x *Response) GetCorrelationId() string

func (*Response) GetError

func (x *Response) GetError() Errors

func (*Response) GetFailedOnLock

func (x *Response) GetFailedOnLock() string

func (*Response) GetLocks

func (x *Response) GetLocks() []*Lock

func (*Response) GetQueuePosition

func (x *Response) GetQueuePosition() int32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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.

func (UnimplementedDisloServer) Create

func (UnimplementedDisloServer) Delete

func (UnimplementedDisloServer) List

func (UnimplementedDisloServer) Lock

func (UnimplementedDisloServer) Status

func (UnimplementedDisloServer) Unlock

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.

Jump to

Keyboard shortcuts

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