tasks

package
v0.0.0-...-cff06d4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(usersService *users.Service, db *mongo.Database, log *logrus.Logger) *Service

func (*Service) CreateTask

func (s *Service) CreateTask(ctx context.Context, task Task) (*Task, error)

func (*Service) DeleteTask

func (s *Service) DeleteTask(ctx context.Context, taskID string) (*Task, error)

func (*Service) GetTask

func (s *Service) GetTask(ctx context.Context, taskID string) (*Task, error)

func (*Service) GetTaskWithinTimeRange

func (s *Service) GetTaskWithinTimeRange(ctx context.Context, userID string, startTime, endTime time.Time) (*Task, error)

func (*Service) GetTasks

func (s *Service) GetTasks(ctx context.Context, userID, lastID string, limit int) ([]Task, error)

func (*Service) UpdateTask

func (s *Service) UpdateTask(ctx context.Context, taskID string, update Task) (*Task, error)

type Task

type Task struct {
	ID        string    `json:"id" bson:"_id,omitempty"`
	Title     string    `json:"title" bson:"title,omitempty"`
	StartTime time.Time `json:"startTime" bson:"startTime,omitempty"`
	EndTime   time.Time `json:"endTime" bson:"endTime,omitempty"`
	UserID    string    `json:"userId" bson:"userId,omitempty"`
	Status    string    `json:"status" bson:"status,omitempty"`
	TimeAdded time.Time `json:"-" bson:"timeAdded,omitempty"`
}

Jump to

Keyboard shortcuts

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