mongodao

package
v0.0.0-...-6ee5725 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mongodao implements task.Accessor interface with MongoDB operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoAccessor

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

MongoAccessor is an Accessor for MongoDB.

func New

func New(path, db, c string) *MongoAccessor

New returns a new MongoAccessor.

func (*MongoAccessor) Close

func (m *MongoAccessor) Close() error

Close closes the session.

func (*MongoAccessor) Delete

func (m *MongoAccessor) Delete(id task.ID) error

Delete removes the task with a given ID.

func (*MongoAccessor) Get

func (m *MongoAccessor) Get(id task.ID) (task.Task, error)

Get returns a task with a given ID.

func (*MongoAccessor) Post

func (m *MongoAccessor) Post(t task.Task) (task.ID, error)

Post adds a new task.

func (*MongoAccessor) Put

func (m *MongoAccessor) Put(id task.ID, t task.Task) error

Put updates a task with a given ID with t.

Jump to

Keyboard shortcuts

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