Documentation ¶
Index ¶
- Variables
- func NewCloudTasksQ(cfg CloudTasksConfig, client *cloudtasks.Client) *cloudTasksQ
- func NewPubSubQ(client *pubsub.Client) *pubSubQ
- type CloudTasksConfig
- type CloudTasksOption
- type CloudTasksOptionType
- type CloudTasksQ
- type PubSubMessage
- type PubSubOption
- type PubSubOptionType
- type PubSubQ
- type QMessage
- type Task
- type TaskInfo
- type TaskOption
- type TaskOptionType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTaskIsNil = fmt.Errorf("task is nil")
Functions ¶
func NewCloudTasksQ ¶
func NewCloudTasksQ(cfg CloudTasksConfig, client *cloudtasks.Client) *cloudTasksQ
func NewPubSubQ ¶
Types ¶
type CloudTasksConfig ¶ added in v0.46.0
type CloudTasksOption ¶
type CloudTasksOption interface { // String returns a string representation of the option. String() string // Type describes the type of the option. Type() CloudTasksOptionType // Value returns a value used to create this option. Value() interface{} }
func ProcessAt ¶
func ProcessAt(t time.Time) CloudTasksOption
ProcessAt returns an option to specify when to process the given task.
type CloudTasksOptionType ¶
type CloudTasksOptionType int
const (
ProcessAtOpt CloudTasksOptionType = iota
)
type CloudTasksQ ¶
type CloudTasksQ interface { // Enqueue enqueues a task with ClousTasks, and returns info. EnqueueWithInfo(ctx context.Context, task *Task, opts ...CloudTasksOption) (*TaskInfo, error) // Enqueue enqueues a task with ClousTasks. Enqueue(ctx context.Context, task *Task, opts ...CloudTasksOption) error }
type PubSubMessage ¶
type PubSubMessage struct { Message struct { ID string `json:"messageId"` PublishTime time.Time `json:"publishTime"` Data []byte `json:"data,omitempty"` OrderingKey string `json:"orderingKey,omitempty"` Attributes map[string]string `json:"attributes,omitempty"` } `json:"message"` Subscription string `json:"subscription"` }
PubSubMessage is the payload of a Pub/Sub event. See the documentation for more details: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage
func (*PubSubMessage) GetGroup ¶ added in v0.15.0
func (m *PubSubMessage) GetGroup() string
func (*PubSubMessage) GetName ¶ added in v0.15.0
func (m *PubSubMessage) GetName() string
func (*PubSubMessage) GetUniqueKey ¶
func (m *PubSubMessage) GetUniqueKey() string
func (*PubSubMessage) UnmarshalData ¶
func (m *PubSubMessage) UnmarshalData(v interface{}) error
type PubSubOption ¶
type PubSubOption interface { // String returns a string representation of the option. String() string // Type describes the type of the option. Type() PubSubOptionType // Value returns a value used to create this option. Value() interface{} }
func OrderedByTaskName ¶ added in v0.13.0
func OrderedByTaskName() PubSubOption
Ordered returns an option to specify the ordered key.
func OrderedKey ¶ added in v0.13.0
func OrderedKey(key string) PubSubOption
Ordered returns an option to specify the ordered key.
type PubSubOptionType ¶
type PubSubOptionType int
const ( OrderedKeyOpt PubSubOptionType = iota OrderedByTaskNameOpt )
type QMessage ¶ added in v0.47.0
func (*QMessage) UnmarshalData ¶ added in v0.47.0
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task represents a unit of work to be performed.
func NewTask ¶
func NewTask(typename string, payload interface{}, opts ...TaskOption) *Task
NewTask returns a new Task given a type name and payload data that will be marshaled. Options can be passed to configure task processing behavior.
func (Task) GetOptions ¶ added in v0.38.0
func (t Task) GetOptions() []TaskOption
func (Task) GetPayload ¶ added in v0.38.0
func (t Task) GetPayload() interface{}
func (Task) GetTypename ¶ added in v0.38.0
type TaskOption ¶
type TaskOption interface { // String returns a string representation of the option. String() string // Type describes the type of the option. Type() TaskOptionType // Value returns a value used to create this option. Value() interface{} }
func Group ¶ added in v0.15.0
func Group(key string) TaskOption
Group returns an option to specify the group.
func UniqueKey ¶
func UniqueKey(key string) TaskOption
UniqueKey returns an option to specify the unique key.
Click to show internal directories.
Click to hide internal directories.