store

package
v0.0.0-...-ba8bc2d Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Driver   *mongo.Client
	Database *mongo.Database
	Options  *options.ClientOptions
}

func NewStore

func NewStore() *Store

func (*Store) Close

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

func (*Store) CreateNote

func (s *Store) CreateNote(note models.Note) error

func (*Store) CreateUser

func (s *Store) CreateUser(user models.User) error

func (*Store) DeleteNoteById

func (s *Store) DeleteNoteById(id primitive.ObjectID) error

func (*Store) DeleteUserById

func (s *Store) DeleteUserById(id primitive.ObjectID) error

func (*Store) GetNoteById

func (s *Store) GetNoteById(id primitive.ObjectID) ([]models.Note, error)

func (*Store) GetNotesByAuthor

func (s *Store) GetNotesByAuthor(author string) ([]models.Note, error)

func (*Store) GetUsersByLogin

func (s *Store) GetUsersByLogin(login string) ([]models.User, error)

func (*Store) Open

func (s *Store) Open() (context.Context, error)

mongodb://<username>:<password>@<host>:<port>

func (*Store) UpdateNoteById

func (s *Store) UpdateNoteById(note models.Note) error

func (*Store) UpdateUserById

func (s *Store) UpdateUserById(user models.User) error

Jump to

Keyboard shortcuts

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