models

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscriptionEntityUnknown = iota
	SubscriptionEntityNamespace
	SubscriptionEntityList
	SubscriptionEntityTask
)
View Source
const ErrCodeAttachmentDoesNotBelongToTask = 4020

ErrCodeAttachmentDoesNotBelongToTask holds the unique world-error code of this error

View Source
const ErrCodeBucketDoesNotBelongToList = 10002

ErrCodeBucketDoesNotBelongToList holds the unique world-error code of this error

View Source
const ErrCodeBucketDoesNotExist = 10001

ErrCodeBucketDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeBucketLimitExceeded = 10004

ErrCodeBucketLimitExceeded holds the unique world-error code of this error

View Source
const ErrCodeBulkTasksMustBeInSameList = 4003

ErrCodeBulkTasksMustBeInSameList holds the unique world-error code of this error

View Source
const ErrCodeBulkTasksNeedAtLeastOne = 4004

ErrCodeBulkTasksNeedAtLeastOne holds the unique world-error code of this error

View Source
const ErrCodeCannotDeleteLastTeamMember = 6006

ErrCodeCannotDeleteLastTeamMember holds the unique world-error code of this error

View Source
const ErrCodeCannotRemoveLastBucket = 10003

ErrCodeCannotRemoveLastBucket holds the unique world-error code of this error

View Source
const ErrCodeIDCannotBeZero = 2001

ErrCodeIDCannotBeZero holds the unique world-error code of this error

View Source
const ErrCodeInvalidData = 2002

ErrCodeInvalidData holds the unique world-error code of this error

View Source
const ErrCodeInvalidRelationKind = 4007

ErrCodeInvalidRelationKind holds the unique world-error code of this error

View Source
const ErrCodeInvalidRight = 9001

ErrCodeInvalidRight holds the unique world-error code of this error

View Source
const ErrCodeInvalidSortOrder = 4014

ErrCodeInvalidSortOrder holds the unique world-error code of this error

View Source
const ErrCodeInvalidSortParam = 4013

ErrCodeInvalidSortParam holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskField = 4016

ErrCodeInvalidTaskField holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskFilterComparator = 4017

ErrCodeInvalidTaskFilterComparator holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskFilterConcatinator = 4018

ErrCodeInvalidTaskFilterConcatinator holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskFilterValue = 4019

ErrCodeInvalidTaskFilterValue holds the unique world-error code of this error

View Source
const ErrCodeLabelDoesNotExist = 8002

ErrCodeLabelDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeLabelIsAlreadyOnTask = 8001

ErrCodeLabelIsAlreadyOnTask holds the unique world-error code of this error

View Source
const ErrCodeLinkSharePasswordInvalid = 13002

ErrCodeLinkSharePasswordInvalid holds the unique world-error code of this error

View Source
const ErrCodeLinkSharePasswordRequired = 13001

ErrCodeLinkSharePasswordRequired holds the unique world-error code of this error

View Source
const ErrCodeListCannotBelongToAPseudoNamespace = 3009

ErrCodeListCannotBelongToAPseudoNamespace holds the unique world-error code of this error

View Source
const ErrCodeListDoesNotExist = 3001

ErrCodeListDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeListIdentifierIsNotUnique = 3007

ErrCodeListIdentifierIsNotUnique holds the unique world-error code of this error

View Source
const ErrCodeListIsArchived = 3008

ErrCodeListIsArchived holds the unique world-error code of this error

View Source
const ErrCodeListMustBelongToANamespace = 3010

ErrCodeListMustBelongToANamespace holds the unique world-error code of this error

View Source
const ErrCodeListShareDoesNotExist = 3006

ErrCodeListShareDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeListTitleCannotBeEmpty = 3005

ErrCodeListTitleCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeNamespaceDoesNotExist = 5001

ErrCodeNamespaceDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeNamespaceIsArchived = 5012

ErrCodeNamespaceIsArchived holds the unique world-error code of this error

View Source
const ErrCodeNamespaceNameCannotBeEmpty = 5006

ErrCodeNamespaceNameCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeNeedToHaveListReadAccess = 3004

ErrCodeNeedToHaveListReadAccess holds the unique world-error code of this error

View Source
const ErrCodeNeedToHaveNamespaceReadAccess = 5009

ErrCodeNeedToHaveNamespaceReadAccess holds the unique world-error code of this error

View Source
const ErrCodeNoRightToSeeTask = 4005

ErrCodeNoRightToSeeTask holds the unique world-error code of this error

View Source
const ErrCodeOnlyOneDoneBucketPerList = 10005

ErrCodeOnlyOneDoneBucketPerList holds the unique world-error code of this error

View Source
const ErrCodeParentTaskCannotBeTheSame = 4006

ErrCodeParentTaskCannotBeTheSame holds the unique world-error code of this error

View Source
const ErrCodeRelationAlreadyExists = 4008

ErrCodeRelationAlreadyExists holds the unique world-error code of this error

View Source
const ErrCodeRelationDoesNotExist = 4009

ErrCodeRelationDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeRelationTasksCannotBeTheSame = 4010

ErrCodeRelationTasksCannotBeTheSame holds the unique world-error code of this error

View Source
const ErrCodeSavedFilterDoesNotExist = 11001

ErrCodeSavedFilterDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeSavedFilterNotAvailableForLinkShare = 11002

ErrCodeSavedFilterNotAvailableForLinkShare holds the unique world-error code of this error

View Source
const ErrCodeSubscriptionAlreadyExists = 12002

ErrCodeSubscriptionAlreadyExists holds the unique world-error code of this error

View Source
const ErrCodeTaskAttachmentDoesNotExist = 4011

ErrCodeTaskAttachmentDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTaskAttachmentIsTooLarge = 4012

ErrCodeTaskAttachmentIsTooLarge holds the unique world-error code of this error

View Source
const ErrCodeTaskCannotBeEmpty = 4001

ErrCodeTaskCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeTaskCommentDoesNotExist = 4015

ErrCodeTaskCommentDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTaskDoesNotExist = 4002

ErrCodeTaskDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTeamAlreadyHasAccess = 6004

ErrCodeTeamAlreadyHasAccess holds the unique world-error code of this error

View Source
const ErrCodeTeamDoesNotExist = 6002

ErrCodeTeamDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTeamDoesNotHaveAccessToList = 6007

ErrCodeTeamDoesNotHaveAccessToList holds the unique world-error code of this error

View Source
const ErrCodeTeamDoesNotHaveAccessToNamespace = 5010

ErrCodeTeamDoesNotHaveAccessToNamespace holds the unique world-error code of this error

View Source
const ErrCodeTeamNameCannotBeEmpty = 6001

ErrCodeTeamNameCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeUnknownSubscriptionEntityType = 12001

ErrCodeUnknownSubscriptionEntityType holds the unique world-error code of this error

View Source
const ErrCodeUserAlreadyAssigned = 4021

ErrCodeUserAlreadyAssigned holds the unique world-error code of this error

View Source
const ErrCodeUserAlreadyHasAccess = 7002

ErrCodeUserAlreadyHasAccess holds the unique world-error code of this error

View Source
const ErrCodeUserAlreadyHasNamespaceAccess = 5011

ErrCodeUserAlreadyHasNamespaceAccess holds the unique world-error code of this error

View Source
const ErrCodeUserDoesNotHaveAccessToList = 7003

ErrCodeUserDoesNotHaveAccessToList holds the unique world-error code of this error

View Source
const ErrCodeUserDoesNotHaveAccessToNamespace = 5003

ErrCodeUserDoesNotHaveAccessToNamespace holds the unique world-error code of this error

View Source
const ErrCodeUserHasNoAccessToLabel = 8003

ErrCodeUserHasNoAccessToLabel holds the unique world-error code of this error

View Source
const ErrCodeUserIsMemberOfTeam = 6005

ErrCodeUserIsMemberOfTeam holds the unique world-error code of this error

View Source
const ErrorCodeGenericForbidden = 0001

ErrorCodeGenericForbidden holds the unique world-error code of this error

View Source
const ListBackgroundUpload string = "upload"

ListBackgroundUpload represents the list upload background type

View Source
const (
	RightUnknown = -1
)

define unknown right

Variables

View Source
var FavoritesPseudoList = List{
	ID:          -1,
	Title:       "Favorites",
	Description: "This list has all tasks marked as favorites.",
	NamespaceID: FavoritesPseudoNamespace.ID,
	IsFavorite:  true,
	Created:     time.Now(),
	Updated:     time.Now(),
}

FavoritesPseudoList holds all tasks marked as favorites

View Source
var FavoritesPseudoNamespace = Namespace{
	ID:          -2,
	Title:       "Favorites",
	Description: "Favorite lists and tasks.",
	Created:     time.Now(),
	Updated:     time.Now(),
}

FavoritesPseudoNamespace is a pseudo namespace used to hold favorited lists and tasks

View Source
var SavedFiltersPseudoNamespace = Namespace{
	ID:          -3,
	Title:       "Filters",
	Description: "Saved filters.",
	Created:     time.Now(),
	Updated:     time.Now(),
}

SavedFiltersPseudoNamespace is a pseudo namespace used to hold saved filters

View Source
var SharedListsPseudoNamespace = Namespace{
	ID:          -1,
	Title:       "Shared Lists",
	Description: "Lists of other users shared with you via teams or directly.",
	Created:     time.Now(),
	Updated:     time.Now(),
}

SharedListsPseudoNamespace is a pseudo namespace used to hold shared lists

Functions

func CreateList added in v0.19.0

func CreateList(s *xorm.Session, list *List, auth web.Auth) (err error)

func CreateNewNamespaceForUser added in v0.16.0

func CreateNewNamespaceForUser(s *xorm.Session, user *user.User) (err error)

CreateNewNamespaceForUser creates a new namespace for a user. To prevent import cycles, we can't do that directly in the user.Create function.

func DeleteUser added in v0.18.0

func DeleteUser(s *xorm.Session, u *user.User) (err error)

DeleteUser completely removes a user and all their associated lists, namespaces and tasks. This action is irrevocable. Public to allow deletion from the CLI.

func ExportUserData added in v0.18.0

func ExportUserData(s *xorm.Session, u *user.User) (err error)

func FindMentionedUsersInText added in v0.18.0

func FindMentionedUsersInText(s *xorm.Session, text string) (users map[int64]*user.User, err error)

func GetLinkSharesByIDs added in v0.17.0

func GetLinkSharesByIDs(s *xorm.Session, ids []int64) (shares map[int64]*LinkSharing, err error)

GetLinkSharesByIDs returns all link shares from a slice of ids

func GetListsByIDs added in v0.16.0

func GetListsByIDs(s *xorm.Session, listIDs []int64) (lists map[int64]*List, err error)

GetListsByIDs returns a map of lists from a slice with list ids

func GetSubscriptions added in v0.20.0

func GetSubscriptions(s *xorm.Session, entityType SubscriptionEntityType, entityIDs []int64, a web.Auth) (listsToSubscriptions map[int64]*Subscription, err error)

GetSubscriptions returns a map of subscriptions to a set of given entity IDs

func GetTables

func GetTables() []interface{}

GetTables returns all structs which are also a table.

func GetTotalCount

func GetTotalCount(counting interface{}) (count int64, err error)

GetTotalCount returns the total amount of something

func GetUserOrLinkShareUser added in v0.17.0

func GetUserOrLinkShareUser(s *xorm.Session, a web.Auth) (uu *user.User, err error)

GetUserOrLinkShareUser returns either a user or a link share disguised as a user.

func IsErrAttachmentAndCoverMustBelongToTheSameTask added in v0.20.0

func IsErrAttachmentAndCoverMustBelongToTheSameTask(err error) bool

IsErrAttachmentAndCoverMustBelongToTheSameTask checks if an error is ErrAttachmentDoesNotBelongToTask.

func IsErrBucketDoesNotBelongToList

func IsErrBucketDoesNotBelongToList(err error) bool

IsErrBucketDoesNotBelongToList checks if an error is ErrBucketDoesNotBelongToList.

func IsErrBucketDoesNotExist

func IsErrBucketDoesNotExist(err error) bool

IsErrBucketDoesNotExist checks if an error is ErrBucketDoesNotExist.

func IsErrBucketLimitExceeded added in v0.15.0

func IsErrBucketLimitExceeded(err error) bool

IsErrBucketLimitExceeded checks if an error is ErrBucketLimitExceeded.

func IsErrBulkTasksMustBeInSameList

func IsErrBulkTasksMustBeInSameList(err error) bool

IsErrBulkTasksMustBeInSameList checks if an error is a ErrBulkTasksMustBeInSameList.

func IsErrBulkTasksNeedAtLeastOne

func IsErrBulkTasksNeedAtLeastOne(err error) bool

IsErrBulkTasksNeedAtLeastOne checks if an error is a ErrBulkTasksNeedAtLeastOne.

func IsErrCannotDeleteLastTeamMember

func IsErrCannotDeleteLastTeamMember(err error) bool

IsErrCannotDeleteLastTeamMember checks if an error is ErrCannotDeleteLastTeamMember.

func IsErrCannotRemoveLastBucket

func IsErrCannotRemoveLastBucket(err error) bool

IsErrCannotRemoveLastBucket checks if an error is ErrCannotRemoveLastBucket.

func IsErrGenericForbidden

func IsErrGenericForbidden(err error) bool

IsErrGenericForbidden checks if an error is a ErrGenericForbidden.

func IsErrIDCannotBeZero

func IsErrIDCannotBeZero(err error) bool

IsErrIDCannotBeZero checks if an error is a ErrIDCannotBeZero.

func IsErrInvalidData

func IsErrInvalidData(err error) bool

IsErrInvalidData checks if an error is a ErrIDCannotBeZero.

func IsErrInvalidRelationKind

func IsErrInvalidRelationKind(err error) bool

IsErrInvalidRelationKind checks if an error is ErrInvalidRelationKind.

func IsErrInvalidRight

func IsErrInvalidRight(err error) bool

IsErrInvalidRight checks if an error is ErrInvalidRight.

func IsErrInvalidSortOrder

func IsErrInvalidSortOrder(err error) bool

IsErrInvalidSortOrder checks if an error is ErrInvalidSortOrder.

func IsErrInvalidSortParam

func IsErrInvalidSortParam(err error) bool

IsErrInvalidSortParam checks if an error is ErrInvalidSortParam.

func IsErrInvalidTaskField

func IsErrInvalidTaskField(err error) bool

IsErrInvalidTaskField checks if an error is ErrInvalidTaskField.

func IsErrInvalidTaskFilterComparator

func IsErrInvalidTaskFilterComparator(err error) bool

IsErrInvalidTaskFilterComparator checks if an error is ErrInvalidTaskFilterComparator.

func IsErrInvalidTaskFilterConcatinator

func IsErrInvalidTaskFilterConcatinator(err error) bool

IsErrInvalidTaskFilterConcatinator checks if an error is ErrInvalidTaskFilterConcatinator.

func IsErrInvalidTaskFilterValue added in v0.14.0

func IsErrInvalidTaskFilterValue(err error) bool

IsErrInvalidTaskFilterValue checks if an error is ErrInvalidTaskFilterValue.

func IsErrLabelDoesNotExist

func IsErrLabelDoesNotExist(err error) bool

IsErrLabelDoesNotExist checks if an error is ErrLabelDoesNotExist.

func IsErrLabelIsAlreadyOnTask

func IsErrLabelIsAlreadyOnTask(err error) bool

IsErrLabelIsAlreadyOnTask checks if an error is ErrLabelIsAlreadyOnTask.

func IsErrLinkSharePasswordInvalid added in v0.17.0

func IsErrLinkSharePasswordInvalid(err error) bool

IsErrLinkSharePasswordInvalid checks if an error is ErrLinkSharePasswordInvalid.

func IsErrLinkSharePasswordRequired added in v0.17.0

func IsErrLinkSharePasswordRequired(err error) bool

IsErrLinkSharePasswordRequired checks if an error is ErrLinkSharePasswordRequired.

func IsErrListCannotBelongToAPseudoNamespace added in v0.19.1

func IsErrListCannotBelongToAPseudoNamespace(err error) bool

IsErrListCannotBelongToAPseudoNamespace checks if an error is a list is archived error.

func IsErrListDoesNotExist

func IsErrListDoesNotExist(err error) bool

IsErrListDoesNotExist checks if an error is a ErrListDoesNotExist.

func IsErrListIdentifierIsNotUnique

func IsErrListIdentifierIsNotUnique(err error) bool

IsErrListIdentifierIsNotUnique checks if an error is a ErrListIdentifierIsNotUnique.

func IsErrListIsArchived

func IsErrListIsArchived(err error) bool

IsErrListIsArchived checks if an error is a list is archived error.

func IsErrListMustBelongToANamespace added in v0.20.0

func IsErrListMustBelongToANamespace(err error) bool

IsErrListMustBelongToANamespace checks if an error is a list must belong to a namespace error.

func IsErrListShareDoesNotExist

func IsErrListShareDoesNotExist(err error) bool

IsErrListShareDoesNotExist checks if an error is a ErrListShareDoesNotExist.

func IsErrListTitleCannotBeEmpty

func IsErrListTitleCannotBeEmpty(err error) bool

IsErrListTitleCannotBeEmpty checks if an error is a ErrListTitleCannotBeEmpty.

func IsErrNamespaceDoesNotExist

func IsErrNamespaceDoesNotExist(err error) bool

IsErrNamespaceDoesNotExist checks if an error is a ErrNamespaceDoesNotExist.

func IsErrNamespaceIsArchived

func IsErrNamespaceIsArchived(err error) bool

IsErrNamespaceIsArchived checks if an error is a .

func IsErrNamespaceNameCannotBeEmpty

func IsErrNamespaceNameCannotBeEmpty(err error) bool

IsErrNamespaceNameCannotBeEmpty checks if an error is a ErrNamespaceDoesNotExist.

func IsErrNeedToHaveListReadAccess

func IsErrNeedToHaveListReadAccess(err error) bool

IsErrNeedToHaveListReadAccess checks if an error is a ErrListDoesNotExist.

func IsErrNeedToHaveNamespaceReadAccess

func IsErrNeedToHaveNamespaceReadAccess(err error) bool

IsErrNeedToHaveNamespaceReadAccess checks if an error is a ErrNamespaceDoesNotExist.

func IsErrNoRightToSeeTask

func IsErrNoRightToSeeTask(err error) bool

IsErrNoRightToSeeTask checks if an error is ErrNoRightToSeeTask.

func IsErrOnlyOneDoneBucketPerList added in v0.17.0

func IsErrOnlyOneDoneBucketPerList(err error) bool

IsErrOnlyOneDoneBucketPerList checks if an error is ErrBucketLimitExceeded.

func IsErrParentTaskCannotBeTheSame

func IsErrParentTaskCannotBeTheSame(err error) bool

IsErrParentTaskCannotBeTheSame checks if an error is ErrParentTaskCannotBeTheSame.

func IsErrRelationAlreadyExists

func IsErrRelationAlreadyExists(err error) bool

IsErrRelationAlreadyExists checks if an error is ErrRelationAlreadyExists.

func IsErrRelationDoesNotExist

func IsErrRelationDoesNotExist(err error) bool

IsErrRelationDoesNotExist checks if an error is ErrRelationDoesNotExist.

func IsErrRelationTasksCannotBeTheSame

func IsErrRelationTasksCannotBeTheSame(err error) bool

IsErrRelationTasksCannotBeTheSame checks if an error is ErrRelationTasksCannotBeTheSame.

func IsErrSavedFilterDoesNotExist added in v0.15.0

func IsErrSavedFilterDoesNotExist(err error) bool

IsErrSavedFilterDoesNotExist checks if an error is ErrSavedFilterDoesNotExist.

func IsErrSavedFilterNotAvailableForLinkShare added in v0.15.0

func IsErrSavedFilterNotAvailableForLinkShare(err error) bool

IsErrSavedFilterNotAvailableForLinkShare checks if an error is ErrSavedFilterNotAvailableForLinkShare.

func IsErrSubscriptionAlreadyExists added in v0.17.0

func IsErrSubscriptionAlreadyExists(err error) bool

IsErrSubscriptionAlreadyExists checks if an error is ErrSubscriptionAlreadyExists.

func IsErrTaskAttachmentDoesNotExist

func IsErrTaskAttachmentDoesNotExist(err error) bool

IsErrTaskAttachmentDoesNotExist checks if an error is ErrTaskAttachmentDoesNotExist.

func IsErrTaskAttachmentIsTooLarge

func IsErrTaskAttachmentIsTooLarge(err error) bool

IsErrTaskAttachmentIsTooLarge checks if an error is ErrTaskAttachmentIsTooLarge.

func IsErrTaskCannotBeEmpty

func IsErrTaskCannotBeEmpty(err error) bool

IsErrTaskCannotBeEmpty checks if an error is a ErrListDoesNotExist.

func IsErrTaskCommentDoesNotExist

func IsErrTaskCommentDoesNotExist(err error) bool

IsErrTaskCommentDoesNotExist checks if an error is ErrTaskCommentDoesNotExist.

func IsErrTaskDoesNotExist

func IsErrTaskDoesNotExist(err error) bool

IsErrTaskDoesNotExist checks if an error is a ErrListDoesNotExist.

func IsErrTeamAlreadyHasAccess

func IsErrTeamAlreadyHasAccess(err error) bool

IsErrTeamAlreadyHasAccess checks if an error is ErrTeamAlreadyHasAccess.

func IsErrTeamDoesNotExist

func IsErrTeamDoesNotExist(err error) bool

IsErrTeamDoesNotExist checks if an error is ErrTeamDoesNotExist.

func IsErrTeamDoesNotHaveAccessToList

func IsErrTeamDoesNotHaveAccessToList(err error) bool

IsErrTeamDoesNotHaveAccessToList checks if an error is a ErrListDoesNotExist.

func IsErrTeamDoesNotHaveAccessToNamespace

func IsErrTeamDoesNotHaveAccessToNamespace(err error) bool

IsErrTeamDoesNotHaveAccessToNamespace checks if an error is a ErrNamespaceDoesNotExist.

func IsErrTeamNameCannotBeEmpty

func IsErrTeamNameCannotBeEmpty(err error) bool

IsErrTeamNameCannotBeEmpty checks if an error is a ErrNamespaceDoesNotExist.

func IsErrUnknownSubscriptionEntityType added in v0.17.0

func IsErrUnknownSubscriptionEntityType(err error) bool

IsErrUnknownSubscriptionEntityType checks if an error is ErrUnknownSubscriptionEntityType.

func IsErrUserAlreadyAssigned added in v0.20.0

func IsErrUserAlreadyAssigned(err error) bool

IsErrUserAlreadyAssigned checks if an error is ErrUserAlreadyAssigned.

func IsErrUserAlreadyHasAccess

func IsErrUserAlreadyHasAccess(err error) bool

IsErrUserAlreadyHasAccess checks if an error is ErrUserAlreadyHasAccess.

func IsErrUserAlreadyHasNamespaceAccess

func IsErrUserAlreadyHasNamespaceAccess(err error) bool

IsErrUserAlreadyHasNamespaceAccess checks if an error is ErrUserAlreadyHasNamespaceAccess.

func IsErrUserDoesNotHaveAccessToList

func IsErrUserDoesNotHaveAccessToList(err error) bool

IsErrUserDoesNotHaveAccessToList checks if an error is a ErrListDoesNotExist.

func IsErrUserDoesNotHaveAccessToNamespace

func IsErrUserDoesNotHaveAccessToNamespace(err error) bool

IsErrUserDoesNotHaveAccessToNamespace checks if an error is a ErrNamespaceDoesNotExist.

func IsErrUserHasNoAccessToLabel

func IsErrUserHasNoAccessToLabel(err error) bool

IsErrUserHasNoAccessToLabel checks if an error is ErrUserHasNoAccessToLabel.

func IsErrUserIsMemberOfTeam

func IsErrUserIsMemberOfTeam(err error) bool

IsErrUserIsMemberOfTeam checks if an error is ErrUserIsMemberOfTeam.

func ListUsersFromList

func ListUsersFromList(s *xorm.Session, l *List, search string) (users []*user.User, err error)

ListUsersFromList returns a list with all users who have access to a list, regardless of the method which gave them access

func RegisterListeners added in v0.17.0

func RegisterListeners()

RegisterListeners registers all event listeners

func RegisterOldExportCleanupCron added in v0.18.0

func RegisterOldExportCleanupCron()

func RegisterOverdueReminderCron added in v0.17.0

func RegisterOverdueReminderCron()

RegisterOverdueReminderCron registers a function which checks once a day for tasks that are overdue and not done.

func RegisterReminderCron added in v0.16.0

func RegisterReminderCron()

RegisterReminderCron registers a cron function which runs every minute to check if any reminders are due the next minute to send emails.

func RegisterUserDeletionCron added in v0.18.0

func RegisterUserDeletionCron()

RegisterUserDeletionCron registers the cron job that actually removes users who are scheduled to delete.

func RemoveUnsplashPhoto added in v0.14.0

func RemoveUnsplashPhoto(s *xorm.Session, fileID int64) (err error)

RemoveUnsplashPhoto removes an unsplash photo from the db

func SetEngine

func SetEngine() (err error)

SetEngine sets the xorm.Engine

func SetListBackground added in v0.14.0

func SetListBackground(s *xorm.Session, listID int64, background *files.File, blurHash string) (err error)

SetListBackground sets a background file as list background in the db

func SetupTests

func SetupTests()

SetupTests takes care of seting up the db, fixtures etc. This is an extra function to be able to call the fixtures setup from the integration tests.

func UpdateList added in v0.19.0

func UpdateList(s *xorm.Session, list *List, auth web.Auth, updateListBackground bool) (err error)

func VerifyLinkSharePassword added in v0.17.0

func VerifyLinkSharePassword(share *LinkSharing, password string) (err error)

VerifyLinkSharePassword checks if a password of a link share matches a provided one.

Types

type Bucket

type Bucket struct {
	// The unique, numeric id of this bucket.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"bucket"`
	// The title of this bucket.
	Title string `xorm:"text not null" valid:"required" minLength:"1" json:"title"`
	// The list this bucket belongs to.
	ListID int64 `xorm:"bigint not null" json:"list_id" param:"list"`
	// All tasks which belong to this bucket.
	Tasks []*Task `xorm:"-" json:"tasks"`

	// How many tasks can be at the same time on this board max
	Limit int64 `xorm:"default 0" json:"limit" minimum:"0" valid:"range(0|9223372036854775807)"`
	// If this bucket is the "done bucket". All tasks moved into this bucket will automatically marked as done. All tasks marked as done from elsewhere will be moved into this bucket.
	IsDoneBucket bool `xorm:"BOOL" json:"is_done_bucket"`

	// The position this bucket has when querying all buckets. See the tasks.position property on how to use this.
	Position float64 `xorm:"double null" json:"position"`

	// A timestamp when this bucket was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this bucket was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	// The user who initially created the bucket.
	CreatedBy   *user.User `xorm:"-" json:"created_by" valid:"-"`
	CreatedByID int64      `xorm:"bigint not null" json:"-"`

	// Including the task collection type so we can use task filters on kanban
	TaskCollection `xorm:"-" json:"-"`

	web.Rights   `xorm:"-" json:"-"`
	web.CRUDable `xorm:"-" json:"-"`
}

Bucket represents a kanban bucket

func (*Bucket) CanCreate

func (b *Bucket) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can create a new bucket

func (*Bucket) CanDelete

func (b *Bucket) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete an existing bucket

func (*Bucket) CanUpdate

func (b *Bucket) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update an existing bucket

func (*Bucket) Create

func (b *Bucket) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new bucket @Summary Create a new bucket @Description Creates a new kanban bucket on a list. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List Id" @Param bucket body models.Bucket true "The bucket object" @Success 200 {object} models.Bucket "The created bucket object." @Failure 400 {object} web.HTTPError "Invalid bucket object provided." @Failure 404 {object} web.HTTPError "The list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/buckets [put]

func (*Bucket) Delete

func (b *Bucket) Delete(s *xorm.Session, a web.Auth) (err error)

Delete removes a bucket, but no tasks @Summary Deletes an existing bucket @Description Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a list. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param listID path int true "List Id" @Param bucketID path int true "Bucket Id" @Success 200 {object} models.Message "Successfully deleted." @Failure 404 {object} web.HTTPError "The bucket does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/buckets/{bucketID} [delete]

func (*Bucket) ReadAll

func (b *Bucket) ReadAll(s *xorm.Session, auth web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns all buckets with their tasks for a certain list @Summary Get all kanban buckets of a list @Description Returns all kanban buckets with belong to a list including their tasks. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List Id" @Param page query int false "The page number for tasks. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of tasks per bucket per page. This parameter is limited by the configured maximum of items per page." @Param s query string false "Search tasks by task text." @Param filter_by query string false "The name of the field to filter by. Allowed values are all task properties. Task properties which are their own object require passing in the id of that entity. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." @Param filter_value query string false "The value to filter for." @Param filter_comparator query string false "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less`, `less_equals`, `like` and `in`. `in` expects comma-separated values in `filter_value`. Defaults to `equals`" @Param filter_concat query string false "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`." @Param filter_include_nulls query string false "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`." @Success 200 {array} models.Bucket "The buckets with their tasks" @Failure 500 {object} models.Message "Internal server error" @Router /lists/{id}/buckets [get]

func (*Bucket) TableName

func (b *Bucket) TableName() string

TableName returns the table name for this bucket.

func (*Bucket) Update

func (b *Bucket) Update(s *xorm.Session, a web.Auth) (err error)

Update Updates an existing bucket @Summary Update an existing bucket @Description Updates an existing kanban bucket. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param listID path int true "List Id" @Param bucketID path int true "Bucket Id" @Param bucket body models.Bucket true "The bucket object" @Success 200 {object} models.Bucket "The created bucket object." @Failure 400 {object} web.HTTPError "Invalid bucket object provided." @Failure 404 {object} web.HTTPError "The bucket does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/buckets/{bucketID} [post]

type BulkAssignees

type BulkAssignees struct {
	// A list with all assignees
	Assignees []*user.User `json:"assignees"`
	TaskID    int64        `json:"-" param:"listtask"`

	web.CRUDable `json:"-"`
	web.Rights   `json:"-"`
}

BulkAssignees is a helper struct used to update multiple assignees at once.

func (*BulkAssignees) CanCreate

func (ba *BulkAssignees) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can add a new assignee

func (*BulkAssignees) Create

func (ba *BulkAssignees) Create(s *xorm.Session, a web.Auth) (err error)

Create adds new assignees to a task @Summary Add multiple new assignees to a task @Description Adds multiple new assignees to a task. The assignee needs to have access to the list, the doer must be able to edit this task. Every user not in the list will be unassigned from the task, pass an empty array to unassign everyone. @tags assignees @Accept json @Produce json @Security JWTKeyAuth @Param assignee body models.BulkAssignees true "The array of assignees" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskAssginee "The created assingees object." @Failure 400 {object} web.HTTPError "Invalid assignee object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees/bulk [post]

type BulkTask

type BulkTask struct {
	// A list of task ids to update
	IDs   []int64 `json:"task_ids"`
	Tasks []*Task `json:"-"`
	Task
}

BulkTask is the definition of a bulk update task

func (*BulkTask) CanUpdate

func (bt *BulkTask) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user is allowed to update a task

func (*BulkTask) GetTasksByIDs

func (bt *BulkTask) GetTasksByIDs(s *xorm.Session) (err error)

GetTasksByIDs returns all tasks for a list of ids

func (*BulkTask) Update

func (bt *BulkTask) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a bunch of tasks at once @Summary Update a bunch of tasks at once @Description Updates a bunch of tasks at once. This includes marking them as done. Note: although you could supply another ID, it will be ignored. Use task_ids instead. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param task body models.BulkTask true "The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update." @Success 200 {object} models.Task "The updated task object." @Failure 400 {object} web.HTTPError "Invalid task object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its list)" @Failure 500 {object} models.Message "Internal error" @Router /tasks/bulk [post]

type DataExportReadyNotification added in v0.18.0

type DataExportReadyNotification struct {
	User *user.User `json:"user"`
}

DataExportReadyNotification represents a DataExportReadyNotification notification

func (*DataExportReadyNotification) Name added in v0.18.0

Name returns the name of the notification

func (*DataExportReadyNotification) ToDB added in v0.18.0

func (n *DataExportReadyNotification) ToDB() interface{}

ToDB returns the DataExportReadyNotification notification in a format which can be saved in the db

func (*DataExportReadyNotification) ToMail added in v0.18.0

ToMail returns the mail notification for DataExportReadyNotification

type DataExportRequestEvent added in v0.18.0

type DataExportRequestEvent struct {
	User *user.User
}

DataExportRequestEvent represents a DataExportRequestEvent event

func (*DataExportRequestEvent) Name added in v0.18.0

func (t *DataExportRequestEvent) Name() string

Name defines the name for DataExportRequestEvent

type DatabaseNotifications added in v0.17.0

type DatabaseNotifications struct {
	notifications.DatabaseNotification

	// Whether or not to mark this notification as read or unread.
	// True is read, false is unread.
	Read bool `xorm:"-" json:"read"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

DatabaseNotifications is a wrapper around the crud operations that come with a database notification.

func (*DatabaseNotifications) CanUpdate added in v0.17.0

func (d *DatabaseNotifications) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can mark a notification as read.

func (*DatabaseNotifications) ReadAll added in v0.17.0

func (d *DatabaseNotifications) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (ls interface{}, resultCount int, numberOfEntries int64, err error)

ReadAll returns all database notifications for a user @Summary Get all notifications for the current user @Description Returns an array with all notifications for the current user. @tags subscriptions @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Security JWTKeyAuth @Success 200 {array} notifications.DatabaseNotification "The notifications" @Failure 403 {object} web.HTTPError "Link shares cannot have notifications." @Failure 500 {object} models.Message "Internal error" @Router /notifications [get]

func (*DatabaseNotifications) Update added in v0.17.0

func (d *DatabaseNotifications) Update(s *xorm.Session, a web.Auth) (err error)

Update marks a notification as read. @Summary Mark a notification as (un-)read @Description Marks a notification as either read or unread. A user can only mark their own notifications as read. @tags subscriptions @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Notification ID" @Success 200 {object} models.DatabaseNotifications "The notification to mark as read." @Failure 403 {object} web.HTTPError "The user does not have access to that notification." @Failure 403 {object} web.HTTPError "Link shares cannot have notifications." @Failure 404 {object} web.HTTPError "The notification does not exist." @Failure 500 {object} models.Message "Internal error" @Router /notifications/{id} [post]

type DecreaseListCounter added in v0.17.0

type DecreaseListCounter struct {
}

func (*DecreaseListCounter) Handle added in v0.17.0

func (s *DecreaseListCounter) Handle(msg *message.Message) (err error)

func (*DecreaseListCounter) Name added in v0.17.0

func (s *DecreaseListCounter) Name() string

type DecreaseNamespaceCounter added in v0.17.0

type DecreaseNamespaceCounter struct {
}

DecreaseNamespaceCounter represents a listener

func (*DecreaseNamespaceCounter) Handle added in v0.17.0

func (s *DecreaseNamespaceCounter) Handle(msg *message.Message) (err error)

Hanlde is executed when the event DecreaseNamespaceCounter listens on is fired

func (*DecreaseNamespaceCounter) Name added in v0.17.0

func (s *DecreaseNamespaceCounter) Name() string

Name defines the name for the DecreaseNamespaceCounter listener

type DecreaseTaskCounter added in v0.17.0

type DecreaseTaskCounter struct {
}

DecreaseTaskCounter represents a listener

func (*DecreaseTaskCounter) Handle added in v0.17.0

func (s *DecreaseTaskCounter) Handle(msg *message.Message) (err error)

Handle is executed when the event DecreaseTaskCounter listens on is fired

func (*DecreaseTaskCounter) Name added in v0.17.0

func (s *DecreaseTaskCounter) Name() string

Name defines the name for the DecreaseTaskCounter listener

type DecreaseTeamCounter added in v0.17.0

type DecreaseTeamCounter struct {
}

DecreaseTeamCounter represents a listener

func (*DecreaseTeamCounter) Handle added in v0.17.0

func (s *DecreaseTeamCounter) Handle(msg *message.Message) (err error)

Hanlde is executed when the event DecreaseTeamCounter listens on is fired

func (*DecreaseTeamCounter) Name added in v0.17.0

func (s *DecreaseTeamCounter) Name() string

Name defines the name for the DecreaseTeamCounter listener

type ErrAttachmentDoesNotBelongToTask added in v0.20.0

type ErrAttachmentDoesNotBelongToTask struct {
	TaskID       int64
	AttachmentID int64
}

ErrAttachmentDoesNotBelongToTask represents an error where the provided task cover attachment does not belong to the same task

func (ErrAttachmentDoesNotBelongToTask) Error added in v0.20.0

func (ErrAttachmentDoesNotBelongToTask) HTTPError added in v0.20.0

HTTPError holds the http error description

type ErrBucketDoesNotBelongToList

type ErrBucketDoesNotBelongToList struct {
	BucketID int64
	ListID   int64
}

ErrBucketDoesNotBelongToList represents an error where a kanban bucket does not belong to a list

func (ErrBucketDoesNotBelongToList) Error

func (ErrBucketDoesNotBelongToList) HTTPError

func (err ErrBucketDoesNotBelongToList) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrBucketDoesNotExist

type ErrBucketDoesNotExist struct {
	BucketID int64
}

ErrBucketDoesNotExist represents an error where a kanban bucket does not exist

func (ErrBucketDoesNotExist) Error

func (err ErrBucketDoesNotExist) Error() string

func (ErrBucketDoesNotExist) HTTPError

func (err ErrBucketDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrBucketLimitExceeded added in v0.15.0

type ErrBucketLimitExceeded struct {
	BucketID int64
	Limit    int64
	TaskID   int64 // may be 0
}

ErrBucketLimitExceeded represents an error where a task is being created or moved to a bucket which has its limit already exceeded.

func (ErrBucketLimitExceeded) Error added in v0.15.0

func (err ErrBucketLimitExceeded) Error() string

func (ErrBucketLimitExceeded) HTTPError added in v0.15.0

func (err ErrBucketLimitExceeded) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrBulkTasksMustBeInSameList

type ErrBulkTasksMustBeInSameList struct {
	ShouldBeID int64
	IsID       int64
}

ErrBulkTasksMustBeInSameList represents a "ErrBulkTasksMustBeInSameList" kind of error.

func (ErrBulkTasksMustBeInSameList) Error

func (ErrBulkTasksMustBeInSameList) HTTPError

func (err ErrBulkTasksMustBeInSameList) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrBulkTasksNeedAtLeastOne

type ErrBulkTasksNeedAtLeastOne struct{}

ErrBulkTasksNeedAtLeastOne represents a "ErrBulkTasksNeedAtLeastOne" kind of error.

func (ErrBulkTasksNeedAtLeastOne) Error

func (err ErrBulkTasksNeedAtLeastOne) Error() string

func (ErrBulkTasksNeedAtLeastOne) HTTPError

func (err ErrBulkTasksNeedAtLeastOne) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrCannotDeleteLastTeamMember

type ErrCannotDeleteLastTeamMember struct {
	TeamID int64
	UserID int64
}

ErrCannotDeleteLastTeamMember represents an error where a user wants to delete the last member of a team (probably himself)

func (ErrCannotDeleteLastTeamMember) Error

func (ErrCannotDeleteLastTeamMember) HTTPError

HTTPError holds the http error description

type ErrCannotRemoveLastBucket

type ErrCannotRemoveLastBucket struct {
	BucketID int64
	ListID   int64
}

ErrCannotRemoveLastBucket represents an error where a kanban bucket is the last on a list and thus cannot be removed.

func (ErrCannotRemoveLastBucket) Error

func (err ErrCannotRemoveLastBucket) Error() string

func (ErrCannotRemoveLastBucket) HTTPError

func (err ErrCannotRemoveLastBucket) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrGenericForbidden

type ErrGenericForbidden struct{}

ErrGenericForbidden represents a "UsernameAlreadyExists" kind of error.

func (ErrGenericForbidden) Error

func (err ErrGenericForbidden) Error() string

func (ErrGenericForbidden) HTTPError

func (err ErrGenericForbidden) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrIDCannotBeZero

type ErrIDCannotBeZero struct{}

ErrIDCannotBeZero represents a "IDCannotBeZero" kind of error. Used if an ID (of something, not defined) is 0 where it should not.

func (ErrIDCannotBeZero) Error

func (err ErrIDCannotBeZero) Error() string

func (ErrIDCannotBeZero) HTTPError

func (err ErrIDCannotBeZero) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidData

type ErrInvalidData struct {
	Message string
}

ErrInvalidData represents a "ErrInvalidData" kind of error. Used when a struct is invalid -> validation failed.

func (ErrInvalidData) Error

func (err ErrInvalidData) Error() string

func (ErrInvalidData) HTTPError

func (err ErrInvalidData) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidRelationKind

type ErrInvalidRelationKind struct {
	Kind RelationKind
}

ErrInvalidRelationKind represents an error where the user tries to use an invalid relation kind

func (ErrInvalidRelationKind) Error

func (err ErrInvalidRelationKind) Error() string

func (ErrInvalidRelationKind) HTTPError

func (err ErrInvalidRelationKind) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidRight

type ErrInvalidRight struct {
	Right Right
}

ErrInvalidRight represents an error where a right is invalid

func (ErrInvalidRight) Error

func (err ErrInvalidRight) Error() string

func (ErrInvalidRight) HTTPError

func (err ErrInvalidRight) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidSortOrder

type ErrInvalidSortOrder struct {
	OrderBy sortOrder
}

ErrInvalidSortOrder represents an error where the provided sort order is invalid

func (ErrInvalidSortOrder) Error

func (err ErrInvalidSortOrder) Error() string

func (ErrInvalidSortOrder) HTTPError

func (err ErrInvalidSortOrder) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidSortParam

type ErrInvalidSortParam struct {
	SortBy string
}

ErrInvalidSortParam represents an error where the provided sort param is invalid

func (ErrInvalidSortParam) Error

func (err ErrInvalidSortParam) Error() string

func (ErrInvalidSortParam) HTTPError

func (err ErrInvalidSortParam) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidTaskField

type ErrInvalidTaskField struct {
	TaskField string
}

ErrInvalidTaskField represents an error where the provided task field is invalid

func (ErrInvalidTaskField) Error

func (err ErrInvalidTaskField) Error() string

func (ErrInvalidTaskField) HTTPError

func (err ErrInvalidTaskField) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidTaskFilterComparator

type ErrInvalidTaskFilterComparator struct {
	Comparator taskFilterComparator
}

ErrInvalidTaskFilterComparator represents an error where the provided task field is invalid

func (ErrInvalidTaskFilterComparator) Error

func (ErrInvalidTaskFilterComparator) HTTPError

HTTPError holds the http error description

type ErrInvalidTaskFilterConcatinator

type ErrInvalidTaskFilterConcatinator struct {
	Concatinator taskFilterConcatinator
}

ErrInvalidTaskFilterConcatinator represents an error where the provided task field is invalid

func (ErrInvalidTaskFilterConcatinator) Error

func (ErrInvalidTaskFilterConcatinator) HTTPError

HTTPError holds the http error description

type ErrInvalidTaskFilterValue added in v0.14.0

type ErrInvalidTaskFilterValue struct {
	Value interface{}
	Field string
}

ErrInvalidTaskFilterValue represents an error where the provided task filter value is invalid

func (ErrInvalidTaskFilterValue) Error added in v0.14.0

func (err ErrInvalidTaskFilterValue) Error() string

func (ErrInvalidTaskFilterValue) HTTPError added in v0.14.0

func (err ErrInvalidTaskFilterValue) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLabelDoesNotExist

type ErrLabelDoesNotExist struct {
	LabelID int64
}

ErrLabelDoesNotExist represents an error where a label does not exist

func (ErrLabelDoesNotExist) Error

func (err ErrLabelDoesNotExist) Error() string

func (ErrLabelDoesNotExist) HTTPError

func (err ErrLabelDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLabelIsAlreadyOnTask

type ErrLabelIsAlreadyOnTask struct {
	LabelID int64
	TaskID  int64
}

ErrLabelIsAlreadyOnTask represents an error where a label is already bound to a task

func (ErrLabelIsAlreadyOnTask) Error

func (err ErrLabelIsAlreadyOnTask) Error() string

func (ErrLabelIsAlreadyOnTask) HTTPError

func (err ErrLabelIsAlreadyOnTask) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLinkSharePasswordInvalid added in v0.17.0

type ErrLinkSharePasswordInvalid struct {
	ShareID int64
}

ErrLinkSharePasswordInvalid represents an error where a subscription entity type is unknown

func (*ErrLinkSharePasswordInvalid) Error added in v0.17.0

func (err *ErrLinkSharePasswordInvalid) Error() string

func (ErrLinkSharePasswordInvalid) HTTPError added in v0.17.0

func (err ErrLinkSharePasswordInvalid) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLinkSharePasswordRequired added in v0.17.0

type ErrLinkSharePasswordRequired struct {
	ShareID int64
}

ErrLinkSharePasswordRequired represents an error where a link share authentication requires a password and none was provided

func (*ErrLinkSharePasswordRequired) Error added in v0.17.0

func (err *ErrLinkSharePasswordRequired) Error() string

func (ErrLinkSharePasswordRequired) HTTPError added in v0.17.0

func (err ErrLinkSharePasswordRequired) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrListCannotBelongToAPseudoNamespace added in v0.19.1

type ErrListCannotBelongToAPseudoNamespace struct {
	ListID      int64
	NamespaceID int64
}

ErrListCannotBelongToAPseudoNamespace represents an error where a list cannot belong to a pseudo namespace

func (*ErrListCannotBelongToAPseudoNamespace) Error added in v0.19.1

func (*ErrListCannotBelongToAPseudoNamespace) HTTPError added in v0.19.1

HTTPError holds the http error description

type ErrListDoesNotExist

type ErrListDoesNotExist struct {
	ID int64
}

ErrListDoesNotExist represents a "ErrListDoesNotExist" kind of error. Used if the list does not exist.

func (ErrListDoesNotExist) Error

func (err ErrListDoesNotExist) Error() string

func (ErrListDoesNotExist) HTTPError

func (err ErrListDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrListIdentifierIsNotUnique

type ErrListIdentifierIsNotUnique struct {
	Identifier string
}

ErrListIdentifierIsNotUnique represents a "ErrListIdentifierIsNotUnique" kind of error. Used if the provided list identifier is not unique.

func (ErrListIdentifierIsNotUnique) Error

func (ErrListIdentifierIsNotUnique) HTTPError

func (err ErrListIdentifierIsNotUnique) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrListIsArchived

type ErrListIsArchived struct {
	ListID int64
}

ErrListIsArchived represents an error, where a list is archived

func (ErrListIsArchived) Error

func (err ErrListIsArchived) Error() string

func (ErrListIsArchived) HTTPError

func (err ErrListIsArchived) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrListMustBelongToANamespace added in v0.20.0

type ErrListMustBelongToANamespace struct {
	ListID      int64
	NamespaceID int64
}

ErrListMustBelongToANamespace represents an error where a list must belong to a namespace

func (*ErrListMustBelongToANamespace) Error added in v0.20.0

func (*ErrListMustBelongToANamespace) HTTPError added in v0.20.0

func (err *ErrListMustBelongToANamespace) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrListShareDoesNotExist

type ErrListShareDoesNotExist struct {
	ID   int64
	Hash string
}

ErrListShareDoesNotExist represents a "ErrListShareDoesNotExist" kind of error. Used if the list share does not exist.

func (ErrListShareDoesNotExist) Error

func (err ErrListShareDoesNotExist) Error() string

func (ErrListShareDoesNotExist) HTTPError

func (err ErrListShareDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrListTitleCannotBeEmpty

type ErrListTitleCannotBeEmpty struct{}

ErrListTitleCannotBeEmpty represents a "ErrListTitleCannotBeEmpty" kind of error. Used if the list does not exist.

func (ErrListTitleCannotBeEmpty) Error

func (err ErrListTitleCannotBeEmpty) Error() string

func (ErrListTitleCannotBeEmpty) HTTPError

func (err ErrListTitleCannotBeEmpty) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrNamespaceDoesNotExist

type ErrNamespaceDoesNotExist struct {
	ID int64
}

ErrNamespaceDoesNotExist represents a "ErrNamespaceDoesNotExist" kind of error. Used if the namespace does not exist.

func (ErrNamespaceDoesNotExist) Error

func (err ErrNamespaceDoesNotExist) Error() string

func (ErrNamespaceDoesNotExist) HTTPError

func (err ErrNamespaceDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrNamespaceIsArchived

type ErrNamespaceIsArchived struct {
	NamespaceID int64
}

ErrNamespaceIsArchived represents an error where a namespace is archived

func (ErrNamespaceIsArchived) Error

func (err ErrNamespaceIsArchived) Error() string

func (ErrNamespaceIsArchived) HTTPError

func (err ErrNamespaceIsArchived) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrNamespaceNameCannotBeEmpty

type ErrNamespaceNameCannotBeEmpty struct {
	NamespaceID int64
	UserID      int64
}

ErrNamespaceNameCannotBeEmpty represents an error, where a namespace name is empty.

func (ErrNamespaceNameCannotBeEmpty) Error

func (ErrNamespaceNameCannotBeEmpty) HTTPError

HTTPError holds the http error description

type ErrNeedToHaveListReadAccess

type ErrNeedToHaveListReadAccess struct {
	ListID int64
	UserID int64
}

ErrNeedToHaveListReadAccess represents an error, where the user dont has read access to that List

func (ErrNeedToHaveListReadAccess) Error

func (err ErrNeedToHaveListReadAccess) Error() string

func (ErrNeedToHaveListReadAccess) HTTPError

func (err ErrNeedToHaveListReadAccess) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrNeedToHaveNamespaceReadAccess

type ErrNeedToHaveNamespaceReadAccess struct {
	NamespaceID int64
	UserID      int64
}

ErrNeedToHaveNamespaceReadAccess represents an error, where the user is not the owner of that namespace (used i.e. when deleting a namespace)

func (ErrNeedToHaveNamespaceReadAccess) Error

func (ErrNeedToHaveNamespaceReadAccess) HTTPError

HTTPError holds the http error description

type ErrNoRightToSeeTask

type ErrNoRightToSeeTask struct {
	TaskID int64
	UserID int64
}

ErrNoRightToSeeTask represents an error where a user does not have the right to see a task

func (ErrNoRightToSeeTask) Error

func (err ErrNoRightToSeeTask) Error() string

func (ErrNoRightToSeeTask) HTTPError

func (err ErrNoRightToSeeTask) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrOnlyOneDoneBucketPerList added in v0.17.0

type ErrOnlyOneDoneBucketPerList struct {
	BucketID     int64
	ListID       int64
	DoneBucketID int64
}

ErrOnlyOneDoneBucketPerList represents an error where a bucket is set to the done bucket but one already exists for its list.

func (*ErrOnlyOneDoneBucketPerList) Error added in v0.17.0

func (err *ErrOnlyOneDoneBucketPerList) Error() string

func (*ErrOnlyOneDoneBucketPerList) HTTPError added in v0.17.0

func (err *ErrOnlyOneDoneBucketPerList) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrParentTaskCannotBeTheSame

type ErrParentTaskCannotBeTheSame struct {
	TaskID int64
}

ErrParentTaskCannotBeTheSame represents an error where the user tries to set a tasks parent as the same

func (ErrParentTaskCannotBeTheSame) Error

func (ErrParentTaskCannotBeTheSame) HTTPError

func (err ErrParentTaskCannotBeTheSame) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrRelationAlreadyExists

type ErrRelationAlreadyExists struct {
	Kind        RelationKind
	TaskID      int64
	OtherTaskID int64
}

ErrRelationAlreadyExists represents an error where the user tries to create an already existing relation

func (ErrRelationAlreadyExists) Error

func (err ErrRelationAlreadyExists) Error() string

func (ErrRelationAlreadyExists) HTTPError

func (err ErrRelationAlreadyExists) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrRelationDoesNotExist

type ErrRelationDoesNotExist struct {
	Kind        RelationKind
	TaskID      int64
	OtherTaskID int64
}

ErrRelationDoesNotExist represents an error where a task relation does not exist.

func (ErrRelationDoesNotExist) Error

func (err ErrRelationDoesNotExist) Error() string

func (ErrRelationDoesNotExist) HTTPError

func (err ErrRelationDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrRelationTasksCannotBeTheSame

type ErrRelationTasksCannotBeTheSame struct {
	TaskID      int64
	OtherTaskID int64
}

ErrRelationTasksCannotBeTheSame represents an error where the user tries to relate a task with itself

func (ErrRelationTasksCannotBeTheSame) Error

func (ErrRelationTasksCannotBeTheSame) HTTPError

HTTPError holds the http error description

type ErrSavedFilterDoesNotExist added in v0.15.0

type ErrSavedFilterDoesNotExist struct {
	SavedFilterID int64
}

ErrSavedFilterDoesNotExist represents an error where a kanban bucket does not exist

func (ErrSavedFilterDoesNotExist) Error added in v0.15.0

func (err ErrSavedFilterDoesNotExist) Error() string

func (ErrSavedFilterDoesNotExist) HTTPError added in v0.15.0

func (err ErrSavedFilterDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrSavedFilterNotAvailableForLinkShare added in v0.15.0

type ErrSavedFilterNotAvailableForLinkShare struct {
	SavedFilterID int64
	LinkShareID   int64
}

ErrSavedFilterNotAvailableForLinkShare represents an error where a kanban bucket does not exist

func (ErrSavedFilterNotAvailableForLinkShare) Error added in v0.15.0

func (ErrSavedFilterNotAvailableForLinkShare) HTTPError added in v0.15.0

HTTPError holds the http error description

type ErrSubscriptionAlreadyExists added in v0.17.0

type ErrSubscriptionAlreadyExists struct {
	EntityID   int64
	EntityType SubscriptionEntityType
	UserID     int64
}

ErrSubscriptionAlreadyExists represents an error where a subscription entity already exists

func (*ErrSubscriptionAlreadyExists) Error added in v0.17.0

func (err *ErrSubscriptionAlreadyExists) Error() string

func (ErrSubscriptionAlreadyExists) HTTPError added in v0.17.0

func (err ErrSubscriptionAlreadyExists) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskAttachmentDoesNotExist

type ErrTaskAttachmentDoesNotExist struct {
	TaskID       int64
	AttachmentID int64
	FileID       int64
}

ErrTaskAttachmentDoesNotExist represents an error where the user tries to relate a task with itself

func (ErrTaskAttachmentDoesNotExist) Error

func (ErrTaskAttachmentDoesNotExist) HTTPError

HTTPError holds the http error description

type ErrTaskAttachmentIsTooLarge

type ErrTaskAttachmentIsTooLarge struct {
	Size uint64
}

ErrTaskAttachmentIsTooLarge represents an error where the user tries to relate a task with itself

func (ErrTaskAttachmentIsTooLarge) Error

func (err ErrTaskAttachmentIsTooLarge) Error() string

func (ErrTaskAttachmentIsTooLarge) HTTPError

func (err ErrTaskAttachmentIsTooLarge) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskCannotBeEmpty

type ErrTaskCannotBeEmpty struct{}

ErrTaskCannotBeEmpty represents a "ErrListDoesNotExist" kind of error. Used if the list does not exist.

func (ErrTaskCannotBeEmpty) Error

func (err ErrTaskCannotBeEmpty) Error() string

func (ErrTaskCannotBeEmpty) HTTPError

func (err ErrTaskCannotBeEmpty) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskCommentDoesNotExist

type ErrTaskCommentDoesNotExist struct {
	ID     int64
	TaskID int64
}

ErrTaskCommentDoesNotExist represents an error where a task comment does not exist

func (ErrTaskCommentDoesNotExist) Error

func (err ErrTaskCommentDoesNotExist) Error() string

func (ErrTaskCommentDoesNotExist) HTTPError

func (err ErrTaskCommentDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskDoesNotExist

type ErrTaskDoesNotExist struct {
	ID int64
}

ErrTaskDoesNotExist represents a "ErrListDoesNotExist" kind of error. Used if the list does not exist.

func (ErrTaskDoesNotExist) Error

func (err ErrTaskDoesNotExist) Error() string

func (ErrTaskDoesNotExist) HTTPError

func (err ErrTaskDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTeamAlreadyHasAccess

type ErrTeamAlreadyHasAccess struct {
	TeamID int64
	ID     int64
}

ErrTeamAlreadyHasAccess represents an error where a team already has access to a list/namespace

func (ErrTeamAlreadyHasAccess) Error

func (err ErrTeamAlreadyHasAccess) Error() string

func (ErrTeamAlreadyHasAccess) HTTPError

func (err ErrTeamAlreadyHasAccess) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTeamDoesNotExist

type ErrTeamDoesNotExist struct {
	TeamID int64
}

ErrTeamDoesNotExist represents an error where a team does not exist

func (ErrTeamDoesNotExist) Error

func (err ErrTeamDoesNotExist) Error() string

func (ErrTeamDoesNotExist) HTTPError

func (err ErrTeamDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTeamDoesNotHaveAccessToList

type ErrTeamDoesNotHaveAccessToList struct {
	ListID int64
	TeamID int64
}

ErrTeamDoesNotHaveAccessToList represents an error, where the Team is not the owner of that List (used i.e. when deleting a List)

func (ErrTeamDoesNotHaveAccessToList) Error

func (ErrTeamDoesNotHaveAccessToList) HTTPError

HTTPError holds the http error description

type ErrTeamDoesNotHaveAccessToNamespace

type ErrTeamDoesNotHaveAccessToNamespace struct {
	NamespaceID int64
	TeamID      int64
}

ErrTeamDoesNotHaveAccessToNamespace represents an error, where the Team is not the owner of that namespace (used i.e. when deleting a namespace)

func (ErrTeamDoesNotHaveAccessToNamespace) Error

func (ErrTeamDoesNotHaveAccessToNamespace) HTTPError

HTTPError holds the http error description

type ErrTeamNameCannotBeEmpty

type ErrTeamNameCannotBeEmpty struct {
	TeamID int64
}

ErrTeamNameCannotBeEmpty represents an error where a team name is empty.

func (ErrTeamNameCannotBeEmpty) Error

func (err ErrTeamNameCannotBeEmpty) Error() string

func (ErrTeamNameCannotBeEmpty) HTTPError

func (err ErrTeamNameCannotBeEmpty) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUnknownSubscriptionEntityType added in v0.17.0

type ErrUnknownSubscriptionEntityType struct {
	EntityType SubscriptionEntityType
}

ErrUnknownSubscriptionEntityType represents an error where a subscription entity type is unknown

func (*ErrUnknownSubscriptionEntityType) Error added in v0.17.0

func (ErrUnknownSubscriptionEntityType) HTTPError added in v0.17.0

HTTPError holds the http error description

type ErrUserAlreadyAssigned added in v0.20.0

type ErrUserAlreadyAssigned struct {
	TaskID int64
	UserID int64
}

ErrUserAlreadyAssigned represents an error where the user is already assigned to this task

func (ErrUserAlreadyAssigned) Error added in v0.20.0

func (err ErrUserAlreadyAssigned) Error() string

func (ErrUserAlreadyAssigned) HTTPError added in v0.20.0

func (err ErrUserAlreadyAssigned) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUserAlreadyHasAccess

type ErrUserAlreadyHasAccess struct {
	UserID int64
	ListID int64
}

ErrUserAlreadyHasAccess represents an error where a user already has access to a list/namespace

func (ErrUserAlreadyHasAccess) Error

func (err ErrUserAlreadyHasAccess) Error() string

func (ErrUserAlreadyHasAccess) HTTPError

func (err ErrUserAlreadyHasAccess) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUserAlreadyHasNamespaceAccess

type ErrUserAlreadyHasNamespaceAccess struct {
	UserID      int64
	NamespaceID int64
}

ErrUserAlreadyHasNamespaceAccess represents an error where a user already has access to a namespace

func (ErrUserAlreadyHasNamespaceAccess) Error

func (ErrUserAlreadyHasNamespaceAccess) HTTPError

HTTPError holds the http error description

type ErrUserDoesNotHaveAccessToList

type ErrUserDoesNotHaveAccessToList struct {
	ListID int64
	UserID int64
}

ErrUserDoesNotHaveAccessToList represents an error, where the user is not the owner of that List (used i.e. when deleting a List)

func (ErrUserDoesNotHaveAccessToList) Error

func (ErrUserDoesNotHaveAccessToList) HTTPError

HTTPError holds the http error description

type ErrUserDoesNotHaveAccessToNamespace

type ErrUserDoesNotHaveAccessToNamespace struct {
	NamespaceID int64
	UserID      int64
}

ErrUserDoesNotHaveAccessToNamespace represents an error, where the user is not the owner of that namespace (used i.e. when deleting a namespace)

func (ErrUserDoesNotHaveAccessToNamespace) Error

func (ErrUserDoesNotHaveAccessToNamespace) HTTPError

HTTPError holds the http error description

type ErrUserHasNoAccessToLabel

type ErrUserHasNoAccessToLabel struct {
	LabelID int64
	UserID  int64
}

ErrUserHasNoAccessToLabel represents an error where a user does not have the right to see a label

func (ErrUserHasNoAccessToLabel) Error

func (err ErrUserHasNoAccessToLabel) Error() string

func (ErrUserHasNoAccessToLabel) HTTPError

func (err ErrUserHasNoAccessToLabel) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUserIsMemberOfTeam

type ErrUserIsMemberOfTeam struct {
	TeamID int64
	UserID int64
}

ErrUserIsMemberOfTeam represents an error where a user is already member of a team.

func (ErrUserIsMemberOfTeam) Error

func (err ErrUserIsMemberOfTeam) Error() string

func (ErrUserIsMemberOfTeam) HTTPError

func (err ErrUserIsMemberOfTeam) HTTPError() web.HTTPError

HTTPError holds the http error description

type Favorite added in v0.18.0

type Favorite struct {
	EntityID int64        `xorm:"bigint not null pk"`
	UserID   int64        `xorm:"bigint not null pk"`
	Kind     FavoriteKind `xorm:"int not null pk"`
}

Favorite represents an entity which is a favorite to someone

func (*Favorite) TableName added in v0.18.0

func (t *Favorite) TableName() string

TableName is the table name

type FavoriteKind added in v0.18.0

type FavoriteKind int

FavoriteKind represents the kind of entities that can be marked as favorite

const (
	FavoriteKindUnknown FavoriteKind = iota
	FavoriteKindTask
	FavoriteKindList
)

type HandleTaskCommentEditMentions added in v0.18.0

type HandleTaskCommentEditMentions struct {
}

HandleTaskCommentEditMentions represents a listener

func (*HandleTaskCommentEditMentions) Handle added in v0.18.0

func (s *HandleTaskCommentEditMentions) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskCommentEditMentions listens on is fired

func (*HandleTaskCommentEditMentions) Name added in v0.18.0

Name defines the name for the HandleTaskCommentEditMentions listener

type HandleTaskCreateMentions added in v0.18.0

type HandleTaskCreateMentions struct {
}

HandleTaskCreateMentions represents a listener

func (*HandleTaskCreateMentions) Handle added in v0.18.0

func (s *HandleTaskCreateMentions) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskCreateMentions listens on is fired

func (*HandleTaskCreateMentions) Name added in v0.18.0

func (s *HandleTaskCreateMentions) Name() string

Name defines the name for the HandleTaskCreateMentions listener

type HandleTaskUpdateLastUpdated added in v0.20.3

type HandleTaskUpdateLastUpdated struct {
}

HandleTaskUpdateLastUpdated represents a listener

func (*HandleTaskUpdateLastUpdated) Handle added in v0.20.3

func (s *HandleTaskUpdateLastUpdated) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskUpdateLastUpdated listens on is fired

func (*HandleTaskUpdateLastUpdated) Name added in v0.20.3

Name defines the name for the HandleTaskUpdateLastUpdated listener

type HandleTaskUpdatedMentions added in v0.18.0

type HandleTaskUpdatedMentions struct {
}

HandleTaskUpdatedMentions represents a listener

func (*HandleTaskUpdatedMentions) Handle added in v0.18.0

func (s *HandleTaskUpdatedMentions) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskUpdatedMentions listens on is fired

func (*HandleTaskUpdatedMentions) Name added in v0.18.0

Name defines the name for the HandleTaskUpdatedMentions listener

type HandleUserDataExport added in v0.18.0

type HandleUserDataExport struct {
}

HandleUserDataExport represents a listener

func (*HandleUserDataExport) Handle added in v0.18.0

func (s *HandleUserDataExport) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleUserDataExport listens on is fired

func (*HandleUserDataExport) Name added in v0.18.0

func (s *HandleUserDataExport) Name() string

Name defines the name for the HandleUserDataExport listener

type IncreaseListCounter added in v0.17.0

type IncreaseListCounter struct {
}

func (*IncreaseListCounter) Handle added in v0.17.0

func (s *IncreaseListCounter) Handle(msg *message.Message) (err error)

func (*IncreaseListCounter) Name added in v0.17.0

func (s *IncreaseListCounter) Name() string

type IncreaseNamespaceCounter added in v0.17.0

type IncreaseNamespaceCounter struct {
}

IncreaseNamespaceCounter represents a listener

func (*IncreaseNamespaceCounter) Handle added in v0.17.0

func (s *IncreaseNamespaceCounter) Handle(msg *message.Message) (err error)

Hanlde is executed when the event IncreaseNamespaceCounter listens on is fired

func (*IncreaseNamespaceCounter) Name added in v0.17.0

func (s *IncreaseNamespaceCounter) Name() string

Name defines the name for the IncreaseNamespaceCounter listener

type IncreaseTaskCounter added in v0.17.0

type IncreaseTaskCounter struct {
}

IncreaseTaskCounter represents a listener

func (*IncreaseTaskCounter) Handle added in v0.17.0

func (s *IncreaseTaskCounter) Handle(msg *message.Message) (err error)

Handle is executed when the event IncreaseTaskCounter listens on is fired

func (*IncreaseTaskCounter) Name added in v0.17.0

func (s *IncreaseTaskCounter) Name() string

Name defines the name for the IncreaseTaskCounter listener

type IncreaseTeamCounter added in v0.17.0

type IncreaseTeamCounter struct {
}

IncreaseTeamCounter represents a listener

func (*IncreaseTeamCounter) Handle added in v0.17.0

func (s *IncreaseTeamCounter) Handle(msg *message.Message) (err error)

Hanlde is executed when the event IncreaseTeamCounter listens on is fired

func (*IncreaseTeamCounter) Name added in v0.17.0

func (s *IncreaseTeamCounter) Name() string

Name defines the name for the IncreaseTeamCounter listener

type Label

type Label struct {
	// The unique, numeric id of this label.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"label"`
	// The title of the lable. You'll see this one on tasks associated with it.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"runelength(1|250)" minLength:"1" maxLength:"250"`
	// The label description.
	Description string `xorm:"longtext null" json:"description"`
	// The color this label has
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|6)" maxLength:"6"`

	CreatedByID int64 `xorm:"bigint not null" json:"-"`
	// The user who created this label
	CreatedBy *user.User `xorm:"-" json:"created_by"`

	// A timestamp when this label was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this label was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Label represents a label

func GetLabelSimple added in v0.20.3

func GetLabelSimple(s *xorm.Session, l *Label) (*Label, error)

func (*Label) CanCreate

func (l *Label) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a label Currently a dummy.

func (*Label) CanDelete

func (l *Label) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a label

func (*Label) CanRead

func (l *Label) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user can read a label

func (*Label) CanUpdate

func (l *Label) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update a label

func (*Label) Create

func (l *Label) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new label @Summary Create a label @Description Creates a new label. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param label body models.Label true "The label object" @Success 201 {object} models.Label "The created label object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 500 {object} models.Message "Internal error" @Router /labels [put]

func (*Label) Delete

func (l *Label) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a label @Summary Delete a label @Description Delete an existing label. The user needs to be the creator of the label to be able to do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Label ID" @Success 200 {object} models.Label "The label was successfully deleted." @Failure 403 {object} web.HTTPError "Not allowed to delete the label." @Failure 404 {object} web.HTTPError "Label not found." @Failure 500 {object} models.Message "Internal error" @Router /labels/{id} [delete]

func (*Label) ReadAll

func (l *Label) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (ls interface{}, resultCount int, numberOfEntries int64, err error)

ReadAll gets all labels a user can use @Summary Get all labels a user has access to @Description Returns all labels which are either created by the user or associated with a task the user has at least read-access to. @tags labels @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search labels by label text." @Security JWTKeyAuth @Success 200 {array} models.Label "The labels" @Failure 500 {object} models.Message "Internal error" @Router /labels [get]

func (*Label) ReadOne

func (l *Label) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne gets one label @Summary Gets one label @Description Returns one label by its ID. @tags labels @Accept json @Produce json @Param id path int true "Label ID" @Security JWTKeyAuth @Success 200 {object} models.Label "The label" @Failure 403 {object} web.HTTPError "The user does not have access to the label" @Failure 404 {object} web.HTTPError "Label not found" @Failure 500 {object} models.Message "Internal error" @Router /labels/{id} [get]

func (Label) TableName

func (Label) TableName() string

TableName makes a pretty table name

func (*Label) Update

func (l *Label) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a label @Summary Update a label @Description Update an existing label. The user needs to be the creator of the label to be able to do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Label ID" @Param label body models.Label true "The label object" @Success 200 {object} models.Label "The created label object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 403 {object} web.HTTPError "Not allowed to update the label." @Failure 404 {object} web.HTTPError "Label not found." @Failure 500 {object} models.Message "Internal error" @Router /labels/{id} [put]

type LabelByTaskIDsOptions

type LabelByTaskIDsOptions struct {
	User                *user.User
	Search              []string
	Page                int
	PerPage             int
	TaskIDs             []int64
	GetUnusedLabels     bool
	GroupByLabelIDsOnly bool
	GetForUser          int64
}

LabelByTaskIDsOptions is a struct to not clutter the function with too many optional parameters.

type LabelTask

type LabelTask struct {
	// The unique, numeric id of this label.
	ID     int64 `xorm:"bigint autoincr not null unique pk" json:"-"`
	TaskID int64 `xorm:"bigint INDEX not null" json:"-" param:"listtask"`
	// The label id you want to associate with a task.
	LabelID int64 `xorm:"bigint INDEX not null" json:"label_id" param:"label"`
	// A timestamp when this task was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

LabelTask represents a relation between a label and a task

func (*LabelTask) CanCreate

func (lt *LabelTask) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can add a label to a task

func (*LabelTask) CanDelete

func (lt *LabelTask) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a label from a task

func (*LabelTask) Create

func (lt *LabelTask) Create(s *xorm.Session, a web.Auth) (err error)

Create adds a label to a task @Summary Add a label to a task @Description Add a label to a task. The user needs to have write-access to the list to be able do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param task path int true "Task ID" @Param label body models.LabelTask true "The label object" @Success 201 {object} models.LabelTask "The created label relation object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 403 {object} web.HTTPError "Not allowed to add the label." @Failure 404 {object} web.HTTPError "The label does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{task}/labels [put]

func (*LabelTask) Delete

func (lt *LabelTask) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a label on a task @Summary Remove a label from a task @Description Remove a label from a task. The user needs to have write-access to the list to be able do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param task path int true "Task ID" @Param label path int true "Label ID" @Success 200 {object} models.Message "The label was successfully removed." @Failure 403 {object} web.HTTPError "Not allowed to remove the label." @Failure 404 {object} web.HTTPError "Label not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{task}/labels/{label} [delete]

func (*LabelTask) ReadAll

func (lt *LabelTask) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all labels on a task @Summary Get all labels on a task @Description Returns all labels which are assicociated with a given task. @tags labels @Accept json @Produce json @Param task path int true "Task ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search labels by label text." @Security JWTKeyAuth @Success 200 {array} models.Label "The labels" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{task}/labels [get]

func (LabelTask) TableName

func (LabelTask) TableName() string

TableName makes a pretty table name

type LabelTaskBulk

type LabelTaskBulk struct {
	// All labels you want to update at once.
	Labels []*Label `json:"labels"`
	TaskID int64    `json:"-" param:"listtask"`

	web.CRUDable `json:"-"`
	web.Rights   `json:"-"`
}

LabelTaskBulk is a helper struct to update a bunch of labels at once

func (*LabelTaskBulk) CanCreate

func (ltb *LabelTaskBulk) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate determines if a user can update a labeltask

func (*LabelTaskBulk) Create

func (ltb *LabelTaskBulk) Create(s *xorm.Session, a web.Auth) (err error)

Create updates a bunch of labels on a task at once @Summary Update all labels on a task. @Description Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param label body models.LabelTaskBulk true "The array of labels" @Param taskID path int true "Task ID" @Success 201 {object} models.LabelTaskBulk "The updated labels object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/labels/bulk [post]

type LabelWithTaskID added in v0.20.3

type LabelWithTaskID struct {
	TaskID int64 `json:"-"`
	Label  `xorm:"extends"`
}

LabelWithTaskID is a helper struct, contains the label + its task ID

func GetLabelsByTaskIDs added in v0.20.3

func GetLabelsByTaskIDs(s *xorm.Session, opts *LabelByTaskIDsOptions) (ls []*LabelWithTaskID, resultCount int, totalEntries int64, err error)

GetLabelsByTaskIDs is a helper function to get all labels for a set of tasks Used when getting all labels for one task as well when getting all lables

type LinkSharing

type LinkSharing struct {
	// The ID of the shared thing
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"share"`
	// The public id to get this shared list
	Hash string `xorm:"varchar(40) not null unique" json:"hash" param:"hash"`
	// The name of this link share. All actions someone takes while being authenticated with that link will appear with that name.
	Name string `xorm:"text null" json:"name"`
	// The ID of the shared list
	ListID int64 `xorm:"bigint not null" json:"-" param:"list"`
	// The right this list is shared with. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// The kind of this link. 0 = undefined, 1 = without password, 2 = with password.
	SharingType SharingType `xorm:"bigint INDEX not null default 0" json:"sharing_type" valid:"length(0|2)" maximum:"2" default:"0"`

	// The password of this link share. You can only set it, not retrieve it after the link share has been created.
	Password string `xorm:"text null" json:"password"`

	// The user who shared this list
	SharedBy   *user.User `xorm:"-" json:"shared_by"`
	SharedByID int64      `xorm:"bigint INDEX not null" json:"-"`

	// A timestamp when this list was shared. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this share was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

LinkSharing represents a shared list

func GetLinkShareByHash

func GetLinkShareByHash(s *xorm.Session, hash string) (share *LinkSharing, err error)

GetLinkShareByHash returns a link share by hash

func GetLinkShareByID added in v0.17.0

func GetLinkShareByID(s *xorm.Session, id int64) (share *LinkSharing, err error)

GetLinkShareByID returns a link share by its id.

func GetLinkShareFromClaims

func GetLinkShareFromClaims(claims jwt.MapClaims) (share *LinkSharing, err error)

GetLinkShareFromClaims builds a link sharing object from jwt claims

func (*LinkSharing) CanCreate

func (share *LinkSharing) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate implements the create right check for a link share

func (*LinkSharing) CanDelete

func (share *LinkSharing) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete implements the delete right check for a link share

func (*LinkSharing) CanRead

func (share *LinkSharing) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead implements the read right check for a link share

func (*LinkSharing) CanUpdate

func (share *LinkSharing) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate implements the update right check for a link share

func (*LinkSharing) Create

func (share *LinkSharing) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new link share for a given list @Summary Share a list via link @Description Share a list via link. The user needs to have write-access to the list to be able do this. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param list path int true "List ID" @Param label body models.LinkSharing true "The new link share object" @Success 201 {object} models.LinkSharing "The created link share object." @Failure 400 {object} web.HTTPError "Invalid link share object provided." @Failure 403 {object} web.HTTPError "Not allowed to add the list share." @Failure 404 {object} web.HTTPError "The list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{list}/shares [put]

func (*LinkSharing) Delete

func (share *LinkSharing) Delete(s *xorm.Session, a web.Auth) (err error)

Delete removes a link share @Summary Remove a link share @Description Remove a link share. The user needs to have write-access to the list to be able do this. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param list path int true "List ID" @Param share path int true "Share Link ID" @Success 200 {object} models.Message "The link was successfully removed." @Failure 403 {object} web.HTTPError "Not allowed to remove the link." @Failure 404 {object} web.HTTPError "Share Link not found." @Failure 500 {object} models.Message "Internal error" @Router /lists/{list}/shares/{share} [delete]

func (*LinkSharing) GetID

func (share *LinkSharing) GetID() int64

GetID returns the ID of the links sharing object

func (*LinkSharing) ReadAll

func (share *LinkSharing) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll returns all shares for a given list @Summary Get all link shares for a list @Description Returns all link shares which exist for a given list @tags sharing @Accept json @Produce json @Param list path int true "List ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search shares by hash." @Security JWTKeyAuth @Success 200 {array} models.LinkSharing "The share links" @Failure 500 {object} models.Message "Internal error" @Router /lists/{list}/shares [get]

func (*LinkSharing) ReadOne

func (share *LinkSharing) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne returns one share @Summary Get one link shares for a list @Description Returns one link share by its ID. @tags sharing @Accept json @Produce json @Param list path int true "List ID" @Param share path int true "Share ID" @Security JWTKeyAuth @Success 200 {object} models.LinkSharing "The share links" @Failure 403 {object} web.HTTPError "No access to the list" @Failure 404 {object} web.HTTPError "Share Link not found." @Failure 500 {object} models.Message "Internal error" @Router /lists/{list}/shares/{share} [get]

func (LinkSharing) TableName

func (LinkSharing) TableName() string

TableName holds the table name

type List

type List struct {
	// The unique, numeric id of this list.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"list"`
	// The title of the list. You'll see this in the namespace overview.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The description of the list.
	Description string `xorm:"longtext null" json:"description"`
	// The unique list short identifier. Used to build task identifiers.
	Identifier string `xorm:"varchar(10) null" json:"identifier" valid:"runelength(0|10)" minLength:"0" maxLength:"10"`
	// The hex color of this list
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|6)" maxLength:"6"`

	OwnerID     int64 `xorm:"bigint INDEX not null" json:"-"`
	NamespaceID int64 `xorm:"bigint INDEX not null" json:"namespace_id" param:"namespace"`

	// The user who created this list.
	Owner *user.User `xorm:"-" json:"owner" valid:"-"`

	// Whether or not a list is archived.
	IsArchived bool `xorm:"not null default false" json:"is_archived" query:"is_archived"`

	// The id of the file this list has set as background
	BackgroundFileID int64 `xorm:"null" json:"-"`
	// Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background
	BackgroundInformation interface{} `xorm:"-" json:"background_information"`
	// Contains a very small version of the list background to use as a blurry preview until the actual background is loaded. Check out https://blurha.sh/ to learn how it works.
	BackgroundBlurHash string `xorm:"varchar(50) null" json:"background_blur_hash"`

	// True if a list is a favorite. Favorite lists show up in a separate namespace. This value depends on the user making the call to the api.
	IsFavorite bool `xorm:"-" json:"is_favorite"`

	// The subscription status for the user reading this list. You can only read this property, use the subscription endpoints to modify it.
	// Will only returned when retreiving one list.
	Subscription *Subscription `xorm:"-" json:"subscription,omitempty"`

	// The position this list has when querying all lists. See the tasks.position property on how to use this.
	Position float64 `xorm:"double null" json:"position"`

	// A timestamp when this list was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this list was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

List represents a list of tasks

func GetListByShareHash

func GetListByShareHash(s *xorm.Session, hash string) (list *List, err error)

GetListByShareHash returns a link share by its hash

func GetListSimplByTaskID

func GetListSimplByTaskID(s *xorm.Session, taskID int64) (l *List, err error)

GetListSimplByTaskID gets a list by a task id

func GetListSimpleByID added in v0.16.0

func GetListSimpleByID(s *xorm.Session, listID int64) (list *List, err error)

GetListSimpleByID gets a list with only the basic items, aka no tasks or user objects. Returns an error if the list does not exist.

func GetListsByNamespaceID

func GetListsByNamespaceID(s *xorm.Session, nID int64, doer *user.User) (lists []*List, err error)

GetListsByNamespaceID gets all lists in a namespace

func (*List) CanCreate

func (l *List) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a list

func (*List) CanDelete

func (l *List) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a list

func (*List) CanRead

func (l *List) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user has read access to a list

func (*List) CanUpdate

func (l *List) CanUpdate(s *xorm.Session, a web.Auth) (canUpdate bool, err error)

CanUpdate checks if the user can update a list

func (*List) CanWrite

func (l *List) CanWrite(s *xorm.Session, a web.Auth) (bool, error)

CanWrite return whether the user can write on that list or not

func (*List) CheckIsArchived

func (l *List) CheckIsArchived(s *xorm.Session) (err error)

CheckIsArchived returns an ErrListIsArchived or ErrNamespaceIsArchived if the list or its namespace is archived.

func (*List) Create

func (l *List) Create(s *xorm.Session, a web.Auth) (err error)

Create implements the create method of CRUDable @Summary Creates a new list @Description Creates a new list in a given namespace. The user needs write-access to the namespace. @tags list @Accept json @Produce json @Security JWTKeyAuth @Param namespaceID path int true "Namespace ID" @Param list body models.List true "The list you want to create." @Success 201 {object} models.List "The created list." @Failure 400 {object} web.HTTPError "Invalid list object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{namespaceID}/lists [put]

func (*List) Delete

func (l *List) Delete(s *xorm.Session, a web.Auth) (err error)

Delete implements the delete method of CRUDable @Summary Deletes a list @Description Delets a list @tags list @Produce json @Security JWTKeyAuth @Param id path int true "List ID" @Success 200 {object} models.Message "The list was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid list object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists/{id} [delete]

func (*List) DeleteBackgroundFileIfExists added in v0.20.3

func (l *List) DeleteBackgroundFileIfExists() (err error)

DeleteBackgroundFileIfExists deletes the list's background file from the db and the filesystem, if one exists

func (*List) IsAdmin

func (l *List) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin returns whether the user has admin rights on the list or not

func (*List) ReadAll

func (l *List) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll gets all lists a user has access to @Summary Get all lists a user has access to @Description Returns all lists a user has access to. @tags list @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search lists by title." @Param is_archived query bool false "If true, also returns all archived lists." @Security JWTKeyAuth @Success 200 {array} models.List "The lists" @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists [get]

func (*List) ReadOne

func (l *List) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne gets one list by its ID @Summary Gets one list @Description Returns a list by its ID. @tags list @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List ID" @Success 200 {object} models.List "The list" @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists/{id} [get]

func (*List) TableName added in v0.17.0

func (l *List) TableName() string

TableName returns a better name for the lists table

func (*List) Update

func (l *List) Update(s *xorm.Session, a web.Auth) (err error)

Update implements the update method of CRUDable @Summary Updates a list @Description Updates a list. This does not include adding a task (see below). @tags list @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List ID" @Param list body models.List true "The list with updated values you want to update." @Success 200 {object} models.List "The updated list." @Failure 400 {object} web.HTTPError "Invalid list object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists/{id} [post]

type ListBackgroundType added in v0.14.0

type ListBackgroundType struct {
	Type string
}

ListBackgroundType holds a list background type

type ListCreatedEvent added in v0.17.0

type ListCreatedEvent struct {
	List *List
	Doer *user.User
}

ListCreatedEvent represents an event where a list has been created

func (*ListCreatedEvent) Name added in v0.17.0

func (l *ListCreatedEvent) Name() string

Name defines the name for ListCreatedEvent

type ListCreatedNotification added in v0.17.0

type ListCreatedNotification struct {
	Doer *user.User `json:"doer"`
	List *List      `json:"list"`
}

ListCreatedNotification represents a ListCreatedNotification notification

func (*ListCreatedNotification) Name added in v0.17.0

func (n *ListCreatedNotification) Name() string

Name returns the name of the notification

func (*ListCreatedNotification) ToDB added in v0.17.0

func (n *ListCreatedNotification) ToDB() interface{}

ToDB returns the ListCreatedNotification notification in a format which can be saved in the db

func (*ListCreatedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for ListCreatedNotification

type ListDeletedEvent added in v0.17.0

type ListDeletedEvent struct {
	List *List
	Doer web.Auth
}

ListDeletedEvent represents an event where a list has been deleted

func (*ListDeletedEvent) Name added in v0.17.0

func (t *ListDeletedEvent) Name() string

Name defines the name for ListDeletedEvent

type ListDuplicate added in v0.14.0

type ListDuplicate struct {
	// The list id of the list to duplicate
	ListID int64 `json:"-" param:"listid"`
	// The target namespace ID
	NamespaceID int64 `json:"namespace_id,omitempty"`

	// The copied list
	List *List `json:",omitempty"`

	web.Rights   `json:"-"`
	web.CRUDable `json:"-"`
}

ListDuplicate holds everything needed to duplicate a list

func (*ListDuplicate) CanCreate added in v0.14.0

func (ld *ListDuplicate) CanCreate(s *xorm.Session, a web.Auth) (canCreate bool, err error)

CanCreate checks if a user has the right to duplicate a list

func (*ListDuplicate) Create added in v0.14.0

func (ld *ListDuplicate) Create(s *xorm.Session, doer web.Auth) (err error)

Create duplicates a list @Summary Duplicate an existing list @Description Copies the list, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one list to a new namespace. The user needs read access in the list and write access in the namespace of the new list. @tags list @Accept json @Produce json @Security JWTKeyAuth @Param listID path int true "The list ID to duplicate" @Param list body models.ListDuplicate true "The target namespace which should hold the copied list." @Success 201 {object} models.ListDuplicate "The created list." @Failure 400 {object} web.HTTPError "Invalid list duplicate object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the list or namespace" @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/duplicate [put]

type ListSharedWithTeamEvent added in v0.17.0

type ListSharedWithTeamEvent struct {
	List *List
	Team *Team
	Doer web.Auth
}

ListSharedWithTeamEvent represents an event where a list has been shared with a team

func (*ListSharedWithTeamEvent) Name added in v0.17.0

func (l *ListSharedWithTeamEvent) Name() string

Name defines the name for ListSharedWithTeamEvent

type ListSharedWithUserEvent added in v0.17.0

type ListSharedWithUserEvent struct {
	List *List
	User *user.User
	Doer web.Auth
}

ListSharedWithUserEvent represents an event where a list has been shared with a user

func (*ListSharedWithUserEvent) Name added in v0.17.0

func (l *ListSharedWithUserEvent) Name() string

Name defines the name for ListSharedWithUserEvent

type ListUIDs

type ListUIDs struct {
	ListOwnerID          int64 `xorm:"listOwner"`
	NamespaceUserID      int64 `xorm:"unID"`
	ListUserID           int64 `xorm:"ulID"`
	NamespaceOwnerUserID int64 `xorm:"nOwner"`
	TeamNamespaceUserID  int64 `xorm:"tnUID"`
	TeamListUserID       int64 `xorm:"tlUID"`
}

ListUIDs hold all kinds of user IDs from accounts who have somehow access to a list

type ListUpdatedEvent added in v0.17.0

type ListUpdatedEvent struct {
	List *List
	Doer web.Auth
}

ListUpdatedEvent represents an event where a list has been updated

func (*ListUpdatedEvent) Name added in v0.17.0

func (l *ListUpdatedEvent) Name() string

Name defines the name for ListUpdatedEvent

type ListUser

type ListUser struct {
	// The unique, numeric id of this list <-> user relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"namespace"`
	// The username.
	Username string `xorm:"-" json:"user_id" param:"user"`
	// Used internally to reference the user
	UserID int64 `xorm:"bigint not null INDEX" json:"-"`
	// The list id.
	ListID int64 `xorm:"bigint not null INDEX" json:"-" param:"list"`
	// The right this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

ListUser represents a list <-> user relation

func (*ListUser) CanCreate

func (lu *ListUser) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a new user <-> list relation

func (*ListUser) CanDelete

func (lu *ListUser) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a user <-> list relation

func (*ListUser) CanUpdate

func (lu *ListUser) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a user <-> list relation

func (*ListUser) Create

func (lu *ListUser) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new list <-> user relation @Summary Add a user to a list @Description Gives a user access to a list. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List ID" @Param list body models.ListUser true "The user you want to add to the list." @Success 201 {object} models.ListUser "The created user<->list relation." @Failure 400 {object} web.HTTPError "Invalid user list object provided." @Failure 404 {object} web.HTTPError "The user does not exist." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/users [put]

func (*ListUser) Delete

func (lu *ListUser) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a list <-> user relation @Summary Delete a user from a list @Description Delets a user from a list. The user won't have access to the list anymore. @tags sharing @Produce json @Security JWTKeyAuth @Param listID path int true "List ID" @Param userID path int true "User ID" @Success 200 {object} models.Message "The user was successfully removed from the list." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 404 {object} web.HTTPError "user or list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/users/{userID} [delete]

func (*ListUser) ReadAll

func (lu *ListUser) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all users who have access to a list @Summary Get users on a list @Description Returns a list with all users which have access on a given list. @tags sharing @Accept json @Produce json @Param id path int true "List ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search users by its name." @Security JWTKeyAuth @Success 200 {array} models.UserWithRight "The users with the right they have." @Failure 403 {object} web.HTTPError "No right to see the list." @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/users [get]

func (ListUser) TableName

func (ListUser) TableName() string

TableName is the table name for ListUser

func (*ListUser) Update

func (lu *ListUser) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a user <-> list relation @Summary Update a user <-> list relation @Description Update a user <-> list relation. Mostly used to update the right that user has. @tags sharing @Accept json @Produce json @Param listID path int true "List ID" @Param userID path int true "User ID" @Param list body models.ListUser true "The user you want to update." @Security JWTKeyAuth @Success 200 {object} models.ListUser "The updated user <-> list relation." @Failure 403 {object} web.HTTPError "The user does not have admin-access to the list" @Failure 404 {object} web.HTTPError "User or list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/users/{userID} [post]

type ListWithTasksAndBuckets added in v0.18.0

type ListWithTasksAndBuckets struct {
	List
	// An array of tasks which belong to the list.
	Tasks []*TaskWithComments `xorm:"-" json:"tasks"`
	// Only used for migration.
	Buckets          []*Bucket `xorm:"-" json:"buckets"`
	BackgroundFileID int64     `xorm:"null" json:"background_file_id"`
}

type Message

type Message struct {
	// A standard message.
	Message string `json:"message"`
}

Message is a standard message

type Namespace

type Namespace struct {
	// The unique, numeric id of this namespace.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"namespace"`
	// The name of this namespace.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The description of the namespace
	Description string `xorm:"longtext null" json:"description"`
	OwnerID     int64  `xorm:"bigint not null INDEX" json:"-"`

	// The hex color of this namespace
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|6)" maxLength:"6"`

	// Whether or not a namespace is archived.
	IsArchived bool `xorm:"not null default false" json:"is_archived" query:"is_archived"`

	// The user who owns this namespace
	Owner *user.User `xorm:"-" json:"owner" valid:"-"`

	// The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.
	// Will only returned when retreiving one namespace.
	Subscription *Subscription `xorm:"-" json:"subscription,omitempty"`

	// A timestamp when this namespace was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this namespace was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	// If set to true, will only return the namespaces, not their lists.
	NamespacesOnly bool `xorm:"-" json:"-" query:"namespaces_only"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Namespace holds informations about a namespace

func GetNamespaceByID

func GetNamespaceByID(s *xorm.Session, id int64) (namespace *Namespace, err error)

GetNamespaceByID returns a namespace object by its ID

func (*Namespace) CanCreate

func (n *Namespace) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a new namespace

func (*Namespace) CanDelete

func (n *Namespace) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a namespace

func (*Namespace) CanRead

func (n *Namespace) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user has read access to that namespace

func (*Namespace) CanUpdate

func (n *Namespace) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update the namespace

func (*Namespace) CanWrite

func (n *Namespace) CanWrite(s *xorm.Session, a web.Auth) (bool, error)

CanWrite checks if a user has write access to a namespace

func (*Namespace) CheckIsArchived

func (n *Namespace) CheckIsArchived(s *xorm.Session) error

CheckIsArchived returns an ErrNamespaceIsArchived if the namepace is archived.

func (*Namespace) Create

func (n *Namespace) Create(s *xorm.Session, a web.Auth) (err error)

Create implements the creation method via the interface @Summary Creates a new namespace @Description Creates a new namespace. @tags namespace @Accept json @Produce json @Security JWTKeyAuth @Param namespace body models.Namespace true "The namespace you want to create." @Success 201 {object} models.Namespace "The created namespace." @Failure 400 {object} web.HTTPError "Invalid namespace object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" @Failure 500 {object} models.Message "Internal error" @Router /namespaces [put]

func (*Namespace) Delete

func (n *Namespace) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a namespace @Summary Deletes a namespace @Description Delets a namespace @tags namespace @Produce json @Security JWTKeyAuth @Param id path int true "Namespace ID" @Success 200 {object} models.Message "The namespace was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid namespace object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{id} [delete]

func (*Namespace) IsAdmin

func (n *Namespace) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin returns true or false if the user is admin on that namespace or not

func (*Namespace) ReadAll

func (n *Namespace) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all namespaces a user has access to @Summary Get all namespaces a user has access to @Description Returns all namespaces a user has access to. @tags namespace @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search namespaces by name." @Param is_archived query bool false "If true, also returns all archived namespaces." @Param namespaces_only query bool false "If true, also returns only namespaces without their lists." @Security JWTKeyAuth @Success 200 {array} models.NamespaceWithLists "The Namespaces." @Failure 500 {object} models.Message "Internal error" @Router /namespaces [get]

func (*Namespace) ReadOne

func (n *Namespace) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne gets one namespace @Summary Gets one namespace @Description Returns a namespace by its ID. @tags namespace @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Namespace ID" @Success 200 {object} models.Namespace "The Namespace" @Failure 403 {object} web.HTTPError "The user does not have access to that namespace." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{id} [get]

func (Namespace) TableName

func (Namespace) TableName() string

TableName makes beautiful table names

func (*Namespace) Update

func (n *Namespace) Update(s *xorm.Session, a web.Auth) (err error)

Update implements the update method via the interface @Summary Updates a namespace @Description Updates a namespace. @tags namespace @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Namespace ID" @Param namespace body models.Namespace true "The namespace with updated values you want to update." @Success 200 {object} models.Namespace "The updated namespace." @Failure 400 {object} web.HTTPError "Invalid namespace object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" @Failure 500 {object} models.Message "Internal error" @Router /namespace/{id} [post]

type NamespaceCreatedEvent added in v0.17.0

type NamespaceCreatedEvent struct {
	Namespace *Namespace
	Doer      web.Auth
}

NamespaceCreatedEvent represents an event where a namespace has been created

func (*NamespaceCreatedEvent) Name added in v0.17.0

func (n *NamespaceCreatedEvent) Name() string

Name defines the name for NamespaceCreatedEvent

type NamespaceDeletedEvent added in v0.17.0

type NamespaceDeletedEvent struct {
	Namespace *Namespace
	Doer      web.Auth
}

NamespaceDeletedEvent represents a NamespaceDeletedEvent event

func (*NamespaceDeletedEvent) Name added in v0.17.0

func (t *NamespaceDeletedEvent) Name() string

TopicName defines the name for NamespaceDeletedEvent

type NamespaceList

type NamespaceList struct {
	List      List      `xorm:"extends"`
	Namespace Namespace `xorm:"extends"`
}

NamespaceList is a meta type to be able to join a list with its namespace

type NamespaceSharedWithTeamEvent added in v0.17.0

type NamespaceSharedWithTeamEvent struct {
	Namespace *Namespace
	Team      *Team
	Doer      web.Auth
}

NamespaceSharedWithTeamEvent represents an event where a namespace has been shared with a team

func (*NamespaceSharedWithTeamEvent) Name added in v0.17.0

Name defines the name for NamespaceSharedWithTeamEvent

type NamespaceSharedWithUserEvent added in v0.17.0

type NamespaceSharedWithUserEvent struct {
	Namespace *Namespace
	User      *user.User
	Doer      web.Auth
}

NamespaceSharedWithUserEvent represents an event where a namespace has been shared with a user

func (*NamespaceSharedWithUserEvent) Name added in v0.17.0

Name defines the name for NamespaceSharedWithUserEvent

type NamespaceUpdatedEvent added in v0.17.0

type NamespaceUpdatedEvent struct {
	Namespace *Namespace
	Doer      web.Auth
}

NamespaceUpdatedEvent represents an event where a namespace has been updated

func (*NamespaceUpdatedEvent) Name added in v0.17.0

func (n *NamespaceUpdatedEvent) Name() string

Name defines the name for NamespaceUpdatedEvent

type NamespaceUser

type NamespaceUser struct {
	// The unique, numeric id of this namespace <-> user relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"namespace"`
	// The username.
	Username string `xorm:"-" json:"user_id" param:"user"`
	UserID   int64  `xorm:"bigint not null INDEX" json:"-"`
	// The namespace id
	NamespaceID int64 `xorm:"bigint not null INDEX" json:"-" param:"namespace"`
	// The right this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

NamespaceUser represents a namespace <-> user relation

func (*NamespaceUser) CanCreate

func (nu *NamespaceUser) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a new user <-> namespace relation

func (*NamespaceUser) CanDelete

func (nu *NamespaceUser) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a user <-> namespace relation

func (*NamespaceUser) CanUpdate

func (nu *NamespaceUser) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a user <-> namespace relation

func (*NamespaceUser) Create

func (nu *NamespaceUser) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new namespace <-> user relation @Summary Add a user to a namespace @Description Gives a user access to a namespace. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Namespace ID" @Param namespace body models.NamespaceUser true "The user you want to add to the namespace." @Success 201 {object} models.NamespaceUser "The created user<->namespace relation." @Failure 400 {object} web.HTTPError "Invalid user namespace object provided." @Failure 404 {object} web.HTTPError "The user does not exist." @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{id}/users [put]

func (*NamespaceUser) Delete

func (nu *NamespaceUser) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a namespace <-> user relation @Summary Delete a user from a namespace @Description Delets a user from a namespace. The user won't have access to the namespace anymore. @tags sharing @Produce json @Security JWTKeyAuth @Param namespaceID path int true "Namespace ID" @Param userID path int true "user ID" @Success 200 {object} models.Message "The user was successfully deleted." @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" @Failure 404 {object} web.HTTPError "user or namespace does not exist." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{namespaceID}/users/{userID} [delete]

func (*NamespaceUser) ReadAll

func (nu *NamespaceUser) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all users who have access to a namespace @Summary Get users on a namespace @Description Returns a namespace with all users which have access on a given namespace. @tags sharing @Accept json @Produce json @Param id path int true "Namespace ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search users by its name." @Security JWTKeyAuth @Success 200 {array} models.UserWithRight "The users with the right they have." @Failure 403 {object} web.HTTPError "No right to see the namespace." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{id}/users [get]

func (NamespaceUser) TableName

func (NamespaceUser) TableName() string

TableName is the table name for NamespaceUser

func (*NamespaceUser) Update

func (nu *NamespaceUser) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a user <-> namespace relation @Summary Update a user <-> namespace relation @Description Update a user <-> namespace relation. Mostly used to update the right that user has. @tags sharing @Accept json @Produce json @Param namespaceID path int true "Namespace ID" @Param userID path int true "User ID" @Param namespace body models.NamespaceUser true "The user you want to update." @Security JWTKeyAuth @Success 200 {object} models.NamespaceUser "The updated user <-> namespace relation." @Failure 403 {object} web.HTTPError "The user does not have admin-access to the namespace" @Failure 404 {object} web.HTTPError "User or namespace does not exist." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{namespaceID}/users/{userID} [post]

type NamespaceWithLists

type NamespaceWithLists struct {
	Namespace `xorm:"extends"`
	Lists     []*List `xorm:"-" json:"lists"`
}

NamespaceWithLists represents a namespace with list meta informations

type NamespaceWithListsAndTasks added in v0.18.0

type NamespaceWithListsAndTasks struct {
	Namespace
	Lists []*ListWithTasksAndBuckets `xorm:"-" json:"lists"`
}

type RelatedTaskMap

type RelatedTaskMap map[RelationKind][]*Task

RelatedTaskMap holds all relations of a single task, grouped by relation kind. This avoids the need for an extra type TaskWithRelation (or similar).

type RelationKind

type RelationKind string

RelationKind represents a kind of relation between to tasks

const (
	RelationKindUnknown     RelationKind = `unknown`
	RelationKindSubtask     RelationKind = `subtask`
	RelationKindParenttask  RelationKind = `parenttask`
	RelationKindRelated     RelationKind = `related`
	RelationKindDuplicateOf RelationKind = `duplicateof`
	RelationKindDuplicates  RelationKind = `duplicates`
	RelationKindBlocking    RelationKind = `blocking`
	RelationKindBlocked     RelationKind = `blocked`
	RelationKindPreceeds    RelationKind = `precedes`
	RelationKindFollows     RelationKind = `follows`
	RelationKindCopiedFrom  RelationKind = `copiedfrom`
	RelationKindCopiedTo    RelationKind = `copiedto`
)

All valid relation kinds

type ReminderDueNotification added in v0.17.0

type ReminderDueNotification struct {
	User *user.User `json:"user"`
	Task *Task      `json:"task"`
}

ReminderDueNotification represents a ReminderDueNotification notification

func (*ReminderDueNotification) Name added in v0.17.0

func (n *ReminderDueNotification) Name() string

Name returns the name of the notification

func (*ReminderDueNotification) ToDB added in v0.17.0

func (n *ReminderDueNotification) ToDB() interface{}

ToDB returns the ReminderDueNotification notification in a format which can be saved in the db

func (*ReminderDueNotification) ToMail added in v0.17.0

ToMail returns the mail notification for ReminderDueNotification

type Right int

Right defines the rights users/teams can have for lists/namespaces

const (
	// Can read lists in a
	RightRead Right = iota
	// Can write in a like lists and tasks. Cannot create new lists.
	RightWrite
	// Can manage a list/namespace, can do everything
	RightAdmin
)

Enumerate all the team rights

type SavedFilter added in v0.15.0

type SavedFilter struct {
	// The unique numeric id of this saved filter
	ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"filter"`
	// The actual filters this filter contains
	Filters *TaskCollection `xorm:"JSON not null" json:"filters" valid:"required"`
	// The title of the filter.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The description of the filter
	Description string `xorm:"longtext null" json:"description"`
	OwnerID     int64  `xorm:"bigint not null INDEX" json:"-"`

	// The user who owns this filter
	Owner *user.User `xorm:"-" json:"owner" valid:"-"`

	// True if the filter is a favorite. Favorite filters show up in a separate namespace together with favorite lists.
	IsFavorite bool `xorm:"default false" json:"is_favorite"`

	// A timestamp when this filter was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this filter was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

SavedFilter represents a saved bunch of filters

func (*SavedFilter) CanCreate added in v0.15.0

func (sf *SavedFilter) CanCreate(s *xorm.Session, auth web.Auth) (bool, error)

CanCreate checks if a user has the right to update a saved filter

func (*SavedFilter) CanDelete added in v0.15.0

func (sf *SavedFilter) CanDelete(s *xorm.Session, auth web.Auth) (bool, error)

CanDelete checks if a user has the right to delete a saved filter

func (*SavedFilter) CanRead added in v0.15.0

func (sf *SavedFilter) CanRead(s *xorm.Session, auth web.Auth) (bool, int, error)

CanRead checks if a user has the right to read a saved filter

func (*SavedFilter) CanUpdate added in v0.15.0

func (sf *SavedFilter) CanUpdate(s *xorm.Session, auth web.Auth) (bool, error)

CanUpdate checks if a user has the right to update a saved filter

func (*SavedFilter) Create added in v0.15.0

func (sf *SavedFilter) Create(s *xorm.Session, auth web.Auth) error

Create creates a new saved filter @Summary Creates a new saved filter @Description Creates a new saved filter @tags filter @Accept json @Produce json @Security JWTKeyAuth @Success 201 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 500 {object} models.Message "Internal error" @Router /filters [put]

func (*SavedFilter) Delete added in v0.15.0

func (sf *SavedFilter) Delete(s *xorm.Session, a web.Auth) error

Delete removes a saved filter @Summary Removes a saved filter @Description Removes a saved filter by its ID. @tags filter @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Filter ID" @Success 200 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 404 {object} web.HTTPError "The saved filter does not exist." @Failure 500 {object} models.Message "Internal error" @Router /filters/{id} [delete]

func (*SavedFilter) ReadOne added in v0.15.0

func (sf *SavedFilter) ReadOne(s *xorm.Session, a web.Auth) error

ReadOne returns one saved filter @Summary Gets one saved filter @Description Returns a saved filter by its ID. @tags filter @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Filter ID" @Success 200 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 500 {object} models.Message "Internal error" @Router /filters/{id} [get]

func (*SavedFilter) TableName added in v0.15.0

func (sf *SavedFilter) TableName() string

TableName returns a better table name for saved filters

func (*SavedFilter) Update added in v0.15.0

func (sf *SavedFilter) Update(s *xorm.Session, a web.Auth) error

Update updates an existing filter @Summary Updates a saved filter @Description Updates a saved filter by its ID. @tags filter @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Filter ID" @Success 200 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 404 {object} web.HTTPError "The saved filter does not exist." @Failure 500 {object} models.Message "Internal error" @Router /filters/{id} [post]

type SendListCreatedNotification added in v0.17.0

type SendListCreatedNotification struct {
}

SendListCreatedNotification represents a listener

func (*SendListCreatedNotification) Handle added in v0.17.0

func (s *SendListCreatedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendListCreatedNotification listens on is fired

func (*SendListCreatedNotification) Name added in v0.17.0

Name defines the name for the SendListCreatedNotification listener

type SendTaskAssignedNotification added in v0.17.0

type SendTaskAssignedNotification struct {
}

SendTaskAssignedNotification represents a listener

func (*SendTaskAssignedNotification) Handle added in v0.17.0

func (s *SendTaskAssignedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTaskAssignedNotification listens on is fired

func (*SendTaskAssignedNotification) Name added in v0.17.0

Name defines the name for the SendTaskAssignedNotification listener

type SendTaskCommentNotification added in v0.17.0

type SendTaskCommentNotification struct {
}

SendTaskCommentNotification represents a listener

func (*SendTaskCommentNotification) Handle added in v0.17.0

func (s *SendTaskCommentNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTaskCommentNotification listens on is fired

func (*SendTaskCommentNotification) Name added in v0.17.0

Name defines the name for the SendTaskCommentNotification listener

type SendTaskDeletedNotification added in v0.17.0

type SendTaskDeletedNotification struct {
}

SendTaskDeletedNotification represents a listener

func (*SendTaskDeletedNotification) Handle added in v0.17.0

func (s *SendTaskDeletedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTaskDeletedNotification listens on is fired

func (*SendTaskDeletedNotification) Name added in v0.17.0

Name defines the name for the SendTaskDeletedNotification listener

type SendTeamMemberAddedNotification added in v0.17.0

type SendTeamMemberAddedNotification struct {
}

SendTeamMemberAddedNotification represents a listener

func (*SendTeamMemberAddedNotification) Handle added in v0.17.0

func (s *SendTeamMemberAddedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTeamMemberAddedNotification listens on is fired

func (*SendTeamMemberAddedNotification) Name added in v0.17.0

Name defines the name for the SendTeamMemberAddedNotification listener

type SharingType

type SharingType int

SharingType holds the sharing type

const (
	SharingTypeUnknown SharingType = iota
	SharingTypeWithoutPassword
	SharingTypeWithPassword
)

These consts represent all valid link sharing types

type SubscribeAssigneeToTask added in v0.17.0

type SubscribeAssigneeToTask struct {
}

func (*SubscribeAssigneeToTask) Handle added in v0.17.0

func (s *SubscribeAssigneeToTask) Handle(msg *message.Message) (err error)

Handle is executed when the event SubscribeAssigneeToTask listens on is fired

func (*SubscribeAssigneeToTask) Name added in v0.17.0

func (s *SubscribeAssigneeToTask) Name() string

Name defines the name for the SubscribeAssigneeToTask listener

type Subscription added in v0.17.0

type Subscription struct {
	// The numeric ID of the subscription
	ID int64 `xorm:"autoincr not null unique pk" json:"id"`

	EntityType SubscriptionEntityType `xorm:"index not null" json:"-"`
	Entity     string                 `xorm:"-" json:"entity" param:"entity"`
	// The id of the entity to subscribe to.
	EntityID int64 `xorm:"bigint index not null" json:"entity_id" param:"entityID"`

	// The user who made this subscription
	User   *user.User `xorm:"-" json:"user"`
	UserID int64      `xorm:"bigint index not null" json:"-"`

	// A timestamp when this subscription was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Subscription represents a subscription for an entity

func GetSubscription added in v0.17.0

func GetSubscription(s *xorm.Session, entityType SubscriptionEntityType, entityID int64, a web.Auth) (subscription *Subscription, err error)

GetSubscription returns a matching subscription for an entity and user. It will return the next parent of a subscription. That means for tasks, it will first look for a subscription for that task, if there is none it will look for a subscription on the list the task belongs to and if that also doesn't exist it will check for a subscription for the namespace the list is belonging to.

func (*Subscription) CanCreate added in v0.17.0

func (sb *Subscription) CanCreate(s *xorm.Session, a web.Auth) (can bool, err error)

CanCreate checks if a user can subscribe to an entity

func (*Subscription) CanDelete added in v0.17.0

func (sb *Subscription) CanDelete(s *xorm.Session, a web.Auth) (can bool, err error)

CanDelete checks if a user can delete a subscription

func (*Subscription) Create added in v0.17.0

func (sb *Subscription) Create(s *xorm.Session, auth web.Auth) (err error)

Create subscribes the current user to an entity @Summary Subscribes the current user to an entity. @Description Subscribes the current user to an entity. @tags subscriptions @Accept json @Produce json @Security JWTKeyAuth @Param entity path string true "The entity the user subscribes to. Can be either `namespace`, `list` or `task`." @Param entityID path string true "The numeric id of the entity to subscribe to." @Success 201 {object} models.Subscription "The subscription" @Failure 403 {object} web.HTTPError "The user does not have access to subscribe to this entity." @Failure 412 {object} web.HTTPError "The subscription already exists." @Failure 412 {object} web.HTTPError "The subscription entity is invalid." @Failure 500 {object} models.Message "Internal error" @Router /subscriptions/{entity}/{entityID} [put]

func (*Subscription) Delete added in v0.17.0

func (sb *Subscription) Delete(s *xorm.Session, auth web.Auth) (err error)

Delete unsubscribes the current user to an entity @Summary Unsubscribe the current user from an entity. @Description Unsubscribes the current user to an entity. @tags subscriptions @Accept json @Produce json @Security JWTKeyAuth @Param entity path string true "The entity the user subscribed to. Can be either `namespace`, `list` or `task`." @Param entityID path string true "The numeric id of the subscribed entity to." @Success 200 {object} models.Subscription "The subscription" @Failure 403 {object} web.HTTPError "The user does not have access to subscribe to this entity." @Failure 404 {object} web.HTTPError "The subscription does not exist." @Failure 500 {object} models.Message "Internal error" @Router /subscriptions/{entity}/{entityID} [delete]

func (*Subscription) TableName added in v0.17.0

func (sb *Subscription) TableName() string

TableName gives us a better tabel name for the subscriptions table

type SubscriptionEntityType added in v0.17.0

type SubscriptionEntityType int

SubscriptionEntityType represents all entities which can be subscribed to

func (SubscriptionEntityType) String added in v0.17.0

func (et SubscriptionEntityType) String() string

String returns a human-readable string of an entity

type Task

type Task struct {
	// The unique, numeric id of this task.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"listtask"`
	// The task text. This is what you'll see in the list.
	Title string `xorm:"TEXT not null" json:"title" valid:"minstringlength(1)" minLength:"1"`
	// The task description.
	Description string `xorm:"longtext null" json:"description"`
	// Whether a task is done or not.
	Done bool `xorm:"INDEX null" json:"done"`
	// The time when a task was marked as done.
	DoneAt time.Time `xorm:"INDEX null 'done_at'" json:"done_at"`
	// The time when the task is due.
	DueDate time.Time `xorm:"DATETIME INDEX null 'due_date'" json:"due_date"`
	// An array of datetimes when the user wants to be reminded of the task.
	Reminders []time.Time `xorm:"-" json:"reminder_dates"`
	// The list this task belongs to.
	ListID int64 `xorm:"bigint INDEX not null" json:"list_id" param:"list"`
	// An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as "undone" and then increase all remindes and the due date by its amount.
	RepeatAfter int64 `xorm:"bigint INDEX null" json:"repeat_after" valid:"range(0|9223372036854775807)"`
	// Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date.
	RepeatMode TaskRepeatMode `xorm:"not null default 0" json:"repeat_mode"`
	// The task priority. Can be anything you want, it is possible to sort by this later.
	Priority int64 `xorm:"bigint null" json:"priority"`
	// When this task starts.
	StartDate time.Time `xorm:"DATETIME INDEX null 'start_date'" json:"start_date" query:"-"`
	// When this task ends.
	EndDate time.Time `xorm:"DATETIME INDEX null 'end_date'" json:"end_date" query:"-"`
	// An array of users who are assigned to this task
	Assignees []*user.User `xorm:"-" json:"assignees"`
	// An array of labels which are associated with this task.
	Labels []*Label `xorm:"-" json:"labels"`
	// The task color in hex
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|6)" maxLength:"6"`
	// Determines how far a task is left from being done
	PercentDone float64 `xorm:"DOUBLE null" json:"percent_done"`

	// The task identifier, based on the list identifier and the task's index
	Identifier string `xorm:"-" json:"identifier"`
	// The task index, calculated per list
	Index int64 `xorm:"bigint not null default 0" json:"index"`

	// The UID is currently not used for anything other than caldav, which is why we don't expose it over json
	UID string `xorm:"varchar(250) null" json:"-"`

	// All related tasks, grouped by their relation kind
	RelatedTasks RelatedTaskMap `xorm:"-" json:"related_tasks"`

	// All attachments this task has
	Attachments []*TaskAttachment `xorm:"-" json:"attachments"`

	// If this task has a cover image, the field will return the id of the attachment that is the cover image.
	CoverImageAttachmentID int64 `xorm:"bigint default 0" json:"cover_image_attachment_id"`

	// True if a task is a favorite task. Favorite tasks show up in a separate "Important" list. This value depends on the user making the call to the api.
	IsFavorite bool `xorm:"-" json:"is_favorite"`

	// The subscription status for the user reading this task. You can only read this property, use the subscription endpoints to modify it.
	// Will only returned when retreiving one task.
	Subscription *Subscription `xorm:"-" json:"subscription,omitempty"`

	// A timestamp when this task was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this task was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	// BucketID is the ID of the kanban bucket this task belongs to.
	BucketID int64 `xorm:"bigint null" json:"bucket_id"`

	// The position of the task - any task list can be sorted as usual by this parameter.
	// When accessing tasks via kanban buckets, this is primarily used to sort them based on a range
	// We're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).
	// You would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.
	// A 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task
	// which also leaves a lot of room for rearranging and sorting later.
	Position float64 `xorm:"double null" json:"position"`
	// The position of tasks in the kanban board. See the docs for the `position` property on how to use this.
	KanbanPosition float64 `xorm:"double null" json:"kanban_position"`

	// The user who initially created the task.
	CreatedBy   *user.User `xorm:"-" json:"created_by" valid:"-"`
	CreatedByID int64      `xorm:"bigint not null" json:"-"` // ID of the user who put that task on the list

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Task represents an task in a todolist

func GetTaskByIDSimple

func GetTaskByIDSimple(s *xorm.Session, taskID int64) (task Task, err error)

GetTaskByIDSimple returns a raw task without extra data by the task ID

func GetTaskSimple

func GetTaskSimple(s *xorm.Session, t *Task) (task Task, err error)

GetTaskSimple returns a raw task without extra data

func GetTasksByUIDs

func GetTasksByUIDs(s *xorm.Session, uids []string, a web.Auth) (tasks []*Task, err error)

GetTasksByUIDs gets all tasks from a bunch of uids

func (*Task) CanCreate

func (t *Task) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate determines if a user has the right to create a list task

func (*Task) CanDelete

func (t *Task) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete an task

func (*Task) CanRead

func (t *Task) CanRead(s *xorm.Session, a web.Auth) (canRead bool, maxRight int, err error)

CanRead determines if a user can read a task

func (*Task) CanUpdate

func (t *Task) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate determines if a user has the right to update a list task

func (*Task) CanWrite

func (t *Task) CanWrite(s *xorm.Session, a web.Auth) (canWrite bool, err error)

CanWrite checks if a user has write access to a task

func (*Task) Create

func (t *Task) Create(s *xorm.Session, a web.Auth) (err error)

Create is the implementation to create a list task @Summary Create a task @Description Inserts a task into a list. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List ID" @Param task body models.Task true "The task object" @Success 201 {object} models.Task "The created task object." @Failure 400 {object} web.HTTPError "Invalid task object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists/{id} [put]

func (*Task) Delete

func (t *Task) Delete(s *xorm.Session, a web.Auth) (err error)

Delete implements the delete method for listTask @Summary Delete a task @Description Deletes a task from a list. This does not mean "mark it done". @tags task @Produce json @Security JWTKeyAuth @Param id path int true "Task ID" @Success 200 {object} models.Message "The created task object." @Failure 400 {object} web.HTTPError "Invalid task ID provided." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id} [delete]

func (*Task) GetFrontendURL added in v0.17.0

func (t *Task) GetFrontendURL() string

func (*Task) GetFullIdentifier added in v0.17.0

func (t *Task) GetFullIdentifier() string

GetFullIdentifier returns the task identifier if the task has one and the index prefixed with # otherwise.

func (*Task) ReadAll

func (t *Task) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll is a dummy function to still have that endpoint documented @Summary Get tasks @Description Returns all tasks on any list the user has access to. @tags task @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search tasks by task text." @Param sort_by query string false "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`." @Param order_by query string false "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`." @Param filter_by query string false "The name of the field to filter by. Allowed values are all task properties. Task properties which are their own object require passing in the id of that entity. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." @Param filter_value query string false "The value to filter for." @Param filter_comparator query string false "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less`, `less_equals`, `like` and `in`. `in` expects comma-separated values in `filter_value`. Defaults to `equals`" @Param filter_concat query string false "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`." @Param filter_include_nulls query string false "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`." @Security JWTKeyAuth @Success 200 {array} models.Task "The tasks" @Failure 500 {object} models.Message "Internal error" @Router /tasks/all [get]

func (*Task) ReadOne

func (t *Task) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne gets one task by its ID @Summary Get one task @Description Returns one task by its ID @tags task @Accept json @Produce json @Param ID path int true "The task ID" @Security JWTKeyAuth @Success 200 {object} models.Task "The task" @Failure 404 {object} models.Message "Task not found" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{ID} [get]

func (*Task) TableName

func (*Task) TableName() string

TableName returns the table name for listtasks

func (*Task) Update

func (t *Task) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a list task @Summary Update a task @Description Updates a task. This includes marking it as done. Assignees you pass will be updated, see their individual endpoints for more details on how this is done. To update labels, see the description of the endpoint. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Task ID" @Param task body models.Task true "The task object" @Success 200 {object} models.Task "The updated task object." @Failure 400 {object} web.HTTPError "Invalid task object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its list)" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id} [post]

func (*Task) UpdateTaskLabels added in v0.20.3

func (t *Task) UpdateTaskLabels(s *xorm.Session, creator web.Auth, labels []*Label) (err error)

Create or update a bunch of task labels

type TaskAssginee

type TaskAssginee struct {
	ID      int64     `xorm:"bigint autoincr not null unique pk" json:"-"`
	TaskID  int64     `xorm:"bigint INDEX not null" json:"-" param:"listtask"`
	UserID  int64     `xorm:"bigint INDEX not null" json:"user_id" param:"user"`
	Created time.Time `xorm:"created not null"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskAssginee represents an assignment of a user to a task

func (*TaskAssginee) CanCreate

func (la *TaskAssginee) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can add a new assignee

func (*TaskAssginee) CanDelete

func (la *TaskAssginee) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete an assignee

func (*TaskAssginee) Create

func (la *TaskAssginee) Create(s *xorm.Session, a web.Auth) (err error)

Create adds a new assignee to a task @Summary Add a new assignee to a task @Description Adds a new assignee to a task. The assignee needs to have access to the list, the doer must be able to edit this task. @tags assignees @Accept json @Produce json @Security JWTKeyAuth @Param assignee body models.TaskAssginee true "The assingee object" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskAssginee "The created assingee object." @Failure 400 {object} web.HTTPError "Invalid assignee object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees [put]

func (*TaskAssginee) Delete

func (la *TaskAssginee) Delete(s *xorm.Session, a web.Auth) (err error)

Delete a task assignee @Summary Delete an assignee @Description Un-assign a user from a task. @tags assignees @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param userID path int true "Assignee user ID" @Success 200 {object} models.Message "The assignee was successfully deleted." @Failure 403 {object} web.HTTPError "Not allowed to delete the assignee." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees/{userID} [delete]

func (*TaskAssginee) ReadAll

func (la *TaskAssginee) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all assignees for a task @Summary Get all assignees for a task @Description Returns an array with all assignees for this task. @tags assignees @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search assignees by their username." @Param taskID path int true "Task ID" @Security JWTKeyAuth @Success 200 {array} user.User "The assignees" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees [get]

func (TaskAssginee) TableName

func (TaskAssginee) TableName() string

TableName makes a pretty table name

type TaskAssignedNotification added in v0.17.0

type TaskAssignedNotification struct {
	Doer     *user.User `json:"doer"`
	Task     *Task      `json:"task"`
	Assignee *user.User `json:"assignee"`
}

TaskAssignedNotification represents a TaskAssignedNotification notification

func (*TaskAssignedNotification) Name added in v0.17.0

func (n *TaskAssignedNotification) Name() string

Name returns the name of the notification

func (*TaskAssignedNotification) ToDB added in v0.17.0

func (n *TaskAssignedNotification) ToDB() interface{}

ToDB returns the TaskAssignedNotification notification in a format which can be saved in the db

func (*TaskAssignedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TaskAssignedNotification

type TaskAssigneeCreatedEvent added in v0.17.0

type TaskAssigneeCreatedEvent struct {
	Task     *Task
	Assignee *user.User
	Doer     *user.User
}

TaskAssigneeCreatedEvent represents an event where a task has been assigned to a user

func (*TaskAssigneeCreatedEvent) Name added in v0.17.0

func (t *TaskAssigneeCreatedEvent) Name() string

Name defines the name for TaskAssigneeCreatedEvent

type TaskAssigneeDeletedEvent added in v0.20.3

type TaskAssigneeDeletedEvent struct {
	Task     *Task
	Assignee *user.User
	Doer     *user.User
}

TaskAssigneeDeletedEvent represents a TaskAssigneeDeletedEvent event

func (*TaskAssigneeDeletedEvent) Name added in v0.20.3

func (t *TaskAssigneeDeletedEvent) Name() string

Name defines the name for TaskAssigneeDeletedEvent

type TaskAssigneeWithUser

type TaskAssigneeWithUser struct {
	TaskID    int64
	user.User `xorm:"extends"`
}

TaskAssigneeWithUser is a helper type to deal with user joins

type TaskAttachment

type TaskAttachment struct {
	ID     int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"attachment"`
	TaskID int64 `xorm:"bigint not null" json:"task_id" param:"task"`
	FileID int64 `xorm:"bigint not null" json:"-"`

	CreatedByID int64      `xorm:"bigint not null" json:"-"`
	CreatedBy   *user.User `xorm:"-" json:"created_by"`

	File *files.File `xorm:"-" json:"file"`

	Created time.Time `xorm:"created" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskAttachment is the definition of a task attachment

func (*TaskAttachment) CanCreate

func (ta *TaskAttachment) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create an attachment

func (*TaskAttachment) CanDelete

func (ta *TaskAttachment) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete an attachment

func (*TaskAttachment) CanRead

func (ta *TaskAttachment) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if the user can see an attachment

func (*TaskAttachment) Delete

func (ta *TaskAttachment) Delete(s *xorm.Session, a web.Auth) error

Delete removes an attachment @Summary Delete an attachment @Description Delete an attachment. @tags task @Accept json @Produce json @Param id path int true "Task ID" @Param attachmentID path int true "Attachment ID" @Security JWTKeyAuth @Success 200 {object} models.Message "The attachment was deleted successfully." @Failure 403 {object} models.Message "No access to this task." @Failure 404 {object} models.Message "The task does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id}/attachments/{attachmentID} [delete]

func (*TaskAttachment) NewAttachment

func (ta *TaskAttachment) NewAttachment(s *xorm.Session, f io.ReadCloser, realname string, realsize uint64, a web.Auth) error

NewAttachment creates a new task attachment Note: I'm not sure if only accepting an io.ReadCloser and not an afero.File or os.File instead is a good way of doing things.

func (*TaskAttachment) ReadAll

func (ta *TaskAttachment) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns a list with all attachments @Summary Get all attachments for one task. @Description Get all task attachments for one task. @tags task @Accept json @Produce json @Param id path int true "Task ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Security JWTKeyAuth @Success 200 {array} models.TaskAttachment "All attachments for this task" @Failure 403 {object} models.Message "No access to this task." @Failure 404 {object} models.Message "The task does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id}/attachments [get]

func (*TaskAttachment) ReadOne

func (ta *TaskAttachment) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne returns a task attachment

func (*TaskAttachment) TableName

func (*TaskAttachment) TableName() string

TableName returns the table name for task attachments

type TaskAttachmentCreatedEvent added in v0.20.3

type TaskAttachmentCreatedEvent struct {
	Task       *Task
	Attachment *TaskAttachment
	Doer       *user.User
}

TaskAttachmentCreatedEvent represents a TaskAttachmentCreatedEvent event

func (*TaskAttachmentCreatedEvent) Name added in v0.20.3

Name defines the name for TaskAttachmentCreatedEvent

type TaskAttachmentDeletedEvent added in v0.20.3

type TaskAttachmentDeletedEvent struct {
	Task       *Task
	Attachment *TaskAttachment
	Doer       *user.User
}

TaskAttachmentDeletedEvent represents a TaskAttachmentDeletedEvent event

func (*TaskAttachmentDeletedEvent) Name added in v0.20.3

Name defines the name for TaskAttachmentDeletedEvent

type TaskCollection

type TaskCollection struct {
	ListID int64   `param:"list" json:"-"`
	Lists  []*List `json:"-"`

	// The query parameter to sort by. This is for ex. done, priority, etc.
	SortBy    []string `query:"sort_by" json:"sort_by"`
	SortByArr []string `query:"sort_by[]" json:"-"`
	// The query parameter to order the items by. This can be either asc or desc, with asc being the default.
	OrderBy    []string `query:"order_by" json:"order_by"`
	OrderByArr []string `query:"order_by[]" json:"-"`

	// The field name of the field to filter by
	FilterBy    []string `query:"filter_by" json:"filter_by"`
	FilterByArr []string `query:"filter_by[]" json:"-"`
	// The value of the field name to filter by
	FilterValue    []string `query:"filter_value" json:"filter_value"`
	FilterValueArr []string `query:"filter_value[]" json:"-"`
	// The comparator for field and value
	FilterComparator    []string `query:"filter_comparator" json:"filter_comparator"`
	FilterComparatorArr []string `query:"filter_comparator[]" json:"-"`
	// The way all filter conditions are concatenated together, can be either "and" or "or".,
	FilterConcat string `query:"filter_concat" json:"filter_concat"`
	// If set to true, the result will also include null values
	FilterIncludeNulls bool `query:"filter_include_nulls" json:"filter_include_nulls"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskCollection is a struct used to hold filter details and not clutter the Task struct with information not related to actual tasks.

func (*TaskCollection) ReadAll

func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll gets all tasks for a collection @Summary Get tasks in a list @Description Returns all tasks for the current list. @tags task @Accept json @Produce json @Param listID path int true "The list ID." @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search tasks by task text." @Param sort_by query string false "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`." @Param order_by query string false "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`." @Param filter_by query string false "The name of the field to filter by. Allowed values are all task properties. Task properties which are their own object require passing in the id of that entity. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." @Param filter_value query string false "The value to filter for. You can use [grafana](https://grafana.com/docs/grafana/latest/dashboards/time-range-controls)- or [elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#date-math)-style relative dates for all date fields like `due_date`, `start_date`, `end_date`, etc." @Param filter_comparator query string false "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less`, `less_equals`, `like` and `in`. `in` expects comma-separated values in `filter_value`. Defaults to `equals`" @Param filter_concat query string false "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`." @Param filter_include_nulls query string false "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`." @Security JWTKeyAuth @Success 200 {array} models.Task "The tasks" @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/tasks [get]

type TaskComment

type TaskComment struct {
	ID       int64      `xorm:"autoincr pk unique not null" json:"id" param:"commentid"`
	Comment  string     `xorm:"text not null" json:"comment"`
	AuthorID int64      `xorm:"not null" json:"-"`
	Author   *user.User `xorm:"-" json:"author"`
	TaskID   int64      `xorm:"not null" json:"-" param:"task"`

	Created time.Time `xorm:"created" json:"created"`
	Updated time.Time `xorm:"updated" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskComment represents a task comment

func (*TaskComment) CanCreate

func (tc *TaskComment) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can create a new comment

func (*TaskComment) CanDelete

func (tc *TaskComment) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a comment

func (*TaskComment) CanRead

func (tc *TaskComment) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user can read a comment

func (*TaskComment) CanUpdate

func (tc *TaskComment) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update a comment

func (*TaskComment) Create

func (tc *TaskComment) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new task comment @Summary Create a new task comment @Description Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param relation body models.TaskComment true "The task comment object" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskComment "The created task comment object." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments [put]

func (*TaskComment) Delete

func (tc *TaskComment) Delete(s *xorm.Session, a web.Auth) error

Delete removes a task comment @Summary Remove a task comment @Description Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param commentID path int true "Comment ID" @Success 200 {object} models.Message "The task comment was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 404 {object} web.HTTPError "The task comment was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments/{commentID} [delete]

func (*TaskComment) ReadAll

func (tc *TaskComment) ReadAll(s *xorm.Session, auth web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns all comments for a task @Summary Get all task comments @Description Get all task comments. The user doing this need to have at least read access to the task. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Success 200 {array} models.TaskComment "The array with all task comments" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments [get]

func (*TaskComment) ReadOne

func (tc *TaskComment) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne handles getting a single comment @Summary Remove a task comment @Description Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param commentID path int true "Comment ID" @Success 200 {object} models.TaskComment "The task comment object." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 404 {object} web.HTTPError "The task comment was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments/{commentID} [get]

func (*TaskComment) TableName

func (tc *TaskComment) TableName() string

TableName holds the table name for the task comments table

func (*TaskComment) Update

func (tc *TaskComment) Update(s *xorm.Session, a web.Auth) error

Update updates a task text by its ID @Summary Update an existing task comment @Description Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param commentID path int true "Comment ID" @Success 200 {object} models.TaskComment "The updated task comment object." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 404 {object} web.HTTPError "The task comment was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments/{commentID} [post]

type TaskCommentCreatedEvent added in v0.17.0

type TaskCommentCreatedEvent struct {
	Task    *Task
	Comment *TaskComment
	Doer    *user.User
}

TaskCommentCreatedEvent represents an event where a task comment has been created

func (*TaskCommentCreatedEvent) Name added in v0.17.0

func (t *TaskCommentCreatedEvent) Name() string

Name defines the name for TaskCommentCreatedEvent

type TaskCommentDeletedEvent added in v0.20.3

type TaskCommentDeletedEvent struct {
	Task    *Task
	Comment *TaskComment
	Doer    *user.User
}

TaskCommentDeletedEvent represents a TaskCommentDeletedEvent event

func (*TaskCommentDeletedEvent) Name added in v0.20.3

func (t *TaskCommentDeletedEvent) Name() string

Name defines the name for TaskCommentDeletedEvent

type TaskCommentNotification added in v0.17.0

type TaskCommentNotification struct {
	Doer      *user.User   `json:"doer"`
	Task      *Task        `json:"task"`
	Comment   *TaskComment `json:"comment"`
	Mentioned bool         `json:"mentioned"`
}

TaskCommentNotification represents a TaskCommentNotification notification

func (*TaskCommentNotification) Name added in v0.17.0

func (n *TaskCommentNotification) Name() string

Name returns the name of the notification

func (*TaskCommentNotification) SubjectID added in v0.18.0

func (n *TaskCommentNotification) SubjectID() int64

func (*TaskCommentNotification) ToDB added in v0.17.0

func (n *TaskCommentNotification) ToDB() interface{}

ToDB returns the TaskCommentNotification notification in a format which can be saved in the db

func (*TaskCommentNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TaskCommentNotification

type TaskCommentUpdatedEvent added in v0.18.0

type TaskCommentUpdatedEvent struct {
	Task    *Task
	Comment *TaskComment
	Doer    *user.User
}

TaskCommentUpdatedEvent represents a TaskCommentUpdatedEvent event

func (*TaskCommentUpdatedEvent) Name added in v0.18.0

func (t *TaskCommentUpdatedEvent) Name() string

Name defines the name for TaskCommentUpdatedEvent

type TaskCreatedEvent added in v0.17.0

type TaskCreatedEvent struct {
	Task *Task
	Doer *user.User
}

TaskCreatedEvent represents an event where a task has been created

func (*TaskCreatedEvent) Name added in v0.17.0

func (t *TaskCreatedEvent) Name() string

Name defines the name for TaskCreatedEvent

type TaskDeletedEvent added in v0.17.0

type TaskDeletedEvent struct {
	Task *Task
	Doer *user.User
}

TaskDeletedEvent represents a TaskDeletedEvent event

func (*TaskDeletedEvent) Name added in v0.17.0

func (t *TaskDeletedEvent) Name() string

Name defines the name for TaskDeletedEvent

type TaskDeletedNotification added in v0.17.0

type TaskDeletedNotification struct {
	Doer *user.User `json:"doer"`
	Task *Task      `json:"task"`
}

TaskDeletedNotification represents a TaskDeletedNotification notification

func (*TaskDeletedNotification) Name added in v0.17.0

func (n *TaskDeletedNotification) Name() string

Name returns the name of the notification

func (*TaskDeletedNotification) ToDB added in v0.17.0

func (n *TaskDeletedNotification) ToDB() interface{}

ToDB returns the TaskDeletedNotification notification in a format which can be saved in the db

func (*TaskDeletedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TaskDeletedNotification

type TaskRelation

type TaskRelation struct {
	// The unique, numeric id of this relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"-"`
	// The ID of the "base" task, the task which has a relation to another.
	TaskID int64 `xorm:"bigint not null" json:"task_id" param:"task"`
	// The ID of the other task, the task which is being related.
	OtherTaskID int64 `xorm:"bigint not null" json:"other_task_id" param:"otherTask"`
	// The kind of the relation.
	RelationKind RelationKind `xorm:"varchar(50) not null" json:"relation_kind" param:"relationKind"`

	CreatedByID int64 `xorm:"bigint not null" json:"-"`
	// The user who created this relation
	CreatedBy *user.User `xorm:"-" json:"created_by"`

	// A timestamp when this label was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskRelation represents a kind of relation between two tasks

func (*TaskRelation) CanCreate

func (rel *TaskRelation) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can create a new relation between two relations

func (*TaskRelation) CanDelete

func (rel *TaskRelation) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a task relation

func (*TaskRelation) Create

func (rel *TaskRelation) Create(s *xorm.Session, a web.Auth) error

Create creates a new task relation @Summary Create a new relation between two tasks @Description Creates a new relation between two tasks. The user needs to have update rights on the base task and at least read rights on the other task. Both tasks do not need to be on the same list. Take a look at the docs for available task relation kinds. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param relation body models.TaskRelation true "The relation object" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskRelation "The created task relation object." @Failure 400 {object} web.HTTPError "Invalid task relation object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/relations [put]

func (*TaskRelation) Delete

func (rel *TaskRelation) Delete(s *xorm.Session, a web.Auth) error

Delete removes a task relation @Summary Remove a task relation @tags task @Accept json @Produce json @Security JWTKeyAuth @Param relation body models.TaskRelation true "The relation object" @Param taskID path int true "Task ID" @Param relationKind path string true "The kind of the relation. See the TaskRelation type for more info." @Param otherTaskId path int true "The id of the other task." @Success 200 {object} models.Message "The task relation was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid task relation object provided." @Failure 404 {object} web.HTTPError "The task relation was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/relations/{relationKind}/{otherTaskId} [delete]

func (*TaskRelation) TableName

func (*TaskRelation) TableName() string

TableName holds the table name for the task relation table

type TaskRelationCreatedEvent added in v0.20.3

type TaskRelationCreatedEvent struct {
	Task     *Task
	Relation *TaskRelation
	Doer     *user.User
}

TaskRelationCreatedEvent represents a TaskRelationCreatedEvent event

func (*TaskRelationCreatedEvent) Name added in v0.20.3

func (t *TaskRelationCreatedEvent) Name() string

Name defines the name for TaskRelationCreatedEvent

type TaskRelationDeletedEvent added in v0.20.3

type TaskRelationDeletedEvent struct {
	Task     *Task
	Relation *TaskRelation
	Doer     *user.User
}

TaskRelationDeletedEvent represents a TaskRelationDeletedEvent event

func (*TaskRelationDeletedEvent) Name added in v0.20.3

func (t *TaskRelationDeletedEvent) Name() string

Name defines the name for TaskRelationDeletedEvent

type TaskReminder

type TaskReminder struct {
	ID       int64     `xorm:"bigint autoincr not null unique pk"`
	TaskID   int64     `xorm:"bigint not null INDEX"`
	Reminder time.Time `xorm:"DATETIME not null INDEX 'reminder'"`
	Created  time.Time `xorm:"created not null"`
}

TaskReminder holds a reminder on a task

func (TaskReminder) TableName

func (TaskReminder) TableName() string

TableName returns a pretty table name

type TaskRepeatMode added in v0.17.0

type TaskRepeatMode int
const (
	TaskRepeatModeDefault TaskRepeatMode = iota
	TaskRepeatModeMonth
	TaskRepeatModeFromCurrentDate
)

type TaskUpdatedEvent added in v0.17.0

type TaskUpdatedEvent struct {
	Task *Task
	Doer *user.User
}

TaskUpdatedEvent represents an event where a task has been updated

func (*TaskUpdatedEvent) Name added in v0.17.0

func (t *TaskUpdatedEvent) Name() string

Name defines the name for TaskUpdatedEvent

type TaskWithComments added in v0.18.0

type TaskWithComments struct {
	Task
	Comments []*TaskComment `xorm:"-" json:"comments"`
}

type Team

type Team struct {
	// The unique, numeric id of this team.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"team"`
	// The name of this team.
	Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The team's description.
	Description string `xorm:"longtext null" json:"description"`
	CreatedByID int64  `xorm:"bigint not null INDEX" json:"-"`

	// The user who created this team.
	CreatedBy *user.User `xorm:"-" json:"created_by"`
	// An array of all members in this team.
	Members []*TeamUser `xorm:"-" json:"members"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Team holds a team object

func GetTeamByID

func GetTeamByID(s *xorm.Session, id int64) (team *Team, err error)

GetTeamByID gets a team by its ID

func (*Team) CanCreate

func (t *Team) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a new team

func (*Team) CanDelete

func (t *Team) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a team

func (*Team) CanRead

func (t *Team) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead returns true if the user has read access to the team

func (*Team) CanUpdate

func (t *Team) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a team

func (*Team) Create

func (t *Team) Create(s *xorm.Session, a web.Auth) (err error)

Create is the handler to create a team @Summary Creates a new team @Description Creates a new team in a given namespace. The user needs write-access to the namespace. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param team body models.Team true "The team you want to create." @Success 201 {object} models.Team "The created team." @Failure 400 {object} web.HTTPError "Invalid team object provided." @Failure 500 {object} models.Message "Internal error" @Router /teams [put]

func (*Team) Delete

func (t *Team) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a team @Summary Deletes a team @Description Delets a team. This will also remove the access for all users in that team. @tags team @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Success 200 {object} models.Message "The team was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid team object provided." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id} [delete]

func (*Team) IsAdmin

func (t *Team) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin returns true when the user is admin of a team

func (*Team) ReadAll

func (t *Team) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all teams the user is part of @Summary Get teams @Description Returns all teams the current user is part of. @tags team @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search teams by its name." @Security JWTKeyAuth @Success 200 {array} models.Team "The teams." @Failure 500 {object} models.Message "Internal error" @Router /teams [get]

func (*Team) ReadOne

func (t *Team) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne implements the CRUD method to get one team @Summary Gets one team @Description Returns a team by its ID. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Success 200 {object} models.Team "The team" @Failure 403 {object} web.HTTPError "The user does not have access to the team" @Failure 500 {object} models.Message "Internal error" @Router /teams/{id} [get]

func (Team) TableName

func (Team) TableName() string

TableName makes beautiful table names

func (*Team) Update

func (t *Team) Update(s *xorm.Session, a web.Auth) (err error)

Update is the handler to create a team @Summary Updates a team @Description Updates a team. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param team body models.Team true "The team with updated values you want to update." @Success 200 {object} models.Team "The updated team." @Failure 400 {object} web.HTTPError "Invalid team object provided." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id} [post]

type TeamCreatedEvent added in v0.17.0

type TeamCreatedEvent struct {
	Team *Team
	Doer web.Auth
}

TeamCreatedEvent represents a TeamCreatedEvent event

func (*TeamCreatedEvent) Name added in v0.17.0

func (t *TeamCreatedEvent) Name() string

Name defines the name for TeamCreatedEvent

type TeamDeletedEvent added in v0.17.0

type TeamDeletedEvent struct {
	Team *Team
	Doer web.Auth
}

TeamDeletedEvent represents a TeamDeletedEvent event

func (*TeamDeletedEvent) Name added in v0.17.0

func (t *TeamDeletedEvent) Name() string

Name defines the name for TeamDeletedEvent

type TeamList

type TeamList struct {
	// The unique, numeric id of this list <-> team relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
	// The team id.
	TeamID int64 `xorm:"bigint not null INDEX" json:"team_id" param:"team"`
	// The list id.
	ListID int64 `xorm:"bigint not null INDEX" json:"-" param:"list"`
	// The right this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TeamList defines the relation between a team and a list

func (*TeamList) CanCreate

func (tl *TeamList) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a team <-> list relation

func (*TeamList) CanDelete

func (tl *TeamList) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a team <-> list relation

func (*TeamList) CanUpdate

func (tl *TeamList) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a team <-> list relation

func (*TeamList) Create

func (tl *TeamList) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new team <-> list relation @Summary Add a team to a list @Description Gives a team access to a list. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "List ID" @Param list body models.TeamList true "The team you want to add to the list." @Success 201 {object} models.TeamList "The created team<->list relation." @Failure 400 {object} web.HTTPError "Invalid team list object provided." @Failure 404 {object} web.HTTPError "The team does not exist." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/teams [put]

func (*TeamList) Delete

func (tl *TeamList) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a team <-> list relation based on the list & team id @Summary Delete a team from a list @Description Delets a team from a list. The team won't have access to the list anymore. @tags sharing @Produce json @Security JWTKeyAuth @Param listID path int true "List ID" @Param teamID path int true "Team ID" @Success 200 {object} models.Message "The team was successfully deleted." @Failure 403 {object} web.HTTPError "The user does not have access to the list" @Failure 404 {object} web.HTTPError "Team or list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/teams/{teamID} [delete]

func (*TeamList) ReadAll

func (tl *TeamList) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll implements the method to read all teams of a list @Summary Get teams on a list @Description Returns a list with all teams which have access on a given list. @tags sharing @Accept json @Produce json @Param id path int true "List ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search teams by its name." @Security JWTKeyAuth @Success 200 {array} models.TeamWithRight "The teams with their right." @Failure 403 {object} web.HTTPError "No right to see the list." @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/teams [get]

func (TeamList) TableName

func (TeamList) TableName() string

TableName makes beautiful table names

func (*TeamList) Update

func (tl *TeamList) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a team <-> list relation @Summary Update a team <-> list relation @Description Update a team <-> list relation. Mostly used to update the right that team has. @tags sharing @Accept json @Produce json @Param listID path int true "List ID" @Param teamID path int true "Team ID" @Param list body models.TeamList true "The team you want to update." @Security JWTKeyAuth @Success 200 {object} models.TeamList "The updated team <-> list relation." @Failure 403 {object} web.HTTPError "The user does not have admin-access to the list" @Failure 404 {object} web.HTTPError "Team or list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{listID}/teams/{teamID} [post]

type TeamMember

type TeamMember struct {
	// The unique, numeric id of this team member relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
	// The team id.
	TeamID int64 `xorm:"bigint not null INDEX" json:"-" param:"team"`
	// The username of the member. We use this to prevent automated user id entering.
	Username string `xorm:"-" json:"username" param:"user"`
	// Used under the hood to manage team members
	UserID int64 `xorm:"bigint not null INDEX" json:"-"`
	// Whether or not the member is an admin of the team. See the docs for more about what a team admin can do
	Admin bool `xorm:"null" json:"admin"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TeamMember defines the relationship between a user and a team

func (*TeamMember) CanCreate

func (tm *TeamMember) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can add a new tem member

func (*TeamMember) CanDelete

func (tm *TeamMember) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a new team member

func (*TeamMember) CanUpdate added in v0.15.0

func (tm *TeamMember) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can modify a team member's right

func (*TeamMember) Create

func (tm *TeamMember) Create(s *xorm.Session, a web.Auth) (err error)

Create implements the create method to assign a user to a team @Summary Add a user to a team @Description Add a user to a team. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param team body models.TeamMember true "The user to be added to a team." @Success 201 {object} models.TeamMember "The newly created member object" @Failure 400 {object} web.HTTPError "Invalid member object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the team" @Failure 500 {object} models.Message "Internal error" @Router /teams/{id}/members [put]

func (*TeamMember) Delete

func (tm *TeamMember) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a user from a team @Summary Remove a user from a team @Description Remove a user from a team. This will also revoke any access this user might have via that team. A user can remove themselves from the team if they are not the last user in the team. @tags team @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param userID path int true "User ID" @Success 200 {object} models.Message "The user was successfully removed from the team." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id}/members/{userID} [delete]

func (*TeamMember) IsAdmin

func (tm *TeamMember) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin checks if the user is team admin

func (*TeamMember) TableName

func (*TeamMember) TableName() string

TableName makes beautiful table names

func (*TeamMember) Update added in v0.15.0

func (tm *TeamMember) Update(s *xorm.Session, a web.Auth) (err error)

Update toggles a team member's admin status @Summary Toggle a team member's admin status @Description If a user is team admin, this will make them member and vise-versa. @tags team @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param userID path int true "User ID" @Success 200 {object} models.Message "The member right was successfully changed." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id}/members/{userID}/admin [post]

type TeamMemberAddedEvent added in v0.17.0

type TeamMemberAddedEvent struct {
	Team   *Team
	Member *user.User
	Doer   *user.User
}

TeamMemberAddedEvent defines an event where a user is added to a team

func (*TeamMemberAddedEvent) Name added in v0.17.0

func (t *TeamMemberAddedEvent) Name() string

Name defines the name for TeamMemberAddedEvent

type TeamMemberAddedNotification added in v0.17.0

type TeamMemberAddedNotification struct {
	Member *user.User `json:"member"`
	Doer   *user.User `json:"doer"`
	Team   *Team      `json:"team"`
}

TeamMemberAddedNotification represents a TeamMemberAddedNotification notification

func (*TeamMemberAddedNotification) Name added in v0.17.0

Name returns the name of the notification

func (*TeamMemberAddedNotification) ToDB added in v0.17.0

func (n *TeamMemberAddedNotification) ToDB() interface{}

ToDB returns the TeamMemberAddedNotification notification in a format which can be saved in the db

func (*TeamMemberAddedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TeamMemberAddedNotification

type TeamNamespace

type TeamNamespace struct {
	// The unique, numeric id of this namespace <-> team relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
	// The team id.
	TeamID int64 `xorm:"bigint not null INDEX" json:"team_id" param:"team"`
	// The namespace id.
	NamespaceID int64 `xorm:"bigint not null INDEX" json:"-" param:"namespace"`
	// The right this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TeamNamespace defines the relationship between a Team and a Namespace

func (*TeamNamespace) CanCreate

func (tn *TeamNamespace) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if one can create a new team <-> namespace relation

func (*TeamNamespace) CanDelete

func (tn *TeamNamespace) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can remove a team from a namespace. Only namespace admins can do that.

func (*TeamNamespace) CanUpdate

func (tn *TeamNamespace) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update a team from a Only namespace admins can do that.

func (*TeamNamespace) Create

func (tn *TeamNamespace) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new team <-> namespace relation @Summary Add a team to a namespace @Description Gives a team access to a namespace. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Namespace ID" @Param namespace body models.TeamNamespace true "The team you want to add to the namespace." @Success 201 {object} models.TeamNamespace "The created team<->namespace relation." @Failure 400 {object} web.HTTPError "Invalid team namespace object provided." @Failure 404 {object} web.HTTPError "The team does not exist." @Failure 403 {object} web.HTTPError "The team does not have access to the namespace" @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{id}/teams [put]

func (*TeamNamespace) Delete

func (tn *TeamNamespace) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a team <-> namespace relation based on the namespace & team id @Summary Delete a team from a namespace @Description Delets a team from a namespace. The team won't have access to the namespace anymore. @tags sharing @Produce json @Security JWTKeyAuth @Param namespaceID path int true "Namespace ID" @Param teamID path int true "team ID" @Success 200 {object} models.Message "The team was successfully deleted." @Failure 403 {object} web.HTTPError "The team does not have access to the namespace" @Failure 404 {object} web.HTTPError "team or namespace does not exist." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{namespaceID}/teams/{teamID} [delete]

func (*TeamNamespace) ReadAll

func (tn *TeamNamespace) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll implements the method to read all teams of a namespace @Summary Get teams on a namespace @Description Returns a namespace with all teams which have access on a given namespace. @tags sharing @Accept json @Produce json @Param id path int true "Namespace ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search teams by its name." @Security JWTKeyAuth @Success 200 {array} models.TeamWithRight "The teams with the right they have." @Failure 403 {object} web.HTTPError "No right to see the namespace." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{id}/teams [get]

func (TeamNamespace) TableName

func (TeamNamespace) TableName() string

TableName makes beautiful table names

func (*TeamNamespace) Update

func (tn *TeamNamespace) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a team <-> namespace relation @Summary Update a team <-> namespace relation @Description Update a team <-> namespace relation. Mostly used to update the right that team has. @tags sharing @Accept json @Produce json @Param namespaceID path int true "Namespace ID" @Param teamID path int true "Team ID" @Param namespace body models.TeamNamespace true "The team you want to update." @Security JWTKeyAuth @Success 200 {object} models.TeamNamespace "The updated team <-> namespace relation." @Failure 403 {object} web.HTTPError "The team does not have admin-access to the namespace" @Failure 404 {object} web.HTTPError "Team or namespace does not exist." @Failure 500 {object} models.Message "Internal error" @Router /namespaces/{namespaceID}/teams/{teamID} [post]

type TeamUser

type TeamUser struct {
	user.User `xorm:"extends"`
	// Whether or not the member is an admin of the team. See the docs for more about what a team admin can do
	Admin  bool  `json:"admin"`
	TeamID int64 `json:"-"`
}

TeamUser is the team member type

type TeamWithRight

type TeamWithRight struct {
	Team  `xorm:"extends"`
	Right Right `json:"right"`
}

TeamWithRight represents a team, combined with rights.

type UndoneTaskOverdueNotification added in v0.17.0

type UndoneTaskOverdueNotification struct {
	User *user.User
	Task *Task
}

UndoneTaskOverdueNotification represents a UndoneTaskOverdueNotification notification

func (*UndoneTaskOverdueNotification) Name added in v0.17.0

Name returns the name of the notification

func (*UndoneTaskOverdueNotification) ToDB added in v0.17.0

func (n *UndoneTaskOverdueNotification) ToDB() interface{}

ToDB returns the UndoneTaskOverdueNotification notification in a format which can be saved in the db

func (*UndoneTaskOverdueNotification) ToMail added in v0.17.0

ToMail returns the mail notification for UndoneTaskOverdueNotification

type UndoneTasksOverdueNotification added in v0.17.0

type UndoneTasksOverdueNotification struct {
	User  *user.User
	Tasks map[int64]*Task
}

UndoneTasksOverdueNotification represents a UndoneTasksOverdueNotification notification

func (*UndoneTasksOverdueNotification) Name added in v0.17.0

Name returns the name of the notification

func (*UndoneTasksOverdueNotification) ToDB added in v0.17.0

func (n *UndoneTasksOverdueNotification) ToDB() interface{}

ToDB returns the UndoneTasksOverdueNotification notification in a format which can be saved in the db

func (*UndoneTasksOverdueNotification) ToMail added in v0.17.0

ToMail returns the mail notification for UndoneTasksOverdueNotification

type UnsplashPhoto added in v0.14.0

type UnsplashPhoto struct {
	ID         int64  `xorm:"autoincr not null unique pk" json:"id,omitempty"`
	FileID     int64  `xorm:"not null" json:"-"`
	UnsplashID string `xorm:"varchar(50)" json:"unsplash_id"`
	Author     string `xorm:"text" json:"author"`
	AuthorName string `xorm:"text" json:"author_name"`
}

UnsplashPhoto is an unsplash photo in the db

func GetUnsplashPhotoByFileID added in v0.14.0

func GetUnsplashPhotoByFileID(s *xorm.Session, fileID int64) (u *UnsplashPhoto, err error)

GetUnsplashPhotoByFileID returns an unsplash photo by its saved file id

func (*UnsplashPhoto) Save added in v0.14.0

func (u *UnsplashPhoto) Save(s *xorm.Session) error

Save persists an unsplash photo to the db

func (*UnsplashPhoto) TableName added in v0.14.0

func (u *UnsplashPhoto) TableName() string

TableName contains the table name for an unsplash photo

type UserDataExportRequestedEvent added in v0.18.0

type UserDataExportRequestedEvent struct {
	User *user.User
}

UserDataExportRequestedEvent represents a UserDataExportRequestedEvent event

func (*UserDataExportRequestedEvent) Name added in v0.18.0

Name defines the name for UserDataExportRequestedEvent

type UserMentionedInTaskNotification added in v0.18.0

type UserMentionedInTaskNotification struct {
	Doer  *user.User `json:"doer"`
	Task  *Task      `json:"task"`
	IsNew bool       `json:"is_new"`
}

UserMentionedInTaskNotification represents a UserMentionedInTaskNotification notification

func (*UserMentionedInTaskNotification) Name added in v0.18.0

Name returns the name of the notification

func (*UserMentionedInTaskNotification) SubjectID added in v0.18.0

func (n *UserMentionedInTaskNotification) SubjectID() int64

func (*UserMentionedInTaskNotification) ToDB added in v0.18.0

func (n *UserMentionedInTaskNotification) ToDB() interface{}

ToDB returns the UserMentionedInTaskNotification notification in a format which can be saved in the db

func (*UserMentionedInTaskNotification) ToMail added in v0.18.0

ToMail returns the mail notification for UserMentionedInTaskNotification

type UserWithRight

type UserWithRight struct {
	user.User `xorm:"extends"`
	Right     Right `json:"right"`
}

UserWithRight represents a user in combination with the right it can have on a list/namespace

type ValidationHTTPError

type ValidationHTTPError struct {
	web.HTTPError
	InvalidFields []string `json:"invalid_fields"`
}

ValidationHTTPError is the http error when a validation fails

func (ValidationHTTPError) Error

func (err ValidationHTTPError) Error() string

Error implements the Error type (so we can return it as type error)

Jump to

Keyboard shortcuts

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