Documentation ¶
Index ¶
- Variables
- func ChangeProjectStatus(p *Project, isClosed bool) error
- func ChangeProjectStatusByRepoIDAndID(repoID, projectID int64, isClosed bool) error
- func DeleteBoardByID(boardID int64) error
- func DeleteProjectByID(id int64) error
- func DeleteProjectByIDCtx(ctx context.Context, id int64) error
- func IsBoardTypeValid(p BoardType) bool
- func IsErrProjectBoardNotExist(err error) bool
- func IsErrProjectNotExist(err error) bool
- func IsTypeValid(p Type) bool
- func MoveIssuesOnProjectBoard(board *Board, sortedIssueIDs map[int64]int64) error
- func NewBoard(board *Board) error
- func NewProject(p *Project) error
- func SetDefaultBoard(projectID, boardID int64) error
- func UpdateBoard(ctx context.Context, board *Board) error
- func UpdateBoardSorting(bs BoardList) error
- func UpdateProject(ctx context.Context, p *Project) error
- type Board
- type BoardList
- type BoardType
- type ErrProjectBoardNotExist
- type ErrProjectNotExist
- type Project
- type ProjectIssue
- type ProjectsConfig
- type SearchOptions
- type Type
Constants ¶
This section is empty.
Variables ¶
var BoardColorPattern = regexp.MustCompile("^#[0-9a-fA-F]{6}$")
BoardColorPattern is a regexp witch can validate BoardColor
Functions ¶
func ChangeProjectStatus ¶
ChangeProjectStatus toggle a project between opened and closed
func ChangeProjectStatusByRepoIDAndID ¶
ChangeProjectStatusByRepoIDAndID toggles a project between opened and closed
func DeleteBoardByID ¶
DeleteBoardByID removes all issues references to the project board.
func DeleteProjectByID ¶
DeleteProjectByID deletes a project from a repository.
func DeleteProjectByIDCtx ¶
DeleteProjectByIDCtx deletes a project from a repository.
func IsBoardTypeValid ¶
IsBoardTypeValid checks if the project board type is valid
func IsErrProjectBoardNotExist ¶
IsErrProjectBoardNotExist checks if an error is a ErrProjectBoardNotExist
func IsErrProjectNotExist ¶
IsErrProjectNotExist checks if an error is a ErrProjectNotExist
func MoveIssuesOnProjectBoard ¶
MoveIssuesOnProjectBoard moves or keeps issues in a column and sorts them inside that column
func SetDefaultBoard ¶
SetDefaultBoard represents a board for issues not assigned to one if boardID is 0 unset default
func UpdateBoard ¶
UpdateBoard updates a project board
func UpdateBoardSorting ¶
UpdateBoardSorting update project board sorting
Types ¶
type Board ¶
type Board struct { ID int64 `xorm:"pk autoincr"` Title string Default bool `xorm:"NOT NULL DEFAULT false"` // issues not assigned to a specific board will be assigned to this board Sorting int8 `xorm:"NOT NULL DEFAULT 0"` Color string `xorm:"VARCHAR(7)"` ProjectID int64 `xorm:"INDEX NOT NULL"` CreatorID int64 `xorm:"NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Board is used to represent boards on a project
type BoardType ¶
type BoardType uint8
BoardType is used to represent a project board type
const ( // BoardTypeNone is a project board type that has no predefined columns BoardTypeNone BoardType = iota // BoardTypeBasicKanban is a project board type that has basic predefined columns BoardTypeBasicKanban // BoardTypeBugTriage is a project board type that has predefined columns suited to hunting down bugs BoardTypeBugTriage )
type ErrProjectBoardNotExist ¶
type ErrProjectBoardNotExist struct {
BoardID int64
}
ErrProjectBoardNotExist represents a "ProjectBoardNotExist" kind of error.
func (ErrProjectBoardNotExist) Error ¶
func (err ErrProjectBoardNotExist) Error() string
type ErrProjectNotExist ¶
ErrProjectNotExist represents a "ProjectNotExist" kind of error.
func (ErrProjectNotExist) Error ¶
func (err ErrProjectNotExist) Error() string
type Project ¶
type Project struct { ID int64 `xorm:"pk autoincr"` Title string `xorm:"INDEX NOT NULL"` Description string `xorm:"TEXT"` RepoID int64 `xorm:"INDEX"` CreatorID int64 `xorm:"NOT NULL"` IsClosed bool `xorm:"INDEX"` BoardType BoardType Type Type RenderedContent string `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` ClosedDateUnix timeutil.TimeStamp }
Project represents a project board
func GetProjectByID ¶
GetProjectByID returns the projects in a repository
func GetProjects ¶
GetProjects returns a list of all projects that have been created in the repository
func (*Project) NumClosedIssues ¶
NumClosedIssues return counter of closed issues assigned to a project
func (*Project) NumOpenIssues ¶
NumOpenIssues return counter of open issues assigned to a project
type ProjectIssue ¶
type ProjectIssue struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` ProjectID int64 `xorm:"INDEX"` // If 0, then it has not been added to a specific board in the project ProjectBoardID int64 `xorm:"INDEX"` // the sorting order on the board Sorting int64 `xorm:"NOT NULL DEFAULT 0"` }
ProjectIssue saves relation from issue to a project
type ProjectsConfig ¶
ProjectsConfig is used to identify the type of board that is being created
func GetProjectsConfig ¶
func GetProjectsConfig() []ProjectsConfig
GetProjectsConfig retrieves the types of configurations projects could have
type SearchOptions ¶
type SearchOptions struct { RepoID int64 Page int IsClosed util.OptionalBool SortType string Type Type }
SearchOptions are options for GetProjects