Documentation ¶
Index ¶
- func RouterAttr(attrRepo Repository, router *httprouter.Router)
- type AttrController
- func (c *AttrController) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *AttrController) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *AttrController) Find(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *AttrController) List(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *AttrController) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- type AttrService
- func (s *AttrService) AddAttr(attr models.Attribute) error
- func (s *AttrService) AttrExists(name string) bool
- func (s *AttrService) DeleteAttrByName(name string) error
- func (s *AttrService) GetAllAttrs() ([]models.Attribute, error)
- func (s *AttrService) GetAttrByName(name string) (models.Attribute, error)
- func (s *AttrService) IsValid(attr models.Attribute) (bool, string)
- func (s *AttrService) UpdateAttr(attr models.Attribute) error
- type MongoRepository
- func (r *MongoRepository) AddAttr(attr models.Attribute) error
- func (r *MongoRepository) DeleteAttrByName(name string) error
- func (r *MongoRepository) GetAllAttrs() ([]models.Attribute, error)
- func (r *MongoRepository) GetAttrByName(name string) (models.Attribute, error)
- func (r *MongoRepository) UpdateAttr(attr models.Attribute) error
- type Read
- type Repository
- type Service
- type Write
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AttrController ¶
type AttrController struct {
// contains filtered or unexported fields
}
AttrController |
func NewAttrController ¶
func NewAttrController(service *AttrService) *AttrController
NewAttrController |
func (*AttrController) Create ¶
func (c *AttrController) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Create |
func (*AttrController) Delete ¶
func (c *AttrController) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Delete |
func (*AttrController) Find ¶
func (c *AttrController) Find(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Find |
func (*AttrController) List ¶
func (c *AttrController) List(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
List |
func (*AttrController) Update ¶
func (c *AttrController) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Update |
type AttrService ¶
type AttrService struct {
// contains filtered or unexported fields
}
AttrService |
func (*AttrService) DeleteAttrByName ¶
func (s *AttrService) DeleteAttrByName(name string) error
DeleteAttrByName |
func (*AttrService) GetAllAttrs ¶
func (s *AttrService) GetAllAttrs() ([]models.Attribute, error)
GetAllAttrs |
func (*AttrService) GetAttrByName ¶
func (s *AttrService) GetAttrByName(name string) (models.Attribute, error)
GetAttrByName |
func (*AttrService) IsValid ¶
func (s *AttrService) IsValid(attr models.Attribute) (bool, string)
IsValid |
func (*AttrService) UpdateAttr ¶
func (s *AttrService) UpdateAttr(attr models.Attribute) error
UpdateAttr |
type MongoRepository ¶
type MongoRepository struct {
// contains filtered or unexported fields
}
MongoRepository |
func NewMongoRepository ¶
func NewMongoRepository(session *mgo.Session) *MongoRepository
NewMongoRepository |
func (*MongoRepository) AddAttr ¶
func (r *MongoRepository) AddAttr(attr models.Attribute) error
AddAttr |
func (*MongoRepository) DeleteAttrByName ¶
func (r *MongoRepository) DeleteAttrByName(name string) error
DeleteAttrByName |
func (*MongoRepository) GetAllAttrs ¶
func (r *MongoRepository) GetAllAttrs() ([]models.Attribute, error)
GetAllAttrs |
func (*MongoRepository) GetAttrByName ¶
func (r *MongoRepository) GetAttrByName(name string) (models.Attribute, error)
GetAttrByName |
func (*MongoRepository) UpdateAttr ¶
func (r *MongoRepository) UpdateAttr(attr models.Attribute) error
UpdateAttr |
Click to show internal directories.
Click to hide internal directories.