backend

package
v0.0.0-...-3b55539 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CANDIDATE uint = 0
	TRAIN     uint = 1
	VAL       uint = 2
)

Variables

This section is empty.

Functions

func DeleteTag

func DeleteTag(tagId int) (err error)

func ExportDataset

func ExportDataset(dataType uint) (text string, err error)

func GetEngine

func GetEngine() *xorm.Engine

func Init

func Init()

Types

type Dataset

type Dataset struct {
	Id          int       `xorm:"pk autoincr"           json:"dataset_id,omitempty"`
	TagId       int       `xorm:"unique(tag_file)"      json:"tag_id,omitempty"`
	Tag         *Tag      `xorm:"-"                     json:"tag,omitempty"`
	FileId      int       `xorm:"unique(tag_file)"      json:"file_id,omitempty"`
	File        *File     `xorm:"-"                     json:"file,omitempty"`
	DataType    uint      `xorm:"tinyint(1) default(0)" json:"data_type,omitempty"`
	Description string    `xorm:"varchar(256)"          json:"description,omitempty"`
	CreatedAt   time.Time `xorm:"created"               json:"created_at,omitempty"`
}

func SaveDataset

func SaveDataset(file *File, tag *Tag, dataType uint, desc string) (dataset *Dataset, err error)

func (*Dataset) FillObject

func (dataset *Dataset) FillObject() (err error)

func (*Dataset) SetFile

func (dataset *Dataset) SetFile(file *File)

func (*Dataset) SetTag

func (dataset *Dataset) SetTag(tag *Tag)

type File

type File struct {
	Id        int       `xorm:"pk autoincr"                 json:"file_id,omitempty"`
	Key       string    `xorm:"varchar(128) notnull unique" json:"key,omitempty"`
	Type      string    `xorm:"varchar(32)"                 json:"type,omitempty"`
	Width     int       `xorm:"integer(4)"                  json:"width,omitempty"`
	Height    int       `xorm:"integer(4)"                  json:"height,omitempty"`
	CreatedAt time.Time `xorm:"created"                     json:"created_at,omitempty"`
}

func UploadFile

func UploadFile(realFile *multipart.FileHeader) (file *File, err error)

type Tag

type Tag struct {
	Id         int       `xorm:"pk autoincr"                 json:"tag_id,omitempty"`
	Name       string    `xorm:"varchar(128) notnull unique" json:"name,omitempty"`
	TrainCount int       `xorm:"tinyint(1) default(0)"       json:"train_count,omitempty"`
	TestCount  int       `xorm:"tinyint(1) default(0)"       json:"test_count,omitempty"`
	CreatedAt  time.Time `xorm:"created"                     json:"created_at,omitempty"`
}

func SaveTag

func SaveTag(realTag string) (tag *Tag, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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