usecases

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

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

Go to latest
Published: Mar 3, 2017 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInteractor

type AppInteractor struct {
	AppRepository IRepository
}

func NewAppInteractor

func NewAppInteractor(appRepository IRepository) *AppInteractor

NewAppInteractor allows to create new AppInteractor object.

func (*AppInteractor) Create

func (ai *AppInteractor) Create(app domain.App) (string, error)

Create allows to persist an App Object. It returns the persisted App Object identifier if App was persisted properly. It returns an error if something went wrong during the persist operation. Implements IAppInteractor interface.

func (*AppInteractor) CreateBatch

func (ai *AppInteractor) CreateBatch(apps []domain.App) ([]string, error)

CreateBatch allows to persist multiple App Objects. It returns the persisted objects identifiers if Apps were persisted properly. It returns an error if something went wrong during the persist operation. Implements IAppInteractor interface.

func (*AppInteractor) Delete

func (ai *AppInteractor) Delete(id string) (string, error)

Delete allows to delete an App Object. It returns the deleted App Object identifier if App was deleted properly. It returns an error if something went wrong during the delete operation. Implements IAppInteractor interface.

func (*AppInteractor) DeleteBatch

func (ai *AppInteractor) DeleteBatch(ids []string) ([]string, error)

DeleteBatch allows to delete multiple App Objects. It returns the deleted App Object identifiers if App were deleted properly. It returns an error if something went wrong during the delete operation. Implements IAppInteractor interface.

func (*AppInteractor) Get

func (ai *AppInteractor) Get(id string) (domain.App, error)

Get allows to retrieve App Object from an identifier. It returns matching App object or an error if the identifier does not exist. Implements IAppInteractor interface.

func (*AppInteractor) Search

func (ai *AppInteractor) Search(id string) ([]domain.App, error)

Search allows to retrieve App Objects from a query. It returns matching App objects or an error. Implements IAppInteractor interface.

type IRepository

type IRepository interface {
	CreateBatch(apps []domain.App) ([]string, error)
	Create(app domain.App) (string, error)
	Search(query string) ([]domain.App, error)
	Get(id string) (domain.App, error)
	Delete(id string) (string, error)
	DeleteBatch(ids []string) ([]string, error)
}

Jump to

Keyboard shortcuts

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