taskqueue

package
v2.3.0-rc.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2016 License: BSD-3-Clause, Apache-2.0 Imports: 12 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"`

	// RetryCount: The number of leases applied to this task.
	RetryCount 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"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "EnqueueTimestamp") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

func (*Task) MarshalJSON

func (s *Task) MarshalJSON() ([]byte, error)

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"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Acl") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

func (*TaskQueue) MarshalJSON

func (s *TaskQueue) MarshalJSON() ([]byte, error)

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"`

	// ForceSendFields is a list of field names (e.g. "AdminEmails") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

TaskQueueAcl: ACLs that are applicable to this TaskQueue object.

func (*TaskQueueAcl) MarshalJSON

func (s *TaskQueueAcl) MarshalJSON() ([]byte, error)

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"`

	// ForceSendFields is a list of field names (e.g. "LeasedLastHour") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

TaskQueueStats: Statistics for the TaskQueue object in question.

func (*TaskQueueStats) MarshalJSON

func (s *TaskQueueStats) MarshalJSON() ([]byte, error)

type TaskqueuesGetCall

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

func (*TaskqueuesGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TaskqueuesGetCall) Do

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

Do executes the "taskqueue.taskqueues.get" call. Exactly one of *TaskQueue or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *TaskQueue.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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.

func (*TaskqueuesGetCall) IfNoneMatch

func (c *TaskqueuesGetCall) IfNoneMatch(entityTag string) *TaskqueuesGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

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"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Items") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

func (*Tasks) MarshalJSON

func (s *Tasks) MarshalJSON() ([]byte, error)

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"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Items") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

func (*Tasks2) MarshalJSON

func (s *Tasks2) MarshalJSON() ([]byte, error)

type TasksDeleteCall

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

func (*TasksDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksDeleteCall) Do

func (c *TasksDeleteCall) Do() error

Do executes the "taskqueue.tasks.delete" call.

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) Context

func (c *TasksGetCall) Context(ctx context.Context) *TasksGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksGetCall) Do

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

Do executes the "taskqueue.tasks.get" call. Exactly one of *Task or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Task.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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.

func (*TasksGetCall) IfNoneMatch

func (c *TasksGetCall) IfNoneMatch(entityTag string) *TasksGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type TasksInsertCall

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

func (*TasksInsertCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksInsertCall) Do

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

Do executes the "taskqueue.tasks.insert" call. Exactly one of *Task or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Task.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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) Context

func (c *TasksLeaseCall) Context(ctx context.Context) *TasksLeaseCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksLeaseCall) Do

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

Do executes the "taskqueue.tasks.lease" call. Exactly one of *Tasks or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Tasks.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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) Context

func (c *TasksListCall) Context(ctx context.Context) *TasksListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksListCall) Do

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

Do executes the "taskqueue.tasks.list" call. Exactly one of *Tasks2 or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Tasks2.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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.

func (*TasksListCall) IfNoneMatch

func (c *TasksListCall) IfNoneMatch(entityTag string) *TasksListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type TasksPatchCall

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

func (*TasksPatchCall) Context

func (c *TasksPatchCall) Context(ctx context.Context) *TasksPatchCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksPatchCall) Do

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

Do executes the "taskqueue.tasks.patch" call. Exactly one of *Task or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Task.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TasksUpdateCall) Do

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

Do executes the "taskqueue.tasks.update" call. Exactly one of *Task or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Task.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

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