mongo

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 18 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"`
	WritePermissions *BoardPermission    `bson:"writePermissions,omitempty"`
	ReadPermissions  *BoardPermission    `bson:"readPermissions,omitempty"`
	Notifications    []BoardNotification `bson:"notifications"`
	OwnerID          string              `bson:"ownerId"`
	TaskStatuses     []TaskStatus        `bson:"statuses,omitempty"`
	TaskTags         []TaskTag           `bson:"tags,omitempty"`
	EligibleUserIds  []string            `bson:"eligibleUserIds,omitempty"`
	EligibleRoleIds  []string            `bson:"eligibleRoleIds,omitempty"`
}

func (*Board) ToProto

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

type BoardNotification

type BoardNotification struct {
	Name             string                   `bson:"name"`
	SubjectTemplate  string                   `bson:"subjectTemplate"`
	MessageTemplate  string                   `bson:"messageTemplate"`
	UserIds          []string                 `bson:"userIds,omitempty"`
	RoleIds          []string                 `bson:"roleIds,omitempty"`
	DayTime          []*commonv1.DayTime      `bson:"sendTimes"`
	EventTypes       []tasksv1.EventType      `bson:"eventTypes"`
	NotificationType tasksv1.NotificationType `bson:"notificationType"`
}

func (*BoardNotification) ToProto

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 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) 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) DeleteBoard

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

func (*Repository) DeleteNotification

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

func (*Repository) DeleteStatusFromTasks added in v0.3.0

func (db *Repository) DeleteStatusFromTasks(ctx context.Context, boardId string, status 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) 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) 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) SaveNotification

func (db *Repository) SaveNotification(ctx context.Context, boardID string, notification *tasksv1.BoardNotification) (*tasksv1.Board, error)

func (*Repository) UpdateBoard added in v0.4.0

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

func (*Repository) UpdateTask

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

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,omitempty"`
	GeoLocation  *GeoLocation       `bson:"location,omitempty"`
	Address      *Address           `bson:"address,omitempty"`
	Tags         []string           `bson:"tags"`
	Status       string             `bson:"status"`
	AssignedBy   string             `bson:"assignedBy,omitempty"`
	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"`
	Attachments  []Attachment       `bson:"attachments"`
}

func (*Task) ToProto

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

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

Jump to

Keyboard shortcuts

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