service

package
v0.0.0-...-75ddec1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemService

type ItemService struct {
	item.UnimplementedItemServiceServer
	// contains filtered or unexported fields
}

func New

func New(repository Repository, storageClient storage.StorageServiceClient) *ItemService

func (*ItemService) Create

func (s *ItemService) Create(ctx context.Context, request *item.CreateRequest) (*item.Item, error)

func (*ItemService) Delete

func (s *ItemService) Delete(ctx context.Context, request *item.DeleteRequest) (*emptypb.Empty, error)

func (*ItemService) Fetch

func (s *ItemService) Fetch(ctx context.Context, request *item.FetchRequest) (*item.FetchResponse, error)

func (*ItemService) Get

func (s *ItemService) Get(ctx context.Context, request *item.GetRequest) (*item.Item, error)

func (*ItemService) Update

func (s *ItemService) Update(ctx context.Context, request *item.UpdateRequest) (*emptypb.Empty, error)

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (*domain.Item, error)
	Fetch(ctx context.Context, criteria domain.ItemCriteria) (*domain.ItemPage, error)
	Create(ctx context.Context, item *domain.Item) (string, error)
	Update(ctx context.Context, item *domain.Item) error
	Delete(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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