mongo

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	PostalCode string `bson:"postalCode"`
	City       string `bson:"city"`
	Street     string `bson:"street"`
	Extra      string `bson:"extra,omitempty"`
}

func (*Address) ToProto

func (addr *Address) ToProto() *customerv1.Address

type Attachment

type Attachment struct {
	Filename    string `bson:"filename"`
	Name        string `bson:"name"`
	ContentType string `bson:"contentType"`
}

func (*Attachment) ToProto

func (at *Attachment) ToProto() *tasksv1.Attachment

type Board

type Board struct {
	ID               primitive.ObjectID      `bson:"_id,omitempty"`
	DisplayName      string                  `bson:"displayName,omitempty"`
	Description      string                  `bson:"description,omitempty"`
	TaskStatuses     []TaskStatus            `bson:"statuses"`
	TaskTags         []TaskTag               `bson:"tags"`
	TaskPriorities   []TaskPriority          `bson:"priorities"`
	HelpText         string                  `bson:"helpText,omitempty"`
	WritePermissions *BoardPermission        `bson:"writePermissions,omitempty"`
	ReadPermissions  *BoardPermission        `bson:"readPermissions,omitempty"`
	OwnerID          string                  `bson:"ownerId"`
	EligibleUserIds  []string                `bson:"eligibleUserIds,omitempty"`
	EligibleRoleIds  []string                `bson:"eligibleRoleIds,omitempty"`
	Subscriptions    map[string]Subscription `bson:"subscriptions"`
	InitialStatus    string                  `bson:"initialStatus"`
	DoneStatus       string                  `bson:"doneStatus"`
	Views            []View                  `bson:"views"`
}

func (*Board) ToProto

func (b *Board) ToProto() *tasksv1.Board

func (*Board) Validate added in v0.7.0

func (b *Board) Validate() error

type BoardPermission

type BoardPermission struct {
	AllowRoles []string `bson:"allowRoles,omitempty"`
	AllowUsers []string `bson:"allowUsers,omitempty"`
	DenyRoles  []string `bson:"denyRoles,omitempty"`
	DenyUsers  []string `bson:"denyUsers,omitempty"`
}

func (*BoardPermission) ToProto

func (perm *BoardPermission) ToProto() *tasksv1.BoardPermission

type GeoLocation

type GeoLocation struct {
	Latitude  float64 `bson:"lat"`
	Longitude float64 `bson:"long"`
}

func (*GeoLocation) ToProto

func (geo *GeoLocation) ToProto() *commonv1.GeoLocation

type Reaction added in v0.8.0

type Reaction struct {
	UserID   string `bson:"userId"`
	Reaction string `bson:"reaction"`
}

func (*Reaction) ToProto added in v0.8.0

func (reaction *Reaction) ToProto() *tasksv1.TaskReaction

type Repository

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

func New

func New(ctx context.Context, uri, dbName string) (*Repository, error)

func (*Repository) AddTaskAttachment

func (db *Repository) AddTaskAttachment(ctx context.Context, taskID, filePath string, attachment *tasksv1.Attachment) (*tasksv1.Task, error)

func (*Repository) AddTaskStatus added in v0.3.0

func (db *Repository) AddTaskStatus(ctx context.Context, boardId string, status *tasksv1.TaskStatus) (*tasksv1.Board, error)

func (*Repository) AddTaskTag added in v0.3.0

func (db *Repository) AddTaskTag(ctx context.Context, boardId string, tag *tasksv1.TaskTag) (*tasksv1.Board, error)

func (*Repository) AddView added in v0.12.7

func (db *Repository) AddView(ctx context.Context, boardId string, view *tasksv1.View) (*tasksv1.Board, error)

func (*Repository) AssignTask

func (db *Repository) AssignTask(ctx context.Context, taskID, assigneeID, assignedByUserId string) (*tasksv1.Task, error)

func (*Repository) CompleteTask

func (db *Repository) CompleteTask(ctx context.Context, taskID string) (*tasksv1.Task, error)

func (*Repository) CreateBoard

func (db *Repository) CreateBoard(ctx context.Context, board *tasksv1.Board) error

func (*Repository) CreateTask

func (db *Repository) CreateTask(ctx context.Context, task *tasksv1.Task) error

func (*Repository) CreateTaskComment added in v0.9.0

func (db *Repository) CreateTaskComment(ctx context.Context, taskId, boardId string, comment string) error

func (*Repository) DeleteBoard

func (db *Repository) DeleteBoard(ctx context.Context, id string) error

func (*Repository) DeleteStatusFromTasks added in v0.3.0

func (db *Repository) DeleteStatusFromTasks(ctx context.Context, boardId string, status string, replacement string) error

func (*Repository) DeleteTagsFromTasks added in v0.3.0

func (db *Repository) DeleteTagsFromTasks(ctx context.Context, boardId string, tag string) error

func (*Repository) DeleteTask

func (db *Repository) DeleteTask(ctx context.Context, id string) error

func (*Repository) DeleteTaskAttachment

func (db *Repository) DeleteTaskAttachment(ctx context.Context, taskID, attachmentName string) (*tasksv1.Task, error)

func (*Repository) DeleteTaskStatus added in v0.3.0

func (db *Repository) DeleteTaskStatus(ctx context.Context, boardID, status string) (*tasksv1.Board, error)

func (*Repository) DeleteTaskTag added in v0.3.0

func (db *Repository) DeleteTaskTag(ctx context.Context, boardID, tag string) (*tasksv1.Board, error)

func (*Repository) DeleteTasksMatchingQuery added in v0.3.0

func (db *Repository) DeleteTasksMatchingQuery(ctx context.Context, queries []*tasksv1.TaskQuery) error

func (*Repository) DeleteView added in v0.12.7

func (db *Repository) DeleteView(ctx context.Context, boardID, view string) (*tasksv1.Board, error)

func (*Repository) DeletesPriorityFromTasks added in v0.7.1

func (db *Repository) DeletesPriorityFromTasks(ctx context.Context, boardId string, priority, replacement int32) error

func (*Repository) FilterTasks added in v0.12.0

func (db *Repository) FilterTasks(ctx context.Context, boardId string, q map[taskql.Field]taskql.Query, groupBy string, groupByDesc bool, pagination *commonv1.Pagination) ([]*tasksv1.TaskGroup, int, error)

FilterTasks is like ListTasks but filters based on taskql queries.

func (*Repository) GetBoard

func (db *Repository) GetBoard(ctx context.Context, id string) (*tasksv1.Board, error)

func (*Repository) GetTask

func (db *Repository) GetTask(ctx context.Context, taskID string) (*tasksv1.Task, error)

func (*Repository) GetTaskTimeline added in v0.8.0

func (db *Repository) GetTaskTimeline(ctx context.Context, ids []string) ([]*tasksv1.TaskTimelineEntry, error)

func (*Repository) ListBoards

func (db *Repository) ListBoards(ctx context.Context) ([]*tasksv1.Board, error)

func (*Repository) ListTasks

func (db *Repository) ListTasks(ctx context.Context, queries []*tasksv1.TaskQuery, pagination *commonv1.Pagination) ([]*tasksv1.Task, int, error)

func (*Repository) UpdateBoard added in v0.4.0

func (db *Repository) UpdateBoard(ctx context.Context, update *tasksv1.UpdateBoardRequest) (*tasksv1.Board, error)

func (*Repository) UpdateBoardSubscription added in v0.7.0

func (db *Repository) UpdateBoardSubscription(ctx context.Context, boardId string, subscription *tasksv1.Subscription) error

func (*Repository) UpdateTask

func (db *Repository) UpdateTask(ctx context.Context, authenticatedUserId string, update *tasksv1.UpdateTaskRequest) (*tasksv1.Task, error)

func (*Repository) UpdateTaskComment added in v0.9.2

func (db *Repository) UpdateTaskComment(ctx context.Context, update *tasksv1.UpdateTaskCommentRequest) (*tasksv1.TaskTimelineEntry, error)

func (*Repository) UpdateTaskSubscription added in v0.7.0

func (db *Repository) UpdateTaskSubscription(ctx context.Context, taskId string, subscription *tasksv1.Subscription) error

type Subscription added in v0.7.0

type Subscription struct {
	UserId       string                     `bson:"userId"`
	Types        []tasksv1.NotificationType `bson:"types"`
	Unsubscribed bool                       `bson:"unsubscribed"`
}

func (*Subscription) ToProto added in v0.7.0

func (s *Subscription) ToProto() *tasksv1.Subscription

type Task

type Task struct {
	ID            primitive.ObjectID      `bson:"_id,omitempty"`
	BoardID       string                  `bson:"boardId"`
	Title         string                  `bson:"title"`
	Description   string                  `bson:"description"`
	Creator       string                  `bson:"creator"`
	Assignee      string                  `bson:"assignee"`
	GeoLocation   *GeoLocation            `bson:"location,omitempty"`
	Address       *Address                `bson:"address,omitempty"`
	Tags          []string                `bson:"tags"`
	Status        string                  `bson:"status"`
	AssignedBy    string                  `bson:"assignedBy"`
	DueTime       time.Time               `bson:"dueTime,omitempty"`
	CreateTime    time.Time               `bson:"createTime"`
	UpdateTime    time.Time               `bson:"updateTime"`
	AssignTime    time.Time               `bson:"assignTime,omitempty"`
	CompleteTime  time.Time               `bson:"completeTime,omitempty"`
	Properties    map[string][]byte       `bson:"properties"`
	Subscriptions map[string]Subscription `bson:"subscriptions"`
	Priority      *int32                  `bson:"priority"`
	Attachments   []Attachment            `bson:"attachments"`
}

func (*Task) ToProto

func (task *Task) ToProto() *tasksv1.Task

type TaskComment added in v0.8.0

type TaskComment struct {
	Comment    string     `bson:"comment"`
	Reactions  []Reaction `bson:"reactions"`
	EditTime   time.Time  `bson:"editTime,omitempty"`
	DeleteTime time.Time  `bson:"deleteTime,omitempty"`
	Offtopic   time.Time  `bson:"offTopicTime,omitempty"`
}

func (*TaskComment) ToProto added in v0.8.0

func (c *TaskComment) ToProto() *tasksv1.TaskComment

type TaskPriority added in v0.7.0

type TaskPriority struct {
	Name        string `bson:"name"`
	Description string `bson:"description,omitempty"`
	Color       string `bson:"color"`
	Priority    int32  `bson:"priority"`
}

func (*TaskPriority) ToProto added in v0.7.0

func (p *TaskPriority) ToProto() *tasksv1.TaskPriority

type TaskStatus

type TaskStatus struct {
	Status      string `bson:"status"`
	Description string `bson:"description,omitempty"`
	Color       string `bson:"color"`
}

func (*TaskStatus) ToProto

func (status *TaskStatus) ToProto() *tasksv1.TaskStatus

type TaskTag added in v0.3.0

type TaskTag struct {
	Tag         string `bson:"tag"`
	Description string `bson:"description,omitempty"`
	Color       string `bson:"color"`
}

func (*TaskTag) ToProto added in v0.3.0

func (tag *TaskTag) ToProto() *tasksv1.TaskTag

type Timeline added in v0.8.0

type Timeline struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"`
	TaskID      primitive.ObjectID `bson:"taskId"`
	BoardID     primitive.ObjectID `bson:"boardId"`
	CreateTime  time.Time          `bson:"createTime"`
	UserID      string             `bson:"userId"`
	ValueChange *ValueChange       `bson:"valueChange,omitempty"`
	Comment     *TaskComment       `bson:"comment,omitempty"`
}

func (*Timeline) ToProto added in v0.8.0

func (t *Timeline) ToProto() (*tasksv1.TaskTimelineEntry, error)

type ValueChange added in v0.8.0

type ValueChange struct {
	FieldName string `bson:"fieldName"`
	OldValue  any    `bson:"oldValue,omitempty"`
	NewValue  any    `bson:"newValue,omitempty"`
}

func (*ValueChange) ToProto added in v0.8.0

func (valueChange *ValueChange) ToProto() (*tasksv1.TaskValueChange, error)

func (*ValueChange) ValueFrom added in v0.8.0

func (vc *ValueChange) ValueFrom(t *Task) any

type View added in v0.12.7

type View struct {
	Name          string `bson:"name"`
	Filter        string `bson:"filter"`
	GroupBy       string `bson:"groupBy"`
	GroupSortDesc bool   `bson:"groupSortDesc"`
	SortField     string `bson:"sortField"`
	SortDesc      bool   `bson:"sortDesc"`
}

func (View) ToProto added in v0.12.7

func (v View) ToProto() *tasksv1.View

Jump to

Keyboard shortcuts

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