model

package
v0.0.0-...-7c9e097 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	ID          int        `xorm:"pk autoincr 'id'"`
	UserID      int        `xorm:"'user_id'"`
	Name        string     `xorm:"notnull"`
	CreateTime  *time.Time `xorm:"created"`
	Description string
	GitPath     string
	Path        string
}

Project corresponds to project table in db

func (*Project) CloneFromGitPath

func (p *Project) CloneFromGitPath(username string) error

CloneFromGitPath clone project form given git path

func (*Project) CreateProjectRoot

func (p *Project) CreateProjectRoot(username string) error

CreateProjectRoot create project root in the user home

func (*Project) GetWithID

func (p *Project) GetWithID(session *xorm.Session) (bool, error)

GetWithID returns project with given project id

func (*Project) GetWithUserID

func (p *Project) GetWithUserID(session *xorm.Session) ([]Project, error)

GetWithUserID returns projects with given user id

func (*Project) GetWithUserIDAndName

func (p *Project) GetWithUserIDAndName(session *xorm.Session) (bool, error)

GetWithUserIDAndName returns project with given user id and project name

func (*Project) Insert

func (p *Project) Insert(session *xorm.Session) (int, error)

Insert insert a project to db

func (Project) TableName

func (p Project) TableName() string

TableName defines table name

Jump to

Keyboard shortcuts

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