mock

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Anything = mock.Anything

Variables

This section is empty.

Functions

func AnythingOfType

func AnythingOfType(t string) mock.AnythingOfTypeArgument

func Transaction

func Transaction() (tx *storage.Transaction, rollback func())

Types

type Container

type Container struct {
	mock.Mock
}

func (*Container) GetCrudConfigs

func (c *Container) GetCrudConfigs() []gocruddy.CrudConfig

func (*Container) GetCrudRepo

func (c *Container) GetCrudRepo() gocruddy.CrudRepository

func (*Container) GetDatabase

func (c *Container) GetDatabase() gocruddy.Database

func (*Container) GetLogger

func (c *Container) GetLogger() logging.Logger

type CrudConfig

type CrudConfig struct {
	mock.Mock
}

func (*CrudConfig) CreateDeleteFilter

func (cc *CrudConfig) CreateDeleteFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter

func (*CrudConfig) CreateGetFilter

func (cc *CrudConfig) CreateGetFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter

func (*CrudConfig) CreateUpdateFilter

func (cc *CrudConfig) CreateUpdateFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter

func (*CrudConfig) GetBasePath

func (cc *CrudConfig) GetBasePath() string

func (*CrudConfig) GetEntityEntry

func (cc *CrudConfig) GetEntityEntry() interface{}

func (*CrudConfig) MapPostEntry

func (cc *CrudConfig) MapPostEntry(entry interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (mapped gocruddy.Entry, err error)

func (*CrudConfig) MapPutEntry

func (cc *CrudConfig) MapPutEntry(entry interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (mapped gocruddy.Entry, err error)

func (*CrudConfig) SerializeList

func (cc *CrudConfig) SerializeList(entries []interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (serialized interface{}, err error)

func (*CrudConfig) UseContainer

func (cc *CrudConfig) UseContainer(c gocruddy.Container)

type CrudRepo

type CrudRepo struct {
	Repo
}

func (*CrudRepo) GetAllEntries

func (r *CrudRepo) GetAllEntries(tx *storage.Transaction, filter gocruddy.DatabaseFilter, t interface{}) (entries []interface{}, err error)

func (*CrudRepo) GetByID

func (r *CrudRepo) GetByID(tx *storage.Transaction, id uint, filter gocruddy.DatabaseFilter, t interface{}) (entry interface{}, err error)

type Database

type Database struct {
	mock.Mock
}

func (*Database) Begin

func (db *Database) Begin() (tx *storage.Transaction, err error)

func (*Database) Gorm

func (db *Database) Gorm() *gorm.DB

func (*Database) UseTransaction

func (db *Database) UseTransaction(fn storage.HandlerFunc) error

type Entity

type Entity struct {
	gorm.Model
}

func (*Entity) GetID

func (e *Entity) GetID() uint

GetID return the id of the entity

type GormLogger

type GormLogger struct {
	mock.Mock
}

GormLogger gorm logger

func (*GormLogger) Error

func (l *GormLogger) Error(ctx context.Context, s string, args ...interface{})

func (*GormLogger) Info

func (l *GormLogger) Info(ctx context.Context, s string, args ...interface{})

func (*GormLogger) LogMode

func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface

func (*GormLogger) Trace

func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GormLogger) Warn

func (l *GormLogger) Warn(ctx context.Context, s string, args ...interface{})

type Log

type Log struct {
	mock.Mock
}

Log mock

func (*Log) CreateGormLogger

func (l *Log) CreateGormLogger() logger.Interface

func (*Log) Debug

func (l *Log) Debug(s string, args ...interface{})

func (*Log) ErrDebug

func (l *Log) ErrDebug(err error)

func (*Log) ErrError

func (l *Log) ErrError(err error)

func (*Log) ErrFatal

func (l *Log) ErrFatal(err error)

func (*Log) ErrInfo

func (l *Log) ErrInfo(err error)

func (*Log) ErrWarn

func (l *Log) ErrWarn(err error)

func (*Log) Error

func (l *Log) Error(s string, args ...interface{})

func (*Log) Fatal

func (l *Log) Fatal(s string, args ...interface{})

func (*Log) GetLevel

func (l *Log) GetLevel() logging.Level

func (*Log) Info

func (l *Log) Info(s string, args ...interface{})

func (*Log) Warn

func (l *Log) Warn(s string, args ...interface{})

func (*Log) Write

func (l *Log) Write(p []byte) (n int, err error)

type Repo

type Repo struct {
	mock.Mock
}

func (*Repo) Delete

func (r *Repo) Delete(tx *storage.Transaction, entry interface{}) (err error)

func (*Repo) Insert

func (r *Repo) Insert(tx *storage.Transaction, entry interface{}) (err error)

func (*Repo) Remove

func (r *Repo) Remove(tx *storage.Transaction, entry interface{}) (err error)

func (*Repo) Update

func (r *Repo) Update(tx *storage.Transaction, entry interface{}) (err error)

Jump to

Keyboard shortcuts

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