Documentation ¶
Index ¶
- func RouterSkill(skillRepo Repository, router *httprouter.Router)
- type MongoRepository
- func (r *MongoRepository) AddSkill(skill models.Skill) error
- func (r *MongoRepository) DeleteSkillByName(name string) error
- func (r *MongoRepository) GetAllSkills() ([]models.Skill, error)
- func (r *MongoRepository) GetSkillByName(name string) (models.Skill, error)
- func (r *MongoRepository) UpdateSkill(skill models.Skill) error
- type Read
- type Repository
- type Service
- type SkillController
- func (c *SkillController) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *SkillController) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *SkillController) Find(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *SkillController) List(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *SkillController) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- type SkillService
- func (s *SkillService) AddSkill(skill models.Skill) error
- func (s *SkillService) DeleteSkillByName(name string) error
- func (s *SkillService) GetAllSkills() ([]models.Skill, error)
- func (s *SkillService) GetSkillByName(name string) (models.Skill, error)
- func (s *SkillService) IsValid(skill models.Skill) (bool, string)
- func (s *SkillService) SkillExists(name string) bool
- func (s *SkillService) UpdateSkill(skill models.Skill) error
- type Write
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MongoRepository ¶
type MongoRepository struct {
// contains filtered or unexported fields
}
MongoRepository |
func NewMongoRepository ¶
func NewMongoRepository(session *mgo.Session) *MongoRepository
NewMongoRepository |
func (*MongoRepository) AddSkill ¶
func (r *MongoRepository) AddSkill(skill models.Skill) error
AddSkill |
func (*MongoRepository) DeleteSkillByName ¶
func (r *MongoRepository) DeleteSkillByName(name string) error
DeleteSkillByName |
func (*MongoRepository) GetAllSkills ¶
func (r *MongoRepository) GetAllSkills() ([]models.Skill, error)
GetAllSkills |
func (*MongoRepository) GetSkillByName ¶
func (r *MongoRepository) GetSkillByName(name string) (models.Skill, error)
GetSkillByName |
func (*MongoRepository) UpdateSkill ¶
func (r *MongoRepository) UpdateSkill(skill models.Skill) error
UpdateSkill |
type Read ¶
type Read interface { GetAllSkills() ([]models.Skill, error) GetSkillByName(name string) (models.Skill, error) }
Read |
type SkillController ¶
type SkillController struct {
// contains filtered or unexported fields
}
SkillController |
func NewSkillController ¶
func NewSkillController(service *SkillService) *SkillController
NewSkillController |
func (*SkillController) Create ¶
func (c *SkillController) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Create |
func (*SkillController) Delete ¶
func (c *SkillController) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Delete |
func (*SkillController) Find ¶
func (c *SkillController) Find(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Find |
func (*SkillController) List ¶
func (c *SkillController) List(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
List |
func (*SkillController) Update ¶
func (c *SkillController) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Update |
type SkillService ¶
type SkillService struct {
// contains filtered or unexported fields
}
SkillService |
func (*SkillService) AddSkill ¶
func (s *SkillService) AddSkill(skill models.Skill) error
AddSkill |
func (*SkillService) DeleteSkillByName ¶
func (s *SkillService) DeleteSkillByName(name string) error
DeleteSkillByName |
func (*SkillService) GetAllSkills ¶
func (s *SkillService) GetAllSkills() ([]models.Skill, error)
GetAllSkills |
func (*SkillService) GetSkillByName ¶
func (s *SkillService) GetSkillByName(name string) (models.Skill, error)
GetSkillByName |
func (*SkillService) IsValid ¶
func (s *SkillService) IsValid(skill models.Skill) (bool, string)
IsValid |
func (*SkillService) SkillExists ¶
func (s *SkillService) SkillExists(name string) bool
SkillExists |
func (*SkillService) UpdateSkill ¶
func (s *SkillService) UpdateSkill(skill models.Skill) error
UpdateSkill |
Click to show internal directories.
Click to hide internal directories.