Documentation ¶
Index ¶
- Variables
- func RegisterCallbackServer(s *grpc.Server, srv CallbackServer)
- func RegisterDelayQueueServer(s *grpc.Server, srv DelayQueueServer)
- type AddReq
- func (*AddReq) Descriptor() ([]byte, []int)
- func (m *AddReq) GetArgs() string
- func (m *AddReq) GetCallback() *CallbackInfo
- func (m *AddReq) GetName() string
- func (m *AddReq) GetTime() *ExecTime
- func (*AddReq) ProtoMessage()
- func (m *AddReq) Reset()
- func (m *AddReq) String() string
- func (m *AddReq) XXX_DiscardUnknown()
- func (m *AddReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AddReq) XXX_Merge(src proto.Message)
- func (m *AddReq) XXX_Size() int
- func (m *AddReq) XXX_Unmarshal(b []byte) error
- type AddResp
- func (*AddResp) Descriptor() ([]byte, []int)
- func (m *AddResp) GetUid() string
- func (*AddResp) ProtoMessage()
- func (m *AddResp) Reset()
- func (m *AddResp) String() string
- func (m *AddResp) XXX_DiscardUnknown()
- func (m *AddResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AddResp) XXX_Merge(src proto.Message)
- func (m *AddResp) XXX_Size() int
- func (m *AddResp) XXX_Unmarshal(b []byte) error
- type CallBackReq
- func (*CallBackReq) Descriptor() ([]byte, []int)
- func (m *CallBackReq) GetArgs() string
- func (m *CallBackReq) GetName() string
- func (m *CallBackReq) GetUid() string
- func (m *CallBackReq) GetUrl() string
- func (*CallBackReq) ProtoMessage()
- func (m *CallBackReq) Reset()
- func (m *CallBackReq) String() string
- func (m *CallBackReq) XXX_DiscardUnknown()
- func (m *CallBackReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CallBackReq) XXX_Merge(src proto.Message)
- func (m *CallBackReq) XXX_Size() int
- func (m *CallBackReq) XXX_Unmarshal(b []byte) error
- type CallbackClient
- type CallbackInfo
- func (*CallbackInfo) Descriptor() ([]byte, []int)
- func (m *CallbackInfo) GetAddress() string
- func (m *CallbackInfo) GetPath() string
- func (m *CallbackInfo) GetSchema() string
- func (*CallbackInfo) ProtoMessage()
- func (m *CallbackInfo) Reset()
- func (m *CallbackInfo) String() string
- func (m *CallbackInfo) XXX_DiscardUnknown()
- func (m *CallbackInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CallbackInfo) XXX_Merge(src proto.Message)
- func (m *CallbackInfo) XXX_Size() int
- func (m *CallbackInfo) XXX_Unmarshal(b []byte) error
- type CallbackServer
- type DelayQueueClient
- type DelayQueueServer
- type ExecTime
- func (*ExecTime) Descriptor() ([]byte, []int)
- func (m *ExecTime) GetDuration() int64
- func (m *ExecTime) GetRelative() bool
- func (*ExecTime) ProtoMessage()
- func (m *ExecTime) Reset()
- func (m *ExecTime) String() string
- func (m *ExecTime) XXX_DiscardUnknown()
- func (m *ExecTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExecTime) XXX_Merge(src proto.Message)
- func (m *ExecTime) XXX_Size() int
- func (m *ExecTime) XXX_Unmarshal(b []byte) error
- type RemoveReq
- func (*RemoveReq) Descriptor() ([]byte, []int)
- func (m *RemoveReq) GetUid() string
- func (*RemoveReq) ProtoMessage()
- func (m *RemoveReq) Reset()
- func (m *RemoveReq) String() string
- func (m *RemoveReq) XXX_DiscardUnknown()
- func (m *RemoveReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RemoveReq) XXX_Merge(src proto.Message)
- func (m *RemoveReq) XXX_Size() int
- func (m *RemoveReq) XXX_Unmarshal(b []byte) error
- type RetrieveReq
- func (*RetrieveReq) Descriptor() ([]byte, []int)
- func (m *RetrieveReq) GetUid() string
- func (*RetrieveReq) ProtoMessage()
- func (m *RetrieveReq) Reset()
- func (m *RetrieveReq) String() string
- func (m *RetrieveReq) XXX_DiscardUnknown()
- func (m *RetrieveReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RetrieveReq) XXX_Merge(src proto.Message)
- func (m *RetrieveReq) XXX_Size() int
- func (m *RetrieveReq) XXX_Unmarshal(b []byte) error
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (m *Task) GetAddress() string
- func (m *Task) GetCreatedAt() int64
- func (m *Task) GetExecTime() int64
- func (m *Task) GetId() uint32
- func (m *Task) GetName() string
- func (m *Task) GetNextExecTime() int64
- func (m *Task) GetPath() string
- func (m *Task) GetRetryTimes() int32
- func (m *Task) GetSchema() string
- func (m *Task) GetTimes() int32
- func (m *Task) GetType() TaskType
- func (m *Task) GetUid() string
- func (m *Task) GetUpdatedAt() int64
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) String() string
- func (m *Task) XXX_DiscardUnknown()
- func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Task) XXX_Merge(src proto.Message)
- func (m *Task) XXX_Size() int
- func (m *Task) XXX_Unmarshal(b []byte) error
- type TaskType
- type UnimplementedCallbackServer
- type UnimplementedDelayQueueServer
Constants ¶
This section is empty.
Variables ¶
var TaskType_name = map[int32]string{
0: "Ignore",
1: "TaskStore",
2: "TaskDelay",
3: "TaskReady",
4: "TaskReserved",
5: "TaskFinished",
6: "TaskRetryDelay",
7: "TaskCheck",
}
var TaskType_value = map[string]int32{
"Ignore": 0,
"TaskStore": 1,
"TaskDelay": 2,
"TaskReady": 3,
"TaskReserved": 4,
"TaskFinished": 5,
"TaskRetryDelay": 6,
"TaskCheck": 7,
}
Functions ¶
func RegisterCallbackServer ¶
func RegisterCallbackServer(s *grpc.Server, srv CallbackServer)
func RegisterDelayQueueServer ¶
func RegisterDelayQueueServer(s *grpc.Server, srv DelayQueueServer)
Types ¶
type AddReq ¶
type AddReq struct { // @inject_tag: valid:"required" 业务名称(worker回调时会返回) Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" valid:"required"` Time *ExecTime `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"` // @inject_tag: valid:"required" 回调路径 Callback *CallbackInfo `protobuf:"bytes,3,opt,name=callback,proto3" json:"callback,omitempty" valid:"required"` // 返回参数(worker回调时返回,尽量传输小数据,如果有需要自行存储在业务,与uid做绑定) Args string `protobuf:"bytes,4,opt,name=args,proto3" json:"args,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AddReq) Descriptor ¶
func (*AddReq) GetCallback ¶
func (m *AddReq) GetCallback() *CallbackInfo
func (*AddReq) ProtoMessage ¶
func (*AddReq) ProtoMessage()
func (*AddReq) XXX_DiscardUnknown ¶
func (m *AddReq) XXX_DiscardUnknown()
func (*AddReq) XXX_Marshal ¶
func (*AddReq) XXX_Unmarshal ¶
type AddResp ¶
type AddResp struct { // @inject_tag: valid:"required" 返回当前唯一标识 Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty" valid:"required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AddResp) Descriptor ¶
func (*AddResp) ProtoMessage ¶
func (*AddResp) ProtoMessage()
func (*AddResp) XXX_DiscardUnknown ¶
func (m *AddResp) XXX_DiscardUnknown()
func (*AddResp) XXX_Marshal ¶
func (*AddResp) XXX_Unmarshal ¶
type CallBackReq ¶
type CallBackReq struct { // @inject_tag: valid:"required" Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty" valid:"required"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` Args string `protobuf:"bytes,4,opt,name=args,proto3" json:"args,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CallBackReq) Descriptor ¶
func (*CallBackReq) Descriptor() ([]byte, []int)
func (*CallBackReq) GetArgs ¶
func (m *CallBackReq) GetArgs() string
func (*CallBackReq) GetName ¶
func (m *CallBackReq) GetName() string
func (*CallBackReq) GetUid ¶
func (m *CallBackReq) GetUid() string
func (*CallBackReq) GetUrl ¶
func (m *CallBackReq) GetUrl() string
func (*CallBackReq) ProtoMessage ¶
func (*CallBackReq) ProtoMessage()
func (*CallBackReq) Reset ¶
func (m *CallBackReq) Reset()
func (*CallBackReq) String ¶
func (m *CallBackReq) String() string
func (*CallBackReq) XXX_DiscardUnknown ¶
func (m *CallBackReq) XXX_DiscardUnknown()
func (*CallBackReq) XXX_Marshal ¶
func (m *CallBackReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CallBackReq) XXX_Merge ¶
func (m *CallBackReq) XXX_Merge(src proto.Message)
func (*CallBackReq) XXX_Size ¶
func (m *CallBackReq) XXX_Size() int
func (*CallBackReq) XXX_Unmarshal ¶
func (m *CallBackReq) XXX_Unmarshal(b []byte) error
type CallbackClient ¶
type CallbackClient interface {
Send(ctx context.Context, in *CallBackReq, opts ...grpc.CallOption) (*empty.Empty, error)
}
CallbackClient is the client API for Callback service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCallbackClient ¶
func NewCallbackClient(cc *grpc.ClientConn) CallbackClient
type CallbackInfo ¶
type CallbackInfo struct { // @inject_tag: valid:"required" 协议(HTTP\GRPC) Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty" valid:"required"` // @inject_tag: valid:"required" 地址+端口 Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" valid:"required"` // 路径(GRPC回调函数固定的) Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CallbackInfo) Descriptor ¶
func (*CallbackInfo) Descriptor() ([]byte, []int)
func (*CallbackInfo) GetAddress ¶
func (m *CallbackInfo) GetAddress() string
func (*CallbackInfo) GetPath ¶
func (m *CallbackInfo) GetPath() string
func (*CallbackInfo) GetSchema ¶
func (m *CallbackInfo) GetSchema() string
func (*CallbackInfo) ProtoMessage ¶
func (*CallbackInfo) ProtoMessage()
func (*CallbackInfo) Reset ¶
func (m *CallbackInfo) Reset()
func (*CallbackInfo) String ¶
func (m *CallbackInfo) String() string
func (*CallbackInfo) XXX_DiscardUnknown ¶
func (m *CallbackInfo) XXX_DiscardUnknown()
func (*CallbackInfo) XXX_Marshal ¶
func (m *CallbackInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CallbackInfo) XXX_Merge ¶
func (m *CallbackInfo) XXX_Merge(src proto.Message)
func (*CallbackInfo) XXX_Size ¶
func (m *CallbackInfo) XXX_Size() int
func (*CallbackInfo) XXX_Unmarshal ¶
func (m *CallbackInfo) XXX_Unmarshal(b []byte) error
type CallbackServer ¶
CallbackServer is the server API for Callback service.
type DelayQueueClient ¶
type DelayQueueClient interface { Add(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) Get(ctx context.Context, in *RetrieveReq, opts ...grpc.CallOption) (*Task, error) Remove(ctx context.Context, in *RemoveReq, opts ...grpc.CallOption) (*empty.Empty, error) }
DelayQueueClient is the client API for DelayQueue service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDelayQueueClient ¶
func NewDelayQueueClient(cc *grpc.ClientConn) DelayQueueClient
type DelayQueueServer ¶
type DelayQueueServer interface { Add(context.Context, *AddReq) (*AddResp, error) Get(context.Context, *RetrieveReq) (*Task, error) Remove(context.Context, *RemoveReq) (*empty.Empty, error) }
DelayQueueServer is the server API for DelayQueue service.
type ExecTime ¶
type ExecTime struct { // 执行时间戳 Duration int64 `protobuf:"varint,1,opt,name=duration,proto3" json:"duration,omitempty"` // 是否是相对时间(如果是相对时间,那么真正执行时间为NOW()+duration) Relative bool `protobuf:"varint,2,opt,name=relative,proto3" json:"relative,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ExecTime) Descriptor ¶
func (*ExecTime) GetDuration ¶
func (*ExecTime) GetRelative ¶
func (*ExecTime) ProtoMessage ¶
func (*ExecTime) ProtoMessage()
func (*ExecTime) XXX_DiscardUnknown ¶
func (m *ExecTime) XXX_DiscardUnknown()
func (*ExecTime) XXX_Marshal ¶
func (*ExecTime) XXX_Unmarshal ¶
type RemoveReq ¶
type RemoveReq struct { // @inject_tag: valid:"required" Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty" valid:"required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RemoveReq) Descriptor ¶
func (*RemoveReq) ProtoMessage ¶
func (*RemoveReq) ProtoMessage()
func (*RemoveReq) XXX_DiscardUnknown ¶
func (m *RemoveReq) XXX_DiscardUnknown()
func (*RemoveReq) XXX_Marshal ¶
func (*RemoveReq) XXX_Unmarshal ¶
type RetrieveReq ¶
type RetrieveReq struct { // @inject_tag: valid:"required" Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty" valid:"required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RetrieveReq) Descriptor ¶
func (*RetrieveReq) Descriptor() ([]byte, []int)
func (*RetrieveReq) GetUid ¶
func (m *RetrieveReq) GetUid() string
func (*RetrieveReq) ProtoMessage ¶
func (*RetrieveReq) ProtoMessage()
func (*RetrieveReq) Reset ¶
func (m *RetrieveReq) Reset()
func (*RetrieveReq) String ¶
func (m *RetrieveReq) String() string
func (*RetrieveReq) XXX_DiscardUnknown ¶
func (m *RetrieveReq) XXX_DiscardUnknown()
func (*RetrieveReq) XXX_Marshal ¶
func (m *RetrieveReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RetrieveReq) XXX_Merge ¶
func (m *RetrieveReq) XXX_Merge(src proto.Message)
func (*RetrieveReq) XXX_Size ¶
func (m *RetrieveReq) XXX_Size() int
func (*RetrieveReq) XXX_Unmarshal ¶
func (m *RetrieveReq) XXX_Unmarshal(b []byte) error
type Task ¶
type Task struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Type TaskType `protobuf:"varint,4,opt,name=type,proto3,enum=pb.TaskType" json:"type,omitempty"` Times int32 `protobuf:"varint,5,opt,name=times,proto3" json:"times,omitempty"` RetryTimes int32 `protobuf:"varint,6,opt,name=retry_times,json=retryTimes,proto3" json:"retry_times,omitempty"` ExecTime int64 `protobuf:"varint,7,opt,name=exec_time,json=execTime,proto3" json:"exec_time,omitempty"` NextExecTime int64 `protobuf:"varint,8,opt,name=next_exec_time,json=nextExecTime,proto3" json:"next_exec_time,omitempty"` Schema string `protobuf:"bytes,9,opt,name=schema,proto3" json:"schema,omitempty"` Address string `protobuf:"bytes,10,opt,name=address,proto3" json:"address,omitempty"` Path string `protobuf:"bytes,11,opt,name=path,proto3" json:"path,omitempty"` CreatedAt int64 `protobuf:"varint,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt int64 `protobuf:"varint,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Task) Descriptor ¶
func (*Task) GetAddress ¶
func (*Task) GetCreatedAt ¶
func (*Task) GetExecTime ¶
func (*Task) GetNextExecTime ¶
func (*Task) GetRetryTimes ¶
func (*Task) GetUpdatedAt ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) XXX_DiscardUnknown ¶
func (m *Task) XXX_DiscardUnknown()
func (*Task) XXX_Unmarshal ¶
type UnimplementedCallbackServer ¶
type UnimplementedCallbackServer struct { }
UnimplementedCallbackServer can be embedded to have forward compatible implementations.
func (*UnimplementedCallbackServer) Send ¶
func (*UnimplementedCallbackServer) Send(ctx context.Context, req *CallBackReq) (*empty.Empty, error)
type UnimplementedDelayQueueServer ¶
type UnimplementedDelayQueueServer struct { }
UnimplementedDelayQueueServer can be embedded to have forward compatible implementations.
func (*UnimplementedDelayQueueServer) Get ¶
func (*UnimplementedDelayQueueServer) Get(ctx context.Context, req *RetrieveReq) (*Task, error)