diff --git a/account.go b/account.go index 8aee3cb91..9201fd62c 100644 --- a/account.go +++ b/account.go @@ -63,7 +63,7 @@ func (i Account) GetUpdateOptions() (o AccountUpdateOptions) { o.TaxID = i.TaxID o.Zip = i.Zip - return + return o } // UnmarshalJSON implements the json.Unmarshaler interface diff --git a/account_agreements.go b/account_agreements.go index d7437b4aa..795244a4a 100644 --- a/account_agreements.go +++ b/account_agreements.go @@ -22,7 +22,7 @@ func (i AccountAgreements) GetUpdateOptions() (o AccountAgreementsUpdateOptions) o.MasterServiceAgreement = i.MasterServiceAgreement o.PrivacyPolicy = i.PrivacyPolicy - return + return o } // GetAccountAgreements gets all agreements and their acceptance status for the Account. diff --git a/account_betas.go b/account_betas.go index 1a498e808..2e23c9284 100644 --- a/account_betas.go +++ b/account_betas.go @@ -8,7 +8,9 @@ import ( "github.com/linode/linodego/internal/parseabletime" ) -// The details and enrollment information of a Beta program that an account is enrolled in. +// AccountBetaProgram represents an enrolled Account Beta Program object, +// which contains the details and enrollment information of a Beta program +// that an account is enrolled in. type AccountBetaProgram struct { Label string `json:"label"` ID string `json:"id"` diff --git a/account_maintenance.go b/account_maintenance.go index 96be1ad35..6e50cab5a 100644 --- a/account_maintenance.go +++ b/account_maintenance.go @@ -28,7 +28,7 @@ type AccountMaintenance struct { When *time.Time `json:"when"` } -// The entity being affected by maintenance +// Entity represents the entity being affected by maintenance type Entity struct { ID int `json:"id"` Label string `json:"label"` diff --git a/account_oauth_client.go b/account_oauth_client.go index ee0c48099..7b0e7795a 100644 --- a/account_oauth_client.go +++ b/account_oauth_client.go @@ -68,7 +68,7 @@ func (i OAuthClient) GetCreateOptions() (o OAuthClientCreateOptions) { o.Label = i.Label o.Public = i.Public - return + return o } // GetUpdateOptions converts a OAuthClient to OAuthClientUpdateOptions for use in UpdateOAuthClient @@ -77,7 +77,7 @@ func (i OAuthClient) GetUpdateOptions() (o OAuthClientUpdateOptions) { o.Label = i.Label o.Public = i.Public - return + return o } // ListOAuthClients lists OAuthClients diff --git a/account_payments.go b/account_payments.go index 40feebc13..af2488e9e 100644 --- a/account_payments.go +++ b/account_payments.go @@ -53,7 +53,7 @@ func (i *Payment) UnmarshalJSON(b []byte) error { // GetCreateOptions converts a Payment to PaymentCreateOptions for use in CreatePayment func (i Payment) GetCreateOptions() (o PaymentCreateOptions) { o.USD = i.USD - return + return o } // ListPayments lists Payments diff --git a/account_users.go b/account_users.go index d6e46ef09..13e71c520 100644 --- a/account_users.go +++ b/account_users.go @@ -98,7 +98,7 @@ func (i User) GetCreateOptions() (o UserCreateOptions) { o.Email = i.Email o.Restricted = i.Restricted - return + return o } // GetUpdateOptions converts a User to UserUpdateOptions for use in UpdateUser @@ -107,7 +107,7 @@ func (i User) GetUpdateOptions() (o UserUpdateOptions) { o.Restricted = copyBool(&i.Restricted) o.Email = i.Email - return + return o } // ListUsers lists Users on the account diff --git a/betas.go b/betas.go index 97a89ef5b..476ef351f 100644 --- a/betas.go +++ b/betas.go @@ -8,7 +8,7 @@ import ( "github.com/linode/linodego/internal/parseabletime" ) -// Beta Program is a new product or service that is not generally available to all Akamai customers. +// BetaProgram is a new product or service that is not generally available to all Akamai customers. // Users must enroll into a beta in order to access the functionality. type BetaProgram struct { Label string `json:"label"` diff --git a/client.go b/client.go index 476151e48..bff9a0b78 100644 --- a/client.go +++ b/client.go @@ -45,7 +45,7 @@ const ( APIEnvVar = "LINODE_TOKEN" // APISecondsPerPoll how frequently to poll for new Events or Status in WaitFor functions APISecondsPerPoll = 3 - // Maximum wait time for retries + // APIRetryMaxWaitTime is the maximum wait time for retries APIRetryMaxWaitTime = time.Duration(30) * time.Second APIDefaultCacheExpiration = time.Minute * 15 ) @@ -171,7 +171,7 @@ func NewClient(hc *http.Client) (client Client) { SetDebug(envDebug). enableLogSanitization() - return + return client } // NewClientFromEnv creates a Client and initializes it with values diff --git a/client_monitor.go b/client_monitor.go index 33d42b161..b54dc8284 100644 --- a/client_monitor.go +++ b/client_monitor.go @@ -66,7 +66,7 @@ func NewMonitorClient(hc *http.Client) (mClient MonitorClient) { mClient.SetDebug(envDebug) - return + return mClient } // SetUserAgent sets a custom user-agent for HTTP requests diff --git a/domain_records.go b/domain_records.go index 373d797e7..2d8865e66 100644 --- a/domain_records.go +++ b/domain_records.go @@ -105,7 +105,7 @@ func (d DomainRecord) GetUpdateOptions() (du DomainRecordUpdateOptions) { du.TTLSec = d.TTLSec du.Tag = copyString(d.Tag) - return + return du } // ListDomainRecords lists DomainRecords diff --git a/domains.go b/domains.go index 7e04b4eed..4f2f2179b 100644 --- a/domains.go +++ b/domains.go @@ -190,7 +190,7 @@ func (d Domain) GetUpdateOptions() (du DomainUpdateOptions) { du.RefreshSec = d.RefreshSec du.TTLSec = d.TTLSec - return + return du } // ListDomains lists Domains diff --git a/firewall_devices.go b/firewall_devices.go index adbd9a17c..4ccc850b5 100644 --- a/firewall_devices.go +++ b/firewall_devices.go @@ -74,7 +74,7 @@ func (c *Client) GetFirewallDevice(ctx context.Context, firewallID, deviceID int return doGETRequest[FirewallDevice](ctx, c, e) } -// AddFirewallDevice associates a Device with a given Firewall +// CreateFirewallDevice associates a Device with a given Firewall func (c *Client) CreateFirewallDevice(ctx context.Context, firewallID int, opts FirewallDeviceCreateOptions) (*FirewallDevice, error) { e := formatAPIPath("networking/firewalls/%d/devices", firewallID) return doPOSTRequest[FirewallDevice](ctx, c, e, opts) diff --git a/firewall_templates.go b/firewall_templates.go index e3be54fda..e2f5f6702 100644 --- a/firewall_templates.go +++ b/firewall_templates.go @@ -9,15 +9,15 @@ type FirewallTemplate struct { Rules FirewallRuleSet `json:"rules"` } -// NOTE: This feature may not currently be available to all users. // GetFirewallTemplate gets a FirewallTemplate given a slug. +// NOTE: This feature may not currently be available to all users. func (c *Client) GetFirewallTemplate(ctx context.Context, slug string) (*FirewallTemplate, error) { e := formatAPIPath("networking/firewalls/templates/%s", slug) return doGETRequest[FirewallTemplate](ctx, c, e) } -// NOTE: This feature may not currently be available to all users. // ListFirewallTemplates gets all available firewall templates for the account. +// NOTE: This feature may not currently be available to all users. func (c *Client) ListFirewallTemplates(ctx context.Context, opts *ListOptions) ([]FirewallTemplate, error) { return getPaginatedResults[FirewallTemplate](ctx, c, "networking/firewalls/templates", opts) } diff --git a/images.go b/images.go index 858136a41..21b2853fb 100644 --- a/images.go +++ b/images.go @@ -142,7 +142,7 @@ func (i Image) GetUpdateOptions() (iu ImageUpdateOptions) { iu.Label = i.Label iu.Description = copyString(&i.Description) - return + return iu } // ListImages lists Images. diff --git a/instance_ips.go b/instance_ips.go index cd87dbcd7..cd2a78505 100644 --- a/instance_ips.go +++ b/instance_ips.go @@ -145,7 +145,7 @@ func (c *Client) DeleteInstanceIPAddress(ctx context.Context, linodeID int, ipAd return doDELETERequest(ctx, c, e) } -// Function to add additional reserved IPV4 addresses to an existing linode +// AssignInstanceReservedIP adds additional reserved IPV4 addresses to an existing linode func (c *Client) AssignInstanceReservedIP(ctx context.Context, linodeID int, opts InstanceReserveIPOptions) (*InstanceIP, error) { endpoint := formatAPIPath("linode/instances/%d/ips", linodeID) return doPOSTRequest[InstanceIP](ctx, c, endpoint, opts) diff --git a/lke_clusters.go b/lke_clusters.go index f5a56fccd..786b6faaf 100644 --- a/lke_clusters.go +++ b/lke_clusters.go @@ -158,7 +158,7 @@ func (i LKECluster) GetCreateOptions() (o LKEClusterCreateOptions) { } // @TODO copy NodePools? - return + return o } // GetUpdateOptions converts a LKECluster to LKEClusterUpdateOptions for use in UpdateLKECluster @@ -174,7 +174,7 @@ func (i LKECluster) GetUpdateOptions() (o LKEClusterUpdateOptions) { // ACL will not be populated in the control plane response } - return + return o } // ListLKEVersions lists the Kubernetes versions available through LKE. This endpoint is cached by default. diff --git a/lke_node_pools.go b/lke_node_pools.go index 62cce2ced..fc90ed25d 100644 --- a/lke_node_pools.go +++ b/lke_node_pools.go @@ -132,7 +132,7 @@ func (l LKENodePool) GetCreateOptions() (o LKENodePoolCreateOptions) { o.UpdateStrategy = l.UpdateStrategy o.Label = l.Label - return + return o } // GetUpdateOptions converts a LKENodePool to LKENodePoolUpdateOptions for use in UpdateLKENodePoolUpdate @@ -146,7 +146,7 @@ func (l LKENodePool) GetUpdateOptions() (o LKENodePoolUpdateOptions) { o.UpdateStrategy = l.UpdateStrategy o.Label = l.Label - return + return o } // ListLKENodePools lists LKENodePools diff --git a/longview.go b/longview.go index 14d8fb41b..16be227e3 100644 --- a/longview.go +++ b/longview.go @@ -28,7 +28,7 @@ type LongviewClientCreateOptions struct { Label string `json:"label"` } -// LongviewClientCreateOptions is an options struct used when Updating a Longview Client +// LongviewClientUpdateOptions is an options struct used when Updating a Longview Client type LongviewClientUpdateOptions struct { Label string `json:"label"` } diff --git a/monitor_dashboards.go b/monitor_dashboards.go index 2554a7b59..2492e1ef6 100644 --- a/monitor_dashboards.go +++ b/monitor_dashboards.go @@ -19,7 +19,7 @@ type MonitorDashboard struct { Widgets []DashboardWidget `json:"widgets"` } -// enum object for serviceType +// ServiceType is an enum object for serviceType type ServiceType string const ( @@ -33,7 +33,7 @@ const ( ServiceTypeFirewallService ServiceType = "firewall" ) -// enum object for DashboardType +// DashboardType is an enum object for DashboardType type DashboardType string const ( @@ -53,7 +53,7 @@ type DashboardWidget struct { AggregateFunction AggregateFunction `json:"aggregate_function"` } -// Enum object for AggregateFunction +// AggregateFunction is an enum object for AggregateFunction type AggregateFunction string const ( @@ -67,7 +67,7 @@ const ( AggregateFunctionLast AggregateFunction = "last" ) -// Enum object for Chart type +// ChartType is an enum object for Chart type type ChartType string const ( diff --git a/monitor_metrics_definitions.go b/monitor_metrics_definitions.go index eca52b112..026652a00 100644 --- a/monitor_metrics_definitions.go +++ b/monitor_metrics_definitions.go @@ -16,7 +16,7 @@ type MonitorMetricsDefinition struct { Unit MetricUnit `json:"unit"` } -// Enum object for MetricType +// MetricType is an enum object for MetricType type MetricType string const ( @@ -26,7 +26,7 @@ const ( MetricTypeSummary MetricType = "summary" ) -// Enum object for Unit +// MetricUnit is an enum object for Unit type MetricUnit string const ( diff --git a/monitor_services_create_token.go b/monitor_services_create_token.go index a5cb47ae9..a4c679e05 100644 --- a/monitor_services_create_token.go +++ b/monitor_services_create_token.go @@ -9,7 +9,7 @@ type MonitorServiceToken struct { Token string `json:"token"` } -// Create token options. +// MonitorTokenCreateOptions contains create token options. type MonitorTokenCreateOptions struct { // EntityIDs are expected to be type "any" as different service_types have different variable type for their entity_ids. For example, Linode has "int" entity_ids whereas object storage has "string" as entity_ids. EntityIDs []any `json:"entity_ids"` diff --git a/network_ips.go b/network_ips.go index 8cebabb42..72be24c63 100644 --- a/network_ips.go +++ b/network_ips.go @@ -69,7 +69,7 @@ func (i InstanceIP) GetUpdateOptionsV2() IPAddressUpdateOptionsV2 { // Deprecated: Please use GetUpdateOptionsV2 for all new implementations. func (i InstanceIP) GetUpdateOptions() (o IPAddressUpdateOptions) { o.RDNS = copyString(&i.RDNS) - return + return o } // ListIPAddresses lists IPAddresses. diff --git a/object_storage_bucket_certs.go b/object_storage_bucket_certs.go index 6597e40f5..4f52859ca 100644 --- a/object_storage_bucket_certs.go +++ b/object_storage_bucket_certs.go @@ -36,7 +36,7 @@ func (c *Client) GetObjectStorageBucketCert(ctx context.Context, clusterOrRegion return doGETRequest[ObjectStorageBucketCert](ctx, c, e) } -// UploadObjectStorageBucketCert uploads a TLS/SSL Cert to be used with an Object Storage Bucket. +// UploadObjectStorageBucketCertV2 uploads a TLS/SSL Cert to be used with an Object Storage Bucket. func (c *Client) UploadObjectStorageBucketCertV2( ctx context.Context, clusterOrRegionID, bucket string, diff --git a/object_storage_buckets.go b/object_storage_buckets.go index 8755f3ade..bdcb54229 100644 --- a/object_storage_buckets.go +++ b/object_storage_buckets.go @@ -159,7 +159,7 @@ func (c *Client) UpdateObjectStorageBucketAccess(ctx context.Context, clusterOrR return doPOSTRequestNoResponseBody(ctx, c, e, opts) } -// GetObjectStorageBucketAccess gets the current access config for a bucket +// GetObjectStorageBucketAccessV2 gets the current access config for a bucket func (c *Client) GetObjectStorageBucketAccessV2(ctx context.Context, clusterOrRegionID, label string) (*ObjectStorageBucketAccessV2, error) { e := formatAPIPath("object-storage/buckets/%s/%s/access", clusterOrRegionID, label) return doGETRequest[ObjectStorageBucketAccessV2](ctx, c, e) @@ -171,7 +171,7 @@ func (c *Client) DeleteObjectStorageBucket(ctx context.Context, clusterOrRegionI return doDELETERequest(ctx, c, e) } -// Lists the contents of the specified ObjectStorageBucket +// ListObjectStorageBucketContents lists the contents of the specified ObjectStorageBucket func (c *Client) ListObjectStorageBucketContents( ctx context.Context, clusterOrRegionID, label string, diff --git a/object_storage_endpoints.go b/object_storage_endpoints.go index 635091948..f3ad166c6 100644 --- a/object_storage_endpoints.go +++ b/object_storage_endpoints.go @@ -2,7 +2,7 @@ package linodego import "context" -// NotificationType constants start with Notification and include all known Linode API Notification Types. +// ObjectStorageEndpointType constants start with Notification and include all known Linode API Notification Types. type ObjectStorageEndpointType string // NotificationType constants represent the actions that cause a Notification. New types may be added in the future. diff --git a/profile.go b/profile.go index ec227b6d1..c290d62b5 100644 --- a/profile.go +++ b/profile.go @@ -66,7 +66,7 @@ func (i Profile) GetUpdateOptions() (o ProfileUpdateOptions) { o.TwoFactorAuth = copyBool(&i.TwoFactorAuth) o.Restricted = copyBool(&i.Restricted) - return + return o } // GetProfile returns the Profile of the authenticated user diff --git a/profile_logins.go b/profile_logins.go index 76f0f201f..96740a398 100644 --- a/profile_logins.go +++ b/profile_logins.go @@ -8,7 +8,7 @@ import ( "github.com/linode/linodego/internal/parseabletime" ) -// Profile represents a Profile object +// ProfileLogin represents a Profile object type ProfileLogin struct { Datetime *time.Time `json:"datetime"` ID int `json:"id"` diff --git a/profile_sshkeys.go b/profile_sshkeys.go index 30b0e4bfe..a18566fdb 100644 --- a/profile_sshkeys.go +++ b/profile_sshkeys.go @@ -53,13 +53,13 @@ func (i SSHKey) GetCreateOptions() (o SSHKeyCreateOptions) { o.Label = i.Label o.SSHKey = i.SSHKey - return + return o } // GetUpdateOptions converts a SSHKey to SSHKeyCreateOptions for use in UpdateSSHKey func (i SSHKey) GetUpdateOptions() (o SSHKeyUpdateOptions) { o.Label = i.Label - return + return o } // ListSSHKeys lists SSHKeys diff --git a/profile_tokens.go b/profile_tokens.go index 958bedaec..0622ec1d3 100644 --- a/profile_tokens.go +++ b/profile_tokens.go @@ -77,13 +77,13 @@ func (i Token) GetCreateOptions() (o TokenCreateOptions) { o.Expiry = copyTime(i.Expiry) o.Scopes = i.Scopes - return + return o } // GetUpdateOptions converts a Token to TokenUpdateOptions for use in UpdateToken func (i Token) GetUpdateOptions() (o TokenUpdateOptions) { o.Label = i.Label - return + return o } // ListTokens lists Tokens diff --git a/regions_availability.go b/regions_availability.go index 4caefeb74..dcba07f75 100644 --- a/regions_availability.go +++ b/regions_availability.go @@ -4,7 +4,7 @@ import ( "context" ) -// Region represents a linode region object +// RegionAvailability represents a linode region object type RegionAvailability struct { Region string `json:"region"` Plan string `json:"plan"` diff --git a/retries.go b/retries.go index 8831b5200..047fed84e 100644 --- a/retries.go +++ b/retries.go @@ -18,10 +18,10 @@ const ( defaultRetryCount = 1000 ) -// type RetryConditional func(r *resty.Response) (shouldRetry bool) +// RetryConditional func(r *resty.Response) (shouldRetry bool) type RetryConditional resty.RetryConditionFunc -// type RetryAfter func(c *resty.Client, r *resty.Response) (time.Duration, error) +// RetryAfter func(c *resty.Client, r *resty.Response) (time.Duration, error) type RetryAfter resty.RetryAfterFunc // Configures resty to diff --git a/tags.go b/tags.go index 2d37ca219..e23ba2168 100644 --- a/tags.go +++ b/tags.go @@ -47,7 +47,7 @@ type TagCreateOptions struct { // GetCreateOptions converts a Tag to TagCreateOptions for use in CreateTag func (i Tag) GetCreateOptions() (o TagCreateOptions) { o.Label = i.Label - return + return o } // ListTags lists Tags diff --git a/test/integration/integration_suite_test.go b/test/integration/integration_suite_test.go index ae8a9fcd2..3ca0cb8a2 100644 --- a/test/integration/integration_suite_test.go +++ b/test/integration/integration_suite_test.go @@ -127,7 +127,7 @@ func testRecorder(t *testing.T, fixturesYaml string, testingMode recorder.Mode, recordStopper = func() { r.Stop() } - return + return r, recordStopper } // createTestClient is a testing helper to creates a linodego.Client initialized using diff --git a/volumes.go b/volumes.go index 70fe3da94..820b0f460 100644 --- a/volumes.go +++ b/volumes.go @@ -99,7 +99,7 @@ func (v Volume) GetUpdateOptions() (updateOpts VolumeUpdateOptions) { updateOpts.Label = v.Label updateOpts.Tags = &v.Tags - return + return updateOpts } // GetCreateOptions converts a Volume to VolumeCreateOptions for use in CreateVolume @@ -113,7 +113,7 @@ func (v Volume) GetCreateOptions() (createOpts VolumeCreateOptions) { createOpts.LinodeID = *v.LinodeID } - return + return createOpts } // ListVolumes lists Volumes