Lines Matching refs:role
37 // role returns true if the role for this job equals any of the given values.
38 func (p parts) role(eq ...string) bool {
39 return p.equal("role", eq...)
146 // matchRole returns true if the role for this job matches any of the given
149 return p.matchPart("role", re...)
301 parse = func(depth int, role string, parts []string) ([]string, error) {
302 s, ok := s.Schema[role]
304 return nil, fmt.Errorf("Invalid job name; %q is not a valid role.", role)
307 result["role"] = role
309 result[fmt.Sprintf("sub-role-%d", depth)] = role
348 role := split[0]
350 _, err := parse(0, role, split)
360 roleKey := "role"
362 roleKey = fmt.Sprintf("sub-role-%d", depth)
364 role, ok := parts[roleKey]
369 s, ok := s.Schema[role]
371 return nil, fmt.Errorf("Invalid job parts; unknown role %q", role)
373 rvParts = append(rvParts, role)
386 subRoleKey := fmt.Sprintf("sub-role-%d", depth+1)
406 return nil, fmt.Errorf("Invalid job parts; unknown sub-role %q", subRole)