Documentation ¶
Overview ¶
This package is in an experimental state, and does not currently follow conventions and style of the rest of goamz or common Go conventions. It must be polished before it's considered a first-class package in goamz.
Index ¶
- type Assignment
- type CreateHITResponse
- type Error
- type ExternalQuestion
- type GetAssignmentsForHITResponse
- type HIT
- type HTMLContent
- type HTMLQuestion
- type Locale
- type MTurk
- func (mt *MTurk) CreateHIT(title, description string, question interface{}, reward Price, ...) (h *HIT, err error)
- func (mt *MTurk) CreateHITOfType(hitTypeId string, q ExternalQuestion, lifetimeInSeconds uint, ...) (h *HIT, err error)
- func (mt *MTurk) GetAssignmentsForHIT(hitId string) (r *Assignment, err error)
- func (mt *MTurk) SearchHITs() (s *SearchHITsResult, err error)
- type Price
- type QualificationRequirement
- type SearchHITsResponse
- type SearchHITsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct { AssignmentId string WorkerId string HITId string AssignmentStatus string AutoApprovalTime string AcceptTime string SubmitTime string ApprovalTime string Answer string }
func (Assignment) Answers ¶
func (a Assignment) Answers() (answers map[string]string)
type CreateHITResponse ¶
The wrapper data structure returned by CreateHIT http://goo.gl/PskcX
type Error ¶
type Error struct { StatusCode int // HTTP status code (200, 403, ...) Code string // EC2 error code ("UnsupportedOperation", ...) Message string // The human-oriented error message RequestId string }
Error encapsulates an error returned by MTurk.
type ExternalQuestion ¶
type ExternalQuestion struct { XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd ExternalQuestion"` ExternalURL string FrameHeight int }
Data structure holding the contents of an "external" question. http://goo.gl/NP8Aa
type GetAssignmentsForHITResponse ¶
type GetAssignmentsForHITResponse struct { RequestId string `xml:"OperationRequest>RequestId"` GetAssignmentsForHITResult struct { Request xmlRequest NumResults uint TotalNumResults uint PageNumber uint Assignment Assignment } }
type HIT ¶
type HIT struct { Request xmlRequest HITId string HITTypeId string CreationTime string Title string Description string Keywords string HITStatus string Reward Price LifetimeInSeconds uint AssignmentDurationInSeconds uint MaxAssignments uint AutoApprovalDelayInSeconds uint QualificationRequirement QualificationRequirement Question interface{} RequesterAnnotation string NumberofSimilarHITs uint HITReviewStatus string NumberOfAssignmentsPending uint NumberOfAssignmentsAvailable uint NumberOfAssignmentsCompleted uint }
The data structure representing a "human interface task" (HIT) Currently only supports "external" questions, because Go structs don't support union types. http://goo.gl/NP8Aa This type is returned, for example, from SearchHITs http://goo.gl/PskcX
type HTMLContent ¶
type HTMLContent struct {
Content string `xml:",innerxml"`
}
Holds the html content of the HTMLQuestion.
type HTMLQuestion ¶
type HTMLQuestion struct { XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd HTMLQuestion"` HTMLContent HTMLContent FrameHeight int }
Data structure holding the contents of an "html" question. http://goo.gl/hQn5An
type MTurk ¶
func (*MTurk) CreateHIT ¶
func (mt *MTurk) CreateHIT( title, description string, question interface{}, reward Price, assignmentDurationInSeconds, lifetimeInSeconds uint, keywords string, maxAssignments uint, qualificationRequirement *QualificationRequirement, requesterAnnotation string) (h *HIT, err error)
Corresponds to the "CreateHIT" operation of the Mechanical Turk API. http://goo.gl/cDBRc Currently only supports "external" questions (see "HIT" struct above). If "keywords", "maxAssignments", "qualificationRequirement" or "requesterAnnotation" are the zero value for their types, they will not be included in the request.
func (*MTurk) CreateHITOfType ¶
func (mt *MTurk) CreateHITOfType(hitTypeId string, q ExternalQuestion, lifetimeInSeconds uint, maxAssignments uint, requesterAnnotation string) (h *HIT, err error)
Corresponds to the "CreateHIT" operation of the Mechanical Turk API, using an existing "hit type". http://goo.gl/cDBRc Currently only supports "external" questions (see "HIT" struct above). If "maxAssignments" or "requesterAnnotation" are the zero value for their types, they will not be included in the request.
func (*MTurk) GetAssignmentsForHIT ¶
func (mt *MTurk) GetAssignmentsForHIT(hitId string) (r *Assignment, err error)
Get the Assignments for a HIT.
func (*MTurk) SearchHITs ¶
func (mt *MTurk) SearchHITs() (s *SearchHITsResult, err error)
Corresponds to "SearchHITs" operation of Mechanical Turk. http://goo.gl/PskcX Currenlty supports none of the optional parameters.
type Price ¶
Common price structure used in requests and responses http://goo.gl/tE4AV
type QualificationRequirement ¶
type QualificationRequirement struct { QualificationTypeId string Comparator string IntegerValue int LocaleValue Locale RequiredToPreview string }
Data structure used to specify requirements for the worker used in CreateHIT, for example http://goo.gl/LvRo9
type SearchHITsResponse ¶
type SearchHITsResponse struct { RequestId string `xml:"OperationRequest>RequestId"` SearchHITsResult SearchHITsResult }
The wrapper data structure returned by SearchHITs http://goo.gl/PskcX
type SearchHITsResult ¶
type SearchHITsResult struct { NumResults uint PageNumber uint TotalNumResults uint HITs []HIT `xml:"HIT"` }
The main data structure returned by SearchHITs http://goo.gl/PskcX