Documentation ¶
Index ¶
- Constants
- func DoDELETE(argURI string) ([]byte, error)
- func DoGET(argURI string) ([]byte, error)
- func DoPOST(argURI string, argPostBody []byte) ([]byte, error)
- func ValidateConfig(config ServiceConfiguration) error
- type AtlasBroker
- func (a AtlasBroker) Bind(ctx context.Context, instanceID, bindingID string, ...) (brokerapi.Binding, error)
- func (a AtlasBroker) Deprovision(ctx context.Context, instanceID string, details brokerapi.DeprovisionDetails, ...) (brokerapi.DeprovisionServiceSpec, error)
- func (a AtlasBroker) GetBinding(ctx context.Context, instanceID, bindingID string) (brokerapi.GetBindingSpec, error)
- func (a AtlasBroker) LastBindingOperation(ctx context.Context, instanceID, bindingID string, ...) (brokerapi.LastOperation, error)
- func (a AtlasBroker) LastOperation(ctx context.Context, instanceID string, details brokerapi.PollDetails) (brokerapi.LastOperation, error)
- func (a AtlasBroker) Provision(ctx context.Context, instanceID string, details brokerapi.ProvisionDetails, ...) (brokerapi.ProvisionedServiceSpec, error)
- func (a AtlasBroker) Services(ctx context.Context) ([]brokerapi.Service, error)
- func (a AtlasBroker) Unbind(ctx context.Context, instanceID, bindingID string, ...) (brokerapi.UnbindSpec, error)
- func (a AtlasBroker) Update(ctx context.Context, instanceID string, details brokerapi.UpdateDetails, ...) (brokerapi.UpdateServiceSpec, error)
- type AuthConfiguration
- type AutoScaling
- type BiConnector
- type BindRequest
- type BindResponse
- type Config
- type Dedicated
- type DeprovisionResponse
- type LastBindingOperationResponse
- type LastOperationResponse
- type Links
- type ProviderSettings
- type Provision
- type ProvisionResponse
- type Roles
- type ServiceConfiguration
- type UnbindResponse
Constants ¶
const ( OperationDeprovision = "deprovision" OperationProvision = "provision" OperationBind = "bind" OperationUnbind = "unbind" StateIDLE = "IDLE" StateCREATING = "CREATING" StateUPDATING = "UPDATING" StateDELETING = "DELETING" StateDELETED = "DELETED" StateREPAIRING = "REPAIRING" ErrorCode404 = "CLUSTER_NOT_FOUND" UserDatabaseStore = "admin" UserRoleDatabase = "admin" UserRoleName = "readWriteAnyDatabase" )
const
Variables ¶
This section is empty.
Functions ¶
func ValidateConfig ¶
func ValidateConfig(config ServiceConfiguration) error
Types ¶
type AtlasBroker ¶
type AtlasBroker struct { }
AtlasBroker - MongoDB Atlas Service Broker
func (AtlasBroker) Bind ¶
func (a AtlasBroker) Bind(ctx context.Context, instanceID, bindingID string, details brokerapi.BindDetails, asyncAllowed bool) (brokerapi.Binding, error)
Bind - MongoDB Atlas Broker - Creates a readWriteAnyDatabse user in the Atlas project
func (AtlasBroker) Deprovision ¶
func (a AtlasBroker) Deprovision(ctx context.Context, instanceID string, details brokerapi.DeprovisionDetails, asyncAllowed bool) (brokerapi.DeprovisionServiceSpec, error)
Deprovision - MongoDB Atlas Broker
func (AtlasBroker) GetBinding ¶
func (a AtlasBroker) GetBinding(ctx context.Context, instanceID, bindingID string) (brokerapi.GetBindingSpec, error)
GetBinding - MongoDB Atlas Broker
func (AtlasBroker) LastBindingOperation ¶
func (a AtlasBroker) LastBindingOperation(ctx context.Context, instanceID, bindingID string, details brokerapi.PollDetails) (brokerapi.LastOperation, error)
LastBindingOperation - MongoDB Atlas Broker
func (AtlasBroker) LastOperation ¶
func (a AtlasBroker) LastOperation(ctx context.Context, instanceID string, details brokerapi.PollDetails) (brokerapi.LastOperation, error)
LastOperation - MongoDB Atlas Broker
func (AtlasBroker) Provision ¶
func (a AtlasBroker) Provision(ctx context.Context, instanceID string, details brokerapi.ProvisionDetails, asyncAllowed bool) (brokerapi.ProvisionedServiceSpec, error)
Provision - MongoDB Atlas Broker
func (AtlasBroker) Unbind ¶
func (a AtlasBroker) Unbind(ctx context.Context, instanceID, bindingID string, details brokerapi.UnbindDetails, asyncAllowed bool) (brokerapi.UnbindSpec, error)
Unbind - MongoDB Atlas Broker
func (AtlasBroker) Update ¶
func (a AtlasBroker) Update(ctx context.Context, instanceID string, details brokerapi.UpdateDetails, asyncAllowed bool) (brokerapi.UpdateServiceSpec, error)
Update - MongoDB Atlas Broker --- TODO
type AuthConfiguration ¶
type AutoScaling ¶
type AutoScaling struct {
DiskGBEnabled bool `json:"diskGBEnabled"`
}
AutoScaling - Provision Setting
type BiConnector ¶
type BiConnector struct { Enabled bool `json:"enabled"` ReadPreference string `json:"readPreference"` }
BiConnector -
type BindRequest ¶
type BindRequest struct { DatabaseName string `json:"databaseName"` Password string `json:"password"` Roles []Roles `json:"roles"` Username string `json:"username"` DeleteAfterDate string `json:"deleteAfterDate,omitempty"` GroupID string `json:"groupId"` }
BindRequest struct - Bind Settings
type BindResponse ¶
type BindResponse struct { DatabaseName string `json:"databaseName"` DeleteAfterDate string `json:"deleteAfterDate,omitempty"` GroupID string `json:"groupId"` Links []Links `json:"links"` Roles []Roles `json:"roles"` Username string `json:"username"` }
BindResponse struct - Bind Settings
type Config ¶
type Config struct { AtlasConfiguration ServiceConfiguration `yaml:"atlas"` AuthConfiguration AuthConfiguration `yaml:"auth"` Host string `yaml:"backend_host"` Port string `yaml:"backend_port"` MonitExecutablePath string `yaml:"monit_executable_path"` AtlasServerExecutablePath string `yaml:"atlas_server_executable_path"` AgentPort string `yaml:"agent_port"` ConsistencyVerificationInterval int `yaml:"consistency_check_interval_seconds"` }
func ParseConfig ¶
func (*Config) DedicatedEnabled ¶
func (*Config) SharedEnabled ¶
type DeprovisionResponse ¶
type DeprovisionResponse struct { }
DeprovisionResponse struct
func TerminateCluster ¶
func TerminateCluster(instanceID string) (DeprovisionResponse, error)
TerminateCluster in MongoDB Atlas
type LastBindingOperationResponse ¶
type LastBindingOperationResponse struct { DatabaseName string `json:"databaseName"` DeleteAfterDate string `json:"deleteAfterDate,omitempty"` GroupID string `json:"groupId"` Links []Links `json:"links"` Roles []Roles `json:"roles"` Username string `json:"username"` }
LastBindingOperationResponse struct -- Gets a single databse user
type LastOperationResponse ¶
type LastOperationResponse struct { AutoScaling AutoScaling `json:"autoScaling,omitempty"` BackupEnabled bool `json:"backupEnabled,omitempty"` BiConnector BiConnector `json:"biConnector,omitempty"` ClusterType string `json:"clusterType,omitempty"` DiskSizeGB float32 `json:"diskSizeGB,omitempty"` EncryptionAtRestProvider string `json:"encryptionAtRestProvider,omitempty"` GroupID string `json:"groupId,omitempty"` MongoDBVersion string `json:"mongoDBVersion,omitempty"` MongoURI string `json:"mongoURI,omitempty,omitempty"` MongoURIUpdated string `json:"mongoURIUpdated,omitempty,omitempty"` MongoURIWithOptions string `json:"mongoURIWithOptions,omitempty"` Name string `json:"name,omitempty"` NumShards int `json:"numShards,omitempty"` Paused bool `json:"paused,omitempty"` ProviderSettings ProviderSettings `json:"providerSetting,omitemptys"` ReplicationFactor int `json:"replicationFactor,omitempty"` StateName string `json:"stateName"` // deal with error json response Detail string `json:"detail,omitempty"` Error int `json:"error,omitempty"` ErrorCode string `json:"errorCode"` Parameters []string `json:"parameters,omitempty"` Reason string `json:"reason,omitempty"` }
LastOperationResponse struct
func GetCluster ¶
func GetCluster(instanceID string) (LastOperationResponse, error)
GetCluster in MongoDB Atlas
type ProviderSettings ¶
type ProviderSettings struct { DiskIOPS int `json:"diskIOPS"` EncryptEBSVolume bool `json:"encryptEBSVolume"` InstanceSizeName string `json:"instanceSizeName"` ProviderName string `json:"providerName"` RegionName string `json:"regionName"` }
ProviderSettings - Provision Setting
type Provision ¶
type Provision struct { AutoScaling AutoScaling `json:"autoScaling"` BackupEnabled bool `json:"backupEnabled"` DiskSizeGB float32 `json:"diskSizeGB"` EncryptionAtRestProvider string `json:"encryptionAtRestProvider"` Name string `json:"name"` NumShards int `json:"numShards"` ReplicationFactor int `json:"replicationFactor"` ProviderSettings ProviderSettings `json:"providerSettings"` }
Provision Setting
type ProvisionResponse ¶
type ProvisionResponse struct { AutoScaling AutoScaling `json:"autoScaling,omitempty"` BackupEnabled bool `json:"backupEnabled,omitempty"` BiConnector BiConnector `json:"biConnector,omitempty"` ClusterType string `json:"clusterType,omitempty"` DiskSizeGB float32 `json:"diskSizeGB,omitempty"` EncryptionAtRestProvider string `json:"encryptionAtRestProvider,omitempty"` GroupID string `json:"groupId,omitempty"` ID string `json:"id,omitempty"` Links []Links `json:"links,omitempty"` MongoDBMajorVersion string `json:"mongoDBMajorVersion,omitempty"` MongoDBVersion string `json:"mongoDBVersion,omitempty"` MongoURI string `json:"mongoURI,omitempty"` MongoURIUpdated time.Time `json:"mongoURIUpdated,omitempty"` MongoURIWithOptions string `json:"mongoURIWithOptions,omitempty"` Name string `json:"name,omitempty"` NumShards int `json:"numShards,omitempty"` Paused bool `json:"paused,omitempty"` ProviderBackupEnabled bool `json:"providerBackupEnabled,omitempty"` ProviderSettings ProviderSettings `json:"providerSettings,omitempty"` ReplicationFactor int `json:"replicationFactor,omitempty"` StateName string `json:"stateName,omitempty"` // deal with error json response Detail string `json:"detail,omitempty"` Error int `json:"error,omitempty"` ErrorCode string `json:"errorCode"` Parameters []string `json:"parameters,omitempty"` Reason string `json:"reason,omitempty"` }
ProvisionResponse struct
func NewCluster ¶
func NewCluster(argPostBody []byte) (ProvisionResponse, error)
NewCluster in MongoDB Atlas
type Roles ¶
type Roles struct { CollectionName string `json:"collectionName,omitempty"` DatabaseName string `json:"databaseName"` RoleName string `json:"roleName"` }
Roles --
type ServiceConfiguration ¶
type ServiceConfiguration struct { ServiceName string `yaml:"service_name"` ServiceID string `yaml:"service_id"` DedicatedVMPlanID string `yaml:"dedicated_vm_plan_id"` Host string `yaml:"host"` DefaultConfigPath string `yaml:"atlas_conf_path"` ProcessCheckIntervalSeconds int `yaml:"process_check_interval"` StartAtlasTimeoutSeconds int `yaml:"start_atlas_timeout"` InstanceDataDirectory string `yaml:"data_directory"` PidfileDirectory string `yaml:"pidfile_directory"` InstanceLogDirectory string `yaml:"log_directory"` ServiceInstanceLimit int `yaml:"service_instance_limit"` Dedicated Dedicated `yaml:"dedicated"` Description string `yaml:"description"` LongDescription string `yaml:"long_description"` ProviderDisplayName string `yaml:"provider_display_name"` DocumentationURL string `yaml:"documentation_url"` SupportURL string `yaml:"support_url"` DisplayName string `yaml:"display_name"` IconImage string `yaml:"icon_image"` }
type UnbindResponse ¶
type UnbindResponse struct { }
UnbindResponse struct
func DeleteUser ¶
func DeleteUser(instanceID string, bindingID string) (UnbindResponse, error)
DeleteUser in MongoDB Atlas