Documentation ¶
Overview ¶
Package mocks the service trip.Service for testing purpose
Package mocks the service base trip.ServiceBase for testing purpose
Index ¶
- type Service
- type ServiceBase
- func (s *ServiceBase) BelongsToUser(userId string, items int64, page int64) ([]*trip.TripEntity, error)
- func (s *ServiceBase) Create(ctx context.IDataMap, ety *trip.TripEntity) (*trip.TripEntity, error)
- func (s *ServiceBase) Delete(ctx context.IDataMap, id string) error
- func (s *ServiceBase) DeleteByUser(userId string) error
- func (s *ServiceBase) Query(q *tql.Query) (*tql.Result, error)
- func (s *ServiceBase) Read(ctx context.IDataMap, id string) (*trip.TripEntity, error)
- func (s *ServiceBase) Update(ctx context.IDataMap, ety *trip.TripEntity) (*trip.TripEntity, error)
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) 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
Click to show internal directories.
Click to hide internal directories.