v1

package
v0.0.0-...-3918530 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_v1_juno_proto protoreflect.FileDescriptor
View Source
var Juno_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "juno.proto.v1.Juno",
	HandlerType: (*JunoServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddToSet",
			Handler:    _Juno_AddToSet_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Lock",
			Handler:       _Juno_Lock_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proto/v1/juno.proto",
}

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

Functions

func RegisterJunoServer

func RegisterJunoServer(s grpc.ServiceRegistrar, srv JunoServer)

Types

type AddToSetRequest

type AddToSetRequest struct {

	// Required. The key of the set.
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Required. The value to add to the set specified in `key`.
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Jupiter.AddToSet rpc.

func (*AddToSetRequest) Descriptor deprecated

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

Deprecated: Use AddToSetRequest.ProtoReflect.Descriptor instead.

func (*AddToSetRequest) GetKey

func (x *AddToSetRequest) GetKey() string

func (*AddToSetRequest) GetValue

func (x *AddToSetRequest) GetValue() string

func (*AddToSetRequest) ProtoMessage

func (*AddToSetRequest) ProtoMessage()

func (*AddToSetRequest) ProtoReflect

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

func (*AddToSetRequest) Reset

func (x *AddToSetRequest) Reset()

func (*AddToSetRequest) String

func (x *AddToSetRequest) String() string

type AddToSetResponse

type AddToSetResponse struct {

	// The updated key.
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The number of items within the set after add.
	Count int64 `protobuf:"zigzag64,2,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Jupiter.AddToSet rpc.

func (*AddToSetResponse) Descriptor deprecated

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

Deprecated: Use AddToSetResponse.ProtoReflect.Descriptor instead.

func (*AddToSetResponse) GetCount

func (x *AddToSetResponse) GetCount() int64

func (*AddToSetResponse) GetKey

func (x *AddToSetResponse) GetKey() string

func (*AddToSetResponse) ProtoMessage

func (*AddToSetResponse) ProtoMessage()

func (*AddToSetResponse) ProtoReflect

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

func (*AddToSetResponse) Reset

func (x *AddToSetResponse) Reset()

func (*AddToSetResponse) String

func (x *AddToSetResponse) String() string

type JunoClient

type JunoClient interface {
	// Attempt to acquire a named lock.
	Lock(ctx context.Context, opts ...grpc.CallOption) (Juno_LockClient, error)
	// Add an item to a set.
	AddToSet(ctx context.Context, in *AddToSetRequest, opts ...grpc.CallOption) (*AddToSetResponse, error)
}

JunoClient is the client API for Juno 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 NewJunoClient

func NewJunoClient(cc grpc.ClientConnInterface) JunoClient

type JunoServer

type JunoServer interface {
	// Attempt to acquire a named lock.
	Lock(Juno_LockServer) error
	// Add an item to a set.
	AddToSet(context.Context, *AddToSetRequest) (*AddToSetResponse, error)
	// contains filtered or unexported methods
}

JunoServer is the server API for Juno service. All implementations must embed UnimplementedJunoServer for forward compatibility

type Juno_LockClient

type Juno_LockClient interface {
	Send(*LockRequest) error
	Recv() (*LockResponse, error)
	grpc.ClientStream
}

type Juno_LockServer

type Juno_LockServer interface {
	Send(*LockResponse) error
	Recv() (*LockRequest, error)
	grpc.ServerStream
}

type LockRequest

type LockRequest struct {

	// Required during the initial call. The name of the lock.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional. Lease time in seconds. Default is 30s. Minimum is 5s.
	LeaseTime int64 `protobuf:"varint,2,opt,name=leaseTime,proto3" json:"leaseTime,omitempty"`
	// Optional. Set to true if you want to release the lock before its expiration period. Prioritized over `extend` when both are set to true.
	Release bool `protobuf:"varint,3,opt,name=release,proto3" json:"release,omitempty"`
	// Optional. Set to true if you want to extend the leased lock.
	Extend bool `protobuf:"varint,4,opt,name=extend,proto3" json:"extend,omitempty"`
	// Optional. Must be set to the received token (when the lock was acquired) when either `extend` or `release` is true.
	Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
	// Optional. If true, the API will block until the requested lock is released or has expired, giving the chance to attempt to reacquire the lock.
	WaitOnFail bool `protobuf:"varint,6,opt,name=waitOnFail,proto3" json:"waitOnFail,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Jupiter.Lock rpc.

func (*LockRequest) Descriptor deprecated

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

Deprecated: Use LockRequest.ProtoReflect.Descriptor instead.

func (*LockRequest) GetExtend

func (x *LockRequest) GetExtend() bool

func (*LockRequest) GetLeaseTime

func (x *LockRequest) GetLeaseTime() int64

func (*LockRequest) GetName

func (x *LockRequest) GetName() string

func (*LockRequest) GetRelease

func (x *LockRequest) GetRelease() bool

func (*LockRequest) GetToken

func (x *LockRequest) GetToken() string

func (*LockRequest) GetWaitOnFail

func (x *LockRequest) GetWaitOnFail() 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

type LockResponse

type LockResponse struct {

	// The lock name used in the request payload.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The lock token. Needed when extending the lock lease.
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// A general progress/activity indicator.
	Heartbeat int64 `protobuf:"varint,3,opt,name=heartbeat,proto3" json:"heartbeat,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Jupiter.Lock rpc.

func (*LockResponse) Descriptor deprecated

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

Deprecated: Use LockResponse.ProtoReflect.Descriptor instead.

func (*LockResponse) GetHeartbeat

func (x *LockResponse) GetHeartbeat() int64

func (*LockResponse) GetName

func (x *LockResponse) GetName() string

func (*LockResponse) GetToken

func (x *LockResponse) GetToken() 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 UnimplementedJunoServer

type UnimplementedJunoServer struct {
}

UnimplementedJunoServer must be embedded to have forward compatible implementations.

func (UnimplementedJunoServer) AddToSet

func (UnimplementedJunoServer) Lock

type UnsafeJunoServer

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

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

Jump to

Keyboard shortcuts

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