Ash Wilson | 1cc96dc | 2014-09-04 10:53:22 -0400 | [diff] [blame] | 1 | package endpoints |
| 2 | |
| 3 | import "fmt" |
| 4 | |
| 5 | func requiredAttribute(attribute string) error { |
| 6 | return fmt.Errorf("You must specify %s for this endpoint.", attribute) |
| 7 | } |
| 8 | |
| 9 | var ( |
Ash Wilson | efac18b | 2014-09-10 14:44:42 -0400 | [diff] [blame^] | 10 | // ErrAvailabilityRequired is reported if an Endpoint is created without an Availability. |
| 11 | ErrAvailabilityRequired = requiredAttribute("an availability") |
Ash Wilson | 1cc96dc | 2014-09-04 10:53:22 -0400 | [diff] [blame] | 12 | |
| 13 | // ErrNameRequired is reported if an Endpoint is created without a Name. |
| 14 | ErrNameRequired = requiredAttribute("a name") |
| 15 | |
| 16 | // ErrURLRequired is reported if an Endpoint is created without a URL. |
| 17 | ErrURLRequired = requiredAttribute("a URL") |
| 18 | |
| 19 | // ErrServiceIDRequired is reported if an Endpoint is created without a ServiceID. |
| 20 | ErrServiceIDRequired = requiredAttribute("a serviceID") |
| 21 | ) |