Skip to content

Commit

Permalink
DUPLO-26089 fix a few lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
duplodavid committed Nov 7, 2024
1 parent 0122e1a commit 12efea2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmd/duplo-jit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func main() {
// Identify the tenant name to use for the cache key.
var tenantName string
client, _ := internal.MustDuploClient(*host, *token, *interactive, false, *port)
*tenantID, tenantName = GetTenantIdAndName(*tenantID, client)
*tenantID, tenantName = getTenantIDAndName(*tenantID, client)

// Build the cache key.
cacheKey = strings.Join([]string{strings.TrimPrefix(*host, "https://"), "tenant", tenantName}, ",")
Expand Down Expand Up @@ -191,7 +191,7 @@ func main() {
// Identify the tenant name to use for the cache key.
var tenantName string
client, _ := internal.MustDuploClient(*host, *token, *interactive, false, *port)
*tenantID, tenantName = GetTenantIdAndName(*tenantID, client)
*tenantID, tenantName = getTenantIDAndName(*tenantID, client)

// Build the cache key.
cacheKey = strings.Join([]string{strings.TrimPrefix(*host, "https://"), "tenant", tenantName}, ",")
Expand All @@ -215,7 +215,7 @@ func main() {
}
}

func GetTenantIdAndName(tenantIDorName string, client *duplocloud.Client) (string, string) {
func getTenantIDAndName(tenantIDorName string, client *duplocloud.Client) (string, string) {
var tenantID string
var tenantName string

Expand Down
11 changes: 6 additions & 5 deletions duplocloud/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ func (c *Client) AdminGetK8sJitAccess(plan string) (*DuploPlanK8ClusterConfig, C
return &creds, nil
}

// AdminGetJITAwsCredentials retrieves just-in-time admin AWS credentials via the Duplo API.
// AdminGetJitAwsCredentials retrieves just-in-time admin AWS credentials via the Duplo API.
func (c *Client) AdminGetJitAwsCredentials() (*AwsJitCredentials, ClientError) {
return c.AdminAwsGetJitAccess("admin")
}

// TenantGetJITAwsCredentials retrieves just-in-time AWS credentials for a tenant via the Duplo API.
// TenantGetJitAwsCredentials retrieves just-in-time AWS credentials for a tenant via the Duplo API.
func (c *Client) TenantGetJitAwsCredentials(tenantID string) (*AwsJitCredentials, ClientError) {
creds := AwsJitCredentials{}
err := c.getAPI(
Expand Down Expand Up @@ -143,11 +143,12 @@ func (c *Client) ListTenantsForUser() (*[]UserTenant, ClientError) {
return &list, nil
}

func (c *Client) GetTenantFeatures(tenantId string) (*DuploTenantFeatures, ClientError) {
// GetTenantFeatures retrieves a tenant's current configuration via the Duplo API.
func (c *Client) GetTenantFeatures(tenantID string) (*DuploTenantFeatures, ClientError) {
features := DuploTenantFeatures{}
err := c.getAPI(
fmt.Sprintf("GetTenantFeatures(%s)", tenantId),
fmt.Sprintf("v3/features/tenant/%s", tenantId),
fmt.Sprintf("GetTenantFeatures(%s)", tenantID),
fmt.Sprintf("v3/features/tenant/%s", tenantID),
&features,
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions duplocloud/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"
)

// Represents a connection to the Duplo API
// Client represents a connection to the Duplo API
type Client struct {
HTTPClient *http.Client
HostURL string
Expand Down Expand Up @@ -66,7 +66,7 @@ func (e clientError) Response() map[string]interface{} {
return e.response
}

// Represents an error from an API call.
// ClientError represents an error from an API call.
type ClientError interface {
Error() string
Status() int
Expand Down

0 comments on commit 12efea2

Please sign in to comment.