Documentation ¶
Index ¶
- Variables
- func RegisterQueuedServer(s grpc.ServiceRegistrar, srv QueuedServer)
- func ToBytes(c *Content) ([]byte, error)
- func ToBytesAndString(cq *ContentAndQueueName) ([]byte, string, error)
- func ToID(id *ID) (driver.ID, error)
- func ToIDBytesAndTime(m *Message) (driver.ID, []byte, time.Time, error)
- func ToInt(ql *QueueLength) (int, error)
- func ToString(qn *QueueName) (string, error)
- func ToTime(et *ExpiryTime) (time.Time, error)
- type Content
- type ContentAndQueueName
- func (*ContentAndQueueName) Descriptor() ([]byte, []int)deprecated
- func (x *ContentAndQueueName) GetContent() *Content
- func (x *ContentAndQueueName) GetName() *QueueName
- func (*ContentAndQueueName) ProtoMessage()
- func (x *ContentAndQueueName) ProtoReflect() protoreflect.Message
- func (x *ContentAndQueueName) Reset()
- func (x *ContentAndQueueName) String() string
- type ExpiryTime
- type ID
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetContent() *Content
- func (x *Message) GetExpiry() *ExpiryTime
- func (x *Message) GetId() *ID
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type QueueLength
- type QueueName
- type QueuedClient
- type QueuedServer
- type UnimplementedQueuedServer
- func (UnimplementedQueuedServer) Acknowledge(context.Context, *ID) (*emptypb.Empty, error)
- func (UnimplementedQueuedServer) Delete(context.Context, *QueueName) (*emptypb.Empty, error)
- func (UnimplementedQueuedServer) Get(context.Context, *QueueName) (*Message, error)
- func (UnimplementedQueuedServer) Len(context.Context, *QueueName) (*QueueLength, error)
- func (UnimplementedQueuedServer) Put(context.Context, *ContentAndQueueName) (*emptypb.Empty, error)
- func (UnimplementedQueuedServer) Refresh(context.Context, *ID) (*ExpiryTime, error)
- func (UnimplementedQueuedServer) Requeue(context.Context, *ID) (*emptypb.Empty, error)
- type UnsafeQueuedServer
Constants ¶
This section is empty.
Variables ¶
var File_queue_proto protoreflect.FileDescriptor
var Queued_ServiceDesc = grpc.ServiceDesc{ ServiceName: "queuerpc.Queued", HandlerType: (*QueuedServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Delete", Handler: _Queued_Delete_Handler, }, { MethodName: "Len", Handler: _Queued_Len_Handler, }, { MethodName: "Get", Handler: _Queued_Get_Handler, }, { MethodName: "Put", Handler: _Queued_Put_Handler, }, { MethodName: "Refresh", Handler: _Queued_Refresh_Handler, }, { MethodName: "Acknowledge", Handler: _Queued_Acknowledge_Handler, }, { MethodName: "Requeue", Handler: _Queued_Requeue_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "queue.proto", }
Queued_ServiceDesc is the grpc.ServiceDesc for Queued service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterQueuedServer ¶
func RegisterQueuedServer(s grpc.ServiceRegistrar, srv QueuedServer)
func ToBytesAndString ¶
func ToBytesAndString(cq *ContentAndQueueName) ([]byte, string, error)
ToBytesAndString converts a *ContentAndQueueName to a slice of bytes and a string.
func ToIDBytesAndTime ¶
ToIDBytesAndTime converts a *Message to a driver.ID, a slice of bytes, and a time.Time.
Types ¶
type Content ¶
type Content struct { Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
Content represents the content of a message.
func (*Content) Descriptor
deprecated
func (*Content) GetContent ¶
func (*Content) ProtoMessage ¶
func (*Content) ProtoMessage()
func (*Content) ProtoReflect ¶
func (x *Content) ProtoReflect() protoreflect.Message
type ContentAndQueueName ¶
type ContentAndQueueName struct { Content *Content `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` Name *QueueName `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
ContentAndQueueName represents message content plus the name of a queue.
func FromBytesAndString ¶
func FromBytesAndString(b []byte, name string) *ContentAndQueueName
FromBytesAndString converts a slice of bytes and a string to a *ContentAndQueueName.
func (*ContentAndQueueName) Descriptor
deprecated
func (*ContentAndQueueName) Descriptor() ([]byte, []int)
Deprecated: Use ContentAndQueueName.ProtoReflect.Descriptor instead.
func (*ContentAndQueueName) GetContent ¶
func (x *ContentAndQueueName) GetContent() *Content
func (*ContentAndQueueName) GetName ¶
func (x *ContentAndQueueName) GetName() *QueueName
func (*ContentAndQueueName) ProtoMessage ¶
func (*ContentAndQueueName) ProtoMessage()
func (*ContentAndQueueName) ProtoReflect ¶
func (x *ContentAndQueueName) ProtoReflect() protoreflect.Message
func (*ContentAndQueueName) Reset ¶
func (x *ContentAndQueueName) Reset()
func (*ContentAndQueueName) String ¶
func (x *ContentAndQueueName) String() string
type ExpiryTime ¶
type ExpiryTime struct { Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` // contains filtered or unexported fields }
ExpiryTime represents the time by which a message much be acknowledged, requeued, or refreshed.
func FromTime ¶
func FromTime(t time.Time) *ExpiryTime
FromTime converts a time.Time to a *ExpiryTime.
func (*ExpiryTime) Descriptor
deprecated
func (*ExpiryTime) Descriptor() ([]byte, []int)
Deprecated: Use ExpiryTime.ProtoReflect.Descriptor instead.
func (*ExpiryTime) GetTime ¶
func (x *ExpiryTime) GetTime() *timestamppb.Timestamp
func (*ExpiryTime) ProtoMessage ¶
func (*ExpiryTime) ProtoMessage()
func (*ExpiryTime) ProtoReflect ¶
func (x *ExpiryTime) ProtoReflect() protoreflect.Message
func (*ExpiryTime) Reset ¶
func (x *ExpiryTime) Reset()
func (*ExpiryTime) String ¶
func (x *ExpiryTime) String() string
type ID ¶
type ID struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
ID represents a unique ID for a message.
func (*ID) Descriptor
deprecated
func (*ID) ProtoMessage ¶
func (*ID) ProtoMessage()
func (*ID) ProtoReflect ¶
func (x *ID) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct { Content *Content `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // The message content Id *ID `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // The message ID Expiry *ExpiryTime `protobuf:"bytes,3,opt,name=expiry,proto3" json:"expiry,omitempty"` // The expiry time // contains filtered or unexported fields }
Message represents a message.
func FromIDBytesAndTime ¶
FromIDBytesAndTime converts an ID, a slice of bytes, and an expiry time to a *Message.
func (*Message) Descriptor
deprecated
func (*Message) GetContent ¶
func (*Message) GetExpiry ¶
func (x *Message) GetExpiry() *ExpiryTime
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type QueueLength ¶
type QueueLength struct { Len int64 `protobuf:"varint,1,opt,name=len,proto3" json:"len,omitempty"` // contains filtered or unexported fields }
QueueLength represents the length of a queue.
func (*QueueLength) Descriptor
deprecated
func (*QueueLength) Descriptor() ([]byte, []int)
Deprecated: Use QueueLength.ProtoReflect.Descriptor instead.
func (*QueueLength) GetLen ¶
func (x *QueueLength) GetLen() int64
func (*QueueLength) ProtoMessage ¶
func (*QueueLength) ProtoMessage()
func (*QueueLength) ProtoReflect ¶
func (x *QueueLength) ProtoReflect() protoreflect.Message
func (*QueueLength) Reset ¶
func (x *QueueLength) Reset()
func (*QueueLength) String ¶
func (x *QueueLength) String() string
type QueueName ¶
type QueueName struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
QueueName represents the name of a queue.
func FromString ¶
FromString converts a string to a *QueueName.
func (*QueueName) Descriptor
deprecated
func (*QueueName) ProtoMessage ¶
func (*QueueName) ProtoMessage()
func (*QueueName) ProtoReflect ¶
func (x *QueueName) ProtoReflect() protoreflect.Message
type QueuedClient ¶
type QueuedClient interface { // Delete deletes the queue with the given name. Delete(ctx context.Context, in *QueueName, opts ...grpc.CallOption) (*emptypb.Empty, error) // Len returns the number of messages in the queue with the given name that are not awaiting acknowledgement. Len(ctx context.Context, in *QueueName, opts ...grpc.CallOption) (*QueueLength, error) // Get returns the next message from the queue with the given name. The message will, eventually, be automatically requeued if it is not acknowledged. Get(ctx context.Context, in *QueueName, opts ...grpc.CallOption) (*Message, error) // Put places a message with the given content on the queue with the given name. Put(ctx context.Context, in *ContentAndQueueName, opts ...grpc.CallOption) (*emptypb.Empty, error) // Refresh gets a new expiry time for the message with the given ID. Refresh(ctx context.Context, in *ID, opts ...grpc.CallOption) (*ExpiryTime, error) // Acknowledge removes the message with the given ID from its queue. Acknowledge(ctx context.Context, in *ID, opts ...grpc.CallOption) (*emptypb.Empty, error) // Requeue requeues the message with the given ID. Requeue(ctx context.Context, in *ID, opts ...grpc.CallOption) (*emptypb.Empty, error) }
QueuedClient is the client API for Queued 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 NewQueuedClient ¶
func NewQueuedClient(cc grpc.ClientConnInterface) QueuedClient
type QueuedServer ¶
type QueuedServer interface { // Delete deletes the queue with the given name. Delete(context.Context, *QueueName) (*emptypb.Empty, error) // Len returns the number of messages in the queue with the given name that are not awaiting acknowledgement. Len(context.Context, *QueueName) (*QueueLength, error) // Get returns the next message from the queue with the given name. The message will, eventually, be automatically requeued if it is not acknowledged. Get(context.Context, *QueueName) (*Message, error) // Put places a message with the given content on the queue with the given name. Put(context.Context, *ContentAndQueueName) (*emptypb.Empty, error) // Refresh gets a new expiry time for the message with the given ID. Refresh(context.Context, *ID) (*ExpiryTime, error) // Acknowledge removes the message with the given ID from its queue. Acknowledge(context.Context, *ID) (*emptypb.Empty, error) // Requeue requeues the message with the given ID. Requeue(context.Context, *ID) (*emptypb.Empty, error) // contains filtered or unexported methods }
QueuedServer is the server API for Queued service. All implementations must embed UnimplementedQueuedServer for forward compatibility
type UnimplementedQueuedServer ¶
type UnimplementedQueuedServer struct { }
UnimplementedQueuedServer must be embedded to have forward compatible implementations.
func (UnimplementedQueuedServer) Acknowledge ¶
func (UnimplementedQueuedServer) Len ¶
func (UnimplementedQueuedServer) Len(context.Context, *QueueName) (*QueueLength, error)
func (UnimplementedQueuedServer) Put ¶
func (UnimplementedQueuedServer) Put(context.Context, *ContentAndQueueName) (*emptypb.Empty, error)
func (UnimplementedQueuedServer) Refresh ¶
func (UnimplementedQueuedServer) Refresh(context.Context, *ID) (*ExpiryTime, error)
type UnsafeQueuedServer ¶
type UnsafeQueuedServer interface {
// contains filtered or unexported methods
}
UnsafeQueuedServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to QueuedServer will result in compilation errors.