Documentation ¶
Index ¶
- Variables
- func ParseTaskName(prefix, taskName string) (string, int, error)
- func QueuePath(projectID, location, queue string) string
- func TaskToPbTask(task *Task) (*taskspb.Task, error)
- type CloudTasksClient
- type Iterator
- type OAuthToken
- type OIDCToken
- type Scheduler
- func (s *Scheduler) Create(ctx context.Context, task *Task, opts ...gax.CallOption) error
- func (s *Scheduler) Delete(ctx context.Context, taskName string, opts ...gax.CallOption) error
- func (s *Scheduler) List(opts ...gax.CallOption) *Iterator
- func (s *Scheduler) Sync(ctx context.Context, tasks []*Task, opts ...gax.CallOption) error
- type Task
- type TaskIterator
- type TaskLister
- type TaskListerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTaskValidation = errors.New("task validation error") ErrTaskAlreadyExists = errors.New("task already exists") )
View Source
var Done = iterator.Done
View Source
var ErrInvalidTask = errors.New("invalid task")
View Source
var ErrInvalidTaskName = errors.New("invalid task name")
Functions ¶
Types ¶
type CloudTasksClient ¶
type CloudTasksClient interface { ListTasks(ctx context.Context, req *taskspb.ListTasksRequest, opts ...gax.CallOption) *cloudtasks.TaskIterator CreateTask(ctx context.Context, req *taskspb.CreateTaskRequest, opts ...gax.CallOption) (*taskspb.Task, error) DeleteTask(ctx context.Context, req *taskspb.DeleteTaskRequest, opts ...gax.CallOption) error }
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
func NewIterator(t TaskLister, queuePath, prefix string, opts ...gax.CallOption) *Iterator
type OAuthToken ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func New ¶
func New(client CloudTasksClient, projectID, location, queue, prefix string) *Scheduler
type Task ¶
type Task struct { QueuePath string Prefix string ID string ScheduledAt time.Time Request *http.Request Authorization isAuthorizationToken Version int }
func PbTaskToTask ¶
type TaskIterator ¶
type TaskLister ¶
type TaskLister interface {
ListTasks(ctx context.Context, req *taskspb.ListTasksRequest, opts ...gax.CallOption) TaskIterator
}
type TaskListerFunc ¶
type TaskListerFunc func(ctx context.Context, req *taskspb.ListTasksRequest, opts ...gax.CallOption) *cloudtasks.TaskIterator
func (TaskListerFunc) ListTasks ¶
func (f TaskListerFunc) ListTasks(ctx context.Context, req *taskspb.ListTasksRequest, opts ...gax.CallOption) TaskIterator
Click to show internal directories.
Click to hide internal directories.