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