FindByID returns the agent host with the given ID, or an error if not found.
(id string)
| 342 | |
| 343 | // FindByID returns the agent host with the given ID, or an error if not found. |
| 344 | func FindByID(id string) (*AgentHost, error) { |
| 345 | for i := range Agents { |
| 346 | if Agents[i].ID == id { |
| 347 | return &Agents[i], nil |
| 348 | } |
| 349 | } |
| 350 | return nil, fmt.Errorf("unknown agent %q, valid agents: %s", id, ValidAgentIDs()) |
| 351 | } |
| 352 | |
| 353 | // ValidAgentIDs returns a comma-separated list of valid agent IDs. |
| 354 | func ValidAgentIDs() string { |