repo

package
v0.0.0-...-79dbf9b Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogPostRepositoryMock

type BlogPostRepositoryMock struct {
	mock.Mock
}

BlogPostRepositoryMock is a mock of BlogPostRepository

func (*BlogPostRepositoryMock) Delete

func (m *BlogPostRepositoryMock) Delete(id uint) error

Delete mock

func (*BlogPostRepositoryMock) Find

func (m *BlogPostRepositoryMock) Find(contains *string, limit *uint) ([]*model.BlogPost, error)

Find mock

func (*BlogPostRepositoryMock) Retrieve

func (m *BlogPostRepositoryMock) Retrieve(id uint) (*model.BlogPost, error)

Retrieve mock

func (*BlogPostRepositoryMock) Store

func (m *BlogPostRepositoryMock) Store(content *model.BlogPost) (*model.BlogPost, error)

Store mock

func (*BlogPostRepositoryMock) Update

func (m *BlogPostRepositoryMock) Update(content *model.BlogPost) error

Update mock

type BlogPostRepositoryMySQL

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

BlogPostRepositoryMySQL is a repository to manage blog posts stored using Gorm

func NewBlogPostRepositoryMySQL

func NewBlogPostRepositoryMySQL(log *zerolog.Logger, db *gorm.DB) *BlogPostRepositoryMySQL

NewBlogPostRepositoryMySQL creates a new blog post repository using the given gorm DB as backend

func (*BlogPostRepositoryMySQL) Delete

func (r *BlogPostRepositoryMySQL) Delete(id uint) error

Delete deletes a blog post from the database from a given ID.

func (*BlogPostRepositoryMySQL) Find

func (r *BlogPostRepositoryMySQL) Find(contains *string, limit *uint) ([]*model.BlogPost, error)

Find returns all of the blog posts that match its filters

func (*BlogPostRepositoryMySQL) Retrieve

func (r *BlogPostRepositoryMySQL) Retrieve(id uint) (*model.BlogPost, error)

Retrieve returns the blog post with the given ID from the database

func (*BlogPostRepositoryMySQL) Store

Store saves a new blog post in the database.

func (*BlogPostRepositoryMySQL) Update

func (r *BlogPostRepositoryMySQL) Update(post *model.BlogPost) error

Update saves a new blog post in the database.

type UserRepositoryMock

type UserRepositoryMock struct {
	mock.Mock
}

UserRepositoryMock is a mock of UserRepository

func (*UserRepositoryMock) AdminExists

func (m *UserRepositoryMock) AdminExists() bool

AdminExists mock

func (*UserRepositoryMock) Retrieve

func (m *UserRepositoryMock) Retrieve(user *model.User) (*model.User, error)

Retrieve mock

func (*UserRepositoryMock) Store

func (m *UserRepositoryMock) Store(user *model.User) (*model.User, error)

Store mock

type UserRepositoryMySQL

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

UserRepositoryMySQL is a repository to manage users stored using Gorm

func NewUserRepositoryMySQL

func NewUserRepositoryMySQL(log *zerolog.Logger, db *gorm.DB) *UserRepositoryMySQL

NewUserRepositoryMySQL creates a new user repository using the given gorm DB as backend

func (*UserRepositoryMySQL) AdminExists

func (r *UserRepositoryMySQL) AdminExists() bool

AdminExists returns true if an admin exists, false otherwise

func (*UserRepositoryMySQL) Retrieve

func (r *UserRepositoryMySQL) Retrieve(user *model.User) (*model.User, error)

Retrieve returns the user with the given ID from the database

func (*UserRepositoryMySQL) Store

func (r *UserRepositoryMySQL) Store(user *model.User) (*model.User, error)

Store saves a new user in the database.

Jump to

Keyboard shortcuts

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