Skip to content

Commit 910603c

Browse files
committed
chore(controller-sdk-go): fmt go code
1 parent d13f736 commit 910603c

66 files changed

Lines changed: 149 additions & 233 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

allowlist/allowlist_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func (fakeHTTPServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
3131

3232
if req.URL.Path == "/v2/apps/example-go/allowlist/" && req.Method == "POST" {
3333
body, err := io.ReadAll(req.Body)
34-
3534
if err != nil {
3635
fmt.Println(err)
3736
res.WriteHeader(http.StatusInternalServerError)
@@ -89,7 +88,6 @@ func TestAllowlistList(t *testing.T) {
8988
}
9089

9190
actual, err := List(drycc, "example-go")
92-
9391
if err != nil {
9492
t.Fatal(err)
9593
}
@@ -116,7 +114,6 @@ func TestAllowlistAdd(t *testing.T) {
116114
}
117115

118116
actual, err := Add(drycc, "example-go", []string{"1.2.3.4", "0.0.0.0/0"})
119-
120117
if err != nil {
121118
t.Fatal(err)
122119
}

api/apps.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package api provides data structures for the Drycc Controller API.
12
package api
23

34
// App is the definition of the app object.

api/auth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package api
22

3+
// AuthLoginRequest represents the request structure for authentication login.
34
type AuthLoginRequest struct {
45
Username string `json:"username,omitempty"`
56
Password string `json:"password,omitempty"`
67
}
78

9+
// AuthLoginResponse represents the response structure for authentication login.
810
type AuthLoginResponse struct {
911
Key string `json:"key,omitempty"`
1012
}

api/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,26 @@ import (
99
// ConfigTags is the key, value for tag
1010
type ConfigTags map[string]interface{}
1111

12-
// ConfigValues value for env
12+
// ConfigVar represents a configuration variable for an app.
1313
type ConfigVar struct {
1414
Name string `json:"name"`
1515
Value interface{} `json:"value"`
1616
}
1717

18+
// ConfigValue represents a configuration value with its type and group.
1819
type ConfigValue struct {
1920
Ptype string `json:"ptype,omitempty"`
2021
Group string `json:"group,omitempty"`
2122
ConfigVar
2223
}
2324

25+
// PtypeValue represents values for a specific process type.
2426
type PtypeValue struct {
2527
Env []ConfigVar `json:"env,omitempty"`
2628
Ref []string `json:"ref,omitempty"`
2729
}
2830

31+
// ConfigInfo represents the complete configuration information for an app.
2932
type ConfigInfo struct {
3033
Ptype map[string]PtypeValue `json:"ptype,omitempty"`
3134
Group map[string][]ConfigVar `json:"group,omitempty"`

api/events.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package api
22

3-
// Event defines the structure of event.
3+
// AppEvent represents an event in the system.
44
type AppEvent struct {
55
Reason string `json:"reason"`
66
Message string `json:"message"`
77
Created string `json:"created"`
88
}
99

10+
// AppEvents is a collection of AppEvent.
1011
type AppEvents []AppEvent

api/filer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package api
22

3+
// FilerDirEntry represents a directory entry in the file system.
34
type FilerDirEntry struct {
45
Name string `json:"name,omitempty"`
56
Path string `json:"path,omitempty"`
@@ -8,4 +9,5 @@ type FilerDirEntry struct {
89
Timestamp string `json:"timestamp,omitempty"`
910
}
1011

12+
// FilerDirEntries is a collection of FilerDirEntry.
1113
type FilerDirEntries []FilerDirEntry

api/gateways.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ type Gateway struct {
1818
Addresses []Address `json:"addresses,omitempty"`
1919
}
2020

21+
// Listener represents a gateway listener configuration.
2122
type Listener struct {
2223
Name string `json:"name,omitempty"`
2324
Port int `json:"port,omitempty"`
2425
Protocol string `json:"protocol,omitempty"`
2526
AllowedRoutes interface{} `json:"allowedRoutes,omitempty"`
2627
}
2728

29+
// Address represents a gateway address configuration.
2830
type Address struct {
2931
Type string `json:"type,omitempty"`
3032
Value string `json:"value,omitempty"`
@@ -40,7 +42,7 @@ type GatewayCreateRequest struct {
4042
Protocol string `json:"protocol,omitempty"`
4143
}
4244

43-
// GatewayRemoteRequest is the structure of Delete /v2/app/<app id>/gateways/.
45+
// GatewayRemoveRequest is the structure of Delete /v2/app/<app id>/gateways/.
4446
type GatewayRemoveRequest struct {
4547
Name string `json:"name,omitempty"`
4648
Port int `json:"port,omitempty"`

api/ps.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ type PodType struct {
4040
// PodTypes holds groups of pods organized by type.
4141
type PodTypes []PodType
4242

43-
// AppLogsRequest is the definition of websocket /v2/apps/<app id>/logs
43+
// PodLogsRequest is the definition of websocket /v2/apps/<app id>/logs
4444
type PodLogsRequest struct {
4545
Lines int `json:"lines"`
4646
Follow bool `json:"follow"`
4747
Container string `json:"container"`
4848
Previous bool `json:"previous"`
4949
}
5050

51-
// Start is the definition of POST /v2/apps/<app_id>/stop or POST /v2/apps/<app_id>/start.
51+
// Types is the definition of POST /v2/apps/<app_id>/stop or POST /v2/apps/<app_id>/start.
5252
type Types struct {
5353
Types []string `json:"types,omitempty"`
5454
}
@@ -75,6 +75,7 @@ type ContainerState struct {
7575
// PodState defines a collection of container state.
7676
type PodState []ContainerState
7777

78+
// PodIDs represents a list of pod IDs.
7879
type PodIDs struct {
7980
PodIDs string `json:"pod_ids"`
8081
}

api/pts.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ type PtypeState struct {
3232
NodeSelector map[string]string `json:"node_selector,omitempty"`
3333
}
3434

35+
// VolumeMount represents a volume mount in a container.
3536
type VolumeMount struct {
3637
Name string `json:"name"`
3738
MountPath string `json:"mountPath"`
3839
}
3940

40-
// PtypesState defines a collection of container state.
41+
// PtypeStates defines a collection of container state.
4142
type PtypeStates []PtypeState

api/releases.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type ReleaseRollback struct {
2222
Ptypes string `json:"ptypes"`
2323
}
2424

25+
// Condition represents a condition in a release.
2526
type Condition struct {
2627
State string `json:"state"`
2728
Action string `json:"action"`

0 commit comments

Comments
 (0)