mocks

package module
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

Neuron Logo

Neuron Mocks Go Report Card GoDoc Build Status GitHub

This repository contains mock repository and factory for the Golang Neuron ORM Neuron Core.

This package should be used only for testing.

Documentation

Overview

Package mocks contains mocked neuron factory and repository. They should be used only in tests.

Index

Constants

View Source
const DriverName = "neuron-mockery"

DriverName is the driver name used by this mocks factory and repository.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	mock.Mock
}

Factory is the repository.Factory mock implementation

func (*Factory) Close

func (f *Factory) Close(ctx context.Context, done chan<- interface{})

Close closes the factory

func (*Factory) DriverName

func (f *Factory) DriverName() string

DriverName returns the factory repository name Implements repository.Repository

func (*Factory) New

func (f *Factory) New(model *config.Repository) (repository.Repository, error)

New creates new repository Implements repository.Factory method

type Repository

type Repository struct {
	mock.Mock
}

Repository is an autogenerated mock type for the Repository type

func (*Repository) Begin

func (_m *Repository) Begin(ctx context.Context, tx *query.Tx, m *mapping.ModelStruct) error

Begin provides a mock function with given fields: ctx, s

func (*Repository) Close

func (_m *Repository) Close(ctx context.Context) error

Close closes the repository connection.

func (*Repository) Commit

func (_m *Repository) Commit(ctx context.Context, tx *query.Tx, m *mapping.ModelStruct) error

Commit provides a mock function with given fields: ctx, m.

func (*Repository) Count added in v0.9.1

func (_m *Repository) Count(ctx context.Context, s *query.Scope) (int64, error)

Count provides a mock function with given fields: ctx, s

func (*Repository) Create

func (_m *Repository) Create(ctx context.Context, s *query.Scope) error

Create provides a mock function with given fields: ctx, s

func (*Repository) Delete

func (_m *Repository) Delete(ctx context.Context, s *query.Scope) error

Delete provides a mock function with given fields: ctx, s

func (*Repository) Dial added in v0.13.0

func (_m *Repository) Dial(context.Context) error

Dial implements repository.Repository interface.

func (*Repository) FactoryName

func (_m *Repository) FactoryName() string

FactoryName provides a mock function that implements FactoryName method.

func (*Repository) Get

func (_m *Repository) Get(ctx context.Context, s *query.Scope) error

Get provides a mock function with given fields: ctx, s

func (*Repository) HealthCheck added in v0.13.0

func (_m *Repository) HealthCheck(ctx context.Context) (*repository.HealthResponse, error)

func (*Repository) List

func (_m *Repository) List(ctx context.Context, s *query.Scope) error

List provides a mock function with given fields: ctx, s

func (*Repository) ModelTxID added in v0.13.0

func (_m *Repository) ModelTxID(model *mapping.ModelStruct) (string, error)

ModelTxID implements query.Transactioner interface.

func (*Repository) Patch

func (_m *Repository) Patch(ctx context.Context, s *query.Scope) error

Patch provides a mock function with given fields: ctx, s

func (*Repository) RegisterModels added in v0.13.0

func (_m *Repository) RegisterModels(models ...*mapping.ModelStruct) error

RegisterModels implements repository.Repository interface.

func (*Repository) Rollback

func (_m *Repository) Rollback(ctx context.Context, tx *query.Tx, m *mapping.ModelStruct) error

Rollback provides a mock function with given fields: ctx, s

Jump to

Keyboard shortcuts

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