model

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlogLinkType     = "blog"
	TutorialLinkType = "tutorial"
	WebpageLinkType  = "webpage"
)
View Source
const (
	// ScriptedSkillType indicates a skill like writing Python or Bash scripts
	ScriptedSkillType = "scripted"
	// CompiledSkillType indicates a skill like writing Java or C++ code
	CompiledSkillType = "compiled"
	// OrchestrationSkillType indicates a skill such as the ability to integrate
	// multiple services to automate a process and provide a single, unified
	// service.
	OrchestrationSkillType = "orchestration"
	// DatabaseSkillType indicates knowledge in an area such as SQL or JDBC
	DatabaseSkillType = "database"
)

Variables

This section is empty.

Functions

func IsValidLinkType

func IsValidLinkType(linkType string) bool

func IsValidSkillType

func IsValidSkillType(skillType string) bool

IsValidSkillType returns true if skillType is a valid SkillType, false if not.

Types

type Link struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	URL      string `json:"url"`
	SkillID  string `json:"skill_id"`
	LinkType string `json:"link_type"`
}
func NewLink(id, name, url, skillID, linkType string) Link

func (Link) GetType

func (l Link) GetType() interface{}

type Skill

type Skill struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	SkillType string `json:"skill_type"`
}

Skill models a particular skill that can be had by a human individual. Each Skill has a Name, SkillType, and a unique ID:

  • The Name should appropriately identify the skill, such as "Java", "SQL", "Go", or "Baking Cookies".

  • The SkillType must be one of the predetermined SkillTypes contained within model/skills.go as

  • The ID can be any desired string value, but ought to be unique, so that it can be used to identify the skill should it be stored in a database with other Skills.

func NewSkill

func NewSkill(id, name, skillType string) Skill

NewSkill returns a new Skill object with specified params

func (Skill) GetType

func (s Skill) GetType() interface{}

GetType satisfies data.ReadAllInterface

func (Skill) NewSkillDTO

func (s Skill) NewSkillDTO(links []Link, icon SkillIcon) SkillDTO

NewSkillDTO returns a new SkillDTO object using receiver and specified params

type SkillDTO

type SkillDTO struct {
	Skill
	Links []Link    `json:"links"`
	Icon  SkillIcon `json:"icon"`
}

SkillDTO holds additional content relevant to a Skill

func (s *SkillDTO) AddLink(link Link)

AddLink adds a new link to the receiver's Links slice

type SkillIcon

type SkillIcon struct {
	SkillID string `json:"skill_id"`
	URL     string `json:"url"`
}

SkillIcon models a small (1 MB max) graphical image for a Skill

func NewSkillIcon

func NewSkillIcon(skillID, url string) SkillIcon

NewSkillIcon returns a new SkillIcon with specified params

func (SkillIcon) GetType

func (i SkillIcon) GetType() interface{}

GetType satisfies data.ReadAllInterface

type SkillReview

type SkillReview struct {
	ID           string `json:"id"`
	SkillID      string `json:"skill_id"`
	TeamMemberID string `json:"team_member_id"`
	Body         string `json:"body"`
	Timestamp    string `json:"timestamp"`
	Positive     bool   `json:"positive"`
}

SkillReview represents a review of a particular Skill. SkillReviews can be positive or negative (determined by Positive flag). Each review must be linked to a specific Skill and TeamMember, and must also contain a date and body (substance of the review).

func NewSkillReview

func NewSkillReview(id, skillID, teamMemberID, body, timestamp string, positive bool) SkillReview

NewSkillReview returns a new instance of SkillReview. All fields must be specified.

func (SkillReview) GetType

func (s SkillReview) GetType() interface{}

GetType returns an interface{} with an underlying concrete type of SkillReview

func (SkillReview) NewSkillReviewDTO

func (s SkillReview) NewSkillReviewDTO(skillName,
	teamMemberName string) SkillReviewDTO

NewSkillReviewDTO returns a new SkillReviewDTO for the SkillReview it is called on, using the specified skillName and teamMemberName.

type SkillReviewDTO

type SkillReviewDTO struct {
	SkillReview
	SkillName      string `json:"skill_name"`
	TeamMemberName string `json:"team_member_name"`
}

SkillReviewDTO holds a SkillReview, as well as the names of the Skill and TeamMember that the SkillReview holds the IDs of.

type TMSkill

type TMSkill struct {
	ID           string `json:"id"`
	SkillID      string `json:"skill_id"`
	TeamMemberID string `json:"team_member_id"`
	WishList     bool   `json:"wish_list"`
	Proficiency  int    `json:"proficiency"`
}

func NewTMSkillDefaults

func NewTMSkillDefaults(id, skillID, teamMemberID string) TMSkill

NewTMSkillDefaults returns a new instance of TMSkill, with defaults for WishList (false) and Proficiency (0).

func NewTMSkillSetDefaults

func NewTMSkillSetDefaults(id, skillID, teamMemberID string, wishList bool,
	proficiency int) TMSkill

NewTMSkillSetDefaults returns a new instance of TMSkill, with all fields specified by the caller. The proficiency field must be in the range of 0-5. If a value is passed in outside of this range, it is clipped to 0 if it's below 0, or 5 if it's above 5.

func (*TMSkill) GetProficiencyString

func (tmSkill *TMSkill) GetProficiencyString() string

getProficiency returns a string representation of the TMSkill's Proficiency level.

func (TMSkill) GetType

func (s TMSkill) GetType() interface{}

GetType returns an interface{} with an underlying concrete type of TMSkill{}.

func (TMSkill) NewTMSkillDTO

func (t TMSkill) NewTMSkillDTO(skillName, teamMemberName string) TMSkillDTO

NewTMSkillDTO returns a new TMSkillDTO for the TMSkill it is called on, using the specified skillName and teamMemberName.

func (*TMSkill) SetProficiency

func (tmSkill *TMSkill) SetProficiency(proficiency int)

setProficiency sets the Proficiency field of the TMSkill instance to the specified proficiency. The specified proficiency must be in the range of 0-5. If a value is passed in outside of this range, it is clipped to 0 if it's below 0, or 5 if it's above 5.

type TMSkillDTO

type TMSkillDTO struct {
	TMSkill
	SkillName      string `json:"skill_name"`
	TeamMemberName string `json:"team_member_name"`
}

type TeamMember

type TeamMember struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Title string `json:"title"`
}

TeamMember represents a human individual that is currently employed by the organization. TeamMembers must have a Name and Title, and a unique ID. TeamMembers may optionally possess a set of Skills (SkillSet), as well as a set of Skills they wish to obtain (WishList).

func NewTeamMember

func NewTeamMember(id, name, title string) TeamMember

NewTeamMember is a constructor for the TeamMember type. Returns a new instance of TeamMember, initialized to the specified ID, Name, and Title.

func (TeamMember) GetType

func (t TeamMember) GetType() interface{}

GetType returns an interface{} with an underlying concrete type of TeamMember{}.

func (TeamMember) NewTeamMemberDTO

func (t TeamMember) NewTeamMemberDTO(tmSkillDTOs []TMSkillDTO) TeamMemberDTO

NewTeamMemberDTO returns a new instance of TeamMemberDTO for the TeamMember it is called on, using the specified []TMSkillDTO.

type TeamMemberDTO

type TeamMemberDTO struct {
	TeamMember
	TMSkillDTOs []TMSkillDTO `json:"tm_skills"`
}

type User

type User struct {
	Login    string `json:"login"`
	Password string `json:"password"`
}

User represents

func NewUser

func NewUser(login, password string) User

type UserAccount

type UserAccount struct {
	Login       string `json:"login"`
	DisplayName string `json:"display_name"`
}

Jump to

Keyboard shortcuts

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