mongodb

package
v0.0.0-...-7f3334f Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExistingUser indicates that the email is already registered
	ErrEmailAlreadyRegistered = errors.New("email address is already registered")

	// ErrReadingUserFromDB indicates that there was a problem while getting the user from the DB
	ErrReadingUserFromDB = errors.New("error reading user from db")

	// ErrEmailPassword indicates that the email or password dont match
	ErrEmailPassword = errors.New("wrong email/password")

	// ErrSavingUserInDB indicates that the there was an error while inserting a User in the DB
	ErrSavingUserInDB = errors.New("wrong email/password")

	// ErrSavingPostInDB indicates that the there was an error while inserting a Post in the DB
	ErrSavingPostInDB = errors.New("error saving Post in DB")
)

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) AddPost

func (s *Storage) AddPost(p adder.Post) error

func (*Storage) DeletePost

func (s *Storage) DeletePost(p remover.Post) error

func (*Storage) DeleteUser

func (s *Storage) DeleteUser(u remover.User)

func (*Storage) GetPost

func (s *Storage) GetPost(p lister.Post) (lister.Post, error)

func (*Storage) GetUser

func (s *Storage) GetUser(email string) (interface{}, error)

func (*Storage) IsAuthenticated

func (s *Storage) IsAuthenticated() error

func (*Storage) Login

func (s *Storage) Login(u auth.User) (interface{}, error)

func (*Storage) Logout

func (s *Storage) Logout() error

func (*Storage) Register

func (s *Storage) Register(u auth.User) error

func (*Storage) UpdatePost

func (s *Storage) UpdatePost(p updater.Post) error

func (*Storage) UpdateUser

func (s *Storage) UpdateUser(email string, u updater.User)

Jump to

Keyboard shortcuts

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