Documentation ¶
Index ¶
- Constants
- func AddQuestion(conn *Connection, token string, locs common.Locations, ttr time.Duration) (qid uint64, err common.Error)
- func DeleteJob(conn *Connection, jid uint64) common.Error
- func GetAnswer1(conn *Connection, token string) (aid uint64, dr *common.DrivingRoute, err common.Error)
- func RegisterGarbage(conn *Connection, token string, qid uint64, delay time.Duration, ...) (gid uint64, err common.Error)
- func SetAnswer(conn *Connection, token string, qid uint64, rc int, dr *common.DrivingRoute) (aid uint64, err common.Error)
- func WithConnection(addr string, do func(*Connection) common.Error) common.Error
- type Answer
- type Connection
- type ConnectionError
- type Garbage
- type JobTooBigError
- type NotFoundError
- type Question
- type UnexpectedError
Constants ¶
View Source
const ( // TimeForever represents a very large duration. TimeForever = math.MaxUint32 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func AddQuestion ¶
func AddQuestion(conn *Connection, token string, locs common.Locations, ttr time.Duration) (qid uint64, err common.Error)
timeLimit = execution time limit ttr = time to run
func GetAnswer1 ¶
func GetAnswer1(conn *Connection, token string) (aid uint64, dr *common.DrivingRoute, err common.Error)
func RegisterGarbage ¶
func SetAnswer ¶
func SetAnswer(conn *Connection, token string, qid uint64, rc int, dr *common.DrivingRoute) (aid uint64, err common.Error)
func WithConnection ¶
Types ¶
type Answer ¶
type Answer struct { Timestamp time.Time `json:"t"` QuestionID uint64 `json:"q"` RetryCount int `json:"r"` DrivingRoute *common.DrivingRoute `json:"d"` }
func GetAnswer2 ¶
type Connection ¶
type ConnectionError ¶
type ConnectionError struct { common.DefaultCauser common.DefaultHasher }
func NewConnectionError ¶
func NewConnectionError(cause error, hash string) ConnectionError
func (ConnectionError) Error ¶
func (err ConnectionError) Error() string
func (ConnectionError) ErrorDetails ¶
func (err ConnectionError) ErrorDetails() string
type Garbage ¶
type Garbage struct { Timestamp time.Time `json:"t"` Token string `json:"x"` QuestionID uint64 `json:"q"` }
func FetchGarbage ¶
func FetchGarbage(conn *Connection) (gid uint64, g *Garbage, err common.Error)
type JobTooBigError ¶
type JobTooBigError struct { common.DefaultCauser common.DefaultHasher }
func NewJobTooBigError ¶
func NewJobTooBigError(cause error, hash string) JobTooBigError
func (JobTooBigError) Error ¶
func (err JobTooBigError) Error() string
func (JobTooBigError) ErrorDetails ¶
func (err JobTooBigError) ErrorDetails() string
type NotFoundError ¶
type NotFoundError struct { common.DefaultCauser common.DefaultHasher }
func NewNotFoundError ¶
func NewNotFoundError(cause error, hash string) NotFoundError
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
func (NotFoundError) ErrorDetails ¶
func (err NotFoundError) ErrorDetails() string
type Question ¶
type Question struct { Timestamp time.Time `json:"t"` Token string `json:"x"` Locations common.Locations `json:"l"` }
func FetchQuestion ¶
func FetchQuestion(conn *Connection) (qid uint64, q *Question, err common.Error)
func GetQuestion ¶
func GetQuestion(conn *Connection, qid uint64) (q *Question, err common.Error)
type UnexpectedError ¶
type UnexpectedError struct { common.DefaultCauser common.DefaultHasher }
func NewUnexpectedError ¶
func NewUnexpectedError(cause error, hash string) UnexpectedError
func (UnexpectedError) Error ¶
func (err UnexpectedError) Error() string
func (UnexpectedError) ErrorDetails ¶
func (err UnexpectedError) ErrorDetails() string
Click to show internal directories.
Click to hide internal directories.