repositories

package
v4.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Field    string
	Operator string
	Value    interface{}
}

type GormRepository

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

func (*GormRepository) All

func (r *GormRepository) All(v interface{}) error

func (*GormRepository) Bind

func (r *GormRepository) Bind(v interface{}, id string) error

func (*GormRepository) Create

func (r *GormRepository) Create(v interface{}) error

func (*GormRepository) Delete

func (r *GormRepository) Delete(v interface{}, id string) error

func (*GormRepository) FindBy

func (r *GormRepository) FindBy(v interface{}, filters ...Filter) error

func (*GormRepository) Model

func (r *GormRepository) Model(model string)

func (*GormRepository) Transaction

func (r *GormRepository) Transaction(f Transaction) error

func (*GormRepository) Update

func (r *GormRepository) Update(v interface{}) error

type MongoRepository

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

func (*MongoRepository) All

func (r *MongoRepository) All(v interface{}) error

func (*MongoRepository) Bind

func (r *MongoRepository) Bind(v interface{}, id string) error

func (*MongoRepository) Create

func (r *MongoRepository) Create(v interface{}) error

func (*MongoRepository) Delete

func (r *MongoRepository) Delete(v interface{}, id string) error

func (*MongoRepository) FindBy

func (r *MongoRepository) FindBy(v interface{}, filters ...Filter) error

func (*MongoRepository) Model

func (r *MongoRepository) Model(model string)

func (*MongoRepository) Transaction

func (r *MongoRepository) Transaction(f Transaction) error

func (*MongoRepository) Update

func (r *MongoRepository) Update(v interface{}) error

type Repository

type Repository interface {
	Model(model string)
	Transaction(Transaction) error
	Create(v interface{}) error
	Update(v interface{}) error
	Bind(v interface{}, id string) error
	All(v interface{}) error
	FindBy(v interface{}, filters ...Filter) error
	Delete(v interface{}, id string) error
}

type Transaction

type Transaction func(Repository) error

Jump to

Keyboard shortcuts

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