66 "fmt"
77 "io/ioutil"
88
9- deis "github.com/deis /controller-sdk-go"
10- "github.com/deis /controller-sdk-go/api"
9+ deis "github.com/teamhephy /controller-sdk-go"
10+ "github.com/teamhephy /controller-sdk-go/api"
1111)
1212
1313// List services registered with an app.
@@ -44,7 +44,13 @@ func List(c *deis.Client, appID string) (api.Services, error) {
4444 return services , reqErr
4545}
4646
47- // New adds a service to an app.
47+ // New adds a new service to an app. App should already exists.
48+ // Service is the way to route some traffic matching given URL pattern to worker different than `web`
49+ // procfileType - name of the process in Procfile (i.e. <process type> from the `<process type>: <command>`), e.g. `webhooks`
50+ // for more about Procfile see this https://devcenter.heroku.com/articles/procfile
51+ // pathPattern - one or several regexp patterns separated by comma, all request matching given regexp
52+ // are routed to the procfileType workers. E.g. `/webhooks/notify,~ ^/users/[0-9]+/.*/webhooks/notify,/webhooks/rest`
53+ // procfileType and pathPattern are mandatory and should have valid values.
4854func New (c * deis.Client , appID string , procfileType string , pathPattern string ) (api.Service , error ) {
4955 u := fmt .Sprintf ("/v2/apps/%s/services/" , appID )
5056
@@ -67,6 +73,7 @@ func New(c *deis.Client, appID string, procfileType string, pathPattern string)
6773}
6874
6975// Delete service from app
76+ // If given service for the app doesn't exists then error returned
7077func Delete (c * deis.Client , appID string , procfileType string ) error {
7178 u := fmt .Sprintf ("/v2/apps/%s/services/" , appID )
7279
0 commit comments