mocks

package
v0.0.0-...-f52bcce Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mocks the service trip.Service for testing purpose

Package mocks the service base trip.ServiceBase for testing purpose

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	*ServiceBase // DO NOT REMOVE this line. ServiceBase implements IServiceBase interface

}

type ServiceBase

type ServiceBase struct {
	Create_ func(ctx context.IDataMap, ety *trip.TripEntity) (*trip.TripEntity, error)
	Read_   func(ctx context.IDataMap, id string) (*trip.TripEntity, error)
	Update_ func(ctx context.IDataMap, ety *trip.TripEntity) (*trip.TripEntity, error)
	Delete_ func(ctx context.IDataMap, id string) error
	Query_  func(q *tql.Query) (*tql.Result, error)

	BelongsToUser_ func(userId string, items int64, page int64) ([]*trip.TripEntity, error)
	DeleteByUser_  func(userId string) error
}

func (*ServiceBase) BelongsToUser

func (s *ServiceBase) BelongsToUser(userId string, items int64, page int64) ([]*trip.TripEntity, error)

BelongsToUser fetch a list of TripEntity that belongs to User given the userId

func (*ServiceBase) Create

func (s *ServiceBase) Create(ctx context.IDataMap, ety *trip.TripEntity) (*trip.TripEntity, error)

Create given a new entity this one is populated with ID and creation timestamp and finally saved into the repository

func (*ServiceBase) Delete

func (s *ServiceBase) Delete(ctx context.IDataMap, id string) error

Delete removes the entity given its id

func (*ServiceBase) DeleteByUser

func (s *ServiceBase) DeleteByUser(userId string) error

DeleteByUser remove all trip given the userId

func (*ServiceBase) Query

func (s *ServiceBase) Query(q *tql.Query) (*tql.Result, error)

Query executes the given query (TQL) and returns the query result

func (*ServiceBase) Read

func (s *ServiceBase) Read(ctx context.IDataMap, id string) (*trip.TripEntity, error)

Read returns a pointer to TripEntity given its id

func (*ServiceBase) Update

func (s *ServiceBase) Update(ctx context.IDataMap, ety *trip.TripEntity) (*trip.TripEntity, error)

Update returns a pointer to TripEntity after update it

Jump to

Keyboard shortcuts

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