repository

package
v0.0.0-...-f3a4c14 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository represents a mocked repository

func (*MockRepository) Delete

func (mock *MockRepository) Delete(post *entity.Post) error

Delete deletes a post from database

func (*MockRepository) FindAll

func (mock *MockRepository) FindAll() ([]entity.Post, error)

FindAll mocks the findAll post method

func (*MockRepository) Save

func (mock *MockRepository) Save(post *entity.Post) (*entity.Post, error)

Save mocks the save post method

type PostRepository

type PostRepository interface {
	Save(post *entity.Post) (*entity.Post, error)
	FindAll() ([]entity.Post, error)
	Delete(post *entity.Post) error
}

PostRepository holds post collection operations

func NewFirestoreRepository

func NewFirestoreRepository() PostRepository

NewFirestoreRepository returns a new instance which implements PostRepository

func NewSQLiteRepository

func NewSQLiteRepository() PostRepository

NewSQLiteRepository implement post repository using sqlite engine

Jump to

Keyboard shortcuts

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