Documentation ¶
Overview ¶
Copyright 2023 MongoDB Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 MongoDB Inc ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 MongoDB Inc ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func LocalDeploymentName(hostname string) string
- func ValidateConnectWith(s string) error
- func ValidateDeploymentName(n string) error
- type ConnectOpts
- type ConnectToAtlasOpts
- type Deployment
- type DeploymentOpts
- func (opts *DeploymentOpts) AtlasDeployments(projectID string) ([]Deployment, error)
- func (opts *DeploymentOpts) CheckIfDeploymentExists(ctx context.Context) error
- func (opts *DeploymentOpts) ConnectionString(ctx context.Context) (string, error)
- func (opts *DeploymentOpts) DetectLocalDeploymentName(ctx context.Context) error
- func (opts *DeploymentOpts) GetLocalDeployments(ctx context.Context) ([]Deployment, error)
- func (opts *DeploymentOpts) InitStore(ctx context.Context, writer io.Writer) func() error
- func (*DeploymentOpts) InternalMongotAddress(ip string) string
- func (opts *DeploymentOpts) IsAtlasDeploymentType() bool
- func (opts *DeploymentOpts) IsAuthEnabled() bool
- func (opts *DeploymentOpts) IsCliAuthenticated() bool
- func (opts *DeploymentOpts) IsLocalDeploymentType() bool
- func (opts *DeploymentOpts) LocalCheckHostname() string
- func (opts *DeploymentOpts) LocalDeploymentPreRun(ctx context.Context) error
- func (opts *DeploymentOpts) LocalMongoMetricsVolume() string
- func (opts *DeploymentOpts) LocalMongodDataVolume() string
- func (opts *DeploymentOpts) LocalMongodHostname() string
- func (opts *DeploymentOpts) LocalMongotDataVolume() string
- func (opts *DeploymentOpts) LocalMongotHostname() string
- func (opts *DeploymentOpts) LocalNetworkName() string
- func (opts *DeploymentOpts) MongodDockerImageName() string
- func (opts *DeploymentOpts) MongotIP(ctx context.Context) (string, error)
- func (opts *DeploymentOpts) NoDeploymentTypeSet() bool
- func (opts *DeploymentOpts) PostRunMessages() error
- func (opts *DeploymentOpts) PromptConnectWith() (string, error)
- func (opts *DeploymentOpts) RemoveLocal(ctx context.Context) error
- func (opts *DeploymentOpts) Select(deployments []Deployment) (Deployment, error)
- func (opts *DeploymentOpts) SelectDeployments(ctx context.Context, projectID string) (Deployment, error)
- func (opts *DeploymentOpts) SelectLocal(ctx context.Context) error
- func (opts *DeploymentOpts) StartSpinner()
- func (opts *DeploymentOpts) StopSpinner()
- func (opts *DeploymentOpts) ValidateAndPromptDeploymentType() error
- func (opts *DeploymentOpts) WaitForMongot(parentCtx context.Context, ip string) error
Constants ¶
const ( MongodHostnamePrefix = "mongod" MongotHostnamePrefix = "mongot" CheckHostnamePrefix = "check" MongotDockerImageName = "docker.io/mongodb/mongodb-atlas-search:preview" PausedState = "PAUSED" StoppedState = "STOPPED" IdleState = "IDLE" DeletingState = "DELETING" RestartingState = "RESTARTING" LocalCluster = "local" AtlasCluster = "atlas" CompassConnect = "compass" MongoshConnect = "mongosh" PromptTypeMessage = "What type of deployment would you like to work with?" MaxItemsPerPage = 500 )
const ( ConnectWithConnectionString = "connectionString" ConnectWithMongosh = "mongosh" ConnectWithCompass = "compass" )
Variables ¶
var ( ErrNotAuthenticated = errors.New("you are not authenticated. Please, run atlas auth login") ErrCompassNotInstalled = errors.New("did not find MongoDB Compass, install: https://dochub.mongodb.org/core/install-compass") ErrMongoshNotInstalled = errors.New("did not find mongosh, install: https://dochub.mongodb.org/core/install-mongosh") DeploymentTypeOptions = []string{LocalCluster, AtlasCluster} )
var ( ErrInvalidConnectWith = errors.New("invalid --connectWith option") ConnectWithOptions = []string{ConnectWithMongosh, ConnectWithCompass, ConnectWithConnectionString} )
var (
ConnectionStringTypeStandard = "standard"
)
var ErrDeploymentNotFound = errors.New("deployment not found")
Functions ¶
func LocalDeploymentName ¶
func ValidateConnectWith ¶
func ValidateDeploymentName ¶
Types ¶
type ConnectOpts ¶
type ConnectOpts struct { cli.OutputOpts DeploymentOpts ConnectWith string ConnectToAtlasOpts }
type ConnectToAtlasOpts ¶
type ConnectToAtlasOpts struct { cli.GlobalOpts cli.InputOpts ConnectionStringType string Store store.AtlasClusterDescriber }
func (*ConnectToAtlasOpts) InitAtlasStore ¶
func (opts *ConnectToAtlasOpts) InitAtlasStore(ctx context.Context) func() error
type Deployment ¶
type DeploymentOpts ¶
type DeploymentOpts struct { DeploymentName string DeploymentType string MdbVersion string Port int DBUsername string DBUserPassword string PodmanClient podman.Client CredStore store.CredentialsGetter DefaultSetter cli.DefaultSetterOpts AtlasClusterListStore store.ClusterLister Config setup.ProfileReader // contains filtered or unexported fields }
func (*DeploymentOpts) AtlasDeployments ¶
func (opts *DeploymentOpts) AtlasDeployments(projectID string) ([]Deployment, error)
func (*DeploymentOpts) CheckIfDeploymentExists ¶
func (opts *DeploymentOpts) CheckIfDeploymentExists(ctx context.Context) error
func (*DeploymentOpts) ConnectionString ¶
func (opts *DeploymentOpts) ConnectionString(ctx context.Context) (string, error)
func (*DeploymentOpts) DetectLocalDeploymentName ¶
func (opts *DeploymentOpts) DetectLocalDeploymentName(ctx context.Context) error
func (*DeploymentOpts) GetLocalDeployments ¶
func (opts *DeploymentOpts) GetLocalDeployments(ctx context.Context) ([]Deployment, error)
func (*DeploymentOpts) InternalMongotAddress ¶
func (*DeploymentOpts) InternalMongotAddress(ip string) string
func (*DeploymentOpts) IsAtlasDeploymentType ¶
func (opts *DeploymentOpts) IsAtlasDeploymentType() bool
func (*DeploymentOpts) IsAuthEnabled ¶
func (opts *DeploymentOpts) IsAuthEnabled() bool
func (*DeploymentOpts) IsCliAuthenticated ¶
func (opts *DeploymentOpts) IsCliAuthenticated() bool
func (*DeploymentOpts) IsLocalDeploymentType ¶
func (opts *DeploymentOpts) IsLocalDeploymentType() bool
func (*DeploymentOpts) LocalCheckHostname ¶
func (opts *DeploymentOpts) LocalCheckHostname() string
func (*DeploymentOpts) LocalDeploymentPreRun ¶
func (opts *DeploymentOpts) LocalDeploymentPreRun(ctx context.Context) error
func (*DeploymentOpts) LocalMongoMetricsVolume ¶
func (opts *DeploymentOpts) LocalMongoMetricsVolume() string
func (*DeploymentOpts) LocalMongodDataVolume ¶
func (opts *DeploymentOpts) LocalMongodDataVolume() string
func (*DeploymentOpts) LocalMongodHostname ¶
func (opts *DeploymentOpts) LocalMongodHostname() string
func (*DeploymentOpts) LocalMongotDataVolume ¶
func (opts *DeploymentOpts) LocalMongotDataVolume() string
func (*DeploymentOpts) LocalMongotHostname ¶
func (opts *DeploymentOpts) LocalMongotHostname() string
func (*DeploymentOpts) LocalNetworkName ¶
func (opts *DeploymentOpts) LocalNetworkName() string
func (*DeploymentOpts) MongodDockerImageName ¶
func (opts *DeploymentOpts) MongodDockerImageName() string
func (*DeploymentOpts) MongotIP ¶
func (opts *DeploymentOpts) MongotIP(ctx context.Context) (string, error)
func (*DeploymentOpts) NoDeploymentTypeSet ¶
func (opts *DeploymentOpts) NoDeploymentTypeSet() bool
func (*DeploymentOpts) PostRunMessages ¶
func (opts *DeploymentOpts) PostRunMessages() error
func (*DeploymentOpts) PromptConnectWith ¶
func (opts *DeploymentOpts) PromptConnectWith() (string, error)
func (*DeploymentOpts) RemoveLocal ¶
func (opts *DeploymentOpts) RemoveLocal(ctx context.Context) error
func (*DeploymentOpts) Select ¶
func (opts *DeploymentOpts) Select(deployments []Deployment) (Deployment, error)
func (*DeploymentOpts) SelectDeployments ¶
func (opts *DeploymentOpts) SelectDeployments(ctx context.Context, projectID string) (Deployment, error)
func (*DeploymentOpts) SelectLocal ¶
func (opts *DeploymentOpts) SelectLocal(ctx context.Context) error
func (*DeploymentOpts) StartSpinner ¶
func (opts *DeploymentOpts) StartSpinner()
func (*DeploymentOpts) StopSpinner ¶
func (opts *DeploymentOpts) StopSpinner()
func (*DeploymentOpts) ValidateAndPromptDeploymentType ¶
func (opts *DeploymentOpts) ValidateAndPromptDeploymentType() error
func (*DeploymentOpts) WaitForMongot ¶
func (opts *DeploymentOpts) WaitForMongot(parentCtx context.Context, ip string) error