Skip to content

Commit a334918

Browse files
committed
chore(controller-sdk-go): upgrade new require
1 parent e0d4869 commit a334918

12 files changed

Lines changed: 70 additions & 79 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# the filepath to this repository, relative to $GOPATH/src
22
REPO_PATH = github.com/drycc/controller-sdk-go
33

4-
DEV_ENV_IMAGE := drycc/go-dev
4+
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
55
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
66

77
# Enable vendor/ directory support.
@@ -21,4 +21,4 @@ test: build test-style
2121
${DEV_ENV_CMD} go test -race -cover -coverprofile=coverage.txt -covermode=atomic ${PKG_DIRS}
2222

2323
test-style:
24-
${DEV_ENV_CMD} lint --deadline
24+
${DEV_ENV_CMD} lint

appsettings/appsettings.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ func List(c *drycc.Client, app string) (api.AppSettings, error) {
3030
// Set sets an app's settings variables.
3131
// This is a patching operation, which means when you call Set() with an api.AppSettings:
3232
//
33-
// - If the variable does not exist, it will be set.
34-
// - If the variable exists, it will be overwritten.
35-
// - If the variable is set to nil, it will be unset.
36-
// - If the variable was ignored in the api.AppSettings, it will remain unchanged.
33+
// - If the variable does not exist, it will be set.
34+
// - If the variable exists, it will be overwritten.
35+
// - If the variable is set to nil, it will be unset.
36+
// - If the variable was ignored in the api.AppSettings, it will remain unchanged.
3737
//
3838
// Calling Set() with an empty api.AppSettings will return a drycc.ErrConflict.
3939
func Set(c *drycc.Client, app string, appSettings api.AppSettings) (api.AppSettings, error) {

auth/auth_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@ package auth
22

33
import (
44
"fmt"
5-
"github.com/drycc/controller-sdk-go/api"
65
"net/http"
76
"net/http/httptest"
87
"testing"
98

9+
"github.com/drycc/controller-sdk-go/api"
10+
1011
drycc "github.com/drycc/controller-sdk-go"
1112
)
1213

1314
type fakeHTTPServer struct {
14-
regenBodyEmpty bool
15-
regenBodyAll bool
16-
regenBodyUsername bool
17-
cancelEmpty bool
18-
cancelUsername bool
1915
}
2016

2117
func (f *fakeHTTPServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {

builds/builds.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,26 @@ func List(c *drycc.Client, appID string, results int) ([]api.Build, int, error)
3434
// configuration object. This can be done with `drycc registry:set` or by using this SDK.
3535
//
3636
// This example adds custom registry credentials to an app:
37-
// import (
38-
// "github.com/drycc/controller-sdk-go/api"
39-
// "github.com/drycc/controller-sdk-go/config"
40-
// )
4137
//
42-
// // Create username/password map
43-
// registryMap := map[string]string{
44-
// "username": "password"
45-
// }
38+
// import (
39+
// "github.com/drycc/controller-sdk-go/api"
40+
// "github.com/drycc/controller-sdk-go/config"
41+
// )
4642
//
47-
// // Create a new configuration, assign the credentials, and set it.
48-
// // Note that config setting is a patching operation, it doesn't overwrite or unset
49-
// // unrelated configuration.
50-
// newConfig := api.Config{}
51-
// newConfig.Registry = registryMap
52-
// _, err := config.Set(<client>, "appname", newConfig)
53-
// if err != nil {
54-
// log.Fatal(err)
55-
// }
43+
// // Create username/password map
44+
// registryMap := map[string]string{
45+
// "username": "password"
46+
// }
47+
//
48+
// // Create a new configuration, assign the credentials, and set it.
49+
// // Note that config setting is a patching operation, it doesn't overwrite or unset
50+
// // unrelated configuration.
51+
// newConfig := api.Config{}
52+
// newConfig.Registry = registryMap
53+
// _, err := config.Set(<client>, "appname", newConfig)
54+
// if err != nil {
55+
// log.Fatal(err)
56+
// }
5657
func New(c *drycc.Client, appID string, image string,
5758
stack string, procfile map[string]string) (api.Build, error) {
5859

config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ func List(c *drycc.Client, app string) (api.Config, error) {
3030
// Set sets an app's config variables and creates a new release.
3131
// This is a patching operation, which means when you call Set() with an api.Config:
3232
//
33-
// - If the variable does not exist, it will be set.
34-
// - If the variable exists, it will be overwritten.
35-
// - If the variable is set to nil, it will be unset.
36-
// - If the variable was ignored in the api.Config, it will remain unchanged.
33+
// - If the variable does not exist, it will be set.
34+
// - If the variable exists, it will be overwritten.
35+
// - If the variable is set to nil, it will be unset.
36+
// - If the variable was ignored in the api.Config, it will remain unchanged.
3737
//
3838
// Calling Set() with an empty api.Config will return a drycc.ErrConflict.
3939
// Trying to unset a key that does not exist returns a drycc.ErrUnprocessable.

drycc.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@
44
// such as the controller url and user token. The client is then passed to api methods,
55
// which use it to make requests.
66
//
7-
// Basic Example
7+
// # Basic Example
88
//
99
// This example creates a client and then lists the apps that the user has access to:
1010
//
11-
// import (
12-
// drycc "github.com/drycc/controller-sdk-go"
13-
// "github.com/drycc/controller-sdk-go/apps"
14-
// )
11+
// import (
12+
// drycc "github.com/drycc/controller-sdk-go"
13+
// "github.com/drycc/controller-sdk-go/apps"
14+
// )
1515
//
16-
// // Verify SSL, Controller URL, API Token
17-
// client, err := drycc.New(true, "drycc.test.io", "abc123")
18-
// if err != nil {
19-
// log.Fatal(err)
20-
// }
21-
// apps, _, err := apps.List(client, 100)
22-
// if err != nil {
23-
// log.Fatal(err)
24-
// }
16+
// // Verify SSL, Controller URL, API Token
17+
// client, err := drycc.New(true, "drycc.test.io", "abc123")
18+
// if err != nil {
19+
// log.Fatal(err)
20+
// }
21+
// apps, _, err := apps.List(client, 100)
22+
// if err != nil {
23+
// log.Fatal(err)
24+
// }
2525
//
26-
// Authentication
26+
// # Authentication
2727
//
2828
// If you don't already have a token for a user, you can retrieve one with a
2929
// username and password.
3030
//
31-
// import (
32-
// drycc "github.com/drycc/controller-sdk-go"
33-
// "github.com/drycc/controller-sdk-go/apps"
34-
// )
31+
// import (
32+
// drycc "github.com/drycc/controller-sdk-go"
33+
// "github.com/drycc/controller-sdk-go/apps"
34+
// )
3535
//
36-
// // Create a client with a blank token to pass to login.
37-
// client, err := drycc.New(true, "drycc.test.io", "")
38-
// if err != nil {
39-
// log.Fatal(err)
40-
// }
41-
// token, err := auth.Login(client, "user", "password")
42-
// if err != nil {
43-
// log.Fatal(err)
44-
// }
45-
// // Set the client to use the retrieved token
46-
// client.Token = token
36+
// // Create a client with a blank token to pass to login.
37+
// client, err := drycc.New(true, "drycc.test.io", "")
38+
// if err != nil {
39+
// log.Fatal(err)
40+
// }
41+
// token, err := auth.Login(client, "user", "password")
42+
// if err != nil {
43+
// log.Fatal(err)
44+
// }
45+
// // Set the client to use the retrieved token
46+
// client.Token = token
4747
//
48-
// Learning More
48+
// # Learning More
4949
//
5050
// See the godoc for the SDK's subpackages to learn more about specific SDK actions.
5151
package drycc

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.19
44

55
require (
66
github.com/gorilla/websocket v1.5.0
7-
github.com/goware/urlx v0.3.1
7+
github.com/goware/urlx v0.3.2
88
)
99

1010
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV
44
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
55
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
66
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
7-
github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI=
8-
github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw=
7+
github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo=
8+
github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw=
99
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU=
1010
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
1111
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=

pkg/time/time.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ type Time struct {
1414
*time.Time
1515
}
1616

17-
func (t *Time) format() string {
18-
return t.Format(DryccDatetimeFormat)
19-
}
20-
2117
// MarshalJSON implements the json.Marshaler interface.
2218
// The time is a quoted string in Drycc' datetime format.
2319
func (t *Time) MarshalJSON() ([]byte, error) {

resources/resources_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ const resourceFixture string = `
113113
}
114114
`
115115

116-
//
117116
const resourceBindingFixture string = `
118117
{
119118
"uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
@@ -367,7 +366,6 @@ func TestServicePlans(t *testing.T) {
367366
}
368367
}
369368

370-
//
371369
func TestResourcesList(t *testing.T) {
372370
t.Parallel()
373371

0 commit comments

Comments
 (0)