serializer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

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

type HTTPError interface {
	error
	StatusCode() int
}

HTTPError defines an Error message as it will be written in the http.Response

func NewHTTPError

func NewHTTPError(statusCode int, msg ...string) HTTPError

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

func NewCountResponse(c int) *Response

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

func NewFeaturesResponse(fs []*model.Feature) *Response

NewFeaturesResponse returns a Response for the passed Features

func NewFilePairResponse

func NewFilePairResponse(fp *model.FilePair, leftLOC, rightLOC int) *Response

NewFilePairResponse returns a Response for the given FilePair

func NewListFilePairsResponse

func NewListFilePairsResponse(fps []*model.FilePair) *Response

NewListFilePairsResponse returns a Response for the given FilePairs

func NewUserResponse

func NewUserResponse(u *model.User) *Response

NewUserResponse returns a Response for the passed User

func NewVersionResponse added in v0.0.1

func NewVersionResponse(version string) *Response

NewVersionResponse returns a Repsponse with current version of the server

Jump to

Keyboard shortcuts

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