Documentation ¶
Index ¶
- Variables
- func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)
- func RegisterQueueServer(s grpc.ServiceRegistrar, srv QueueServer)
- type Ack
- type AddClusterMemberRequest
- func (*AddClusterMemberRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddClusterMemberRequest) GetMemberAddress() string
- func (x *AddClusterMemberRequest) GetMemberId() string
- func (*AddClusterMemberRequest) ProtoMessage()
- func (x *AddClusterMemberRequest) ProtoReflect() protoreflect.Message
- func (x *AddClusterMemberRequest) Reset()
- func (x *AddClusterMemberRequest) String() string
- type AdminClient
- type AdminServer
- type CheckHealthRequest
- func (*CheckHealthRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckHealthRequest) GetRequestId() string
- func (*CheckHealthRequest) ProtoMessage()
- func (x *CheckHealthRequest) ProtoReflect() protoreflect.Message
- func (x *CheckHealthRequest) Reset()
- func (x *CheckHealthRequest) String() string
- type ClusterInfo
- func (*ClusterInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ClusterInfo) GetLeaderId() string
- func (x *ClusterInfo) GetMembers() []*Server
- func (x *ClusterInfo) GetServerId() string
- func (*ClusterInfo) ProtoMessage()
- func (x *ClusterInfo) ProtoReflect() protoreflect.Message
- func (x *ClusterInfo) Reset()
- func (x *ClusterInfo) String() string
- type Command
- func (*Command) Descriptor() ([]byte, []int)deprecated
- func (x *Command) GetAck() *Ack
- func (m *Command) GetCmd() isCommand_Cmd
- func (x *Command) GetQueue() *QueueConfig
- func (x *Command) GetTask() *Task
- func (*Command) ProtoMessage()
- func (x *Command) ProtoReflect() protoreflect.Message
- func (x *Command) Reset()
- func (x *Command) String() string
- type Command_Ack
- type Command_Queue
- type Command_Task
- type DeleteTaskRequest
- func (*DeleteTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteTaskRequest) GetAsync() bool
- func (x *DeleteTaskRequest) GetReference() *TaskReference
- func (x *DeleteTaskRequest) GetRequestId() string
- func (*DeleteTaskRequest) ProtoMessage()
- func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteTaskRequest) Reset()
- func (x *DeleteTaskRequest) String() string
- type DeleteTaskResponse
- func (*DeleteTaskResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteTaskResponse) GetForwardedTo() string
- func (*DeleteTaskResponse) ProtoMessage()
- func (x *DeleteTaskResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteTaskResponse) Reset()
- func (x *DeleteTaskResponse) String() string
- type GetClusterInfoRequest
- func (*GetClusterInfoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetClusterInfoRequest) GetRequestId() string
- func (*GetClusterInfoRequest) ProtoMessage()
- func (x *GetClusterInfoRequest) ProtoReflect() protoreflect.Message
- func (x *GetClusterInfoRequest) Reset()
- func (x *GetClusterInfoRequest) String() string
- type GetQueueRequest
- func (*GetQueueRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetQueueRequest) GetQueue() string
- func (x *GetQueueRequest) GetRequestId() string
- func (*GetQueueRequest) ProtoMessage()
- func (x *GetQueueRequest) ProtoReflect() protoreflect.Message
- func (x *GetQueueRequest) Reset()
- func (x *GetQueueRequest) String() string
- type GetTaskRequest
- func (*GetTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTaskRequest) GetReference() *TaskReference
- func (x *GetTaskRequest) GetRequestId() string
- func (*GetTaskRequest) ProtoMessage()
- func (x *GetTaskRequest) ProtoReflect() protoreflect.Message
- func (x *GetTaskRequest) Reset()
- func (x *GetTaskRequest) String() string
- type PushStreamResponse
- func (*PushStreamResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PushStreamResponse) GetForwardedTo() string
- func (x *PushStreamResponse) GetMessage() string
- func (x *PushStreamResponse) GetStatus() uint32
- func (x *PushStreamResponse) GetTask() *Task
- func (*PushStreamResponse) ProtoMessage()
- func (x *PushStreamResponse) ProtoReflect() protoreflect.Message
- func (x *PushStreamResponse) Reset()
- func (x *PushStreamResponse) String() string
- type PushTaskRequest
- func (*PushTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PushTaskRequest) GetAsync() bool
- func (x *PushTaskRequest) GetMetadata() map[string]string
- func (x *PushTaskRequest) GetPayload() []byte
- func (x *PushTaskRequest) GetQueue() string
- func (x *PushTaskRequest) GetRequestId() string
- func (m *PushTaskRequest) GetSchedule() isPushTaskRequest_Schedule
- func (x *PushTaskRequest) GetScheduleTime() *timestamppb.Timestamp
- func (x *PushTaskRequest) GetTtsSeconds() int64
- func (*PushTaskRequest) ProtoMessage()
- func (x *PushTaskRequest) ProtoReflect() protoreflect.Message
- func (x *PushTaskRequest) Reset()
- func (x *PushTaskRequest) String() string
- type PushTaskRequest_ScheduleTime
- type PushTaskRequest_TtsSeconds
- type PushTaskResponse
- func (*PushTaskResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PushTaskResponse) GetForwardedTo() string
- func (x *PushTaskResponse) GetTask() *Task
- func (*PushTaskResponse) ProtoMessage()
- func (x *PushTaskResponse) ProtoReflect() protoreflect.Message
- func (x *PushTaskResponse) Reset()
- func (x *PushTaskResponse) String() string
- type QueueClient
- type QueueConfig
- func (*QueueConfig) Descriptor() ([]byte, []int)deprecated
- func (x *QueueConfig) GetAckDeadlineSeconds() int32
- func (x *QueueConfig) GetId() string
- func (x *QueueConfig) GetLastDeliveredQueuedTask() string
- func (x *QueueConfig) GetLastDeliveredScheduledTask() string
- func (*QueueConfig) ProtoMessage()
- func (x *QueueConfig) ProtoReflect() protoreflect.Message
- func (x *QueueConfig) Reset()
- func (x *QueueConfig) String() string
- type QueueServer
- type Queue_PullClient
- type Queue_PullServer
- type Queue_PushStreamClient
- type Queue_PushStreamServer
- type RemoveClusterMemberRequest
- func (*RemoveClusterMemberRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RemoveClusterMemberRequest) GetMemberId() string
- func (*RemoveClusterMemberRequest) ProtoMessage()
- func (x *RemoveClusterMemberRequest) ProtoReflect() protoreflect.Message
- func (x *RemoveClusterMemberRequest) Reset()
- func (x *RemoveClusterMemberRequest) String() string
- type Server
- func (*Server) Descriptor() ([]byte, []int)deprecated
- func (x *Server) GetHost() string
- func (x *Server) GetId() string
- func (x *Server) GetQueuePort() int32
- func (x *Server) GetRaftPort() int32
- func (x *Server) GetSqlPort() int32
- func (*Server) ProtoMessage()
- func (x *Server) ProtoReflect() protoreflect.Message
- func (x *Server) Reset()
- func (x *Server) String() string
- type Status
- type Task
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetCreatedAt() *timestamppb.Timestamp
- func (x *Task) GetId() string
- func (x *Task) GetLastRetry() *timestamppb.Timestamp
- func (x *Task) GetMetadata() map[string]string
- func (x *Task) GetPayload() []byte
- func (x *Task) GetQueue() string
- func (x *Task) GetScheduleTime() *timestamppb.Timestamp
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- type TaskReference
- func (*TaskReference) Descriptor() ([]byte, []int)deprecated
- func (x *TaskReference) GetQueue() string
- func (x *TaskReference) GetTaskId() string
- func (*TaskReference) ProtoMessage()
- func (x *TaskReference) ProtoReflect() protoreflect.Message
- func (x *TaskReference) Reset()
- func (x *TaskReference) String() string
- type UnimplementedAdminServer
- func (UnimplementedAdminServer) AddClusterMember(context.Context, *AddClusterMemberRequest) (*emptypb.Empty, error)
- func (UnimplementedAdminServer) BootstrapCluster(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (UnimplementedAdminServer) CheckHealth(context.Context, *CheckHealthRequest) (*Status, error)
- func (UnimplementedAdminServer) GetClusterInfo(context.Context, *GetClusterInfoRequest) (*ClusterInfo, error)
- func (UnimplementedAdminServer) GetQueue(context.Context, *GetQueueRequest) (*QueueConfig, error)
- func (UnimplementedAdminServer) RemoveClusterMember(context.Context, *RemoveClusterMemberRequest) (*emptypb.Empty, error)
- func (UnimplementedAdminServer) UpdateQueue(context.Context, *UpdateQueueRequest) (*QueueConfig, error)
- type UnimplementedQueueServer
- func (UnimplementedQueueServer) Delete(context.Context, *DeleteTaskRequest) (*DeleteTaskResponse, error)
- func (UnimplementedQueueServer) Get(context.Context, *GetTaskRequest) (*Task, error)
- func (UnimplementedQueueServer) Pull(Queue_PullServer) error
- func (UnimplementedQueueServer) Push(context.Context, *PushTaskRequest) (*PushTaskResponse, error)
- func (UnimplementedQueueServer) PushStream(Queue_PushStreamServer) error
- type UnsafeAdminServer
- type UnsafeQueueServer
- type UpdateQueueRequest
- func (*UpdateQueueRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateQueueRequest) GetQueue() *QueueConfig
- func (x *UpdateQueueRequest) GetRequestId() string
- func (*UpdateQueueRequest) ProtoMessage()
- func (x *UpdateQueueRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateQueueRequest) Reset()
- func (x *UpdateQueueRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var Admin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "z4.Admin", HandlerType: (*AdminServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CheckHealth", Handler: _Admin_CheckHealth_Handler, }, { MethodName: "GetQueue", Handler: _Admin_GetQueue_Handler, }, { MethodName: "UpdateQueue", Handler: _Admin_UpdateQueue_Handler, }, { MethodName: "GetClusterInfo", Handler: _Admin_GetClusterInfo_Handler, }, { MethodName: "AddClusterMember", Handler: _Admin_AddClusterMember_Handler, }, { MethodName: "RemoveClusterMember", Handler: _Admin_RemoveClusterMember_Handler, }, { MethodName: "BootstrapCluster", Handler: _Admin_BootstrapCluster_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "admin_service.proto", }
Admin_ServiceDesc is the grpc.ServiceDesc for Admin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_admin_service_proto protoreflect.FileDescriptor
var File_model_proto protoreflect.FileDescriptor
var File_queue_service_proto protoreflect.FileDescriptor
var Queue_ServiceDesc = grpc.ServiceDesc{ ServiceName: "z4.Queue", HandlerType: (*QueueServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Push", Handler: _Queue_Push_Handler, }, { MethodName: "Get", Handler: _Queue_Get_Handler, }, { MethodName: "Delete", Handler: _Queue_Delete_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "PushStream", Handler: _Queue_PushStream_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Pull", Handler: _Queue_Pull_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "queue_service.proto", }
Queue_ServiceDesc is the grpc.ServiceDesc for Queue service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterAdminServer ¶
func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)
func RegisterQueueServer ¶
func RegisterQueueServer(s grpc.ServiceRegistrar, srv QueueServer)
Types ¶
type Ack ¶
type Ack struct { Reference *TaskReference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` // contains filtered or unexported fields }
func (*Ack) Descriptor
deprecated
func (*Ack) GetReference ¶ added in v0.2.0
func (x *Ack) GetReference() *TaskReference
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶
func (x *Ack) ProtoReflect() protoreflect.Message
type AddClusterMemberRequest ¶
type AddClusterMemberRequest struct { // The host:port of the peer's Raft server. MemberAddress string `protobuf:"bytes,1,opt,name=member_address,json=memberAddress,proto3" json:"member_address,omitempty"` // The unique id of the peer. MemberId string `protobuf:"bytes,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` // contains filtered or unexported fields }
func (*AddClusterMemberRequest) Descriptor
deprecated
func (*AddClusterMemberRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddClusterMemberRequest.ProtoReflect.Descriptor instead.
func (*AddClusterMemberRequest) GetMemberAddress ¶
func (x *AddClusterMemberRequest) GetMemberAddress() string
func (*AddClusterMemberRequest) GetMemberId ¶
func (x *AddClusterMemberRequest) GetMemberId() string
func (*AddClusterMemberRequest) ProtoMessage ¶
func (*AddClusterMemberRequest) ProtoMessage()
func (*AddClusterMemberRequest) ProtoReflect ¶
func (x *AddClusterMemberRequest) ProtoReflect() protoreflect.Message
func (*AddClusterMemberRequest) Reset ¶
func (x *AddClusterMemberRequest) Reset()
func (*AddClusterMemberRequest) String ¶
func (x *AddClusterMemberRequest) String() string
type AdminClient ¶
type AdminClient interface { // CheckHealth determines whether the service is in a healthy state. CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*Status, error) // GetQueue gets settings for a task queue. GetQueue(ctx context.Context, in *GetQueueRequest, opts ...grpc.CallOption) (*QueueConfig, error) // UpdateQueue updates the settings of a task queue. UpdateQueue(ctx context.Context, in *UpdateQueueRequest, opts ...grpc.CallOption) (*QueueConfig, error) // GetClusterInfo returns information about the structure of the Raft cluster. GetClusterInfo(ctx context.Context, in *GetClusterInfoRequest, opts ...grpc.CallOption) (*ClusterInfo, error) // AddClusterMember adds a peer to the Raft cluster. // // This rpc should be called on the leader but can be invoked on any peer that // is connected to the leader. AddClusterMember(ctx context.Context, in *AddClusterMemberRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // RemoveClusterMember removes a peer from the Raft cluster. // // This rpc should be called on the leader but can be invoked on any peer that // is connected to the leader. RemoveClusterMember(ctx context.Context, in *RemoveClusterMemberRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) BootstrapCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) }
AdminClient is the client API for Admin 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 NewAdminClient ¶
func NewAdminClient(cc grpc.ClientConnInterface) AdminClient
type AdminServer ¶
type AdminServer interface { // CheckHealth determines whether the service is in a healthy state. CheckHealth(context.Context, *CheckHealthRequest) (*Status, error) // GetQueue gets settings for a task queue. GetQueue(context.Context, *GetQueueRequest) (*QueueConfig, error) // UpdateQueue updates the settings of a task queue. UpdateQueue(context.Context, *UpdateQueueRequest) (*QueueConfig, error) // GetClusterInfo returns information about the structure of the Raft cluster. GetClusterInfo(context.Context, *GetClusterInfoRequest) (*ClusterInfo, error) // AddClusterMember adds a peer to the Raft cluster. // // This rpc should be called on the leader but can be invoked on any peer that // is connected to the leader. AddClusterMember(context.Context, *AddClusterMemberRequest) (*emptypb.Empty, error) // RemoveClusterMember removes a peer from the Raft cluster. // // This rpc should be called on the leader but can be invoked on any peer that // is connected to the leader. RemoveClusterMember(context.Context, *RemoveClusterMemberRequest) (*emptypb.Empty, error) BootstrapCluster(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // contains filtered or unexported methods }
AdminServer is the server API for Admin service. All implementations must embed UnimplementedAdminServer for forward compatibility
type CheckHealthRequest ¶
type CheckHealthRequest struct { // A unique id for the request. RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // contains filtered or unexported fields }
func (*CheckHealthRequest) Descriptor
deprecated
func (*CheckHealthRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckHealthRequest.ProtoReflect.Descriptor instead.
func (*CheckHealthRequest) GetRequestId ¶
func (x *CheckHealthRequest) GetRequestId() string
func (*CheckHealthRequest) ProtoMessage ¶
func (*CheckHealthRequest) ProtoMessage()
func (*CheckHealthRequest) ProtoReflect ¶
func (x *CheckHealthRequest) ProtoReflect() protoreflect.Message
func (*CheckHealthRequest) Reset ¶
func (x *CheckHealthRequest) Reset()
func (*CheckHealthRequest) String ¶
func (x *CheckHealthRequest) String() string
type ClusterInfo ¶
type ClusterInfo struct { // The unique id of the peer that the request was sent to. ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` // The unique id of the cluster leader. LeaderId string `protobuf:"bytes,2,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"` // All peers of the cluster. Members []*Server `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` // contains filtered or unexported fields }
ClusterInfo contains information about the cluster.
func (*ClusterInfo) Descriptor
deprecated
func (*ClusterInfo) Descriptor() ([]byte, []int)
Deprecated: Use ClusterInfo.ProtoReflect.Descriptor instead.
func (*ClusterInfo) GetLeaderId ¶ added in v0.2.0
func (x *ClusterInfo) GetLeaderId() string
func (*ClusterInfo) GetMembers ¶
func (x *ClusterInfo) GetMembers() []*Server
func (*ClusterInfo) GetServerId ¶
func (x *ClusterInfo) GetServerId() string
func (*ClusterInfo) ProtoMessage ¶
func (*ClusterInfo) ProtoMessage()
func (*ClusterInfo) ProtoReflect ¶
func (x *ClusterInfo) ProtoReflect() protoreflect.Message
func (*ClusterInfo) Reset ¶
func (x *ClusterInfo) Reset()
func (*ClusterInfo) String ¶
func (x *ClusterInfo) String() string
type Command ¶
type Command struct { // Types that are assignable to Cmd: // *Command_Task // *Command_Ack // *Command_Queue Cmd isCommand_Cmd `protobuf_oneof:"cmd"` // contains filtered or unexported fields }
Command is any command replicated by Raft peers and applied to their FSM.
func (*Command) Descriptor
deprecated
func (*Command) GetQueue ¶ added in v0.2.0
func (x *Command) GetQueue() *QueueConfig
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type Command_Ack ¶
type Command_Ack struct { // A request to acknowledge a task so that it is not redelivered. Ack *Ack `protobuf:"bytes,2,opt,name=ack,proto3,oneof"` }
type Command_Queue ¶ added in v0.2.0
type Command_Queue struct { // A request to save a queue. Queue *QueueConfig `protobuf:"bytes,3,opt,name=queue,proto3,oneof"` }
type Command_Task ¶
type Command_Task struct { // A request to save a task. Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof"` }
type DeleteTaskRequest ¶
type DeleteTaskRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` Async bool `protobuf:"varint,2,opt,name=async,proto3" json:"async,omitempty"` Reference *TaskReference `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` // contains filtered or unexported fields }
func (*DeleteTaskRequest) Descriptor
deprecated
func (*DeleteTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead.
func (*DeleteTaskRequest) GetAsync ¶
func (x *DeleteTaskRequest) GetAsync() bool
func (*DeleteTaskRequest) GetReference ¶ added in v0.2.0
func (x *DeleteTaskRequest) GetReference() *TaskReference
func (*DeleteTaskRequest) GetRequestId ¶
func (x *DeleteTaskRequest) GetRequestId() string
func (*DeleteTaskRequest) ProtoMessage ¶
func (*DeleteTaskRequest) ProtoMessage()
func (*DeleteTaskRequest) ProtoReflect ¶
func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message
func (*DeleteTaskRequest) Reset ¶
func (x *DeleteTaskRequest) Reset()
func (*DeleteTaskRequest) String ¶
func (x *DeleteTaskRequest) String() string
type DeleteTaskResponse ¶
type DeleteTaskResponse struct { ForwardedTo string `protobuf:"bytes,1,opt,name=forwarded_to,json=forwardedTo,proto3" json:"forwarded_to,omitempty"` // contains filtered or unexported fields }
func (*DeleteTaskResponse) Descriptor
deprecated
func (*DeleteTaskResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTaskResponse.ProtoReflect.Descriptor instead.
func (*DeleteTaskResponse) GetForwardedTo ¶
func (x *DeleteTaskResponse) GetForwardedTo() string
func (*DeleteTaskResponse) ProtoMessage ¶
func (*DeleteTaskResponse) ProtoMessage()
func (*DeleteTaskResponse) ProtoReflect ¶
func (x *DeleteTaskResponse) ProtoReflect() protoreflect.Message
func (*DeleteTaskResponse) Reset ¶
func (x *DeleteTaskResponse) Reset()
func (*DeleteTaskResponse) String ¶
func (x *DeleteTaskResponse) String() string
type GetClusterInfoRequest ¶
type GetClusterInfoRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // contains filtered or unexported fields }
func (*GetClusterInfoRequest) Descriptor
deprecated
func (*GetClusterInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetClusterInfoRequest.ProtoReflect.Descriptor instead.
func (*GetClusterInfoRequest) GetRequestId ¶
func (x *GetClusterInfoRequest) GetRequestId() string
func (*GetClusterInfoRequest) ProtoMessage ¶
func (*GetClusterInfoRequest) ProtoMessage()
func (*GetClusterInfoRequest) ProtoReflect ¶
func (x *GetClusterInfoRequest) ProtoReflect() protoreflect.Message
func (*GetClusterInfoRequest) Reset ¶
func (x *GetClusterInfoRequest) Reset()
func (*GetClusterInfoRequest) String ¶
func (x *GetClusterInfoRequest) String() string
type GetQueueRequest ¶ added in v0.2.0
type GetQueueRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` Queue string `protobuf:"bytes,2,opt,name=queue,proto3" json:"queue,omitempty"` // contains filtered or unexported fields }
func (*GetQueueRequest) Descriptor
deprecated
added in
v0.2.0
func (*GetQueueRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetQueueRequest.ProtoReflect.Descriptor instead.
func (*GetQueueRequest) GetQueue ¶ added in v0.2.0
func (x *GetQueueRequest) GetQueue() string
func (*GetQueueRequest) GetRequestId ¶ added in v0.2.0
func (x *GetQueueRequest) GetRequestId() string
func (*GetQueueRequest) ProtoMessage ¶ added in v0.2.0
func (*GetQueueRequest) ProtoMessage()
func (*GetQueueRequest) ProtoReflect ¶ added in v0.2.0
func (x *GetQueueRequest) ProtoReflect() protoreflect.Message
func (*GetQueueRequest) Reset ¶ added in v0.2.0
func (x *GetQueueRequest) Reset()
func (*GetQueueRequest) String ¶ added in v0.2.0
func (x *GetQueueRequest) String() string
type GetTaskRequest ¶
type GetTaskRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` Reference *TaskReference `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"` // contains filtered or unexported fields }
func (*GetTaskRequest) Descriptor
deprecated
func (*GetTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTaskRequest.ProtoReflect.Descriptor instead.
func (*GetTaskRequest) GetReference ¶ added in v0.2.0
func (x *GetTaskRequest) GetReference() *TaskReference
func (*GetTaskRequest) GetRequestId ¶
func (x *GetTaskRequest) GetRequestId() string
func (*GetTaskRequest) ProtoMessage ¶
func (*GetTaskRequest) ProtoMessage()
func (*GetTaskRequest) ProtoReflect ¶
func (x *GetTaskRequest) ProtoReflect() protoreflect.Message
func (*GetTaskRequest) Reset ¶
func (x *GetTaskRequest) Reset()
func (*GetTaskRequest) String ¶
func (x *GetTaskRequest) String() string
type PushStreamResponse ¶
type PushStreamResponse struct { Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` Status uint32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` ForwardedTo string `protobuf:"bytes,4,opt,name=forwarded_to,json=forwardedTo,proto3" json:"forwarded_to,omitempty"` // contains filtered or unexported fields }
PushStreamResponse is a stream response from the server when adding a task.
func (*PushStreamResponse) Descriptor
deprecated
func (*PushStreamResponse) Descriptor() ([]byte, []int)
Deprecated: Use PushStreamResponse.ProtoReflect.Descriptor instead.
func (*PushStreamResponse) GetForwardedTo ¶
func (x *PushStreamResponse) GetForwardedTo() string
func (*PushStreamResponse) GetMessage ¶
func (x *PushStreamResponse) GetMessage() string
func (*PushStreamResponse) GetStatus ¶
func (x *PushStreamResponse) GetStatus() uint32
func (*PushStreamResponse) GetTask ¶
func (x *PushStreamResponse) GetTask() *Task
func (*PushStreamResponse) ProtoMessage ¶
func (*PushStreamResponse) ProtoMessage()
func (*PushStreamResponse) ProtoReflect ¶
func (x *PushStreamResponse) ProtoReflect() protoreflect.Message
func (*PushStreamResponse) Reset ¶
func (x *PushStreamResponse) Reset()
func (*PushStreamResponse) String ¶
func (x *PushStreamResponse) String() string
type PushTaskRequest ¶
type PushTaskRequest struct { // The unique id of this request RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // The queue where the task should be added. Queue string `protobuf:"bytes,2,opt,name=queue,proto3" json:"queue,omitempty"` // Whether to asynchronously push the task. // // Asynchronous task creation does not wait for the task to // be persisted on all peers. It is faster but may result in // less durable operations. Async bool `protobuf:"varint,3,opt,name=async,proto3" json:"async,omitempty"` // Arbitrary key/value metadata for the task. Metadata map[string]string `` /* 157-byte string literal not displayed */ // An arbitrary task payload. Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` // Optional schedule for the task if it should be // delivered at a specific time. // // Types that are assignable to Schedule: // *PushTaskRequest_ScheduleTime // *PushTaskRequest_TtsSeconds Schedule isPushTaskRequest_Schedule `protobuf_oneof:"schedule"` // contains filtered or unexported fields }
PushTaskRequest is a request to add a task to the queue.
func (*PushTaskRequest) Descriptor
deprecated
func (*PushTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use PushTaskRequest.ProtoReflect.Descriptor instead.
func (*PushTaskRequest) GetAsync ¶
func (x *PushTaskRequest) GetAsync() bool
func (*PushTaskRequest) GetMetadata ¶
func (x *PushTaskRequest) GetMetadata() map[string]string
func (*PushTaskRequest) GetPayload ¶
func (x *PushTaskRequest) GetPayload() []byte
func (*PushTaskRequest) GetQueue ¶ added in v0.2.0
func (x *PushTaskRequest) GetQueue() string
func (*PushTaskRequest) GetRequestId ¶
func (x *PushTaskRequest) GetRequestId() string
func (*PushTaskRequest) GetSchedule ¶ added in v0.2.0
func (m *PushTaskRequest) GetSchedule() isPushTaskRequest_Schedule
func (*PushTaskRequest) GetScheduleTime ¶ added in v0.2.0
func (x *PushTaskRequest) GetScheduleTime() *timestamppb.Timestamp
func (*PushTaskRequest) GetTtsSeconds ¶
func (x *PushTaskRequest) GetTtsSeconds() int64
func (*PushTaskRequest) ProtoMessage ¶
func (*PushTaskRequest) ProtoMessage()
func (*PushTaskRequest) ProtoReflect ¶
func (x *PushTaskRequest) ProtoReflect() protoreflect.Message
func (*PushTaskRequest) Reset ¶
func (x *PushTaskRequest) Reset()
func (*PushTaskRequest) String ¶
func (x *PushTaskRequest) String() string
type PushTaskRequest_ScheduleTime ¶ added in v0.2.0
type PushTaskRequest_ScheduleTime struct { // The time when the task should be delivered to consumers. ScheduleTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=schedule_time,json=scheduleTime,proto3,oneof"` }
type PushTaskRequest_TtsSeconds ¶ added in v0.2.0
type PushTaskRequest_TtsSeconds struct { // The amount of time to wait before delivering the task to consumers. TtsSeconds int64 `protobuf:"varint,7,opt,name=tts_seconds,json=ttsSeconds,proto3,oneof"` }
type PushTaskResponse ¶
type PushTaskResponse struct { // The task that was added Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` // The peer that handled the task creation // // Under normal circumstances, this field should be an empty string. // If a request to create a task is sent to a follower instead of // a leader, the follower will forward the request to the leader // and set this field to the leader's address. This is a hint to the // client that it should reconnect to the leader. ForwardedTo string `protobuf:"bytes,2,opt,name=forwarded_to,json=forwardedTo,proto3" json:"forwarded_to,omitempty"` // contains filtered or unexported fields }
PushTaskResponse is the result of adding a task to the queue.
func (*PushTaskResponse) Descriptor
deprecated
func (*PushTaskResponse) Descriptor() ([]byte, []int)
Deprecated: Use PushTaskResponse.ProtoReflect.Descriptor instead.
func (*PushTaskResponse) GetForwardedTo ¶
func (x *PushTaskResponse) GetForwardedTo() string
func (*PushTaskResponse) GetTask ¶
func (x *PushTaskResponse) GetTask() *Task
func (*PushTaskResponse) ProtoMessage ¶
func (*PushTaskResponse) ProtoMessage()
func (*PushTaskResponse) ProtoReflect ¶
func (x *PushTaskResponse) ProtoReflect() protoreflect.Message
func (*PushTaskResponse) Reset ¶
func (x *PushTaskResponse) Reset()
func (*PushTaskResponse) String ¶
func (x *PushTaskResponse) String() string
type QueueClient ¶
type QueueClient interface { // Push adds a task to the queue. // // This rpc should be called on the leader. Push(ctx context.Context, in *PushTaskRequest, opts ...grpc.CallOption) (*PushTaskResponse, error) // PushStream opens a bi-directional stream for adding tasks. // // PushStream offers higher throughput than Push if many tasks need // to be added in quick succession. // // This rpc should be called on the leader. PushStream(ctx context.Context, opts ...grpc.CallOption) (Queue_PushStreamClient, error) // Pull opens a bi-directional stream for consuming ready tasks. // // Metadata must be passed to the server to indicate which // queue to consume from. The metadata key must be "queue" // and its value a single string that identifies the queue. // // This rpc must be called on the leader. Pull(ctx context.Context, opts ...grpc.CallOption) (Queue_PullClient, error) // Get retrieves a task by its ID. // // This rpc only works for scheduled tasks. Get(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*Task, error) // Delete removes a task from the queue before it is delivered. // // This should be used to delete tasks that are not yet ready // for consumption. If consuming tasks using the Pull method, // the acknowledgement functionality should be used instead of // Delete. Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteTaskResponse, error) }
QueueClient is the client API for Queue 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 NewQueueClient ¶
func NewQueueClient(cc grpc.ClientConnInterface) QueueClient
type QueueConfig ¶ added in v0.2.0
type QueueConfig struct { // The unique id of the queue. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The id of the last scheduled task that was sent to a client. LastDeliveredScheduledTask string `` /* 143-byte string literal not displayed */ // The id of the last queued task that was sent to a client. LastDeliveredQueuedTask string `` /* 134-byte string literal not displayed */ // The length of time after sending a message that it will // be redelivered if not acknowledged. AckDeadlineSeconds int32 `protobuf:"varint,4,opt,name=ack_deadline_seconds,json=ackDeadlineSeconds,proto3" json:"ack_deadline_seconds,omitempty"` // contains filtered or unexported fields }
func (*QueueConfig) Descriptor
deprecated
added in
v0.2.0
func (*QueueConfig) Descriptor() ([]byte, []int)
Deprecated: Use QueueConfig.ProtoReflect.Descriptor instead.
func (*QueueConfig) GetAckDeadlineSeconds ¶ added in v0.2.0
func (x *QueueConfig) GetAckDeadlineSeconds() int32
func (*QueueConfig) GetId ¶ added in v0.2.0
func (x *QueueConfig) GetId() string
func (*QueueConfig) GetLastDeliveredQueuedTask ¶ added in v0.2.0
func (x *QueueConfig) GetLastDeliveredQueuedTask() string
func (*QueueConfig) GetLastDeliveredScheduledTask ¶ added in v0.2.0
func (x *QueueConfig) GetLastDeliveredScheduledTask() string
func (*QueueConfig) ProtoMessage ¶ added in v0.2.0
func (*QueueConfig) ProtoMessage()
func (*QueueConfig) ProtoReflect ¶ added in v0.2.0
func (x *QueueConfig) ProtoReflect() protoreflect.Message
func (*QueueConfig) Reset ¶ added in v0.2.0
func (x *QueueConfig) Reset()
func (*QueueConfig) String ¶ added in v0.2.0
func (x *QueueConfig) String() string
type QueueServer ¶
type QueueServer interface { // Push adds a task to the queue. // // This rpc should be called on the leader. Push(context.Context, *PushTaskRequest) (*PushTaskResponse, error) // PushStream opens a bi-directional stream for adding tasks. // // PushStream offers higher throughput than Push if many tasks need // to be added in quick succession. // // This rpc should be called on the leader. PushStream(Queue_PushStreamServer) error // Pull opens a bi-directional stream for consuming ready tasks. // // Metadata must be passed to the server to indicate which // queue to consume from. The metadata key must be "queue" // and its value a single string that identifies the queue. // // This rpc must be called on the leader. Pull(Queue_PullServer) error // Get retrieves a task by its ID. // // This rpc only works for scheduled tasks. Get(context.Context, *GetTaskRequest) (*Task, error) // Delete removes a task from the queue before it is delivered. // // This should be used to delete tasks that are not yet ready // for consumption. If consuming tasks using the Pull method, // the acknowledgement functionality should be used instead of // Delete. Delete(context.Context, *DeleteTaskRequest) (*DeleteTaskResponse, error) // contains filtered or unexported methods }
QueueServer is the server API for Queue service. All implementations must embed UnimplementedQueueServer for forward compatibility
type Queue_PullClient ¶
type Queue_PullServer ¶
type Queue_PushStreamClient ¶
type Queue_PushStreamClient interface { Send(*PushTaskRequest) error Recv() (*PushStreamResponse, error) grpc.ClientStream }
type Queue_PushStreamServer ¶
type Queue_PushStreamServer interface { Send(*PushStreamResponse) error Recv() (*PushTaskRequest, error) grpc.ServerStream }
type RemoveClusterMemberRequest ¶
type RemoveClusterMemberRequest struct { // The unique id of the peer. MemberId string `protobuf:"bytes,1,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` // contains filtered or unexported fields }
func (*RemoveClusterMemberRequest) Descriptor
deprecated
func (*RemoveClusterMemberRequest) Descriptor() ([]byte, []int)
Deprecated: Use RemoveClusterMemberRequest.ProtoReflect.Descriptor instead.
func (*RemoveClusterMemberRequest) GetMemberId ¶
func (x *RemoveClusterMemberRequest) GetMemberId() string
func (*RemoveClusterMemberRequest) ProtoMessage ¶
func (*RemoveClusterMemberRequest) ProtoMessage()
func (*RemoveClusterMemberRequest) ProtoReflect ¶
func (x *RemoveClusterMemberRequest) ProtoReflect() protoreflect.Message
func (*RemoveClusterMemberRequest) Reset ¶
func (x *RemoveClusterMemberRequest) Reset()
func (*RemoveClusterMemberRequest) String ¶
func (x *RemoveClusterMemberRequest) String() string
type Server ¶
type Server struct { // The unique id of the peer. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` RaftPort int32 `protobuf:"varint,3,opt,name=raft_port,json=raftPort,proto3" json:"raft_port,omitempty"` SqlPort int32 `protobuf:"varint,4,opt,name=sql_port,json=sqlPort,proto3" json:"sql_port,omitempty"` QueuePort int32 `protobuf:"varint,5,opt,name=queue_port,json=queuePort,proto3" json:"queue_port,omitempty"` // contains filtered or unexported fields }
TODO: Rename this to Peer. Server is a member of the cluster.
func (*Server) Descriptor
deprecated
func (*Server) GetQueuePort ¶ added in v0.2.0
func (*Server) GetRaftPort ¶ added in v0.2.0
func (*Server) GetSqlPort ¶ added in v0.2.0
func (*Server) ProtoMessage ¶
func (*Server) ProtoMessage()
func (*Server) ProtoReflect ¶
func (x *Server) ProtoReflect() protoreflect.Message
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func (*Status) Descriptor
deprecated
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type Task ¶
type Task struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Queue string `protobuf:"bytes,2,opt,name=queue,proto3" json:"queue,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` ScheduleTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=schedule_time,json=scheduleTime,proto3" json:"schedule_time,omitempty"` // Last time the task was sent to the client due to not receiving an ack. LastRetry *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_retry,json=lastRetry,proto3" json:"last_retry,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*Task) Descriptor
deprecated
func (*Task) GetCreatedAt ¶ added in v0.2.0
func (x *Task) GetCreatedAt() *timestamppb.Timestamp
func (*Task) GetLastRetry ¶
func (x *Task) GetLastRetry() *timestamppb.Timestamp
func (*Task) GetMetadata ¶
func (*Task) GetPayload ¶
func (*Task) GetScheduleTime ¶ added in v0.2.0
func (x *Task) GetScheduleTime() *timestamppb.Timestamp
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶
func (x *Task) ProtoReflect() protoreflect.Message
type TaskReference ¶ added in v0.2.0
type TaskReference struct { // The queue where the task is located. Queue string `protobuf:"bytes,1,opt,name=queue,proto3" json:"queue,omitempty"` TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // contains filtered or unexported fields }
TaskReference is a unique reference to a task.
func (*TaskReference) Descriptor
deprecated
added in
v0.2.0
func (*TaskReference) Descriptor() ([]byte, []int)
Deprecated: Use TaskReference.ProtoReflect.Descriptor instead.
func (*TaskReference) GetQueue ¶ added in v0.2.0
func (x *TaskReference) GetQueue() string
func (*TaskReference) GetTaskId ¶ added in v0.2.0
func (x *TaskReference) GetTaskId() string
func (*TaskReference) ProtoMessage ¶ added in v0.2.0
func (*TaskReference) ProtoMessage()
func (*TaskReference) ProtoReflect ¶ added in v0.2.0
func (x *TaskReference) ProtoReflect() protoreflect.Message
func (*TaskReference) Reset ¶ added in v0.2.0
func (x *TaskReference) Reset()
func (*TaskReference) String ¶ added in v0.2.0
func (x *TaskReference) String() string
type UnimplementedAdminServer ¶
type UnimplementedAdminServer struct { }
UnimplementedAdminServer must be embedded to have forward compatible implementations.
func (UnimplementedAdminServer) AddClusterMember ¶
func (UnimplementedAdminServer) AddClusterMember(context.Context, *AddClusterMemberRequest) (*emptypb.Empty, error)
func (UnimplementedAdminServer) BootstrapCluster ¶
func (UnimplementedAdminServer) CheckHealth ¶
func (UnimplementedAdminServer) CheckHealth(context.Context, *CheckHealthRequest) (*Status, error)
func (UnimplementedAdminServer) GetClusterInfo ¶
func (UnimplementedAdminServer) GetClusterInfo(context.Context, *GetClusterInfoRequest) (*ClusterInfo, error)
func (UnimplementedAdminServer) GetQueue ¶ added in v0.2.0
func (UnimplementedAdminServer) GetQueue(context.Context, *GetQueueRequest) (*QueueConfig, error)
func (UnimplementedAdminServer) RemoveClusterMember ¶
func (UnimplementedAdminServer) RemoveClusterMember(context.Context, *RemoveClusterMemberRequest) (*emptypb.Empty, error)
func (UnimplementedAdminServer) UpdateQueue ¶ added in v0.2.0
func (UnimplementedAdminServer) UpdateQueue(context.Context, *UpdateQueueRequest) (*QueueConfig, error)
type UnimplementedQueueServer ¶
type UnimplementedQueueServer struct { }
UnimplementedQueueServer must be embedded to have forward compatible implementations.
func (UnimplementedQueueServer) Delete ¶
func (UnimplementedQueueServer) Delete(context.Context, *DeleteTaskRequest) (*DeleteTaskResponse, error)
func (UnimplementedQueueServer) Get ¶
func (UnimplementedQueueServer) Get(context.Context, *GetTaskRequest) (*Task, error)
func (UnimplementedQueueServer) Pull ¶
func (UnimplementedQueueServer) Pull(Queue_PullServer) error
func (UnimplementedQueueServer) Push ¶
func (UnimplementedQueueServer) Push(context.Context, *PushTaskRequest) (*PushTaskResponse, error)
func (UnimplementedQueueServer) PushStream ¶
func (UnimplementedQueueServer) PushStream(Queue_PushStreamServer) error
type UnsafeAdminServer ¶
type UnsafeAdminServer interface {
// contains filtered or unexported methods
}
UnsafeAdminServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AdminServer will result in compilation errors.
type UnsafeQueueServer ¶
type UnsafeQueueServer interface {
// contains filtered or unexported methods
}
UnsafeQueueServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to QueueServer will result in compilation errors.
type UpdateQueueRequest ¶ added in v0.2.0
type UpdateQueueRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // A new version of the queue // // The following fields cannot be updated // - id // - last_delivered_task Queue *QueueConfig `protobuf:"bytes,2,opt,name=queue,proto3" json:"queue,omitempty"` // contains filtered or unexported fields }
func (*UpdateQueueRequest) Descriptor
deprecated
added in
v0.2.0
func (*UpdateQueueRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateQueueRequest.ProtoReflect.Descriptor instead.
func (*UpdateQueueRequest) GetQueue ¶ added in v0.2.0
func (x *UpdateQueueRequest) GetQueue() *QueueConfig
func (*UpdateQueueRequest) GetRequestId ¶ added in v0.2.0
func (x *UpdateQueueRequest) GetRequestId() string
func (*UpdateQueueRequest) ProtoMessage ¶ added in v0.2.0
func (*UpdateQueueRequest) ProtoMessage()
func (*UpdateQueueRequest) ProtoReflect ¶ added in v0.2.0
func (x *UpdateQueueRequest) ProtoReflect() protoreflect.Message
func (*UpdateQueueRequest) Reset ¶ added in v0.2.0
func (x *UpdateQueueRequest) Reset()
func (*UpdateQueueRequest) String ¶ added in v0.2.0
func (x *UpdateQueueRequest) String() string