pb

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskType_name = map[int32]string{
	0: "Ignore",
	1: "TaskStore",
	2: "TaskDelay",
	3: "TaskReady",
	4: "TaskReserved",
	5: "TaskFinished",
	6: "TaskRetryDelay",
	7: "TaskCheck",
}
View Source
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) Descriptor() ([]byte, []int)

func (*AddReq) GetArgs

func (m *AddReq) GetArgs() string

func (*AddReq) GetCallback

func (m *AddReq) GetCallback() *CallbackInfo

func (*AddReq) GetName

func (m *AddReq) GetName() string

func (*AddReq) GetTime

func (m *AddReq) GetTime() *ExecTime

func (*AddReq) ProtoMessage

func (*AddReq) ProtoMessage()

func (*AddReq) Reset

func (m *AddReq) Reset()

func (*AddReq) String

func (m *AddReq) String() string

func (*AddReq) XXX_DiscardUnknown

func (m *AddReq) XXX_DiscardUnknown()

func (*AddReq) XXX_Marshal

func (m *AddReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddReq) XXX_Merge

func (m *AddReq) XXX_Merge(src proto.Message)

func (*AddReq) XXX_Size

func (m *AddReq) XXX_Size() int

func (*AddReq) XXX_Unmarshal

func (m *AddReq) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*AddResp) GetUid

func (m *AddResp) GetUid() string

func (*AddResp) ProtoMessage

func (*AddResp) ProtoMessage()

func (*AddResp) Reset

func (m *AddResp) Reset()

func (*AddResp) String

func (m *AddResp) String() string

func (*AddResp) XXX_DiscardUnknown

func (m *AddResp) XXX_DiscardUnknown()

func (*AddResp) XXX_Marshal

func (m *AddResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddResp) XXX_Merge

func (m *AddResp) XXX_Merge(src proto.Message)

func (*AddResp) XXX_Size

func (m *AddResp) XXX_Size() int

func (*AddResp) XXX_Unmarshal

func (m *AddResp) XXX_Unmarshal(b []byte) error

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

type CallbackServer interface {
	Send(context.Context, *CallBackReq) (*empty.Empty, error)
}

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) Descriptor() ([]byte, []int)

func (*ExecTime) GetDuration

func (m *ExecTime) GetDuration() int64

func (*ExecTime) GetRelative

func (m *ExecTime) GetRelative() bool

func (*ExecTime) ProtoMessage

func (*ExecTime) ProtoMessage()

func (*ExecTime) Reset

func (m *ExecTime) Reset()

func (*ExecTime) String

func (m *ExecTime) String() string

func (*ExecTime) XXX_DiscardUnknown

func (m *ExecTime) XXX_DiscardUnknown()

func (*ExecTime) XXX_Marshal

func (m *ExecTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecTime) XXX_Merge

func (m *ExecTime) XXX_Merge(src proto.Message)

func (*ExecTime) XXX_Size

func (m *ExecTime) XXX_Size() int

func (*ExecTime) XXX_Unmarshal

func (m *ExecTime) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*RemoveReq) GetUid

func (m *RemoveReq) GetUid() string

func (*RemoveReq) ProtoMessage

func (*RemoveReq) ProtoMessage()

func (*RemoveReq) Reset

func (m *RemoveReq) Reset()

func (*RemoveReq) String

func (m *RemoveReq) String() string

func (*RemoveReq) XXX_DiscardUnknown

func (m *RemoveReq) XXX_DiscardUnknown()

func (*RemoveReq) XXX_Marshal

func (m *RemoveReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoveReq) XXX_Merge

func (m *RemoveReq) XXX_Merge(src proto.Message)

func (*RemoveReq) XXX_Size

func (m *RemoveReq) XXX_Size() int

func (*RemoveReq) XXX_Unmarshal

func (m *RemoveReq) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Task) GetAddress

func (m *Task) GetAddress() string

func (*Task) GetCreatedAt

func (m *Task) GetCreatedAt() int64

func (*Task) GetExecTime

func (m *Task) GetExecTime() int64

func (*Task) GetId

func (m *Task) GetId() uint32

func (*Task) GetName

func (m *Task) GetName() string

func (*Task) GetNextExecTime

func (m *Task) GetNextExecTime() int64

func (*Task) GetPath

func (m *Task) GetPath() string

func (*Task) GetRetryTimes

func (m *Task) GetRetryTimes() int32

func (*Task) GetSchema

func (m *Task) GetSchema() string

func (*Task) GetTimes

func (m *Task) GetTimes() int32

func (*Task) GetType

func (m *Task) GetType() TaskType

func (*Task) GetUid

func (m *Task) GetUid() string

func (*Task) GetUpdatedAt

func (m *Task) GetUpdatedAt() int64

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

func (*Task) XXX_DiscardUnknown

func (m *Task) XXX_DiscardUnknown()

func (*Task) XXX_Marshal

func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Task) XXX_Merge

func (m *Task) XXX_Merge(src proto.Message)

func (*Task) XXX_Size

func (m *Task) XXX_Size() int

func (*Task) XXX_Unmarshal

func (m *Task) XXX_Unmarshal(b []byte) error

type TaskType

type TaskType int32

根据文档定义常量

const (
	TaskType_Ignore         TaskType = 0
	TaskType_TaskStore      TaskType = 1
	TaskType_TaskDelay      TaskType = 2
	TaskType_TaskReady      TaskType = 3
	TaskType_TaskReserved   TaskType = 4
	TaskType_TaskFinished   TaskType = 5
	TaskType_TaskRetryDelay TaskType = 6
	TaskType_TaskCheck      TaskType = 7
)

func (TaskType) EnumDescriptor

func (TaskType) EnumDescriptor() ([]byte, []int)

func (TaskType) String

func (x TaskType) String() string

type UnimplementedCallbackServer

type UnimplementedCallbackServer struct {
}

UnimplementedCallbackServer can be embedded to have forward compatible implementations.

func (*UnimplementedCallbackServer) Send

type UnimplementedDelayQueueServer

type UnimplementedDelayQueueServer struct {
}

UnimplementedDelayQueueServer can be embedded to have forward compatible implementations.

func (*UnimplementedDelayQueueServer) Add

func (*UnimplementedDelayQueueServer) Get

func (*UnimplementedDelayQueueServer) Remove

Jump to

Keyboard shortcuts

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