pb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Capybara_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pb.Capybara",
	HandlerType: (*CapybaraServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ClaimLock",
			Handler:    _Capybara_ClaimLock_Handler,
		},
		{
			MethodName: "ReleaseLock",
			Handler:    _Capybara_ReleaseLock_Handler,
		},
		{
			MethodName: "Put",
			Handler:    _Capybara_Put_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Capybara_Delete_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Capybara_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pb/capybara.proto",
}

Capybara_ServiceDesc is the grpc.ServiceDesc for Capybara 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_pb_capybara_proto protoreflect.FileDescriptor
View Source
var File_pb_database_proto protoreflect.FileDescriptor

Functions

func RegisterCapybaraServer

func RegisterCapybaraServer(s grpc.ServiceRegistrar, srv CapybaraServer)

Types

type CapybaraClient

type CapybaraClient interface {
	// Acquires a lock
	ClaimLock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error)
	// Release a lock
	ReleaseLock(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error)
	// CRUD operations
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

CapybaraClient is the client API for Capybara 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 NewCapybaraClient

func NewCapybaraClient(cc grpc.ClientConnInterface) CapybaraClient

type CapybaraServer

type CapybaraServer interface {
	// Acquires a lock
	ClaimLock(context.Context, *LockRequest) (*LockResponse, error)
	// Release a lock
	ReleaseLock(context.Context, *ReleaseRequest) (*ReleaseResponse, error)
	// CRUD operations
	Put(context.Context, *PutRequest) (*PutResponse, error)
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// contains filtered or unexported methods
}

CapybaraServer is the server API for Capybara service. All implementations must embed UnimplementedCapybaraServer for forward compatibility

type DeleteRequest

type DeleteRequest struct {
	Buckets []string `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"`
	Key     string   `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetBuckets

func (x *DeleteRequest) GetBuckets() []string

func (*DeleteRequest) GetKey

func (x *DeleteRequest) GetKey() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type GetRequest

type GetRequest struct {
	Buckets []string `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"`
	Key     string   `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetBuckets

func (x *GetRequest) GetBuckets() []string

func (*GetRequest) GetKey

func (x *GetRequest) GetKey() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetValue

func (x *GetResponse) GetValue() []byte

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type Lock

type Lock struct {
	Owner      string                 `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	CreatedAt  *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	ValidUntil *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty"`
	// contains filtered or unexported fields
}

func (*Lock) Descriptor deprecated

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

Deprecated: Use Lock.ProtoReflect.Descriptor instead.

func (*Lock) GetCreatedAt

func (x *Lock) GetCreatedAt() *timestamppb.Timestamp

func (*Lock) GetOwner

func (x *Lock) GetOwner() string

func (*Lock) GetValidUntil

func (x *Lock) GetValidUntil() *timestamppb.Timestamp

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 LockRequest

type LockRequest struct {
	Key string               `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Who string               `protobuf:"bytes,2,opt,name=who,proto3" json:"who,omitempty"`
	TTL *durationpb.Duration `protobuf:"bytes,3,opt,name=TTL,proto3" json:"TTL,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) GetTTL

func (x *LockRequest) GetTTL() *durationpb.Duration

func (*LockRequest) GetWho

func (x *LockRequest) GetWho() string

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 {
	Acquired   bool                   `protobuf:"varint,1,opt,name=acquired,proto3" json:"acquired,omitempty"`
	Owner      string                 `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	CreatedAt  *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	ValidUntil *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty"`
	// contains filtered or unexported fields
}

func (*LockResponse) Descriptor deprecated

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

Deprecated: Use LockResponse.ProtoReflect.Descriptor instead.

func (*LockResponse) GetAcquired

func (x *LockResponse) GetAcquired() bool

func (*LockResponse) GetCreatedAt

func (x *LockResponse) GetCreatedAt() *timestamppb.Timestamp

func (*LockResponse) GetOwner

func (x *LockResponse) GetOwner() string

func (*LockResponse) GetValidUntil

func (x *LockResponse) GetValidUntil() *timestamppb.Timestamp

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 PutRequest

type PutRequest struct {
	Buckets []string `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"`
	Key     string   `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Value   []byte   `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*PutRequest) Descriptor deprecated

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

Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.

func (*PutRequest) GetBuckets

func (x *PutRequest) GetBuckets() []string

func (*PutRequest) GetKey

func (x *PutRequest) GetKey() string

func (*PutRequest) GetValue

func (x *PutRequest) GetValue() []byte

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) ProtoReflect

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

func (*PutRequest) Reset

func (x *PutRequest) Reset()

func (*PutRequest) String

func (x *PutRequest) String() string

type PutResponse

type PutResponse struct {
	// contains filtered or unexported fields
}

func (*PutResponse) Descriptor deprecated

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

Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) ProtoReflect

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

func (*PutResponse) Reset

func (x *PutResponse) Reset()

func (*PutResponse) String

func (x *PutResponse) String() string

type ReleaseRequest

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

func (*ReleaseRequest) Descriptor deprecated

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

Deprecated: Use ReleaseRequest.ProtoReflect.Descriptor instead.

func (*ReleaseRequest) GetKey

func (x *ReleaseRequest) GetKey() string

func (*ReleaseRequest) GetWho

func (x *ReleaseRequest) GetWho() string

func (*ReleaseRequest) ProtoMessage

func (*ReleaseRequest) ProtoMessage()

func (*ReleaseRequest) ProtoReflect

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

func (*ReleaseRequest) Reset

func (x *ReleaseRequest) Reset()

func (*ReleaseRequest) String

func (x *ReleaseRequest) String() string

type ReleaseResponse

type ReleaseResponse struct {
	// contains filtered or unexported fields
}

func (*ReleaseResponse) Descriptor deprecated

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

Deprecated: Use ReleaseResponse.ProtoReflect.Descriptor instead.

func (*ReleaseResponse) ProtoMessage

func (*ReleaseResponse) ProtoMessage()

func (*ReleaseResponse) ProtoReflect

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

func (*ReleaseResponse) Reset

func (x *ReleaseResponse) Reset()

func (*ReleaseResponse) String

func (x *ReleaseResponse) String() string

type UnimplementedCapybaraServer

type UnimplementedCapybaraServer struct {
}

UnimplementedCapybaraServer must be embedded to have forward compatible implementations.

func (UnimplementedCapybaraServer) ClaimLock

func (UnimplementedCapybaraServer) Delete

func (UnimplementedCapybaraServer) Get

func (UnimplementedCapybaraServer) Put

func (UnimplementedCapybaraServer) ReleaseLock

type UnsafeCapybaraServer

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

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

Jump to

Keyboard shortcuts

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