data

package
v0.0.0-...-85ecf22 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLink(link models.Link) error

CreateLink creates new Link in database

func GetAllLinks() ([]models.Link, error)

GetAllLinks returns all links in database

Types

type CategoryRepository

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

CategoryRepository provides access to category table

func NewCategoryRepository

func NewCategoryRepository() *CategoryRepository

NewCategoryRepository returns instance of CategoryRepository

func (*CategoryRepository) CreateCategory

func (cr *CategoryRepository) CreateCategory(category models.LinkCategory) (*models.LinkCategory, error)

CreateCategory creates Link category in Firebase

func (*CategoryRepository) GetAllActive

func (cr *CategoryRepository) GetAllActive() ([]models.LinkCategory, error)

GetAllActive returns list of categories for links

type LinkRepository

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

LinkRepository provides acces to Link repository as class

func NewLinkRepository

func NewLinkRepository() *LinkRepository
func (lr *LinkRepository) GetLink(linkID string) (link models.Link, err error)

GetLink returns Link by LinkId

func (lr *LinkRepository) GetUserLinks(userID string) (links []models.Link, err error)

GetUserLinks returns all links which belongs to user

func (*LinkRepository) SetLinkCategory

func (lr *LinkRepository) SetLinkCategory(linkID, categoryID string) error

SetLinkCategory sets LinkCategory for existing link

type UserRepository

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

UserRepository provides access to User table as object

func NewUserRepository

func NewUserRepository() *UserRepository

NewUserRepository returns instance of UserRepository

func (*UserRepository) GetAllUsers

func (ur *UserRepository) GetAllUsers() ([]models.User, error)

GetAllUsers returns list of all users from database

func (*UserRepository) Login

func (ur *UserRepository) Login(email, password string) (user models.User, err error)

Login returns logged in user or error

Jump to

Keyboard shortcuts

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