Skip to content

Commit

Permalink
docs: enable exported lint and fix docs (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn authored May 27, 2021
1 parent 9b14450 commit cdbb08e
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ linters-settings:
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
Expand Down
1 change: 1 addition & 0 deletions atmcfg/atmcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func newScramSha256Creds(user *opsmngr.MongoDBUser, password string) (*opsmngr.S
return scram256Creds, nil
}

// ErrUnsupportedMechanism means the provided mechanism wasn't valid.
var ErrUnsupportedMechanism = errors.New("unrecognized SCRAM-SHA format")

// newScramShaCreds takes a plain text password and a specified mechanism name and generates
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/automation_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (s *AutomationServiceOp) UpdateConfig(ctx context.Context, groupID string,

// AutomationConfig represents an Ops Manager project automation config.
//
// See more: https://docs.opsmanager.mongodb.com/current/reference/cluster-configuration/
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/automation-config-parameters/
type AutomationConfig struct {
AgentVersion *map[string]interface{} `json:"agentVersion,omitempty"`
AtlasProxies *[]interface{} `json:"atlasProxies,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/backup_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type BackupConfigsServiceOp service

var _ BackupConfigsService = &BackupConfigsServiceOp{}

// BackupConfigs represents a Backup configuration in the MongoDB Ops Manager API.
// BackupConfig represents a Backup configuration in the MongoDB Ops Manager API.
type BackupConfig struct {
GroupID string `json:"groupId,omitempty"`
ClusterID string `json:"clusterId,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/blockstore_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type BlockstoreConfigService interface {
Delete(context.Context, string) (*atlas.Response, error)
}

// BackupConfigsServiceOp provides an implementation of the BackupConfigsService interface.
// BlockstoreConfigServiceOp provides an implementation of the BlockstoreConfigService interface.
type BlockstoreConfigServiceOp service

var _ BlockstoreConfigService = &BlockstoreConfigServiceOp{}
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/daemon_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type DaemonConfigService interface {
Delete(context.Context, string) (*atlas.Response, error)
}

// BackupConfigsServiceOp provides an implementation of the BackupConfigsService interface.
// DaemonConfigServiceOp provides an implementation of the DaemonConfigService interface.
type DaemonConfigServiceOp service

var _ DaemonConfigService = &DaemonConfigServiceOp{}
Expand Down
4 changes: 2 additions & 2 deletions opsmngr/feature_control_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ type FeatureControlPoliciesService interface {
ListSupportedPolicies(context.Context, *atlas.ListOptions) (*FeaturePolicy, *atlas.Response, error)
}

// AgentsServiceOp provides an implementation of the AgentsService interface.
// FeatureControlPoliciesServiceOp provides an implementation of the FeatureControlPoliciesService interface.
type FeatureControlPoliciesServiceOp service

var _ FeatureControlPoliciesService = new(FeatureControlPoliciesServiceOp)

// Agent represents an Ops Manager agent.
// FeaturePolicy represents an Ops Manager feature policy.
type FeaturePolicy struct {
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions opsmngr/file_system_store_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const backupAdministratorFileSystemStoreConfigurationsBasePath = "admin/backup/snapshot/fileSystemConfigs"

// FileSystemStoreService is an interface for using the File System Store Configuration
// FileSystemStoreConfigService is an interface for using the File System Store Configuration
// endpoints of the MongoDB Ops Manager API.
//
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/file-system-store-config/
Expand All @@ -36,7 +36,7 @@ type FileSystemStoreConfigService interface {
Delete(context.Context, string) (*atlas.Response, error)
}

// BackupConfigsServiceOp provides an implementation of the BackupConfigsService interface.
// FileSystemStoreConfigServiceOp provides an implementation of the FileSystemStoreConfigService interface.
type FileSystemStoreConfigServiceOp service

var _ FileSystemStoreConfigService = &FileSystemStoreConfigServiceOp{}
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/oplog_store_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type OplogStoreConfigService interface {
Delete(context.Context, string) (*atlas.Response, error)
}

// BackupConfigsServiceOp provides an implementation of the BackupConfigsService interface.
// OplogStoreConfigServiceOp provides an implementation of the OplogStoreConfigService interface.
type OplogStoreConfigServiceOp service

var _ OplogStoreConfigService = &OplogStoreConfigServiceOp{}
Expand Down
6 changes: 4 additions & 2 deletions opsmngr/opsmngr.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ import (
)

const (
CloudURL = atlas.CloudURL
APIPublicV1Path = "api/public/v1.0/" // APIPublicV1Path specifies the v1 api path
// CloudURL specifies the public cloud base url.
CloudURL = atlas.CloudURL
// APIPublicV1Path specifies the v1 api path.
APIPublicV1Path = "api/public/v1.0/"
defaultBaseURL = CloudURL + APIPublicV1Path
userAgent = "go-ops-manager"
jsonMediaType = "application/json"
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/project_job_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ProjectJobConfigService interface {
Update(context.Context, string, *ProjectJob) (*ProjectJob, *atlas.Response, error)
}

// BackupConfigsServiceOp provides an implementation of the BackupConfigsService interface.
// ProjectJobConfigServiceOp provides an implementation of the ProjectJobConfigService interface.
type ProjectJobConfigServiceOp service

var _ ProjectJobConfigService = &ProjectJobConfigServiceOp{}
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/s3_blockstore_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const backupAdministratorS3BlockstoreBasePath = "admin/backup/snapshot/s3Configs"

// S3BlockstoreService is an interface for using the S3 Blockstore Service
// S3BlockstoreConfigService is an interface for using the S3 Blockstore Service
// endpoints of the MongoDB Ops Manager API.
//
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/s3-blockstore-config/
Expand Down
7 changes: 3 additions & 4 deletions opsmngr/server_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
// ServerUsageService is an interface for using the Server Usage Service
// endpoints of the MongoDB Ops Manager API.
//
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/s3-blockstore-config/
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/
type ServerUsageService interface {
GenerateDailyUsageSnapshot(context.Context) (*atlas.Response, error)
ListAllHostAssignment(context.Context, *ServerTypeOptions) (*HostAssignments, *atlas.Response, error)
Expand All @@ -49,15 +49,14 @@ type ServerUsageServiceOp service

var _ ServerUsageService = &ServerUsageServiceOp{}

// type ServerUsageReportService interface { is an interface for interfacing with the ServerUsage Report Service
// endpoints of the MongoDB Ops Manager API.
// ServerUsageReportService interface is an interface for downloading the service usage report.
//
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/create-one-report/
type ServerUsageReportService interface {
Download(context.Context, *ServerTypeOptions, io.Writer) (*atlas.Response, error)
}

// LogsServiceOp handles communication with the Log Collection Jobs download method of the
// ServerUsageReportServiceOp handles communication with the Log Collection Jobs download method of the
// MongoDB Ops Manager API.
type ServerUsageReportServiceOp struct {
Client atlas.GZipRequestDoer
Expand Down
2 changes: 1 addition & 1 deletion opsmngr/sync_store_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const backupAdministratorSyncBasePath = "admin/backup/sync/mongoConfigs"

// SyncService is an interface for using the Sync
// SyncStoreConfigService is an interface for using the Sync
// endpoints of the MongoDB Ops Manager API.
//
// See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/sync-store-config/
Expand Down

0 comments on commit cdbb08e

Please sign in to comment.