task

package
v0.0.0-...-2780e7b Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2013 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeMap = make(map[string]Type)

TypeMap contains the types registered by RegisterType. Do not modify.

View Source
var Types []Type

Types are the sorted task types. Do not modify. This is updated by RegisterType.

Functions

func RegisterType

func RegisterType(tt Type)

Types

type Env

type Env interface {
	HTTPClient() *http.Client
	Logf(format string, args ...interface{})

	// GetMeta returns a blob up to 1MB in size. The key's
	// namespace is shared with all task types, so should
	// be prefixed.
	// If nothing is set, the return value is (nil, nil).
	GetMeta(key string) ([]byte, error)

	// SetMeta sets a blob up to 1MB in size. The key's
	// namespace is shared with all task types, so should
	// be prefixed.
	SetMeta(key string, value []byte) error
}

An Env is the environment a task Type needs to do its work.

type PolledTask

type PolledTask struct {
	ID        string    // without the "type." prefix.
	Created   time.Time // or zero
	Modified  time.Time // or zero
	Title     string
	OwnerHint string // optional. prefix or email address.
}

A PolledTask is an open task as returned by Type.Poll. It isn't written to the datastore as-is, but is converted to a new or existing qopher.Task.

func (*PolledTask) GetCreated

func (pt *PolledTask) GetCreated() time.Time

func (*PolledTask) GetModified

func (pt *PolledTask) GetModified() time.Time

type Type

type Type interface {
	Type() string                // "issue"
	PollInterval() time.Duration // minute granularity
	Poll(Env) ([]*PolledTask, error)
	TaskURL(id string) string
}

Type is a task type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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