model

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

View Source
var Answers = map[string]string{
	"yes":   "yes",
	"maybe": "maybe",
	"no":    "no",
	"skip":  "skip",
}

Answers lists the accepted answers

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	ID           int
	UserID       int
	PairID       int
	ExperimentID int
	Answer       sql.NullString
	Duration     int
}

Assignment tracks the answer of a worker to a given FilePair of an Experiment

func (*Assignment) AnswerStr

func (a *Assignment) AnswerStr() string

AnswerStr returns the string value, using "" if it's not set

type Experiment

type Experiment struct {
	ID          int
	Name        string
	Description string
}

Experiment groups a certain amount of FilePairs

type Feature

type Feature struct {
	Name   string
	Weight float64
}

Feature represents one name-value feature of file

type File

type File struct {
	BlobID       string
	RepositoryID string
	CommitHash   string
	Path         string
	Content      string
	Hash         string
}

File contains the info of a File

type FilePair

type FilePair struct {
	ID           int
	Score        float64
	Diff         string
	ExperimentID int
	Left         File
	Right        File
}

FilePair represents the pairs of files to annotate

type Role

type Role string

Role represents the position of a app User

const (
	// Requester is the role of a user that can review assignments, users, stats of experiments...
	Requester Role = "requester"
	// Worker is the role of a user that can answer assignments
	Worker Role = "worker"
)

func (*Role) Scan

func (r *Role) Scan(value interface{}) error

Scan sets the Role with the passed string

func (Role) String added in v0.0.1

func (r Role) String() string

String returns the string value of the Role

func (Role) Value

func (r Role) Value() (driver.Value, error)

Value returns the string value of the Role

type User

type User struct {
	ID        int
	Login     string // GitHub account username
	Username  string // Real name, as returned by GitHub
	AvatarURL string
	Role      Role
}

User of the application; can be Requester or Workers

Jump to

Keyboard shortcuts

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