Documentation ¶
Index ¶
- type GiftAssocService
- type MongoRepository
- func (r *MongoRepository) Create(ctx context.Context, gift types.Gift) (string, error)
- func (r *MongoRepository) Delete(ctx context.Context, id string) error
- func (r *MongoRepository) FindAll(ctx context.Context) ([]types.Gift, error)
- func (r *MongoRepository) FindByID(ctx context.Context, id string) (*types.Gift, error)
- func (r *MongoRepository) Update(ctx context.Context, gift types.Gift) error
- type Repository
- type Service
- func (s *Service) Create(ctx context.Context, gift types.Gift) (string, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) Get(ctx context.Context, id string) (*types.Gift, error)
- func (s *Service) GetAll(ctx context.Context) ([]types.Gift, error)
- func (s *Service) Update(ctx context.Context, gift types.Gift) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GiftAssocService ¶
type MongoRepository ¶
type MongoRepository struct {
// contains filtered or unexported fields
}
MongoRepository is MongoDB implementation of repository
func NewMongoRepository ¶
func NewMongoRepository(s *mgo.Session) *MongoRepository
NewMongoRepository return new MongoDB repository
func (*MongoRepository) Delete ¶
func (r *MongoRepository) Delete(ctx context.Context, id string) error
Delete a gift
type Repository ¶
type Repository interface { FindByID(ctx context.Context, id string) (*types.Gift, error) FindAll(ctx context.Context) ([]types.Gift, error) Create(ctx context.Context, gift types.Gift) (string, error) Update(ctx context.Context, gift types.Gift) error Delete(ctx context.Context, id string) error }
Repository is an interface of a gift repository
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is an gift service
func NewService ¶
func NewService(r Repository, assocService GiftAssocService, l glog.Logger) *Service
NewService return a new gift service
Click to show internal directories.
Click to hide internal directories.