service

package
v0.0.0-...-00c4b02 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 3 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
}

Service initializes our database instance

func NewService

func NewService(ds db.DataStore) *Service

NewService creates a connection to our database

func (*Service) AddTask

func (s *Service) AddTask(ctx context.Context, task *models.Task) (string, error)

AddTask adds task into database

func (*Service) Close

func (s *Service) Close(ctx context.Context) error

Close disconnects the mongo client

func (*Service) DeleteTask

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

DeleteTask deletes task from database

func (*Service) GetTask

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

GetTask gets task from database

func (*Service) UpdateTask

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

UpdateTask updates the task in the database

Jump to

Keyboard shortcuts

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