mongo

package
v0.0.0-...-e1e4618 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	DefaultTimeout time.Duration
	// contains filtered or unexported fields
}

func New

func New(connectionString string, databaseName string, defaultTimeout time.Duration) (*Storage, error)
func (sto *Storage) DeleteLink(id string) error

func (*Storage) DeleteSession

func (sto *Storage) DeleteSession(id string) error

func (*Storage) DeleteUser

func (sto *Storage) DeleteUser(id string) error
func (sto *Storage) GetLink(id string) (link models.Link, err error)

func (*Storage) GetSession

func (sto *Storage) GetSession(id string) (models.Session, error)

func (*Storage) GetUser

func (sto *Storage) GetUser(id string) (user models.User, err error)

func (*Storage) GetUserByName

func (sto *Storage) GetUserByName(name string) (user models.User, err error)

func (*Storage) IncreaseLinkHitCount

func (sto *Storage) IncreaseLinkHitCount(id string) error
func (sto *Storage) ListLinks(ownerID string, limit, offset uint) ([]models.Link, error)

func (*Storage) ListSessions

func (sto *Storage) ListSessions(ownerID string, limit, offset uint) ([]models.Session, error)

func (*Storage) ListUsers

func (sto *Storage) ListUsers(limit, offset uint) ([]models.User, error)
func (sto *Storage) SaveLink(link models.Link) error

func (*Storage) SaveSession

func (sto *Storage) SaveSession(session models.Session) error

func (*Storage) SaveUser

func (sto *Storage) SaveUser(user models.User) error

func (*Storage) UpdateLinkContent

func (sto *Storage) UpdateLinkContent(id, content string) error

func (*Storage) UpdateSessionToken

func (sto *Storage) UpdateSessionToken(id string, tokenID string) error

func (*Storage) UpdateUser

func (sto *Storage) UpdateUser(user user_repository.UpdatePayload) error

Jump to

Keyboard shortcuts

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