taskqueue

package
v0.0.0-...-0297be7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package taskqueue provides access to the TaskQueue API.

See https://developers.google.com/appengine/docs/python/taskqueue/rest

Usage example:

import "google.golang.org/api/taskqueue/v1beta2"
...
taskqueueService, err := taskqueue.New(oauthHttpClient)

Index

Constants

View Source
const (
	// Manage your Tasks and Taskqueues
	TaskqueueScope = "https://www.googleapis.com/auth/taskqueue"

	// Consume Tasks from your Taskqueues
	TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskqueue.consumer"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Taskqueues *TaskqueuesService

	Tasks *TasksService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

type Task

type Task struct {
	// EnqueueTimestamp: Time (in seconds since the epoch) at which the task
	// was enqueued.
	EnqueueTimestamp int64 `json:"enqueueTimestamp,omitempty,string"`

	// Id: Name of the task.
	Id string `json:"id,omitempty"`

	// Kind: The kind of object returned, in this case set to task.
	Kind string `json:"kind,omitempty"`

	// LeaseTimestamp: Time (in seconds since the epoch) at which the task
	// lease will expire. This value is 0 if the task isnt currently leased
	// out to a worker.
	LeaseTimestamp int64 `json:"leaseTimestamp,omitempty,string"`

	// PayloadBase64: A bag of bytes which is the task payload. The payload
	// on the JSON side is always Base64 encoded.
	PayloadBase64 string `json:"payloadBase64,omitempty"`

	// QueueName: Name of the queue that the task is in.
	QueueName string `json:"queueName,omitempty"`

	// Retry_count: The number of leases applied to this task.
	Retry_count int64 `json:"retry_count,omitempty"`

	// Tag: Tag for the task, could be used later to lease tasks grouped by
	// a specific tag.
	Tag string `json:"tag,omitempty"`
}

type TaskQueue

type TaskQueue struct {
	// Acl: ACLs that are applicable to this TaskQueue object.
	Acl *TaskQueueAcl `json:"acl,omitempty"`

	// Id: Name of the taskqueue.
	Id string `json:"id,omitempty"`

	// Kind: The kind of REST object returned, in this case taskqueue.
	Kind string `json:"kind,omitempty"`

	// MaxLeases: The number of times we should lease out tasks before
	// giving up on them. If unset we lease them out forever until a worker
	// deletes the task.
	MaxLeases int64 `json:"maxLeases,omitempty"`

	// Stats: Statistics for the TaskQueue object in question.
	Stats *TaskQueueStats `json:"stats,omitempty"`
}

type TaskQueueAcl

type TaskQueueAcl struct {
	// AdminEmails: Email addresses of users who are "admins" of the
	// TaskQueue. This means they can control the queue, eg set ACLs for the
	// queue.
	AdminEmails []string `json:"adminEmails,omitempty"`

	// ConsumerEmails: Email addresses of users who can "consume" tasks from
	// the TaskQueue. This means they can Dequeue and Delete tasks from the
	// queue.
	ConsumerEmails []string `json:"consumerEmails,omitempty"`

	// ProducerEmails: Email addresses of users who can "produce" tasks into
	// the TaskQueue. This means they can Insert tasks into the queue.
	ProducerEmails []string `json:"producerEmails,omitempty"`
}

type TaskQueueStats

type TaskQueueStats struct {
	// LeasedLastHour: Number of tasks leased in the last hour.
	LeasedLastHour int64 `json:"leasedLastHour,omitempty,string"`

	// LeasedLastMinute: Number of tasks leased in the last minute.
	LeasedLastMinute int64 `json:"leasedLastMinute,omitempty,string"`

	// OldestTask: The timestamp (in seconds since the epoch) of the oldest
	// unfinished task.
	OldestTask int64 `json:"oldestTask,omitempty,string"`

	// TotalTasks: Number of tasks in the queue.
	TotalTasks int64 `json:"totalTasks,omitempty"`
}

type TaskqueuesGetCall

type TaskqueuesGetCall struct {
	// contains filtered or unexported fields
}

func (*TaskqueuesGetCall) Do

func (c *TaskqueuesGetCall) Do() (*TaskQueue, error)

func (*TaskqueuesGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TaskqueuesGetCall) GetStats

func (c *TaskqueuesGetCall) GetStats(getStats bool) *TaskqueuesGetCall

GetStats sets the optional parameter "getStats": Whether to get stats.

type TaskqueuesService

type TaskqueuesService struct {
	// contains filtered or unexported fields
}

func NewTaskqueuesService

func NewTaskqueuesService(s *Service) *TaskqueuesService

func (*TaskqueuesService) Get

func (r *TaskqueuesService) Get(project string, taskqueue string) *TaskqueuesGetCall

Get: Get detailed information about a TaskQueue.

type Tasks

type Tasks struct {
	// Items: The actual list of tasks returned as a result of the lease
	// operation.
	Items []*Task `json:"items,omitempty"`

	// Kind: The kind of object returned, a list of tasks.
	Kind string `json:"kind,omitempty"`
}

type Tasks2

type Tasks2 struct {
	// Items: The actual list of tasks currently active in the TaskQueue.
	Items []*Task `json:"items,omitempty"`

	// Kind: The kind of object returned, a list of tasks.
	Kind string `json:"kind,omitempty"`
}

type TasksDeleteCall

type TasksDeleteCall struct {
	// contains filtered or unexported fields
}

func (*TasksDeleteCall) Do

func (c *TasksDeleteCall) Do() error

func (*TasksDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TasksGetCall

type TasksGetCall struct {
	// contains filtered or unexported fields
}

func (*TasksGetCall) Do

func (c *TasksGetCall) Do() (*Task, error)

func (*TasksGetCall) Fields

func (c *TasksGetCall) Fields(s ...googleapi.Field) *TasksGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TasksInsertCall

type TasksInsertCall struct {
	// contains filtered or unexported fields
}

func (*TasksInsertCall) Do

func (c *TasksInsertCall) Do() (*Task, error)

func (*TasksInsertCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TasksLeaseCall

type TasksLeaseCall struct {
	// contains filtered or unexported fields
}

func (*TasksLeaseCall) Do

func (c *TasksLeaseCall) Do() (*Tasks, error)

func (*TasksLeaseCall) Fields

func (c *TasksLeaseCall) Fields(s ...googleapi.Field) *TasksLeaseCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TasksLeaseCall) GroupByTag

func (c *TasksLeaseCall) GroupByTag(groupByTag bool) *TasksLeaseCall

GroupByTag sets the optional parameter "groupByTag": When true, all returned tasks will have the same tag

func (*TasksLeaseCall) Tag

func (c *TasksLeaseCall) Tag(tag string) *TasksLeaseCall

Tag sets the optional parameter "tag": The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag

type TasksListCall

type TasksListCall struct {
	// contains filtered or unexported fields
}

func (*TasksListCall) Do

func (c *TasksListCall) Do() (*Tasks2, error)

func (*TasksListCall) Fields

func (c *TasksListCall) Fields(s ...googleapi.Field) *TasksListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TasksPatchCall

type TasksPatchCall struct {
	// contains filtered or unexported fields
}

func (*TasksPatchCall) Do

func (c *TasksPatchCall) Do() (*Task, error)

func (*TasksPatchCall) Fields

func (c *TasksPatchCall) Fields(s ...googleapi.Field) *TasksPatchCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TasksService

type TasksService struct {
	// contains filtered or unexported fields
}

func NewTasksService

func NewTasksService(s *Service) *TasksService

func (*TasksService) Delete

func (r *TasksService) Delete(project string, taskqueue string, task string) *TasksDeleteCall

Delete: Delete a task from a TaskQueue.

func (*TasksService) Get

func (r *TasksService) Get(project string, taskqueue string, task string) *TasksGetCall

Get: Get a particular task from a TaskQueue.

func (*TasksService) Insert

func (r *TasksService) Insert(project string, taskqueue string, task *Task) *TasksInsertCall

Insert: Insert a new task in a TaskQueue

func (*TasksService) Lease

func (r *TasksService) Lease(project string, taskqueue string, numTasks int64, leaseSecs int64) *TasksLeaseCall

Lease: Lease 1 or more tasks from a TaskQueue.

func (*TasksService) List

func (r *TasksService) List(project string, taskqueue string) *TasksListCall

List: List Tasks in a TaskQueue

func (*TasksService) Patch

func (r *TasksService) Patch(project string, taskqueue string, task string, newLeaseSeconds int64, task2 *Task) *TasksPatchCall

Patch: Update tasks that are leased out of a TaskQueue. This method supports patch semantics.

func (*TasksService) Update

func (r *TasksService) Update(project string, taskqueue string, task string, newLeaseSeconds int64, task2 *Task) *TasksUpdateCall

Update: Update tasks that are leased out of a TaskQueue.

type TasksUpdateCall

type TasksUpdateCall struct {
	// contains filtered or unexported fields
}

func (*TasksUpdateCall) Do

func (c *TasksUpdateCall) Do() (*Task, error)

func (*TasksUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

Jump to

Keyboard shortcuts

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