Documentation
¶
Index ¶
- type ExpAnnotationResponse
- type HTTPError
- type Response
- func NewAssignmentsResponse(as []*model.Assignment) *Response
- func NewCountResponse(c int) *Response
- func NewEmptyResponse() *Response
- func NewExpAnnotationsResponse(data ExpAnnotationResponse) *Response
- func NewExperimentResponse(e *model.Experiment, progress float32) *Response
- func NewExperimentsResponse(experiments []*model.Experiment, progresses []float32) *Response
- func NewFeaturesResponse(fs []*model.Feature) *Response
- func NewFilePairResponse(fp *model.FilePair, leftLOC, rightLOC int) *Response
- func NewListFilePairsResponse(fps []*model.FilePair) *Response
- func NewUserResponse(u *model.User) *Response
- func NewVersionResponse(version string) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpAnnotationResponse ¶
type ExpAnnotationResponse struct { Yes int `json:"yes"` Maybe int `json:"maybe"` No int `json:"no"` Skip int `json:"skip"` Unanswered int `json:"unanswered"` Total int `json:"total"` }
ExpAnnotationResponse stores the data needed by NewExpAnnotationsResponse
type HTTPError ¶
HTTPError defines an Error message as it will be written in the http.Response
func NewHTTPError ¶
NewHTTPError returns an Error
type Response ¶
type Response struct { Status int `json:"status"` Data interface{} `json:"data,omitempty"` Errors []HTTPError `json:"errors,omitempty"` }
Response encapsulate the content of an http.Response
func NewAssignmentsResponse ¶
func NewAssignmentsResponse(as []*model.Assignment) *Response
NewAssignmentsResponse returns a Response for the passed Assignment
func NewCountResponse ¶
NewCountResponse returns a Response for the total of a count
func NewEmptyResponse ¶
func NewEmptyResponse() *Response
NewEmptyResponse returns an empty Response
func NewExpAnnotationsResponse ¶
func NewExpAnnotationsResponse(data ExpAnnotationResponse) *Response
NewExpAnnotationsResponse returns a Response for the Experiment Annotation results
func NewExperimentResponse ¶
func NewExperimentResponse(e *model.Experiment, progress float32) *Response
NewExperimentResponse returns a Response for the passed Experiment
func NewExperimentsResponse ¶ added in v0.0.2
func NewExperimentsResponse(experiments []*model.Experiment, progresses []float32) *Response
NewExperimentsResponse returns a Response with a list of Experiments
func NewFeaturesResponse ¶
NewFeaturesResponse returns a Response for the passed Features
func NewFilePairResponse ¶
NewFilePairResponse returns a Response for the given FilePair
func NewListFilePairsResponse ¶
NewListFilePairsResponse returns a Response for the given FilePairs
func NewUserResponse ¶
NewUserResponse returns a Response for the passed User
func NewVersionResponse ¶ added in v0.0.1
NewVersionResponse returns a Repsponse with current version of the server