logic

package
v0.0.0-...-5805fc1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterResulter

func RegisterResulter(r Resulter, f ResulterFunc)

RegisterResulter registers a function to be called lated via Call. It is usually called from the init function of a package that contains a Resulter.

func RegisterTasker

func RegisterTasker(t Tasker, f TaskerFunc)

RegisterTasker registers a function to be called lated via Call. It is usually called from the init function of a package that contains a Tasker.

Types

type InsDel

type InsDel struct {
	Inserted,
	Deleted int
}

func (*InsDel) Add

func (id *InsDel) Add(insDel InsDel)

type Resulter

type Resulter int

Resulter is a reference to a unique implementation of a ResulterFunc.

const (
	// Average computes the weighted average over all task results. It is included
	// in this package.
	Average Resulter = 1 + iota
)

func (Resulter) Call

func (r Resulter) Call(ctx context.Context, result model.KeyedResult, challenge model.Challenge) error

Call looks up a registered Resulter and calls it.

type ResulterFunc

type ResulterFunc func(ctx context.Context, result model.KeyedResult, challenge model.Challenge) error

ResulterFunc is a function that will compute skills for the referenced Result. It will call Taskers of encapsulated tasks on demand.

type Tasker

type Tasker int

Tasker is a reference to a unique implementation of a TaskerFunc.

const (
	// JunitTasker computes the skills for a specific task. It iterates
	// over all the submissions.
	JunitTasker Tasker = 1 + iota
	DiffTasker
)

func (Tasker) Call

func (t Tasker) Call(ctx context.Context, result model.KeyedResult, task model.KeyedTask, user model.User, startTime time.Time) (model.Skills, error)

Call looks up a registered Tasker and calls it.

type TaskerFunc

type TaskerFunc func(ctx context.Context, result model.KeyedResult, task model.KeyedTask, user model.User, startTime time.Time) (model.Skills, error)

TaskerFunc is a function that will compute task results for the given Task and User.

Jump to

Keyboard shortcuts

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