usecases

package
v0.0.0-...-2a97ad4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerRepository

type LoggerRepository interface {
	LogError(string, ...interface{})
	LogAccess(string, ...interface{})
}

type MongoRepository

type MongoRepository interface {
	Query(entity.Mongo) (*mongo.Cursor, error)
	FindBy(entity.Mongo) *mongo.SingleResult
	Insert(entity.Mongo) (*mongo.InsertOneResult, error)
	Update(entity.Mongo) (*mongo.UpdateResult, error)
	Delete(entity.Mongo) (*mongo.DeleteResult, error)
}

type UserInteractor

type UserInteractor struct {
	UserRepository UserService
}

func (*UserInteractor) Destroy

func (ui *UserInteractor) Destroy(userId string) (interface{}, error)

func (*UserInteractor) Index

func (ui *UserInteractor) Index() (model.Users, error)

func (*UserInteractor) Show

func (ui *UserInteractor) Show(userId string) (model.User, error)

func (*UserInteractor) Store

func (ui *UserInteractor) Store(user model.User) (interface{}, error)

func (*UserInteractor) Update

func (ui *UserInteractor) Update(userId string, user model.User) (interface{}, error)

type UserService

type UserService interface {
	FindAll() (model.Users, error)
	FindById(string) (model.User, error)
	Create(model.User) (interface{}, error)
	Update(string, model.User) (interface{}, error)
	Delete(string) (interface{}, error)
}

Jump to

Keyboard shortcuts

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