result

package
v0.0.0-...-d4285bb Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2014 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Some result names.
	NORESULT = "NoResult"
	TIMEOUT  = "Timeout"
	ERROR    = "Error"
	CODE     = "Code"
	//The different types of compilation that we can have.
	SUCCESS CompileType = iota
	WARNINGS
	ERRORS
	UNKNOWN
)

Variables

View Source
var (
	COMPILE_SUCCESS = []byte("Compiled successfully")
)

Functions

func HasChart

func HasChart(cs ...interface{}) bool

Types

type ChartVal

type ChartVal struct {
	Name   string
	X      int64
	Y      float64
	FileId bson.ObjectId
}

type Charter

type Charter interface {
	ChartVals() []*ChartVal
	GetName() string
}

Charter is used to display result data in a chart.

type Code

type Code struct {
	FileId bson.ObjectId
	Lang   string
	Data   string
}

Code is a Displayer used to display a source file's code.

func NewCode

func NewCode(fid bson.ObjectId, lang string, data []byte) *Code

NewCode

func (*Code) GetName

func (c *Code) GetName() string

GetName

func (*Code) GetType

func (c *Code) GetType() string

func (*Code) Reporter

func (c *Code) Reporter() Reporter

Reporter

func (*Code) Template

func (c *Code) Template() string

type Coder

type Coder interface {
	GetName() string
	Lines() []*Line
}

type CompileType

type CompileType uint

CompileType tells us what type of result compilation gave us.

type Displayer

type Displayer interface {
	GetType() string
	//GetName
	GetName() string
	//Reporter
	Reporter() Reporter
	//Template retrieves the name of a html template.
	//Each Displayer should therefore have a html file which specify how
	//its result is displayed. The return value of the Displayer's
	//Reporter method is passed to the template.
	//Here is an example for Javac:
	//
	//{{define "result"}}
	//{{if .Success}}
	//<h4 class="text-success">{{.Header}}</h4>
	//{{else}}
	//{{$content := setBreaks .Result}}
	//{{if .Warnings}}
	//<h4 class="text-warning">{{.Header}}</h4>
	//<p class="text-warning">{{$content}}</p>
	//{{else}}
	//<h4 class="text-danger">{{.Header}}</h4>
	//<p class="text-danger">{{$content}}</p>
	//{{end}}
	//{{end}}
	//{{end}}
	Template() string
}

Displayer is used to display result reports.

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is a Displayer used to indicate that an error occured when retrieving a Tool's result or running a Tool..

func NewError

func NewError(tipe, name string) *Error

NewError creates an Error. There are 3 types: Timeout, No result and error.

func (*Error) GetName

func (e *Error) GetName() string

GetName

func (*Error) GetType

func (e *Error) GetType() string

func (*Error) Reporter

func (e *Error) Reporter() Reporter

Reporter

func (*Error) Template

func (e *Error) Template() string

Template

type Line

type Line struct {
	Title       string
	Description string
	Start       int
	End         int
}

type Reporter

type Reporter interface{}

Reporter is an interface which represents a tool report on a snapshot.

type Tooler

type Tooler interface {
	GetType() string
	//Retrieves the result's db id.
	GetId() bson.ObjectId
	//Retrieves the file associated with the result's db id.
	GetFileId() bson.ObjectId
	GetTestId() bson.ObjectId
	//Retrieves this result's tool name.
	GetName() string
	//True if this result is partially stored on GridFS, false otherwise.
	OnGridFS() bool
	//Retrieves the report generated by the associated tool stored in this result.
	Reporter() Reporter
	//Sets this result's tool report. Used mainly to move data from/to GridFS
	SetReport(Reporter)
}

Tooler is used to store tool result data.

Jump to

Keyboard shortcuts

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